NaturalONE Version 8.3.7
 —  Using NaturalONE  —

Managing Objects Directly on a Natural Server

This document covers the following topics:


Editing Objects

When you edit a source directly on a Natural server, a lock is applied in order to prevent concurrent updating of objects, the source is automatically downloaded into a temporary project in the Eclipse workspace and the editor is opened. You can then apply changes to the source code and save them; the source is then changed on the server. When you close the editor, the object is automatically unlocked and removed from the temporary project. When the temporary project no longer contains any objects, it is removed from the Eclipse workspace.

The following information applies to Natural for Windows, UNIX and OpenVMS. It also applies to Natural for Mainframes when the profile parameter SLOCK has been set to "SPOD".

Start of instruction setTo edit objects

  1. In the Natural Server view, select the object(s) that you want to edit.

  2. Invoke the context menu and choose Edit.

    Or:
    Double-click each object that you want to edit.

    An editor window appears for each selected object and you can now edit the sources. See Using the Natural Editors for further information.

    When an object is currently locked, an editor is not invoked. Instead, the following information is shown: the date and time when the object was locked, and by whom it was locked.

Note:
For information on how to edit resources, see Working with Resources.

Top of page

Listing Objects

When you "list" an object, you display its contents but you cannot modify it. However, you can copy its contents. The object is automatically downloaded into a temporary project in the Eclipse workspace and the editor is opened in read-only mode. This is helpful, for example, if you want to view the contents of an object that you are not allowed to modify, or if you want to view the contents of an object and do not want to lock the object (as done with the Edit command).

Start of instruction setTo list objects

  1. In the Natural Server view, select the object(s) that you want to list.

  2. Invoke the context menu and choose List.

    An editor window appears for each selected object.

Top of page

Saving Objects

Object sources are saved using the standard Eclipse functionality. The object source is saved directly on the Natural server.

Start of instruction setTo save an object

  1. Activate the editor window for the source that you want to save.

  2. From the File menu, choose Save.

    Or:
    Press CTRL+S.

Top of page

Checking Objects

You can check the source code of an object (except classes) for syntax errors.

Note:
When the option Console output is enabled on the Runtime Execution page of the Natural preferences, information about success or failure of the Check command is shown in the Console view.

Start of instruction setTo check objects

  1. In the Natural Server view, select the object(s) that you want to check.

  2. Invoke the context menu and choose Check.

    If an error was found, a dialog box appears, providing information on the error.

Top of page

Stowing Objects

When you stow an object, it is compiled and saved. If no errors are found, the source form of the object is saved and the resulting generated program is stored (in addition to the source).

Note:
When the option Console output is enabled on the Runtime Execution page of the Natural preferences, information about success or failure of the Stow command is shown in the Console view.

Start of instruction setTo stow the current object in the editor

  1. Activate the editor window for the source that you want to stow.

  2. Invoke the context menu and choose Stow.

    Or:
    Press CTRL+T.

    If an error is found, information on the error is shown in the Problems view. In this case, you first have to correct the error before it is possible to stow the object.

Start of instruction setTo stow several objects

  1. In the Natural Server view, select the object(s) that you want to stow.

  2. Invoke the context menu and choose Stow.

    If an error is found, a dialog box appears, providing information on the error. In this case, you first have to correct the error before it is possible to stow the object.

Top of page

Cataloging Objects

When you catalog an object, it is compiled. If no errors are found, the resulting generated program is stored.

In contrast to the Stow command, the source code is not saved when you catalog an object. When the editor is open and the latest changes have not yet been saved, they are not considered by the Catalog command.

Note:
When the option Console output is enabled on the Runtime Execution page of the Natural preferences, information about success or failure of the Catalog command is shown in the Console view.

Start of instruction setTo catalog objects

  1. In the Natural Server view, select the object(s) that you want to catalog.

  2. Invoke the context menu and choose Catalog.

    If an error was found, a dialog box appears, providing information on the error. In this case, you first have to correct the error before it is possible to catalog the object.

Top of page

Executing Objects

When you execute an object, the default configuration settings in the Natural preferences are used (see Natural I/O > Runtime in Setting the Preferences).

