public class OKMDocument extends Object implements DocumentModule
| Modifier and Type | Method and Description | 
|---|---|
| void | cancelCheckout(String token,
              String docPath)Cancel a previous checked out state in a document. | 
| Version | checkin(String token,
       String docPath,
       InputStream is,
       String comment)Check in the document to create a new version. | 
| Version | checkin(String token,
       String docPath,
       InputStream is,
       String comment,
       int increment)Check in the document to create a new version. | 
| void | checkout(String token,
        String docPath)Checkout the document to edit it. | 
| void | copy(String token,
    String docPath,
    String destPath)Copy a document to another location in the repository. | 
| Document | create(String token,
      Document doc,
      InputStream is)Creates a new document in the repository. | 
| Document | createSimple(String token,
            String docPath,
            InputStream is) | 
| void | delete(String token,
      String docPath)Deletes a document from the repository. | 
| void | extendedCopy(String token,
            String docPath,
            String destPath,
            String docName,
            ExtendedAttributes extAttr)Copy a document to another location in the repository. | 
| void | forceCancelCheckout(String token,
                   String docPath)Force to cancel a previous checked out state in a document. | 
| void | forceUnlock(String token,
           String docPath)For document unlock, so will be editable for other users. | 
| List<Document> | getChildren(String token,
           String fldId)Retrieve a list of children documents from an existing folder. | 
| List<Document> | getChilds(String token,
         String fldId)Deprecated.  | 
| InputStream | getContent(String token,
          String docId,
          boolean checkout)Obtain document content from the repository. | 
| InputStream | getContentByVersion(String token,
                   String docId,
                   String versionId)Obtain document content from the repository. | 
| static OKMDocument | getInstance() | 
| LockInfo | getLockInfo(String token,
           String docPath)Returns a lock information. | 
| String | getPath(String token,
       String uuid)Get the document path from a UUID | 
| Document | getProperties(String token,
             String docPath)Obtain document properties from the repository. | 
| List<Version> | getVersionHistory(String token,
                 String docPath)Get the document version history. | 
| long | getVersionHistorySize(String token,
                     String docPath)Get the version size of a Document. | 
| boolean | isCheckedOut(String token,
            String docPath)Test if a node has been already checked out. | 
| boolean | isLocked(String token,
        String docPath)Tell if a document is locked. | 
| boolean | isValid(String token,
       String docId)Test if a document path is valid. | 
| LockInfo | lock(String token,
    String docPath)Lock a document, so only is editable by the locker. | 
| void | move(String token,
    String docPath,
    String destPath)Move a document to another location in the repository. | 
| void | purge(String token,
     String docPath)Deletes definitively a document from the repository. | 
| void | purgeVersionHistory(String token,
                   String docPath)Purge a Document version history, so delete all previous versions but last one. | 
| Document | rename(String token,
      String docPath,
      String newName)Rename a document in the repository. | 
| void | restoreVersion(String token,
              String docPath,
              String versionId)Revert the document to an specific previous version. | 
| void | setProperties(String token,
             Document doc)Set document properties in the repository. | 
| void | unlock(String token,
      String docPath)Unlock a document, so will be editable for other users. | 
public static OKMDocument getInstance()
public Document create(String token, Document doc, InputStream is) throws UnsupportedMimeTypeException, FileSizeExceededException, UserQuotaExceededException, VirusDetectedException, ItemExistsException, PathNotFoundException, AccessDeniedException, RepositoryException, IOException, DatabaseException, ExtensionException, AutomationException
DocumentModulecreate in interface DocumentModuledoc - A document object with the new document properties.UnsupportedMimeTypeException - If the uploaded file has an unsupported MIME type.FileSizeExceededException - If the document content is biggest than the maximum accepted.ItemExistsException - If there is already a document in the repository with the same name.PathNotFoundException - If the parent folder doesn't exist.AccessDeniedException - If there is any security problem: you can't modify the parent document folder
         because of lack of permissions.RepositoryException - If there is any general repository problem.IOException - An error when inserting document data into the repository.UserQuotaExceededExceptionVirusDetectedExceptionDatabaseExceptionExtensionExceptionAutomationExceptionpublic Document createSimple(String token, String docPath, InputStream is) throws UnsupportedMimeTypeException, FileSizeExceededException, UserQuotaExceededException, VirusDetectedException, ItemExistsException, PathNotFoundException, AccessDeniedException, RepositoryException, IOException, DatabaseException, ExtensionException, AutomationException
