HATS 7.5.1 Web API Reference

Publicly accessible methods not documented here are for IBM internal use only and may change in a future release of the product.

com.ibm.hats.common.customlogic
Class HatsHpCustomListener

java.lang.Object
  extended by com.ibm.hats.common.customlogic.HatsHpCustomListener
All Implemented Interfaces:
MacroCustomActionListener, ECLCustomRecoListener, Serializable, EventListener

public class HatsHpCustomListener
extends Object
implements ECLCustomRecoListener, MacroCustomActionListener, Serializable

Class Name: HatsHpCustomListener
Class Type:
Normal
Base Class:
None
Intf Class:
ECLCustomRecoListener, MacroCustomActionListener
Description:
This class supports custom logic as working in the HostPublisher release to work within HATS.

Format for ScreenToValue Parms are:
HPubRegionToVal | COMPARISONOPERATOR | COMPARISONDATATYPE |TOP | LEFT | BOTTOM | RIGHT | COMPARISONTEXT
COMPARISONOPERATOR = { <, <=, =, >, >= }
COMPARISONTYPE = {TEXT, TEXTIGNORECASE, NUMERIC, }
Separator is | (shift \ on keypad), and there is no final termination character

Example:
HPubRegionToVal | <= | NUMERIC | 10 | 10 | 20 | 22 | 150
HPubRegionToVal | = | TEXT | 5 | 5 | 5 | 10 | RALVMS

Format for ScreentoScreeenParms:
HPubRegionToRegion | COMPARISONOPERATOR | COMPARISONDATATYPE | TOP | LEFT | BOTTOM | RIGHT | TOP2 | LEFT2 | BOTTOM2 | RIGHT2 |

Note: other customreco ids may not have all these separators, but should have at least 1 - i.e, <customreco id="HPubExtractFieldAttributes|" optional="false" invertmatch="false" />

See Also:
ECLCustomRecoListener, MacroCustomActionListener, Serialized Form

Field Summary
 boolean debugON
          Boolean for whether in debug mode or not.
static String FIXEDLOOP_CUSTOM_ID
          String constant for custom ID for fixed iteration looping.
static String FIXEDLOOP_INCREMENT_ID
          String constant for ID for fixed iteration loop incrementing.
static String HPUBREGIONTOREGION_CUSTOM_ID
          String constant for custom ID for region to region.
static String HPUBREGIONTOVAL_CUSTOM_ID
          String constant for custom ID for region to value.
 
Constructor Summary
HatsHpCustomListener()
           
 
Method Summary
static String convertDBCStoSBCS(String text, String codePageString, boolean unicodeField, boolean bUseAccentedCharacters)
          A method used to convert a DBCS string to its SBCS equivalent by removing the doubled-up DBCS characters.
 boolean DoReco(ECLCustomRecoEvent e)
          This is the code that handles the fixed iteration looping and the advanced recognition that existed in Host Publisher.
 void execute(MacroCustomActionEvent mcaEv)
          We need this for fixed iteration looping - a custom action is used to increment the loop.
 int getLoopIterationCount()
          Loop iteration count, tracked iteration count via the Custom Action.
 void halt(MacroCustomActionEvent e)
          Halt.
 int incrementLoopIterationCount()
          Increments loop iteration count.
 boolean isBIDIReverse()
          This fuction is used to check if the orientation of the terminal is different than the orientation of the screen captured, if so it will reverse the descriptior for the screen captured to match those coming from the host.
static String massageString(String text)
          Adjusts strings before comparisons to account for DBCS spaces and SO/SI characters.
 void setBIDIReverse(boolean flag)
          Sets the BIDI reverse.
static boolean stringIsHPubCustomID(String id)
          Evaluates whether or not the given string is a known entity by this code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HPUBREGIONTOVAL_CUSTOM_ID

public static final String HPUBREGIONTOVAL_CUSTOM_ID
String constant for custom ID for region to value.

See Also:
Constant Field Values

HPUBREGIONTOREGION_CUSTOM_ID

public static final String HPUBREGIONTOREGION_CUSTOM_ID
String constant for custom ID for region to region.

See Also:
Constant Field Values

FIXEDLOOP_CUSTOM_ID

