Class DocumentFileServiceImpl

java.lang.Object
org.exoplatform.documents.service.DocumentFileServiceImpl
All Implemented Interfaces:
org.exoplatform.documents.service.DocumentFileService

public class DocumentFileServiceImpl extends Object implements org.exoplatform.documents.service.DocumentFileService
  • Constructor Details

    • DocumentFileServiceImpl

      public DocumentFileServiceImpl(org.exoplatform.documents.storage.DocumentFileStorage documentFileStorage, org.exoplatform.documents.storage.JCRDeleteFileStorage jcrDeleteFileStorage, org.exoplatform.services.security.Authenticator authenticator, org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.services.security.IdentityRegistry identityRegistry, org.exoplatform.services.listener.ListenerService listenerService, io.meeds.analytics.api.service.AnalyticsService analyticsService, org.exoplatform.services.thumbnail.ImageThumbnailService imageThumbnailService)
  • Method Details

    • getSpaceRootFolder

      public org.exoplatform.documents.model.FolderNode getSpaceRootFolder(long spaceId, org.exoplatform.services.security.Identity userAclIdentity) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Specified by:
      getSpaceRootFolder in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
    • getPersonalRootFolder

      public org.exoplatform.documents.model.FolderNode getPersonalRootFolder(org.exoplatform.services.security.Identity userAclIdentity)
      Specified by:
      getPersonalRootFolder in interface org.exoplatform.documents.service.DocumentFileService
    • getRootFolderOwnerId

      public long getRootFolderOwnerId(String documentId)
      Specified by:
      getRootFolderOwnerId in interface org.exoplatform.documents.service.DocumentFileService
    • getFileContentAsText

      public String getFileContentAsText(String docId)
      Specified by:
      getFileContentAsText in interface org.exoplatform.documents.service.DocumentFileService
    • getDocumentItems

      public List<? extends org.exoplatform.documents.model.AbstractNode> getDocumentItems(org.exoplatform.documents.constant.FileListingType listingType, org.exoplatform.documents.model.DocumentNodeFilter filter, int offset, int limit, long userIdentityId, boolean showHiddenFiles) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      getDocumentItems in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • getFavoriteFileIds

      public List<String> getFavoriteFileIds(org.exoplatform.documents.model.DocumentNodeFilter filter, int offset, int limit, long userIdentityId) throws IllegalAccessException
      Specified by:
      getFavoriteFileIds in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
    • 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.service.DocumentFileService
    • 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.service.DocumentFileService
    • getFilesTimeline

      public List<org.exoplatform.documents.model.FileNode> getFilesTimeline(org.exoplatform.documents.model.DocumentTimelineFilter filter, int offset, int limit, long userIdentityId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      getFilesTimeline in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • getBiggestDocuments

      public List<org.exoplatform.documents.model.AbstractNode> getBiggestDocuments(long ownerId, org.exoplatform.social.core.identity.model.Identity userIdentity, int offset, int limit) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      getBiggestDocuments in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • getGroupDocumentsCount

      public org.exoplatform.documents.model.DocumentGroupsSize getGroupDocumentsCount(org.exoplatform.documents.model.DocumentTimelineFilter filter, long userIdentityId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      getGroupDocumentsCount in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • getFolderChildNodes

      public List<org.exoplatform.documents.model.AbstractNode> getFolderChildNodes(org.exoplatform.documents.model.DocumentFolderFilter filter, int offset, int limit, long userIdentityId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      getFolderChildNodes in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • getBreadcrumb

      public List<org.exoplatform.documents.model.BreadCrumbItem> getBreadcrumb(long ownerId, String folderId, String folderPath, long authenticatedUserId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      getBreadcrumb in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • getFullTreeData

      public List<org.exoplatform.documents.model.FullTreeItem> getFullTreeData(long ownerId, String folderId, String destinationFolderPath, long authenticatedUserId, boolean withChildren, boolean showHidden) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      getFullTreeData in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • duplicateDocument

      public org.exoplatform.documents.model.AbstractNode duplicateDocument(long ownerId, String fileId, String prefixClone, long authenticatedUserId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      duplicateDocument in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • copyDocument

      public org.exoplatform.documents.model.AbstractNode copyDocument(String nodeId, String destintionNodeId, long authenticatedUserId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      copyDocument in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • moveDocument

      public void moveDocument(long ownerId, String fileId, String destPath, long authenticatedUserId, String conflictAction) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException, org.exoplatform.commons.ObjectAlreadyExistsException
      Specified by:
      moveDocument in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
      org.exoplatform.commons.ObjectAlreadyExistsException
    • createFolder

      public org.exoplatform.documents.model.AbstractNode createFolder(long ownerId, String folderId, String folderPath, String name, long authenticatedUserId) throws IllegalAccessException, org.exoplatform.commons.ObjectAlreadyExistsException, org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      createFolder in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
      org.exoplatform.commons.ObjectAlreadyExistsException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • getNewName

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

      public void renameDocument(long ownerId, String documentID, String name, long authenticatedUserId) throws IllegalAccessException, org.exoplatform.commons.ObjectAlreadyExistsException, org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      renameDocument in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
      org.exoplatform.commons.ObjectAlreadyExistsException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • deleteDocument

      public void deleteDocument(String folderPath, String documentId, boolean favorite, long delay, long authenticatedUserId) throws IllegalAccessException
      Specified by:
      deleteDocument in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
    • undoDeleteDocument

      public void undoDeleteDocument(String documentId, long authenticatedUserId)
      Specified by:
      undoDeleteDocument in interface org.exoplatform.documents.service.DocumentFileService
    • deleteDocuments

      public void deleteDocuments(int actionId, List<org.exoplatform.documents.model.AbstractNode> documents, long authenticatedUserId) throws IllegalAccessException
      Specified by:
      deleteDocuments in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
    • downloadDocuments

      public void downloadDocuments(int actionId, List<org.exoplatform.documents.model.AbstractNode> documents, long authenticatedUserId) throws IllegalAccessException
      Specified by:
      downloadDocuments in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
    • updatePermissions

      public void updatePermissions(String documentId, org.exoplatform.documents.model.NodePermission nodePermissionEntity, long authenticatedUserId) throws IllegalAccessException
      Specified by:
      updatePermissions in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
    • shareDocument

      public void shareDocument(String documentId, long destId, long authenticatedUserId, boolean notifyMember) throws IllegalAccessException
      Specified by:
      shareDocument in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
    • unShareDocument

      public void unShareDocument(String documentId, long destId) throws javax.jcr.RepositoryException
      Specified by:
      unShareDocument in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      javax.jcr.RepositoryException
    • notifyMember

      public void notifyMember(String documentId, long destId) throws IllegalAccessException
      Specified by:
      notifyMember in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
    • canAccess

      public boolean canAccess(String documentID, org.exoplatform.services.security.Identity aclIdentity)
      Specified by:
      canAccess in interface org.exoplatform.documents.service.DocumentFileService
    • getAclUserIdentity

      public org.exoplatform.services.security.Identity getAclUserIdentity(String username) throws IllegalAccessException
      Specified by:
      getAclUserIdentity in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
    • updateDocumentDescription

      public void updateDocumentDescription(long ownerId, String documentID, String description, long aclIdentity) throws IllegalStateException, IllegalAccessException, javax.jcr.RepositoryException
      Specified by:
      updateDocumentDescription in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalStateException
      IllegalAccessException
      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.service.DocumentFileService
      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.service.DocumentFileService
    • updateVersionSummary

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

      public org.exoplatform.documents.model.FileVersion restoreVersion(String versionId, String aclIdentity)
      Specified by:
      restoreVersion in interface org.exoplatform.documents.service.DocumentFileService
      Returns:
    • canAddDocument

      public boolean canAddDocument(String spaceId, String currentUserName)
      Specified by:
      canAddDocument in interface org.exoplatform.documents.service.DocumentFileService
    • getDownloadZipBytes

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

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

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

      public void moveDocuments(int actionId, long ownerId, List<org.exoplatform.documents.model.AbstractNode> documents, String destPath, long userIdentityId) throws IllegalAccessException
      Specified by:
      moveDocuments in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
    • canImport

      public boolean canImport(org.exoplatform.services.security.Identity identity)
      Specified by:
      canImport in interface org.exoplatform.documents.service.DocumentFileService
    • getDocumentsSizeStat

      public org.exoplatform.documents.model.DocumentsSize getDocumentsSizeStat(long ownerId, long userIdentityId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      getDocumentsSizeStat in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • addDocumentsSizeStat

      public org.exoplatform.documents.model.DocumentsSize addDocumentsSizeStat(long ownerId, long userIdentityId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      addDocumentsSizeStat in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • hasEditPermissionOnDocument

      public boolean hasEditPermissionOnDocument(String nodeId, long userIdentityId) throws IllegalAccessException
      Specified by:
      hasEditPermissionOnDocument in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
    • hasEditPermissionOnDocument

      public boolean hasEditPermissionOnDocument(String nodeId, org.exoplatform.services.security.Identity aclIdentity)
      Specified by:
      hasEditPermissionOnDocument in interface org.exoplatform.documents.service.DocumentFileService
    • importFiles

      public void importFiles(String ownerId, String folderId, String folderPath, String uploadId, String conflict, org.exoplatform.services.security.Identity identity, long authenticatedUserId) throws Exception
      Specified by:
      importFiles in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      Exception
    • getDeletedDocuments

      public List<org.exoplatform.documents.model.TrashElementNode> getDeletedDocuments(org.exoplatform.documents.model.TrashElementNodeFilter filter) throws javax.jcr.RepositoryException
      Specified by:
      getDeletedDocuments in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      javax.jcr.RepositoryException
    • countDeletedDocuments

      public int countDeletedDocuments()
      Specified by:
      countDeletedDocuments in interface org.exoplatform.documents.service.DocumentFileService
    • restoreDocumentFromTrash

      public void restoreDocumentFromTrash(String trashNodePath) throws javax.jcr.RepositoryException
      Specified by:
      restoreDocumentFromTrash in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      javax.jcr.RepositoryException
    • deleteDocumentPermanently

      public void deleteDocumentPermanently(String documentPath) throws org.exoplatform.commons.exception.ObjectNotFoundException, javax.jcr.RepositoryException
      Specified by:
      deleteDocumentPermanently in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      javax.jcr.RepositoryException
    • deleteDocumentsPermanently

      public void deleteDocumentsPermanently(int actionId, List<org.exoplatform.documents.model.AbstractNode> trashElementNodes, long userIdentityId) throws IllegalAccessException
      Specified by:
      deleteDocumentsPermanently in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
    • restoreDocuments

      public void restoreDocuments(int actionId, List<org.exoplatform.documents.model.AbstractNode> trashElementNodes, long userIdentityId) throws IllegalAccessException
      Specified by:
      restoreDocuments in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
    • getDocumentById

      public org.exoplatform.documents.model.AbstractNode getDocumentById(String documentId, String aclIdentity) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      getDocumentById in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • 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.service.DocumentFileService
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • getImageThumbnailContent

      public io.meeds.portal.thumbnail.model.FileContent getImageThumbnailContent(String fileType, String documentId, String userName, int width, int height) throws Exception
      Specified by:
      getImageThumbnailContent in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      Exception
    • createThumbnail

      public org.exoplatform.commons.file.model.FileItem createThumbnail(String fileType, io.meeds.portal.thumbnail.model.FileContent file, String userName, int width, int height) throws Exception
      Specified by:
      createThumbnail in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      Exception
    • getDocumentById

      public org.exoplatform.documents.model.AbstractNode getDocumentById(String documentId)
      Specified by:
      getDocumentById in interface org.exoplatform.documents.service.DocumentFileService
    • setDocumentVisibility

      public void setDocumentVisibility(long ownerId, String documentID, Boolean hidden, long authenticatedUserId) throws Exception
      Specified by:
      setDocumentVisibility in interface org.exoplatform.documents.service.DocumentFileService
      Throws:
      Exception
    • getDocumentCategoryIds

      public List<Long> getDocumentCategoryIds(String documentId)
      Specified by:
      getDocumentCategoryIds in interface org.exoplatform.documents.service.DocumentFileService
    • getDocumentCategoryIds

      public List<Long> getDocumentCategoryIds(long spaceIdentityId, String userName)
      Specified by:
      getDocumentCategoryIds in interface org.exoplatform.documents.service.DocumentFileService