Back to Contents


How Templates Work for the GDCAX or GJC

A template is an html file that displays your application through a browser, using a Genero Front End. A template can have predefined variables or tags. Templates are stored in $FGLASDIR/tpl directory. Genero Web Services Extension does not need a template as it is not a Front End but a server that waits for requests.

You can define your own templates and use them in your applications. See the GAS Configuration Reference section on how to set up a template.

Topics


GAS tags

GAS tags are predefined variables you can use in a GDCAX / GJC template.

Syntax:

$(resource-name)
|
<tag gwc:tpl-attribute="tpl-value" [...]>...</tag>


Notes:
  1. resource-name is the name of a resource defined in the Genero Application Server configuration file.
  2. tag is an html tag.
  3. tpl-attribute is a gwc template attribute (see the GWC manual for more information).
  4. tpl-value is the value of the template attribute.
While most resources are defined in the Genero Application Server configuration file, pre-defined resources are provided that, while not explicitly defined in the configuration file, are available for your use. These resources include:

Pre-Defined Resource
Description
application.id
Application identifier in as.xcf
constant.meta-tags
Will be replaced by GAS meta tags. Only used for GWC.
server.version
Will be replaced by GAS version.
application.start.uri
Will be replaced by GAS URI. It is used in the restart template page.
For example:
URL is http://localhost/cgi-bin/fglccgi/wa/r/demo?Arg=val1&Arg=val2
GAS URI will be /cgi-bin/fglccgi/wa/r/demo?Arg=val1&Arg=val2
application.querystring
Will be replaced by the URL substring after the question mark.
For example:
URL is http://localhost/cgi-bin/fglccgi/wa/r/demo?Arg=val1&Arg=val2
The querystring will be Arg=val1&Arg=val2
connector.uri
Will be replaced by the URL path to the connector. Available for any Front End (GWC, GDC, or GJC).
For example:
URL is http://localhost/cgi-bin/fglccgi/wa/r/demo?Arg=val1&Arg=val2
The querystring will be /cgi-bin/fglccgi
 

Back to the top


GDCAX Template

The template provided by the GAS package only indicates that the GDCAX package needs to be installed. After GDCAX installation, this template is replaced by the GDCAX default template.

Example fglgdcdefault.html:
01 <HTML>
02   <HEAD>
03     <TITLE>
04       $(application.id) - Four J's Genero Desktop Client - Active X
05     </TITLE>
06     <META http-equiv="expires" content="1">
07     <META http-equiv="pragma" content="no-cache">
08   </HEAD>
09
10   <BODY BGCOLOR="#FFFFFF" onload="startIt();" onbeforeunload="preventClose();">
11     <H2>
12       Application: $(application.id)
13     </H2>
14     <CENTER>
15       <OBJECT NAME="gdc" 
16         Id="DesktopClient" 
17         CLASSID="clsid:2311DF65-9D1A-4dda-94AA-90568D989633"
18         CODEBASE="/fjs/activex/gdc.cab#version=1,32,1,5"
19         height=440
20         width=395>
21         [Object not available! Did you forget to build and register the server?]
22       </OBJECT>
23     </CENTER>
24   </BODY>
25
26   <SCRIPT language="javascript">
27     function startIt()
28     {
29     // the serverUrl must be set BEFORE starting the application
30     if ("$(connector.uri)" != ""){
31     gdc.setSrvUrl(location.protocol + "//" + location.host + "1 $(connector.uri)" + "/wa/r/" + "$(application.id)" + "?" + "$(application.querystring)");
32     } else {
33     gdc.setSrvUrl(location.href);
34     }
35     gdc.setPictureUrl("$(pictures.uri)");
36     gdc.setAppName("$(application.id)");
37     return false;
38     }
39     function preventClose()
40     {
41     event.returnValue = "Genero Desktop Client";
42     }
43 
44   </SCRIPT>
45 
46 </HTML>
Notes:
  1. version indicates the GDC ActiveX version. If this version is greater than the GDC ActiveX installed on the client computer, the client installation will be updated. In this example, 1,21,1,3 corresponds to GDCAX version 1.21.1c.
  2. startIt() javascript function has been added to launch the application specified in gdc.setAppName function.
  3. preventClose() javascript function asks the user if he really wants to leave the html page, which will close all the GDCAX applications.
Tip: To hide the GDCAX monitor, use a style.

Example:

01 <STYLE type="text/css">
02       .hidden { display: none; }
03 </STYLE>
04 ... 



05 <OBJECT NAME="gdc" class="hidden" ...>
06 ...
07 </OBJECT>
In this example, the GDCAX monitor is not displayed thanks to the hidden style.

Back to the top


GJC Template

The template provided with the GAS package, only indicates that you need to install the GJC package.

Example fglgjcdefault.html:
01 <HTML>
02   <HEAD>
03     <TITLE>
04       $(application.id) - Four J's Genero Java Client
05     </TITLE>
06     <META http-equiv="expires" content="1">
07     <META http-equiv="pragma" content="no-cache">
08   </HEAD>
09   <BODY BGCOLOR="#FFFFFF">
10     <H2>
11       You must install the Four J's Genero Java Client extension before you can use it with the Application Server
12     </H2>
13   </BODY>
14 </HTML>
After GJC installation, this template file is replaced by the GJC default template.

GJC default template:
01 <HTML>
02   <HEAD>
03     <TITLE>
04                   $(application.id) - Four J's Genero Java Client
05     </TITLE>
06     <META http-equiv="expires" content="1">
07     <META http-equiv="pragma" content="no-cache">
08   </HEAD>
09   <BODY BGCOLOR="#FFFFFF">
10     <H1>
11             Application: $(application.id)
12     </H1>
13     <CENTER>
14     <APPLET NAME="gjc" CODE="com.fourjs.monitor.Monitor" ARCHIVE="gjc.jar" codebase="/fjs/applet" WIDTH=300 HEIGHT=200 MAYSCRIPT>
15       <PARAM NAME="resourcesPath" VALUE="/fjs/applet">
16       <PARAM NAME="applicationId" VALUE="$(application.id)">
17       <PARAM NAME="applicationQuerySring" VALUE="$(application.querystring)">
18       <PARAM NAME="connectorURI" VALUE="$(connector.uri)">
19     </APPLET>
20     </CENTER>
21   </BODY>
22 </SCRIPT>
23 </HTML>

Back to the top