public static final String FIXEDLOOP_CUSTOM_ID
String constant for custom ID for fixed iteration looping.

See Also:
Constant Field Values

FIXEDLOOP_INCREMENT_ID

public static final String FIXEDLOOP_INCREMENT_ID
String constant for ID for fixed iteration loop incrementing.

See Also:
Constant Field Values

debugON

public boolean debugON
Boolean for whether in debug mode or not.

Constructor Detail

HatsHpCustomListener

public HatsHpCustomListener()
Method Detail

stringIsHPubCustomID

public static boolean stringIsHPubCustomID(String id)
Evaluates whether or not the given string is a known entity by this code.

Parameters:
id - The ID from the tag.
Returns:
Boolean matched, whether or not the string id is acceptable.

getLoopIterationCount

public int getLoopIterationCount()
Loop iteration count, tracked iteration count via the Custom Action. It is set to 0 when the loop is complete.

Returns:
The count of iterations of the loop.

incrementLoopIterationCount

public int incrementLoopIterationCount()
Increments loop iteration count.

Returns:
The count of iterations of the loop.

execute

public void execute(MacroCustomActionEvent mcaEv)
We need this for fixed iteration looping - a custom action is used to increment the loop.

Specified by:
execute in interface MacroCustomActionListener
Parameters:
mcaEv - The MacroCustonActionEvent object.
See Also:
MacroCustomActionListener.execute(MacroCustomActionEvent)

halt

public void halt(MacroCustomActionEvent e)
Halt. Not currently implemented.

Specified by:
halt in interface MacroCustomActionListener
Parameters:
e - The MacroCustomActionEvent object.
See Also:
MacroCustomActionListener.halt(MacroCustomActionEvent)

DoReco

public boolean DoReco(ECLCustomRecoEvent e)
This is the code that handles the fixed iteration looping and the advanced recognition that existed in Host Publisher. It follows the ECLCustomRecoListener method.

Specified by:
DoReco in interface ECLCustomRecoListener
Parameters:
e - The ECLCustomRecoEvent object.
See Also:
ECLCustomRecoListener.DoReco( ECLCustomRecoEvent )

convertDBCStoSBCS

public static String convertDBCStoSBCS(String text,
                                       String codePageString,
                                       boolean unicodeField,
                                       boolean bUseAccentedCharacters)
A method used to convert a DBCS string to its SBCS equivalent by removing the doubled-up DBCS characters. We need this method when doing custom screen recognition - DoReco(ECLCustomRecoEvent e). When we call HOD's ECLPS.GetScreenRect(cahr[], int, int, int, int, int, ECLPS.TEXT_PLANE) on a DBCS Presentation Space, we are returned a double-byte string in the char[] that we passed in. If we try to compare this char[] to a SBCS string, we will get erroneous results. Therefore, we need to convert the DBCS string to a SBCS string.
EXAMPLE:
   Input:  "abc(SO)##$$%%(SI)abc..." (here '#' '$' and '%' represent DBCS chars)
  Output:  "abc(SO)#$%(SI)abc..."
The "(SO)" symbol represents the transition from SBCS to DBCS, and the "(SI)" symbol represents the transition from DBCS to SBCS.

Parameters:
text - The DBCS String to convert to SBCS.
codePageString - The String that represents EBCDIC code page.
unicodeField - The Boolean for Unicode Field.
bUseAccentedCharacters - The Boolean that represents the switch for accented character support.
Returns:
The SBCS equivalent of the DBCS string passed in.

massageString

public static String massageString(String text)
Adjusts strings before comparisons to account for DBCS spaces and SO/SI characters.

Parameters:
text - The text to readjust.
Returns:
The resultant massaged text.

isBIDIReverse

public boolean isBIDIReverse()
This fuction is used to check if the orientation of the terminal is different than the orientation of the screen captured, if so it will reverse the descriptior for the screen captured to match those coming from the host. This support was added for compare Region to value criterion.

Returns:
Returns true if reverse, false otherwise.

setBIDIReverse

public void setBIDIReverse(boolean flag)
Sets the BIDI reverse.

Parameters:
flag - Boolean flag setting BIDI reverse.

HATS 7.5.1 (201005110649)