public void delete(String token, String docPath) throws LockException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException, ExtensionException
DocumentModuledelete in interface DocumentModuledocPath - The path that identifies an unique document.LockException - Can't delete a locked document.PathNotFoundException - If there is no document in this repository path.AccessDeniedException - If there is any security problem: you can't modify the document because of lack of
         permissions.RepositoryException - If there is any general repository problem.DatabaseExceptionExtensionExceptionpublic Document getProperties(String token, String docPath) throws RepositoryException, PathNotFoundException, DatabaseException
DocumentModulegetProperties in interface DocumentModuleRepositoryException - If there is any general repository problem.PathNotFoundException - If there is no document in this repository path. you can't modify the document
         because of lack of permissions.DatabaseExceptionpublic InputStream getContent(String token, String docId, boolean checkout) throws PathNotFoundException, AccessDeniedException, RepositoryException, IOException, DatabaseException
DocumentModulegetContent in interface DocumentModuledocId - The path that identifies an unique document or its UUID.PathNotFoundException - If there is no document in this repository path.AccessDeniedException - If there is any security problem: you can't modify this document because of lack of
         permissions. Related to extended security.RepositoryException - If there is any general repository problem.IOException - An error when retrieving document data from the repository.DatabaseExceptionpublic InputStream getContentByVersion(String token, String docId, String versionId) throws RepositoryException, PathNotFoundException, IOException, DatabaseException
DocumentModulegetContentByVersion in interface DocumentModuledocId - The path that identifies an unique document or its UUID.versionId - The id of the version to get the content from.RepositoryException - If there is any general repository problem.PathNotFoundException - If there is no folder in the repository with this path.IOException - An error when retrieving document data from the repository.DatabaseException@Deprecated public List<Document> getChilds(String token, String fldId) throws PathNotFoundException, RepositoryException, DatabaseException
DocumentModulegetChilds in interface DocumentModulefldId - The path that identifies an unique folder or its UUID.PathNotFoundException - If there is no folder in this repository path.RepositoryException - If there is any general repository problem.DatabaseExceptionpublic List<Document> getChildren(String token, String fldId) throws PathNotFoundException, RepositoryException, DatabaseException
DocumentModulegetChildren in interface DocumentModulefldId - The path that identifies an unique folder or its UUID.PathNotFoundException - If there is no folder in this repository path.RepositoryException - If there is any general repository problem.DatabaseExceptionpublic Document rename(String token, String docPath, String newName) throws PathNotFoundException, ItemExistsException, AccessDeniedException, LockException, RepositoryException, DatabaseException, ExtensionException
DocumentModulerename in interface DocumentModuledocPath - The path that identifies an unique document.newName - The new folder name.PathNotFoundException - If there is no document in this repository path.ItemExistsException - If there is already a document in the repository with the same name in the same path.AccessDeniedException - If there is any security problem: you can't modify the document because of lack of
         permissions.RepositoryException - If there is any general repository problem.LockExceptionDatabaseExceptionExtensionExceptionpublic void setProperties(String token, Document doc) throws LockException, VersionException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException
DocumentModulesetProperties in interface DocumentModuledoc - An document object with the propertiesLockException - A locked document can't be modified.VersionException - A document checked in can't be modified.PathNotFoundException - If there is no document in this repository path.AccessDeniedException - If there is any security problem: you can't modify the document because of lack of
         permissions.RepositoryException - If there is any general repository problem.DatabaseExceptionpublic void checkout(String token, String docPath) throws LockException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException
DocumentModulecheckout in interface DocumentModuledocPath - The path that identifies an unique document.LockException - A locked document can't be modified.PathNotFoundException - If there is no document in this repository path.AccessDeniedException - If there is any security problem: you can't modify the document because of lack of
         permissions.RepositoryException - If there is any general repository problem.DatabaseExceptionpublic void cancelCheckout(String token, String docPath) throws LockException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException
DocumentModulecancelCheckout in interface DocumentModuledocPath - The path that identifies an unique document.LockException - A locked document can't be modified.PathNotFoundException - If there is no document in this repository path.AccessDeniedException - If there is any security problem: you can't modify the document because of lack of
         permissions.RepositoryException - If there is any general repository problem.DatabaseExceptionpublic void forceCancelCheckout(String token, String docPath) throws LockException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException, PrincipalAdapterException
DocumentModuleforceCancelCheckout in interface DocumentModuledocPath - The path that identifies an unique document.LockException - A locked document can't be modified.PathNotFoundException - If there is no document in this repository path.AccessDeniedException - If there is any security problem: you can't modify the document because of lack of
         permissions.RepositoryException - If there is any general repository problem.DatabaseExceptionPrincipalAdapterExceptionpublic boolean isCheckedOut(String token, String docPath) throws PathNotFoundException, RepositoryException, DatabaseException
