Package ch.entwine.weblounge.common.impl.content.image

Examples of ch.entwine.weblounge.common.impl.content.image.ImageResourceImpl


   * {@inheritDoc}
   *
   * @see ch.entwine.weblounge.common.repository.ResourceSerializer#newResource(ch.entwine.weblounge.common.site.Site)
   */
  public Resource<ImageContent> newResource(Site site) {
    return new ImageResourceImpl(new ImageResourceURIImpl(site));
  }
View Full Code Here


   *      ch.entwine.weblounge.common.language.Language)
   */
  public Resource<ImageContent> newResource(Site site, InputStream is,
      User user, Language language) {
    ImageMetadata imageMetadata = ImageMetadataUtils.extractMetadata(new BufferedInputStream(is));
    ImageResource imageResource = new ImageResourceImpl(new ImageResourceURIImpl(site));
    imageResource.setCreated(user, new Date());

    if (imageMetadata == null)
      return imageResource;

    if (!StringUtils.isBlank(imageMetadata.getCaption())) {
      imageResource.setTitle(imageMetadata.getCaption(), language);
    }
    if (!StringUtils.isBlank(imageMetadata.getLegend())) {
      imageResource.setDescription(imageMetadata.getLegend(), language);
    }
    for (String keyword : imageMetadata.getKeywords()) {
      imageResource.addSubject(keyword);
    }
    if (!StringUtils.isBlank(imageMetadata.getCopyright())) {
      imageResource.setRights(imageMetadata.getCopyright(), language);
    }
    return imageResource;
  }
View Full Code Here

TOP

Related Classes of ch.entwine.weblounge.common.impl.content.image.ImageResourceImpl

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.