com.wrq.vhi.script.api
Interface InsertRecordEvent

All Superinterfaces:
EntityEvent, Event, HostSessionEvent, ModelEvent, RecordSetEvent

public interface InsertRecordEvent
extends RecordSetEvent

Insert record event information.

See Also:
RecordSetEventHandler.insertRecord(com.wrq.vhi.script.api.InsertRecordEvent)

Method Summary
 void defaultInsertRecord()
          Searches for suitable record as defined in the model, executes the before insert operation, writes the fields, and executes the after insert operation.
 void defaultInsertRecord(java.util.Map values)
          Searches for suitable record as defined in the model, executes the before insert operation, writes the fields and executes the after insert operation.
 void findInsertLocation()
          Search for a suitable insertion location as defined in the model and make that the current record.
 RecordSetScreen getCurrentRecordSetScreen()
          Fetches all records (including blank, repeated, filtered etc) on the current screen.
 java.util.Map getFieldWriteValues()
          Gets the set of fields and associated values to be written.
 void setCurrentRecordIndex(int index)
          Sets the current record index.
 void writeField(java.lang.String name, java.lang.String value)
          Writes the specified field to the current record on the screen.
 
Methods inherited from interface com.wrq.vhi.script.api.RecordSetEvent
getPageNumber, getRecordSetContext, getRecordSetMetaData, getRecordSetName
 
Methods inherited from interface com.wrq.vhi.script.api.EntityEvent
getEntityName, getTabStops
 
Methods inherited from interface com.wrq.vhi.script.api.ModelEvent
getClientSession, getCurrentOperation, getCurrentProcedure, getModelContext
 
Methods inherited from interface com.wrq.vhi.script.api.Event
checkForTimeout, createErrorMessage, createErrorMessage, createHostSession, createUserErrorMessage, getEventStack, getHandlerProperty, getLogger, isDesignEnvironment
 
Methods inherited from interface com.wrq.vhi.script.api.HostSessionEvent
getHostSession
 
Methods inherited from interface com.wrq.vhi.script.api.ModelEvent
getClientSession, getCurrentOperation, getCurrentProcedure, getModelContext
 
Methods inherited from interface com.wrq.vhi.script.api.Event
checkForTimeout, createErrorMessage, createErrorMessage, createHostSession, createUserErrorMessage, getEventStack, getHandlerProperty, getLogger, isDesignEnvironment
 

Method Detail

getFieldWriteValues

java.util.Map getFieldWriteValues()
Gets the set of fields and associated values to be written. The values in the map can be modified and the map used as a parameter to the defaultInsertRecord(java.util.Map) method.

Returns:
A map of field names to field values

getCurrentRecordSetScreen

RecordSetScreen getCurrentRecordSetScreen()
                                          throws ApptrieveException
Fetches all records (including blank, repeated, filtered etc) on the current screen. This useful for finding the correct insertion location in the recordset.

Returns:
the records on the current screen
Throws:
ApptrieveException

setCurrentRecordIndex

void setCurrentRecordIndex(int index)
                           throws ApptrieveException
Sets the current record index. Unlike HostSession.setCurrentRecordIndex(int), this method allows excluded records to be set as the current record. Any excluded record made current via this method has the excluded flag cleared, thus becoming visible to the client application.

Parameters:
index - one-based record index (zero meaning set the index to before the first record in the recordset)
Throws:
ApptrieveException

findInsertLocation

void findInsertLocation()
                        throws ApptrieveException
Search for a suitable insertion location as defined in the model and make that the current record.

Throws:
ApptrieveException

writeField

void writeField(java.lang.String name,
                java.lang.String value)
                throws ApptrieveException
Writes the specified field to the current record on the screen. If the cursor is not at the field's location, the VHI will issue a MoveCursor command. Upon successfully moving the cursor, the value will be written to the screen, firing the appropriate FieldEventHandler.writeField(com.wrq.vhi.script.api.WriteFieldEvent) event, if any.

Parameters:
name - the field name
value - the field value
Throws:
ApptrieveException

defaultInsertRecord

void defaultInsertRecord()
                         throws ApptrieveException
Searches for suitable record as defined in the model, executes the before insert operation, writes the fields, and executes the after insert operation. The field values returned by getFieldWriteValues() will be used.

Throws:
ApptrieveException

defaultInsertRecord

void defaultInsertRecord(java.util.Map values)
                         throws ApptrieveException
Searches for suitable record as defined in the model, executes the before insert operation, writes the fields and executes the after insert operation.

Parameters:
values - the fields and values to insert
Throws:
ApptrieveException