4Js Genero Web Mysteries solved 

Genero Installation for using the WEB

This is easy!

7/31/2008 Tim Ertl

This is such an EASY process "IF" you already know how to do it. Nobody wrote it down! You always have to call 4Js support.

For years now one problem has plagued 4Js, Documentation. They have some very pretty user stuff BUT they lack coherent installation information in some of their products. This site is to document the Genero Installation for using the WEB. I have had very good experiance with the both the european and American support teams. Both have VERY good staff. I hate to pester them every time I need something that should be in the documentation. One common problem with ALL Support groups is that once they have done it they forget what it took for them to understand it. This is not a 4Js thing, it is a human thing. I have made documentation suggestions over the years to the USA support and to the Genero Developers private email list. None seem to have ever made it to the releases available in 2008. So I made my own documentation. It will deteriorate over the years but the basic tribulations that occur from release to release are NOT what I am documenting here. This attempts to cover what needs to be done in general with at least version 1.33, 2.01 and 2.11. Thought the exact details may change the process is the same. So look at the docs for your release and you should be able to ge through this easily.
 
Why am I doing this? Because each time I do it I always waste a bunch of time attempting to remember the details and Where to start first!

My examples and information are based on having the database server on one machine (in my case Sun Solaris) and the Web Server on another machine (linux AMP).
You should have a firewall or dmz in the middle. Although you may have a Windows database server the basic structure of the installation is the same. Just substitute "Administrator" for "root" and you should get the point. Dual servers is a pretty typical installation of software based on a survey of users I met at the IIUG conference in April 2008.

First off, what do you need in order to get a genero.42r application to expose itself to the web? This was clear as mud.
You need SEVERAL packages and you need to take parts from one and insert into another. Something 4Js does not document in any single place. Genero uses a transport called a GAS "Genero Application Server". It has two parts, one for the Web server the other for the Database server. THAT IS NOT ALL! you need a client or clients to be exposed via the Application Server. THEN you will need to take peice(s) from the Web server and put it in files on the Database server.  Then you need to configure the client to access one of your applications. Clear? Well  let me break it down into instructions on how to do an install.

DOWNLOADS:
Sooo You need to put software on the Database server and some more software on the Web server. If your not sure of downloading do not be surprised. Call you're 4js support group for help on downloads.
  1. Download to your desktop a copy of the FGL GDC (Desk top client) docs as well as the FGLGAS docs. Have them handy before you proceed.
  2. On the Database server you need GAS! down load from 4js the GAS package you need for your Database server hardware & OS platform. In my case I used the Solaris Sparc version.  Put this in the /tmp folder on the database server.
  3. On the Web server you need GAS! Yes you need another version of GAS unless you have the same platform type for both. You will need to download the GAS for the platform your web server is running. Put this in the /tmp folder of the Web server.
  4. YES YOU NEED MORE THAN ONE COPY OF THIS INSTALLER one for each system type (web server and Database server).
  5. On the Web server you will also need a client. I started with the Genero Desk top Client for ASP called GDCAX. Again you need to download the version for your web servers platform. Put this in the /tmp folder of the Web server.
INSTALLS:
  1. On the database server (assuming unix) you just "sh ./fjs-gas.........run -i" and follow the instructions for the database server. I NEVER use the suggested directory since in the future you can not do an upgrade to another release. I put it in /informix/gas2.11 .
  2. On the Web server I did the GAS first. usa support suggested to (as root) create a directory under the Web servers cgi-bin/gas2.11 and I gave ownership to "informix". Then as Informix do the install "sh ./fjs-gas.....run -i" and follow the directions for the "Web server" putting it into the cgi-bin/gas2.11 directory.
  3. On the Web server as root I created another folder in the htdocs folder called gdcax2.11 and gave ownership to informix. Then as Informix is did the "sh fjs-gdcax.......run -i" and place its output in the htdocs/gdcax2.11 folder.
NOT DONE YET!
  1. On the web server in the htdocs/gdcax2.11 folder you will find a file called "fglfdcdefault.js". Apaprently the install program was not smart enough to set it up for you so you will need to modify it and parse out the data you will need to insert into the html document. Line 14 starts with a "innerStr+=" and points to '/fjs/activex/gdc.cab#version='. Change it to: 'gdc2.11/fjs/activex/gdc.cab#version'. All we did was add the pathname to find the file gdc.cab in its proper location (so we can upgrade later without destroying the old one).
  2. If you can figure out how to do the Java you will get:
    1. <OBJECT NAME="gdc"
      1. Id="DesktopClient" 
      2. CLASSID="clsid:2311DF65-9D1A-4dda-94AA-90568D989633" 
      3. CODEBASE="/gdcax2.11/fjs/activex/gdc.cab#version=1,32,1,5"
      4. height=440
      5. width=395> 
      6. [Object not available! Did you forget to build and register the server?] 
    2. </OBJECT>
  3. On the DATABASE SERVER in the gas2.11/tpl directory you can add the above lines into the HTML script called fglgdcdefault.html.