Start of instruction setTo execute objects

  1. In the Natural Server view, select the object that you want to execute.

    Note:
    It is only possible to execute one object at a time.

  2. Invoke the context menu and choose Execute.

    The output is either shown in the internal browser or in an external browser, depending on your launch configuration.

Top of page

Refreshing the Display

Usually when something changes in Natural, the Natural Server view is automatically refreshed. This happens, for example, when objects are created, renamed or deleted. The automatic refresh requires that the corresponding option has been set in the Natural preferences; see Runtime Execution in Setting the Preferences.

There are, however, situations where an automatic refresh does not take place, since Natural is not aware of a modification. For example, two Natural processes are currently active and both are working on the same system file. When one Natural is applying a change to the system file (such as creating a new object), the second Natural is not aware of this modification. In this case, you have to refresh the display manually.

Start of instruction setTo refresh the display manually

  1. In the Natural Server view, select the node to be refreshed (for example, a library).

  2. Invoke the context menu and choose Refresh.

    Or:
    Press F5.

    The most recent information is fetched from the Natural server. The tree remains expanded at the same place.

Top of page

Copying and Moving Objects and Libraries

You can copy and move nearly all of the nodes in the Natural Server view. This can be either a group node or a node for a single object. For example, you can copy all programs of a library by copying the Program node. The following restrictions apply:

Libraries are copied and moved in the same way as any other node in the Natural Server view. The target node for a copied or moved library can be any system file node. It can even be any other library node; in this case, all objects of the source library are copied. The following applies for libraries:

You can also copy and move nodes from one Natural server environment to another Natural server environment, for example, from a mainframe environment to a UNIX environment.

Note:
Using drag-and-drop, it is possible to download libraries and objects to an existing project in the Eclipse workspace. For further information, see Downloading an Existing Library or Object from a Natural Server.

Start of instruction setTo copy objects or libraries using menu commands

  1. In the Natural Server view, select one or more nodes.

  2. Invoke the context menu and choose Copy.

  3. Select the target node in the Natural Server view.

  4. Invoke the context menu and choose Paste.

Start of instruction setTo copy objects or libraries using drag-and-drop

  1. In the Natural Server view, select one or more nodes.

  2. Click and hold down the left mouse button.

  3. Drag the mouse to the node in the Natural Server view to which you want to copy the objects.

  4. Hold down CTRL.

  5. Release the mouse button and then CTRL.

    Caution:
    If you do not hold down CTRL before releasing the mouse button, the objects are moved.

Start of instruction setTo move objects or libraries using a menu command

  1. In the Natural Server view, select one or more nodes.

  2. Invoke the context menu and choose Move.

    The following dialog box appears.

    Move objects

    The upper part of the dialog lists the path(s) to the selected node(s). If you decide that you do no longer want to move one of the listed nodes, simply deselect the corresponding check box.

  3. In the lower part of the dialog, select the target node for the moved object(s).

    Note:
    Any filters that have been set are also used in the Move Objects dialog box.

  4. Choose the Finish button.

Start of instruction setTo move objects using drag-and-drop

  1. In the Natural Server view, select one or more nodes.

  2. Click and hold down the left mouse button.

  3. Drag the mouse to the node in the Natural Server view to which you want to move the objects.

  4. Release the mouse button.

    When you drag an object to a different environment (for example, from a UNIX environment to a mainframe environment), the object is copied and not moved. The object is not deleted at its original position.

Notes:

  1. When you copy or move an object to another library in which an object of the same type and with the same name exists already, and when the corresponding option has been set in the Natural preferences (see Runtime Execution in Setting the Preferences), you are asked whether you want to overwrite the object.
  2. When you are dragging nodes, the mouse pointer always indicates whether the objects can be dropped or not.
  3. If the automatic refresh does not take place, refresh the source and/or target node manually to see the result of a copy-and-paste, move or drag-and-drop operation. See Refreshing the Display.

Top of page

Renaming Objects and Libraries

When renaming an object or library, make sure to adhere to the Natural naming conventions.

Note:
It is not possible to rename error messages, mainframe DDMs, and the library SYSTEM.

Start of instruction setTo rename an object

  1. In the Natural Server view, select the node that is to be renamed.

  2. Invoke the context menu and choose Rename.

    A dialog box appears.

  3. Enter a new name and choose the OK button.

Top of page

Deleting Objects and Libraries

