|
Oracle Collaboration Suite Discussions Java API Reference 10g (10.1.1) Part No. B16232-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.discussions.sdk.TdSearchTerm
Defines the query criteria for a search in Oracle Discussions.
The query criteria can be applied a Facility and Board or a Thread.
The query string will be matched on the author of the message, the message subject and the message body - with or without attachement matching depending on the server settings.
Cannot be applied to search on TdThread and TdMessage objects.
Sample code snippet illustrating the usage of TdSearchTerm
//Create a default TdSearchTerm. TdSearchTerm tdst = TdSearchTerm.getDefaultSearchTerm(""); //Set various search criterion. tdst.setQuery(keyword); tdst.setNumberOfReplies(iNumReplies); tdst.setHasAttachments(bHasAttachments); //Invoke a search function using search term globally. tdStore.search(tdst);
Field Summary | |
static int |
ANY_DATE_RANGE Represents any date range. |
static int |
IS_NEW Represents that the search is based on messages posted after user's last logout time and current time. |
static int |
WITHIN_ONE_DAY Represents that the search is based on messages posted within one day before and after the choosen date. |
static int |
WITHIN_ONE_MONTH Represents that the search is based on messages posted within one month before and after the choosen date. |
static int |
WITHIN_ONE_WEEK Represents that the search is based on messages posted within one week before and after the choosen date. |
static int |
WITHIN_ONE_YEAR Represents that the search is based on messages posted within one year before and after the choosen date. |
Method Summary | |
boolean |
equals(java.lang.Object obj) Compares one search term with another. |
static TdSearchTerm |
getDefaultSearchTerm(java.lang.String query) Returns the default search term implementation. |
int |
getMinimalMessageSize() Gets minimal size of the message. |
int |
getNumberOfReplies() Gets number of replies. |
java.lang.String |
getQuery() Returns the query string used by this search term. |
java.util.Date |
getStartDate() Returns the start query date: only messages posted after this date will be searched. |
java.util.Date |
getStopDate() Returns the stop query date: only messages posted before this date will be searched. |
java.lang.String |
getUsername() Returns the username: only messages posted by username will be searched |
boolean |
hasAttachments() Returns true if only messages with attachments will be returned from search, false will put no restriction on message attachments |
int |
hashCode() Returns the combined hashcode of different fields in the search term. |
boolean |
isNew() Returns true if only messages posted later than user's last logout time will be returned from search, false will put no restriction on message post date. |
void |
setDateRange(int iDateRange) A convenient method to set the start date and stop date The date range will center around the date the is currently set as the start date. |
void |
setHasAttachments(boolean bHasAttachments) Sets has_attachments flag. |
void |
setMinimalMessageSize(int iMinMsgSize) Sets minimal size of the message. |
void |
setNew(boolean bIsNew) Sets is_new flag. |
void |
setNumberOfReplies(int iNumReplies) Sets number of replies. |
void |
setQuery(java.lang.String query) Sets the query string used by this search term. |
void |
setStartDate(java.util.Date dStartDate) Sets the start query date: only messages posted after this date will be searched. |
void |
setStopDate(java.util.Date dStopDate) Sets the stop query date: only messages posted before this date will be searched. |
void |
setUsername(java.lang.String username) Sets the username: only messages posted by username will be searched. |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ANY_DATE_RANGE
Indicates that search is not consrained by start and end dates.
public static final int IS_NEW
public static final int WITHIN_ONE_DAY
For example, if the chosen date is 24-Jul-2005, then search is based on dates ranging from 23-Jul-2005 to 25-Jul-2005 inclusive.
public static final int WITHIN_ONE_WEEK
For example, if the chosen date is 24-Jul-2005, then search is based on dates ranging from one week before 24-Jul-2005 to One week after 24-Jul2005, end dates inclusive.
public static final int WITHIN_ONE_MONTH
For example, if the chosen date is 24-Jul-2005, then search is based on dates ranging from one month before 24-Jul-2005 to One month after 24-Jul2005, end dates inclusive.
public static final int WITHIN_ONE_YEAR
For example, if the chosen date is 24-Jul-2005, then search is based on dates ranging from one year before 24-Jul-2005 to One year after 24-Jul2005, end dates inclusive.
Method Detail |
public static TdSearchTerm getDefaultSearchTerm(java.lang.String query)
query
- the query on which search is based.public java.lang.String getQuery()
public java.lang.String getUsername()
public java.util.Date getStartDate()
public java.util.Date getStopDate()
public void setQuery(java.lang.String query)
query
- search querypublic void setStartDate(java.util.Date dStartDate)
dStartDate
- messages posted after this date are searched.public void setUsername(java.lang.String username)
username
- username on which search is based.public void setStopDate(java.util.Date dStopDate)
dStopDate
- indicates the max date upto whichsearch is based.public void setNumberOfReplies(int iNumReplies)
iNumReplies
- integer representing the number of replies per message on which the search is based.public int getNumberOfReplies()
public void setMinimalMessageSize(int iMinMsgSize)
iMinMsgSize
- integer representing the minimal message size icluded in the search.public int getMinimalMessageSize()
public void setHasAttachments(boolean bHasAttachments)
bHasAttachments
- boolean status indicating if the search criteria includes messages with attachments.public boolean hasAttachments()
public void setNew(boolean bIsNew)
bIsNew
- Indicates if the search term is new.public boolean isNew()
public void setDateRange(int iDateRange)
iDateRange
- Teh date range to be set.public boolean equals(java.lang.Object obj)
Extracts individual fields of both the search terms and compares them for equality.
If all the fields match, then the terms are said to be equal.
Otherwise, they are said to be unequal.
obj
- the search term to be compared with another.public int hashCode()
Used in comparing one search term with another for equality.
If the hash codes are equal, then the search terms are equal and if the hash codes differ, the search terms are considered to be unequal.
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |