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 JCRSupportINSTANCE
-
Constructor Summary
Constructors Constructor Description JCRSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckin(org.apache.sling.api.resource.Resource rsrc)voidcheckoutIfNecessary(org.apache.sling.api.resource.Resource rsrc, List<Modification> changes, VersioningConfiguration versioningConfiguration)Stringcopy(Object src, Object dstParent, String name)ObjectgetItem(org.apache.sling.api.resource.Resource rsrc)ObjectgetNode(org.apache.sling.api.resource.Resource rsrc)IntegergetPropertyType(Object node, String name)booleanhasSession(org.apache.sling.api.resource.ResourceResolver resolver)BooleanisFileNodeType(org.apache.sling.api.resource.ResourceResolver resolver, String nodeType)booleanisNewNode(Object node)booleanisNode(org.apache.sling.api.resource.Resource rsrc)booleanisNodeType(org.apache.sling.api.resource.Resource rsrc, String typeHint)booleanisPropertyMandatory(Object node, String name)booleanisPropertyMultiple(Object node, String name)booleanisPropertyProtectedOrNewAutoCreated(Object node, String name)booleanisVersionable(org.apache.sling.api.resource.Resource rsrc)booleanjcrEnabled()voidmove(Object src, Object dstParent, String name)voidsetPrimaryNodeType(Object node, String type)voidsetTypedProperty(Object n, String name, String[] values, int type, boolean multiValued)ModificationstoreAsReference(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()
-
-