Create and apply a custom XCF for your Web application

Follow these steps to create and apply a custom configuration for your Web application within the Genero Studio framework.

When launching a Web application, information needed to launch that application is provided in an external application configuration (XCF) file. An XCF file is an external XML file that provides the configuration details for an application being launched by the Genero Application Server (GAS). When Genero Studio launches a GWC application, it generates the XCF file and places it in the default directory for application configuration files, as specified in the GAS configuration file. If you have explicit changes that need to be made to the generated XCF file - such as specifying a specific snippet to use or parameters to pass to the application - you must create a custom XCF file.
Note: Refer to the GAS documentation for information on creating an XCF file and launching Web applications outside of Genero Studio.
  1. Create a custom application configuration XCF file. Use Code Editor to create the file as it provides syntax highlighting and auto-completion while editing. Validation is done using the corresponding XSD, and any errors are displayed. Include only those elements that you need to add for customization purposes. Example custom XCF file (myHelloWorld.xcf):
    <?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>
      <OUTPUT>
        <MAP Id="DUA_SL" Allowed="TRUE">
          <THEME>
            <TEMPLATE Id="_default">c:\mypath\main2.xhtml</TEMPLATE>
           <SNIPPET Id="ComboBox">c:\mypath\SL\combobox.xaml</SNIPPET> 
          </THEME>
        </MAP>
      </OUTPUT>
      </APPLICATION>
  2. Add the custom XCF file to your application's project structure. 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 myHelloWorld.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 XCF file first in the application node. If there is no custom XCF file in the application node, Genero Studio will use the first custom XCF file found in the libraries that are dependencies of the application. If multiple custom XCF files are located, the first found file is used. If no custom configuration file is found, the default configuration file created by Genero Studio is used. The information in the found custom XCF file is applied to the generated XCF file. Two XCF files are automatically generated when the application is run with the GWC client.
    application_user.xcf
    This file is intended to be re-used afterward in a normal GAS/GWC 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 to be (modified and) re-used afterward.