Back to Contents


Genero Web Client Application Directory Structure


When developing and testing applications with the Genero Web Client, you typically conduct all your development using the Genero Application Server and not the Web server.  For production, when including the Web server, certain files need to be relocated to the Web server host.

For a list of the files and directories created during installation, see the Installation - Directory and Files help topic.


Development Application Directory Structure

For any Genero application, you have to manage multiple files: source code files, their compiled versions, and other files associated with the DVM (.4ad, .4st, and so on). When you display a Genero application using the Genero Web Client, additional files must be managed: templates, snippets, CSS, and JavaScript files.

Four J's recommends that you organize the directory to represent a small local web site, as shown in the example below.

Example

This example provides a simple directory structure for organizing files for a single application. The directory structure and organization can get more complex when you are managing several modules or applications and/or a larger web site, especially when you re-use files across applications.

You should then define an ALIAS that points to the root directory of the local application Web site, as shown in the example below.

Example

<INTERFACE_TO_CONNECTOR>
   ... 
   <DOCUMENT_ROOT>$(res.path.docroot)</DOCUMENT_ROOT>
   <ALIAS Id="/mysite">/myApp/web</ALIAS>
   ...
</INTERFACE_TO_CONNECTOR>

In this example, the alias "/mysite" enables access to the files stored in the directory "/myApp/web/". Using the alias, you can connect to the local web site using the URI http://<app_server>:6394/mysite/page.html, where page.html is in the myApp/web directory.

For deployment, you can copy the entire web site to your Web server, or set a special directory to gather the modified templates. This makes the template configuration in the as.xcf easier.

To avoid breaking links, build the web site with absolute paths. For example, specify "/mysite/img/pic.png" not "../img/pic.png".

Back to the top


Where to Place Files for Production

When it is time to put your application in production, you will introduce the Web server to your solution and may want to move some of the files to the Web server. It is not necessary to move the files to the Web server, however. In fact, Four J's recommends you keep all files on the application server and move them to the Web server only if performance issues arise.

Topics

Files that can exist on either the application server or the Web server

The following files can exist on either the application server or the Web server:

Note: Template and snippet files must be located on the application server, as they are used to create the XML (xHTML) file that is passed to the browser.

Keeping files on the application server

If you plan to leave the files on the application server only, you should not have to do any alterations to the existing files with the possible exception of the template files. In order for a Web server to access files stored on the application server, $(connector.uri) must be used in front of the directory path for the files listed above. At runtime, $(connector.uri) is replaced by:

To summarize, $(connector.uri) is required to retrieve documents sitting on the application server when going through a Web server.

Moving files to the Web server

When moving files from the application server to the Web server, you must:

Locating Files on both the Application Server and the Web Server

If you wish to allow access from both the Web server or the application server simultaneously, you should:

By removing the $(connector.uri), as long as the files exist on both the application server and the Web server, you can access the files regardless of the connection type used.

Tips:

Back to the top