Class JCRDocumentFileStorage

java.lang.Object
org.exoplatform.documents.storage.jcr.JCRDocumentFileStorage
All Implemented Interfaces:
org.exoplatform.documents.storage.DocumentFileStorage

public class JCRDocumentFileStorage extends Object implements org.exoplatform.documents.storage.DocumentFileStorage
  • Field Details

  • Constructor Details

    • JCRDocumentFileStorage

      public JCRDocumentFileStorage(org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator, org.exoplatform.services.jcr.RepositoryService repositoryService, DocumentSearchServiceConnector documentSearchServiceConnector, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.services.listener.ListenerService listenerService, org.exoplatform.upload.UploadService uploadService, org.exoplatform.services.security.IdentityRegistry identityRegistry, org.exoplatform.social.core.manager.ActivityManager activityManager, BulkStorageActionService bulkStorageActionService)
  • Method Details

    • getSpaceRootFolder

      public org.exoplatform.documents.model.FolderNode getSpaceRootFolder(long spaceId, org.exoplatform.services.security.Identity aclIdentity) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      getSpaceRootFolder in interface org.exoplatform.documents.storage.DocumentFileStorage
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • getRootFolderOwnerId

      public long getRootFolderOwnerId(String documentId)
      Specified by:
      getRootFolderOwnerId in interface org.exoplatform.documents.storage.DocumentFileStorage
    • getPersonalRootFolder

      public org.exoplatform.documents.model.FolderNode getPersonalRootFolder(org.exoplatform.services.security.Identity aclIdentity)
      Specified by:
      getPersonalRootFolder in interface org.exoplatform.documents.storage.DocumentFileStorage
    • getFilesTimeline

      public List<org.exoplatform.documents.model.FileNode> getFilesTimeline(org.exoplatform.documents.model.DocumentTimelineFilter filter, org.exoplatform.services.security.Identity aclIdentity, int offset, int limit) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      getFilesTimeline in interface org.exoplatform.documents.storage.DocumentFileStorage
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • getFavoriteFileIds

      public List<String> getFavoriteFileIds(org.exoplatform.documents.model.DocumentNodeFilter filter, org.exoplatform.services.security.Identity aclIdentity, int offset, int limit)
      Specified by:
      getFavoriteFileIds in interface org.exoplatform.documents.storage.DocumentFileStorage
    • search

      public List<org.exoplatform.documents.model.FileNode> search(String keyword, org.exoplatform.services.security.Identity identity, int offset, int limit)
      Specified by:
      search in interface org.exoplatform.documents.storage.DocumentFileStorage
    • search

      public List<org.exoplatform.documents.model.FileNode> search(org.exoplatform.documents.model.DocumentTimelineFilter filter, org.exoplatform.services.security.Identity identity, int offset, int limit)
      Specified by:
      search in interface org.exoplatform.documents.storage.DocumentFileStorage
    • getBiggestDocuments

      public List<org.exoplatform.documents.model.AbstractNode> getBiggestDocuments(Long ownerId, org.exoplatform.services.security.Identity aclIdentity, int offset, int limit) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      getBiggestDocuments in interface org.exoplatform.documents.storage.DocumentFileStorage
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • calculateFilesSize

      public long calculateFilesSize(Long ownerId, org.exoplatform.services.security.Identity aclIdentity) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      calculateFilesSize in interface org.exoplatform.documents.storage.DocumentFileStorage
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • getGroupDocumentsCount

      public org.exoplatform.documents.model.DocumentGroupsSize getGroupDocumentsCount(org.exoplatform.documents.model.DocumentTimelineFilter filter, org.exoplatform.services.security.Identity aclIdentity) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      getGroupDocumentsCount in interface org.exoplatform.documents.storage.DocumentFileStorage
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • getFolderChildNodes

      public List<org.exoplatform.documents.model.AbstractNode> getFolderChildNodes(org.exoplatform.documents.model.DocumentFolderFilter filter, org.exoplatform.services.security.Identity aclIdentity, int offset, int limit) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      getFolderChildNodes in interface org.exoplatform.documents.storage.DocumentFileStorage
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • getBreadcrumb

      public List<org.exoplatform.documents.model.BreadCrumbItem> getBreadcrumb(long ownerId, String folderId, String folderPath, org.exoplatform.services.security.Identity aclIdentity) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      getBreadcrumb in interface org.exoplatform.documents.storage.DocumentFileStorage
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • getFullTreeData

      public List<org.exoplatform.documents.model.FullTreeItem> getFullTreeData(long ownerId, String folderId, String destinationFolderPath, org.exoplatform.services.security.Identity aclIdentity, boolean withChildren, boolean showHidden)
      Specified by:
      getFullTreeData in interface org.exoplatform.documents.storage.DocumentFileStorage
    • createFolder

      public org.exoplatform.documents.model.AbstractNode createFolder(long ownerId, String folderId, String folderPath, String title, org.exoplatform.services.security.Identity aclIdentity) throws org.exoplatform.commons.ObjectAlreadyExistsException, IllegalAccessException
      Specified by:
      createFolder in interface org.exoplatform.documents.storage.DocumentFileStorage
      Throws:
      org.exoplatform.commons.ObjectAlreadyExistsException
      IllegalAccessException
    • getNewName

      public String getNewName(long ownerId, String folderId, String folderPath, String title) throws IllegalAccessException, org.exoplatform.commons.ObjectAlreadyExistsException, org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      getNewName in interface org.exoplatform.documents.storage.DocumentFileStorage
      Throws:
      IllegalAccessException
      org.exoplatform.commons.ObjectAlreadyExistsException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • renameDocument

      public void renameDocument(long ownerId, String documentID, String title, org.exoplatform.services.security.Identity aclIdentity) throws org.exoplatform.commons.ObjectAlreadyExistsException
      Specified by:
      renameDocument in interface org.exoplatform.documents.storage.DocumentFileStorage
      Throws:
      org.exoplatform.commons.ObjectAlreadyExistsException
    • setDocumentVisibility

      public void setDocumentVisibility(long ownerId, String documentID, Boolean hidden, org.exoplatform.services.security.Identity aclIdentity) throws org.exoplatform.commons.ObjectAlreadyExistsException
      Specified by:
      setDocumentVisibility in interface org.exoplatform.documents.storage.DocumentFileStorage
      Throws:
      org.exoplatform.commons.ObjectAlreadyExistsException
    • duplicateDocument

      public org.exoplatform.documents.model.AbstractNode duplicateDocument(long ownerId, String fileId, String prefixClone, org.exoplatform.services.security.Identity aclIdentity) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      duplicateDocument in interface org.exoplatform.documents.storage.DocumentFileStorage
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • copyDocument

      public org.exoplatform.documents.model.AbstractNode copyDocument(String nodeId, String destintionNodeId, org.exoplatform.services.security.Identity aclIdentity) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      copyDocument in interface org.exoplatform.documents.storage.DocumentFileStorage
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • moveDocument

      public void moveDocument(javax.jcr.Session session, long ownerId, String fileId, String destPath, org.exoplatform.services.security.Identity aclIdentity, String conflictAction) throws Exception
      Specified by:
      moveDocument in interface org.exoplatform.documents.storage.DocumentFileStorage
      Throws:
      Exception
    • moveDocument

      public void moveDocument(long ownerId, String fileId, String destPath, org.exoplatform.services.security.Identity aclIdentity, String conflictAction) throws org.exoplatform.commons.ObjectAlreadyExistsException
      Specified by:
      moveDocument in interface org.exoplatform.documents.storage.DocumentFileStorage
      Throws:
      org.exoplatform.commons.ObjectAlreadyExistsException
    • getDocumentCategoryIds

      public List<Long> getDocumentCategoryIds(long ownerId, org.exoplatform.services.security.Identity aclIdentity)
      Specified by:
      getDocumentCategoryIds in interface org.exoplatform.documents.storage.DocumentFileStorage
    • updatePermissions

      public void updatePermissions(String documentID, org.exoplatform.documents.model.NodePermission nodePermissionEntity, org.exoplatform.services.security.Identity aclIdentity)
      Specified by:
      updatePermissions in interface org.exoplatform.documents.storage.DocumentFileStorage
    • shareDocument

      public void shareDocument(String documentId, long destId, org.exoplatform.services.security.Identity aclIdentity, boolean notifyMember)
      Specified by:
      shareDocument in interface org.exoplatform.documents.storage.DocumentFileStorage
    • isDocumentSharedWithSamePermissions

      public boolean isDocumentSharedWithSamePermissions(javax.jcr.Node currentNode, javax.jcr.Node linkNode, org.exoplatform.social.core.identity.model.Identity destinationIdentity) throws javax.jcr.RepositoryException
      Throws:
      javax.jcr.RepositoryException
    • notifyMember

      public void notifyMember(String documentId, long destId)
      Specified by:
      notifyMember in interface org.exoplatform.documents.storage.DocumentFileStorage
    • canAccess

      public boolean canAccess(String documentID, org.exoplatform.services.security.Identity aclIdentity)
      Specified by:
      canAccess in interface org.exoplatform.documents.storage.DocumentFileStorage
    • updateDocumentDescription

      public void updateDocumentDescription(long ownerId, String documentId, String description, org.exoplatform.services.security.Identity aclIdentity) throws javax.jcr.RepositoryException
      Specified by:
      updateDocumentDescription in interface org.exoplatform.documents.storage.DocumentFileStorage
      Throws:
      javax.jcr.RepositoryException
    • createShortcut

      public void createShortcut(String documentId, String destPath, String aclIdentity, String conflictAction) throws IllegalAccessException, org.exoplatform.commons.ObjectAlreadyExistsException
      Specified by:
      createShortcut in interface org.exoplatform.documents.storage.DocumentFileStorage
      Throws:
      IllegalAccessException
      org.exoplatform.commons.ObjectAlreadyExistsException
    • getFileVersions

      public List<org.exoplatform.documents.model.FileVersion> getFileVersions(String fileNodeId, String aclIdentity)
      Specified by:
      getFileVersions in interface org.exoplatform.documents.storage.DocumentFileStorage
    • getDocumentById

      public org.exoplatform.documents.model.AbstractNode getDocumentById(String documentId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Specified by:
      getDocumentById in interface org.exoplatform.documents.storage.DocumentFileStorage
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
    • getDocumentById

      public org.exoplatform.documents.model.AbstractNode getDocumentById(String documentId)
      Specified by:
      getDocumentById in interface org.exoplatform.documents.storage.DocumentFileStorage
    • getDocumentContent

      public io.meeds.portal.thumbnail.model.FileContent getDocumentContent(String documentId, String aclIdentity) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      getDocumentContent in interface org.exoplatform.documents.storage.DocumentFileStorage
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • updateVersionSummary

      public org.exoplatform.documents.model.FileVersion updateVersionSummary(String originFileId, String versionId, String summary, String aclIdentity)
      Specified by:
      updateVersionSummary in interface org.exoplatform.documents.storage.DocumentFileStorage
    • restoreVersion

      public org.exoplatform.documents.model.FileVersion restoreVersion(String versionId, String aclIdentity)
      Specified by:
      restoreVersion in interface org.exoplatform.documents.storage.DocumentFileStorage
      Returns:
    • countNodeAccessList

      public Map<String,Boolean> countNodeAccessList(javax.jcr.Node node, org.exoplatform.services.security.Identity aclIdentity) throws javax.jcr.RepositoryException
      Throws:
      javax.jcr.RepositoryException
    • downloadDocuments

      public void downloadDocuments(int actionId, List<org.exoplatform.documents.model.AbstractNode> documents, org.exoplatform.services.security.Identity identity, long authenticatedUserId)
      Specified by:
      downloadDocuments in interface org.exoplatform.documents.storage.DocumentFileStorage
    • getDownloadZipBytes

      public byte[] getDownloadZipBytes(int actionId, String userName) throws IOException
      Specified by:
      getDownloadZipBytes in interface org.exoplatform.documents.storage.DocumentFileStorage
      Throws:
      IOException
    • cancelBulkAction

      public void cancelBulkAction(String actionId, String userName) throws IOException
      Specified by:
      cancelBulkAction in interface org.exoplatform.documents.storage.DocumentFileStorage
      Throws:
      IOException
    • createNewVersion

      public org.exoplatform.documents.model.FileVersion createNewVersion(String nodeId, String aclIdentity, InputStream newContent)
      Specified by:
      createNewVersion in interface org.exoplatform.documents.storage.DocumentFileStorage
    • moveDocuments

      public void moveDocuments(int actionId, long ownerId, List<org.exoplatform.documents.model.AbstractNode> documents, String destPath, org.exoplatform.services.security.Identity userIdentity, long identityId)
      Specified by:
      moveDocuments in interface org.exoplatform.documents.storage.DocumentFileStorage
    • hasEditPermissions

      public boolean hasEditPermissions(String nodeId, org.exoplatform.services.security.Identity aclUserIdentity)
      Specified by:
      hasEditPermissions in interface org.exoplatform.documents.storage.DocumentFileStorage
    • getDocumentDownloadItem

      public org.exoplatform.documents.model.DownloadItem getDocumentDownloadItem(String documentId)
      Specified by:
      getDocumentDownloadItem in interface org.exoplatform.documents.storage.DocumentFileStorage
    • downloadFolder

      public String downloadFolder(String folderId)
      Specified by:
      downloadFolder in interface org.exoplatform.documents.storage.DocumentFileStorage
    • getFileContentAsText

      public String getFileContentAsText(String documentId)
      Specified by:
      getFileContentAsText in interface org.exoplatform.documents.storage.DocumentFileStorage
    • unShareDocument

      public void unShareDocument(String documentId, long destId)
      Specified by:
      unShareDocument in interface org.exoplatform.documents.storage.DocumentFileStorage
    • importFiles

      public void importFiles(String importId, org.exoplatform.social.core.space.model.Space space, String userName, String folderId, String folderPath, String conflict, org.exoplatform.services.security.Identity identity, String ownerId, long authenticatedUserId) throws Exception
      Specified by:
      importFiles in interface org.exoplatform.documents.storage.DocumentFileStorage
      Throws:
      Exception
    • canImport

      public boolean canImport(org.exoplatform.services.security.Identity identity)
      Specified by:
      canImport in interface org.exoplatform.documents.storage.DocumentFileStorage
    • hasFolderNodes

      public boolean hasFolderNodes(javax.jcr.Node node, boolean showHidden) throws javax.jcr.RepositoryException
      Throws:
      javax.jcr.RepositoryException
    • clearSymlinksNavHistory

      public void clearSymlinksNavHistory()
      Specified by:
      clearSymlinksNavHistory in interface org.exoplatform.documents.storage.DocumentFileStorage
    • isPersonalDrive

      public boolean isPersonalDrive(javax.jcr.Node node) throws javax.jcr.RepositoryException
      Throws:
      javax.jcr.RepositoryException