DocumentModuleisCheckedOut in interface DocumentModuledocPath - The path that identifies an unique document.PathNotFoundException - If there is no document in this repository path.RepositoryException - If there is any general repository problem.DatabaseExceptionpublic Version checkin(String token, String docPath, InputStream is, String comment) throws FileSizeExceededException, UserQuotaExceededException, VirusDetectedException, LockException, VersionException, PathNotFoundException, AccessDeniedException, RepositoryException, IOException, DatabaseException, ExtensionException, AutomationException
DocumentModulecheckin in interface DocumentModuledocPath - The path that identifies an unique document.comment - A comment for this checkin.LockException - A locked document can't be modified.VersionException - If the nodes was not previously checked out.PathNotFoundException - If there is no document in this repository path.AccessDeniedException - If there is any security problem: you can't modify the document because of lack of
         permissions.RepositoryException - If there is any general repository problem.FileSizeExceededExceptionUserQuotaExceededExceptionVirusDetectedExceptionIOExceptionDatabaseExceptionExtensionExceptionAutomationExceptionpublic Version checkin(String token, String docPath, InputStream is, String comment, int increment) throws FileSizeExceededException, UserQuotaExceededException, VirusDetectedException, LockException, VersionException, PathNotFoundException, AccessDeniedException, RepositoryException, IOException, DatabaseException, ExtensionException, AutomationException
DocumentModulecheckin in interface DocumentModuledocPath - The path that identifies an unique document.comment - A comment for this checkin.increment - Which increment should be increased.LockException - A locked document can't be modified.VersionException - If the nodes was not previously checked out.PathNotFoundException - If there is no document in this repository path.AccessDeniedException - If there is any security problem: you can't modify the document because of lack of
         permissions.RepositoryException - If there is any general repository problem.FileSizeExceededExceptionUserQuotaExceededExceptionVirusDetectedExceptionIOExceptionDatabaseExceptionExtensionExceptionAutomationExceptionpublic List<Version> getVersionHistory(String token, String docPath) throws PathNotFoundException, RepositoryException, DatabaseException
DocumentModulegetVersionHistory in interface DocumentModuledocPath - The path that identifies an unique document or its UUID.PathNotFoundException - If there is no document in this repository path.RepositoryException - If there is any general repository problem.DatabaseExceptionpublic LockInfo lock(String token, String docPath) throws LockException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException
DocumentModulelock in interface DocumentModuledocPath - The path that identifies an unique document.LockException - If the node is already locked.PathNotFoundException - If there is no document in this repository path.AccessDeniedException - If there is any security problem: you can't modify the document because of lack of
         permissions.RepositoryException - If there is any general repository problem.DatabaseExceptionpublic void unlock(String token, String docPath) throws LockException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException
DocumentModuleunlock in interface DocumentModuledocPath - The path that identifies an unique document.LockException - If the node is not locked.PathNotFoundException - If there is no document in this repository path.AccessDeniedException - If there is any security problem: you can't modify the document because of lack of
         permissions.RepositoryException - If there is any general repository problem.DatabaseExceptionpublic void forceUnlock(String token, String docPath) throws LockException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException, PrincipalAdapterException
DocumentModuleforceUnlock in interface DocumentModuledocPath - The path that identifies an unique document.LockException - If the node is not locked.PathNotFoundException - If there is no document in this repository path.AccessDeniedException - If there is any security problem: you can't modify the document because of lack of
         permissions.RepositoryException - If there is any general repository problem.DatabaseExceptionPrincipalAdapterExceptionpublic boolean isLocked(String token, String docPath) throws PathNotFoundException, RepositoryException, DatabaseException
DocumentModuleisLocked in interface DocumentModuledocPath - The path that identifies an unique document.PathNotFoundException - If there is no document in the repository with this path.RepositoryException - If there is any repository problem.DatabaseExceptionpublic LockInfo getLockInfo(String token, String docPath) throws LockException, PathNotFoundException, RepositoryException, DatabaseException
DocumentModulegetLockInfo in interface DocumentModuledocPath - The path that identifies an unique document.LockException - If the node is not locked.PathNotFoundException - If there is no document in the repository with this path.RepositoryException - If there is any repository problem.DatabaseExceptionpublic void purge(String token, String docPath) throws LockException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException, ExtensionException
DocumentModulepurge in interface DocumentModuledocPath - The path that identifies an unique document.PathNotFoundException - If there is no document in the repository with this path.AccessDeniedException - If there is any security problem: you can't access this document because of lack of
         permissions.RepositoryException - If there is any general repository problem.LockExceptionDatabaseExceptionExtensionExceptionpublic void move(String token, String docPath, String destPath) throws PathNotFoundException, ItemExistsException, AccessDeniedException, LockException, RepositoryException, DatabaseException, ExtensionException, AutomationException
