wt.indexsearch
Class RwareSearch

java.lang.Object
  extended bywt.indexsearch.RwareSearch
All Implemented Interfaces:
Externalizable, Serializable

public class RwareSearch
extends Object
implements Externalizable

This class is used to submit a search request to the WindchillSearchServlet and process the results. The search method allows for searches across multiple libraries, requesting multiple return fields and allows user to search against multiple fields in a specific locale.

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private static int DO_BOOLEAN_QUERY
           
private static int DO_CONCEPT_QUERY
           
static String DO_MAX_DOCS_PER_LIB_PROPERTY
           
private static int DO_PATTERN_QUERY
           
static String EXPANSION_LEVEL_PROPERTY
           
static long EXTERNALIZATION_VERSION_UID
           
private static boolean INDEX_ENABLED
           
static int MAX_DATABASE_RESULTS_TO_PROCESS
           
static String MAX_DOCS_PROPERTY
           
static int MAX_REG_EXPR_PROPERTY
           
static int MAX_RWARE_DOCS_RETURNED
          Identifies the maximum number of items that can be retrieved from Rware in one query.
static int MAX_SEARCH_TIME
          Identifies the maximum time that an Rware search will execute.
static String MAX_SEARCH_TIME_PROPERTY
           
static int MIN_MAX_HIT
          Identifies the minimum hit of a query.
static String MIN_MAX_HIT_PROPERTY
           
protected static long OLD_FORMAT_VERSION_UID
           
static String PREF_NAME_QUERY_TYPE
          The key name of the user preference that stores the query type.
static String PREF_NAME_SEMANTIC_EXPANSION
          The key name of the user preference that stores the query semantic expansion level.
static String PREF_NODE
          The user preferences node at which RetrievalWare user preferences are stored.
static String PREF_VALUE_QUERY_TYPE_BOOLEAN
          Identifies the boolean query type and can be assigned to preference PREF_NAME_QUERY_TYPE.
static String PREF_VALUE_QUERY_TYPE_CONCEPT
          Identifies the concept query type and can be assigned to preference PREF_NAME_QUERY_TYPE.
static String PREF_VALUE_QUERY_TYPE_PATTERN
          Identifies the pattern query type and can be assigned to preference PREF_NAME_QUERY_TYPE.
static String PREF_VALUE_SEMANTIC_EXPANSION_EXACT
          Identifies the exact match query expansion level and can be assigned to preference PREF_NAME_SEMANTIC_EXPANSION.
static String PREF_VALUE_SEMANTIC_EXPANSION_MOST_STRONG
          Identifies the most strongly related concepts query expansion level and can be assigned to preference PREF_NAME_SEMANTIC_EXPANSION.
static String PREF_VALUE_SEMANTIC_EXPANSION_SIMPLE
          Identifies the simple variations query expansion level and can be assigned to preference PREF_NAME_SEMANTIC_EXPANSION.
static String PREF_VALUE_SEMANTIC_EXPANSION_STRONG
          Identifies the strongly related concepts query expansion level and can be assigned to preference PREF_NAME_SEMANTIC_EXPANSION.
static String PREF_VALUE_SEMANTIC_EXPANSION_WEAK
          Identifies the weakly related concepts query expansion level and can be assigned to preference PREF_NAME_SEMANTIC_EXPANSION.
static String QUERY_TYPE
           
private static String RESOURCE
           
private static String searchPassword
           
private static String searchServer
           
private static String searchUser
           
private static boolean SECURE_SERVER
           
(package private) static long serialVersionUID
           
static String SET_LANGUAGE_PROPERTY
           
static String STR_MAX_REG_EXPR_PROPERTY
           
static boolean VERBOSE_EXECUTION
           
private static String WINDCHILL_KEY
           
 
Constructor Summary
RwareSearch()
           
 
Method Summary
private static String escapeEquals(String queryString)
           
private static String getDefaultQueryOptions(String locale)
          Get the default query options specified through user preferences

Supported API: false
 int getMaxResults()
          Provides the set amount of max results that can be retrieved from Rware This is to provide better performance.
static int getPreferredQueryType()
          Gets the query type from user preferences and returns the RetrievalWare specific constant for that query type.
static int getPreferredSemanticExpansion()
          Gets the query semantic expansion level from user preferences and returns an integer between 1 and 9, 1 being the least semantic expansion.
private static String getQueryOptions(Enumeration options, String requiredFields)
          Get the query options specified and turn them into a string to pass onto the search servlet

Supported API: false
private static HashMap[] processResults(String results)
          Takes the return string from the search servlet and processes the results into a Hashmap array to return to the calling method.
