public interface DocumentService
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DOCUMENT |
static java.lang.String |
DOCUMENTMAPPING |
static java.lang.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,
java.lang.String name,
java.lang.String description)
Save a document
|
SMappedDocument |
attachDocumentToProcessInstance(SDocument document,
long processInstanceId,
java.lang.String name,
java.lang.String description,
int index)
Save a document
|
void |
deleteArchivedDocuments(java.util.List<java.lang.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(java.lang.Long processInstanceId)
Delete documents from a specified process instance
|
java.lang.String |
generateDocumentURL(java.lang.String name,
java.lang.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(java.lang.String documentId)
Get document content by document id
|
java.util.List<SMappedDocument> |
getDocumentList(java.lang.String documentName,
long processInstanceId,
int fromIndex,
int numberOfResult)
Get a list of document.
|
java.util.List<SMappedDocument> |
getDocumentList(java.lang.String documentName,
long processInstanceId,
long time)
Get a list of document at a given time.
|
java.util.List<SMappedDocument> |
getDocumentsOfProcessInstance(long processInstanceId,
int fromIndex,
int numberPerPage,
java.lang.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,
java.lang.String documentName)
Get document with mapping by its name in the specific process instance
|
SMappedDocument |
getMappedDocument(long processInstanceId,
java.lang.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,
java.lang.String documentName)
Remove the document with the specified process instance and name
|
void |
removeCurrentVersion(SMappedDocument document)
Remove this document.
|
void |
removeDocument(SMappedDocument mappedDocument) |
java.util.List<SAMappedDocument> |
searchArchivedDocuments(QueryOptions queryOptions)
Search all archived documents according to the query criteria.
|
java.util.List<SAMappedDocument> |
searchArchivedDocumentsSupervisedBy(long userId,
QueryOptions queryOptions)
Search all archived documents for the specific supervisor
|
java.util.List<SMappedDocument> |
searchDocuments(QueryOptions queryOptions)
Search all documents according to the query criteria
|
java.util.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 java.lang.String DOCUMENT
static final java.lang.String DOCUMENTMAPPING
static final java.lang.String SUPERVISED_BY
SMappedDocument attachDocumentToProcessInstance(SDocument document, long processInstanceId, java.lang.String name, java.lang.String description) throws SObjectCreationException
document - the document to storeprocessInstanceId - the process instance id to attach the document toname - description - SObjectCreationException - when the storage has failedSMappedDocument attachDocumentToProcessInstance(SDocument document, long processInstanceId, java.lang.String name, java.lang.String description, int index) throws SObjectCreationException, SObjectAlreadyExistsException
document - the document to storeprocessInstanceId - the process instance id to attach the document toname - description - index - the index in the list of documentSObjectCreationException - when the storage has failedSObjectAlreadyExistsExceptionvoid removeCurrentVersion(SMappedDocument document) throws 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 removeSObjectModificationExceptionvoid removeCurrentVersion(long processInstanceId,
java.lang.String documentName)
throws SObjectNotFoundException,
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 documentSObjectNotFoundExceptionSObjectModificationExceptionbyte[] getDocumentContent(java.lang.String documentId)
throws SObjectNotFoundException
documentId - identifier of the documentSObjectNotFoundExceptionSMappedDocument getMappedDocument(long mappingId) throws SObjectNotFoundException, SBonitaReadException
mappingId - identifier of the mapping of the documentSObjectNotFoundExceptionSBonitaReadExceptionSLightDocument getDocument(long documentId) throws SObjectNotFoundException, SBonitaReadException
documentId - identifier of documentSObjectNotFoundExceptionSBonitaReadExceptionSMappedDocument getMappedDocument(long processInstanceId, java.lang.String documentName) throws SObjectNotFoundException, SBonitaReadException
processInstanceId - identifier of process instancedocumentName - name of process documentSObjectNotFoundExceptionSBonitaReadExceptionjava.util.List<SMappedDocument> getDocumentsOfProcessInstance(long processInstanceId, int fromIndex, int numberPerPage, java.lang.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, java.lang.String documentName, long time) throws SObjectNotFoundException, SBonitaReadException
processInstanceId - identifier of process instancedocumentName - name of documenttime - the archived time of documentSObjectNotFoundExceptionSBonitaReadExceptionlong getNumberOfDocuments(QueryOptions queryOptions) throws SBonitaReadException
queryOptions - a QueryOptions object containing some query conditionsSBonitaReadExceptionjava.util.List<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 conditionsSBonitaReadExceptionjava.util.List<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 SObjectModificationException
SObjectModificationExceptionjava.util.List<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 conditionsSBonitaReadExceptionjava.util.List<SAMappedDocument> searchArchivedDocumentsSupervisedBy(long userId, QueryOptions queryOptions) throws SBonitaReadException
userId - identifier of supervisor userqueryOptions - a QueryOptions object containing some query conditionsSBonitaReadExceptionSAMappedDocument getArchivedVersionOfProcessDocument(long documentId) throws SObjectNotFoundException
documentId - identifier of process documentSObjectNotFoundException - when the document does not existjava.lang.String generateDocumentURL(java.lang.String name,
java.lang.String contentStorageId)
SAMappedDocument getArchivedDocument(long archivedProcessDocumentId) throws SObjectNotFoundException
archivedProcessDocumentId - the id of the archived documentSObjectNotFoundException - when the archive does not existvoid deleteDocument(SLightDocument document) throws SObjectModificationException
SObjectModificationExceptionvoid deleteDocumentsFromProcessInstance(java.lang.Long processInstanceId)
throws SBonitaReadException,
SObjectModificationException
processInstanceId - SObjectModificationExceptionSBonitaReadExceptionvoid deleteArchivedDocuments(java.util.List<java.lang.Long> processInstanceId)
throws SBonitaReadException,
SRecorderException
processInstanceId - ids of the source process instancesSBonitaReadExceptionSRecorderExceptionvoid archive(SDocumentMapping documentMapping, long archiveDate) throws SObjectModificationException
documentMapping - document mapping will be archivedarchiveDate - the archive timeSObjectModificationExceptionvoid updateDocumentOfList(SMappedDocument mappedDocument, SDocument document, int index) throws SObjectModificationException
mappedDocument - the document to updatedocument - the new contentindex - the new indexSObjectModificationExceptionvoid updateDocumentIndex(SMappedDocument mappedDocument, int index) throws SObjectModificationException
mappedDocument - the document to updateindex - the new indexSObjectModificationExceptionjava.util.List<SMappedDocument> getDocumentList(java.lang.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 SObjectModificationException
documentToUpdate - the document mapping to udpatesDocument - the value to set th emapping withSRecorderExceptionSObjectModificationExceptionjava.util.List<SMappedDocument> getDocumentList(java.lang.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 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 onSObjectNotFoundExceptionSBonitaReadExceptionSRecorderExceptionSMappedDocument updateDocument(long documentId, SDocument sDocument) throws SObjectNotFoundException, SObjectModificationException, SBonitaReadException
documentId - the id of the document to updatesDocument - the new version of the document @returnSObjectNotFoundExceptionSObjectModificationExceptionSBonitaReadException