Interface DocumentFileStorage


public interface DocumentFileStorage
  • Method Details

    • getSpaceRootFolder

      FolderNode getSpaceRootFolder(long spaceId, org.exoplatform.services.security.Identity aclIdentity) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Retrieves the Root folder Path of a Space
      Parameters:
      spaceId - Space technical identifier
      aclIdentity - user willing to access the space's root folder
      Returns:
      the root FolderNode for the designated space
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when the space doesn't exist
    • getPersonalRootFolder

      FolderNode getPersonalRootFolder(org.exoplatform.services.security.Identity aclIdentity)
      Retrieves the Root folder Path of a user
      Parameters:
      aclIdentity - user willing to access his/her own root folder
      Returns:
      the root FolderNode for the designated user
    • getRootFolderOwnerId

      long getRootFolderOwnerId(String documentId)
      Return the root folder owner Identity id
      Parameters:
      documentId - JCR Node Id by example
      Returns:
      Identity id
    • getFilesTimeline

      List<FileNode> getFilesTimeline(DocumentTimelineFilter filter, org.exoplatform.services.security.Identity aclIdentity, int offset, int limit) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Retrieves a list of accessible files, for a selected user, by applying the designated filter. The returned results will be of type FileNode only. The ownerId of filter object will be used to select the list of accessible Nodes to retrieve switch a timeline.
      Parameters:
      filter - DocumentTimelineFilter that contains filtering criteria
      aclIdentity - Identity of the user acessing files
      offset - Offset of the result list
      limit - Limit of the result list
      Returns:
      List of AbstractNode
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when parentFolderId doesn't exisits
    • search

      List<FileNode> search(String keyword, org.exoplatform.services.security.Identity identity, int offset, int limit)
      Parameters:
      keyword - Search term
      identity - User ACL Identity
      offset - search offset
      limit - search limit
      Returns:
      List of found FileNode available for user
    • search

      List<FileNode> search(DocumentTimelineFilter filter, org.exoplatform.services.security.Identity identity, int offset, int limit)
      Parameters:
      filter - DocumentTimelineFilter to restrict search results
      identity - User ACL Identity
      offset - search offset
      limit - search limit
      Returns:
      List of found FileNode available for user
    • getBiggestDocuments

      List<AbstractNode> getBiggestDocuments(Long ownerId, org.exoplatform.services.security.Identity aclIdentity, int offset, int limit) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Retrieves a list of biggest accessible files, for a selected user. The returned results will be of type FileNode only. The ownerId of filter object will be used to select the list of accessible Nodes to retrieve.
      Parameters:
      ownerId - Identity of the identity in which search files
      aclIdentity - Identity of the user acessing files
      offset - Offset of the result list
      limit - Limit of the result list
      Returns:
      List of AbstractNode
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when parentFolderId doesn't exisits
    • calculateFilesSize

      long calculateFilesSize(Long ownerId, org.exoplatform.services.security.Identity aclIdentity) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • getGroupDocumentsCount

      DocumentGroupsSize getGroupDocumentsCount(DocumentTimelineFilter filter, org.exoplatform.services.security.Identity aclIdentity) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Retrieves the number of existing files by group.
      Parameters:
      filter - DocumentFolderFilter that contains filtering criteria
      aclIdentity - Identity of the user acessing files
      Returns:
      DocumentGroupsSize
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when parentFolderId doesn't exisits
    • getFolderChildNodes

      List<AbstractNode> getFolderChildNodes(DocumentFolderFilter filter, org.exoplatform.services.security.Identity aclIdentity, int offset, int limit) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Retrieves a list of accessible files, for a selected user, by applying the designated filter. The parentForlderId of filter object will be used to select the list of Nodes to retrieve.
      Parameters:
      filter - DocumentFolderFilter that contains filtering criteria
      aclIdentity - Identity of the user acessing files
      offset - Offset of the result list
      limit - Limit of the result list
      Returns:
      List of AbstractNode
      Throws:
      IllegalAccessException - when the user isn't allowed to access documents of the designated parentFolderId
      org.exoplatform.commons.exception.ObjectNotFoundException - when parentFolderId doesn't exisits
    • getBreadcrumb

      List<BreadCrumbItem> getBreadcrumb(long ownerId, String folderId, String folderPath, org.exoplatform.services.security.Identity aclIdentity) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Retrieves breadcrumb of the given node.
      Parameters:
      folderId - Id of the given folder
      aclIdentity - Identity of the user acessing files
      Returns:
      List of AbstractNode
      Throws:
      IllegalAccessException - when the user isn't allowed to access documents of the designated parentFolderId
      org.exoplatform.commons.exception.ObjectNotFoundException - when folderId doesn't exisits
    • getFullTreeData

      List<FullTreeItem> getFullTreeData(long ownerId, String folderId, String destinationFolderPath, org.exoplatform.services.security.Identity aclIdentity, boolean withChildren, boolean showHidden) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Retrieves breadcrumb of the given node.
      Parameters:
      folderId - Id of the given folder
      aclIdentity - Identity of the user acessing files
      withChildren - get all children
      Returns:
      List of AbstractNode
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • setDocumentVisibility

      void setDocumentVisibility(long ownerId, String documentID, Boolean hidden, org.exoplatform.services.security.Identity aclIdentity) throws org.exoplatform.commons.ObjectAlreadyExistsException
      Set the document visibility.
      Parameters:
      ownerId - the owner Id
      documentID - theDocument Id
      hidden - the hidden value
      aclIdentity - user Identuty
      Throws:
      org.exoplatform.commons.ObjectAlreadyExistsException
    • duplicateDocument

      AbstractNode duplicateDocument(long ownerId, String fileId, String prefixClone, org.exoplatform.services.security.Identity aclIdentity) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Duplicate the given node.
      Parameters:
      fileId - Id of the given file
      aclIdentity - Identity of the user acessing files
      Returns:
      AbstractNode
      Throws:
      IllegalAccessException - when the user isn't allowed to access documents of the designated parentFolderId
      org.exoplatform.commons.exception.ObjectNotFoundException - when folderId doesn't exisits
    • copyDocument

      AbstractNode copyDocument(String nodeId, String destintionNodeId, org.exoplatform.services.security.Identity aclIdentity) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Copy the given node.
      Parameters:
      nodeId - Id of the given file
      destintionNodeId - Id of the destination folder
      aclIdentity - Identity of the user acessing files
      Returns:
      AbstractNode
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when folderId doesn't exisits
    • moveDocument

      void moveDocument(javax.jcr.Session session, long ownerId, String fileId, String destPath, org.exoplatform.services.security.Identity aclIdentity, String conflictAction) throws Exception
      Move the given node.
      Parameters:
      session - current jcr session
      fileId - Id of the given file
      aclIdentity - Identity of the user acessing files
      conflictAction - conflict action
      Throws:
      IllegalAccessException - when the user isn't allowed to access documents of the designated parentFolderId
      org.exoplatform.commons.exception.ObjectNotFoundException - when folderId doesn't exisits
      org.exoplatform.commons.ObjectAlreadyExistsException - when file with same name already exists in the target path
      Exception
    • moveDocument

      void moveDocument(long ownerId, String fileId, String destPath, org.exoplatform.services.security.Identity aclIdentity, String conflictAction) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException, org.exoplatform.commons.ObjectAlreadyExistsException
      Move the given node.
      Parameters:
      fileId - Id of the given file
      aclIdentity - Identity of the user acessing files
      conflictAction - conflict action
      Throws:
      IllegalAccessException - when the user isn't allowed to access documents of the designated parentFolderId
      org.exoplatform.commons.exception.ObjectNotFoundException - when folderId doesn't exisits
      org.exoplatform.commons.ObjectAlreadyExistsException - when file with same name already exists in the target path
    • createFolder

      AbstractNode createFolder(long ownerId, String folderId, String folderPath, String title, org.exoplatform.services.security.Identity aclIdentity) throws IllegalAccessException, org.exoplatform.commons.ObjectAlreadyExistsException, org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      IllegalAccessException
      org.exoplatform.commons.ObjectAlreadyExistsException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • getNewName

      String getNewName(long ownerId, String folderId, String folderPath, String title) throws IllegalAccessException, org.exoplatform.commons.ObjectAlreadyExistsException, org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      IllegalAccessException
      org.exoplatform.commons.ObjectAlreadyExistsException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • renameDocument

      void renameDocument(long ownerId, String documentID, String title, org.exoplatform.services.security.Identity aclIdentity) throws IllegalAccessException, org.exoplatform.commons.ObjectAlreadyExistsException, org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      IllegalAccessException
      org.exoplatform.commons.ObjectAlreadyExistsException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • updatePermissions

      void updatePermissions(String documentID, NodePermission nodePermissionEntity, org.exoplatform.services.security.Identity aclIdentity)
    • downloadDocuments

      void downloadDocuments(int actionId, List<AbstractNode> documents, org.exoplatform.services.security.Identity identity, long authenticatedUserId)
    • shareDocument

      void shareDocument(String documentId, long destId, org.exoplatform.services.security.Identity aclIdentity, boolean broadcast) throws IllegalAccessException
      Shares a document with given user or space
      Parameters:
      documentId - document id
      destId - target user or space identity id
      aclIdentity - current user Identity
      Throws:
      IllegalAccessException
    • unShareDocument

      void unShareDocument(String documentId, long destId) throws javax.jcr.RepositoryException
      Throws:
      javax.jcr.RepositoryException
    • notifyMember

      void notifyMember(String documentId, long destId) throws IllegalAccessException
      Throws:
      IllegalAccessException
    • canAccess

      boolean canAccess(String documentID, org.exoplatform.services.security.Identity aclIdentity)
    • updateDocumentDescription

      default void updateDocumentDescription(long ownerId, String documentID, String description, org.exoplatform.services.security.Identity aclIdentity) throws IllegalStateException, javax.jcr.RepositoryException
      Throws:
      IllegalStateException
      javax.jcr.RepositoryException
    • createShortcut

      void createShortcut(String documentId, String destPath, String aclIdentity, String conflictAction) throws IllegalAccessException, org.exoplatform.commons.ObjectAlreadyExistsException
      Creates a shortcut for a document
      Parameters:
      documentId - document id
      destPath - destination path
      aclIdentity - user identity id
      conflictAction - conflict action
      Throws:
      IllegalAccessException
      org.exoplatform.commons.ObjectAlreadyExistsException
    • getFileVersions

      List<FileVersion> getFileVersions(String fileNodeId, String aclIdentity)
      Retrieves versions of specific file
      Parameters:
      fileNodeId - target file node id
      aclIdentity - user identity id
      Returns:
      List of FileVersion
    • getDocumentById

      AbstractNode getDocumentById(String documentId, String aclIdentity) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Retrieves a document By Id
      Parameters:
      documentId - target file node id
      aclIdentity - user identity id
      Returns:
      AbstractNode
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when document doesn't exists
      IllegalAccessException - when user can't access document
    • getDocumentById

      AbstractNode getDocumentById(String documentId)
      Parameters:
      documentId - target file node id
      Returns:
      AbstractNode
    • getDocumentContent

      io.meeds.portal.thumbnail.model.FileContent getDocumentContent(String documentId, String aclIdentity) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Retrieves a document content By its Id
      Parameters:
      documentId - target file node id
      aclIdentity - user identity id
      Returns:
      FileContent
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • updateVersionSummary

      FileVersion updateVersionSummary(String originFileId, String versionId, String summary, String aclIdentity)
      update or add a version summary
      Parameters:
      originFileId - original file id
      versionId - version id
      summary - new summary to be saved
      aclIdentity - current user identity
      Returns:
      FileVersion
    • restoreVersion

      FileVersion restoreVersion(String versionId, String aclIdentity)
      restore document version
      Parameters:
      versionId - version id
      aclIdentity - current user identity
      Returns:
      FileVersion
    • getDownloadZipBytes

      byte[] getDownloadZipBytes(int actionId, String userName) throws IOException
      Get the zip for download by action ID
      Parameters:
      actionId - action id
      userName - current user name
      Throws:
      IOException
    • cancelBulkAction

      void cancelBulkAction(String actionId, String userName) throws IOException
      Cancel any bulk action by action ID
      Parameters:
      actionId - action id
      userName - current user name
      Throws:
      IOException
    • createNewVersion

      FileVersion createNewVersion(String nodeId, String aclIdentity, InputStream newContent)
      Creates a new version from an input stream
      Parameters:
      nodeId - target node id
      aclIdentity - current user identity id
      newContent - the new content to be set in the new version
      Returns:
      FileVersion
    • moveDocuments

      void moveDocuments(int actionId, long ownerId, List<AbstractNode> documents, String destPath, org.exoplatform.services.security.Identity userIdentityId, long identityId)
      Move list of documents in bulk
      Parameters:
      actionId - action id
      ownerId - owner id
      documents - list of documents to move
      destPath - destination path
      userIdentityId - current user acl identity id
      identityId - current user identity id
    • hasEditPermissions

      boolean hasEditPermissions(String nodeId, org.exoplatform.services.security.Identity aclUserIdentity)
      Checks if user has edit permission on document
      Parameters:
      nodeId - document node id
      aclUserIdentity - user identity id
      Returns:
      true if has edit permission or false
    • getDocumentDownloadItem

      DownloadItem getDocumentDownloadItem(String documentId)
      Gets a download item of a given document
      Parameters:
      documentId - document id
      Returns:
      DownloadItem
    • downloadFolder

      String downloadFolder(String folderId)
      Download a zipped folder
      Parameters:
      folderId - folder node id
      Returns:
      downloaded zip path
    • getFileContentAsText

      String getFileContentAsText(String documentId)
      Returns a document file content as Text
      Parameters:
      documentId - Document identifier
      Returns:
      the text representation of a file
    • importFiles

      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
      Import list of documents from an uploaded zip
      Parameters:
      importId - import id
      space - space where to create documents
      folderId - folder id
      folderPath - folder path
      conflict - conflict rule
      identity - current user identity
      ownerId - owner id
      authenticatedUserId - current user identity id
      Throws:
      Exception
    • canImport

      boolean canImport(org.exoplatform.services.security.Identity identity)
    • getFavoriteFileIds

      List<String> getFavoriteFileIds(DocumentNodeFilter filter, org.exoplatform.services.security.Identity aclUserIdentity, int offset, int limit)
    • getDocumentCategoryIds

      default List<Long> getDocumentCategoryIds(long spaceIdentityId, org.exoplatform.services.security.Identity aclIdentity)
      Parameters:
      spaceIdentityId - Space Identity Identifier
      Returns:
      List of Category Ids used in Documents
    • clearSymlinksNavHistory

      void clearSymlinksNavHistory()