Back to Contents | GAS Configuration File Overview
Resources allow you to create resources, or variables, for use within the configuration files and templates. Resources can be defined in the general RESOURCE_LIST element or within individual application or Web service configurations.
The RESOURCE_LIST element of the Genero Application Server configuration file allows you to define RESOURCE elements, which can then be referenced in your configuration files and template files. A resource is a kind of variable that can be used in the configuration files and in template files. By defining and using resources, when the value of the resource needs updating, it becomes possible to modify the resource in one location - within the RESOURCE_LIST - and the new value is carried through the various components that reference the resource.
A resource is defined as platform-independent or platform-dependent, based on the section in which the resource is defined.
<RESOURCE_LIST> <PLATFORM_INDEPENDENT> [ resource] [...] </PLATFORM_INDEPENDENT> [ <WNT> resource [...] </WNT> ] [ <UNX> resource [...] </UNX> ] </RESOURCE_LIST>
The RESOURCE_LIST element may contain the following child elements:
<RESOURCE_LIST> <PLATFORM_INDEPENDENT> <RESOURCE Id="res.fglgui" Source="INTERNAL">1</RESOURCE> ... </PLATFORM_INDEPENDENT> <WNT> <RESOURCE Id="res.dvm.wa" Source="INTERNAL">$(res.fgldir)\bin\fglrun.exe</RESOURCE> ... </WNT> <UNX> <RESOURCE Id="res.dvm.wa" Source="INTERNAL">$(res.fgldir)/bin/fglrun.exe</RESOURCE> ... </UNX> </RESOURCE_LIST>
For more information on defining a resource, refer to the RESOURCE section below.
The PLATFORM_INDEPENDENT element containing a list of platform-independent resources, available on both Unix and Windows platforms.
The PLATFORM_INDEPENDENT element may contain the following child element (described below):
The WNT element containing a list of Windows NT resources: those resources are only available on the Windows NT/2000/XP operating systems.
The WNT element may contain the following child element (described below):
The UNX element contains a list of those resources that are only available on UNIX operating systems. There is no difference between UNIX systems like Linux, AIX, HP-UX, Solaris, and so on.
The UNX element may contain the following child element (described below):
A RESOURCE element defines a resource, or variable, that can be used in the configuration files and in template files. It takes two attributes, an Id attribute and a Source attribute.
<RESOURCE Id="resId" Source="( FILE | INTERNAL | ENVIRON ) " >
resData </RESOURCE>
Source
attribute.Source
is FILE, resData is the path to this file.Source
is INTERNAL,
resData is the value of the resource.Source
is ENVIRON, resData is the
name of an environment variable.
$(resId)
The following example illustrates a resource defined inline.
<RESOURCE Id="res.dvm.wa" Source="INTERNAL">$(res.fgldir)/bin/fglrun.exe</RESOURCE>
The following example illustrates a resource defined as the contents of a file. In this example, the resource is a file named generodefault.html, stored in the template directory specified by the resource res.path.tpl:
<RESOURCE Id="res.theme.default.gwc.template" Source="FILE">$(res.path.tpl)/generodefault.html</RESOURCE>
The following example illustrates a resource defined as the value of an environment variable. In this example, the resource res.os contains the value of the environment variable OS. For example, on a Windows system, the environment variable OS could have the value Windows_NT.
<RESOURCE Id="res.os" Source="ENVIRON">OS</RESOURCE>