Bidirectional application support

This chapter explains how to use the functions provided by HATS for developing applications in bidirectional 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 bidirectional languages:

This chapter explains all these features.

 

Software environment

The following are required for bidirectional application support:

To support correct bidirectional data input in WebSphere Studio V5

  1. Select Windows >Preferences
  2. Go To Workbench then Editors
  3. In the Text file encoding click Other
  4. Enter UTF-8 value from the drop-down List

To support correct bidirectional data input in the Run on Server, follow these steps:

  1. Go to Server perspective
  2. Open .wsi file (double-click)
  3. Go to Environment tab
  4. Modify encoding in the encoding.properties file manually for bidirectional language to be UTF-8
  5. Put in Java VM arguments -Dclient.encoding.override=UTF-8

 

Work with the host terminal

The HATS host terminal allows Host On-Demand bidirectional-specific keystrokes, so you can perform the following bidirectional functions. The following host function keys are available for both 3270, 5250 and VT sessions:

Ctrl+L: Latin Layer

This key combination changes the language layer to Latin and the operator information area (OIA) is updated to show English Language.

Ctrl+S: Screen Reverse

If the screen orientation is left-to-right, this key combination changes the screen image to right-to-left and the language layer changes to Bidi. If the screen orientation is right-to-left, this key combination reverses the screen image to left-to-right and the language changes to Latin. This is not available in VT visual sessions.

Ctrl+N: Bidi Layer

This key combination changes the language layer to Bidi and the OIA is updated to show Bidi Language.

Ctrl+F: Field Reverse

If the field orientation is left-to-right, this key combination changes the field orientation to right-to-left, the cursor moves to the other side of the field, and the language layer becomes Bidi. If the field orientation is right-to-left, this key combination changes the field orientation to left-to-right, the cursor moves to the other side of the field, and the language layer becomes Latin. This is for 5250 sessions only.

The following host function keys are available only for 3270 sessions:

Ctrl+P: Push

You can enter and edit text in the opposite direction from the field direction.

Ctrl+O: End Push

Push mode is ended and the cursor moves to the end of the push segment.

Ctrl+A: Auto Push

You can type mixed left-to-right and right-to-left text by changing the language layer.

The following host function key is available only for 5250 sessions:

Ctrl+C: Close

The data entered in one keystroke direction (either left-to-right or right-to-left) is concatenated with the data that was previously entered in the opposite direction. The cursor direction is set to be the same as the field direction, and the language layer is set to the default for the field direction. If the screen orientation is currently left-to-right, the cursor is positioned at the first null to the right of the concatenated text. If the screen orientation is currently right-to-left, the cursor is positioned at the first null to the left of the concatenated text.

The following host function keys are available only for Arabic VT sessions:

Ctrl+K: Column heading

Column heading mode causes blanks between columns of text to break insertions so the English titles to columns of data maintain their correct position.

The following host function keys are available only for Hebrew VT sessions:

Ctrl+D : Cursor direction

If the current cursor direction is left-to-right, pressing Ctrl+D changes it to right-to-left, and back again. This function is allowed for visual text type only. When the cursor direction is set to right-to-left, this does not affect cursor addressing and moving, insert and delete characters, erase in line or erase in display. The following functions are affected by right-to-left cursor direction settings:

  • Backspace (the cursor moves one position to the right)
  • Carriage return (the cursor moves to the right most position on the current line)
  • Line feed (the cursor moves to the right most position of the next line)
  • Typing in the auto wrap mode (current line is continued from right most position of the next line)

Ctrl+D : Character set modes

This function switches between 7-bit and 8-bit character sets. If the current character set is DEC Hebrew (8-bit) or ISO Hebrew Supplemental (8-bit), pressing Ctrl+B changes the current character set to Hebrew NRCS (7-bit). If the current character set is Hebrew NRCS (7-bit), pressing Ctrl+B loads one of two 8-bit character sets based on the following rule:

  • If the session is configured with one of the 8-bit character sets, that session's 8-bit character set will be loaded. If the session is configured with 7-bit character set, ISO Hebrew Supplemental will be loaded. The current language layer and cursor direction are not changed.

For Arabic users only the following limitations appear with both System keyboard layout English and Arabic 101

These limitations disappear with Arabic keyboard 102.

 

