Interface DocumentFileService
public interface DocumentFileService
-
Method Summary
Modifier and TypeMethodDescriptionaddDocumentsSizeStat(long ownerId, long userIdentityId) Calculate total size of a space or user drive and store the result in new analytics entrybooleanbooleancanAddDocument(String spaceId, String currentUserName) verify if current user can add documentvoidcancelBulkAction(String actionId, String userName) Cancel any bulk action by action IDbooleancanImport(org.exoplatform.services.security.Identity identity) Check if the current user can import documents from zipvoidcheckCanCreatePublicLink(String documentId, long userIdentityId) Refuses the creation, or the update, of the document's public link when its space forbids it to the user: "Limit Access Management" ascheckCanManageAccess(String, long, String), then "Keep documents inside the space", which refuses every public link.voidcheckCanManageAccess(String documentId, long userIdentityId, String action) Refuses a change of the document's access, its public link included, that its space's "Limit Access Management" setting forbids to the user.copyDocument(String nodeId, String destintionNodeId, long authenticatedUserId) Copy the given node.intCounts the total number of deleted documents in the trash.createDocumentFromTemplate(long ownerId, String folderId, String folderPath, String title, String documentType, long authenticatedUserId) Creates a new empty office document (Word/Excel/PowerPoint/ODF) from the platform's blank template, delegating to the ecmsDocumentService.createDocumentFromTemplateDocument(long ownerId, String templateDocumentId, String destinationFolderId, String title, long authenticatedUserId) Creates a document from a template document, in one call: the copy is created under the given title in the destination folder and one document creation is recorded, whether the user kept the proposed name or changed it.createFolder(long ownerId, String folderId, String folderPath, String name, long authenticatedUserId) createFolderPath(String folderId, List<String> titles, long authenticatedUserId) Creates the last folder of a path of folder titles under a folder, each folder before it reused when it exists, created otherwise, asDocumentFileStorage.createFolderPath(String, List, Identity)describes.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 documentorg.exoplatform.commons.file.model.FileItemcreateThumbnail(String fileType, io.meeds.portal.thumbnail.model.FileContent fileContent, String userName, int width, int height) Create thumbnail for given image, always at the one preview sizegetImageThumbnailContent(String, String, String, int, int)reads, whatever width and height are asked.voiddeleteDocument(String documentPath, String documentId, boolean favorite, long delay, long authenticatedUserId) Delete a document.voiddeleteDocumentPermanently(String documentPath) Delete a document from the trash based on the specified trash node path.voiddeleteDocuments(int actionId, List<AbstractNode> documents, long authenticatedUserId) Delete a list of documents.voiddeleteDocumentsPermanently(int actionId, List<AbstractNode> trashElementNodes, long userIdentityId) Delete a list of documents from the trash.voiddownloadDocuments(int actionId, List<AbstractNode> documents, long authenticatedUserId) Download a list of documents.duplicateDocument(long ownerId, String fileId, String prefixClone, long authenticatedUserId) Duplicate the given node.org.exoplatform.services.security.IdentitygetAclUserIdentity(String userName) default StringgetAudioTranscription(String documentId) A previously saved media Text transcription contentdefault StringgetAudioTranscription(String documentId, long aclIdentity) A previously saved media Text transcription contentgetBiggestDocuments(long ownerId, org.exoplatform.social.core.identity.model.Identity userIdentity, int offset, int limit) Retrieves a list of accessible files, for a selected user, by applying the designated filter.getBreadcrumb(long ownerId, String folderId, String folderPath, long authenticatedUserId) Retrieves breadcrumb of the given node.getDeletedDocuments(TrashElementNodeFilter trashElementNodeFilter) Retrieves a list of trash elements that match the specified filter.getDocumentById(String documentId) Retrieves a file by its identifier.getDocumentById(String documentId, String aclIdentity) Retrieves a file by its identifier.getDocumentCategoryIds(long spaceIdentityId, String userName) getDocumentCategoryIds(String documentId) io.meeds.portal.thumbnail.model.FileContentgetDocumentContent(String documentId, String aclIdentity) Retrieves a file content by its identifier.List<? extends AbstractNode> getDocumentItems(FileListingType listingType, DocumentNodeFilter filter, int offset, int limit, long userIdentityId, boolean showHiddenFiles) Retrieves a list of accessible folders and/or files, for a selected user, by applying the designated filter.default StringgetDocumentPathInDrive(String documentId, long ownerId, long authenticatedUserId) Retrieves the path of a document as reached from the drive of an owner: the document's own path when it lies in that drive, otherwise the path through a shortcut of that drive targeting the document or one of its ancestors; in a user drive, only the document or its parent folder.getDocumentsSizeStat(long ownerId, long userIdentityId) Get the total size of a space or user drivebyte[]getDownloadZipBytes(int actionId, String userName) Get the zip for download by action IDgetFavoriteFileIds(DocumentNodeFilter filter, int offset, int limit, long userIdentityId) default InputStreamgetFileContentAsStream(String documentId, long userIdentityId) Returns a document file content as Streamdefault StringgetFileContentAsText(String documentId) Returns a document file content as TextgetFilesTimeline(DocumentTimelineFilter filter, int offset, int limit, long userIdentityId) Retrieves a list of accessible files, for a selected user, by applying the designated filter.default DocumentTextContentgetFileTextContent(String documentId) Returns the text of a document file, from the search index when it already holds it, else extracted from the file itself, and when there is none, why.getFileVersions(String fileNodeId, String aclIdentity) Retrieves versions of specific filegetFolderChildNodes(DocumentFolderFilter filter, int offset, int limit, long userIdentityId) Retrieves a list of accessible files, for a selected user, by applying the designated filter.getFullTreeData(long ownerId, String folderId, String destinationFolderPath, long authenticatedUserId, boolean withChildren, boolean showHidden) Retrieves tree of the given node.getGroupDocumentsCount(DocumentTimelineFilter filter, long userIdentityId) Retrieves the number of existing files by group.io.meeds.portal.thumbnail.model.FileContentgetImageThumbnailContent(String fileType, String documentId, String userName, int width, int height) Get image thumbnail content, always at the one preview size the documents clients display, whatever width and height are asked: this read stores no thumbnail at any other size.getNewName(long ownerId, String folderId, String folderPath, String name) default FolderNodegetPersonalRootFolder(org.exoplatform.services.security.Identity aclIdentity) Retrieves the Root folder Path of a userdefault longgetRootFolderOwnerId(String documentId) Return the root folder ownerIdentityidgetSpaceAccess(String documentId, long userIdentityId) default FolderNodegetSpaceRootFolder(long spaceId, org.exoplatform.services.security.Identity aclIdentity) Retrieves the Root folder Path of a SpacebooleanhasEditPermissionOnDocument(String nodeId, long userIdentityId) Checks if user has edit permission on documentbooleanhasEditPermissionOnDocument(String nodeId, org.exoplatform.services.security.Identity aclIdentity) voidimportFiles(String ownerId, String folderId, String folderPath, String uploadId, String conflict, org.exoplatform.services.security.Identity identity, long authenticatedUserId) Import list of documents from an uploaded zipbooleanisKeptInsideSpace(String documentId) voidmoveDocument(long ownerId, String fileId, String destPath, long authenticatedUserId, String conflictAction) Move the given node.voidmoveDocuments(int actionId, long ownerId, List<AbstractNode> documents, String destPath, long userIdentityId) Move list of documents in bulkvoidnotifyMember(String documentId, long destId) voidrenameDocument(long ownerId, String documentID, String name, long authenticatedUserId) voidrestoreDocumentFromTrash(String trashNodePath) Restores a document from the trash based on the specified trash node path.voidrestoreDocuments(int actionId, List<AbstractNode> trashElementNodes, long userIdentityId) Restore a list of documents from the trash.restoreVersion(String versionId, String aclIdentity) restore document versionsearch(DocumentTimelineFilter filter, org.exoplatform.services.security.Identity identity, int offset, int limit) voidsetDocumentVisibility(long ownerId, String documentID, Boolean hidden, long authenticatedUserId) Set the document visibility.voidshareDocument(String documentId, long destId, long authenticatedUserId, boolean broadcast) Shares a document with given user or space.voidsynchronizeSpacePermissions(org.exoplatform.social.core.space.model.Space space) Synchronizes JCR node permissions for a space, automatically detecting whether the space is in redactional mode based onSpace.voidundoDeleteDocument(String documentId, long authenticatedUserId) Undo delete a document (Cancel the delete action).voidunShareDocument(String documentId, long destId) default voidupdateAudioTranscription(String documentId, String transcription) Updates the Text transcription of a Documentdefault voidupdateAudioTranscription(String documentId, String transcription, long aclIdentity) Updates the Text transcription of a Documentdefault voidupdateDocumentDescription(long ownerId, String documentID, String description, long aclIdentity) voidupdatePermissions(String documentId, NodePermission nodePermissionEntity, long authenticatedUserId) Writes the document's access list and shares it with the identities ofNodePermission#toShare.updateVersionSummary(String originFileId, String versionId, String summary, String aclIdentity) update or add a version summary
-
Method Details
-
getDocumentItems
List<? extends 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-FileListingTypefilter-DocumentNodeFilterthat contains filtering criteriaoffset- Offset of the result listlimit- Limit of the result listuserIdentityId-Identitytechnical identifier of the user acessing files- Returns:
ListofAbstractNode- Throws:
IllegalAccessException- when the user isn't allowed to access documents of the designated parentFolderId or ownerIdorg.exoplatform.commons.exception.ObjectNotFoundException- when parentFolderId or ownerId doesn't exisits
-
search
-
search
List<FileNode> search(DocumentTimelineFilter filter, org.exoplatform.services.security.Identity identity, int offset, int limit) - Parameters:
filter-DocumentTimelineFilterto restrict search resultsidentity- User ACLIdentityoffset- search offsetlimit- search limit- Returns:
Listof foundFileNodeavailable for user
-
getDocumentById
AbstractNode getDocumentById(String documentId, String aclIdentity) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException Retrieves a file by its identifier.- Parameters:
documentId- Id of the given documentaclIdentity- user identity id- Returns:
AbstractNode- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when document doesn't exisitsIllegalAccessException- when document isn't accessible for user
-
getDocumentById
Retrieves a file by its identifier.- Parameters:
documentId- Id of the given document
-
getDocumentPathInDrive
default String getDocumentPathInDrive(String documentId, long ownerId, long authenticatedUserId) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException Retrieves the path of a document as reached from the drive of an owner: the document's own path when it lies in that drive, otherwise the path through a shortcut of that drive targeting the document or one of its ancestors; in a user drive, only the document or its parent folder.- Parameters:
documentId- Id of the given documentownerId- identity id of the drive owner (space or user)authenticatedUserId- current user identity id- Returns:
- the path of the document from the owner's drive, null when no shortcut of that drive leads to it
- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the document or the owner's drive isn't found or isn't accessible to the userIllegalAccessException- when the user's identity can't be resolved
-
getDocumentContent
io.meeds.portal.thumbnail.model.FileContent getDocumentContent(String documentId, String aclIdentity) throws org.exoplatform.commons.exception.ObjectNotFoundException Retrieves a file content by its identifier.- Parameters:
documentId- Id of the given documentaclIdentity- user identity id- Returns:
InputStream- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException
-
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 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 listuserIdentityId-Identitytechnical identifier of the user acessing files- Returns:
ListofAbstractNode- Throws:
IllegalAccessException- when the user isn't allowed to access documents of the designated ownerIdorg.exoplatform.commons.exception.ObjectNotFoundException- when ownerId doesn't exisits
-
getFavoriteFileIds
List<String> getFavoriteFileIds(DocumentNodeFilter filter, int offset, int limit, long userIdentityId) throws IllegalAccessException - Parameters:
filter-DocumentFavoriteFilterthat contains filtering criteriaoffset- Offset of the result listlimit- Limit of the result listuserIdentityId-Identitytechnical identifier of the user acessing files- Returns:
ListofAbstractNodeidentifiers- Throws:
IllegalAccessException- when the user isn't found
-
getBiggestDocuments
List<AbstractNode> getBiggestDocuments(long ownerId, org.exoplatform.social.core.identity.model.Identity userIdentity, 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 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:
ownerId-Identitytechnical identifier of the where search filesuserIdentity-Identitytechnical identifier of the user acessing filesoffset- Offset of the result listlimit- Limit of the result list- Returns:
ListofFileNode- Throws:
IllegalAccessException- when the user isn't allowed to access documents of the designated ownerIdorg.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-DocumentTimelineFilterthat contains filtering criteriauserIdentityId-Identitytechnical identifier of the user acessing files- Returns:
ListofAbstractNode- Throws:
IllegalAccessException- when the user isn't allowed to access documents of the designated ownerIdorg.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-DocumentFolderFilterthat contains filtering criteriaoffset- Offset of the result listlimit- Limit of the result listuserIdentityId-Identitytechnical identifier of 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, long authenticatedUserId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException Retrieves breadcrumb of the given node.- Parameters:
folderId- Id of the given folderauthenticatedUserId- of the user acessing files- Returns:
ListofBreadCrumbItem- 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, long authenticatedUserId, boolean withChildren, boolean showHidden) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException Retrieves tree of the given node.- Parameters:
folderId- Id of the given folderdestinationFolderPath- destination folder to add to the treeauthenticatedUserId- of the user acessing fileswithChildren- get all children- Returns:
ListofFullTreeItem- Throws:
IllegalAccessException- when the user isn't allowed to access documents of the designated parentFolderIdorg.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 fileauthenticatedUserId- of 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, long authenticatedUserId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException Copy the given node.- Parameters:
nodeId- Id of the given filedestintionNodeId- Id of the destination folderauthenticatedUserId- of 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
-
createDocumentFromTemplateDocument
AbstractNode createDocumentFromTemplateDocument(long ownerId, String templateDocumentId, String destinationFolderId, String title, long authenticatedUserId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException, org.exoplatform.commons.ObjectAlreadyExistsException Creates a document from a template document, in one call: the copy is created under the given title in the destination folder and one document creation is recorded, whether the user kept the proposed name or changed it. The Documents app's Duplicate and copy-paste keepcopyDocument(String, String, long)and record nothing.- Parameters:
ownerId- owner identity id, used when destinationFolderId is blanktemplateDocumentId- identifier of the template document nodedestinationFolderId- identifier of the destination folder nodetitle- title the user gave, with or without the template's extensionauthenticatedUserId- identity id of the user creating the document- Returns:
- the created
AbstractNode, the copy itself - Throws:
IllegalAccessException- when the user may not add a document to the destination folderorg.exoplatform.commons.exception.ObjectNotFoundException- when the template document or the destination folder doesn't existorg.exoplatform.commons.ObjectAlreadyExistsException- when the destination folder already holds a node of the computed name
-
moveDocument
void moveDocument(long ownerId, String fileId, String destPath, long authenticatedUserId, String conflictAction) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException, org.exoplatform.commons.ObjectAlreadyExistsException Move the given node.- Parameters:
fileId- Id of the given fileauthenticatedUserId- of the user accessing 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 existorg.exoplatform.commons.ObjectAlreadyExistsException- when file with same name already exists in the target path
-
deleteDocument
void deleteDocument(String documentPath, String documentId, boolean favorite, long delay, long authenticatedUserId) throws IllegalAccessException Delete a document.- Parameters:
documentPath- the path of documentdocumentId- the Id of documentfavorite- Is favorite documentdelay- the delay to apply the delete atcionauthenticatedUserId- of the user acessing files- Throws:
IllegalAccessException- when the user isn't allowed to delete document
-
undoDeleteDocument
Undo delete a document (Cancel the delete action).- Parameters:
documentId- the Id of documentauthenticatedUserId- of the user acessing files
-
deleteDocuments
void deleteDocuments(int actionId, List<AbstractNode> documents, long authenticatedUserId) throws IllegalAccessException Delete a list of documents.- Parameters:
documents- the list documentauthenticatedUserId- of the user acessing files- Throws:
IllegalAccessException
-
downloadDocuments
void downloadDocuments(int actionId, List<AbstractNode> documents, long authenticatedUserId) throws IllegalAccessException Download a list of documents.- Parameters:
documents- the list documentauthenticatedUserId- of the user accessing files- Throws:
IllegalAccessException
-
updatePermissions
void updatePermissions(String documentId, NodePermission nodePermissionEntity, long authenticatedUserId) throws IllegalAccessException Writes the document's access list and shares it with the identities ofNodePermission#toShare. The space of the document decides the whole request before anything is written, for a user who may edit the document: "Limit Access Management" ascheckCanManageAccess(String, long, String), then "Keep documents inside the space", which refuses an identity outside the space, everyone included, that the request adds to the document's stored access list or shares it with. A membership of a group the stored list already reaches, whatever its type, is not counted as added.- Parameters:
documentId- the document's identifiernodePermissionEntity- the access list to write and the shares to makeauthenticatedUserId- the social identity id of the user changing it- Throws:
DocumentSharingRefusedException- when the space refuses the changeIllegalAccessException- when the user is unknown or cannot edit the document
-
notifyMember
- Throws:
IllegalAccessException
-
createFolder
AbstractNode createFolder(long ownerId, String folderId, String folderPath, String name, long authenticatedUserId) throws IllegalAccessException, org.exoplatform.commons.ObjectAlreadyExistsException, org.exoplatform.commons.exception.ObjectNotFoundException - Throws:
IllegalAccessExceptionorg.exoplatform.commons.ObjectAlreadyExistsExceptionorg.exoplatform.commons.exception.ObjectNotFoundException
-
createFolderPath
AbstractNode createFolderPath(String folderId, List<String> titles, long authenticatedUserId) throws IllegalAccessException, org.exoplatform.commons.ObjectAlreadyExistsException, org.exoplatform.commons.exception.ObjectNotFoundException Creates the last folder of a path of folder titles under a folder, each folder before it reused when it exists, created otherwise, asDocumentFileStorage.createFolderPath(String, List, Identity)describes.- Parameters:
folderId- the folder the path starts undertitles- the folder titles, the first under that folderauthenticatedUserId- the identity id of the user creating them- Returns:
- the last folder of the path, created
- Throws:
IllegalAccessException- when the user can't add a missing folderorg.exoplatform.commons.ObjectAlreadyExistsException- when the last folder exists alreadyorg.exoplatform.commons.exception.ObjectNotFoundException- when the starting folder can't be found
-
createDocumentFromTemplate
AbstractNode createDocumentFromTemplate(long ownerId, String folderId, String folderPath, String title, String documentType, long authenticatedUserId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException, org.exoplatform.commons.ObjectAlreadyExistsException Creates a new empty office document (Word/Excel/PowerPoint/ODF) from the platform's blank template, delegating to the ecmsDocumentService.- Parameters:
ownerId- owner identity id (used when folderId is blank)folderId- identifier of the parent folder nodefolderPath- optional relative path under the parent foldertitle- document title (should already include the file extension)documentType- office document extension (docx, xlsx, pptx, odt, ods, odp)authenticatedUserId- identity id of the user creating the document- Returns:
- the created
AbstractNode - Throws:
IllegalAccessExceptionorg.exoplatform.commons.exception.ObjectNotFoundExceptionorg.exoplatform.commons.ObjectAlreadyExistsException
-
getNewName
String getNewName(long ownerId, String folderId, String folderPath, String name) 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 name, long authenticatedUserId) throws IllegalAccessException, org.exoplatform.commons.ObjectAlreadyExistsException, org.exoplatform.commons.exception.ObjectNotFoundException - Throws:
IllegalAccessExceptionorg.exoplatform.commons.ObjectAlreadyExistsExceptionorg.exoplatform.commons.exception.ObjectNotFoundException
-
canAccess
-
checkCanManageAccess
void checkCanManageAccess(String documentId, long userIdentityId, String action) throws IllegalAccessException Refuses a change of the document's access, its public link included, that its space's "Limit Access Management" setting forbids to the user. The decision reads the space's committed settings and roles.- Parameters:
documentId- the document's identifieruserIdentityId- the social identity id of the user changing itaction- the change, one of theDocumentSharingRefusedExceptionactions- Throws:
DocumentSharingRefusedException- when the space refuses the changeIllegalAccessException- when the user is unknown
-
checkCanCreatePublicLink
Refuses the creation, or the update, of the document's public link when its space forbids it to the user: "Limit Access Management" ascheckCanManageAccess(String, long, String), then "Keep documents inside the space", which refuses every public link. The decision reads the space's committed settings once.- Parameters:
documentId- the document's identifieruserIdentityId- the social identity id of the user creating the link- Throws:
DocumentSharingRefusedException- when the space refuses the linkIllegalAccessException- when the user is unknown
-
isKeptInsideSpace
- Parameters:
documentId- the document's identifier- Returns:
- whether the document's space keeps its documents inside, on the space's committed settings; true when they cannot be read
-
getSpaceAccess
- Parameters:
documentId- the document's identifieruserIdentityId- the social identity id of the user- Returns:
- whether the document's space lets the user change its access list, and whether it keeps its documents inside, both decided on one read of the space's committed settings and roles; a document whose space or settings cannot be read refuses both
-
getAclUserIdentity
org.exoplatform.services.security.Identity getAclUserIdentity(String userName) throws IllegalAccessException - Throws:
IllegalAccessException
-
updateDocumentDescription
default void updateDocumentDescription(long ownerId, String documentID, String description, long aclIdentity) throws IllegalStateException, IllegalAccessException, javax.jcr.RepositoryException - Throws:
IllegalStateExceptionIllegalAccessExceptionjavax.jcr.RepositoryException
-
updateAudioTranscription
default void updateAudioTranscription(String documentId, String transcription, long aclIdentity) throws IllegalAccessException Updates the Text transcription of a Document- Parameters:
documentId- Video or Audio UUIDtranscription- Media Audio Transcription TextaclIdentity- current user Identity- Throws:
IllegalAccessException- when the current user can't edit the designated document
-
updateAudioTranscription
-
getAudioTranscription
default String getAudioTranscription(String documentId, long aclIdentity) throws IllegalAccessException A previously saved media Text transcription content- Parameters:
documentId- Video or Audio UUIDaclIdentity- current user Identity- Returns:
- the transcription text
- Throws:
IllegalAccessException- when the current user can't access the designated document
-
getAudioTranscription
-
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- conflictAction- 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
-
canAddDocument
-
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, long userIdentityId) throws IllegalAccessException Move list of documents in bulk- Parameters:
actionId- action idownerId- owner iddocuments- list of documents to movedestPath- destination pathuserIdentityId- current user identity id- Throws:
IllegalAccessException
-
canImport
boolean canImport(org.exoplatform.services.security.Identity identity) Check if the current user can import documents from zip- Parameters:
identity- Current user Identity
-
getDocumentsSizeStat
DocumentsSize getDocumentsSizeStat(long ownerId, long userIdentityId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException Get the total size of a space or user drive- Parameters:
ownerId- Id of the owner Identity- Returns:
- the document size object
- Throws:
IllegalAccessExceptionorg.exoplatform.commons.exception.ObjectNotFoundException
-
addDocumentsSizeStat
DocumentsSize addDocumentsSizeStat(long ownerId, long userIdentityId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException Calculate total size of a space or user drive and store the result in new analytics entry- Parameters:
ownerId- Id of the owner IdentityuserIdentityId- current user identity id- Returns:
- the document size object
- Throws:
IllegalAccessExceptionorg.exoplatform.commons.exception.ObjectNotFoundException
-
hasEditPermissionOnDocument
boolean hasEditPermissionOnDocument(String nodeId, long userIdentityId) throws IllegalAccessException Checks if user has edit permission on document- Parameters:
nodeId- document node iduserIdentityId- user identity id- Returns:
- true if has edit permission or false
- Throws:
IllegalAccessException
-
hasEditPermissionOnDocument
boolean hasEditPermissionOnDocument(String nodeId, org.exoplatform.services.security.Identity aclIdentity) - Parameters:
nodeId-AbstractNodetechnical identifieraclIdentity- UserIdentity- Returns:
- true if has edit permission, else false
-
importFiles
void importFiles(String ownerId, String folderId, String folderPath, String uploadId, String conflict, org.exoplatform.services.security.Identity identity, long authenticatedUserId) throws Exception Import list of documents from an uploaded zip- Parameters:
ownerId- owner idfolderId- folder idfolderPath- folder pathuploadId- upload idconflict- conflict ruleidentity- current user identityauthenticatedUserId- current user identity id- Throws:
Exception
-
getDeletedDocuments
List<TrashElementNode> getDeletedDocuments(TrashElementNodeFilter trashElementNodeFilter) throws javax.jcr.RepositoryException Retrieves a list of trash elements that match the specified filter.- Parameters:
trashElementNodeFilter- the filter used to find trash elements- Returns:
- a list of nodes representing the trash elements
- Throws:
javax.jcr.RepositoryException- if an error occurs while accessing the repository
-
countDeletedDocuments
int countDeletedDocuments()Counts the total number of deleted documents in the trash.- Returns:
- the total count of deleted documents
-
restoreDocumentFromTrash
Restores a document from the trash based on the specified trash node path.- Parameters:
trashNodePath- the path of the trash node to restore- Throws:
javax.jcr.RepositoryException- if an error occurs during the restoration process
-
deleteDocumentPermanently
void deleteDocumentPermanently(String documentPath) throws org.exoplatform.commons.exception.ObjectNotFoundException, javax.jcr.RepositoryException Delete a document from the trash based on the specified trash node path.- Parameters:
documentPath- the path of the trash node to delete- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- if a document not exist in the trashjavax.jcr.RepositoryException- if an error occurs during the delete process
-
deleteDocumentsPermanently
void deleteDocumentsPermanently(int actionId, List<AbstractNode> trashElementNodes, long userIdentityId) throws IllegalAccessException Delete a list of documents from the trash.- Parameters:
actionId- the delete permanently action identifiertrashElementNodes- the list of the trash nodes to deleteuserIdentityId- the user identity identifier- Throws:
IllegalAccessException
-
restoreDocuments
void restoreDocuments(int actionId, List<AbstractNode> trashElementNodes, long userIdentityId) throws IllegalAccessException Restore a list of documents from the trash.- Parameters:
actionId- the restore action identifiertrashElementNodes- the list of the trash nodes to restoreuserIdentityId- the user identity identifier- Throws:
IllegalAccessException
-
getImageThumbnailContent
io.meeds.portal.thumbnail.model.FileContent getImageThumbnailContent(String fileType, String documentId, String userName, int width, int height) throws Exception Get image thumbnail content, always at the one preview size the documents clients display, whatever width and height are asked: this read stores no thumbnail at any other size.- Parameters:
fileType- the file typedocumentId- the document IduserName- the user namewidth- the width asked, not used to size the thumbnailheight- the height asked, not used to size the thumbnail- Throws:
Exception
-
createThumbnail
org.exoplatform.commons.file.model.FileItem createThumbnail(String fileType, io.meeds.portal.thumbnail.model.FileContent fileContent, String userName, int width, int height) throws Exception Create thumbnail for given image, always at the one preview sizegetImageThumbnailContent(String, String, String, int, int)reads, whatever width and height are asked.- Parameters:
fileType- the file typefileContent- the FileContent objectuserName- the user namewidth- the width asked, not used to size the thumbnailheight- the height asked, not used to size the thumbnail- Throws:
Exception
-
setDocumentVisibility
-
getDocumentCategoryIds
-
getDocumentCategoryIds
-
getSpaceRootFolder
default FolderNode getSpaceRootFolder(long spaceId, org.exoplatform.services.security.Identity aclIdentity) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException Retrieves the Root folder Path of a Space- Parameters:
spaceId-Spacetechnical identifieraclIdentity- user willing to access the space's root folder- Returns:
- the root
FolderNodefor the designated space - Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the space doesn't existIllegalAccessException- when the user isn't allowed to access documents of the designated space
-
getPersonalRootFolder
Retrieves the Root folder Path of a user- Parameters:
aclIdentity- user willing to access his/her own root folder- Returns:
- the root
FolderNodefor the designated user
-
getRootFolderOwnerId
Return the root folder ownerIdentityid- Parameters:
documentId- JCR Node Id by example- Returns:
Identityid
-
getFileContentAsText
-
getFileTextContent
Returns the text of a document file, from the search index when it already holds it, else extracted from the file itself, and when there is none, why. No permission is checked here: the caller checks the user can access the document first.- Parameters:
documentId- Document identifier- Returns:
- the text of the file and where it came from, or why there is none
-
getFileContentAsStream
Returns a document file content as Stream- Parameters:
documentId- Document identifieruserIdentityId- User Identity identifier accessing the file binary- Returns:
- the file binary
-
synchronizeSpacePermissions
void synchronizeSpacePermissions(org.exoplatform.social.core.space.model.Space space) Synchronizes JCR node permissions for a space, automatically detecting whether the space is in redactional mode based onSpace. Rewrites node ACLs from open to redactional or vice versa when the space still has standard (uncustomized) permissions.- Parameters:
space- Space
-