com.filenet.wcm.toolkit.util
Class WcmVerityParser

java.lang.Object
  extended bycom.filenet.wcm.toolkit.util.WcmVerityParser

public class WcmVerityParser
extends java.lang.Object

This class interprets a text input line, along with a modifier, and produces XML used in Stored Searches, Search Templates and for execution of Search Templates. The text input line can contain any valid alphanumeric characters, plus the following: - !word - indicates that 'word' should be excluded - w*d - indicates that any words beginning with 'w' and ending with 'd' will be found - "my phrase" - double quotes (must be in a pair) comprise a phrase, the contents - of which is preserved. The XML that's returned will look something like: my phrase Which will then have to be wrapped in the following XML: "my phrase" insert parser's XML here "another phrase" insert parser's XML here


Field Summary
static java.lang.String ALL
           
static java.lang.String ANY
           
static java.lang.String IN_ZONE
           
static java.lang.String NEAR
           
static java.lang.String NONE
           
static java.lang.String PARAGRAPH
           
static java.lang.String SENTENCE
           
static java.lang.String VQL
           
 
Constructor Summary
WcmVerityParser(boolean enableEncoding)
          Default constructor
 
Method Summary
 java.lang.String getErrorMsg()
          Gets the current error message string, if any exists.
static void main(java.lang.String[] argv)
          The main method of the application.
 org.w3c.dom.Node parse(java.util.Locale locale, java.lang.String text, java.lang.String modifier, java.lang.String zoneName)
          Parses the text string into the XML format that is used in content searching.
 org.w3c.dom.Node parse(java.lang.String text, java.lang.String modifier, java.lang.String zoneName)
          Parses the text string into the XML format that is used in content searching.
 java.lang.String toString()
          toString() outputs the contents of the DOM tree in a readable format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

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

ALL

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

ANY

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

IN_ZONE

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

NEAR

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

PARAGRAPH

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

SENTENCE

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

VQL

public static final java.lang.String VQL
See Also:
Constant Field Values
Constructor Detail

WcmVerityParser

public WcmVerityParser(boolean enableEncoding)
Default constructor

Method Detail

parse

public org.w3c.dom.Node parse(java.util.Locale locale,
                              java.lang.String text,
                              java.lang.String modifier,
                              java.lang.String zoneName)
                       throws WcmException
Parses the text string into the XML format that is used in content searching. This method will only parse one condition at a time. If several conditions are ANDed together, then they will need to be parsed one at a time, with the XML for the logical ANDing created elsewhere.

Parameters:
text - accepts a string of one or more words, with or without quotes. Also accepts one or more wildcard characters (*) in a word, or any word preceeded by the not character (!). For example: "Orange County" CA* !Florida
modifier - accepts any of the following strings: {None, All, Any, In Zone, Near, Paragraph, Sentence, VQL}
zoneName - is only used when the modifier is "In Zone". Otherwise, it should be set to an empty string.
Returns:
Node which is the root of the XML tree created by the parser. Note: This node must be imported when adding it to a different Document object. For example: Node myNode = myParser.parse("test", "None", ""); Node newNode = document.importNode(myNode, true);
Throws:
WcmException

getErrorMsg

public java.lang.String getErrorMsg()
Gets the current error message string, if any exists.

Returns:
String

parse

public org.w3c.dom.Node parse(java.lang.String text,
                              java.lang.String modifier,
                              java.lang.String zoneName)
                       throws WcmException
Parses the text string into the XML format that is used in content searching. This method will only parse one condition at a time. If several conditions are ANDed together, then they will need to be parsed one at a time, with the XML for the logical ANDing created elsewhere.

Parameters:
text - accepts a string of one or more words, with or without quotes. Also accepts one or more wildcard characters (*) in a word, or any word preceeded by the not character (!). For example: "Orange County" CA* !Florida
modifier - accepts any of the following strings: {None, All, Any, In Zone, Near, Paragraph, Sentence, VQL}
zoneName - is only used when the modifier is "In Zone". Otherwise, it should be set to an empty string.
Returns:
Node which is the root of the XML tree created by the parser. Note: This node must be imported when adding it to a different Document object. For example: Node myNode = myParser.parse("test", "None", ""); Node newNode = document.importNode(myNode, true);
Throws:
WcmException

toString

public java.lang.String toString()
toString() outputs the contents of the DOM tree in a readable format.

Returns:
String

main

public static void main(java.lang.String[] argv)
The main method of the application.

Parameters:
argv - The command line argument to this application.
Since:
IWWS1.00


© Copyright IBM Corp. 2002, 2007. All Rights Reserved.