Package org.intalio.tempo.workflow.task.attachments

Examples of org.intalio.tempo.workflow.task.attachments.AttachmentMetadata


         
         @Test
         public void testAttachments() throws Exception {
          PATask task1 = new PATask(getUniqueTaskID(), new URI(
                  "http://hellonico.net"));
          AttachmentMetadata attMetadata = new AttachmentMetadata();
          Attachment att = new Attachment(attMetadata, new URL(
                  "file:///thisisadocument1.txt"));
          Attachment att2 = new Attachment(attMetadata, new URL(
                  "file:///thisisadocument2.txt"));
          task1.addAttachment(att);
          task1.addAttachment(att2);
          task1.getUserOwners().add("niko");
          persist(task1);
        
          PATask task2 = new PATask(getUniqueTaskID(), new URI(
                  "http://hellonico.net"));
          task2.getUserOwners().add("niko");
          AttachmentMetadata attMetadata2 = new AttachmentMetadata();
          Attachment att3 = new Attachment(attMetadata2, new URL(
                  "file:///thisisadocument3.txt"));
          task2.addAttachment(att3);
          persist(task2);
        
View Full Code Here


          
           }
          
           @Test
           public void attachmentsPATask() throws Exception {
            AttachmentMetadata metadata = new AttachmentMetadata();
            Attachment att = new Attachment(metadata, new URL(
                    "http://hellonico.net"));
            String id = "pa" + System.currentTimeMillis();
            PATask task1 = new PATask(id, new URI("http://hellonico.net"),
                    "processId", "soap", getXmlSampleDocument());
View Full Code Here

                        XmlCursor attCursor = attachmentElement.newCursor();
                        try {
                            if (attCursor.getTextValue().trim().length() != 0) {
                                com.intalio.bpms.workflow.taskManagementServices20051109.AttachmentMetadata attachmentMetadata = attachmentElement
                                                .getAttachmentMetadata();
                                AttachmentMetadata metadata = new AttachmentMetadata();
                                String mimeType = attachmentMetadata.getMimeType();
                                if (mimeType != null) {
                                    metadata.setMimeType(mimeType);
                                }
                                String fileName = attachmentMetadata.getFileName();
                                if (fileName != null)
                                    metadata.setFileName(fileName);
                                String title = attachmentMetadata.getTitle();
                                if (title != null)
                                    metadata.setTitle(title);
                                String description2 = attachmentMetadata.getDescription();
                                if (description2 != null)
                                    metadata.setDescription(description2);

                                try {
                                    Calendar cal = attachmentMetadata.getCreationDate();
                                    if ((cal != null)) {
                                        metadata.setCreationDate(new XsdDateTime(cal.toString()).getTime());
                                    }
                                } catch (Exception e) {
                                    _logger.warn("Error in unmarshalling creation date in attachment from metadata");
                                    metadata.setCreationDate(new Date());
                                }

                                String payloadURLStr = attachmentElement.getPayloadUrl();
                                URL payloadURL;
                                try {
View Full Code Here

TOP

Related Classes of org.intalio.tempo.workflow.task.attachments.AttachmentMetadata

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.