|
Clearspace API (1.7.0) 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 | |
|---|---|
Document |
createDocument(User user,
DocumentType documentType,
java.lang.String documentID,
java.lang.String title,
java.lang.String body)
Create a new document. |
void |
deleteDocument(Document document)
Deletes a document. |
Document |
getDocument(Community community,
java.lang.String subject)
Returns a document from a community 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(java.lang.String documentID)
Returns a document from the community based on its document ID. |
Document |
getDocument(java.lang.String documentID,
int version)
Returns the revision of the document with the specified docID and version number. |
JiveIterator<Document> |
getDocumentsUnderEdit()
Returns an Iterable of documents currently being editted. |
int |
getDocumentsUnderEditCount()
Returns the count of the number of documents currently being editted. |
int |
getEditAutoExpireTimeout()
Returns the number of minutes that a document will be marked as being editted without any updates before the document will be remarked as not being editted. |
JiveIterator<Document> |
getPopularDocuments()
Returns the top x documents across all communities according to ratings, document views & time passed since the document was created. |
JiveIterator<Document> |
getPopularDocuments(java.util.List<java.lang.String> languages)
Returns the top x documents across all communities 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,
Community destinationCommunity)
Moves a document from it's current community to another. |
void |
setCommentsEnabled(boolean commentsEnabled)
Enables or disables the comments feature system wide. |
void |
setEditAutoExpireTimeout(int minutes)
Sets the number of minutes that a document will be marked as being editted without any updates before the document will be remarked as not being editted. |
void |
setTrackbacksEnabled(boolean trackbacksEnabled)
Enables or disables the trackbacks feature system wide. |
| Methods inherited from interface com.jivesoftware.community.JiveManager |
|---|
destroy, initialize |
| Method Detail |
|---|
Document createDocument(User user,
DocumentType documentType,
java.lang.String documentID,
java.lang.String title,
java.lang.String body)
throws DuplicateIDException
DocumentState.INCOMPLETE
and must be attached to a community using the Community.addDocument(Document)
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(java.lang.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(java.lang.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(Community community,
java.lang.String subject)
throws DocumentObjectNotFoundException,
UnauthorizedException
community - the community 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(java.util.List<java.lang.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,
Community destinationCommunity)
throws UnauthorizedException
document - the document to move.destinationCommunity - the community to move the document to.
UnauthorizedException - if user does not have administrator permissions for the
document's current community.
void deleteDocument(Document document)
throws UnauthorizedException
Document.getVersionManager()
document - the document to delete.
UnauthorizedException - if user does not have administrator permissions for the
community.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 administratorint getEditAutoExpireTimeout()
void setEditAutoExpireTimeout(int minutes)
throws UnauthorizedException
minutes - the edit autoexpire timeout in minutes
UnauthorizedException - if not authorized
|
Clearspace Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||