Packaging examples

With the fglgar tool you can immediately see the results of a Genero Web Application or Web Service during your development stage without having to install a Web server or a GAS package.

Packaging and running applications with fglgar

If you have a directory named MyFirstApp with a Genero 4GL application and/or a service that you wish to test, then with just three fglgar commands applications are packaged and can be viewed in a browser.
$ cd MyFirstApp
$ fglcomp -M HelloWorld.4gl
$ fglcomp -M MyWebService.4gl
$ fglgar gar --application HelloWorld.42m --service MySebService.42m
$ fglgar war --input-gar MyFirstApp.gar
$ fglgar run --war MyFirstApp.war -p 9999
Where:
  1. The application and service source files (4gl) are compiled.
  2. fglgar is run with the gar command to create an archive file with the compiled applications and services.
  3. fglgar is run with the war command to create a war file that embeds the gar file together with the GAS written in Java (JGAS) that allows applications to be run as standalone.
  4. fglgar is run with the run command to start the JGAS packaged in the war file. It opens port 9999 to listen for incoming requests to launch applications or Web services. See Running applications from a war file.

Adding a customized GBC to the package

If you have customized Genero Browser Client (GBC) in a directory named gbc_customized, then you can include it in the package with the --gbc option.
$ cd MyFirstApp
$ fglcomp -M HelloWorld.4gl
$ fglcomp -M MyWebService.4gl
$ fglgar gar --application HelloWorld.42m --service MyWebService.42m
$ fglgar war --input-gar MyFirstApp.gar --gbc c:\dev\gbc_customized
$ fglgar run --war MyFirstApp.war -p 9999

Packaging multiple applications

If you have multiple applications to deploy in your MyApps directory that you wish to test, you can add them to the fglgar gar with --application options, as shown. The applications are bundled in the gar and run from the war file.
$ cd MyApps
$ fglcomp -M HelloWorld.4gl
$ fglcomp -M app1.4gl
$ fglgar gar --application HelloWorld.42m --application app1.42m 
$ fglgar war --input-gar MyApps.gar
$ fglgar run --war MyApps.war -p 9999