Capturing screens

In bidirectional 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.

 

Recognizing bidirectional host components

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 bidirectional 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 InputWithHints whose orientation is the opposite of the screen orientation.

Mixed bidirectional text may be used in Selection lists and Function keys settings. It means that strings like: BIDI1 = BIDI2 , where BIDI1 and BIDI2 are segments of bidirectional text, may be recognized as function keys and selection lists .

By default, only left-to-right components may be recognized in uncustomized screens (as in an English session). However, selection of "recognition of RightToLeft components" property in the Project Settings dialog, under the Rendering Settings tab will enable recognition of both left-to-right and right-to-left components in uncustomized screens ( default rendering).

 

Controlling the orientation of widgets

There are two special check boxes that provide you, the bidirectional 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 bidirectional 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, 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 bidirectional 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 bidirectional 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.

 

Global variables

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.

 

Text replacement

When you use text replacement in bidi sessions, there are three additional check boxes you can use:

Match with LTR screens

This option allows text replacement to be performed correctly for text on a left-to-right display screen.

Match with RTL screens

This option allows text replacement to be performed correctly for text on a right-to-left display screen.

Match with reversed screen

If you check this box and the Match with LTR screen check box, the reversed string would match in a right-to-left screen. When Reverse screen is clicked on a left-to-right screen, the data is consistent.

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:

Table 9. Bidirectional text replacement options and results
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

 

Enabling the user to reverse the screen direction

You can provide a Screen Reverse button on bidirectional 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 bidirectional 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.

Enabling the Screen Reverse button to the user of an Arabic application will enable another check box to control shaping orientation. For more information see: Functions for Arabic code pages

 

VT bidirectional display options

For VT bidi sessions, some specific bidi properties need to be set to the terminal to work correctly for bidi users. A VT BIDI display options button which appears in the Connection Settings panel is added to access these options:

Text type (Hebrew)

Determines the format of the text characters stored. Select Visual or Logical. The default is Visual.

Cursor direction (Hebrew Visual)

Sets the cursor direction left-to-right (LTR) or right-to-left (RTL). When cursor direction is set RTL, all characters are displayed in the RTL direction because the cursor moves left by default after each displayed character. In general, only applications that are designed to receive input in a RTL direction will work properly when the Cursor Direction is set to RTL. The default is LTR.

Smart Ordering (Arabic/Hebrew Logical)

Determines whether segments of characters with different text attributes are ordered separately. The default is Off.

Show Text Attributes (Arabic/Hebrew Logical)

Enabled only when Smart Ordering is On. The default is Yes.

 

Right-To-Left printing support

Bidirectional files could be either RTL or LTR files and in order to print correct RTL data, the developer should check theEnable RTL printing check box which appears in the Advanced tab under Connection > Main settings in bidi 3270 sessions

This check box will be enabled if printing is enabled.

In case of Arabic Applications, enabling RTL printing will enable the following two check boxes.

 

Integration Objects support

Integration Objects bidi support means the correct reordering of extracted/inserted data in runtime and full control by the application developer over screen and extraction/insertion controls orientation using high level GUI.

To Support the above requirement :

 

Information for end users

End users of HATS applications using bidirectional 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 bidirectional 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:

Alt+Shift: Language selection

This key combination toggles the language layer back and forth between Latin and the bidirectional language.

Alt+Enter: Screen reverse

This key combination reverses the direction of the screen.

Shift+NumLock: Push

You can enter and edit text whose direction is opposite from the field direction.

Shift+NumPad "/" character: End push

Push mode is ended and the cursor moves to the end of the push segment.

Alt+NumPad "/" character: Auto push

You can type mixed left-to-right and right-to-left text by changing the language layer. Autopush is especially useful for typing digits in right-to-left fields. The push and end push functions are automatically activated according to the language of the text being typed. In right-to-left fields, typing a digit or a Latin letter causes the automatic initiation of push, without a language change. Additional Latin letters or digits will continue the push mode; any other character automatically terminates push mode. This feature allows you to type bidirectional text with imbedded numbers or Latin words without using push and end push. In left-to-right fields, typing a bidirectional character causes the automatic initiation of push. Typing any digit or Latin character causes the automatic termination of the mode. This enables the end user to type Latin text with imbedded bidirectional words by using language layer selection rather than push and end push.

 

