mobile.runOnServer

Run an application from the Genero Application Server using the specified URL.

Syntax

ui.Interface.frontCall("mobile", "runOnServer",
   [ appurl, timeout ], [] )
  • appurl - The GAS URL to the Genero application (this must be a ua/r URL).
  • timeout - The timeout (in seconds) to wait for the first connection to the web server and GAS answer. This does not include the time to start the server-side application.A timeout of zero indicates an infinite timeout.

Usage

The runOnServer front call allows you to start an application in the Genero Application Server (GAS), from an embedded/local application running on the mobile device. The remote application's graphical user interface displays on the mobile device.

The front call returns when the called application ends, and the control goes back to the initial application executing on the mobile device.

The applications executed on the GAS server must use the UTF-8 encoding. Mobile front-ends will reject any attempt to display forms of an application using an encoding other than UTF-8.

The remote application cannot use RUN WITHOUT WAITING to start child programs. Only RUN is supported.

The first parameter (appurl) identifies the remote application to be started and must contain an "ua/r" URL syntax (the UA protocol introduced with the GAS 3.00).

For example: http://myappserver:6394/ua/r/myapp.

This URL may contain a query string, with parameters for the application to be executed by the GAS.

The timeout parameter can be used to give the control back to the local app, if the Web Server or GAS takes too long to respond. Note that this timeout applies to the first connection to the Web Server / GAS, and does not include the time to start the server program. A timeout of zero indicates an infinite timeout.

In case of failure (such as application not found, or timeout expired), the front call raises the runtime error -6333 and the HTTP status code of the request can be found in the error message details.

Note: The application running on the GAS can only access the data-directory directory, in the sandbox of the embedded application that executes the runOnServer front call. File handling APIs like fgl_getfile() and fgl_putfile() can only access this directory on the mobile device. If no absolute path is specified in the file path for the mobile device, the data-directory is used.

Example

TRY
    CALL ui.interface.frontcall("mobile","runOnServer",["http://santana:6394/ua/r/orders"],[])
CATCH
    ERROR err_get(status)
END TRY