DocumentModulemove in interface DocumentModuledocPath - The path that identifies an unique document.destPath - The destination folder path.PathNotFoundException - If the dstPath does not existsItemExistsException - If there is already a document in the destination folder with the same name.AccessDeniedException - If there is any security problem: you can't modify the document's parent folder or
         the destination folder because of lack of permissions.RepositoryException - If there is any general repository problem.LockExceptionDatabaseExceptionExtensionExceptionAutomationExceptionpublic void copy(String token, String docPath, String destPath) throws ItemExistsException, PathNotFoundException, AccessDeniedException, RepositoryException, IOException, DatabaseException, UserQuotaExceededException, ExtensionException, AutomationException
DocumentModulecopy in interface DocumentModuledocPath - The path that identifies an unique document.destPath - The destination folder path.ItemExistsException - If there is already a document in the destination folder with the same name.PathNotFoundException - If the dstPath does not existsAccessDeniedException - If there is any security problem: you can't modify the document's parent folder or
         the destination folder because of lack of permissions.RepositoryException - If there is any general repository problem.IOExceptionDatabaseExceptionUserQuotaExceededExceptionExtensionExceptionAutomationExceptionpublic void extendedCopy(String token, String docPath, String destPath, String docName, ExtendedAttributes extAttr) throws ItemExistsException, PathNotFoundException, AccessDeniedException, RepositoryException, IOException, DatabaseException, UserQuotaExceededException, ExtensionException, AutomationException
DocumentModuleextendedCopy in interface DocumentModuledocPath - The path that identifies an unique document.destPath - The destination folder path.docName - The name of the new document or null if not changedextAttr - Attributes to define what need to be duplicated.ItemExistsException - If there is already a document in the destination folder with the same name.PathNotFoundException - If the dstPath does not existsAccessDeniedException - If there is any security problem: you can't modify the document's parent folder or
         the destination folder because of lack of permissions.RepositoryException - If there is any general repository problem.IOExceptionDatabaseExceptionUserQuotaExceededExceptionExtensionExceptionAutomationExceptionpublic void restoreVersion(String token, String docPath, String versionId) throws PathNotFoundException, AccessDeniedException, LockException, RepositoryException, DatabaseException, ExtensionException
DocumentModulerestoreVersion in interface DocumentModuledocPath - The path that identifies an unique document.versionId - The version id to revert to.PathNotFoundException - If there is no document in this repository path.AccessDeniedException - If there is any security problem: you can't modify the document because of lack of
         permissions.RepositoryException - If there is any general repository problem.LockExceptionDatabaseExceptionExtensionExceptionpublic void purgeVersionHistory(String token, String docPath) throws PathNotFoundException, AccessDeniedException, LockException, RepositoryException, DatabaseException
DocumentModulepurgeVersionHistory in interface DocumentModuledocPath - The path that identifies an unique document.PathNotFoundException - If there is no folder in the repository with this path.AccessDeniedException - If there is any security problem: you can't access this folder because of lack of
         permissions.RepositoryException - If there is any general repository problem.LockExceptionDatabaseExceptionpublic long getVersionHistorySize(String token, String docPath) throws PathNotFoundException, RepositoryException, DatabaseException
DocumentModulegetVersionHistorySize in interface DocumentModuledocPath - The path that identifies an unique document or its UUID.PathNotFoundException - If there is no folder in the repository with this path.RepositoryException - If there is any general repository problem.DatabaseExceptionpublic boolean isValid(String token, String docId) throws PathNotFoundException, RepositoryException, DatabaseException
DocumentModuleisValid in interface DocumentModuledocId - The path that identifies an unique document or its UUID.PathNotFoundException - If the node does not exists.RepositoryException - If there is any general repository problem.DatabaseExceptionpublic String getPath(String token, String uuid) throws AccessDeniedException, RepositoryException, DatabaseException
DocumentModulegetPath in interface DocumentModuleuuid - The unique document id.AccessDeniedException - If there is any security problem: you can't access this node because of lack of
         permissions.RepositoryException - If there is any problem.DatabaseExceptionCopyright © 2015. All Rights Reserved.