Interface ProcessesAttachmentService


public interface ProcessesAttachmentService
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    copyAttachmentsToEntity(Long userId, Long sourceEntityId, String sourceEntityType, Long destEntityId, String destEntityType, Long projectId)
    Copy attachments from source entity to a dest entity
    org.exoplatform.services.attachments.model.Attachment
    createNewFormDocument(Long userIdentityId, String title, String path, String pathDrive, String templateName, String entityType, Long entityId)
    Creates a new onlyoffice document form
    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 by selectProcessAttachments(long, long, long, Attachment[]), or a document the user has just created
    void
    moveAttachmentsToEntity(Long userId, Long sourceEntityId, String sourceEntityType, Long destEntityId, String destEntityType, Long projectId)
    Move attachments from source entity to a dest entity
    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 by selectRequestAttachments(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 by selectProcessAttachments(long, long, long, Attachment[]), or a document the user has just created
      Parameters:
      attachments - list of attachments
      userId - user identity id
      entityId - entity id
      entityType - entity type
      projectId - 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 id
      sourceEntityId - source entity of attachments
      sourceEntityType - target entity type to attach files from source entity
      destEntityId - target entity id
      destEntityType - target entity type
      projectId - 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 by selectRequestAttachments(long, long, long, long, List)
      Parameters:
      attachments - list of attachment
      userId - user identity id
      sourceEntityId - source entity of attachments
      sourceEntityType - target entity type to attach files from source entity
      destEntityId - target entity id
      destEntityType - target entity type
      projectId - 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 id
      sourceEntityId - source entity of attachments
      sourceEntityType - target entity type to attach files from source entity
      destEntityId - target entity id
      destEntityType - target entity type
      projectId - 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 user
      draftId - id of the request draft
      workflowId - id of the draft's process
      projectId - task project id of the draft's process
      sentAttachments - 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 user
      workflowId - id of the process, 0 for a process to create
      projectId - task project id of the process, 0 for a process to create
      sentAttachments - 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 id
      title - document title
      path - document path
      pathDrive - drive path
      templateName - document template name
      entityType - entity type to attach created document
      entityId - entity id
      Returns:
      Attachment
      Throws:
      Exception