When you delete an object in the Natural Server view, both source and generated program are deleted. It is not possible to delete an object when it is currently locked on the server.

A library is deleted in the same way as a Natural object. If you are working in a multiple-user environment, you should only delete a Natural library if you have exclusive access to the library involved. It is not possible to delete the library SYSTEM.

Start of instruction setTo delete objects or libraries

  1. In the Natural Server view, select one or more nodes.

  2. Invoke the context menu and choose Delete.

    Or:
    Press DEL.

    When the corresponding option has been set in the Natural preferences (see Runtime Execution in Setting the Preferences), you are prompted to confirm the deletion.

Top of page

Unlocking Locked Objects

When you are working in Natural server mode, it may happen that the connection to the Natural server is lost. In this case, any objects that you are editing directly on the Natural server remain locked until they are manually unlocked.

You can view the Natural objects that are locked. If required, you can unlock them.

Start of instruction setTo unlock locked objects

  1. In the Natural Server view, select a node in the appropriate Natural server environment.

    For example, select the node for a library containing locked objects. The library name and all available information will then be provided in the dialog box which is used for unlocking.

  2. Invoke the context menu and choose Unlock.

    A dialog box appears. When a library was selected, its name and the appropriate database ID and file number are automatically provided.

    Unlock

    Notes:

    1. Depending on the selected node, all available information is filled into the dialog box as default information.
    2. If you have selected a single object, the object is unlocked immediately and a corresponding message appears in the status line. The above dialog box does not appear in this case.
    3. If several nodes (for example, several libraries) are selected, only the first node is considered by the Unlock command.
    4. If Natural Security is active on the Natural server, you can only unlock objects if you are allowed to do so.
  3. You can limit your search by specifying further options (for example, an object type or a specific date and time). The following options are available:

    Option Description
    Library

    The name of the library which contains the locked object. Asterisk notation (*) can be used.

    DBID

    The database ID of the specified library. Asterisk notation (*) can be used.

    On mainframe servers with parameter SLOCK=PRE, the following applies: When asterisk notation (*) is used, only the current FNAT, FUSER and FDIC files are scanned.

    FNR

    The file number of the specified library. Asterisk notation (*) can be used.

    On mainframe servers with parameter SLOCK=PRE, the following applies: When asterisk notation (*) is used, only the current FNAT, FUSER and FDIC files are scanned.

    Password

    This option is available only for a mainframe server and when the profile parameter SLOCK=PRE has been set in the mainframe environment.

    The password for the specified system file (DBID and FNR).

    Needs not be specified when the DBID and FNR of the current FNAT or FUSER are used.

    Cipher

    This option is available only for a mainframe server and when the profile parameter SLOCK=PRE has been set in the mainframe environment.

    The cipher key for the specified system file (DBID and FNR).

    Needs not be specified when the DBID and FNR of the current FNAT or FUSER are used.

    Object name

    The name of the object to be unlocked. Asterisk notation (*) can be used. For a list of all objects from a specific start value, the notation ">" can also be used.

    Object type

    If you want to restrict the objects to be unlocked to a specific object type, select the corresponding object type from the drop-down list box. The asterisk (*) in the drop-down list box means that all locked objects will be found.

    Locked by

    The ID of the user who caused the object to be locked. Asterisk notation (*) can be used.

    Your own user ID is provided by default.

    If Natural Security is used, you can only specify another user ID if the security unlock flag is set to "F" (forced unlock) in the Natural Security user profile.

    Locked on

    When the Specify date check box is selected, you can specify a date (either in the spin box or in the dialog box which appears when you choose the Calendar button). All locked objects between this date and the current date will then be found.

    When you select the Specify time check box, you can also define a time. All locked objects between this time on the specified date and the current date will then be found.

  4. Choose the Finish button.

    When locked objects exist, they are shown in the Unlock Objects view.

    Unlock Objects view

    Note:
    This view is automatically shown when locked objects are found. It is not shown by default when you open the NaturalONE perspective. See also Showing a View of the NaturalONE Perspective.

  5. In the Unlock Objects view, select the object(s) that you want to unlock.

  6. Invoke the context menu and choose Unlock Objects.

    All selected objects are unlocked. For each unlocked object, the following icon is shown in the Status column: Icon.

Top of page

Working with DDMs

