Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.webservices
Class Query

java.lang.Object
  extended by com.jivesoftware.forum.webservices.Query

public class Query
extends java.lang.Object

Provides the ability to create complex search queries.

Since:
5.1

Field Summary
static int ASCENDING
          Ascending sort (ie 3, 4, 5...).
static int DATE
          Sort by date
static int DESCENDING
          Descending sort (ie 3, 2, 1...).
static int RATING
          Sort by rating
static int RELEVANCE
          Sort by relevance
static int SUBJECT
          Sort by message subject
 
Constructor Summary
Query()
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.util.Date getAfterDate()
          Returns the earliest date for search results.
 java.util.Date getBeforeDate()
          Returns the latest date for search results.
 long getFilterOnUserID()
          Returns the userID, used for filtering messages by a specific author.
 java.lang.String getQueryString()
          Returns the query string for the Query object.
 int getSortField()
          Returns the currently selected sort field.
 int getSortOrder()
          Returns the sort order, which will be Query.ASCENDING for ascending sorting, or Query.DESCENDING for descending sorting.
 int hashCode()
           
 void setAfterDate(java.util.Date afterDate)
          Sets the earliest date for search results.
 void setBeforeDate(java.util.Date beforeDate)
          Sets the latest date for search results.
 void setFilterOnUserID(long userID)
          Restricts the query results to messages posted by a specified user.
 void setQueryString(java.lang.String queryString)
          Sets the query string for the Query object.
 void setSortField(int sortField)
          Sets the sort field to use.
 void setSortOrder(int sortOrder)
          Sets the sort type.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RELEVANCE

public static final int RELEVANCE
Sort by relevance

See Also:
Constant Field Values

RATING

public static final int RATING
Sort by rating

See Also:
Constant Field Values

DATE

public static final int DATE
Sort by date

See Also:
Constant Field Values

SUBJECT

public static final int SUBJECT
Sort by message subject

See Also:
Constant Field Values

DESCENDING

public static final int DESCENDING
Descending sort (ie 3, 2, 1...).

See Also:
Constant Field Values

ASCENDING

public static final int ASCENDING
Ascending sort (ie 3, 4, 5...).

See Also:
Constant Field Values
Constructor Detail

Query

public Query()
Method Detail

getQueryString

public java.lang.String getQueryString()
Returns the query string for the Query object. If the query string has not been set, this method will return null.

Returns:
the Query query string.

setQueryString

public void setQueryString(java.lang.String queryString)
Sets the query string for the Query object.

Parameters:
queryString - a new query string.

getBeforeDate

public java.util.Date getBeforeDate()
Returns the latest date for search results. For example, the "before date" can be used to search for messages modified more than 1 month ago.

If the "before date" has not been set, this method will return null.

Returns:
the upder date boundary for search results.

setBeforeDate

public void setBeforeDate(java.util.Date beforeDate)
Sets the latest date for search results. For example, the "before date" can be used to search for messages modified more than 1 month ago.

Parameters:
beforeDate - an upper date boundary for search results.

getAfterDate

public java.util.Date getAfterDate()
Returns the earliest date for search results. For example, the "after date" can be used to search for messages modified within the last week.

If the "after date" has not been set, this method will return null.

Returns:
the lower date boundary for search results.

setAfterDate

public void setAfterDate(java.util.Date afterDate)
Sets the earliest date for search results. For example, the "after date" can be used to search for messages modified within the last week.

Parameters:
afterDate - a lower date boundary for search results.

getSortField

public int getSortField()
Returns the currently selected sort field. Default is Query.RELEVANCE.

Returns:
current sort.

setSortField

public void setSortField(int sortField)
Sets the sort field to use. Default is Query.RELEVANCE.

Parameters:
sortField - the field that will be used for sorting.

getSortOrder

public int getSortOrder()
Returns the sort order, which will be Query.ASCENDING for ascending sorting, or Query.DESCENDING for descending sorting. Descending sorting is: 3, 2, 1, etc. Ascending sorting is 1, 2, 3, etc.

Returns:
the sort order.

setSortOrder

public void setSortOrder(int sortOrder)
Sets the sort type. Valid arguments are Query.ASCENDING for ascending sorting or Query.DESCENDING for descending sorting. Descending sorting is: 3, 2, 1, etc. Ascending sorting is 1, 2, 3, etc.

Parameters:
sortOrder - the order that results will be sorted in.

getFilterOnUserID

public long getFilterOnUserID()
Returns the userID, used for filtering messages by a specific author.

Returns:
the userID, used for filtering messages by a specific author.

setFilterOnUserID

public void setFilterOnUserID(long userID)
Restricts the query results to messages posted by a specified user. Note: this method is not intended to show all messages posted by a user. Rather, it lets you filter out search results; for example, all messages matching the query "Jive rocks", but filtering out all results that aren't posted by some particular user. If you just want to see all messages posted by a user regardless of their actual content, use the ResultFilter class for a particular forum, or the ContentService.getMessagesByUserID(userID) method for a user's messages among all forums.

Parameters:
userID, - used for filtering messages by a specific author.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.