Package org.activiti.rest.service.api.engine

Examples of org.activiti.rest.service.api.engine.AttachmentResponse


    }
    return result ;
  }
 
  public AttachmentResponse createAttachmentResponse(Attachment attachment, String serverRootUrl) {
    AttachmentResponse result = new AttachmentResponse();
    result.setId(attachment.getId());
    result.setName(attachment.getName());
    result.setDescription(attachment.getDescription());
    result.setType(attachment.getType());
    result.setUserId(attachment.getUserId());
   
    if (attachment.getUrl() == null && attachment.getTaskId() != null) {
      // Attachment content can be streamed
      result.setContentUrl(formatUrl(serverRootUrl, RestUrls.URL_TASK_ATTACHMENT_DATA, attachment.getTaskId(), attachment.getId()));
    } else {
      result.setExternalUrl(attachment.getUrl());
    }
   
    if (attachment.getTaskId() != null) {
      result.setUrl(formatUrl(serverRootUrl, RestUrls.URL_TASK_ATTACHMENT, attachment.getTaskId(), attachment.getId()));
      result.setTaskUrl(formatUrl(serverRootUrl, RestUrls.URL_TASK, attachment.getTaskId()));
    }
    if (attachment.getProcessInstanceId() != null) {
      result.setProcessInstanceUrl(formatUrl(serverRootUrl, RestUrls.URL_PROCESS_INSTANCE, attachment.getProcessInstanceId()));
    }
    return result ;
  }
View Full Code Here


  public AttachmentResponse createAttachment(@PathVariable String taskId, HttpServletRequest request, HttpServletResponse response) {
   
    String serverRootUrl = request.getRequestURL().toString();
    serverRootUrl = serverRootUrl.substring(0, serverRootUrl.indexOf("/runtime/tasks/"));
   
    AttachmentResponse result = null;
    Task task = getTaskFromRequest(taskId);
    if (request instanceof MultipartHttpServletRequest) {
      result = createBinaryAttachment((MultipartHttpServletRequest) request, task, serverRootUrl, response);
    } else {
     
View Full Code Here

TOP

Related Classes of org.activiti.rest.service.api.engine.AttachmentResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.