When Natural for Ajax is installed, you can work with Natural for Ajax Tools which allows you to use the Natural for Ajax functionality directly from within Natural Studio. Using Natural for Ajax Tools, you can design web pages for rich internet applications, import adapters for these pages into a Natural library, generate programs that display these pages and test these programs in an internal browser.
For application modernization, it is possible to extract information from Natural maps. The resulting files can then be used by another tool which converts the output to Natural for Ajax page layouts.
This document covers the following topics:
For further information, see the Natural for Ajax documentation.
Natural for Ajax Tools is an optional plug-in for Natural Studio. The installation of this plug-in is part of the Natural installation. You can either install this plug-in during a first-time installation or install it later in a separate setup process. For further information on the installation procedure, see the Installation documentation.
Before Natural for Ajax Tools can be used, you have to proceed as described in the following topics:
When you activate a plug-in, Natural Studio starts a second Natural
session using the parameter file NATPARM
. If your Natural session
uses a parameter file other than NATPARM
, you must be aware of the
fact that the FNAT
(especially the libraries SYSPLNJX
and SYSLIBS
) and other Natural parameters (such as the
WORK
parameter) may be different in the Natural plug-in session (which uses
NATPARM
) and in your Natural session (which uses another parameter
file). This may lead to unpredictable errors. Therefore, it is recommended that
you also use the parameter file NATPARM
for your Natural session.
See also the information on the Natural parameter file in the section
Plug-Ins under Natural
Security of the Natural Security
documentation.
When Natural for Ajax Tools has been installed, it has to be activated in the Plug-In Manager. For detailed information on the activation procedure, see Plug-in Manager in the documentation Using Natural Studio.
When Natural for Ajax Tools has been activated in the Plug-in Manager, additional elements are available in the Natural Studio window:
An additional toolbar is shown. The buttons in this toolbar represent the following menu commands:
Note:
The display of this toolbar can be switched on and off by choosing
from the menu.
When the current context (that is, the selected object) allows it, the context menu provides the following additional cascading menu:
. Depending on the context, the cascading menu contains different commands:When a library is currently selected, the following commands are available in the cascading menu:
When a program is currently selected, the following commands are available in the cascading menu:
When an adapter is currently selected, the following command is available in the cascading menu:
When a map is currently selected, the following command is available in the cascading menu:
In order to develop Natural for Ajax applications, a Natural Development Server (NDV, optional), an application server with Natural for Ajax and a Web I/O Interface server (NWO) are required.
When Natural for Ajax Tools has been activated in the Plug-in Manager,
you first have to configure the relationship between the Natural development
servers and the corresponding application servers and Web I/O Interface
servers. This is done in the configuration file
ConfigNJXPLG.dat that resides as a resource in the library
SYSPLNJX
.
Each entry in the configuration data consists of:
Natural Development Server host name.
Natural Development Server port number (optional).
Application server host name.
Application server port number.
Application server path name.
Web I/O Interface server host name.
Web I/O Interface server port number.
See the contents of the file ConfigNJXPLG.dat for additional information.
This file already contains the configuration that is necessary for working in the local environment. After you have defined a configuration line for a new remote development environment, you must make sure that the file sessions.xml on the corresponding application server (see Managing the Configuration File for the Session in the Natural Web I/O Interface documentation) contains a session definition with the same name.
Example:
Your ConfigNJXPLG.dat file contains the following line:
MYNDV,2700,MYAPPS,8080,\\MYAPPS\JBOSS\#LIB\nat,MYNWO,2900
In this case, the sessions.xml file of the application server running on "MYAPPS:8080" must contain the following session definition:
<sessions> <session id="MYNDV"> <natural_program>script-name</natural_program> <user id="" pwd=""/> </session> </sessions>
Optionally, you can specify a user ID and password. This is useful with the
command. Then you do not have to enter a user ID and password every time you start a Natural for Ajax program in Natural Studio.In general, a Natural for Ajax project consists of one or more Natural libraries with Natural objects that implement the server part, and one or more Application Designer projects that implement the user interface part.
The current version of Natural for Ajax Tools assumes that a Natural for Ajax project consists of one Natural library and one Application Designer project, where the name of the Application Designer project is identical to the name of the Natural library translated to lowercase letters.
Using the Application Designer, you design the web pages for your rich internet applications. You can open the Application Designer development workplace directly from Natural Studio.
To open the Application Designer development workplace
Select the Natural library which belongs to your Application Designer project.
Invoke the context menu and choose
.Or:
When the Natural for Ajax Tools toolbar is shown, choose the
following toolbar button.
The Application Designer development workplace is invoked in a browser window. Now you can create an Application Designer project for your web pages, create pages, edit existing pages and create Natural adapters for pages.
Important:
Name your Application Designer project like the corresponding
Natural library (translated to lowercase letters).
For further information, see Developing the User Interface in the Natural for Ajax documentation.
A Natural adapter is generated when you save the layout for your Natural page in the Application Designer. You can import the generated adapters from the application server environment into the Natural library with the same name.
To import the generated adapters
Select the library into which you want to import the generated adapters.
Invoke the context menu and choose
.Or:
When the Natural for Ajax Tools toolbar is shown, choose the
following toolbar button.
The generated adapters from the equally named Application Designer project are imported into the selected library.
When an adapter already exists in the library, you are asked whether you want to replace it.
From an adapter, you can generate the Natural main program that calls the adapter and displays the page.
To generate the main program from an adapter
Select the adapter.
Invoke the context menu and choose
.Or:
When the Natural for Ajax Tools toolbar is shown, choose the
following toolbar button.
The program is generated. Its source code is shown in a program editor window.
Stow the program with a name of your choice.
For further information (for example, how to handle page events), see Developing the Application Code in the Natural for Ajax documentation.
You can execute the Natural main program which has been generated from an adapter. A browser window is then invoked in Natural Studio and you can test your program.
To execute the main program
Select the main program.
Invoke the context menu and choose
.Or:
When the Natural for Ajax Tools toolbar is shown, choose the
following toolbar button.
The program is executed in a browser window.
If you want to start a Natural program or the Application Designer development workplace outside of Natural Studio, you can display the URL that is required for starting it.
To display the URL of a program
Select the program.
Invoke the context menu and choose
.Or:
When the Natural for Ajax Tools toolbar is shown, choose the
following toolbar button.
A dialog box appears, containing the URL for the program.
Using copy-and-paste, you can enter this URL in a browser which is supported by Application Designer (for example, Internet Explorer or Mozilla Firefox). Thus, you can execute your program directly in the browser (that is, not in the internal browser which is used in Natural Studio).
To display the URL of the Application Designer development workplace
Select any object except for a program, or select a library or system file.
Choose the following toolbar button from the Natural for Ajax Tools toolbar.
A dialog box appears, containing the URL for the Application Designer development workplace.
Using copy-and-paste, you can enter this URL in a browser which is supported by Application Designer (for example, Internet Explorer or Mozilla Firefox). Thus, you can invoke the Application Designer development workplace directly in the browser (that is, not in the internal browser which is used in Natural Studio).
The Map Extractor is used in the process of converting a map-based application to a Natural for Ajax application. It creates map extract files which are intended as input for the Map Converter. For detailed information, see Application Modernization in the Natural for Ajax documentation.
To use the Map Extractor
Select one or more Natural maps.
Invoke the context menu and choose
.The map extract files are created. The location of these files is shown in a dialog box.