Class JCRSupport


  • public class JCRSupport
    extends Object
    • Field Detail

      • INSTANCE

        public static final JCRSupport INSTANCE
    • Constructor Detail

      • JCRSupport

        public JCRSupport()
    • Method Detail

      • checkin

        public boolean checkin​(org.apache.sling.api.resource.Resource rsrc)
                        throws org.apache.sling.api.resource.PersistenceException
        Throws:
        org.apache.sling.api.resource.PersistenceException
      • checkoutIfNecessary

        public void checkoutIfNecessary​(org.apache.sling.api.resource.Resource rsrc,
                                        List<Modification> changes,
                                        VersioningConfiguration versioningConfiguration)
                                 throws org.apache.sling.api.resource.PersistenceException
        Throws:
        org.apache.sling.api.resource.PersistenceException
      • isNode

        public boolean isNode​(org.apache.sling.api.resource.Resource rsrc)
      • isVersionable

        public boolean isVersionable​(org.apache.sling.api.resource.Resource rsrc)
                              throws org.apache.sling.api.resource.PersistenceException
        Throws:
        org.apache.sling.api.resource.PersistenceException
      • isNodeType

        public boolean isNodeType​(org.apache.sling.api.resource.Resource rsrc,
                                  String typeHint)
      • isFileNodeType

        public Boolean isFileNodeType​(org.apache.sling.api.resource.ResourceResolver resolver,
                                      String nodeType)
      • isPropertyProtectedOrNewAutoCreated

        public boolean isPropertyProtectedOrNewAutoCreated​(Object node,
                                                           String name)
                                                    throws org.apache.sling.api.resource.PersistenceException
        Throws:
        org.apache.sling.api.resource.PersistenceException
      • isPropertyMandatory

        public boolean isPropertyMandatory​(Object node,
                                           String name)
                                    throws org.apache.sling.api.resource.PersistenceException
        Throws:
        org.apache.sling.api.resource.PersistenceException
      • isPropertyMultiple

        public boolean isPropertyMultiple​(Object node,
                                          String name)
                                   throws org.apache.sling.api.resource.PersistenceException
        Throws:
        org.apache.sling.api.resource.PersistenceException
      • isNewNode

        public boolean isNewNode​(Object node)
      • getPropertyType

        public Integer getPropertyType​(Object node,
                                       String name)
                                throws org.apache.sling.api.resource.PersistenceException
        Throws:
        org.apache.sling.api.resource.PersistenceException
      • hasSession

        public boolean hasSession​(org.apache.sling.api.resource.ResourceResolver resolver)
      • storeAsReference

        public Modification storeAsReference​(org.apache.sling.api.resource.Resource resource,
                                             Object node,
                                             String name,
                                             String[] values,
                                             int type,
                                             boolean multiValued)
                                      throws org.apache.sling.api.resource.PersistenceException
        Stores property value(s) as reference(s). Will parse the reference(s) from the string value(s) in the RequestProperty.
        Parameters:
        resource - resource
        node - the node
        name - the name
        values - the value
        type - the type
        multiValued - if multiValued
        Returns:
        true only if parsing was successful and the property was actually changed
        Throws:
        org.apache.sling.api.resource.PersistenceException - if the operation cannot be executed
      • setTypedProperty

        public void setTypedProperty​(Object n,
                                     String name,
                                     String[] values,
                                     int type,
                                     boolean multiValued)
                              throws org.apache.sling.api.resource.PersistenceException
        Throws:
        org.apache.sling.api.resource.PersistenceException
      • getNode

        public Object getNode​(org.apache.sling.api.resource.Resource rsrc)
      • getItem

        public Object getItem​(org.apache.sling.api.resource.Resource rsrc)
      • setPrimaryNodeType

        public void setPrimaryNodeType​(Object node,
                                       String type)
                                throws org.apache.sling.api.resource.PersistenceException
        Throws:
        org.apache.sling.api.resource.PersistenceException
      • copy

        public String copy​(Object src,
                           Object dstParent,
                           String name)
                    throws org.apache.sling.api.resource.PersistenceException
        Throws:
        org.apache.sling.api.resource.PersistenceException
      • move

        public void move​(Object src,
                         Object dstParent,
                         String name)
                  throws org.apache.sling.api.resource.PersistenceException
        Throws:
        org.apache.sling.api.resource.PersistenceException
      • jcrEnabled

        public boolean jcrEnabled()