Create a custom configuration for Web applications

Genero Studio needs an application configuration file to display an application using the Genero Browser Client (GBC). To implement your custom look-and-feel, create and specify a custom configuration file.

About this task

Information needed to launch an application is provided in an application configuration (.xcf) file. Written in XML, this file provides necessary configuration details to the Genero Application Server (GAS), allowing the GAS to deliver the application.

When Genero Studio executes an application using the Genero Web Client for JavaScript (also known as the Genero Browser Client), it generates the application configuration file, and places the file in a directory specified in the GAS configuration file.

You can change the default configuration. You may need to pass parameters to the application, or change the customization project used by the Web client. To specify a different configuration, create a custom application configuration file.
Tip: See the Genero Application Server Administrator's Guide for details on creating application configuration files.
  1. Create a custom application configuration (.xcf) file.
    Tip: Use Code Editor as it provides syntax highlighting and auto-completion. Validation is done using the corresponding .xsd. Errors are displayed.
    Include only elements needed for your customization goals.
    This example specifies the customization directory to use when displaying an application using the Genero Browser Client (GBC). The GBC element specifies the symbolic link to the customization project directory. For more information on GBC customization projects and configuration files, refer to the Genero Application Server Administrator's Guide.
    <?xml version="1.0" encoding="UTF-8" ?>
    <APPLICATION Parent="defaultgwc"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="http://www.4js.com/ns/gas/3.00/cfextwa.xsd">
      <UA_OUTPUT>
        <PUBLIC_IMAGEPATH>$(res.public.resources)</PUBLIC_IMAGEPATH>
        <GBC>mycust</GBC>
      </UA_OUTPUT>
    </APPLICATION>

    This example passes parameters at the application start.

    <?xml version="1.0" encoding="UTF-8" ?>
    <APPLICATION Parent="defaultgwc"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:noNamespaceSchemaLocation="http://www.4js.com/ns/gas/2.10/cfextwa.xsd">
       <EXECUTION>
        <PARAMETERS>
            <PARAMETER>--test</PARAMETER>
            <PARAMETER>-o</PARAMETER>
            <PARAMETER>outputFile.txt</PARAMETER>
        </PARAMETERS>
      </EXECUTION>
    </APPLICATION>
  2. Add the custom application configuration (.xcf) file to your application project. Your file can have any valid file name, and must end with an xcf extension. Add the file to an application node or dependent library.

    This figure is a tree view that shows the mycust.xcf file as a child node of the Hello World application node.

    Figure 1. Project View with Custom XCF file displayed

  3. Launch the application in Genero Studio. Genero Studio searches for a custom application configuration file in the following order:
    1. In the application node.
    2. In the libraries that are dependencies of the application. If multiple custom .xcf files are located, the first found file is used.

    Information from the custom application configuration file is applied to the configuration file generated by Genero Studio.

    Two .xcf files are generated when the application is run with the GBC client.
    application_user.xcf
    This file is intended for re-use in a normal GAS/GBC configuration.
    application_user_studio.xcf
    This file is temporary and only used by Genero Studio for running the web application for a single session; it is not intended for re-used afterward.