Interface ProcessesAttachmentService
public interface ProcessesAttachmentService
-
Method Summary
Modifier and TypeMethodDescriptionvoidcopyAttachmentsToEntity(Long userId, Long sourceEntityId, String sourceEntityType, Long destEntityId, String destEntityType, Long projectId) Copy attachments from source entity to a dest entityorg.exoplatform.services.attachments.model.AttachmentcreateNewFormDocument(Long userIdentityId, String title, String path, String pathDrive, String templateName, String entityType, Long entityId) Creates a new onlyoffice document formvoidlinkAttachmentsToEntity(org.exoplatform.services.attachments.model.Attachment[] attachments, Long userId, Long entityId, String entityType, Long projectId) Links a list of attachments to entity, moving or copying their files with the platform's rights: the caller passes only attachments selected byselectProcessAttachments(long, long, long, Attachment[]), or a document the user has just createdvoidmoveAttachmentsToEntity(Long userId, Long sourceEntityId, String sourceEntityType, Long destEntityId, String destEntityType, Long projectId) Move attachments from source entity to a dest entityvoidmoveAttachmentsToEntity(List<org.exoplatform.services.attachments.model.Attachment> attachments, Long userId, Long sourceEntityId, String sourceEntityType, Long destEntityId, String destEntityType, Long projectId) Move attachments from source entity to a dest entity, with the platform's rights: the caller passes only attachments selected byselectRequestAttachments(long, long, long, long, List)org.exoplatform.services.attachments.model.Attachment[]selectProcessAttachments(long userId, long workflowId, long projectId, org.exoplatform.services.attachments.model.Attachment[] sentAttachments) Selects, among the attachments sent for a process, the ones to link to it.List<org.exoplatform.services.attachments.model.Attachment> selectRequestAttachments(long userId, long draftId, long workflowId, long projectId, List<org.exoplatform.services.attachments.model.Attachment> sentAttachments) Selects the attachments a request created from a draft takes: the attachments stored on the draft, never a list the client sends.
-
Method Details
-
linkAttachmentsToEntity
void linkAttachmentsToEntity(org.exoplatform.services.attachments.model.Attachment[] attachments, Long userId, Long entityId, String entityType, Long projectId) Links a list of attachments to entity, moving or copying their files with the platform's rights: the caller passes only attachments selected byselectProcessAttachments(long, long, long, Attachment[]), or a document the user has just created- Parameters:
attachments- list of attachmentsuserId- user identity identityId- entity identityType- entity typeprojectId- task project id
-
moveAttachmentsToEntity
void moveAttachmentsToEntity(Long userId, Long sourceEntityId, String sourceEntityType, Long destEntityId, String destEntityType, Long projectId) Move attachments from source entity to a dest entity- Parameters:
userId- user identity idsourceEntityId- source entity of attachmentssourceEntityType- target entity type to attach files from source entitydestEntityId- target entity iddestEntityType- target entity typeprojectId- task project id
-
moveAttachmentsToEntity
void moveAttachmentsToEntity(List<org.exoplatform.services.attachments.model.Attachment> attachments, Long userId, Long sourceEntityId, String sourceEntityType, Long destEntityId, String destEntityType, Long projectId) Move attachments from source entity to a dest entity, with the platform's rights: the caller passes only attachments selected byselectRequestAttachments(long, long, long, long, List)- Parameters:
attachments- list of attachmentuserId- user identity idsourceEntityId- source entity of attachmentssourceEntityType- target entity type to attach files from source entitydestEntityId- target entity iddestEntityType- target entity typeprojectId- task project id
-
copyAttachmentsToEntity
void copyAttachmentsToEntity(Long userId, Long sourceEntityId, String sourceEntityType, Long destEntityId, String destEntityType, Long projectId) Copy attachments from source entity to a dest entity- Parameters:
userId- user identity idsourceEntityId- source entity of attachmentssourceEntityType- target entity type to attach files from source entitydestEntityId- target entity iddestEntityType- target entity typeprojectId- task project id
-
selectRequestAttachments
List<org.exoplatform.services.attachments.model.Attachment> selectRequestAttachments(long userId, long draftId, long workflowId, long projectId, List<org.exoplatform.services.attachments.model.Attachment> sentAttachments) throws IllegalAccessException Selects the attachments a request created from a draft takes: the attachments stored on the draft, never a list the client sends. An attachment the process's attachment list returns, which lists a shortcut and its target once, is kept without the user's read check and copied, never moved: the draft copy hands the process's attachments to every requester, and leaves the original id on the draft when a copy fails. Any other attachment in the draft's folder,workdraft/<draftId>at the root of the drive of an existing space, where the processes place the draft's copies of the process attachments, is kept and moved. Any other one must be readable by the user, and is moved only when the user may remove it and didn't pick it from a drive, otherwise copied. Nothing is written.- Parameters:
userId- identity id of the user creating the request, the current userdraftId- id of the request draftworkflowId- id of the draft's processprojectId- task project id of the draft's processsentAttachments- attachments the client sent, read only to know which ones were picked from a drive- Returns:
- the attachments to move or copy, a copy being marked by
Attachment.isEXoDrive() - Throws:
IllegalAccessException- when the user can't read one of the draft's attachments the process doesn't hold, or isn't the current user while the draft has one
-
selectProcessAttachments
org.exoplatform.services.attachments.model.Attachment[] selectProcessAttachments(long userId, long workflowId, long projectId, org.exoplatform.services.attachments.model.Attachment[] sentAttachments) throws IllegalAccessException Selects, among the attachments sent for a process, the ones to link to it. An attachment the processes placed in the process folder is kept; any other one must be readable by the user, and is moved only when the user may remove it and didn't pick it from a drive, otherwise copied. On an update, an attachment the process's attachment list already holds is left as it is, whatever the user's rights on it: it is neither linked again, nor moved, nor copied. A linked attachment that list leaves out, such as a trashed or quarantined one, or the second of a shortcut and its target, which it lists once, is selected like one not linked yet. Nothing is written.- Parameters:
userId- identity id of the user creating or updating the process, the current userworkflowId- id of the process, 0 for a process to createprojectId- task project id of the process, 0 for a process to createsentAttachments- attachments the client sent- Returns:
- the attachments to link, move or copy, a copy being marked by
Attachment.isEXoDrive() - Throws:
IllegalAccessException- when the user can't read an attachment the process's attachment list doesn't hold, or isn't the current user while such an attachment is sent
-
createNewFormDocument
org.exoplatform.services.attachments.model.Attachment createNewFormDocument(Long userIdentityId, String title, String path, String pathDrive, String templateName, String entityType, Long entityId) throws Exception Creates a new onlyoffice document form- Parameters:
userIdentityId- user identity idtitle- document titlepath- document pathpathDrive- drive pathtemplateName- document template nameentityType- entity type to attach created documententityId- entity id- Returns:
Attachment- Throws:
Exception
-