|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ptc.windchill.cadx.search.IntegratedSearchTask
Provides a search API for the client to use to get paged, sorted, and
integrated database and content searches. The session id is used to
get back the next page of a search that has already been executed. If
the session isn't accessed in a while the session id will be timed out
and the search results will not be available. After a search session
id is no longer needed then the closeSession method should be used to
close the session. The session id should be retrieved by using getSessionID
after a successful call to search. The session id should be saved and
then used to retrieve the next page if the IntegratedSearchTask instance
that initiated the search can not be saved. Calling search and specifying
a pageOffset will retrieve that page. The first page is offset of 0.
This class is being implemented to support the increased functionality
of the HTML Search for release 6. This class will be superseded in release
7 and will probably be deprecated in that release or shortly after.
Supported API: true
Extendable: false
Field Summary | |
static String |
ALL_ITERATIONS
Supported API: true |
static String |
ALL_VERSIONS
Supported API: true |
private static String |
CLASSNAME
|
static long |
EXTERNALIZATION_VERSION_UID
|
private static long |
NO_SESSION
|
private static int |
NO_TOTALSIZE
|
protected static long |
OLD_FORMAT_VERSION_UID
|
private static String |
RESOURCE
|
private QuerySpec |
searchQuerySpec
|
(package private) static long |
serialVersionUID
|
private static String |
SERVER_ID
|
private long |
sessionID
|
private int |
totalSize
|
private static boolean |
VERBOSE
|
Constructor Summary | |
IntegratedSearchTask()
Get a new instance of IntegratedSearchTask to use for new searches. |
|
IntegratedSearchTask(long a_sessionID)
Get a new instance of IntegratedSearchTask to use with a previous paging session. |
Method Summary | |
void |
clearSession()
Closes an older session and clears the session id and total size attributes in preparation for a new search. |
void |
closeSession()
Used to close a database paging session. |
QueryResult |
customSearch(Vector classnames,
Hashtable criteria,
Hashtable criteriaIBA,
Vector criteriaKeyword,
boolean isAnd,
Vector displayAttributes,
Vector sortKeys,
int pageOffset,
int pageRange,
String searchFilter,
Vector contentLibrary,
Locale locale)
|
private Vector |
getClassList(Vector classnames)
|
QuerySpec |
getCustomSearchQuerySpec()
|
QueryResult |
getPage(int offset,
int range,
Vector displayAttributes)
Get the specified page from an existing search results. |
long |
getSessionID()
Return the session id of this paging session. |
int |
getTotalSize()
Return the total number of objects in the search results. |
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(IntegratedSearchTask thisObject,
ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source. |
QueryResult |
search(Vector classnames,
Hashtable criteria,
String keyword,
Vector displayAttributes,
Vector sortKeys,
int pageOffset,
int pageRange,
String searchFilter,
Vector contentLibrary,
Locale locale)
Will execute a search against the content search engine and the database search using all of the parameters. |
QueryResult |
search(Vector classnames,
Hashtable criteria,
String keyword,
Vector displayAttributes,
Vector sortKeys,
int pageRange,
String searchFilter,
Vector contentLibrary,
Locale locale)
Will execute a search against the content search engine and the database search using all of the parameters. |
private void |
setSessionID(long a_sessionID)
|
private void |
setTotalSize(int a_totalSize)
|
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 |
private static final String RESOURCE
private static final String CLASSNAME
private long sessionID
private int totalSize
private QuerySpec searchQuerySpec
public static final String ALL_VERSIONS
public static final String ALL_ITERATIONS
static final long serialVersionUID
public static final long EXTERNALIZATION_VERSION_UID
protected static final long OLD_FORMAT_VERSION_UID
private static final long NO_SESSION
private static final int NO_TOTALSIZE
private static final boolean VERBOSE
private static final String SERVER_ID
Constructor Detail |
public IntegratedSearchTask()
public IntegratedSearchTask(long a_sessionID)
a_sessionID
- Session id for an existing paging session. Retrieved from a previous search of IntegratedSearchTask. Session ids will automatically time out if not used for a period of time. Paging sessions that are no longer needed should be closed.Method Detail |
public void writeExternal(ObjectOutput output) throws IOException
writeExternal
in interface Externalizable
output
-
IOException
public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
input
-
IOException
ClassNotFoundException
protected boolean readVersion(IntegratedSearchTask thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
thisObject
- input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
private boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
public void clearSession()
public void closeSession() throws WTException
WTException
public QueryResult search(Vector classnames, Hashtable criteria, String keyword, Vector displayAttributes, Vector sortKeys, int pageRange, String searchFilter, Vector contentLibrary, Locale locale) throws WTException
classnames
- A list of the classes (of type Class not String) that this search will use in a compound search. All of the criteria attributes and the sorting attributes must be the same for each of the classes in the list. The sorting must be in the same order and the types of the attributes must be the same.criteria
- A series of name value pairs of type String that specify the search criteria. The "keyword" name with a value for the string specifies the keyword used in the content search.keyword
- String used to search against the content search engine. If this string is null no content search will be run. Set this string to null if there is no content search engine installed on the system.displayAttributes
- List of attributes that are used to inflate the attribute values after a search.sortKeys
- List of sort key strings that the results should be sorted in. The keys are ordered with the first sort key being the first in the list. The string is of the format:
pageRange
- For the database paging of the search results this sets the size of a page.searchFilter
- Can be set to either ALL_VERSIONS or ALL_ITERATIONS. The ALL_VERSIONS will return the latest iteration of each of the versions for the iterated object. ALL_ITERATIONS will return all iterations of all versions of the iterated object.contentLibrary
- A list of the content libraries which the content search should be executed against.locale
- Locale of the client that is executed this method.
WTException
public QueryResult search(Vector classnames, Hashtable criteria, String keyword, Vector displayAttributes, Vector sortKeys, int pageOffset, int pageRange, String searchFilter, Vector contentLibrary, Locale locale) throws WTException
classnames
- A list of the classes (of type Class not String) that this search will use in a compound search. All of the criteria attributes and the sorting attributes must be the same for each of the classes in the list. The sorting must be in the same order and the types of the attributes must be the same.criteria
- A series of name value pairs of type String that specify the search criteria. The "keyword" name with a value for the string specifies the keyword used in the content search.keyword
- String used to search against the content search engine. If this string is null no content search will be run. Set this string to null if there is no content search engine installed on the system.displayAttributes
- List of attributes that are used to inflate the attribute values after a search or retrieval of a page.sortKeys
- List of sort key strings that the results should be sorted in. The keys are ordered with the first sort key being the first in the list. The string is of the format:
pageOffset
- For the database paging of the search results this is the page offset into the results that is being requested. If the session id has been set to a valid session then a new query is not done but the offset is used to return a specific page of the query results. The first page is 0.pageRange
- For the database paging of the search results this sets the size of a page.searchFilter
- Can be set to either ALL_VERSIONS or ALL_ITERATIONS. The ALL_VERSIONS will return the latest iteration of each of the versions for the iterated object. ALL_ITERATIONS will return all iterations of all versions of the iterated object.contentLibrary
- A list of the content libraries which the content search should be executed against.locale
- Locale of the client that is executed this method.
WTException
public QueryResult getPage(int offset, int range, Vector displayAttributes) throws WTException
offset
- For the database paging of the search results this is the page offset into the results that is being requested. The first page is 0, the second is 1, ....range
- For the database paging of the search results this sets the size of a page.displayAttributes
- List of attributes that are used to inflate the attribute values after a search or retrieval of a page.
WTException
public long getSessionID()
public int getTotalSize()
private void setTotalSize(int a_totalSize)
private void setSessionID(long a_sessionID)
private Vector getClassList(Vector classnames) throws WTException
WTException
public QueryResult customSearch(Vector classnames, Hashtable criteria, Hashtable criteriaIBA, Vector criteriaKeyword, boolean isAnd, Vector displayAttributes, Vector sortKeys, int pageOffset, int pageRange, String searchFilter, Vector contentLibrary, Locale locale) throws WTException
WTException
public QuerySpec getCustomSearchQuerySpec()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |