Defining Applications

Within your schema, you can have one or many applications. While each application in a schema can differ in appearance and functionality, it shares the same underlying object model as other applications in that schema; that is, the object model defined by the schema.

The Application class provides a superclass for all user application instances. Each user application is defined as an instance of the Application class. The Application class defines standard properties and methods for the running of any application.

Each time a new schema is defined, an instance of the Application class is created for that schema. When a schema is loaded from a file and there is application data (in the .ddb or .ddx file), JADE creates an instance of the Application class for each application defined in this file.

If the initialize or finalize method is not set for an application but it is defined in the application or any superclass other than the RootSchema Application class, the Application Browser displays that method in the respective Initialize Method or Finalize Method column of the Application Browser. This enables you to see from the Application Browser the default initialize and finalize methods that will be invoked when running the application.

Double‑clicking on a method name in the Initialize Method or Finalize Method column displays the method source for that method.

The following example shows the Application class node expanded in the Class List of the Class Browser, with the Application Browser and Run Application dialog illustrating the connection between the Application class and the user applications defined in that class.

The Application Browser provides a summary of application attributes, which are displayed in a table that has the following columns.

  1. Default, with an arrow in the row of the default application.

  2. Name, containing the application name.

  3. Application Type, containing the application type.

  4. Startup Form/Document, containing the name of the startup form, if specified.

  5. Initialize Method, containing the name of the application initialize method, if defined.

  6. Finalize Method, containing the name of the application finalize method, if defined.

  7. About Form, containing the About form of the application, if specified.

  8. Web App Type, containing the Web application type; that is, HTML Documents, Web Services, Rest Services, or JADE Forms.

  9. Version, containing application version number, if specified, to be displayed in the default About box for the application.

  10. Default Locale, containing the default locale to be used when the application is run under a locale that is not supported by the schema of the application.

  11. Icon, containing the icon, if specified, to be used for your application instead of the default icon.

  12. Font, containing the typeface and attributes, if specified, of the font for the forms in the application to be used instead of the default font.

  13. Help File, containing the name and location, if specified, of the application help file.

Right-click in the table on the Application Browser to display the Application menu commands.

Clicking on the heading of a column sorts the table by that value (for example, Application Type). If the column is not the Name column, the table is sorted using the selected column and then the Name column as the second sort column. Clicking on the existing sorted column heading toggles ascending sort order.

Double-click on the name of:

The LockTest schema shown in this example has user-defined applications, which in the development environment are persistent instances of the Application class. These user-defined applications inherit any constant, property, or method defined in the Application class or that you defined in the LockTest subclass.

View persistent user-defined applications instances by selecting the Classes menu Inspect Instances command or from the Application Browser. View shared transient instances for a node by selecting the Classes menu Inspect Shared Transients command.

To run an application, select the required application in the Run Application dialog. A transient instance of the class is then automatically made available to the run time copy of the application.

