Configuring the Genero Application Server / Configuring applications on GAS |
An application configuration file provides the Genero Application Server (GAS) with the information needed to run an application. It becomes available for use as soon as created and when added to a recognized group directory.
Once you have created an application, you need to configure it so that it can be executed by the GAS. For this you need to create an application configuration file. Typically, the name of the file matches the name of the application and has an xcf suffix. For example, if the application name was "app1", create a configuration file named app1.xcf.
Save the file in a defined GROUP directory. By default, the directory where the GAS searches for external application configuration files is defined in the GAS configuration file (default as.xcf) by the tag <GROUP Id="_default">directory</GROUP>. You can specify alternate directories; see GROUP (for an application) or GROUP (for a service).
The configuration file defines an application environment, and starts with the Application element. Within this element, you can define local resources, change the execution environment, the timeout settings, the image, and output settings. You can refer to previously defined components by using the tag attribute Using.
The organization of the elements within the application configuration file depend on the type of application. See Application configuration files.
These examples show some well-formed external application configuration files.
The simplest application configuration file specifies a parent application and the path to the compiled application files. The application inherits the configuration of the parent application. The file is named appname.xcf, where appname is the name of the application.
<APPLICATION Parent="defaultgwc"> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.4js.com/ns/gas/3.00/cfextwa.xsd"> <EXECUTION> <PATH>$(res.path.fgldir.demo)/Widgets</PATH> </EXECUTION> </APPLICATION>
In this example, the external application configuration file Edit.xcf provides a configuration for the Edit application. Things to note:
While an application inherits its base configuration from the parent application, additional configuration elements can be added and existing configuration elements can be overwritten.
This example configuration file is for a GWC-JS Web application.
<APPLICATION Parent="defaultgwc"> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.4js.com/ns/gas/3.00/cfextwa.xsd"> <EXECUTION> <PATH>$(res.path.fgldir.demo)/Widgets</PATH> </EXECUTION> <!-- Override the default gwc-js with gwc-js-custom--> <UA_OUTPUT> <PROXY>$(res.uaproxy.cmd)</PROXY> <PUBLIC_IMAGEPATH>$(res.public.resources)</PUBLIC_IMAGEPATH> <GWC-JS>gwc-js-custom</GWC-JS> <TIMEOUT> Using="cpn.wa.timeout"</TIMEOUT> </UA_OUTPUT> </APPLICATION>
<APPLICATION Parent="demo-tut-abstract"> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.4js.com/ns/gas/3.00/cfextwa.xsd"> <!-- Define a resource to the template HTML file --> <RESOURCE Id="res.template.tutorial" Source="INTERNAL">$(res.path.demo.dem-tut)/web/tutorial/tutorialStep1.html </RESOURCE> <EXECUTION> <PATH>$(res.path.demo.dem-tut)/src</PATH> <MODULE>tutStep1.42r</MODULE> </EXECUTION> <!-- Override default rendering template --> <OUTPUT> <MAP Id="DUA_HTML5"> <THEME> <TEMPLATE Id="_default">$(res.template.tutorial)</TEMPLATE> </THEME> <OUTPUT> </APPLICATION>