FIRST TEST
Now that you have completed the installation it is time to test.

Go to the gas2.11 Database Server directory (/informix/gas2.11 ) and type . ./envas ,then type, ./bin/gasd  and it should start up the gasd server/service.

https://your.webserver.com/cgi-bin/gas2.11/fglccgi/wa/r/gdc-demo

Should show you the GDC with no shortcuts displayed.
If it does not check to make sure the installation has all the sub-directories and that the html script has the OBJECT in a good place.

NOW I want to give the cutomer access to my Already written applications. (see below this security warning)
DO NOT DO IT!
GIVE this A LOT of thought before proceeding. So far we have no security! Let anyone into your database? I think not!

First think I did was put the whole project on a ssl (https) server. At least then what goes on in these session is a little harder to view. Banks use ssl as does paypal and other sites.

SSL Alone is not security, in my case rather than let the users pick from the GDC start menu (gdc short cuts) I allow them access to only ONE application. "LOGIN". This app has a "WEBSECURITY" table on the database server to which I validate the entrance of a new user.



As you can see from the menu bar this little utility has reports and programs that can be call AFTER the user is authorized AND if that user has (also in the websecurity table) permission to access the specific application.

I am not done there! In addition, all the applications (that were already written and in use by internal customers) were modified so that IF the user was from the web I would log the activity AND I also restrict the user to their part of the data contained in the database. For instance User "websusan" can only access the data for vendor 101 and Not any of the data for other vendors. The internal users can use the same program but have access to all the vendors since they deal with all of them.

ALL I am saying is that you should think this all the way through and not stop at the .htaccess type permissions.

Enough of my bable about security.
How do I expose an application to the WEB!
In my case I only exposed one login application and let it call the other applications (fglrun commands from the login app).

On the Database Server in the GAS etc (gdc2.11/etc in my examples) there is a file called "as.xcf". Somewhat xml looking file. You should look at the GAS documentation under GAS configuration Reference  to see the terms. AND I HIGHLY recommend you remove things you are not planning to use for hacker proofing. To ADD a new app there are really only three  things you need to do.
  1. Fill out the Load Library Path. A frequent problem with all the packages in 2.11 is that they added a new database driver and the packages do not have the path to them in the default path (see genero BDL "envcomp". You need to add the path to yor genero dbdrivers directory. It is found inside the genero directoy. Just a minor bug in this release of genero. Now we need to add that to our GAS since it was forgotten there as well. Another bug.
    1. From: <RESOURCE Id="res.ldlibrarypath" Source="INTERNAL">/informix/genero
      /lib:/informix/genero/bin</RESOURCE>
    2. TO: <RESOURCE Id="res.ldlibrarypath" Source="INTERNAL">/informix/genero
      /lib:/informix/genero/bin:/informix/genero/dbdrivers</RESOURCE>
  2. add a RESOURCE that points at where your executable is. Put it in the part of the file that has the other resource lines.
    1. <RESOURCE Id="res.path.ltl" Source="INTERNAL">/genbin/login</RESOURCE>
    2. /genbin/login is the directory that me login.42r program exists in.
  3. In the same file add a <APPLICATION. I put it right where the gdc-demo app was.
    1.       <APPLICATION Id="login" Parent="defaultgdc">
              <EXECUTION>
                <PATH>$(res.path.ltl)</PATH>
                <MODULE>login.42r</MODULE>
              </EXECUTION>
            </APPLICATION>
Now your ready to test your application! Very similar to the test of the demo you will have:
https://your.webserver.com/cgi-bin/gas2.11/fglccgi/wa/r/login  where the name "login" comes from the APPLICATION Id="login".

When making changes I have found it necessary sometimes to stop and restart the gasd daemon/service.


That is it. VERY IMPORTANT. CLEAN UP! Remove applications you do not plan to use. There are those out there will to hack!

TIPS: problems I do to myself because I am smart :-) Not good things but I needed to fix them. Genero needs to have consistent paths to itself or it will detect an error and not let you in.
ERROR(-6053):Installation path has changed.
It must hold the original installation path.
Means that you had a different $FGLDIR when you added the license than the one you are using now. You CAN use links but you must use the same name everywhere. Even in the as.xcf.

DISCLAIMER: I have tried my best to reduce the information here to show how simple it is to do this install. I make no claims as to how it will work for you. I have done this a few times now and I still have to work at it to figure out what to do and how or where to get started. This was intended as a guide not a reference.