syntheticoperation
Class SearchCommand

java.lang.Object
  extended by syntheticoperation.SearchCommand

public class SearchCommand
extends java.lang.Object

Implement guts of Bobcat system search command.

This class implements a single static method which examines the value of an attribute and rewrites it to perform the type of search desired.


Field Summary
private static java.util.regex.Pattern commandPattern
          Pattern used to separate search command from search argument.
 
Constructor Summary
SearchCommand()
           
 
Method Summary
static void rewrite(com.wrq.vhi.script.api.ScriptHostSession hs, java.lang.String command, java.lang.String attrName)
          Rewrite a search command to use the given command string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

commandPattern

private static final java.util.regex.Pattern commandPattern
Pattern used to separate search command from search argument.

The command consists of optional leading spaces, one or more letters followed by an "=" character, the search term itself, followed by trailing spaces.

Constructor Detail

SearchCommand

public SearchCommand()
Method Detail

rewrite

public static void rewrite(com.wrq.vhi.script.api.ScriptHostSession hs,
                           java.lang.String command,
                           java.lang.String attrName)
                    throws com.wrq.apptrieve.agent.ApptrieveException
Rewrite a search command to use the given command string.

Insert or replace the value of the command

  1. Reading the attribute value.
  2. Determining if the attribute already contains the desired command.
  3. Rewriting the attribute with the proper command if needed.
  4. Executing the search.

Parameters:
hs - the host session to interact with
command - the desired command ("a", "w", and so on)
attrName - the name of the attribute holding the command text
Throws:
com.wrq.apptrieve.agent.ApptrieveException