Interface DocumentService
-
- All Superinterfaces:
ComponentService<com.flower.docs.domain.document.Document>
,CRUDService<com.flower.docs.domain.document.Document>
,EditService<com.flower.docs.domain.document.Document>
public interface DocumentService extends ComponentService<com.flower.docs.domain.document.Document>
Service dedicated toDocument
management- Author:
- Christopher Laszczuk
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<com.flower.docs.domain.file.DocumentFile>
addFiles(com.flower.docs.domain.common.Id id, java.util.List<com.flower.docs.domain.file.DocumentFile> files, boolean replace)
Adds multiple files to a document.java.util.List<com.flower.docs.domain.document.Document>
create(java.util.List<com.flower.docs.domain.document.Document> documents)
Creates a document with its files.void
deleteFiles(com.flower.docs.domain.common.Id id, java.util.List<com.flower.docs.domain.common.Id> fileIds)
Deletes files of a document.com.flower.docs.domain.file.DocumentFile
getFile(com.flower.docs.domain.common.Id documentId, com.flower.docs.domain.common.Id fileId, boolean includeContent)
Get a specific file of document.java.util.List<com.flower.docs.domain.file.DocumentFile>
getFiles(com.flower.docs.domain.common.Id id, boolean includeContent)
Get files of document.-
Methods inherited from interface com.flower.docs.service.api.component.ComponentService
search
-
Methods inherited from interface com.flower.docs.service.api.common.CRUDService
delete, get, update
-
Methods inherited from interface com.flower.docs.service.api.component.EditService
edit, editNext
-
-
-
-
Method Detail
-
create
java.util.List<com.flower.docs.domain.document.Document> create(java.util.List<com.flower.docs.domain.document.Document> documents) throws com.flower.docs.domain.exception.FunctionalException, com.flower.docs.domain.exception.TechnicalException
Creates a document with its files.
Note: If a document to create has no class, it will be created asStatus.DRAFT
. This allows an asynchronous document creation. File operation on a draft document does not require any specific permission.- Specified by:
create
in interfaceCRUDService<com.flower.docs.domain.document.Document>
- Parameters:
documents
- The documents to create. If a document has no class, it will be created asStatus.DRAFT
- Returns:
- The created documents
- Throws:
com.flower.docs.domain.exception.TechnicalException
- If a technical error occurred during processcom.flower.docs.domain.exception.FunctionalException
- If a functional error occurred during process
-
getFiles
java.util.List<com.flower.docs.domain.file.DocumentFile> getFiles(com.flower.docs.domain.common.Id id, boolean includeContent) throws com.flower.docs.domain.exception.TechnicalException, com.flower.docs.domain.exception.FunctionalException
Get files of document.- Parameters:
id
- The identifier of the document whose files are requestedIdentifiableElement.getId()
includeContent
- Determines if the file contents should be included or not- Returns:
- The requested files
- Throws:
com.flower.docs.domain.exception.TechnicalException
- If a technical error occurred during processcom.flower.docs.domain.exception.FunctionalException
- If a functional error occurred during process- See Also:
DocumentFile.getContent()
-
getFile
com.flower.docs.domain.file.DocumentFile getFile(com.flower.docs.domain.common.Id documentId, com.flower.docs.domain.common.Id fileId, boolean includeContent) throws com.flower.docs.domain.exception.TechnicalException, com.flower.docs.domain.exception.FunctionalException
Get a specific file of document.- Parameters:
documentId
- The identifier of the document whose files are requestedIdentifiableElement.getId()
fileId
- The identifier of the document fileIdentifiableElement.getId()
includeContent
- Determines if the file contents should be included or not- Returns:
- The requested file
- Throws:
com.flower.docs.domain.exception.TechnicalException
- If a technical error occurred during processcom.flower.docs.domain.exception.FunctionalException
- If a functional error occurred during process- See Also:
DocumentFile.getContent()
-
addFiles
java.util.List<com.flower.docs.domain.file.DocumentFile> addFiles(com.flower.docs.domain.common.Id id, java.util.List<com.flower.docs.domain.file.DocumentFile> files, boolean replace) throws com.flower.docs.domain.exception.TechnicalException, com.flower.docs.domain.exception.FunctionalException
Adds multiple files to a document.- Parameters:
id
- The document idIdentifiableElement.getId()
files
- The files to addIdentifiableElement.getId()
replace
- Determines if actual document files should be replaced by provided ones- Returns:
- The created files without their content
- Throws:
com.flower.docs.domain.exception.TechnicalException
- If a technical error occurred during processcom.flower.docs.domain.exception.FunctionalException
- If a functional error occurred during process
-
deleteFiles
void deleteFiles(com.flower.docs.domain.common.Id id, java.util.List<com.flower.docs.domain.common.Id> fileIds) throws com.flower.docs.domain.exception.TechnicalException, com.flower.docs.domain.exception.FunctionalException
Deletes files of a document.- Parameters:
id
- The document idIdentifiableElement.getId()
fileIds
- The identifiers of files to deleteIdentifiableElement.getId()
- Throws:
com.flower.docs.domain.exception.TechnicalException
- If a technical error occurred during processcom.flower.docs.domain.exception.FunctionalException
- If a functional error occurred during process
-
-