Auto Field Reverse

Alt+NumPad 5

  • When auto field reverse is enabled, upon initial entry to an alphanumeric field, the field orientation will be set to right-to-left (for both left-to-right and right-to-left screen orientations).
  • When auto field reverse is enabled, upon initial entry to a numeric field, the field orientation will be set to left-to-right (for both left-to-right and right-to-left screen orientations).
  • When auto field reverse is disabled, upon initial entry to a field (whether numeric or alphanumeric), the field orientation is always set equal to the screen orientation.

When Auto Field Reverse is activated all fields, with the exception of password fields will have the same (described above) behavior. In 3270 sessions right-to-left screens, auto field reverse is the default mode of operation.

 

Field Reverse

Alt+Numlock

When field reverse is activated, typing orientation in current (focused) field will be changed. If the field is empty, cursor will be adjusted to the opposite side of the field. When field is not empty, the cursor position will not change. Field reverse is active only in the current field. When focus is lost, the typing orientation returns to its previous value.

 

Status Area

The status area of the visual input field provides information about the current field type (numeric or alphanumeric), auto field reverse mode status (on/off), typing orientation (switched by field reverse keys) and AutoPush mode status(on/off). For Arabic Sessions, Numerals Shaping Status, whether Arabic or English, is outlined in status bar.

 

iSeries 5250 Unicode support

Bidirectional text that appears in Unicode fields that use 5250 systems will now be processed correctly. Instead of using visual input field these fields will have a contextual orientation (according to first strong character).

 

Functions for Arabic code pages

These functions are specific to projects using Arabic code pages.

 

Shaping Direction

In some cases users would like to edit a file in both screen orientations. In the previous HATS release the shaping of submitted Arabic data was dependent on runtime screen orientation. So that a LTR file "File initially created and saved in a LTR screen" should be edited only in a LTR screen and a RTL file "File initially created and saved in a RTL screen" should be edited only in RTL screen to ensure correct shaping of Arabic data.

RTL Shaping has been added in HATS Version 5 release to remove this limitation. Deselecting this option informs HATS that the user is currently editing LTR file "independent of screen orientation". Selecting this option informs HATS that the user is currently editing RTL file independent of screen orientation, thus the same Arabic shaped data could be submitted correctly in both screen orientations, without the drawback of submitting wrong shapes in previous release. Arabic users should ensure before editing and submitting LTR file that this option is unchecked. They should also ensure that this option is checked before editing and submitting RTL file. This check box appears only if the developer enables the screen reverse button while configuring the application in WebSphere Studio.

 

Arabic selective shaping

In some cases you may need to send your data to the host in isolated format. To meet such requirements a field disable shaping property has been added for Arabic sessions through 2 check boxes:

 

Symmetric and numeric swapping

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.

 

Screen captures

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.

 

Set Arabic printing sessions on iSeries Web Access (iWA)

Following is a summary of the settings to present Arabic data properly on iSeries Web Access.

For Global settings:

SCS reports:

AFP reports:

 

Other considerations

 

Additions to HATS files

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 bidirectional code page, the connection (.hco) file has an additional enableScrRev attribute of the <hodconnection> tag, that can have the following values:

(blank)

The Screen Reverse button is not placed on any screens.

NotCustomized

The Screen Reverse button is placed only on screens that do not match a screen customization.

Customized

The Screen Reverse button is placed on all screens.

When a project uses any Arabic code page, the connection (.hco) file has an additional disableFldShp attribute of the <hodconnection> tag that can have either true or false values

If printing is checked in 3270 session an additional printRTLSupport setting will appear in <classSetttings> tag. For Arabic 3270 sessions, another two settings will appear for symmetric and numeric swapping which are printSymSwapSuppot and printNumSwapSupport. All these printing settings have values of true or false equivalent to enable or disable of the feature.

When a project uses any bidirectional code page, the application (.hap) file has additional attributes for the <replace> tag within the <textReplacement> tag:

matcher

Text is to be replaced when the screen orientation is left-to-right.

maltreat

Text is to be replaced when the screen orientation is right-to-left.

matchReverse

Text is to be replaced when the screen orientation is reversed.

 

Home