Class ContentReader

java.lang.Object
com.adobe.acs.commons.contentsync.ContentReader

public class ContentReader extends Object
  • Constructor Details

    • ContentReader

      public ContentReader(javax.jcr.Session session) throws javax.jcr.RepositoryException
      Throws:
      javax.jcr.RepositoryException
  • Method Details

    • sanitize

      public javax.json.JsonObject sanitize(javax.json.JsonObject node) throws javax.jcr.RepositoryException
      Recursive sanitize the give JCR node and remove protected properties
      Parameters:
      node - json node representing a JCR node
      Returns:
      sanitized json
      Throws:
      javax.jcr.RepositoryException
      See Also:
    • getProtectedProperties

      public List<String> getProtectedProperties(javax.json.JsonObject node) throws javax.jcr.RepositoryException
      Collect protected properties of a given JCR node (non-recursively). The list of protected properties consists of: - properties protected by node's primary type - properties protected by node's mixins

      For example, if a cq:Page node does not have any mixins applied this method would return

            ["jcr:created", "jcr:createdBy"]
        

      If cq:Page is versionable, i.e. has the "mix:versionable" mixin type, then this method would return properties protected by the primary type (cq:Page ) and the mixin (mix:versionable) and the list would be

            ["jcr:created", "jcr:createdBy", "jcr:versionHistory", "jcr:baseVersion", "jcr:predecessors",
            "jcr:mergeFailed", "jcr:activity", "jcr:configuration", "jcr:isCheckedOut", "jcr:uuid" ]
        
      Parameters:
      node - json representing a JCR node
      Returns:
      the list of protected properties
      Throws:
      javax.jcr.RepositoryException
    • collectBinaryProperties

      public List<String> collectBinaryProperties(javax.json.JsonObject node)
      Recursively collect binary properties from a given json node.

      For example, if node represents a cq:Page object with inline images, the output would look like

        [
          /jcr:content/image/file/jcr:content/jcr:data,
          /jcr:content/image/file/jcr:content/dam:thumbnails/dam:thumbnail_480.png/jcr:content/jcr:data,
          /jcr:content/image/file/jcr:content/dam:thumbnails/dam:thumbnail_60.png/jcr:content/jcr:data,
          /jcr:content/image/file/jcr:content/dam:thumbnails/dam:thumbnail_300.png/jcr:content/jcr:data,
          /jcr:content/image/file/jcr:content/dam:thumbnails/dam:thumbnail_48.png/jcr:content/jcr:data
        ]
       
      Parameters:
      node - json representing a JCR node
      Returns:
      list of property paths relative to the json root