|
Clearspace API (1.10.16) Core Javadocs | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jivesoftware.community.ResultFilter
com.jivesoftware.community.DocumentResultFilter
public class DocumentResultFilter
Filters and sorts lists of Documents. This allows for a very rich set of possible queries that
can be run. Some examples are: "Show all documents in the community, sorted by their modification
date" or "Show all documents in the community created after xxx and with the extended property
'test' having a value of '12345'".
The class also supports pagination of results with the setStartIndex(int) and setNumResults(int) methods. If the start index is not set, it will begin at index 0 (the start of results). If the number of results is not set, it will be unbounded and return as many results as available.
Factory methods to create common queries are provided for convenience.
| Field Summary | |
|---|---|
static int |
NOT_MODE
|
| Fields inherited from class com.jivesoftware.community.ResultFilter |
|---|
AND_MODE, ASCENDING, CONTAINS_MATCH, DESCENDING, EXACT_MATCH, NULL_INT, OR_MODE |
| Constructor Summary | |
|---|---|
DocumentResultFilter()
|
|
| Method Summary | |
|---|---|
void |
addBinaryBodyContentType(java.lang.String contentType)
Adds a content type to the list of content types that binary body documents will be filtered upon. |
void |
addDocumentField(DocumentField field,
long optionID)
Adds a document field option to the list of options that will be filtered upon |
void |
addDocumentState(DocumentState state)
Add a document state to the list of document states that will be filtered upon. |
void |
addDocumentType(DocumentType type)
Sets the document type to filter results selected by the result filter. |
void |
addLanguage(java.lang.String language)
Add a language to the list of languages that will be filtered upon. |
static DocumentResultFilter |
createAllStatesFilter()
|
static DocumentResultFilter |
createDefaultFilter()
Creates a default document ResultFilter: no filtering with results sorted on the document's creation date in descending order. |
void |
deleteDocumentState(DocumentState state)
Deletes a document state from the list of document states that will be filtered upon. |
void |
deleteDocumentType(DocumentType type)
Add a document type to the list of document states that will be filtered upon. |
void |
deleteLanguage(java.lang.String language)
Deletes a language from the list of languages that will be filtered upon. |
java.lang.String |
getBinaryBodyContentType(int index)
Returns the binary body content type at the specified index. |
int |
getBinaryBodyContentTypeCount()
Returns the count of the content types that will be used to filter binary documents |
int |
getBinaryBodyMode()
Returns the mode that will be used to select results if binary body content types have been specified. |
DocumentField |
getDocumentField(int index)
Returns the document field at the specified index in the list of document fields to be filtered on. |
int |
getDocumentFieldCount()
|
int |
getDocumentFieldMode()
Returns the mode that will be used to select results if multiple document field values have been specified. |
java.lang.Object |
getDocumentFieldValue(int index)
Returns the optionID(s) at the specified index in the list of DocumentFields to be filtered on. |
int |
getDocumentStateCount()
Returns the number of document states that results will be filtered on. |
java.util.Iterator<DocumentState> |
getDocumentStates()
Returns the list of document states to filter results selected by the result filter. |
java.util.Iterator<DocumentType> |
getDocumentTypes()
Returns the list of document types to filter results selected by the result filter. |
int |
getDocumentTypesCount()
Returns the number of document types that results will be filtered on. |
java.util.Date |
getExpirationDateRangeMax()
Returns a date that represents the upper boundry for documents to be selected by the result filter. |
java.util.Date |
getExpirationDateRangeMin()
Returns a date that represents the lower boundry for documents to be selected by the result filter. |
java.util.List<java.lang.String> |
getLanguages()
Returns the list of languages to filter results selected by the result filter. |
DocumentField |
getSortDocumentField()
Returns the document field that will be sorted on. |
boolean |
isExcludeOwnerInUserFilter()
Returns true if the document owner should be excluded when filtering by user id. |
boolean |
isIncludeAuthorsInUserFilter()
Returns true if users who have been added as authors to a document should be included when filtering by user. |
boolean |
isIncludeNonRecommendedDocuments()
Returns whether the result to be selected by the result filter should include documents with a recommended attribute set to false. |
boolean |
isIncludeRecommendedDocuments()
Returns whether the result to be selected by the result filter should include documents with a recommended attribute set to true. |
boolean |
isIncludeReviewersInUserFilter()
Returns true if users who have been added as reviewers to a document should be included when filtering by user. |
boolean |
isIncludeUnSearchableDocuments()
Returns whether the result to be selected by the result filter should include documents with a searchable attribute set to false. |
boolean |
isOnlyIncludeCollaborativeDocuments()
Returns true to only include collaborative documents (documents having textual bodies instead of binary bodies) in the list of document to filter upon. |
boolean |
isRestrictToLatestVersion()
Returns true if only the latest document version will be tested when filtering on document state. |
void |
setBinaryBodyMode(int binaryBodyMode)
Sets the mode that will be used to select results if binary body content types have been specified. |
void |
setDocumentFieldMode(int documentFieldMode)
Sets the mode that will be used to select results if multiple document field values have been specified. |
void |
setExcludeOwnerInUserFilter(boolean excludeOwner)
Sets whether the document owner should be excluded when filtering by user id. |
void |
setExpirationDateRangeMax(java.util.Date expirationDateRangeMax)
Sets a date that represents the upper boundry for documents to be selected by the result filter. |
void |
setExpirationDateRangeMin(java.util.Date expirationDateRangeMin)
Sets a date that represents the lower boundry for documents to be selected by the result filter. |
void |
setIncludeAuthorsInUserFilter(boolean includeAuthorsInUserFilter)
Sets whether users who have been added as authors to a document should be included when filtering by user. |
void |
setIncludeNonRecommendedDocuments(boolean include)
Sets whether the result to be selected by the result filter should include documents with a recommended attribute set to false. |
void |
setIncludeRecommendedDocuments(boolean include)
Sets whether the result to be selected by the result filter should include documents with a recommended attribute set to true. |
void |
setIncludeReviewersInUserFilter(boolean includeReviewersInUserFilter)
Sets whether users who have been added as reviewers to a document should be included when filtering by user. |
void |
setIncludeUnSearchableDocuments(boolean include)
Sets whether the result to be selected by the result filter should include documents with a searchable attribute set to false. |
void |
setOnlyIncludeCollaborativeDocuments(boolean onlyIncludeCollaborativeDocuments)
Set to true to only include collaborative documents (documents having textual bodies instead of binary bodies) in the list of document to filter upon. |
void |
setRestrictToLatestVersion(boolean restrictToLatestVersion)
By default, all versions of a document will be tested when filtering on document state. |
void |
setSortDocumentField(DocumentField field)
Sets the document field to sort on. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NOT_MODE
| Constructor Detail |
|---|
public DocumentResultFilter()
| Method Detail |
|---|
public static DocumentResultFilter createDefaultFilter()
public static DocumentResultFilter createAllStatesFilter()
public java.util.Date getExpirationDateRangeMin()
public void setExpirationDateRangeMin(java.util.Date expirationDateRangeMin)
expirationDateRangeMin - a date representing the highest value of the expiration date
range to be selected.public java.util.Date getExpirationDateRangeMax()
public void setExpirationDateRangeMax(java.util.Date expirationDateRangeMax)
expirationDateRangeMax - a date representing the highest value of the expiration date
range to be selected.public boolean isIncludeUnSearchableDocuments()
public void setIncludeUnSearchableDocuments(boolean include)
include - true to include searchable documents, false otherwise.public boolean isIncludeRecommendedDocuments()
public void setIncludeRecommendedDocuments(boolean include)
include - true to include recommended documents, false otherwise.public boolean isIncludeNonRecommendedDocuments()
public void setIncludeNonRecommendedDocuments(boolean include)
include - true to include unrecommended documents, false otherwise.public int getDocumentTypesCount()
public java.util.Iterator<DocumentType> getDocumentTypes()
public void addDocumentType(DocumentType type)
type - the document type to filter results selected by the result filter.public void deleteDocumentType(DocumentType type)
type - a document typepublic java.util.List<java.lang.String> getLanguages()
public void addLanguage(java.lang.String language)
language - an ISO-639 language code.public void deleteLanguage(java.lang.String language)
language - an ISO-639 language code.public boolean isIncludeAuthorsInUserFilter()
public void setIncludeAuthorsInUserFilter(boolean includeAuthorsInUserFilter)
includeAuthorsInUserFilter - true when users who have been added as authors to a document
should be included when filtering by user.public boolean isIncludeReviewersInUserFilter()
public void setIncludeReviewersInUserFilter(boolean includeReviewersInUserFilter)
includeReviewersInUserFilter - true when users who have been added as reviewers to a document
should be included when filtering by user.public int getDocumentStateCount()
public java.util.Iterator<DocumentState> getDocumentStates()
DocumentState.PUBLISHED.
public void addDocumentState(DocumentState state)
state - a document statepublic void deleteDocumentState(DocumentState state)
state - a document state to removepublic int getDocumentFieldMode()
ResultFilter.AND_MODE which specifies that all document
field values must match for the object to be selected. ResultFilter.OR_MODE is useful if you want
objects to be returned if any of the document field values match.
public void setDocumentFieldMode(int documentFieldMode)
ResultFilter.AND_MODE (the default) specifies that all document field values must
match for the object to be selected. ResultFilter.OR_MODE is useful if you want objects to be
returned if any of the document field values match.
documentFieldMode - the mode that will be used to select results if multiple document
field values have been specified.public int getDocumentFieldCount()
public DocumentField getDocumentField(int index)
public java.lang.Object getDocumentFieldValue(int index)
public void addDocumentField(DocumentField field,
long optionID)
field - a document field with a DocumentFieldType.DataType.LIST_SINGLE or
DocumentFieldType.DataType.LIST_MULTI data typeoptionID - an option from the fieldpublic DocumentField getSortDocumentField()
public void setSortDocumentField(DocumentField field)
field - the document field to sort on.
java.lang.IllegalArgumentException - if the document field is unfilterablepublic boolean isOnlyIncludeCollaborativeDocuments()
public void setOnlyIncludeCollaborativeDocuments(boolean onlyIncludeCollaborativeDocuments)
onlyIncludeCollaborativeDocuments - true to only include textual documents in the filtered
results, false to include both text and binary body documents in the filtered results.public int getBinaryBodyMode()
ResultFilter.OR_MODE which specifies that any specified
content type must match for the object to be selected. NOT_MODE is useful if you want
objects to be returned if none of the specified content types match for the object to be
selected.
public void setBinaryBodyMode(int binaryBodyMode)
ResultFilter.OR_MODE (the default) specifies that any specified
content type must match for the object to be selected. NOT_MODE is useful if you want
objects to be returned if none of the specified content types match for the object to be
selected
binaryBodyMode - the mode that will be used to select results if binary body content types have
been specified.public int getBinaryBodyContentTypeCount()
public java.lang.String getBinaryBodyContentType(int index)
index - the index
public void addBinaryBodyContentType(java.lang.String contentType)
isOnlyIncludeCollaborativeDocuments()
setting, in which case the results are undefined.
Adding multiple content types results in 'OR' type filtering since documents cannot have multiple content types.
Note that wildcards (*) are allowed such that adding a content type such as image/* will include all documents with an image based binary body being included in the filtered results.
contentType - the binary body content type to add to the filter.public boolean isRestrictToLatestVersion()
public void setRestrictToLatestVersion(boolean restrictToLatestVersion)
restrictToLatestVersion - set true to restrict this test to only the lates document version.public boolean isExcludeOwnerInUserFilter()
public void setExcludeOwnerInUserFilter(boolean excludeOwner)
excludeOwner - true when the document owner should be excluded when filtering by user id.
java.lang.IllegalStateException - if this filter is not set to include authors or reviewers when filtering
by user id.
|
Clearspace Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||