abbreviationdb
Class FieldHandler

java.lang.Object
  extended by com.wrq.vhi.script.api.FieldEventHandler
      extended by abbreviationdb.FieldHandler
All Implemented Interfaces:
com.wrq.vhi.script.api.EventHandler

public class FieldHandler
extends com.wrq.vhi.script.api.FieldEventHandler

Translate recordset field codes using a database.

This class overrides the readField event so that the cryptic codes contained in the host application display can be translated into a more readable form for use in the client application.


Field Summary
static java.lang.String description
           
static int readFieldTimeout
          Timeout in seconds for the readField() event.
static int writeFieldTimeout
          Timeout in seconds for the writeField() event.
 
Fields inherited from interface com.wrq.vhi.script.api.EventHandler
DEFAULT_TIMEOUT
 
Constructor Summary
FieldHandler()
           
 
Method Summary
 java.lang.String readField(com.wrq.vhi.script.api.ReadFieldEvent event)
          Translate codes when reading database fields.
 
Methods inherited from class com.wrq.vhi.script.api.FieldEventHandler
writeField
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

description

public static final java.lang.String description
See Also:
Constant Field Values

readFieldTimeout

public static final int readFieldTimeout
Timeout in seconds for the readField() event. A value of DEFAULT_TIMEOUT means the event will use the model defined default event timeout.

See Also:
Constant Field Values

writeFieldTimeout

public static final int writeFieldTimeout
Timeout in seconds for the writeField() event. A value of DEFAULT_TIMEOUT means the event will use the model defined default event timeout.

See Also:
Constant Field Values
Constructor Detail

FieldHandler

public FieldHandler()
Method Detail

readField

public java.lang.String readField(com.wrq.vhi.script.api.ReadFieldEvent event)
                           throws com.wrq.apptrieve.agent.ApptrieveException
Translate codes when reading database fields.

Look up the code value contained in the field in a database. If a translation exists the translation is returned, otherwise the original code is returned.

Errors which occur when performing a translation are written to the Verastream log. In particular, missing abbreviations are logged so that they can be added to the database.

Overrides:
readField in class com.wrq.vhi.script.api.FieldEventHandler
Parameters:
event - the event instance
Returns:
the translated field value, if one exists, else the original field contents
Throws:
com.wrq.apptrieve.agent.ApptrieveException