This chapter explains how to use the functions provided by HATS for developing applications in bi-directional languages. Generally its contents apply to both Hebrew and Arabic application developers. The functions that are specific to Arabic users are described separately.
HATS provides these functions to support bi-directional languages:
This chapter explains all these features.
The following are required for bidirectional application support:
The HATS host terminal allows Host On-Demand bi-directional-specific keystrokes, so you can perform the following bi-directional functions. The following host function keys are available for both 3270 and 5250 sessions:
The following host function keys are available only for 3270 sessions:
The following host function key is available only for 5250 sessions:
In bi-directional sessions, screens can be captured either as left-to-right screens or as right-to-left screens. Captured screens are displayed exactly as they were captured. To capture a screen as a right-to-left screen, press Ctrl+S (Screen Reverse) in a left-to-right screen and click Create Screen Capture.
Usually the orientation of a host component is the same as the screen orientation. However, in some cases, the orientation of a host component is the opposite of the general orientation of the screen. When a HATS project uses a bi-directional code page, a check box labeled Component orientation opposite to screen orientation is added to the Insert Host Component wizard. When you add a host component to a transformation, check this box if the host component's orientation is the opposite of the screen orientation. Checking the box enables HATS to recognize command prompts, function keys, selection lists, and menus whose orientation is the opposite of the screen orientation.
There are two special check boxes that provide you, the BIDI application developer, control over widget presentation when your application runs in the WebSphere Application Server:
On a left-to-right screen, when the Widget Orientation check box is selected, the GUI image is changed to be right-to-left. Similarly, when the Text Orientation check box is selected, the text within the GUI image is changed to left-to-right. By default, selection of the Widget Orientation check box causes the Text Orientation check box to be selected also. However, you can deselect this check box if desired.
For example, suppose you have the left-to-right screen that contains following text (capital letters are BIDI data and lower case letters remain as English data):
BIDI TEXT pf01=help
You will customize this screen as RTL. When your application runs, the screen is displayed as:
TXET IDIB pleh=10fp
From the end user point of view, everything is correct except the function key. The function key is recognized, but it is displayed backwards.
For the customized screen to appear correctly, you must select the Widget Orientation opposite to Screen Orientation check box when inserting the function key host component into a customized screen. By default, the Text Orientation opposite to Screen Orientation check box is also selected.
When your application runs, the screen is displayed as:
TXET IDIB pf01=help
When you replace a text input field with a drop-down list in a bi-directional project, the captions of the drop-down list items are not affected by the screen orientation . The captions will always appear in visual LTR format, unless you check the Reverse text in widget check box for the widget. In that case the captions will be appear in visual RTL format.
Also, when creating bi-directional HATS applications, and copying and pasting multiple lines of text from a protected field into a visual input field, the text may be reversed. If you copy and paste one line at a time, the orientation will be preserved.
When global variables are extracted, the extracted data is exactly the data that appears on the screen, including the orientation of the current screen. Any global variables inserted onto a screen as an action of a screen customization are inserted according to the screen orientation.
When you use text replacement in Bidi sessions, there are three additional check boxes you can use:
If you check this box and the Match with RTL Screens check box, the reversed string would match in a left-to-right screen. When Reverse Screen is clicked on a right-to-left screen, data is consistent.
You must check either Match with LTR Screen or Match with RTL Screens.
For example, suppose a left-to-right host screen contains the text: NO on. If you define text replacement to replace "no" with "yes" and ignore the case, the results depend on the boxes you checked, as follows:
| Options selected | LTR screen | RTL screen |
|---|---|---|
| Match LTR screen only | yes on | no ON |
| Match RTL screen only | NO on | yes ON |
| Match LTR screen and RTL screen | yes on | yes ON |
| Match LTR screen and match reversed screen | yes on | no sey |
| Match RTL screen and match reversed screen | NO sey | yes ON |
| Match LTR and RTL screen and match reversed screen | yes sey | yes sey |
You can provide a Screen Reverse button on bi-directional Web pages for the convenience of your end users. The button appears on the application keypad in the template. Clicking the button toggles the screen orientation--the operation performed on legacy systems by pressing the Alt+Enter keys.
When you create a new HATS project and select a bi-directional code page, two additional check boxes appear: Enable screen reverse for uncustomized screens and Enable screen reverse for customized screens. These check boxes determine whether the Screen Reverse button appears on these screens. Initially, only the first box is enabled. If you check the first box, the second box is enabled. There is no way to check only the second box.
An uncustomized screen is one that was not matched by any screen customization. An uncustomized screen, when viewed by the end user, has the same screen orientation as the previous screen. If the first screen is uncustomized, it defaults to left-to-right. If the screen orientation was changed on a previous screen, it is inherited by the next uncustomized screen and reset by the next customized screen.
The initial screen orientation of customized screens is the same as it was when the screens were customized. For both customized and uncustomized screens, clicking Screen Reverse changes the screen orientation. During screen recognition, a reversed screen is considered different from the same screen before the screen has been reversed. Therefore, Screen Reverse could cause a screen not to be recognized. If the developer is confident that all host components that appear on a customized screen are oriented properly, there is no need to enable the Screen Reverse button for that screen. It is advisable to disable the Screen Reverse button for customized screens.
When the user clicks Screen Reverse, the screen is refreshed and any entries the user has typed are erased.
End users of HATS applications using bi-directional code pages can perform some operations unique to these applications. Provide the information in this section to your end users. If you implement a Screen Reverse button, inform them about its use.
HATS applications using bi-directional code pages offer a special input field called a visual input field. Unlike regular fields, which implement logical data input and presentation, the visual field implements visual data input and presentation. When entering data in a visual field, you can use these functions:
These functions are specific to projects using Arabic code pages.
These options are effective only in Arabic 3270 sessions. If symmetric swapping is enabled, swapping characters are swapped in right-to-left screens. If numeric swapping is enabled, English numerals are replaced by Arabic numerals in right-to-left screens and Arabic numerals are replaced by English numerals in right-to-left Screens. These parameters are set on the Advanced Connection Settings tab of the project editor. HATS host terminal is affected by symmetric swapping and numeric swapping parameters set by the user when creating the application. The parameters are identified respectively as symmetricSwapEnabled and numericSwapEnabled, and the values of the parameters is either true or false.
For an Arabic session with right-to-left captured screens, brackets and numerals are affected by the symmetric and numeric swapping options of the application. With WebSphere Studio Application Developer Version 4, to correctly view Arabic numbers the digit substitution should be set to "Contextual" in the regional settings.
When a project uses an Arabic code page, screen customization event (.evnt) files have an additional <orientation>true</orientation> tag within the description tag. A value of true indicates that the screen is customized as a right-to-left screen; otherwise it is customized as left-to-right.
When a project uses any bi-directional code page, the application (.hap) file has an additional enableScrRev attribute of the <session> tag, that can have the following values:
When a project uses any bi-directional code page, the application (.hap) file has additional attributes for the <replace> tag within the <textReplacement> tag:
Two Bidi APIs for handling text conversion from visual to logical and vice versa are included in the HostScreen class, so you can use these APIs when creating custom widgets and components to handle extraction of data.