Back to Contents


Adding Applications

This section will help you to set up an application rapidly. For complete details on possible configuration parameters and settings, see Application List Reference.

Topics


Application Configuration Overview

When you configure an application, there are many pieces of information that must be provided to the Genero Application Server. However, much of this information is common across a set of applications. Therefore, rather than have you provide all the information each time you configure an application, Genero supports the concept of inheritance. You define abstract applications to hold the basic information that is common across your applications, and then you configure your application to inherit the settings of the abstract application. There is no limit to the levels of inheritance: an application can inherit from another application (abstract or not) that inherits from another application, and so on. To inherit a default configuration from another application, you specify it as the parent of the application.

In general, an abstract application is defined first. This abstract application is not executable, but is intended to provide the baseline default configuration for other applications to inherit. You can create as many abstract applications as you require, and abstract applications can inherit a default configuration from another abstract application.

When configuring an application that is to be an executable, you can provide the configuration details in either the Genero Application Server configuration file, or you can create a separate application-specific configuration file, known as an external application configuration file. If you add the application to the Genero Application Server configuration file, you must stop and restart the Genero Application Server for the application to be recognized. If you create an external application configuration file, you can add the file into a defined GROUP directory and  the application is immediately available without having to do a GAS restart.

See also:

Back to the top


Creating Abstract Applications

To simplify application configuration, an application can specify a parent application to provides default configuration settings needed to run the application. An abstract application is an application that is created not as an executable, but to be a parent providing configuration defaults for executable applications. You should create your own abstract application and use it as the parent for a set of programs that share common configurations.

Tip: If you use this inheritance mechanism efficiently, you can configure new applications with only a few entries in a configuration file.

To specify an abstract application, set the Abstract attribute to TRUE.

Warning: Abstract applications can only be defined in the application server configuration file, they cannot be defined in an external application configuration file.

Example for web applications:

01 <APPLICATION Id="defaultwa" Abstract="TRUE">
02   <EXECUTION Using="cpn.wa.execution.local"/>
03   <OUTPUT>
04     <MAP Id="DUA_GWC" Allowed="FALSE"/>
05     <MAP Id="DUA_GJC" Allowed="FALSE"/>
06     <MAP Id="DUA_GDC" Allowed="FALSE"/>
07   </OUTPUT>
08 </APPLICATION>
In this example, DUA_GWC, DUA_GJC and DUA_GDC are OutputMap, which indicates the Front End used to display the application. Note that no OutputMap is enabled as the attribute Allowed is set to FALSE.

Example for a GWC application:

01 <!--This is the default application for GWC-->
02 <APPLICATION Id="defaultgwc" Parent="defaultwa" Abstract="TRUE">
03  <TIMEOUT Using="cpn.gwc.timeout.set1"/>
04  <PICTURE Using="cpn.gwc.picture"/>
05  <OUTPUT Rule="UseGWC">
06   <MAP Id="DUA_Symbol-WC" Allowed="TRUE">
07    <RENDERING Using="cpn.rendering.xslt"/>
08    <THEME Using="cpn.theme.default.gwc">
09     <TEMPLATE Id="_default">$(res.theme.symbol-wc.stylesheet)</TEMPLATE>
10    </THEME>
11   </MAP>
12   <MAP Id="DUA_GWC" Allowed="TRUE">
13    <RENDERING Using="cpn.rendering.gwc"/>
14    <THEME Using="cpn.theme.default.gwc"/>
15   </MAP>
16   <MAP Id="DUA_AJAX" Allowed="TRUE">
17    <RENDERING Using="cpn.rendering.gwc2" />
18    <THEME Using="cpn.theme.ajax.gwc" />
19   </MAP>
20   <MAP Id="DUA_PAGE" Allowed="TRUE">
21    <RENDERING Using="cpn.rendering.gwc2" />
22    <THEME Using="cpn.theme.page.gwc" />
23   </MAP>
24   <MAP Id="DUA_PDA" Allowed="TRUE">
25    <RENDERING Using="cpn.rendering.gwc2" />
26    <THEME Using="cpn.theme.pda.gwc" />
27   </MAP>
28  </OUTPUT>
29 </APPLICATION>

Back to the top


Configuring applications for Genero Web Client (GWC)

To add an application for GWC, you only need to specify:
In the following example the path is a resource; this can also be an absolute path to your application files.

Example:

01 <APPLICATION Id="demo" Parent="defaultgwc">
02   <EXECUTION>
03     <PATH>$(res.path.fgldir.demo)</PATH>
04    <MODULE>demo.42r</MODULE>
05   </EXECUTION>
06 </APPLICATION>
defaultgwc is the parent of any web application for GWC.

Example:

01 <APPLICATION Id="defaultgwc" Parent="defaultwa" Abstract="TRUE">
02   <TIMEOUT Using="cpn.gwc.timeout.set1"/>
03   <PICTURE Using="cpn.picture.webserver"/>
04   <OUTPUT Rule="UseGWC">
05     <MAP Id="DUA_GWC" Allowed="TRUE">
06       <THEME Using="cpn.theme.default.gwc"/>
07     </MAP>
08   </OUTPUT>
09 </APPLICATION>
The defaultgwc application inherits from the defaultwa application. In the Abstract application section, defaultwa is the parent for any web application and no OutputMap is enabled; defaultgwc just enables DUA_GWC OutputMap and specifies the environment for this OutputMap.

Back to the top


Using External Application Configuration Files

To configure an application using an external application configuration file, you provide the same code that you would for adding an application directly to the Genero Application Server configuration file, except that you store this information in a file whose name matches that of the application.  For example, to create a file for a program named demo, you would create an external application configuration file with the name demo.xcf.  You must use the .xcf suffix. You then place this file in a group directory as configured in the Genero Application Server configuration file.

Creating a Group

A group consists of a group name and a directory in which external application configuration files can be placed. When a front-end starts an application whose configuration information is in an external application configuration file, it must provide the group name to direct the Genero Application Server to the directory where the file resides, and the application name to identify which file to read. As with applications, a group is specified in the APPLICATION_LIST component of the Genero Application Server configuration file.

Syntax:

  <GROUP Id="groupId" > path </GROUP>

Notes:

  1. groupId is the alias
  2. path is the physical path to the directory

Example:

01 <GROUP Id="_default">$(res.path.app)</GROUP>
02 <GROUP Id="gwc-demo">$(res.path.app)/tutorial/gwc-demo</GROUP>

Configuring an External Application

Create a separate .xcf file for each application. Because the application and configuration file share the same name, there is no need to specify the Id attribute. In the following example, if the file was named "demo.xcf", then this configuration file would accomplish the same task as when included in the Genero Application Server configuration file; the only difference between this example and the example shown above is the lack of the Id attribute.

Example:

01 <APPLICATION Parent="defaultgwc">
02   <EXECUTION>
03     <PATH>$(res.path.fgldir.demo)</PATH>
04    <MODULE>demo.42r</MODULE>
05   </EXECUTION>
06 </APPLICATION>

Back to the top


What if the application doesn't start?

When you request an application, if it does not start, then chances are there is something wrong in the configuration. Some suggestions:

When you receive the "Error: Runtime error. Try again ..." page

Your application cannot start. Check your application configuration. 

Usually, the path to your program is not the correct one.

Back to the top