|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.wrq.vhi.script.api.RecordSetEventHandler
public abstract class RecordSetEventHandler
Abstract base class for a recordset event handler. All classes that extend this class appear as recordset handlers in the VHI design tool.
No recordset events will fire until a client makes a recordset request such as fetchRecords(). Once such a request is received, VHI will read the contents of the recordset on a screen by screen basis until enough data has been read to fulfill the client request.
The first step when reading a recordset screen is to determine its location and size. This step cannot be overridden by an event handler, but a recordset can be defined in the model to be the entire screen if need be.
The second step is to determine the location and size of each record. If
the parseScreen(com.wrq.vhi.script.api.ParseScreenEvent)
method is defined, VHI will defer to this method
for determining the record locations and sizes.
The third step is to determine the location and size of each field within
each record. If the parseRecord(com.wrq.vhi.script.api.ParseRecordEvent)
method is defined, VHI will defer
to this method for determining the field locations and sizes. The method
will be called for each record found on the screen.
The fourth step is to read the contents of each field in each record. If
a FieldEventHandler.readField(com.wrq.vhi.script.api.ReadFieldEvent)
method is
defined, VHI will defer to this method for reading each field in the
recordset. The method will be called for each field that needs to be read.
This provides the opportunity to do any needed data translation.
The fifth step is to determine if the current screen is the first or last
of the recordset. If an isTerminated(com.wrq.vhi.script.api.IsTerminatedEvent)
method is defined, VHI will
defer to this method for making the first and last screen determination.
The sixth step is to designate which records should be visible to the
client application and which records are eligible for record insertion.
If a getRecordType(com.wrq.vhi.script.api.GetRecordTypeEvent)
method is defined, VHI will defer to this
method for categorizing the records. Typically blank and repeated records
are excluded at this stage so that they will not be visible to client
applications, regardless of any client provided filter expression.
As part of a recordset fetch or update API call, the client application
can provide a filter expression that constrains the records retrieved or
updated. The evaluation of this filter expression can be overridden by
defining an applyFilter(com.wrq.vhi.script.api.ApplyFilterEvent)
method. If this method is defined, VHI
will defer evaluation of all client filter expressions to this method.
Field Summary |
---|
Fields inherited from interface com.wrq.vhi.script.api.EventHandler |
---|
DEFAULT_TIMEOUT |
Constructor Summary | |
---|---|
RecordSetEventHandler()
|
Method Summary | |
---|---|
boolean |
applyFilter(ApplyFilterEvent event)
Called to apply a client provided filter expression to a record. |
int |
getCurrentHostRecord(GetCurrentHostRecordEvent event)
Called to get the current host record index. |
int |
getRecordType(GetRecordTypeEvent event)
Called to identify the type of record. |
void |
insertRecord(InsertRecordEvent event)
Called to insert a record into the recordset. |
boolean |
isTerminated(IsTerminatedEvent event)
Called to check if this is the last screen in a scroll direction. |
java.util.Map |
parseRecord(ParseRecordEvent event)
Called to obtain the field location and sizes for the specified record. |
java.util.List |
parseScreen(ParseScreenEvent event)
Called to obtain the location and size of records on the current screen. |
void |
updateRecord(UpdateRecordEvent event)
Called to update the contents of the current record. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RecordSetEventHandler()
Method Detail |
---|
public java.util.List parseScreen(ParseScreenEvent event) throws ApptrieveException
Any record marked as partial will be combined by VHI with adjacent partial records upon return from this event. If the last record is marked as partial it will be combined with the first record of the next screen if partial.
See RecordSetEventHandler
for details about when this event is
fired in relation to other recordset events.
NOTE: ScriptHostSession
methods that change the terminal
screen cannot be called within this event.
event
- the event instance
RecordLocation
objects
ApptrieveException
public java.util.Map parseRecord(ParseRecordEvent event) throws ApptrieveException
See RecordSetEventHandler
for details about when this event is
fired in relation to other recordset events.
NOTE: ScriptHostSession
methods that change the terminal
screen cannot be called within this event.
event
- the event instance
FieldLocation
objects
ApptrieveException
public boolean isTerminated(IsTerminatedEvent event) throws ApptrieveException
See RecordSetEventHandler
for details about when this event is
fired in relation to other recordset events.
NOTE: ScriptHostSession
methods that change the terminal
screen cannot be called within this event.
event
- the event instance
IsTerminatedEvent.getScrollDirection()
ApptrieveException
public int getRecordType(GetRecordTypeEvent event) throws ApptrieveException
See RecordSetEventHandler
for details about when this event is
fired in relation to other recordset events.
NOTE: ScriptHostSession
methods that change the terminal
screen cannot be called within this event.
event
- the event instance
GetRecordTypeEvent.NORMAL_RECORD
- Visible to client applications and not an insert locationGetRecordTypeEvent.BLANK_RECORD
- Visible to client applications and an insert locationGetRecordTypeEvent.EXCLUDED_RECORD
- Not visible to client applications and not an insert locationGetRecordTypeEvent.EXCLUDED_BLANK_RECORD
- Not visible to client applications and an insert locationApptrieveException
public boolean applyFilter(ApplyFilterEvent event) throws ApptrieveException
When this event is defined, VHI will bypass its own filter expression processing and defer to this event.
See RecordSetEventHandler
for details about when this event is
fired in relation to other recordset events.
NOTE: ScriptHostSession
methods that change the terminal
screen cannot be called within this event.
event
- the event instance
ApptrieveException
public int getCurrentHostRecord(GetCurrentHostRecordEvent event) throws ApptrieveException
NOTE: ScriptHostSession
methods that change the terminal
screen cannot be called within this event.
event
- the event instance
ApptrieveException
public void updateRecord(UpdateRecordEvent event) throws ApptrieveException
event
- the event instance
ApptrieveException
public void insertRecord(InsertRecordEvent event) throws ApptrieveException
event
- the event instance
ApptrieveException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |