Examples of Attachment


Examples of org.cedj.geekseek.domain.attachment.model.Attachment

        return rep;
    }

    @Override
    public Attachment to(UriInfo uriInfo, AttachmentRepresentation representation) {
        Attachment attachment = new Attachment(
            representation.getTitle(),
            representation.getMimeType(),
            representation.getUrl());
        return attachment;
    }

Examples of org.codehaus.swizzle.confluence.Attachment

    public void testAddAttachment() throws Exception
    {
        String attachmentName = String.format("test_attachment_%d.png", random.nextInt());
        byte[] data = ("Data for " + attachmentName).getBytes();

        Attachment attachment = new Attachment();
        attachment.setPageId(TestConstants.TEST_PAGE_WITH_ATTACHMENTS);
        attachment.setFileName(attachmentName);

        attachment = rpc.addAttachment(0, attachment, data);

        TestUtils.banner("TEST: addAttachment()");
        System.out.format("%s\n", attachment);

        // We can't assert the file name because it can be transformed (e.g. some characters could be removed).
        assertEquals(data.length, Integer.parseInt(attachment.getFileSize()));

        // Let's see if the attachment was properly added.
        assertEquals(new String(data), new String(rpc.getAttachmentData(attachment.getPageId(), attachment
            .getFileName(), "1.1")));
    }

Examples of org.codehaus.xfire.attachments.Attachment

        InMessage res = invokeService(msg, HttpTransport.HTTP_BINDING);

        Attachments atts = res.getAttachments();
        Iterator parts = atts.getParts();
        assertTrue(parts.hasNext());
        Attachment att = (Attachment) parts.next();
       
        Document response = (Document) res.getProperty(RESPONSE);
        addNamespace("m", "http://xfire.codehaus.org/mtom");
        addNamespace("xop", "http://www.w3.org/2004/08/xop/include");
        assertValid("//s:Body/m:GetPictureResponse/m:image/xop:Include", response);

Examples of org.drools.task.Attachment

                    session.write(resultsCmnd);
                    break;
                }
                case AddAttachmentRequest: {
                    response = CommandName.AddAttachmentResponse;
                    Attachment attachment = (Attachment) cmd.getArguments().get(1);
                    Content content = (Content) cmd.getArguments().get(2);
                    taskSession.addAttachment((Long) cmd.getArguments().get(0),
                            attachment,
                            content);

                    List args = new ArrayList(2);
                    args.add(attachment.getId());
                    args.add(content.getId());
                    Command resultsCmnd = new Command(cmd.getId(),
                            CommandName.AddAttachmentResponse,
                            args);
                    session.write(resultsCmnd);

Examples of org.eclipse.persistence.internal.xr.Attachment

                    mapping.setXPath(SERVICE_NAMESPACE_PREFIX + ":" + "result");
                    descriptor.addMapping(mapping);
                    mapping.initialize((AbstractSession)dbwsAdapter.getOXSession());
                }
                else if (queryOperation.isAttachment()) {
                    Attachment attachment = queryOperation.getResult().getAttachment();
                    XMLBinaryDataMapping mapping = new XMLBinaryDataMapping();
                    mapping.setAttributeName("result");
                    mapping.setXPath(SERVICE_NAMESPACE_PREFIX + ":" + "result");
                    mapping.setSwaRef(true);
                    mapping.setShouldInlineBinaryData(false);
                    mapping.setMimeType(attachment.getMimeType());
                    descriptor.addMapping(mapping);
                }
                else {
                    QName type = queryOperation.getResult().getType();
                    String localElement = type.getLocalPart();

Examples of org.encuestame.persistence.domain.Attachment

     * @param unitAttachment
     * @throws EnMeExpcetion
     */
    public final void addAttachment(final UnitAttachment unitAttachment) throws EnMeExpcetion{
        try {
            Attachment attachment = new Attachment();
            attachment.setAttachmentId(unitAttachment.getAttachmentId());
            attachment.setFilename(unitAttachment.getFilename());
            attachment.setUploadDate(unitAttachment.getUploadDate());
            this.getProjectDaoImp().saveOrUpdate(attachment);
        } catch (Exception e) {
            throw new EnMeExpcetion(e);
        }
    }

Examples of org.exoplatform.services.mail.Attachment

    * We check if we can get real cause of exception, if that occurs during
    * message sending process.
    */
   public void testSendMessageAsynchExceptionCause() throws Exception
   {
      Attachment attachment = new Attachment();
      attachment.setInputStream(new ByteArrayInputStream(ATTACHMENT.getBytes()));
      attachment.setMimeType(TEXT_PLAIN);

      Message message = new Message();
      message.setFrom("!@#$%^&*()");
      message.setTo(generateRandomEmailRecipient());
      message.setCC(generateRandomEmailRecipient() + "," + generateRandomEmailRecipient());

Examples of org.geotools.ml.Attachment

        for (Iterator itr = contentList.iterator(); itr.hasNext();) {
            content.append((String) itr.next());
        }

        return new Attachment(name, mimeType, content.toString());
    }

Examples of org.infoglue.cms.applications.workflowtool.function.email.Attachment

    {
      try
      {
        for(final Iterator i = attachments.iterator(); i.hasNext(); )
        {
          final Attachment attachment = (Attachment) i.next();
          logger.debug("Adding attachment : " + attachment);
          DigitalAssetController.create(createDigitalAssetVO(attachment), getInputStream(attachment), getContentVersion(), getDatabase());
        }
      }
      catch(Exception e)

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

        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());

        tms.removeAttachment(task1.getID(), attachment1.getPayloadURL());

        PATask task3 = (PATask) tms.getTask(task1.getID());
        Assert.assertEquals(1, task3.getAttachments().size());
        Assert.assertEquals(attachment2.getPayloadURL(), task3.getAttachments().iterator().next().getPayloadURL());

        Attachment[] attachments = tms.getAttachments(task1.getID());
        Assert.assertEquals(1, attachments.length);
        Assert.assertEquals(attachment2.getPayloadURL(), attachments[0].getPayloadURL());

        tms.removeAttachment(task1.getID(), attachment2.getPayloadURL());
        tms.addAttachment(task1.getID(), attachment1);

        PATask task4 = (PATask) tms.getTask(task1.getID());
        Assert.assertEquals(1, task4.getAttachments().size());
        Assert.assertEquals(attachment1.getPayloadURL(), task4.getAttachments().iterator().next().getPayloadURL());
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.