News in NetPhantom 3.61 Build 1400

The following new features are implemented in NetPhantom 3.61 Build 1400.
 

The Application INI file

In order to use the new features below, a new INI file is required for the application. It should be stored in the same directory as the runtime file (.NPR), but with the file extension ".INI".

If you have an application called MYAPP.NPR in the directory somewhere/myapp, the INI file should be named MYAPP.INI (note: in upper case) in the same directory. The text file should be saved in ISO-8859-1 codepage (e.g. the same codepage as for "normal" HTML pages [notepad], i.e. not in EBCDIC).

Example of an INI file for an application:

[base]
something=0
 
[clientProperties]
someProperty=X
another=Y

Client properties for an application

Client properties can now be defined in the Application INI file (as described above), in the [clientProperties] section.

These properties will be transferred to the client upon initialization of the runtime file and can be retrieved with the Java API function SessionManager.getProperty. In cases where multiple runtime files are used ("merge on-the-fly"), the initialization of the runtime file depends on the matching host screen and can sometimes be done in a later stage, thus not directly when the client connects to the server.

Example of an application INI File

[base]
privateClassLoader=1
tooltipTextFile=MYAPP.TT
 
[clientProperties]
desktop.color=0xC0C0C0
desktop.image=15Image/spaceman.gif
tooltip.initialDelay=10
tooltip.dismissDelay=30000
tooltip.reshowDelay=10

Bitmap in application area

The application area attributes (where panels are displayed when running inside an application panel or a browser) can now be specified.

In the application.INI file, specify the entry desktop.image=xpFileName and desktop.color in the [clientProperties] section as described below.

The desktop.image setting uses two parameters x and p just in front of the file name. These parameters indicate:

  • x how the bitmap should be stretched, 0=no stretching, 1=stretch but keep the aspect/ratio, 2=stretch to fit in desktop area.
  • The second parameter y indicates the position of the bitmap when not stretched to fit in the desktop area with a number position similar to the numeric keypad on the keyboard, i.e. 7=top-left, 8=top-middle, 9=top-right, 4=left-center, 5=center, 6=right-center, 1=bottom-left, 2=bottom-center, 3=bottom-right.

The FileName parameter should be a file relative to the RESURL of the client (e.g. "Image/myback.gif") or a specification of how and where to load the image (e.g. "http://myserver/Image/myback.gif").

When many runtime files are used ("merge on-the-fly") and one bitmap has been set for the desktop area and a new runtime file becomes initialized, the bitmap will remain unless the new runtime file has specified a new image in the Application INI file (or an empty bitmap).
 

Background color in application area

Similar to the bitmap specification, a background color can be set for the application area when a bitmap that is not stretched to fit the panel is not present.

Specify the entry desktop.color=color in the [clientProperties] section in the application INI file. This setting must be an RGB (Red-Green-Blue) value in hexadecimal format, e.g. "0xC0C0C0" for dark gray, or a name of a system property (that specifies the color).

For example, the setting desktop.color=0x005C5C could be a desktop background color.

The bitmap and color properties can also be specified as parameters to the NetPhantom Client, when running as a Java Application:

java se.entra.phantom.client.Phantom
     desktop.image:05http://myserver/image.gif
     desktop.color:0x005C5C

or when running as an Applet:

<applet width="100%" height="100%"
        code="se.entra.phantom.client.Phantom"
        archive="/NetPhantomClient.jar">
  <param name="desktop.image" value="/image.gif">
  <param name="desktop.color" value="0x005C5C">
</applet>

Tooltip text

An application can have tooltip text for every component supporting this in an application, e.g. the pull-down menus, menu items and pushbuttons (entry-field or similar components does not [yet] support this feature due to Java/Swing limitations).

The tooltip text should be either a simple text string (e.g. "Select this item to perform something") or in HTML format (e.g. "<html>This is a longer text that <br>can be written <br>on multiple lines").

On the server side, a Java API is available ("setTooltipText" in VirtualPullDownMenu, VirtualMenuItem and VirtualControl or "setProperty" in VirtualInterface).

For a runtime application, a predefined tooltip text can be specified using the Application INI file setting tooltipTextFile=filename in the [base] section, for example:

[base]
tooltipTextFile=MYAPP.TT

The file "MYAPP.TT" should be in the format described below (in the ISO-8859-1 codepage). Note that PANELID and CONTROLID are separated by a dash (-).

