conditionalprocedure
Class SearchByKeywordProcedureHandler

java.lang.Object
  extended by com.wrq.vhi.script.api.ProcedureEventHandler
      extended by conditionalprocedure.SearchByKeywordProcedureHandler
All Implemented Interfaces:
com.wrq.vhi.script.api.EventHandler

public class SearchByKeywordProcedureHandler
extends com.wrq.vhi.script.api.ProcedureEventHandler

Implement a keyword search procedure for the Bobcat library system.

This procedure executes a search for keyword, and handles several possible valid outcomes:


Field Summary
static java.lang.String description
           
static int executeProcedureTimeout
          Set a nonstandard timeout for this procedure.
private static java.lang.String searchAttribute
          Name of attribute which holds search command.
private static java.lang.String searchEntity
          Name of entity at which search starts.
private static java.lang.String searchOperation
          Name of "search by keyword" operation.
 
Fields inherited from interface com.wrq.vhi.script.api.EventHandler
DEFAULT_TIMEOUT
 
Constructor Summary
SearchByKeywordProcedureHandler()
           
 
Method Summary
 com.wrq.vhi.script.api.ProcedureRecordSet executeProcedure(com.wrq.vhi.script.api.ExecuteProcedureEvent event)
          Retrieve search results from different entities and recordsets.
 
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

executeProcedureTimeout

public static final int executeProcedureTimeout
Set a nonstandard timeout for this procedure. Scrolling through a large set of records could take a while.

See Also:
Constant Field Values

searchOperation

private static final java.lang.String searchOperation
Name of "search by keyword" operation.

See Also:
Constant Field Values

searchAttribute

private static final java.lang.String searchAttribute
Name of attribute which holds search command.

See Also:
Constant Field Values

searchEntity

private static final java.lang.String searchEntity
Name of entity at which search starts.

See Also:
Constant Field Values
Constructor Detail

SearchByKeywordProcedureHandler

public SearchByKeywordProcedureHandler()
Method Detail

executeProcedure

public com.wrq.vhi.script.api.ProcedureRecordSet executeProcedure(com.wrq.vhi.script.api.ExecuteProcedureEvent event)
                                                           throws com.wrq.apptrieve.agent.ApptrieveException
Retrieve search results from different entities and recordsets.

This procedure event handler validates the input parameter and executes a search operation to retrieve the search results. It uses the destination entity to decide whether the host application detected an error (in which an exception is returned) or actually generated search results.

In the case that a single result is found, the various attributes on the singleton result entity are mapped to output columns and returned as a single-row recordset

In the case that multiple results are returned, the job of parsing the records into fields is done by the recordset handler. This method takes the parsed fields and places them into the result records. In particular, publication titles can span two lines: this handler rejoins the lines and returns them as a single Title column.

Overrides:
executeProcedure in class com.wrq.vhi.script.api.ProcedureEventHandler
Parameters:
event - the event instance
Returns:
the procedure result
Throws:
com.wrq.apptrieve.agent.ApptrieveException