|
Clearspace API (2.5.29) Core Javadocs | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DocumentManager
This manager provides methods to load documents and to retrieve popular documents. Once a handle on a document is
obtained one can use the methods in the Document interface to retrieve document versions, comments, images
and attachments.
JiveContext,
Document| Method Summary | |
|---|---|
void |
addDocument(JiveContainer container,
Document document,
Map parameters)
Add a document as a child of a container. |
void |
addDocument(JiveContainer container,
Document document,
com.jivesoftware.community.impl.PermissionsBundle permBundle,
Map parameters)
Add a document as a child of the container with permissions defined by the provided permission bundle. |
void |
addDocumentApprover(JiveContainer container,
User user)
Add the user as a document approver for this entire container. |
Document |
createDocument(User user,
DocumentType documentType,
String documentID,
String title,
Document body)
Create a new document. |
Document |
createDocument(User user,
DocumentType documentType,
String documentID,
String title,
String body)
Create a new document. |
void |
deleteDocument(Document document)
Deletes a document. |
void |
deleteUserDocuments(User user)
Deletes all user documents, including previous versions. |
Document |
getDocument(JiveContainer container,
String subject)
Returns a document from a container based on its subject. |
Document |
getDocument(long docID)
Returns the document with the specified docID. |
Document |
getDocument(long docID,
int version)
Returns the revision of document with the specified docID and version number. |
Document |
getDocument(String documentID)
Returns a document from the container based on its document ID. |
Document |
getDocument(String documentID,
int version)
Returns the revision of the document with the specified docID and version number. |
Collection<User> |
getDocumentApprovers(JiveContainer container)
Returns all of the users that must approve new documents before they reach a PUBLISHED state when it is in a PENDING_APPROVAL state. |
int |
getDocumentCount(JiveContainer container)
Returns the number of published documents in the container. |
int |
getDocumentCount(JiveContainer container,
DocumentResultFilter resultFilter)
Returns the number of documents in the container {and possibly all child containers (if the container is a community)} based on the specified ResultFilter. |
int |
getDocumentCount(TagSet tagSet)
Returns the number of published documents in the tag set. |
int |
getDocumentCount(TagSet tagSet,
DocumentResultFilter filter)
Returns the number of documents in the tag set based on the specified ResultFilter. |
JiveIterator<Document> |
getDocuments(JiveContainer container)
Returns an Iterable for all the published documents in the container. |
JiveIterator<Document> |
getDocuments(JiveContainer container,
DocumentResultFilter resultFilter)
Returns an Iterable for all the documents in the container {and possibly all child containers (if the container is a community)} that match the criteria specified by the ResultFilter. |
JiveIterator<Document> |
getDocuments(TagSet tagSet)
Returns an Iterable for all the published documents in the tag set. |
JiveIterator<Document> |
getDocuments(TagSet tagSet,
DocumentResultFilter resultFilter)
Returns an Iterable for all the documents in the tag set that match the criteria specified by the ResultFilter. |
JiveIterator<Document> |
getDocumentsUnderEdit()
Returns an Iterable of documents currently being editted. |
JiveIterator<Document> |
getDocumentsUnderEdit(JiveContainer container)
Returns the count of the number of documents currently being editted in the container. |
int |
getDocumentsUnderEditCount()
Returns the count of the number of documents currently being editted. |
int |
getDocumentsUnderEditCount(JiveContainer container)
Returns an Iterable of documents currently being editted in the container. |
Document |
getLatestDocument(JiveContainer container)
Returns the most recently created or edited document in this container (including all sub-communities). |
JiveIterator<Document> |
getPopularDocuments()
Returns the top x documents across all containers according to ratings, document views & time passed since the document was created. |
JiveIterator<Document> |
getPopularDocuments(JiveContainer c)
Returns the top x documents across a given community & it's subcommunities according to ratings, document views & time passed since the document was created in the languages specified. |
JiveIterator<Document> |
getPopularDocuments(List<String> languages)
Returns the top x documents across all containers according to ratings, document views & time passed since the document was created in the languages specified. |
int |
getUserApprovalDocumentCount(User user)
Returns a count of all documents that a user needs to approve. |
JiveIterator<Document> |
getUserApprovalDocuments(User user)
Returns all documents that a user needs to approve. |
int |
getUserDocumentCount(User user,
DocumentState[] states)
Returns a count of all documents in the supplied DocumentStates a user is an author of. |
JiveIterator<Document> |
getUserDocuments(User user,
DocumentState[] states)
Returns all documents in the supplied DocumentStates for the supplied user. |
boolean |
isCommentsEnabled()
Returns true if the comments feature is turned on. |
boolean |
isTrackbacksEnabled()
Returns true if the trackbacks feature is turned on. |
void |
moveDocument(Document document,
JiveContainer destinationContainer)
Moves a document from it's current container to another. |
void |
removeDocumentApprover(JiveContainer container,
User user)
Remove this user as a document approver for this container. |
void |
setCommentsEnabled(boolean commentsEnabled)
Enables or disables the comments feature system wide. |
void |
setTrackbacksEnabled(boolean trackbacksEnabled)
Enables or disables the trackbacks feature system wide. |
| Methods inherited from interface com.jivesoftware.community.JiveManager |
|---|
destroy |
| Method Detail |
|---|
Document createDocument(User user,
DocumentType documentType,
String documentID,
String title,
String body)
throws DuplicateIDException
DocumentState.INCOMPLETE and must be
attached to a container using the addDocument(JiveContainer, Document,java.util.Map) method.
If a documentID is not provided (i.e. it's null) one will be automatically created. By default the autogenerated
ID will be 'tempDOC-#' however the 'tempDOC-#' prefix can be controlled by changing the 'jive.temporaryDocPrefix'
jive property.
user - the author of the new documentdocumentType - the document type of the new documentdocumentID - the document ID of the new documenttitle - the title of the new documentbody - the body of the new document
DuplicateIDException - if the documentID provided is the same as an already existing document
Document createDocument(User user,
DocumentType documentType,
String documentID,
String title,
Document body)
throws DuplicateIDException
DocumentState.INCOMPLETE and must be
attached to a container using the addDocument(JiveContainer, Document,java.util.Map) method.
If a documentID is not provided (i.e. it's null) one will be automatically created. By default the autogenerated
ID will be 'tempDOC-#' however the 'tempDOC-#' prefix can be controlled by changing the 'jive.temporaryDocPrefix'
jive property.
user - the author of the new documentdocumentType - the document type of the new documentdocumentID - the document ID of the new documenttitle - the title of the new documentbody - the body of the new document
DuplicateIDException - if the documentID provided is the same as an already existing document
Document getDocument(long docID)
throws DocumentObjectNotFoundException,
UnauthorizedException
docID - the long doc ID of the document
DocumentObjectNotFoundException - if no document with the specified ID can be found
UnauthorizedException - if the user doesn't have permissions to view the document.
Document getDocument(long docID,
int version)
throws DocumentObjectNotFoundException,
UnauthorizedException
docID - the long doc ID of the documentversion - the version number of the document
DocumentObjectNotFoundException - if no document with the specified ID can be found
UnauthorizedException - if the user doesn't have permissions to view the document.
Document getDocument(String documentID)
throws DocumentObjectNotFoundException,
UnauthorizedException
documentID - the document ID of the document to retrieve.
DocumentObjectNotFoundException - if no document with the specified ID can be found
UnauthorizedException - if the user doesn't have permissions to view the document.
Document getDocument(String documentID,
int version)
throws DocumentObjectNotFoundException,
UnauthorizedException
documentID - the document ID of the document to retrieve.version - the version number of the document.
DocumentObjectNotFoundException - if no document with the specified ID can be found
UnauthorizedException - if the user doesn't have permissions to view the document.
Document getDocument(JiveContainer container,
String subject)
throws DocumentObjectNotFoundException,
UnauthorizedException
container - the container to retrieve the document from.subject - the subject of the document to retrieve.
DocumentObjectNotFoundException - if no document matching the given criteria can be found
UnauthorizedException - if the user doesn't have permissions to view the document.JiveIterator<Document> getPopularDocuments()
Top x of ((document views) * (document mean rating+2)) * 1/(1 + number of days since creation date)
The number of documents to return is determined by the property "popularDocuments.number", defaulting to 5 if the property is not specified. Popular documents are only calculated once every 15 minutes.
JiveIterator<Document> getPopularDocuments(JiveContainer c)
c - container from which to fetch popular documents.
JiveIterator<Document> getPopularDocuments(List<String> languages)
languages - a list of ISO-639 language codes to restrict returned documents to.
JiveIterator<Document> getUserApprovalDocuments(User user)
user - The user to acquire the documents for.
int getUserApprovalDocumentCount(User user)
user - the user to return a count for
JiveIterator<Document> getUserDocuments(User user,
DocumentState[] states)
DocumentStates for the supplied user.
user - the user to return documents forstates - the document states to filter on
DocumentStates for the supplied user.
int getUserDocumentCount(User user,
DocumentState[] states)
DocumentStates a user is an author of.
user - the user to return a count for.states - the document states to filter on
DocumentStates a user is an author of.int getDocumentsUnderEditCount()
JiveIterator<Document> getDocumentsUnderEdit()
void moveDocument(Document document,
JiveContainer destinationContainer)
throws UnauthorizedException
document - the document to move.destinationContainer - the container to move the document to.
UnauthorizedException - if user does not have administrator permissions for the document's current
container.
void deleteDocument(Document document)
throws UnauthorizedException
Document.getVersionManager()
document - the document to delete.
UnauthorizedException - if user does not have administrator permissions for the container.void deleteUserDocuments(User user)
Document.getVersionManager()
user - the author of the documents being deleted
UnauthorizedException - if user does not have administrator permissions for the container.boolean isCommentsEnabled()
void setCommentsEnabled(boolean commentsEnabled)
throws UnauthorizedException
commentsEnabled - true to enable the comments feature, false to disable
UnauthorizedException - if not a system administratorboolean isTrackbacksEnabled()
void setTrackbacksEnabled(boolean trackbacksEnabled)
throws UnauthorizedException
trackbacksEnabled - true to enable the trackback feature, false to disable
UnauthorizedException - if not a system administrator
void addDocument(JiveContainer container,
Document document,
Map parameters)
throws RejectedException,
DocumentAlreadyExistsException,
UnauthorizedException
Document.save()
for more details.
Adding a document to a container may cause a DocumentAlreadyExistsException to be thrown if the subject
of the document is not unique among the published documents in the container.
An UnauthorizedException will be thrown if the user is not a system administrator or does not have the proper
permissions on either the document or the container.
container - The container to add a document.document - the document to add into this container.parameters -
RejectedException - if one of the installed interceptors prevents the document from being added.
DocumentAlreadyExistsException - if the subject of the document is not unique in the container
UnauthorizedException - if user does not have the proper permissions for the container.
void addDocument(JiveContainer container,
Document document,
com.jivesoftware.community.impl.PermissionsBundle permBundle,
Map parameters)
throws RejectedException,
DocumentAlreadyExistsException,
UnauthorizedException
Document.save() for more details.
Adding a document to a container may cause a DocumentAlreadyExistsException to be thrown if the subject
of the document is not unique among the published documents in the container.
An UnauthorizedException will be thrown if the user is not a system administrator or does not have the proper
permissions on either the document or the container.
container - The container to add a document to.document - the document to add into this container.permBundle - the permissions to assign to the documentparameters -
RejectedException - if one of the installed interceptors prevents the document from being added.
DocumentAlreadyExistsException - if the subject of the document is not unique in the container
UnauthorizedException - if user does not have the proper permissions for the container.Collection<User> getDocumentApprovers(JiveContainer container)
container - The container to get document approvers.
void addDocumentApprover(JiveContainer container,
User user)
throws UnauthorizedException
container - The container to a document approver for.user - The user to add as a document approver.
UnauthorizedException - if user does not have the proper permissions for the container.
void removeDocumentApprover(JiveContainer container,
User user)
throws UnauthorizedException
container - The container to remove a document approver from.user - The user to remove as a document approver.
UnauthorizedException - if user does not have the proper permissions for the container.Document getLatestDocument(JiveContainer container)
DocumentResultFilter, but this method offers a simpler, more optimized way to access
the data.
container - The container to get the last document for
int getDocumentCount(JiveContainer container)
getDocumentCount(JiveContainer , DocumentResultFilter)
with DocumentResultFilter}.setRecusive(true).
container - The container to find a document count for.
int getDocumentCount(TagSet tagSet)
tagSet - the TagSet to return the number of published documents for
JiveIterator<Document> getDocuments(JiveContainer container)
DocumentResultFilter.setRecusive(true).
container - The documents for the container.
JiveIterator<Document> getDocuments(TagSet tagSet)
tagSet - The documents for the tag set.
int getDocumentCount(JiveContainer container,
DocumentResultFilter resultFilter)
container - The container find a document count forresultFilter - a DocumentResultFilter to limit the query on.
int getDocumentCount(TagSet tagSet,
DocumentResultFilter filter)
tagSet - the TagSet to return the document count forfilter - a DocumentResultFilter to limit the query on.
JiveIterator<Document> getDocuments(JiveContainer container,
DocumentResultFilter resultFilter)
container - The container to retrieve documents from.resultFilter - a DocumentResultFilter object to perform filtering and sorting with.
JiveIterator<Document> getDocuments(TagSet tagSet,
DocumentResultFilter resultFilter)
tagSet - the TagSet to retrieve documents forresultFilter - a DocumentResultFilter object to perform filtering and sorting with.
int getDocumentsUnderEditCount(JiveContainer container)
container - The container to to get a count for.
JiveIterator<Document> getDocumentsUnderEdit(JiveContainer container)
container - The container to find the number of documents under edit for.
|
Clearspace Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||