public interface DocumentService
| Modifier and Type | Field and Description |
|---|---|
static String |
DOCUMENT |
static String |
DOCUMENTMAPPING |
static String |
SUPERVISED_BY |
| Modifier and Type | Method and Description |
|---|---|
void |
archive(SDocumentMapping documentMapping,
long archiveDate)
archive the specific document mapping in the archive date
|
SMappedDocument |
attachDocumentToProcessInstance(SDocument document,
long processInstanceId,
String name,
String description)
Save a document
|
SMappedDocument |
attachDocumentToProcessInstance(SDocument document,
long processInstanceId,
String name,
String description,
int index)
Save a document
|
void |
deleteArchivedDocuments(List<Long> processInstanceId)
delete archived documents mapping and documents links to a set of processes
|
void |
deleteContentOfArchivedDocument(long archivedDocumentId)
Remove the content of an archived document while keeping it's metadata.
|
void |
deleteDocument(SLightDocument document) |
void |
deleteDocumentsFromProcessInstance(Long processInstanceId)
Delete documents from a specified process instance
|
String |
generateDocumentURL(String name,
String contentStorageId) |
SAMappedDocument |
getArchivedDocument(long archivedProcessDocumentId)
Retrieve an archived document
|
SAMappedDocument |
getArchivedVersionOfProcessDocument(long documentId)
Get the archived version corresponding to a document
|
SLightDocument |
getDocument(long documentId)
Get document by its id
|
byte[] |
getDocumentContent(String documentId)
Get document content by document id
|
List<SMappedDocument> |
getDocumentList(String documentName,
long processInstanceId,
int fromIndex,
int numberOfResult)
Get a list of document.
|
List<SMappedDocument> |
getDocumentList(String documentName,
long processInstanceId,
long time)
Get a list of document at a given time.
|
List<SMappedDocument> |
getDocumentsOfProcessInstance(long processInstanceId,
int fromIndex,
int numberPerPage,
String field,
OrderByType order)
Get a list of documents for specific process instance, this can be used for pagination
|
SMappedDocument |
getMappedDocument(long mappingId)
Get document with mapping by its mapping id
|
SMappedDocument |
getMappedDocument(long processInstanceId,
String documentName)
Get document with mapping by its name in the specific process instance
|
SMappedDocument |
getMappedDocument(long processInstanceId,
String documentName,
long time)
Get name specified document archived in a certain time in the process instance
|
long |
getNumberOfArchivedDocuments(QueryOptions queryOptions)
Get total number of archived documents according to the query criteria
|
long |
getNumberOfArchivedDocumentsSupervisedBy(long userId,
QueryOptions queryOptions)
Get total number of archived documents for the specific supervisor
|
long |
getNumberOfDocuments(QueryOptions queryOptions)
Get total number of document according to the query criteria
|
long |
getNumberOfDocumentsOfProcessInstance(long processInstanceId)
Get total number of documents in the specific process instance
|
long |
getNumberOfDocumentsSupervisedBy(long userId,
QueryOptions queryOptions)
Get total number of documents for the specific supervisor
|
void |
removeCurrentVersion(long processInstanceId,
String documentName)
Remove the document with the specified process instance and name
|
void |
removeCurrentVersion(SMappedDocument document)
Remove this document.
|
void |
removeDocument(SMappedDocument mappedDocument) |
List<SAMappedDocument> |
searchArchivedDocuments(QueryOptions queryOptions)
Search all archived documents according to the query criteria.
|
List<SAMappedDocument> |
searchArchivedDocumentsSupervisedBy(long userId,
QueryOptions queryOptions)
Search all archived documents for the specific supervisor
|
List<SMappedDocument> |
searchDocuments(QueryOptions queryOptions)
Search all documents according to the query criteria
|
List<SMappedDocument> |
searchDocumentsSupervisedBy(long userId,
QueryOptions queryOptions)
Search all documents for the specific supervisor
|
SMappedDocument |
updateDocument(long documentId,
SDocument sDocument)
update the document having the documentId with this new version
|
SMappedDocument |
updateDocument(SDocumentMapping documentToUpdate,
SDocument sDocument) |
void |
updateDocumentIndex(SMappedDocument mappedDocument,
int index)
update the index of a document inside the list
|
void |
updateDocumentOfList(SMappedDocument mappedDocument,
SDocument document,
int index) |
static final String DOCUMENT
static final String DOCUMENTMAPPING
static final String SUPERVISED_BY
SMappedDocument attachDocumentToProcessInstance(SDocument document, long processInstanceId, String name, String description) throws org.bonitasoft.engine.commons.exceptions.SObjectCreationException
document - the document to storeprocessInstanceId - the process instance id to attach the document toname - description - org.bonitasoft.engine.commons.exceptions.SObjectCreationException - when the storage has failedSMappedDocument attachDocumentToProcessInstance(SDocument document, long processInstanceId, String name, String description, int index) throws org.bonitasoft.engine.commons.exceptions.SObjectCreationException, org.bonitasoft.engine.commons.exceptions.SObjectAlreadyExistsException
document - the document to storeprocessInstanceId - the process instance id to attach the document toname - description - index - the index in the list of documentorg.bonitasoft.engine.commons.exceptions.SObjectCreationException - when the storage has failedorg.bonitasoft.engine.commons.exceptions.SObjectAlreadyExistsExceptionvoid removeCurrentVersion(SMappedDocument document) throws org.bonitasoft.engine.commons.exceptions.SObjectModificationException
this archive and delete mapping on the process, i.e. the content of the document itself will be kept in database, use
deleteContentOfArchivedDocument(long) to delete the content
document - the document mapping to removeorg.bonitasoft.engine.commons.exceptions.SObjectModificationExceptionvoid removeCurrentVersion(long processInstanceId,
String documentName)
throws org.bonitasoft.engine.commons.exceptions.SObjectNotFoundException,
org.bonitasoft.engine.commons.exceptions.SObjectModificationException
this archive and delete mapping on the process, i.e. the content of the document itself will be kept in database, use
deleteContentOfArchivedDocument(long) to delete the content
processInstanceId - id of the process having the documentdocumentName - name of the documentorg.bonitasoft.engine.commons.exceptions.SObjectNotFoundExceptionorg.bonitasoft.engine.commons.exceptions.SObjectModificationExceptionbyte[] getDocumentContent(String documentId) throws org.bonitasoft.engine.commons.exceptions.SObjectNotFoundException
documentId - identifier of the documentorg.bonitasoft.engine.commons.exceptions.SObjectNotFoundExceptionSMappedDocument getMappedDocument(long mappingId) throws org.bonitasoft.engine.commons.exceptions.SObjectNotFoundException, SBonitaReadException
mappingId - identifier of the mapping of the documentorg.bonitasoft.engine.commons.exceptions.SObjectNotFoundExceptionSBonitaReadExceptionSLightDocument getDocument(long documentId) throws org.bonitasoft.engine.commons.exceptions.SObjectNotFoundException, SBonitaReadException
documentId - identifier of documentorg.bonitasoft.engine.commons.exceptions.SObjectNotFoundExceptionSBonitaReadExceptionSMappedDocument getMappedDocument(long processInstanceId, String documentName) throws org.bonitasoft.engine.commons.exceptions.SObjectNotFoundException, SBonitaReadException
processInstanceId - identifier of process instancedocumentName - name of process documentorg.bonitasoft.engine.commons.exceptions.SObjectNotFoundExceptionSBonitaReadExceptionList<SMappedDocument> getDocumentsOfProcessInstance(long processInstanceId, int fromIndex, int numberPerPage, String field, OrderByType order) throws SBonitaReadException
processInstanceId - identifier of process instancefromIndex - Index of the record to be retrieved from. First record has index 0numberPerPage - Number of result we want to get. Maximum number of result returnedorder - field - SBonitaReadExceptionlong getNumberOfDocumentsOfProcessInstance(long processInstanceId)
throws SBonitaReadException
processInstanceId - identifier of process instanceSBonitaReadExceptionSMappedDocument getMappedDocument(long processInstanceId, String documentName, long time) throws org.bonitasoft.engine.commons.exceptions.SObjectNotFoundException, SBonitaReadException
processInstanceId - identifier of process instancedocumentName - name of documenttime - the archived time of documentorg.bonitasoft.engine.commons.exceptions.SObjectNotFoundExceptionSBonitaReadExceptionlong getNumberOfDocuments(QueryOptions queryOptions) throws SBonitaReadException
queryOptions - a QueryOptions object containing some query conditionsSBonitaReadExceptionList<SMappedDocument> searchDocuments(QueryOptions queryOptions) throws SBonitaReadException
queryOptions - a QueryOptions object containing some query conditionsSBonitaReadExceptionlong getNumberOfDocumentsSupervisedBy(long userId,
QueryOptions queryOptions)
throws SBonitaReadException
userId - identifier of supervisor userqueryOptions - a QueryOptions object containing some query conditionsSBonitaReadExceptionList<SMappedDocument> searchDocumentsSupervisedBy(long userId, QueryOptions queryOptions) throws SBonitaReadException
userId - identifier of supervisor userqueryOptions - a QueryOptions object containing some query conditionsSBonitaReadExceptionlong getNumberOfArchivedDocuments(QueryOptions queryOptions) throws SBonitaReadException
queryOptions - a QueryOptions object containing some query conditionsSBonitaReadExceptionvoid removeDocument(SMappedDocument mappedDocument) throws org.bonitasoft.engine.commons.exceptions.SObjectModificationException
org.bonitasoft.engine.commons.exceptions.SObjectModificationExceptionList<SAMappedDocument> searchArchivedDocuments(QueryOptions queryOptions) throws SBonitaReadException
queryOptions - a QueryOptions object containing some query conditionsSBonitaReadExceptionlong getNumberOfArchivedDocumentsSupervisedBy(long userId,
QueryOptions queryOptions)
throws SBonitaReadException
userId - identifier of supervisor userqueryOptions - a QueryOptions object containing some query conditionsSBonitaReadExceptionList<SAMappedDocument> searchArchivedDocumentsSupervisedBy(long userId, QueryOptions queryOptions) throws SBonitaReadException
userId - identifier of supervisor userqueryOptions - a QueryOptions object containing some query conditionsSBonitaReadExceptionSAMappedDocument getArchivedVersionOfProcessDocument(long documentId) throws org.bonitasoft.engine.commons.exceptions.SObjectNotFoundException
documentId - identifier of process documentorg.bonitasoft.engine.commons.exceptions.SObjectNotFoundException - when the document does not existSAMappedDocument getArchivedDocument(long archivedProcessDocumentId) throws org.bonitasoft.engine.commons.exceptions.SObjectNotFoundException
archivedProcessDocumentId - the id of the archived documentorg.bonitasoft.engine.commons.exceptions.SObjectNotFoundException - when the archive does not existvoid deleteDocument(SLightDocument document) throws org.bonitasoft.engine.commons.exceptions.SObjectModificationException
org.bonitasoft.engine.commons.exceptions.SObjectModificationExceptionvoid deleteDocumentsFromProcessInstance(Long processInstanceId) throws SBonitaReadException, org.bonitasoft.engine.commons.exceptions.SObjectModificationException
processInstanceId - org.bonitasoft.engine.commons.exceptions.SObjectModificationExceptionSBonitaReadExceptionvoid deleteArchivedDocuments(List<Long> processInstanceId) throws SBonitaReadException, SRecorderException
processInstanceId - ids of the source process instancesSBonitaReadExceptionSRecorderExceptionvoid archive(SDocumentMapping documentMapping, long archiveDate) throws org.bonitasoft.engine.commons.exceptions.SObjectModificationException
documentMapping - document mapping will be archivedarchiveDate - the archive timeorg.bonitasoft.engine.commons.exceptions.SObjectModificationExceptionvoid updateDocumentOfList(SMappedDocument mappedDocument, SDocument document, int index) throws org.bonitasoft.engine.commons.exceptions.SObjectModificationException
mappedDocument - the document to updatedocument - the new contentindex - the new indexorg.bonitasoft.engine.commons.exceptions.SObjectModificationExceptionvoid updateDocumentIndex(SMappedDocument mappedDocument, int index) throws org.bonitasoft.engine.commons.exceptions.SObjectModificationException
mappedDocument - the document to updateindex - the new indexorg.bonitasoft.engine.commons.exceptions.SObjectModificationExceptionList<SMappedDocument> getDocumentList(String documentName, long processInstanceId, int fromIndex, int numberOfResult) throws SBonitaReadException
documentName - the name of the document listprocessInstanceId - the id of the process instance that contains the listfromIndex - pagination parameternumberOfResult - pagination parameterSBonitaReadExceptionSMappedDocument updateDocument(SDocumentMapping documentToUpdate, SDocument sDocument) throws org.bonitasoft.engine.commons.exceptions.SObjectModificationException
documentToUpdate - the document mapping to udpatesDocument - the value to set th emapping withSRecorderExceptionorg.bonitasoft.engine.commons.exceptions.SObjectModificationExceptionList<SMappedDocument> getDocumentList(String documentName, long processInstanceId, long time) throws SBonitaReadException
elements are taken from archive and from non archived mapping if the process is still running
documentName - the name of the document listprocessInstanceId - the id of the process instance that contains the listtime - time when the list was like thatSBonitaReadExceptionvoid deleteContentOfArchivedDocument(long archivedDocumentId)
throws org.bonitasoft.engine.commons.exceptions.SObjectNotFoundException,
SBonitaReadException,
SRecorderException
After calling this method you will not be able to retrieve the content of the document since it will be erased from the database. This method can be useful for keeping history of a document without overloading the database.
documentId - the id of the archived document to remove content onorg.bonitasoft.engine.commons.exceptions.SObjectNotFoundExceptionSBonitaReadExceptionSRecorderExceptionSMappedDocument updateDocument(long documentId, SDocument sDocument) throws org.bonitasoft.engine.commons.exceptions.SObjectNotFoundException, org.bonitasoft.engine.commons.exceptions.SObjectModificationException, SBonitaReadException
documentId - the id of the document to updatesDocument - the new version of the document @returnorg.bonitasoft.engine.commons.exceptions.SObjectNotFoundExceptionorg.bonitasoft.engine.commons.exceptions.SObjectModificationExceptionSBonitaReadExceptionCopyright © 2019 Bonitasoft S.A.. All rights reserved.