Examples of AttachmentMetadataImpl


Examples of com.intalio.bpms.workflow.taskManagementServices20051109.impl.AttachmentMetadataImpl

        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;
View Full Code Here

Examples of org.waveprotocol.box.attachment.impl.AttachmentMetadataImpl

      WaveletName waveletName, String fileName, ParticipantId creator) throws IOException {
    AttachmentData data = store.getAttachment(attachmentId);
    if (data == null) {
      throw new IOException("No such atachment " + attachmentId.serialise());
    }
    AttachmentMetadata metadata = new AttachmentMetadataImpl();
    metadata.setAttachmentId(attachmentId.serialise());
    metadata.setAttachmentUrl(AttachmentServlet.ATTACHMENT_URL + "/" + attachmentId.serialise());
    metadata.setThumbnailUrl(AttachmentServlet.THUMBNAIL_URL + "/" + attachmentId.serialise());
    metadata.setWaveRef(waveletName2WaveRef(waveletName));
    metadata.setFileName(fileName);
    String contentType = getMimeType(fileName);
    metadata.setMimeType(contentType);
    metadata.setSize(data.getSize());
    metadata.setCreator((creator != null) ? creator.getAddress() : "");
    BufferedImage image = null;
    try {
      image = ImageIO.read(data.getInputStream());
    } catch (IOException ex) {
      LOG.log(Level.SEVERE, "Identifying attachment", ex);
    }
    if (image != null) {
      ImageMetadata imageMetadata = new ImageMetadataImpl();
      imageMetadata.setWidth(image.getWidth());
      imageMetadata.setHeight(image.getHeight());
      metadata.setImageMetadata(imageMetadata);
      try {
        BufferedImage thumbnail = makeThumbnail(image);
        storeThumbnail(attachmentId, thumbnail);
        ImageMetadata thumbnailMetadata = new ImageMetadataImpl();
        thumbnailMetadata.setWidth(thumbnail.getWidth());
        thumbnailMetadata.setHeight(thumbnail.getHeight());
        metadata.setThumbnailMetadata(thumbnailMetadata);
      } catch (IOException ex) {
        LOG.log(Level.SEVERE, "Building attachment thumbnail", ex);
      }
    } else {
      ImageMetadata thumbnailMetadata = new ImageMetadataImpl();
      thumbnailMetadata.setWidth(THUMBNAIL_PATTERN_WIDTH);
      thumbnailMetadata.setHeight(THUMBNAIL_PATTERN_HEIGHT);
      metadata.setThumbnailMetadata(thumbnailMetadata);
    }
    store.storeMetadata(attachmentId, metadata);
    return metadata;
  }
View Full Code Here

Examples of org.waveprotocol.box.attachment.impl.AttachmentMetadataImpl

  private AttachmentMetadata metadata;
  private Status status = Status.NOT_UPLOADING;

  public AttachmentImpl() {
    metadata = new AttachmentMetadataImpl();
  }
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.