Tutorial: Run fgl demos

Demo applications are packaged with the FGLGWS product. You can create a war file to run these applications on your Java Enterprise Edition (J2EE) server.

The goal of this tutorial is to create a war file to run the Genero BDL demo applications on your J2EE server. The demos are located in your Genero BDL installation directory, $FGLDIR/demo. For more information on Genero BDL, refer to the Genero Business Development Language User Guide.

Steps

  1. Start the command line interface and set the environment for your Genero BDL using envcomp.
    • On Linux®/macOS™, change to your Genero BDL installation directory and run the script, for example:
      cd /opt/fourjs/fgl
      ./envcomp 
    • On Windows®, change to your Genero BDL installation directory and run the bat file, for example:
      cd "c:\program files\fourjs\fgl"
      envcomp.bat 
  2. Create a new directory, for example, called "demos".

    mkdir demos

  3. With a text editor create a configuration file named gwc-demo.xcf. Add the following configuration and save the file to the "demos" directory:
    <?xml version="1.0" encoding="UTF-8"?>
    <APPLICATION>
      <EXECUTION>
        <PATH>$(res.fgldir)/demo</PATH>
        <MODULE>demo</MODULE>
      </EXECUTION>
    </APPLICATION>
    
  4. Create a configuration file named simple-demo.xcf with the following and save to the "demos" directory:
    <?xml version="1.0" encoding="UTF-8"?>
    <APPLICATION>
      <EXECUTION>
        <PATH>$(res.fgldir)/demo/Widgets</PATH>
        <MODULE>Edit.42m</MODULE>
      </EXECUTION>
    </APPLICATION>
    
  5. Create the gar file by running the following command at the command line of the demos directory:
    fglgar gar --output demos.gar --application gwc-demo.xcf --application simple-demo.xcf
    The demos.gar file is created.
  6. Create the war file by running the following command at the command line of the demos directory:
    fglgar war --web-content MyJgasDir/WebContent --input-gar demos.gar --output demos.war
    
    Where:
    1. The --web-content option is mandatory. Here you specify the path to the Java Web Content directory of your JGAS installation.
      Tip:

      A second --web-content option may be used to specify a WebContent directory where, for example, you have some additional Java applications or files that overwrite files copied in the first option from the Java Web Content directory of your JGAS installation.

      For more information on using this option, refer to the fglgar page in the Genero Business Development Language User Guide
    2. The --input-gar (-g ) option is mandatory. Here you specify the Genero Archive you want to use to create the war file.
    3. The --output option specifies the relative or absolute path to the war file to generate.
    The demos.war files is created.
  7. Run the application on your Java Enterprise Edition (J2EE) server.
    1. Deploy the war file using your J2EE server tool or deployment portal interface.
    2. Use the link or URL created to access the applications deployed in the war file.
      Tip:

      The base URL in the context of the J2EE server is http://server:port/war_file_name. If you type the base URL in a browser, you get the JGAS user interface home page where you can then access all applications and services published in your war file. For more information on the JGAS user interface, go to JGAS home page.

    3. Select the application to run.
What to do next

Follow the procedure in Tutorial: Run ggc demos to run the Genero Ghost Client (GGC) demo applications tests against the demos application running on your J2EE server.