public class DocumentService
extends java.lang.Object
| Constructor and Description |
|---|
DocumentService(ContentManagementSystem contentManagementSystem) |
| Modifier and Type | Method and Description |
|---|---|
CategoryType |
createNewCategoryType(java.lang.String name,
int maxChoices) |
FileDocument |
createNewFileDocument(Document parent) |
TextDocument |
createNewTextDocument(Document parent) |
UrlDocument |
createNewUrlDocument(Document parent) |
void |
deleteDocument(Document document) |
Category[] |
getAllCategoriesOfType(CategoryType categoryType) |
CategoryType[] |
getAllCategoryTypes() |
Category |
getCategory(CategoryType categoryType,
java.lang.String categoryName) |
Category |
getCategory(int categoryId) |
CategoryType |
getCategoryType(int categoryTypeId) |
CategoryType |
getCategoryType(java.lang.String categoryTypeName) |
Document |
getDocument(int documentId)
Used to get a document of any type.
|
Document |
getDocument(java.lang.String documentIdString)
Used to get a document of any type.
|
java.util.List<Document> |
getDocuments(SearchQuery query) |
SearchResult<Document> |
getDocuments(SearchQuery query,
int startPosition,
int maxResults) |
TextDocument |
getTextDocument(int documentId) |
TextDocument |
getTextDocument(java.lang.String documentIdString) |
UrlDocument |
getUrlDocument(int documentId) |
UrlDocument |
getUrlDocument(java.lang.String documentIdString) |
org.w3c.dom.Document |
getXmlDomForDocument(Document document) |
SearchQuery |
parseLuceneSearchQuery(java.lang.String query) |
void |
saveCategory(Category category) |
int |
saveChanges(Document document)
Saves the changes to a modified document.
|
Document[] |
search(SearchQuery query) |
public DocumentService(ContentManagementSystem contentManagementSystem)
public Document getDocument(java.lang.String documentIdString) throws NoPermissionException
documentIdString - The unique id or name of the document requested, can be either the int value also known as "meta_id"
or the document name also known as "alias".NoPermissionException - If the current user dosen't have the rights to read this document.public Document getDocument(int documentId) throws NoPermissionException
documentId - The id number of the document requested, also sometimes known as "meta_id"NoPermissionException - If the current user dosen't have the rights to read this document.public TextDocument getTextDocument(java.lang.String documentIdString) throws NoPermissionException
documentIdString - The unique id or name of the document requested, can be either the int value alsp known as "meta_id"
or the document name also known as "alias".NoPermissionException - If the current user dosen't have the rights to read this document.public TextDocument getTextDocument(int documentId) throws NoPermissionException
documentId - The id number of the document requested, also known as "meta_id"NoPermissionException - If the current user dosen't have the rights to read this document.public TextDocument createNewTextDocument(Document parent) throws NoPermissionException
NoPermissionExceptionpublic UrlDocument createNewUrlDocument(Document parent) throws NoPermissionException
NoPermissionExceptionpublic FileDocument createNewFileDocument(Document parent) throws NoPermissionException
NoPermissionExceptionpublic UrlDocument getUrlDocument(java.lang.String documentIdString) throws NoPermissionException
documentIdString - The unique id or name of the document requested, can be either the int value also known as "meta_id"
or the document name also known as "alias".NoPermissionException - If the current user doesn't have the rights to read this document.public UrlDocument getUrlDocument(int documentId) throws NoPermissionException
documentId - The id number of the document requested, also known as "meta_id"NoPermissionException - If the current user doesn't have the rights to read this document.public CategoryType getCategoryType(int categoryTypeId)
public SearchQuery parseLuceneSearchQuery(java.lang.String query) throws BadQueryException
BadQueryExceptionpublic org.w3c.dom.Document getXmlDomForDocument(Document document)
public int saveChanges(Document document) throws SaveException
document - - document that going to be savedSaveExceptionpublic void deleteDocument(Document document) throws NoPermissionException
NoPermissionExceptionpublic Category getCategory(CategoryType categoryType, java.lang.String categoryName)
public Category getCategory(int categoryId)
public CategoryType getCategoryType(java.lang.String categoryTypeName)
public Category[] getAllCategoriesOfType(CategoryType categoryType)
public CategoryType[] getAllCategoryTypes()
public CategoryType createNewCategoryType(java.lang.String name, int maxChoices) throws NoPermissionException, CategoryTypeAlreadyExistsException
NoPermissionExceptionCategoryTypeAlreadyExistsExceptionpublic java.util.List<Document> getDocuments(SearchQuery query) throws SearchException
SearchExceptionpublic SearchResult<Document> getDocuments(SearchQuery query, int startPosition, int maxResults) throws SearchException
SearchExceptionpublic Document[] search(SearchQuery query) throws SearchException
SearchExceptionpublic void saveCategory(Category category) throws NoPermissionException, CategoryAlreadyExistsException