How DDMs are shown in the Natural Server view depends on the type of server environment (see also Contents of the Natural Server View).

If you are working in a mainframe environment where the DDMs are always stored in the system file FDIC or if you are working in a UNIX, OpenVMS or Windows environment where the FDDM parameter has been set so that the DDMs are stored in the system file FDDM, all public DDMs are always shown under the DDMs system file node. If you have the corresponding permission, you can work with DDMs that have been linked to specific libraries using Natural Security. The linked DDMs are protected, and only authorized users are able to access them. The way in which protected libraries are shown depends on the setting of the Display DDMs in library option in the Natural preferences (see Runtime Execution in Setting the Preferences):

If you are working in a UNIX, OpenVMS or Windows environment where the DDMs are stored in libraries (that is, the FDDM parameter has not been set), the setting of the Display DDMs in library option is not considered. All DDMs are always shown in the DDMs group node of the library in which they are located. If allowed by Natural Security, it is possible to download the DDMs. Other than described above for the mainframe, the DDMs are also downloaded if the complete library is downloaded to a Natural project.

The commands which can be executed on DDMs which are displayed in a library are restricted to Catalog, Stow, Edit, List and Unlock. File operation commands such as Delete or Rename cannot be used.

Top of page

Working with Dialogs

You can work with dialogs when NaturalONE has been installed in a Windows environment.

Dialogs cannot be edited with a NaturalONE editor. However, when Natural Studio is installed on the same machine as NaturalONE, you can invoke Natural Studio from the Natural Server view and then edit the dialog directly in Natural Studio, using the dialog editor.

The prerequisites are:

When these prerequisites are fulfilled and Natural Studio can be found in the development environment, the Edit with Natural Studio command is visible in the context menu for a selected dialog in the Natural Server view.

Natural Studio's dialog editor can only be invoked for dialogs that are accessible via the Natural Server view. Dialogs which are stored in the Eclipse workspace (in the Navigator view or in the Natural Navigator view) can only be edited with NaturalONE's source editor (however, this is not recommended). If you want to edit a dialog that is stored in the Eclipse workspace with Natural Studio's dialog editor, you have to upload the dialog to an appropriate development server.

Start of instruction setTo edit a dialog

  1. In the Natural Server view, select the dialog that you want to edit.

  2. Invoke the context menu and choose Edit with Natural Studio.

    Natural Studio's dialog editor is invoked for the selected object and you can now edit it. For detailed information on the dialog editor, see the Natural for Windows documentation.

Note:
If you want, you can also use any other features of Natural Studio. All installed functionality will be available to you.

Top of page

Working with Resources

In Natural terminology, resources are non-Natural files (such as images or HTML files) that are used in a Natural application.

In the Natural Server view, the resources in a library are contained in a node called Resources. When you expand this node, additional nodes are shown for the available types of resources. For example, all bitmaps (*.bmp) are shown in a node called Bitmap Images, and all icons (*.ico) are shown in a node called Icons.

If you want to modify a resource, you have to double-click it. This downloads the resource into a temporary project in your Eclipse workspace and opens the appropriate internal editor. You can then apply changes to the resource and save them; the resource is then changed on the server. When you close the internal editor, the resource is automatically removed from the temporary project. When the temporary project no longer contains any resources or Natural objects, it is automatically removed from the Eclipse workspace.

Caution:
There are some resource types (for example, icons) for which an internal editor is not available. In this case, an external program is started which is registered as the system default editor for that file type. When you close an external program, Eclipse (and thus NaturalONE) is not aware of this. As a result, the resource is not removed from the temporary project. In this, case you have to delete the resource manually from the temporary project and, if the resource was the last object in the temporary project, you also have to delete the temporary project manually.

Top of page

Working with Private-mode Libraries

When you switch on private mode in the properties of a Natural project which is located in the Eclipse workspace, one or more private-mode libraries are automatically created on the associated Natural server when you build the project. These private-mode libraries are visible in the Natural Server view.

It is not possible to change a private-mode library in the Natural Server view, and it is not possible to change any object in a private-mode library (for example, it is not possible to edit such an object). The corresponding commands in the context menu are unavailable (gray).

For further information, see Private-mode Libraries in NaturalONE in a Nutshell, and the description for private mode in Changing the Project Properties.

Top of page