Deploying GWA apps
This section describes how to build and deploy GWA apps with Genero.
Building GWA apps with Genero
Genero provides a command-line tool to create GWA.
Genero Web Applications are distributed as Genero archive (gwa) files, similar to standard Genero application. A GWA package can be deployed on a GAS to be served by a web server.
Genero provides the gwabuildtool command line tool to build GWA applications.
- The Genero BDL development environment (FGLDIR) must be installed to compile your program files.
- The GWA must be installed. For more details, go to Install Genero Web Application.
- Refer to the topics in the Overview section to quickly become familiar with the features of the GWA.
Program directory required for the build
To build a GWA application, you must prepare a directory, referred to as the programdir, containing the program files (.42m, .42f, and so on) and resource files (images, database files, web components) needed by the Genero Web application. This directory might have a structure similar to that described for mobile applications in Directory structure for GMA apps.
Specifying the GBC to be used
- The first option, is to use the GBC specified by the
gwabuildtool --gbc gbc-directory
build option. - If the
--gbc
option is not specified, gwabuildtool will look for the FGLGBCDIR environment variable. - Finally, it defaults to the FGLDIR/web_utilities/gbc/gbc directory if none of the previous options is set.
GBC is loaded in an iframe inside the GWA application, so the index.html of GWA does not equal the index.html of GBC.
Any customization of the GBC is expected to work. GWA requires that GBCDIR/index.html exists and GBCDIR/VERSION exists.
http://localhost:9103/d/r/index.html?fglapp=main.42m&uuid=gwarun2024_12_11_18_00_31_769&viaMiniWS=1
Add
&debugmode=1
at the end of the URL and reload the application. On reload, the
GBC debug icons should be visible in the chromebar at the top. For more information about GBC query
string options, refer to Query string parameters page in the Genero Browser Client User Guide.Specifying environment with fglprofile
If you provide a fglprofile file in your program directory, it will be bundled with your application package. For details of setting environment for your GWA application, go to Setting environment with fglprofile.
The Web manifest file
Every GWA application must be created with a web application manifest file. The gwabuildtool creates a default manifest file that can be modified later. For more details, go to Web application manifest file.
Specifying the start-up module
- In the URL query string, you can specify
fglapp=anothermodule
. GWA will then look in the embedded file system for a 42m of that name (for example, /app/anothermodule.42m) - Or with the gwabuildtool, you can use the option
--main-module
to specify the initial 42m module to be loaded.
Build and deploy the application
Build, deploy, and launch a GWA application on the GAS
It is assumed you have a directory with your Genero program files. For more information on creating the program directory, go to Program directory required for the build
Follow these steps to build the GWA application:
Steps
--gbc
option if the default GBC is not to be used. For more information, go to
Specifying the GBC to be used.gwabuildtool --program-dir /usr/myprogramdir
--program-dir
option is mandatory. It must be set to the
path of your program directory. Deploy and launch the application
cd gwa_dist
gwasrv index.html
The default browser opens with an address like
http://localhost:9101/d/r/gwa_dist/index.html
and serves the Genero application now
running in the browser. To deploy the application on your GAS, you must first produce a Genero archive (gwa) file using fglgar gwa.
Steps
Troubleshooting GWAs
What steps can you take if you have trouble with a Genero web application (GWA)?
If a GWA is stuck during the load process, check the browser debug console for errors.
The error is most likely visible in the console, either from the JavaScript side or from the fglrun side. fglrun VM runtime errors are unfortunately not visible in the UI yet, so console output may contain the following:
- Program stopped at 'main.4gl, line number 21.
- FORMS statement error number -6331.
- Front end module could not be loaded.
If the error is not an fglrun runtime error:
- First, try reloading the app with the browser reload option with:
- "Force Reload this page"(Chrome).
- "Reload page from Origin" (Safari®).
- Ctrl-F5 (Firefox™).
- Next, clear the browser cache and then reload.
- Next, clear website data for the development host and reload.