Interface DocumentFileStorage
public interface DocumentFileStorage
-
Method Summary
Modifier and TypeMethodDescriptionlongcalculateFilesSize(Long ownerId, org.exoplatform.services.security.Identity aclIdentity) booleanvoidcancelBulkAction(String actionId, String userName) Cancel any bulk action by action IDbooleancanImport(org.exoplatform.services.security.Identity identity) voidcopyDocument(String nodeId, String destintionNodeId, org.exoplatform.services.security.Identity aclIdentity) Copy the given node.createFolder(long ownerId, String folderId, String folderPath, String title, org.exoplatform.services.security.Identity aclIdentity) createNewVersion(String nodeId, String aclIdentity, InputStream newContent) Creates a new version from an input streamvoidcreateShortcut(String documentId, String destPath, String aclIdentity, String conflictAction) Creates a shortcut for a documentvoiddownloadDocuments(int actionId, List<AbstractNode> documents, org.exoplatform.services.security.Identity identity, long authenticatedUserId) downloadFolder(String folderId) Download a zipped folderduplicateDocument(long ownerId, String fileId, String prefixClone, org.exoplatform.services.security.Identity aclIdentity) Duplicate the given node.getBiggestDocuments(Long ownerId, org.exoplatform.services.security.Identity aclIdentity, int offset, int limit) Retrieves a list of biggest accessible files, for a selected user.getBreadcrumb(long ownerId, String folderId, String folderPath, org.exoplatform.services.security.Identity aclIdentity) Retrieves breadcrumb of the given node.getDocumentById(String documentId) getDocumentById(String documentId, String aclIdentity) Retrieves a document By IdgetDocumentCategoryIds(long spaceIdentityId, org.exoplatform.services.security.Identity aclIdentity) io.meeds.portal.thumbnail.model.FileContentgetDocumentContent(String documentId, String aclIdentity) Retrieves a document content By its IdgetDocumentDownloadItem(String documentId) Gets a download item of a given documentbyte[]getDownloadZipBytes(int actionId, String userName) Get the zip for download by action IDgetFavoriteFileIds(DocumentNodeFilter filter, org.exoplatform.services.security.Identity aclUserIdentity, int offset, int limit) getFilesTimeline(DocumentTimelineFilter filter, org.exoplatform.services.security.Identity aclIdentity, int offset, int limit) Retrieves a list of accessible files, for a selected user, by applying the designated filter.getFileVersions(String fileNodeId, String aclIdentity) Retrieves versions of specific filegetFolderChildNodes(DocumentFolderFilter filter, org.exoplatform.services.security.Identity aclIdentity, int offset, int limit) Retrieves a list of accessible files, for a selected user, by applying the designated filter.getFullTreeData(long ownerId, String folderId, String destinationFolderPath, org.exoplatform.services.security.Identity aclIdentity, boolean withChildren, boolean showHidden) Retrieves breadcrumb of the given node.getGroupDocumentsCount(DocumentTimelineFilter filter, org.exoplatform.services.security.Identity aclIdentity) Retrieves the number of existing files by group.getNewName(long ownerId, String folderId, String folderPath, String title) booleanhasEditPermissions(String nodeId, org.exoplatform.services.security.Identity aclUserIdentity) Checks if user has edit permission on documentvoidimportFiles(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) Import list of documents from an uploaded zipvoidmoveDocument(long ownerId, String fileId, String destPath, org.exoplatform.services.security.Identity aclIdentity, String conflictAction) Move the given node.voidmoveDocument(javax.jcr.Session session, long ownerId, String fileId, String destPath, org.exoplatform.services.security.Identity aclIdentity, String conflictAction) Move the given node.voidmoveDocuments(int actionId, long ownerId, List<AbstractNode> documents, String destPath, org.exoplatform.services.security.Identity userIdentityId, long identityId) Move list of documents in bulkvoidnotifyMember(String documentId, long destId) voidrenameDocument(long ownerId, String documentID, String title, org.exoplatform.services.security.Identity aclIdentity) restoreVersion(String versionId, String aclIdentity) restore document versionvoidsetDocumentVisibility(long ownerId, String documentID, Boolean hidden, org.exoplatform.services.security.Identity aclIdentity) Set the document visibility.voidshareDocument(String documentId, long destId, org.exoplatform.services.security.Identity aclIdentity, boolean broadcast) Shares a document with given user or spacevoidunShareDocument(String documentId, long destId) default voidupdateDocumentDescription(long ownerId, String documentID, String description, org.exoplatform.services.security.Identity aclIdentity) voidupdatePermissions(String documentID, NodePermission nodePermissionEntity, org.exoplatform.services.security.Identity aclIdentity) updateVersionSummary(String originFileId, String versionId, String summary, String aclIdentity) update or add a version summary
-
Method Details
-
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 typeFileNodeonly. The ownerId of filter object will be used to select the list of accessible Nodes to retrieve switch a timeline.- Parameters:
filter-DocumentTimelineFilterthat contains filtering criteriaaclIdentity-Identityof the user acessing filesoffset- Offset of the result listlimit- Limit of the result list- Returns:
ListofAbstractNode- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when parentFolderId doesn't exisits
-
search
-
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 typeFileNodeonly. The ownerId of filter object will be used to select the list of accessible Nodes to retrieve.- Parameters:
ownerId-Identityof the identity in which search filesaclIdentity-Identityof the user acessing filesoffset- Offset of the result listlimit- Limit of the result list- Returns:
ListofAbstractNode- 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-DocumentFolderFilterthat contains filtering criteriaaclIdentity-Identityof 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-DocumentFolderFilterthat contains filtering criteriaaclIdentity-Identityof the user acessing filesoffset- Offset of the result listlimit- Limit of the result list- Returns:
ListofAbstractNode- Throws:
IllegalAccessException- when the user isn't allowed to access documents of the designated parentFolderIdorg.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 folderaclIdentity-Identityof the user acessing files- Returns:
ListofAbstractNode- Throws:
IllegalAccessException- when the user isn't allowed to access documents of the designated parentFolderIdorg.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 folderaclIdentity-Identityof the user acessing fileswithChildren- get all children- Returns:
ListofAbstractNode- Throws:
IllegalAccessExceptionorg.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 IddocumentID- theDocument Idhidden- the hidden valueaclIdentity- 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 fileaclIdentity-Identityof the user acessing files- Returns:
AbstractNode- Throws:
IllegalAccessException- when the user isn't allowed to access documents of the designated parentFolderIdorg.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 filedestintionNodeId- Id of the destination folderaclIdentity-Identityof 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 sessionfileId- Id of the given fileaclIdentity-Identityof the user acessing filesconflictAction- conflict action- Throws:
IllegalAccessException- when the user isn't allowed to access documents of the designated parentFolderIdorg.exoplatform.commons.exception.ObjectNotFoundException- when folderId doesn't exisitsorg.exoplatform.commons.ObjectAlreadyExistsException- when file with same name already exists in the target pathException
-
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 fileaclIdentity-Identityof the user acessing filesconflictAction- conflict action- Throws:
IllegalAccessException- when the user isn't allowed to access documents of the designated parentFolderIdorg.exoplatform.commons.exception.ObjectNotFoundException- when folderId doesn't exisitsorg.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:
IllegalAccessExceptionorg.exoplatform.commons.ObjectAlreadyExistsExceptionorg.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:
IllegalAccessExceptionorg.exoplatform.commons.ObjectAlreadyExistsExceptionorg.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:
IllegalAccessExceptionorg.exoplatform.commons.ObjectAlreadyExistsExceptionorg.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) -
notifyMember
- Throws:
IllegalAccessException
-
canAccess
-
updateDocumentDescription
default void updateDocumentDescription(long ownerId, String documentID, String description, org.exoplatform.services.security.Identity aclIdentity) throws IllegalStateException, javax.jcr.RepositoryException - Throws:
IllegalStateExceptionjavax.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 iddestPath- destination pathaclIdentity- user identity idconflictAction- conflict action- Throws:
IllegalAccessExceptionorg.exoplatform.commons.ObjectAlreadyExistsException
-
getFileVersions
Retrieves versions of specific file- Parameters:
fileNodeId- target file node idaclIdentity- user identity id- Returns:
ListofFileVersion
-
getDocumentById
AbstractNode getDocumentById(String documentId, String aclIdentity) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException Retrieves a document By Id- Parameters:
documentId- target file node idaclIdentity- user identity id- Returns:
AbstractNode- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when document doesn't existsIllegalAccessException- when user can't access document
-
getDocumentById
- 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 idaclIdentity- 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 idversionId- version idsummary- new summary to be savedaclIdentity- current user identity- Returns:
FileVersion
-
restoreVersion
restore document version- Parameters:
versionId- version idaclIdentity- current user identity- Returns:
FileVersion
-
getDownloadZipBytes
Get the zip for download by action ID- Parameters:
actionId- action iduserName- current user name- Throws:
IOException
-
cancelBulkAction
Cancel any bulk action by action ID- Parameters:
actionId- action iduserName- current user name- Throws:
IOException
-
createNewVersion
Creates a new version from an input stream- Parameters:
nodeId- target node idaclIdentity- current user identity idnewContent- 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 idownerId- owner iddocuments- list of documents to movedestPath- destination pathuserIdentityId- current user acl identity ididentityId- 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 idaclUserIdentity- user identity id- Returns:
- true if has edit permission or false
-
getDocumentDownloadItem
Gets a download item of a given document- Parameters:
documentId- document id- Returns:
DownloadItem
-
downloadFolder
Download a zipped folder- Parameters:
folderId- folder node id- Returns:
- downloaded zip path
-
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 idspace- space where to create documentsfolderId- folder idfolderPath- folder pathconflict- conflict ruleidentity- current user identityownerId- owner idauthenticatedUserId- 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- SpaceIdentityIdentifier- Returns:
Listof Category Ids used in Documents
-