To add an application to your current schema

  1. Perform one of the following actions to open an Application Browser window.

    • Select the Applications command from the Browse menu

    • Click the Browse Applications toolbar button

    • Press Ctrl+L

    The Application Browser is then displayed.

  2. From the Application menu of the Application Browser, select the Add command.

    The Application sheet of the Define Application dialog, shown in the following image, is then displayed, to enable you to specify general application details.

  3. In the Name text box, specify the name of your new application. An entry in this text box is mandatory. The name must start with an uppercase character and it must be unique to the schema to which you are adding it.

  4. In the Help File text box, specify the name and location of the application help file, if required. For example:

    c:\jade\testapp.hlp

    Use the Browse button to search for your help file, if required. When you click the Browse button, the common File dialog is then displayed, to enable you to select the appropriate file or location. The help file can be an Adobe Acrobat Portable Document Format (.pdf) file, Hypertext Markup Language (.htm or .html) files, a Windows help (.hlp) file, or a compiled help (.chm) file.

    If you do not specify a help file in this text box or you do not use the Application class helpFile property to dynamically set the help file at run time, no help file is opened when help is requested.

  5. In the Version # text box, specify the application version number, if required.

  6. In the Default Locale combo box, select the default locale (language) for your new application, if required. The locales that are listed are those supported by the current schema. If you do not specify a default locale, the current locale is set to the first locale supported by the schema.

    When the default locale is set in the JADE development environment, the Locale not supported message box is not displayed in the runtime application.

    The default locale is used when the application is run under a locale that is not supported by the schema of the application. The application cannot be run under a locale that is not supported, as no form and string translations will exist. If you try to run an application under a locale that is not supported by the schema, the current locale is set to the application default locale.

  7. Use the Application Type combo box to select the type of application that you require, as follows.

    • GUI

      The default application type, which provides Windows and print facilities, and so on.

    • GUI, no forms

      Specifies a graphical user interface application that has no form display.

    • Non-GUI

      Specifies an application that can run in a client node or a server node. The initialize method of a non‑GUI application should not use any GUI facilities and should not invoke printing services. A non‑GUI application runs on the node on which the startApplication method of the Application class is executed (that is, if this method is executed on a server node, the application is started on that server node).

      Alternatively, you can start a non‑GUI application by using the ServerApplication parameter in the [JadeServer] section or the [JadeAppServer] section of the JADE initialization file, which starts the application when the server node is initialized, or you can check the Run As Server Application check box in the JADE development environment Run Application dialog.

    • Rest Services

      Specifies that the application can be accessed from the Internet, if required. The Web Options sheet is then enabled.

      The defined for the application is the first Web page that is displayed when the application is invoked from the Web browser. Application features such as the start-up form, Multiple Document Interface (MDI) forms, and three-dimensional controls are ignored for REST‑enabled applications.

    • Rest Services, Non‑GUI

      Specifies that the application can be accessed from the Internet as a background task, if required. The Web Options sheet is then enabled.

      Application features such as the start-up form, Multiple Document Interface (MDI) forms, and three-dimensional controls are ignored for REST‑enabled applications. In addition, as applications of type Rest Services, Non‑Gui do not display the Web Application Monitor window, this type of application can be run in the background.

    • Web-enabled

      Specifies that the application can be accessed from the Internet, if required. The Web Options sheet is then enabled.

      The start-up form defined for the application is the first Web page that is displayed when the application is invoked from the Web browser. Application features such as Multiple Document Interface (MDI) forms and three-dimensional controls are ignored for Web-enabled applications.

    • Web-enabled Non-GUI

      Specifies that the application can be accessed from the Internet as a background task, if required. The Web Options sheet is then enabled. The start-up form defined for the application is the first Web page that is displayed when the application is invoked from the Web browser.

      Application features such as Multiple Document Interface (MDI) forms and three-dimensional controls are ignored for Web-enabled applications. In addition, as applications of type Web‑Enabled Non‑GUI do not display the Web Application Monitor window, this type of application can be run in the background.

    For more details, see the Application class applicationType property in Chapter 1 of the JADE Encyclopaedia of Classes.

    Applications of type No Forms, Non_GUI, Rest Services, Non‑Gui, and Web‑Enabled Non‑GUI terminate only after the JADE terminate instruction is executed.

    The Application class startApplication, startAppMethodWithString and startAppMethod methods start only Non-GUI, Rest Services, Non‑Gui, and Web‑Enabled Non‑GUI applications if they are invoked from a server method or server application. (An exception is raised if they are invoked from a server method or a server application to start an application of a type other than non-GUI.) On a client node, they start all types of application.

  8. If you selected the Web‑enabled or Web‑enabled Non‑GUI application type in the previous step, the Web Application Type group box is then enabled. If you do not want to dynamically generate HTML based on JADE forms, select the:

    • HTML Documents option button if you want HTML generated based on HTML documents in your Web application. (For details, see "Specifying Your HTML Thin Client Access Options", in Chapter 1 of the JADE Web Application Guide.)

    • Web Services option button if you want your application to support Web services. (For details, see "Defining a Web Services Application", in Chapter 11 of the JADE Developer’s Reference.)

    • Rest Services option button if you want your application to support REST services. (For details, see "REST-Based Web Services", in Chapter 11 of the JADE Developer’s Reference.)

    By default, HTML is dynamically generated in Web applications based on JADE forms; that is, the JADE Forms option button is selected.

  9. In the Icon group box, click the Change button if you want to display the common File Open dialog, to enable you to select an icon (.ico) file for your JADE application icon display.

  10. In the Start-up Form combo box, select the form that is to be displayed when the new application is started.

    The first form that you create for the application becomes the default start-up form when you run your application. (For details, see "Adding a New Form", in Chapter 5.)

    If your application type is Web‑Enabled or Web‑Enabled Non‑GUI and you do not select or specify a value in this combo box, the HTML Documents sheet on the Web Options sheet is enabled so that you can define an HTML home page.

  11. In the About Form combo box, select the form that is to be displayed in response to a user of the runtime application selecting the About command in the Help menu.

  12. Check the Show Super Class Methods check box if you want applicable methods from the current schema and all superschemas displayed in the following Initialize Method and Finalize Method combo boxes. When this check box is unchecked, applicable methods from the current schema are displayed in the following combo boxes.

    This check box is initially unchecked for a new application definition or when you are changing an application and the Initialize Method and Finalize Method combo boxes are empty or the methods are defined in the current schema. If an application being changed has a defined initialize or finalize method that is defined in another schema, the check box is checked and disabled.

    If you check this check box to toggle the checked status, the Initialize Method and Finalize Method combo boxes are reloaded according to the new status.

    When you select an initialize or finalize method from a superschema, the check box is disabled so that you cannot uncheck the check box, which would prevent the display of the currently selected method.

  13. In the Initialize Method combo box, select the start-up method that is to be invoked when the application is started (for example, the initialize method), if required. This must be a method of the Application class.

    The Application class initialize method is called automatically if you do not explicitly specify a start-up method in the Initialize Method combo box.

  14. In the Finalize Method combo box, select the method that is to be invoked when a close request has been made for your application. This must be a method of the Application class. When the selected finalize method is invoked, the application then terminates, and cannot handle new form requests.

  15. Select the Form sheet if you want to specify your form preferences. (For details, see "Specifying Your Form Preferences", in Chapter 5.)

    Alternatively, perform one of the following actions.

Your specified application is then created as an instance of the Application class and is therefore not displayed in the Class List of the Class Browser. It is displayed in the Application Browser, however, and can be viewed from the Class Browser by inspecting instances of the Application class.

Only one Application Browser for the current schema can be open at any time. If an Application Browser is already open for that schema, it is brought to the top when you click the Browse Application toolbar button or you select the Applications command from the Browse menu.

You can have concurrent open Application Browsers for different schemas in the current development environment session.