Class DocumentAPIImpl

  • All Implemented Interfaces:
    org.bonitasoft.engine.api.DocumentAPI

    public class DocumentAPIImpl
    extends java.lang.Object
    implements org.bonitasoft.engine.api.DocumentAPI
    Author:
    Baptiste Mesta
    • Constructor Summary

      Constructors 
      Constructor Description
      DocumentAPIImpl()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.bonitasoft.engine.bpm.document.Document addDocument​(long processInstanceId, java.lang.String documentName, java.lang.String description, org.bonitasoft.engine.bpm.document.DocumentValue documentValue)  
      org.bonitasoft.engine.bpm.document.Document attachDocument​(long processInstanceId, java.lang.String documentName, java.lang.String fileName, java.lang.String mimeType, byte[] documentContent)  
      org.bonitasoft.engine.bpm.document.Document attachDocument​(long processInstanceId, java.lang.String documentName, java.lang.String fileName, java.lang.String mimeType, java.lang.String url)  
      org.bonitasoft.engine.bpm.document.Document attachNewDocumentVersion​(long processInstanceId, java.lang.String documentName, java.lang.String contentFileName, java.lang.String contentMimeType, byte[] documentContent)  
      org.bonitasoft.engine.bpm.document.Document attachNewDocumentVersion​(long processInstanceId, java.lang.String documentName, java.lang.String fileName, java.lang.String mimeType, java.lang.String url)  
      void deleteContentOfArchivedDocument​(long archivedDocumentId)  
      org.bonitasoft.engine.bpm.document.ArchivedDocument getArchivedProcessDocument​(long archivedProcessDocumentId)  
      org.bonitasoft.engine.bpm.document.ArchivedDocument getArchivedVersionOfProcessDocument​(long sourceObjectId)  
      org.bonitasoft.engine.bpm.document.Document getDocument​(long documentId)  
      org.bonitasoft.engine.bpm.document.Document getDocumentAtActivityInstanceCompletion​(long activityInstanceId, java.lang.String documentName)  
      org.bonitasoft.engine.bpm.document.Document getDocumentAtProcessInstantiation​(long processInstanceId, java.lang.String documentName)  
      byte[] getDocumentContent​(java.lang.String documentStorageId)  
      java.util.List<org.bonitasoft.engine.bpm.document.Document> getDocumentList​(long processInstanceId, java.lang.String name, int fromIndex, int numberOfResult)  
      org.bonitasoft.engine.bpm.document.Document getLastDocument​(long processInstanceId, java.lang.String documentName)  
      java.util.List<org.bonitasoft.engine.bpm.document.Document> getLastVersionOfDocuments​(long processInstanceId, int pageIndex, int numberPerPage, org.bonitasoft.engine.bpm.document.DocumentCriterion pagingCriterion)  
      long getNumberOfDocuments​(long processInstanceId)  
      org.bonitasoft.engine.bpm.document.Document removeDocument​(long documentId)  
      org.bonitasoft.engine.search.SearchResult<org.bonitasoft.engine.bpm.document.ArchivedDocument> searchArchivedDocuments​(org.bonitasoft.engine.search.SearchOptions searchOptions)  
      org.bonitasoft.engine.search.SearchResult<org.bonitasoft.engine.bpm.document.ArchivedDocument> searchArchivedDocumentsSupervisedBy​(long userId, org.bonitasoft.engine.search.SearchOptions searchOptions)  
      org.bonitasoft.engine.search.SearchResult<org.bonitasoft.engine.bpm.document.Document> searchDocuments​(org.bonitasoft.engine.search.SearchOptions searchOptions)  
      org.bonitasoft.engine.search.SearchResult<org.bonitasoft.engine.bpm.document.Document> searchDocumentsSupervisedBy​(long userId, org.bonitasoft.engine.search.SearchOptions searchOptions)  
      void setDocumentList​(long processInstanceId, java.lang.String name, java.util.List<org.bonitasoft.engine.bpm.document.DocumentValue> documentsValues)  
      org.bonitasoft.engine.bpm.document.Document updateDocument​(long documentId, org.bonitasoft.engine.bpm.document.DocumentValue documentValue)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DocumentAPIImpl

        public DocumentAPIImpl()
    • Method Detail

      • attachDocument

        public org.bonitasoft.engine.bpm.document.Document attachDocument​(long processInstanceId,
                                                                          java.lang.String documentName,
                                                                          java.lang.String fileName,
                                                                          java.lang.String mimeType,
                                                                          java.lang.String url)
                                                                   throws org.bonitasoft.engine.bpm.document.DocumentAttachmentException
        Specified by:
        attachDocument in interface org.bonitasoft.engine.api.DocumentAPI
        Throws:
        org.bonitasoft.engine.bpm.document.DocumentAttachmentException
      • addDocument

        public org.bonitasoft.engine.bpm.document.Document addDocument​(long processInstanceId,
                                                                       java.lang.String documentName,
                                                                       java.lang.String description,
                                                                       org.bonitasoft.engine.bpm.document.DocumentValue documentValue)
                                                                throws org.bonitasoft.engine.bpm.document.DocumentAttachmentException,
                                                                       org.bonitasoft.engine.exception.AlreadyExistsException
        Specified by:
        addDocument in interface org.bonitasoft.engine.api.DocumentAPI
        Throws:
        org.bonitasoft.engine.bpm.document.DocumentAttachmentException
        org.bonitasoft.engine.exception.AlreadyExistsException
      • updateDocument

        public org.bonitasoft.engine.bpm.document.Document updateDocument​(long documentId,
                                                                          org.bonitasoft.engine.bpm.document.DocumentValue documentValue)
                                                                   throws org.bonitasoft.engine.bpm.document.DocumentAttachmentException
        Specified by:
        updateDocument in interface org.bonitasoft.engine.api.DocumentAPI
        Throws:
        org.bonitasoft.engine.bpm.document.DocumentAttachmentException
      • attachDocument

        public org.bonitasoft.engine.bpm.document.Document attachDocument​(long processInstanceId,
                                                                          java.lang.String documentName,
                                                                          java.lang.String fileName,
                                                                          java.lang.String mimeType,
                                                                          byte[] documentContent)
                                                                   throws org.bonitasoft.engine.bpm.document.DocumentAttachmentException
        Specified by:
        attachDocument in interface org.bonitasoft.engine.api.DocumentAPI
        Throws:
        org.bonitasoft.engine.bpm.document.DocumentAttachmentException
      • attachNewDocumentVersion

        public org.bonitasoft.engine.bpm.document.Document attachNewDocumentVersion​(long processInstanceId,
                                                                                    java.lang.String documentName,
                                                                                    java.lang.String fileName,
                                                                                    java.lang.String mimeType,
                                                                                    java.lang.String url)
                                                                             throws org.bonitasoft.engine.bpm.document.DocumentAttachmentException
        Specified by:
        attachNewDocumentVersion in interface org.bonitasoft.engine.api.DocumentAPI
        Throws:
        org.bonitasoft.engine.bpm.document.DocumentAttachmentException
      • attachNewDocumentVersion

        public org.bonitasoft.engine.bpm.document.Document attachNewDocumentVersion​(long processInstanceId,
                                                                                    java.lang.String documentName,
                                                                                    java.lang.String contentFileName,
                                                                                    java.lang.String contentMimeType,
                                                                                    byte[] documentContent)
                                                                             throws org.bonitasoft.engine.bpm.document.DocumentAttachmentException
        Specified by:
        attachNewDocumentVersion in interface org.bonitasoft.engine.api.DocumentAPI
        Throws:
        org.bonitasoft.engine.bpm.document.DocumentAttachmentException
      • getDocument

        public org.bonitasoft.engine.bpm.document.Document getDocument​(long documentId)
                                                                throws org.bonitasoft.engine.bpm.document.DocumentNotFoundException
        Specified by:
        getDocument in interface org.bonitasoft.engine.api.DocumentAPI
        Throws:
        org.bonitasoft.engine.bpm.document.DocumentNotFoundException
      • getLastVersionOfDocuments

        public java.util.List<org.bonitasoft.engine.bpm.document.Document> getLastVersionOfDocuments​(long processInstanceId,
                                                                                                     int pageIndex,
                                                                                                     int numberPerPage,
                                                                                                     org.bonitasoft.engine.bpm.document.DocumentCriterion pagingCriterion)
                                                                                              throws org.bonitasoft.engine.bpm.document.DocumentException
        Specified by:
        getLastVersionOfDocuments in interface org.bonitasoft.engine.api.DocumentAPI
        Throws:
        org.bonitasoft.engine.bpm.document.DocumentException
      • getDocumentContent

        public byte[] getDocumentContent​(java.lang.String documentStorageId)
                                  throws org.bonitasoft.engine.bpm.document.DocumentNotFoundException
        Specified by:
        getDocumentContent in interface org.bonitasoft.engine.api.DocumentAPI
        Throws:
        org.bonitasoft.engine.bpm.document.DocumentNotFoundException
      • getLastDocument

        public org.bonitasoft.engine.bpm.document.Document getLastDocument​(long processInstanceId,
                                                                           java.lang.String documentName)
                                                                    throws org.bonitasoft.engine.bpm.document.DocumentNotFoundException
        Specified by:
        getLastDocument in interface org.bonitasoft.engine.api.DocumentAPI
        Throws:
        org.bonitasoft.engine.bpm.document.DocumentNotFoundException
      • getNumberOfDocuments

        public long getNumberOfDocuments​(long processInstanceId)
                                  throws org.bonitasoft.engine.bpm.document.DocumentException
        Specified by:
        getNumberOfDocuments in interface org.bonitasoft.engine.api.DocumentAPI
        Throws:
        org.bonitasoft.engine.bpm.document.DocumentException
      • getDocumentAtProcessInstantiation

        public org.bonitasoft.engine.bpm.document.Document getDocumentAtProcessInstantiation​(long processInstanceId,
                                                                                             java.lang.String documentName)
                                                                                      throws org.bonitasoft.engine.bpm.document.DocumentNotFoundException
        Specified by:
        getDocumentAtProcessInstantiation in interface org.bonitasoft.engine.api.DocumentAPI
        Throws:
        org.bonitasoft.engine.bpm.document.DocumentNotFoundException
      • getDocumentAtActivityInstanceCompletion

        public org.bonitasoft.engine.bpm.document.Document getDocumentAtActivityInstanceCompletion​(long activityInstanceId,
                                                                                                   java.lang.String documentName)
                                                                                            throws org.bonitasoft.engine.bpm.document.DocumentNotFoundException
        Specified by:
        getDocumentAtActivityInstanceCompletion in interface org.bonitasoft.engine.api.DocumentAPI
        Throws:
        org.bonitasoft.engine.bpm.document.DocumentNotFoundException
      • searchDocuments

        public org.bonitasoft.engine.search.SearchResult<org.bonitasoft.engine.bpm.document.Document> searchDocuments​(org.bonitasoft.engine.search.SearchOptions searchOptions)
                                                                                                               throws org.bonitasoft.engine.exception.SearchException
        Specified by:
        searchDocuments in interface org.bonitasoft.engine.api.DocumentAPI
        Throws:
        org.bonitasoft.engine.exception.SearchException
      • searchDocumentsSupervisedBy

        public org.bonitasoft.engine.search.SearchResult<org.bonitasoft.engine.bpm.document.Document> searchDocumentsSupervisedBy​(long userId,
                                                                                                                                  org.bonitasoft.engine.search.SearchOptions searchOptions)
                                                                                                                           throws org.bonitasoft.engine.exception.SearchException
        Specified by:
        searchDocumentsSupervisedBy in interface org.bonitasoft.engine.api.DocumentAPI
        Throws:
        org.bonitasoft.engine.exception.SearchException
      • searchArchivedDocuments

        public org.bonitasoft.engine.search.SearchResult<org.bonitasoft.engine.bpm.document.ArchivedDocument> searchArchivedDocuments​(org.bonitasoft.engine.search.SearchOptions searchOptions)
                                                                                                                               throws org.bonitasoft.engine.exception.SearchException
        Specified by:
        searchArchivedDocuments in interface org.bonitasoft.engine.api.DocumentAPI
        Throws:
        org.bonitasoft.engine.exception.SearchException
      • searchArchivedDocumentsSupervisedBy

        public org.bonitasoft.engine.search.SearchResult<org.bonitasoft.engine.bpm.document.ArchivedDocument> searchArchivedDocumentsSupervisedBy​(long userId,
                                                                                                                                                  org.bonitasoft.engine.search.SearchOptions searchOptions)
                                                                                                                                           throws org.bonitasoft.engine.exception.SearchException
        Specified by:
        searchArchivedDocumentsSupervisedBy in interface org.bonitasoft.engine.api.DocumentAPI
        Throws:
        org.bonitasoft.engine.exception.SearchException
      • getArchivedVersionOfProcessDocument

        public org.bonitasoft.engine.bpm.document.ArchivedDocument getArchivedVersionOfProcessDocument​(long sourceObjectId)
                                                                                                throws org.bonitasoft.engine.bpm.document.ArchivedDocumentNotFoundException
        Specified by:
        getArchivedVersionOfProcessDocument in interface org.bonitasoft.engine.api.DocumentAPI
        Throws:
        org.bonitasoft.engine.bpm.document.ArchivedDocumentNotFoundException
      • getArchivedProcessDocument

        public org.bonitasoft.engine.bpm.document.ArchivedDocument getArchivedProcessDocument​(long archivedProcessDocumentId)
                                                                                       throws org.bonitasoft.engine.bpm.document.ArchivedDocumentNotFoundException
        Specified by:
        getArchivedProcessDocument in interface org.bonitasoft.engine.api.DocumentAPI
        Throws:
        org.bonitasoft.engine.bpm.document.ArchivedDocumentNotFoundException
      • removeDocument

        public org.bonitasoft.engine.bpm.document.Document removeDocument​(long documentId)
                                                                   throws org.bonitasoft.engine.bpm.document.DocumentNotFoundException,
                                                                          org.bonitasoft.engine.exception.DeletionException
        Specified by:
        removeDocument in interface org.bonitasoft.engine.api.DocumentAPI
        Throws:
        org.bonitasoft.engine.bpm.document.DocumentNotFoundException
        org.bonitasoft.engine.exception.DeletionException
      • getDocumentList

        public java.util.List<org.bonitasoft.engine.bpm.document.Document> getDocumentList​(long processInstanceId,
                                                                                           java.lang.String name,
                                                                                           int fromIndex,
                                                                                           int numberOfResult)
                                                                                    throws org.bonitasoft.engine.bpm.document.DocumentNotFoundException
        Specified by:
        getDocumentList in interface org.bonitasoft.engine.api.DocumentAPI
        Throws:
        org.bonitasoft.engine.bpm.document.DocumentNotFoundException
      • setDocumentList

        public void setDocumentList​(long processInstanceId,
                                    java.lang.String name,
                                    java.util.List<org.bonitasoft.engine.bpm.document.DocumentValue> documentsValues)
                             throws org.bonitasoft.engine.bpm.document.DocumentException
        Specified by:
        setDocumentList in interface org.bonitasoft.engine.api.DocumentAPI
        Throws:
        org.bonitasoft.engine.bpm.document.DocumentException
      • deleteContentOfArchivedDocument

        public void deleteContentOfArchivedDocument​(long archivedDocumentId)
                                             throws org.bonitasoft.engine.bpm.document.DocumentException,
                                                    org.bonitasoft.engine.bpm.document.DocumentNotFoundException
        Specified by:
        deleteContentOfArchivedDocument in interface org.bonitasoft.engine.api.DocumentAPI
        Throws:
        org.bonitasoft.engine.bpm.document.DocumentException
        org.bonitasoft.engine.bpm.document.DocumentNotFoundException