Examples of AttachmentMetaData


Examples of org.intalio.tempo.workflow.tas.core.AttachmentMetadata

     * Stores a simple text file
     *
     * @throws Exception
     */
    public void testStorage() throws Exception {
        AttachmentMetadata metadata = new AttachmentMetadata();
        metadata.setMimeType("text/plain");
        String string = "hello.txt";
        metadata.setFilename(string);
        String url = _service.add(_credentials, metadata, "Hello world!".getBytes("UTF-8"));
        System.out.println("URL: " + url);
        _service.delete(_credentials, url);
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.tas.core.AttachmentMetadata

     * Stores an xml file
     *
     * @throws Exception
     */
    public void testStoreXmlFile() throws Exception {
        AttachmentMetadata metadata = new AttachmentMetadata();
        metadata.setMimeType("text/xml");
        metadata.setFilename("log4j.xml");
        String url = _service.add(_credentials, metadata, this.getClass().getResource("/log4j.xml").toExternalForm());
        _service.delete(_credentials, url);
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.tas.core.AttachmentMetadata

                new WDSStorageStrategy(_WDS_ENDPOINT));
    }

    public void testWDSStorage() throws Exception {
       
        AttachmentMetadata metadata = new AttachmentMetadata();
        metadata.setMimeType("text/plain");
        metadata.setFilename("hello.txt");
       
        String url = _service.add(_credentials, metadata, "Hello world!".getBytes("UTF-8"));
       
        _logger.debug("URL: " + url);
       
View Full Code Here

Examples of org.intalio.tempo.workflow.tas.core.AttachmentMetadata

    /**
     * Parses a <code>tas:attachmentMetadata</code> element into an {@link AttachmentMetadata} object.
     */
    private static AttachmentMetadata parseAttachmentMetadata(OMElement metadataElement)
            throws InvalidMessageFormatException {
        AttachmentMetadata metadata = new AttachmentMetadata();
        String mimeType = _xpathHelper.getRequiredString(metadataElement, "tas:mimeType").trim();
        metadata.setMimeType(mimeType);
        String filename = _xpathHelper.getRequiredString(metadataElement, "tas:filename").trim();
        metadata.setFilename(filename);
        return metadata;
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.tas.core.AttachmentMetadata

    public OMElement add(OMElement addRequestElement) throws AxisFault {
        try {
            _logger.debug("Request: add");

            OMElement metadataElement = _xpathHelper.getRequiredElement(addRequestElement, "tas:attachmentMetadata");
            AttachmentMetadata metadata = TASAxis2Bridge.parseAttachmentMetadata(metadataElement);

            OMElement credentialElement = _xpathHelper.getRequiredElement(addRequestElement, "tas:authCredentials");
            AuthCredentials credentials = TASAxis2Bridge.parseAuthCredentials(credentialElement);

            OMElement localFileUrlElement = _xpathHelper.getElement(addRequestElement, "tas:localFileURL");
View Full Code Here

Examples of org.intalio.tempo.workflow.tas.live.TasStub.AttachmentMetadata

    DataHandler h = new DataHandler(new ByteArrayDataSource(bytes, "base64"));
    choice.setPayload(h);
    req.setAddRequestChoice_type0(choice);

    // add the TAS metadata
    AttachmentMetadata meta = new AttachmentMetadata();
    meta.setFilename(fileName);
    meta.setMimeType(mimetype);
    req.setAttachmentMetadata(meta);
   
    // add TAS credentials
    AuthCredentials cred = new AuthCredentials();
    AuthorizedRoles_type0 roles = new AuthorizedRoles_type0();
View Full Code Here

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

        String task1ID = nextRandom();
        PATask task1 = new PATask(task1ID, new URI("http://localhost/1"), "processID", "urn:completeSOAPAction", Utils.createXMLDocument());
        task1.getUserOwners().add("test.system-test");
        task1.getUserOwners().add("intalio\\admin");
        Attachment attachment1 = new Attachment(new AttachmentMetadata(), new URL("http://localhost/a1"));
        task1.addAttachment(attachment1);
        Attachment attachment2 = new Attachment(new AttachmentMetadata(), new URL("http://localhost/a2"));
        task1.addAttachment(attachment2);
        tms.create(task1);

        PATask task2 = (PATask) tms.getTask(task1.getID());
        Assert.assertEquals(2, task2.getAttachments().size());
View Full Code Here

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

        OMElementQueue rootQueue = new OMElementQueue(rootElement);

        OMElement metadataElement = this.requireElement(rootQueue, "attachmentMetadata");
        OMElementQueue metadataQueue = new OMElementQueue(metadataElement);

        AttachmentMetadata metadata = new AttachmentMetadata();
        String mimeType = this.expectElementValue(metadataQueue, "mimeType");
        if (mimeType != null) {
            metadata.setMimeType(mimeType);
        }
        String fileName = this.expectElementValue(metadataQueue, "fileName");
        if (fileName != null) {
            metadata.setFileName(fileName);
        }
        String title = this.expectElementValue(metadataQueue, "title");
        if (title != null) {
            metadata.setTitle(title);
        }
        String description = this.expectElementValue(metadataQueue, "description");
        if (description != null) {
            metadata.setDescription(description);
        }
        String creationDateStr = this.expectElementValue(metadataQueue, "creationDate");
        if ((creationDateStr != null) && ! ("".equals(creationDateStr))) {
            metadata.setCreationDate(new XsdDateTime(creationDateStr).getTime());
        }

        String payloadURLStr = this.requireElementValue(rootQueue, "payloadUrl");
        return new Attachment(metadata, payloadURLStr);
    }
View Full Code Here

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

                com.intalio.bpms.workflow.taskManagementServices20051109.Attachment xmlAttachment = xmlAttachments
                        .addNewAttachment();
                com.intalio.bpms.workflow.taskManagementServices20051109.AttachmentMetadata xmlAttachmentMetadata = xmlAttachment
                        .addNewAttachmentMetadata();

                AttachmentMetadata metadata = attachment.getMetadata();
                xmlAttachmentMetadata.setMimeType(metadata.getMimeType());
                xmlAttachmentMetadata.setFileName(metadata.getFileName());
                xmlAttachmentMetadata.setTitle(metadata.getTitle());
                xmlAttachmentMetadata.setDescription(metadata.getDescription());
                Calendar attachmentCreateDate = Calendar.getInstance();
                attachmentCreateDate.setTime(metadata.getCreationDate());
                xmlAttachmentMetadata.setCreationDate(attachmentCreateDate);

                final URL payloadURL = attachment.getPayloadURL();
                xmlAttachment.setPayloadUrl(payloadURL.toString());
            }
View Full Code Here

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

    }

    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;
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.