Package org.structr.web.entity.relation

Examples of org.structr.web.entity.relation.Thumbnails


        }

        if (thumbnail != null && data != null) {

          // Create a thumbnail relationship
          Thumbnails thumbnailRelationship = app.create(originalImage, thumbnail, Thumbnails.class);

          // Thumbnails always have to be removed along with origin image
          thumbnailRelationship.setProperty(AbstractRelationship.cascadeDelete, Relation.SOURCE_TO_TARGET);

          // Add to cache list
          // thumbnailRelationships.add(thumbnailRelationship);
          long size = data.length;

          thumbnail.setProperty(File.size, size);
          thumbnail.setProperty(Image.width, tnWidth);
          thumbnail.setProperty(Image.height, tnHeight);

          thumbnail.setProperty(AbstractNode.hidden,        originalImage.getProperty(AbstractNode.hidden));
          thumbnail.setProperty(AbstractNode.visibleToAuthenticatedUsers,    originalImage.getProperty(AbstractNode.visibleToAuthenticatedUsers));
          thumbnail.setProperty(AbstractNode.visibleToPublicUsers,    originalImage.getProperty(AbstractNode.visibleToPublicUsers));
          thumbnail.setProperty(AbstractNode.owner,      originalImage.getProperty(AbstractNode.owner));

          thumbnailRelationship.setProperty(Image.width, tnWidth);
          thumbnailRelationship.setProperty(Image.height, tnHeight);
          thumbnailRelationship.unlockReadOnlyPropertiesOnce();
          thumbnailRelationship.setProperty(Image.checksum, newChecksum);

//                                                      System.out.println("Thumbnail ID: " + thumbnail.getUuid() + ", orig. image ID: " + originalImage.getUuid() + ", orig. image checksum: " + originalImage.getProperty(checksum));
          // Soft-delete outdated thumbnails
          for (Image tn : oldThumbnails) {
View Full Code Here

TOP

Related Classes of org.structr.web.entity.relation.Thumbnails

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.