This section describes how to configure deployment for individual General Interface Builder applications and the JSX system, which is the General Interface runtime. There are two areas to consider when deploying GI applications: Configuring Deployed ApplicationsThere are two possible ways to configure the deployment of a General Interface application:
When the deployed application is launched, deployment parameters are passed to the General Interface runtime in the following order, with the first one taking precedence over the others:
HTML Script ElementOne mechanism for configuring an application is to modify the script element of the HTML launch page where the application is deployed. Deployment parameters can be included as attributes of the script element or as query parameters in the src attribute of the script element. General Interface provides several built-in parameters, such as jsxappns, jsxapploader, and jsxapppath. Custom attributes or parameters can also be added to the script element. For example, this mechanism can be used to communicate session information from a web server to a General Interface application. However, all attributes beginning with jsx are reserved for General Interface.
The following parameters are significant in the General Interface runtime:
For examples of how to use these deployment parameters in the script element, see the following examples. In this example, the jsxapppath attribute contains the application path. <div style="width:100%;height:400px;"> <script type"text/javascript" src="JSX/js/JSX30.js" jsxapppath="../workspace/JSXAPPS/samples/chart"> </script> </div> In this example, the application path, jsxapppath, is passed as a parameter to the General Interface runtime file, JSX/js/JSX30.js. <div style="width:100%;height:400px;"> <script type="text/javascript" src="JSX/js/JSX30.js?jsxapppath=../workspace/JSXAPPS/samples/chart"> </script> </div> To pass multiple parameters, use an ampersand (&). This example passes the application path and the progress bar loading as parameters. <div style="width:100%;height:400px;"> <script type="text/javascript" src="JSX/js/JSX30.js?jsxapppath=../workspace/JSXAPPS/MyProject&jsxapploader=0" </script> </div> Any application configuration parameter is available using the jsx3.app. Server.getEnv() method. For more information, see General Interface API Reference. Application Configuration FileThe other mechanism for configuring an application is to modify the application configuration file, config.xml. This file contains configuration parameters that affect deployment of the application. These parameters can be edited on the Deployment panel of the Project Settings dialog in General Interface Builder. To open the Deployment panel, choose Project > Project Settings > Deployment. Deployment parameters include such settings as namespace, initial component to load, script to run when loading, and so on. For more information on the available parameters, see File Menu. Other deployment options, such as which add-ins to load, are automatically set in config.xml from settings in the IDE. Custom attributes can also be manually added to config.xml, which is located at the root of the project. Simply open config.xml, add a new record element, and save the file. For example, you could add a record that externalizes a constant from JavaScript code as shown here: <record jsxid="CONSTANT1" type="number">VALUE1</record> This value can also be queried using the jsx3.app.Server.getEnv() method. For example, myApp.getEnv("CONSTANT1");
Configuring the RuntimeThe General Interface runtime or JSX system, which is required to run deployed General Interface applications, is configured at deployment with the same script element mechanism described in Configuring Deployed Applications. A runtime configuration parameter is any parameter beginning with jsx but not jsxapp. Any General Interface application in a multi-application deployment page may configure the runtime. However, it is an error if script elements provide conflicting values for a single runtime parameter. JSX system parameters include but aren't limited to the following:
By default, General Interface 3.5.1 and 3.6.0 load version 6 if available, then version 4 if available, then version 3. If you need to use a different version, use these system parameters to override the defaults. General Interface runtime parameters are available using the jsx3.getEnv() method. For more information on the getEnv() method, see General Interface API Reference. As an example of configuring the runtime, you might configure the General Interface runtime to print a value to the system log. The following example assigns a value of value1 to a General Interface runtime parameter named jsxprop1 : <script type"text/javascript" src="JSX/js/JSX30.js" jsxprop1="value1"> </script> Including the following log statement in a JavaScript file: jsx3.log("The value of jsxprop1 is " + jsx3.getEnv("jsxprop1"));
would print the following output to the system log: The value of jsxprop1 is value1. |
Contents
|