private static HashMap processRow(String row)
           
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(RwareSearch thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
static HashMap[] search(String queryString, Enumeration classList, Enumeration contentLibrary, Enumeration fetchFields, String whereClause, Enumeration queryPrefs, Locale locale)
          This search method will search Rware, returning back all of the designated pre-fetch fields and the PersistOidInfo field which is required for all Windchill applications.
static HashMap[] search(String queryString, String classList, String contentLibrary, Enumeration fetchFields, String whereClause, Enumeration queryPrefs, Locale locale, String strGetHitRankings)
          This search method will search Rware, returning back all of the designated pre-fetch fields and the PersistOidInfo field which is required for all Windchill applications.
static HashMap search(String input, Vector classList, Vector contentLibrary, Locale locale)
          

Supported API: false
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

VERBOSE_EXECUTION

public static boolean VERBOSE_EXECUTION

SECURE_SERVER

private static boolean SECURE_SERVER

searchUser

private static String searchUser

searchServer

private static String searchServer

searchPassword

private static String searchPassword

INDEX_ENABLED

private static boolean INDEX_ENABLED

PREF_NODE

public static final String PREF_NODE
The user preferences node at which RetrievalWare user preferences are stored.

See Also:
Constant Field Values

PREF_NAME_QUERY_TYPE

public static final String PREF_NAME_QUERY_TYPE
The key name of the user preference that stores the query type.

See Also:
Constant Field Values

PREF_VALUE_QUERY_TYPE_CONCEPT

public static final String PREF_VALUE_QUERY_TYPE_CONCEPT
Identifies the concept query type and can be assigned to preference PREF_NAME_QUERY_TYPE.

See Also:
Constant Field Values

PREF_VALUE_QUERY_TYPE_PATTERN

public static final String PREF_VALUE_QUERY_TYPE_PATTERN
Identifies the pattern query type and can be assigned to preference PREF_NAME_QUERY_TYPE.

See Also:
Constant Field Values

PREF_VALUE_QUERY_TYPE_BOOLEAN

public static final String PREF_VALUE_QUERY_TYPE_BOOLEAN
Identifies the boolean query type and can be assigned to preference PREF_NAME_QUERY_TYPE.

See Also:
Constant Field Values

DO_BOOLEAN_QUERY

private static final int DO_BOOLEAN_QUERY
See Also:
Constant Field Values

DO_CONCEPT_QUERY

private static final int DO_CONCEPT_QUERY
See Also:
Constant Field Values

DO_PATTERN_QUERY

private static final int DO_PATTERN_QUERY
See Also:
Constant Field Values

PREF_NAME_SEMANTIC_EXPANSION

public static final String PREF_NAME_SEMANTIC_EXPANSION
The key name of the user preference that stores the query semantic expansion level.

See Also:
Constant Field Values

PREF_VALUE_SEMANTIC_EXPANSION_EXACT

public static final String PREF_VALUE_SEMANTIC_EXPANSION_EXACT
Identifies the exact match query expansion level and can be assigned to preference PREF_NAME_SEMANTIC_EXPANSION.

See Also:
Constant Field Values

PREF_VALUE_SEMANTIC_EXPANSION_SIMPLE

public static final String PREF_VALUE_SEMANTIC_EXPANSION_SIMPLE
Identifies the simple variations query expansion level and can be assigned to preference PREF_NAME_SEMANTIC_EXPANSION.

See Also:
Constant Field Values

PREF_VALUE_SEMANTIC_EXPANSION_MOST_STRONG

public static final String PREF_VALUE_SEMANTIC_EXPANSION_MOST_STRONG
Identifies the most strongly related concepts query expansion level and can be assigned to preference PREF_NAME_SEMANTIC_EXPANSION.

See Also:
Constant Field Values

PREF_VALUE_SEMANTIC_EXPANSION_STRONG

public static final String PREF_VALUE_SEMANTIC_EXPANSION_STRONG
Identifies the strongly related concepts query expansion level and can be assigned to preference PREF_NAME_SEMANTIC_EXPANSION.

See Also:
Constant Field Values

PREF_VALUE_SEMANTIC_EXPANSION_WEAK

public static final String PREF_VALUE_SEMANTIC_EXPANSION_WEAK
Identifies the weakly related concepts query expansion level and can be assigned to preference PREF_NAME_SEMANTIC_EXPANSION.

See Also:
Constant Field Values

MAX_RWARE_DOCS_RETURNED

public static int MAX_RWARE_DOCS_RETURNED
Identifies the maximum number of items that can be retrieved from Rware in one query. Defaults to 4090


MAX_SEARCH_TIME

public static int MAX_SEARCH_TIME
Identifies the maximum time that an Rware search will execute. Defaults to 30 seconds


MIN_MAX_HIT

public static int MIN_MAX_HIT
Identifies the minimum hit of a query. Defaults to 2


MAX_DATABASE_RESULTS_TO_PROCESS

public static int MAX_DATABASE_RESULTS_TO_PROCESS

MAX_REG_EXPR_PROPERTY

public static int MAX_REG_EXPR_PROPERTY

MAX_SEARCH_TIME_PROPERTY

public static String MAX_SEARCH_TIME_PROPERTY

QUERY_TYPE

public static String QUERY_TYPE

EXPANSION_LEVEL_PROPERTY

public static String EXPANSION_LEVEL_PROPERTY

MAX_DOCS_PROPERTY

public static String MAX_DOCS_PROPERTY

MIN_MAX_HIT_PROPERTY

public static String MIN_MAX_HIT_PROPERTY

SET_LANGUAGE_PROPERTY

public static String SET_LANGUAGE_PROPERTY

DO_MAX_DOCS_PER_LIB_PROPERTY

public static String DO_MAX_DOCS_PER_LIB_PROPERTY

STR_MAX_REG_EXPR_PROPERTY

public static String STR_MAX_REG_EXPR_PROPERTY

WINDCHILL_KEY

private static final String WINDCHILL_KEY
See Also:
Constant Field Values
Constructor Detail

RwareSearch

public RwareSearch()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(RwareSearch thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

search

public static HashMap[] search(String queryString,
                               Enumeration classList,
                               Enumeration contentLibrary,
                               Enumeration fetchFields,
                               String whereClause,
                               Enumeration queryPrefs,
                               Locale locale)
                        throws WTException
This search method will search Rware, returning back all of the designated pre-fetch fields and the PersistOidInfo field which is required for all Windchill applications.

Supported API: false

Parameters:
queryString -
classList -
contentLibrary -
fetchFields -
whereClause -
queryPrefs -
locale -
Returns:
HashMap[]
Throws:
WTException

search

public static HashMap search(String input,
                             Vector classList,
                             Vector contentLibrary,
                             Locale locale)
                      throws WTException


Supported API: false

Parameters:
input -
classList -
contentLibrary -
locale -
Returns:
HashMap
Throws:
WTException

search

public static HashMap[] search(String queryString,
                               String classList,
                               String contentLibrary,
                               Enumeration fetchFields,
                               String whereClause,
                               Enumeration queryPrefs,
                               Locale locale,
                               String strGetHitRankings)
                        throws WTException
This search method will search Rware, returning back all of the designated pre-fetch fields and the PersistOidInfo field which is required for all Windchill applications.

Supported API: false

Parameters:
queryString -
classList -
contentLibrary -
fetchFields -
whereClause -
queryPrefs -
locale -
strGetHitRankings -
Returns:
HashMap[]
Throws:
WTException

processResults

private static HashMap[] processResults(String results)
                                 throws WTException
Takes the return string from the search servlet and processes the results into a Hashmap array to return to the calling method. Each result is a hashmap, keyed off the Windchill UFID of the object and the requested fetch fields are are also keys in the returned hashmap

Returns:
void
Throws:
WTException

processRow

private static HashMap processRow(String row)

getPreferredQueryType

public static int getPreferredQueryType()
Gets the query type from user preferences and returns the RetrievalWare specific constant for that query type.

See Also:
RWQuery#DO_BOOLEAN_QUERY, RWQuery#DO_CONCEPT_QUERY, RWQuery#DO_PATTERN_QUERY,

Supported API: false

getPreferredSemanticExpansion

public static int getPreferredSemanticExpansion()
Gets the query semantic expansion level from user preferences and returns an integer between 1 and 9, 1 being the least semantic expansion. In terms Windchill:

Supported API: false


getMaxResults

public int getMaxResults()
Provides the set amount of max results that can be retrieved from Rware This is to provide better performance.


getQueryOptions

private static String getQueryOptions(Enumeration options,
                                      String requiredFields)
                               throws WTException
Get the query options specified and turn them into a string to pass onto the search servlet

Supported API: false

Returns:
String
Throws:
WTException

getDefaultQueryOptions

private static String getDefaultQueryOptions(String locale)
                                      throws WTException
Get the default query options specified through user preferences

Supported API: false

Returns:
String
Throws:
WTException

escapeEquals

private static String escapeEquals(String queryString)
                            throws PatternSyntaxException
Throws:
PatternSyntaxException