Interface DocumentFileService


  • public interface DocumentFileService
    • Method Detail

      • getDocumentItems

        List<AbstractNode> getDocumentItems​(FileListingType listingType,
                                            DocumentNodeFilter filter,
                                            int offset,
                                            int limit,
                                            long userIdentityId,
                                            boolean showHiddenFiles)
                                     throws IllegalAccessException,
                                            org.exoplatform.commons.exception.ObjectNotFoundException
        Retrieves a list of accessible folders and/or files, for a selected user, by applying the designated filter.
        Parameters:
        listingType - FileListingType
        filter - DocumentNodeFilter that contains filtering criteria
        offset - Offset of the result list
        limit - Limit of the result list
        userIdentityId - Identity technical identifier of the user acessing files
        Returns:
        List of AbstractNode
        Throws:
        IllegalAccessException - when the user isn't allowed to access documents of the designated parentFolderId or ownerId
        org.exoplatform.commons.exception.ObjectNotFoundException - when parentFolderId or ownerId doesn't exisits
      • getFilesTimeline

        List<FileNode> getFilesTimeline​(DocumentTimelineFilter filter,
                                        int offset,
                                        int limit,
                                        long userIdentityId)
                                 throws IllegalAccessException,
                                        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
        offset - Offset of the result list
        limit - Limit of the result list
        userIdentityId - Identity technical identifier of the user acessing files
        Returns:
        List of AbstractNode
        Throws:
        IllegalAccessException - when the user isn't allowed to access documents of the designated ownerId
        org.exoplatform.commons.exception.ObjectNotFoundException - when ownerId doesn't exisits
      • getGroupDocumentsCount

        DocumentGroupsSize getGroupDocumentsCount​(DocumentTimelineFilter filter,
                                                  long userIdentityId)
                                           throws IllegalAccessException,
                                                  org.exoplatform.commons.exception.ObjectNotFoundException
        Retrieves the number of existing files by group.
        Parameters:
        filter - DocumentTimelineFilter that contains filtering criteria
        userIdentityId - Identity technical identifier of the user acessing files
        Returns:
        List of AbstractNode
        Throws:
        IllegalAccessException - when the user isn't allowed to access documents of the designated ownerId
        org.exoplatform.commons.exception.ObjectNotFoundException - when ownerId doesn't exisits
      • getFolderChildNodes

        List<AbstractNode> getFolderChildNodes​(DocumentFolderFilter filter,
                                               int offset,
                                               int limit,
                                               long userIdentityId)
                                        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
        offset - Offset of the result list
        limit - Limit of the result list
        userIdentityId - Identity technical identifier 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 parentFolderId doesn't exisits
      • getBreadcrumb

        List<BreadCrumbItem> getBreadcrumb​(long ownerId,
                                           String folderId,
                                           String folderPath,
                                           long authenticatedUserId)
                                    throws IllegalAccessException,
                                           org.exoplatform.commons.exception.ObjectNotFoundException
        Retrieves breadcrumb of the given node.
        Parameters:
        folderId - Id of the given folder
        authenticatedUserId - of the user acessing files
        Returns:
        List of BreadCrumbItem
        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,
                                           long authenticatedUserId)
                                    throws IllegalAccessException,
                                           org.exoplatform.commons.exception.ObjectNotFoundException
        Retrieves breadcrumb of the given node.
        Parameters:
        folderId - Id of the given folder
        authenticatedUserId - of the user acessing files
        Returns:
        List of FullTreeItem
        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
      • duplicateDocument

        AbstractNode duplicateDocument​(long ownerId,
                                       String fileId,
                                       String prefixClone,
                                       long authenticatedUserId)
                                throws IllegalAccessException,
                                       org.exoplatform.commons.exception.ObjectNotFoundException
        Duplicate the given node.
        Parameters:
        fileId - Id of the given file
        authenticatedUserId - 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
      • moveDocument

        void moveDocument​(long ownerId,
                          String fileId,
                          String destPath,
                          long authenticatedUserId)
                   throws IllegalAccessException,
                          org.exoplatform.commons.exception.ObjectNotFoundException
        Move the given node.
        Parameters:
        fileId - Id of the given file
        authenticatedUserId - of the user acessing files
        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
      • deleteDocument

        void deleteDocument​(String documentPath,
                            String documentId,
                            boolean favorite,
                            long delay,
                            long authenticatedUserId)
                     throws IllegalAccessException
        Delete a document.
        Parameters:
        documentPath - the path of document
        documentId - the Id of document
        favorite - Is favorite document
        delay - the delay to apply the delete atcion
        authenticatedUserId - of the user acessing files
        Throws:
        IllegalAccessException - when the user isn't allowed to delete document
      • undoDeleteDocument

        void undoDeleteDocument​(String documentId,
                                long authenticatedUserId)
        Undo delete a document (Cancel the delete action).
        Parameters:
        documentId - the Id of document
        authenticatedUserId - of the user acessing files
      • shareDocument

        void shareDocument​(String documentId,
                           long destId)
                    throws IllegalAccessException
        Shares a document with given user or space
        Parameters:
        documentId - document id
        destId - target user or space identity id
        Throws:
        IllegalAccessException
      • createFolder

        void createFolder​(long ownerId,
                          String folderId,
                          String folderPath,
                          String name,
                          long authenticatedUserId)
                   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 name)
                   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 name,
                            long authenticatedUserId)
                     throws IllegalAccessException,
                            org.exoplatform.commons.ObjectAlreadyExistsException,
                            org.exoplatform.commons.exception.ObjectNotFoundException
        Throws:
        IllegalAccessException
        org.exoplatform.commons.ObjectAlreadyExistsException
        org.exoplatform.commons.exception.ObjectNotFoundException
      • canAccess

        boolean canAccess​(String documentID,
                          org.exoplatform.services.security.Identity aclIdentity)
                   throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException