Examples of AttachmentMetaData


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

    public static void main(String[] args) {
        junit.textui.TestRunner.run(AttachmentMarshallerTest.class);
    }

    public void testAttachmentMarshaller() throws Exception {
        Attachment attachment1 = new Attachment(new AttachmentMetadata(), new URL("http://localhost/a1"));
        OMElement att = AttachmentMarshaller.marshalAttachment(attachment1);

        _logger.debug(TestUtils.toPrettyXML(att));
    }
View Full Code Here

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

        _logger.debug(TestUtils.toPrettyXML(att));
    }

    public void testAttachmentsMarshaller() throws Exception {
        Attachment[] attachments = new Attachment[2];
        Attachment attachment1 = new Attachment(new AttachmentMetadata(), new URL("http://localhost/a1"));
        Attachment attachment2 = new Attachment(new AttachmentMetadata(), new URL("http://localhost/a2"));
        attachments[0] = attachment1;
        attachments[1] = attachment2;
        OMElement att = AttachmentMarshaller.marshalAttachments(attachments);

        _logger.debug(TestUtils.toPrettyXML(att));
View Full Code Here

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

      Assert.assertFalse(task.isAvailableTo(niko));
    }

    public void testAttachments() throws Exception {
        PATask task = this.createPATask();
        Attachment attachment = new Attachment(new AttachmentMetadata(), new URL("http://localhost/a1"));
        Assert.assertNull(task.addAttachment(attachment));
        Assert.assertTrue(task.getAttachments().size() == 1);
        Assert.assertEquals(attachment, task.getAttachments().iterator().next());
        Assert.assertEquals(attachment, task.removeAttachment(attachment.getPayloadURL()));
        Assert.assertTrue(task.getAttachments().isEmpty());
View Full Code Here

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

        task.getUserOwners().add("test/user1");
        task.getRoleOwners().add("test.role1");
        task.getRoleOwners().add("test\\role2");
        task.setOutput(TestUtils.createXMLDocument());
     
        task.addAttachment(new Attachment(new AttachmentMetadata(), new URL("http://localhost/url1")));
        AttachmentMetadata metadata = new AttachmentMetadata();
        metadata.setMimeType("image/jpeg");
        task.addAttachment(new Attachment(metadata, new URL("http://localhost/url2")));

        this.testTaskMarshalling(task);
    }
View Full Code Here

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

        task.getUserOwners().add("test/user1");
        task.getRoleOwners().add("test.role1");
        task.getRoleOwners().add("test\\role2");
        task.setOutput(TestUtils.createXMLDocument());

        task.addAttachment(new Attachment(new AttachmentMetadata(), new URL("http://localhost/url1")));
        AttachmentMetadata metadata = new AttachmentMetadata();
        metadata.setMimeType("image/jpeg");
        task.addAttachment(new Attachment(metadata, new URL("http://localhost/url2")));

        this.testTaskMetadataMarshalling(task, null);
    }
View Full Code Here

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

        task.setPriority(1);
        task.setProcessID("processID1");
        task.authorizeActionForUser("claim", "test/user1");
        task.authorizeActionForRole("revoke", "test/role1");

        task.addAttachment(new Attachment(new AttachmentMetadata(), new URL("http://localhost/url1")));
        AttachmentMetadata metadata = new AttachmentMetadata();
        metadata.setMimeType("image/jpeg");
        task.addAttachment(new Attachment(metadata, new URL("http://localhost/url2")));

        this.testTaskMarshalling(task);
   
View Full Code Here

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

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

          
           }
          
           @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

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

                        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

Examples of org.jboss.profileservice.persistence.repository.metadata.AttachmentMetaData

      {
         attachments = new ArrayList<AttachmentMetaData>();
         repositoryMetaData.setAttachments(attachments);
      }
      // Extract the attachment
      AttachmentMetaData attachment = null;
      for(AttachmentMetaData a : attachments)
      {
         if(attachmentName.equals(a.getName()))
            attachment = a;
      }

      // Create a new one
      if(attachment == null)
      {
         // Create attachment meta data
         attachment = new AttachmentMetaData();
         // Add attachment meta data
         attachments.add(attachment);
      }

      // Is attachmentName the same as the className ?
      attachment.setName(attachmentName);
      attachment.setClassName(managedObject.getAttachment().getClass().getName());

      // Save the attachment
      String attachmentPath = deploymentPath + attachment.getName();
      // Create the persistence information
      PersistenceRoot persistenceRoot = getSerializer().loadAttachment(attachmentPath, PersistenceRoot.class);
      //
      persistenceRoot = createPersistedMetaData(persistenceRoot, managedObject, component, remove);
      // Serialize the attachment
      getSerializer().saveAttachment(attachmentPath, persistenceRoot);

      // Update the last modified.
      long lastModified = System.currentTimeMillis();
      attachment.setLastModified(lastModified);
      repositoryMetaData.setLastModified(lastModified);

      //  Save the updated repository meta data
      getSerializer().saveAttachment(getMetaDataPathName(deploymentPath), repositoryMetaData);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.