GWA API

The Genero Web Application API is a package included with GWA installations, offering modules like gwa.location and gwa.app to assist with application development.

In this example, various methods from the GWA API are used to return information about the GWA application.

IMPORT FGL gwa.app
IMPORT FGL gwa.location

MAIN
  CALL menu_gwa_info()
END MAIN

FUNCTION menu_gwa_info()

  DEFINE loc_i gwa.location.TGWALocation
  DEFINE svr_i gwa.app.TServerVersionAndBuildResult
  DEFINE app_i gwa.app.TAppInformation

  CALL gwa.app.getServerVersionAndBuild() RETURNING svr_i
  CALL gwa.app.getInformation() RETURNING app_i

  MENU "GWA info"
    ON ACTION url
        ATTRIBUTES(TEXT = "URL", COMMENT = "Shows the GWA installation URL")
      CALL gwa.location.get() RETURNING loc_i
      MESSAGE SFMT("URL: %1", loc_i.href)

    ON ACTION appver
        ATTRIBUTES(TEXT = "App ver", COMMENT = "Shows the app's version")
      MESSAGE SFMT("App version: %1", gwa.app.getVersion())

    ON ACTION appbuild
        ATTRIBUTES(TEXT = "App build", COMMENT = "Shows the app's version")
      MESSAGE SFMT("App build: %1", gwa.app.getBuild())

    ON ACTION tit ATTRIBUTES(TEXT = "Title", COMMENT = "Shows the app's Title")
      MESSAGE SFMT("App title: %1", gwa.app.getTitle())

    ON ACTION gwa
        ATTRIBUTES(TEXT = "GWA ver", COMMENT = "Shows the GWA version")
      MESSAGE SFMT("GWA version: %1", app_i.gwaVersion)

    ON ACTION svr
        ATTRIBUTES(TEXT = "Server ver", COMMENT = "Shows the Server version")
      MESSAGE SFMT("Server version: %1", svr_i.serverVersion)

    ON ACTION gbc
        ATTRIBUTES(TEXT = "GBC ver", COMMENT = "Shows the GBC version")
      MESSAGE SFMT("GBC version: %1", gwa.app.getGBCVersion())

    ON ACTION cancel ATTRIBUTES(TEXT = "Back")
      EXIT MENU

  END MENU
END FUNCTION