Class JCRSupport
- java.lang.Object
-
- org.apache.sling.servlets.post.impl.helper.JCRSupport
-
public class JCRSupport extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static JCRSupport
INSTANCE
-
Constructor Summary
Constructors Constructor Description JCRSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkin(org.apache.sling.api.resource.Resource rsrc)
void
checkoutIfNecessary(org.apache.sling.api.resource.Resource rsrc, List<Modification> changes, VersioningConfiguration versioningConfiguration)
String
copy(Object src, Object dstParent, String name)
Object
getItem(org.apache.sling.api.resource.Resource rsrc)
Object
getNode(org.apache.sling.api.resource.Resource rsrc)
Integer
getPropertyType(Object node, String name)
boolean
hasSession(org.apache.sling.api.resource.ResourceResolver resolver)
Boolean
isFileNodeType(org.apache.sling.api.resource.ResourceResolver resolver, String nodeType)
boolean
isNewNode(Object node)
boolean
isNode(org.apache.sling.api.resource.Resource rsrc)
boolean
isNodeType(org.apache.sling.api.resource.Resource rsrc, String typeHint)
boolean
isPropertyMandatory(Object node, String name)
boolean
isPropertyMultiple(Object node, String name)
boolean
isPropertyProtectedOrNewAutoCreated(Object node, String name)
boolean
isVersionable(org.apache.sling.api.resource.Resource rsrc)
boolean
jcrEnabled()
void
move(Object src, Object dstParent, String name)
void
setPrimaryNodeType(Object node, String type)
void
setTypedProperty(Object n, String name, String[] values, int type, boolean multiValued)
Modification
storeAsReference(org.apache.sling.api.resource.Resource resource, Object node, String name, String[] values, int type, boolean multiValued)
Stores property value(s) as reference(s).
-
-
-
Field Detail
-
INSTANCE
public static final JCRSupport INSTANCE
-
-
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 theRequestProperty
.- Parameters:
resource
- resourcenode
- the nodename
- the namevalues
- the valuetype
- the typemultiValued
- 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()
-
-