Package se.conciliate.extensions.store
Interface MTDocumentStore
public interface MTDocumentStore
Utility methods for documents.
- Since:
- 3.0
-
Method Summary
Modifier and TypeMethodDescriptionfindDocument
(long id) Finds a document by ID.findDocument
(String uuid) Finds a document by UUID.findDocumentHeaders
(List<Long> idList) Finds documents in the current repository from a list of document ID:s, as headers.findDocuments
(List<Long> idList) Finds documents in the current repository from a list of document ID:s.findDocumentsWithContent
(MTRepository repo, MTLanguage lang, String content, int maxResult) Finds the documents with the given content.findDocumentType
(long documentTypeID) Finds a document type by ID.findDocumentTypeHeaders
(List<Long> idList) Finds document types from a list of document type ID:s, as header.findDocumentTypes
(List<Long> idList) Finds document types from a list of document type ID:s.Finds duplicates for the documents in the current repository and current language.findDuplicateDocumentHeaders
(List<Long> idList) Finds duplicates for the documents specified by theidList
in the current repository and current language.
-
Method Details
-
findDocument
Finds a document by ID.- Parameters:
id
- The document ID.- Returns:
- A document or
null
if no such document exists. - Throws:
MTAccessException
- Since:
- 3.0
-
findDocument
Finds a document by UUID.- Parameters:
uuid
- The document UUID.- Returns:
- A document or
null
if no such document exists. - Throws:
MTAccessException
- Since:
- 3.0
-
findDocuments
Finds documents in the current repository from a list of document ID:s. The documents will be returned in the same order as the ID list. Documents which the current user does not have read access to will be filtered out of the result.- Parameters:
idList
- The ID:s of documents to find.- Returns:
- A list of documents with the ID:s in
idList
. - Throws:
MTAccessException
- Since:
- 3.0
-
findDocumentsWithContent
List<MTDocumentHeader> findDocumentsWithContent(MTRepository repo, MTLanguage lang, String content, int maxResult) throws MTAccessException Finds the documents with the given content.- Parameters:
repo
-lang
-content
- contents of the documentmaxResult
-- Returns:
- list of documents with the content
- Throws:
MTAccessException
- Since:
- 9.0
-
findDocumentHeaders
Finds documents in the current repository from a list of document ID:s, as headers. The documents will be returned in the same order as the ID list. Documents which the current user does not have read access to will be filtered out of the result.- Parameters:
idList
- The ID:s of documents to find.- Returns:
- A list of documents with the ID:s in
idList
. - Throws:
MTAccessException
- Since:
- 3.0
-
findDocumentType
Finds a document type by ID.- Parameters:
documentTypeID
- The document type ID.- Returns:
- A document type or
null
if no such document type exists. - Throws:
MTAccessException
- Since:
- 3.0
-
findDocumentTypes
Finds document types from a list of document type ID:s. The types will be returned in the same order as the ID list.- Parameters:
idList
- The ID:s of document types to find.- Returns:
- A list of document types with the ID:s in
idList
. - Throws:
MTAccessException
- Since:
- 3.0
-
findDocumentTypeHeaders
Finds document types from a list of document type ID:s, as header. The types will be returned in the same order as the ID list.- Parameters:
idList
- The ID:s of document types to find.- Returns:
- A list of document types with the ID:s in
idList
. - Throws:
MTAccessException
- Since:
- 3.0
-
findDuplicateDocumentHeaders
Finds duplicates for the documents in the current repository and current language. Documents are considered duplicate when two or more have the same URL. NOTE: This method will look for possible duplicates in the whole repository.- Returns:
- A list of lists of the duplicates.
- Throws:
MTAccessException
- Since:
- 9.0
-
findDuplicateDocumentHeaders
List<List<MTDocumentHeader>> findDuplicateDocumentHeaders(List<Long> idList) throws MTAccessException Finds duplicates for the documents specified by theidList
in the current repository and current language. Documents are considered duplicate when two or more have the same URL. NOTE: This method will look for possible duplicates in the whole repository but filter the result based onidList
.- Parameters:
idList
- list of document id's to find duplicates for.- Returns:
- A list of lists of the duplicates.
- Throws:
MTAccessException
- Since:
- 9.0
-