This document describes how to generate a client interface object, using Java Wrapper for Natural. It covers the following topics:
To use Java Wrapper for Natural you need Software AG Designer with the NaturalONE and EntireX plug-ins installed.
To start the Java Wrapper for Natural, select a Natural subprogram (file extension .NSN) located in a library of a NaturalONE project, and from the context menu choose
. Alternatively you can start the Java Wrapper for Natural from the context menu of the Natural source folder or any parent folder in the project, including the Natural library and the Project folder.If you have started the wizard from a folder containing multiple Natural libraries, the wizard displays a page showing all available libraries from which you can select one.
Select the Natural library from the list and continue with Step 3: Select the Natural Subprograms.
The following wizard page provides a list of available Natural subprograms.
In the Source pane, select at least one program from the list of Natural subprograms (CALLNATs). You can also choose or .
In the Extraction Settings pane, check Redesign the interfaces if you want to design the extracted interfaces to the Natural subprograms. The button will be enabled. See Step 4: Redesign the Interface for Natural Subprograms (Optional). If you do not check Redesign the interfaces, see Natural to IDL Mapping for default mappings.
Check Replace special characters in parameter names by underscore to substitute the special characters '$', '#', '&', '@', '/' by underscores. See also Extracting IDL Parameter Names.
Press
to continue.If Redesign the interfaces is checked, continue with Step 4: Redesign the Interface for Natural Subprograms (Optional).
Otherwise continue with Step 5: Configure the Class to be Generated.
In this step, you can redesign the interface. This includes:
Use this page for the following tasks:
Define the direction of parameters in the extracted interface. Choose Map to In, Map to Out or Map to InOut for each parameter on level 1.
Define which parameters redefined in the Natural PDA are part of the
extracted interface. Choose Map to In, Map to
Out or Map to InOut for the
REDEFINE
base parameter or any
REDEFINE
path.
Hide or suppress unneeded parameters in the extracted interface. Choose Suppress.
Set parameters to constants and hide or suppress them in the extracted interface. Choose Set Constant.
This page consists of the following main parts:
Top line
The top line contains the current Natural subprogram and the IDL library
name. The combo box can be used as quick navigation if more than one Natural
subprogram is selected.
Middle
The middle part contains a tab item for each interface ( IDL program)
extracted from the Natural subprogram.
Note:
It is possible to extract more than one interface (IDL program) from a
Natural subprogram. To create, rename and remove interfaces, use the toolbar on
the right side of tab folder.
Icon | Function | Description |
---|---|---|
Create | Create a new interface (IDL program) based on the original parameters of the Natural subprogram. | |
Duplicate | Create a new interface (IDL program) based on the current interface (active tab). All modifications of the current interface are copied. | |
Rename | Change the name of the current interface (active tab). The name must be unique. | |
Remove | Remove the current interface (active tab). At least one interface must exist. | |
Expand All | Expand the Natural and IDL tree. | |
Collapse All | Collapse the Natural and IDL tree. |
Middle left
Input pane. The parameters of the Natural subprogram to extract from. For
each Natural subprogram parameter you can choose one of the operations
Map to In, Map to Out, Map
to InOut, Suppress and Set
Constant. Additionally for REDEFINE
s, a quick fix is available
(icons on the left side of the pane) to choose which parameters redefined in
the Natural PDA are part of the extracted interface.
Notes:
FUNCTION (A3)
is set to constant; FILLER1(A4)
and
FILLER2(A60)
are suppressed; FUNCTION-DATA(A161)
and
its first REDEFINE
path are implicitly suppressed because the
second REDEFINE
path with prefix MOD-DATA-2-R2
is
selected.
FUNCTION (A3) [MOD]
).
Middle right
Output pane. The extracted interface (IDL).
Bottom
Reference. The Natural subprogram source and its PDA sources, each
displayed in a separate tab.
The panes can be resized.
To enlarge parameter lists, use the vertical bars on the side.
You can close the bottom pane if it is not needed by clicking on the triangle next to Natural Subprogram Source. In this way, you have more space for viewing the upper panes.
Use the quick navigation or choose
to continue. If multiple Natural subprograms have been selected in the Natural subprogram selection step, redesign the next interface. The amount of subprograms extracted so far is indicated by the fraction next to the title (current/total).If multiple Natural subprograms have been selected in the Natural subprogram selection step, redesign the next interface. The amount of subprograms extracted so far is indicated by the fraction next to the title (current/total).
If only one Natural subprogram has been selected or no further one has to be redesigned, continue with Step 5: Configure the Class to be Generated.
The next wizard page asks for the name of the target folder of the generated Java classes, and for a Java package name. By default, the Java sources are generated into a folder Java/src. If this does not already exist, it will be created.
The Java interface object is generated and placed into the target folder.
For more information see the NaturalONE documentation.
Use the preference page for the IDL Extractor for Natural to manage the default values relevant for Step 3: Select the Natural Subprograms. See Preferences.