Packaging for GWA

Genero Web Application (GWA) is a Genero application running entirely in the browser.

To understand Genero Web Application basics, go to Genero Web applications in the Genero Business Development Language User Guide.

Package for a GWA application

Creating a package for a mobile platform follows the general packaging procedure.

To create a package for a GWA application:
  1. Navigate to your packages group.
  2. Right-click the packages group and click New Package.
  3. Click Genero Web Application.
Genero Studio creates the Genero Web application package and its directory nodes. A directory node specifies one or more files to include in the package.
Table 1. Default Directory nodes
Directory Contents
Binaries Binary files, such as the compiled modules (.42m files).
Config Configuration files. By default, this node includes fglprofile to provide the database driver and source information.
Database Database files. By default, this node includes db files, because SQLite is the supported database.
Images Image files. By default, this node includes .png, .jpg, and .ttf files, as well as the image2font.txt file.
Resources Application resource files, such as action defaults (.4ad) and style files (.4st).
Webcomponents Web component files.
To specify the module used in the package properties, navigate to the Properties window and within the Package section specify the Main module name.

To define the title used by a GWA application, navigate to the Properties window and within the Package section specify the Label.

For more information, go to Package node properties.

GWA package QR code access and host configuration limitations

By default, GST uses the network host name configured at the operating system level when generating QR codes for GWA packages. This allows scanning the QR code with a mobile device to access the published package. However, browser based execution of GWA packages is subject to limitations. Running a GWA package without a certificate is only permitted on localhost, which prevents access from external devices.

To enable testing with a certificate, configure the GAS launched by GST using start script options in Genero Configuration Management:
--cert-file "<path to .crt file>"
and
--cert-key "<path to .pem file>"

Launch and debug a GWA package

To launch a GWA application, right-click on the GWA package node, select Deploy and then Launch. The Genero Application Server (GAS) launches the application.

To debug an application, choose one of the following options:

  • Right-click on the GWA package node, select Deploy and then Debug.
  • Right-click on the GWA package node, select Deploy and copy the URL from the Output window. In the toolbar select Debug > Debug Genero Application, enter the URL and click Debug.
The GAS launches this application in debug mode. The application execution stops at the MAIN function if you have not set any other breakpoints. To continue the execution of the application, navigate to Genero Studio's debug menu and select the continue icon. For more information, go to Debug menu.

Show deployed URLs

The Show deployed URLs context menu item provides direct access to deployed application URLs for GWA packages.

To execute Show deployed URLs:
  1. Right click on the GWA package.
  2. Select Show deployed URLs.

Upon execution, Genero Studio (GST) starts the Genero Application Server (GAS) if it is not already running. It then queries the GAS to retrieve the list of deployed applications associated with the selected package. The associated URLs appear in the Output panel.

GWAUSERDIR

Genero Studio packages a Genero Web Application (GWA) by copying all files from the directory specified in the GWAUSERDIR environment variable into the gwa directory, located inside the application's distribution folder. For example, you can use the GWAUSERDIR variable to set up a manifest file and favicon to use in your GWA package.

GWAUSERDIR is a Genero Studio-specific environment variable. For more information on Genero Studio-specific environment variables, go to Genero Studio-specific environment variables.

Web application manifest file

A web application manifest file is a JSON file that contains important information about your Genero Web Application (GWA). The manifest file for a GWA is named gwa.webmanifest and is located in the programdir/gwa directory of your project. This file allows you to customize various aspects of your web application, including:

  • Icons: Change the icons that represent your application.
  • Screenshots: Add screenshots to showcase your application.
  • Application title: Modify the title displayed for your application.

For more information on the web application manifest file, go to Web application manifest file in the Genero Business Development Language User Guide.

PhoneDemo

The PhoneDemo_Web_App is part of the package nodes within the PhoneDemo. This provides an example of a GWA package node. For instructions on building, deploying and launching the PhoneDemo as a Genero Web Application, go to GWA (in GST) Quick Start.