wt.prefs
Class PrefSearchService

java.lang.Object
  extended bywt.prefs.PrefSearchService
All Implemented Interfaces:
RemoteAccess

public final class PrefSearchService
extends Object
implements RemoteAccess

This class is the Preference Search Service, which performs searches on the Windchill Database for Preference Entries. All strings passed to the search() and getEntry() methods should be preformatted for SQL searches by making sure any '%' characters are escaped etc.

See Also:


Supported API: true

Extendable: false

Field Summary
 
Fields inherited from interface wt.method.RemoteAccess
versionID
 
Constructor Summary
PrefSearchService()
           
 
Method Summary
static PrefSearch getEntry(String aSearchString, String[] aContext)
          This method will retrieve the Entry from the Preferences that matches the search criteria exactly for the given context.
private static ArrayList parseListHeirarchy(ArrayList currentList, String[] context)
          This method will take an array list of search PrefSearch items, and a context mask, and return only the top matching value for the given context mask and searched list.
static ArrayList search(String aString, String[] aContext)
          This method is used to search the preference from the client using the remote interface.
private static ArrayList search(String aString, String[] aContext, boolean isLike)
          This private method will perform the Query on the datebase for the Preference UI table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrefSearchService

public PrefSearchService()
Method Detail

getEntry

public static PrefSearch getEntry(String aSearchString,
                                  String[] aContext)
                           throws WTException
This method will retrieve the Entry from the Preferences that matches the search criteria exactly for the given context. The first match will be returned

Parameters:
aSearchString - The string to search for.
aContext - The context list for the current context.
Returns:
PrefSearch the located value, null if not found.
Throws:
WTException

search

public static ArrayList search(String aString,
                               String[] aContext)
                        throws WTException
This method is used to search the preference from the client using the remote interface. The search will be a SearchCondition.LIKE search of the Search String.

Parameters:
aString - The string to search for.
aContext - The list of contexts for the current context.
Returns:
ArrayList The list of PrefSearch objects found.
Throws:
WTException

search

private static ArrayList search(String aString,
                                String[] aContext,
                                boolean isLike)
                         throws WTException
This private method will perform the Query on the datebase for the Preference UI table.

Parameters:
aString - The string to query for.
aContext - The search context.
isLike - Whether the search is a like or equals
Throws:
WTException

parseListHeirarchy

private static ArrayList parseListHeirarchy(ArrayList currentList,
                                            String[] context)
This method will take an array list of search PrefSearch items, and a context mask, and return only the top matching value for the given context mask and searched list.

Parameters:
currentList - The current list to search
context - The heirarchial list of contexts.
Returns:
The preference list containing the top most preference for each preference.