Class JCRSupport
java.lang.Object
org.apache.sling.servlets.post.impl.helper.JCRSupport
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
void
checkoutIfNecessary
(Resource rsrc, List<Modification> changes, VersioningConfiguration versioningConfiguration) getPropertyType
(Object node, String name) boolean
hasSession
(ResourceResolver resolver) isFileNodeType
(ResourceResolver resolver, String nodeType) boolean
boolean
boolean
isNodeType
(Resource rsrc, String typeHint) boolean
isPropertyMandatory
(Object node, String name) boolean
isPropertyMultiple
(Object node, String name) boolean
isPropertyProtectedOrNewAutoCreated
(Object node, String name) boolean
isVersionable
(Resource rsrc) boolean
void
void
setPrimaryNodeType
(Object node, String type) void
setTypedProperty
(Object n, String name, String[] values, int type, boolean multiValued) storeAsReference
(Resource resource, Object node, String name, String[] values, int type, boolean multiValued) Stores property value(s) as reference(s).
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
JCRSupport
public JCRSupport()
-
-
Method Details
-
checkin
- Throws:
PersistenceException
-
checkoutIfNecessary
public void checkoutIfNecessary(Resource rsrc, List<Modification> changes, VersioningConfiguration versioningConfiguration) throws PersistenceException - Throws:
PersistenceException
-
isNode
-
isVersionable
- Throws:
PersistenceException
-
isNodeType
-
isFileNodeType
-
isPropertyProtectedOrNewAutoCreated
public boolean isPropertyProtectedOrNewAutoCreated(Object node, String name) throws PersistenceException - Throws:
PersistenceException
-
isPropertyMandatory
- Throws:
PersistenceException
-
isPropertyMultiple
- Throws:
PersistenceException
-
isNewNode
-
getPropertyType
- Throws:
PersistenceException
-
hasSession
-
storeAsReference
public Modification storeAsReference(Resource resource, Object node, String name, String[] values, int type, boolean multiValued) throws 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:
PersistenceException
- if the operation cannot be executed
-
setTypedProperty
public void setTypedProperty(Object n, String name, String[] values, int type, boolean multiValued) throws PersistenceException - Throws:
PersistenceException
-
getNode
-
getItem
-
setPrimaryNodeType
- Throws:
PersistenceException
-
copy
- Throws:
PersistenceException
-
move
- Throws:
PersistenceException
-
jcrEnabled
public boolean jcrEnabled()
-