response.setGetAttachmentsResponse(atts);
return XmlTooling.convertDocument(response);
}
private static Attachment transformAttachment(org.intalio.tempo.workflow.task.attachments.Attachment attachment) {
AttachmentMetadataImpl metadata = (AttachmentMetadataImpl) com.intalio.bpms.workflow.taskManagementServices20051109.AttachmentMetadata.Factory
.newInstance();
AttachmentMetadata data = attachment.getMetadata();
Calendar cal = Calendar.getInstance();
cal.setTime(data.getCreationDate());
metadata.setCreationDate(cal);
metadata.setDescription(data.getDescription());
metadata.setFileName(data.getFileName());
metadata.setMimeType(data.getMimeType());
metadata.setTitle(data.getTitle());
Attachment att = (Attachment) Attachment.Factory.newInstance();
att.setAttachmentMetadata(metadata);
att.setPayloadUrl(attachment.getPayloadURL().toString());
return att;