; Comment line begins with a semicolon, but
; comment line(s) are not allowed directly
; after a "PANELID-CONTROLID" line.
; Empty lines are skipped.

PANELID-CONTROLID:
Text that will be displayed on a single line

PANELID-CONTROLID:
<html>A text in HTML format that can be displayed over multiple lines and MUST end with </html>

PANELID-CONTROLID:
*html-filename

The html-filename specifies an external file (relative to the runtime file) and must be a valid HTML file (in the ISO-8859-1 codepage).

The CONTROLID can also be set to *MENUx where x specifies the pull-down menu number (as main pull-down menus do not have a control ID).

Tooltip texts are displayed after a short while when the mouse pointer is moved over a component. However, a longer text may be specified for menu items, and the end-user can sometimes not be able to read all the contents of the tooltip. Special settings for how tooltip texts are displayed for menu items is therefore available and should be specified in the [clientProperties] section of the Application INI file, see below.

The Java/Swing ToolTipManager contains numerous properties for configuring how long it will take for the tooltips to become visible, and how long until they are hidden. Consider a panel that has different tooltip texts based on where the mouse is. When the mouse moves into the panel and over a region that has a valid tooltip, the tooltip will become visible after initialDelay milliseconds. After dismissDelay milliseconds the tooltip will be hidden. If the mouse is over a region that has a valid tooltip, and the tooltip is currently visible, when the mouse moves to a region that doesn't have a valid tooltip the tooltip will be hidden. If the mouse then moves back into a region that has a valid tooltip within reshowDelay milliseconds, the tooltip will immediately be shown, otherwise the tooltip will be shown again after initialDelay milliseconds.

The following settings are available for displaying tooltip texts for menu items:

tooltip.initialDelay The number of milliseconds to delay (after the mouse pointer has paused) before displaying the tooltip.
tooltip.dismissDelay The number of milliseconds to delay before taking away the tooltip.
tooltip.reshowDelay Used to specify the amount of time before the user has to wait initialDelay milliseconds before a tooltip will be shown. That is, if the tooltip is hidden, and the user moves into a region of the same component that has a valid tooltip within reshowDelay milliseconds the tooltip will immediately be shown. Otherwise, if the user moves into a region with a valid tooltip after reshowDelay milliseconds, the user will have to wait an additional initialDelay milliseconds before the tooltip is shown again.

Example Application INI file:

[base]
tooltipTextFile=MYAPP.TT
 
[clientProperties]
tooltip.initialDelay=200
tooltip.dismissDelay=30000
tooltip.reshowDelay=100

Example MYAPP.TT file:

ADMIN-*MENU1:
<html>
<body>Provides file transfer capabilities between
server and client and also to quit the application.
</body>
</html>

ADMIN-*MENU2:
<html>
<body>The following topics are handled here:
<ol>
<li>Licensing,
<li>Configuration of the server,
<li>Access management (users and groups),
<li>Service functions,
<li>Upgrade functions.
</ol>
</body>
</html>

ADMIN-*MENU3:
Handles enabling and reloading of defined and loaded applications

ADMIN-*MENU4:
Performs client related tasks

ADMIN-*MENU5:
Performs server auditing, tracing and event logging tasks

ADMIN-*MENU6:
The About menu

ADMIN-FILEMAN:
One of the most complex panels on the client side!

ADMIN-ABOUT:
The most common panel in all applications!

Private Class Loader

The NetPhantom class loader normally loads Java classes created from REXX files from the CLASSPATH setting of the Java VM. When the application runtime file was located outside the "normal" directory structure, the CLASSPATH had to be adjusted to allow class files to be loaded.

The new private class loader for an application has the same functionality as to adjust the CLASSPATH to include the parent directory of the runtime file, i.e. if an application is loaded from /usr/myuser/mydir/myapps/prod/myapp/MYAPP.NPR, the CLASSPATH for the private class loader would be prepended with the directory /usr/myuser/mydir/myapps/prod before the normal CLASSPATH setting.

To enable the private class loader, specify privateClassLoader=1 in the [base] section of the Application INI file:

[base]
privateClassLoader=1

Hiding unauthorized menu items in Phantom Session Booster

Menu items that a user is not allowed to access are normally disabled in Phantom Session Booster. Support to hide them rather than to disable them is now added for NetPhantom. In order to activate this new setting, specify hideUnauthorizedMenuItems=1 in PSB.INI.