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) 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.getBreadcrumb(long ownerId, String folderId, String folderPath, org.exoplatform.services.security.Identity aclIdentity) Retrieves breadcrumb of the given node.getDocumentDownloadItem(String documentId) Gets a download item of a given documentbyte[]getDownloadZipBytes(int actionId, String userName) Get the zip for download by action IDgetFilesTimeline(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, org.exoplatform.services.security.Identity aclIdentity, boolean withChildren) 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 versionvoidshareDocument(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 criteriaoffset- Offset of the result listlimit- Limit of the result listaclIdentity-Identityof the user acessing files- 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 criteriaoffset- Offset of the result listlimit- Limit of the result listaclIdentity-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 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, org.exoplatform.services.security.Identity aclIdentity, boolean withChildren) 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
-
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
-
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
boolean canAccess(String documentID, org.exoplatform.services.security.Identity aclIdentity) throws javax.jcr.RepositoryException - Throws:
javax.jcr.RepositoryException
-
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
-
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:
ownerId- owner idspace- space where to create documentsfolderId- folder idfolderPath- folder pathimportId- import idconflict- conflict ruleidentity- current user identityauthenticatedUserId- current user identity id- Throws:
Exception
-
canImport
boolean canImport(org.exoplatform.services.security.Identity identity)
-