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 zipcreateFolder(long ownerId, String folderId, String folderPath, String name, long authenticatedUserId) 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 documentvoiddeleteDocument(String documentPath, String documentId, boolean favorite, long delay, long authenticatedUserId) Delete a document.voiddeleteDocuments(int actionId, List<AbstractNode> documents, long authenticatedUserId) Delete a list of documents.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) getBreadcrumb(long ownerId, String folderId, String folderPath, long authenticatedUserId) Retrieves breadcrumb of the given node.getDefaultView(Long ownerId, String userIdentityId) Get Stored default View for the current usergetDocumentItems(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.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 IDgetFilesTimeline(DocumentTimelineFilter filter, int offset, int limit, long userIdentityId) 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, 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, long authenticatedUserId, boolean withChildren) Retrieves breadcrumb of the given node.getGroupDocumentsCount(DocumentTimelineFilter filter, long userIdentityId) Retrieves the number of existing files by group.getNewName(long ownerId, String folderId, String folderPath, String name) booleanhasEditPermissionOnDocument(String nodeId, long userIdentityId) Checks if user has edit permission on documentvoidimportFiles(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 zipvoidmoveDocument(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) restoreVersion(String versionId, String aclIdentity) restore document versionvoidsetDefaultView(Long ownerId, String userIdentityId, String view) Set default View for the current uservoidshareDocument(String documentId, long destId, long authenticatedUserId, boolean broadcast) Shares a document with given user or spacevoidundoDeleteDocument(String documentId, long authenticatedUserId) Undo delete a document (Cancel the delete action).voidunShareDocument(String documentId, long destId) default voidupdateDocumentDescription(long ownerId, String documentID, String description, long aclIdentity) voidupdatePermissions(String documentId, NodePermission nodePermissionEntity, long authenticatedUserId) updateVersionSummary(String originFileId, String versionId, String summary, String aclIdentity) update or add a version summary
-
Method Details
-
getDocumentItems
List<AbstractNode> getDocumentItems(FileListingType listingType, DocumentNodeFilter filter, int offset, int limit, long userIdentityId, boolean showHiddenFiles) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException Retrieves a list of accessible folders and/or files, for a selected user, by applying the designated filter.- Parameters:
listingType-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
-
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
-
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, long authenticatedUserId, boolean withChildren) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException Retrieves breadcrumb of the given node.- Parameters:
folderId- Id of the given folderauthenticatedUserId- 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
-
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 - Throws:
IllegalAccessException
-
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
-
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
boolean canAccess(String documentID, org.exoplatform.services.security.Identity aclIdentity) throws javax.jcr.RepositoryException - Throws:
javax.jcr.RepositoryException
-
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
-
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
verify if current user can add document- Parameters:
spaceId- space idcurrentUserName- current user name
-
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
-
getDefaultView
Get Stored default View for the current user- Parameters:
ownerId- Id of the owner IdentityuserIdentityId- user identity id- Returns:
- the stored view
-
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
-
setDefaultView
Set default View for the current user- Parameters:
ownerId- Id of the owner IdentityuserIdentityId- user identity idview- the view to store
-
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
-
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
-