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:
- Support of bidirectional code pages
- Correct bidirectional text processing and symmetric swapping
- Support of left-to-right and right-to-left screen customization
- Support of bidirectional functionality that was available in Host Publisher
- Support of left-to-right and right-to-left pages and controls for Integration Objects
- A Screen Reverse button to toggle between left-to-right (LTR) and right-to-left (RTL) screen orientation
- Different levels of user control over screen orientation
- Control over the orientation of host components, widgets, and text, which may be opposite to general screen orientation
- Optional recognition of both right-to-left and left-to-right components in default rendering (uncustomized screens)
- Mixed bidirectional text may be used in selection lists and function key settings
- Visual Input Field support, including Auto Field Reverse support
- Bidirectional text in global variables and text replacement, including different algorithms for text replacement in screens with left-to-right and right-to-left orientation.
- Right-to left printing support in 3270 sessions
- Support for VT logical and visual bidirectional sessions including correct insertion and extraction
- Global rules using bidirectional text
- Bidi support of SWT Terminal
This chapter explains all these features.
Software environment
The following are required for bidirectional application support:
- The supported browser and its version is Internet Explorer version 5.5 or higher.
- The default locale of the machine where WebSphere Studio is installed should be set to Arabic for Arabic users and Hebrew for Hebrew users.
- The default locale for the end user client machine must be set to Arabic for Arabic users and Hebrew for Hebrew users.
- For data input in bidirectional code pages to be processed correctly, UTF-8 must be specified for Hebrew and Arabic locales as follows:
For WebSphere Application Server version 5, on the Settings page for the application server, click Process Definition > JVM and specify -Dclient.encoding.override=UTF-8
To support correct bidirectional data input in WebSphere Studio V5
- Select Windows >Preferences
- Go To Workbench then Editors
- In the Text file encoding click Other
- Enter UTF-8 value from the drop-down List
To support correct bidirectional data input in the Run on Server, follow these steps:
- Go to Server perspective
- Open .wsi file (double-click)
- Go to Environment tab
- Modify encoding in the encoding.properties file manually for bidirectional language to be UTF-8
- 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
- Dot "." and slash "/" characters in the keypad part of the keyboard are not displayed correctly in case on English keyboard layout and Arabic language layer.
- Arabic character "Tatweel" with English keyboard and Arabic language is typed as "ZAL" character you can use "shift+J" combination to type "Tatweel" Character.
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:
- Over the whole customized screen, in case of Prepopulated with host components in the new transformation wizard.
- Over selected specific widgets, in the case of the Insert HATS Component wizard. This control is done by two special check boxes that appear to bidirectional application developer in Studio in , new transformation wizard and Insert Host Component Wizard. These two check boxes are:
- Widget Orientation opposite to Screen Orientation
- Text Orientation opposite to Screen Orientation.
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=helpYou will customize this screen as RTL. When your application runs, the screen is displayed as:
TXET IDIB pleh=10fpFrom 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=helpWhen 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.
- Enable Symmetric Swapping: If symmetric swapping is enabled, swapping characters are swapped with RTL file printing.
- Enable Numeric Swapping: If numeric swapping is enabled, English numerals are replaced by Arabic numerals and Arabic numerals are replaced by English numerals with RTL file printing.
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 :
- If you create Model I Web pages, you are provided with the ability to set the resulting browser's page default orientation (LTR or RTL) through the Screen Orientation radio button option for each Create Model I Web pages dialog.
- If you define input/output properties will be provided with the ability to set the text orientation (LTR or RTL) for each input/output property through the Text Orientation radio button option for each Input or Output Property Definition dialog.
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:
- Disable shaping for password fields:
When you create a new HATS project and select an Arabic code page, this check box appears. It determines whether the shaping for password fields is enabled or disabled. Hence it determines if the Arabic data of password fields will be submitted to the host in isolated or shaped form.
- Disable field shaping:
This check box appears in the Insert Host Component wizard . It determines if the Arabic data, inside input fields in this selected region, will be submitted to the host in isolated or shaped form
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:
- System value QCCSID (37). This is for the English language to allow the HTTP, TomCat, and background server to start properly if they need to use POSIX characters not represented in code page 420.
SCS reports:
- The report's code page is picked up from spool file's Character set identifier (CHRID) reflected in the printer file parameter (CHRID) that is picked up from the device description then system value. To display Arabic characters properly if the system value QCCSID is not set to 420 perform the following:
- CHGPRTF or OVRPRTF with the Character identifier parameter CHRID(235 420). Graphic character set 235 and Code page 420.
- Regenerate the spool file.
AFP reports:
- Add the fonts and overlay report to the resource library list in one of the two methods:
- Add the library QFNTAR3 to system library list system value QSYSLIBL
- Add the resource libraries containing the overlays and fonts to the printer file parameter: User resource library list USRRSCLIBL. This parameter overrides the system value setting above and does not check the rest of the libraries defined in system library list
Regenerate the spool file.
Other considerations
- To view Arabic numbers correctly in widget previews and in the deployed HATS application, digit substitution should be set to "None" in the regional settings.
- Screen recognition should always be done with whole Arabic words and not with a part of an Arabic word.
- Bidi functions are not supported in the transformation design, this is due to a limitation in the WebSphere Studio V5 JSP design with bidi data.
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