Class JCRSupportImpl
java.lang.Object
org.apache.sling.servlets.post.impl.helper.JCRSupportImpl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidcheckoutIfNecessary(Resource resource, List<Modification> changes, VersioningConfiguration versioningConfiguration) Copy thesrcitem into thedstParentnode.getPropertyType(Object node, String name) booleanhasSession(ResourceResolver resolver) static booleanisAncestorOrSameNode(javax.jcr.Node src, javax.jcr.Node dest) determines if the 2 nodes are in ancestor relationship or identicalisFileNodeType(ResourceResolver resolver, String nodeType) booleanbooleanbooleanisNodeType(Resource rsrc, String typeHint) booleanisPropertyMandatory(Object node, String name) booleanisPropertyMultiple(Object node, String name) booleanbooleanisVersionable(Resource rsrc) voidvoidsetPrimaryNodeType(Object node, String type) voidsetTypedProperty(Object n, String name, String[] values, int type, boolean multiValued) storeAsReference(Object n, String name, String[] values, int type, boolean multiValued)
-
Constructor Details
-
JCRSupportImpl
public JCRSupportImpl()
-
-
Method Details
-
isVersionable
- Throws:
PersistenceException
-
checkin
- Throws:
PersistenceException
-
checkoutIfNecessary
public void checkoutIfNecessary(Resource resource, List<Modification> changes, VersioningConfiguration versioningConfiguration) throws PersistenceException - Throws:
PersistenceException
-
isNode
-
isNodeType
-
isFileNodeType
-
isPropertyProtectedOrNewAutoCreated
public boolean isPropertyProtectedOrNewAutoCreated(Object n, String name) throws PersistenceException - Throws:
PersistenceException
-
isNewNode
-
isPropertyMandatory
- Throws:
PersistenceException
-
isPropertyMultiple
- Throws:
PersistenceException
-
getPropertyType
- Throws:
PersistenceException
-
storeAsReference
public Modification storeAsReference(Object n, String name, String[] values, int type, boolean multiValued) throws PersistenceException - Throws:
PersistenceException
-
hasSession
-
setTypedProperty
public void setTypedProperty(Object n, String name, String[] values, int type, boolean multiValued) throws PersistenceException - Throws:
PersistenceException
-
getNode
-
getItem
-
setPrimaryNodeType
- Throws:
PersistenceException
-
move
- Throws:
PersistenceException
-
copy
Copy thesrcitem into thedstParentnode. The name of the newly created item is set toname.- Parameters:
src- The item to copy to the new locationdstParent- The node into which thesrcnode is to be copiedname- The name of the newly created item. If this isnullthe new item gets the same name as thesrcitem.- Returns:
- the name of the newly created object
- Throws:
PersistenceException- May be thrown in case of any problem copying the content.PersistenceException- in case something fails- See Also:
-
copy(Node, Node, String)copy(Property, Node, String)
-
isAncestorOrSameNode
public static boolean isAncestorOrSameNode(javax.jcr.Node src, javax.jcr.Node dest) throws javax.jcr.RepositoryException determines if the 2 nodes are in ancestor relationship or identical- Parameters:
src- one nodedest- the other node- Returns:
- true if src is an ancestor node of dest, or if both are the same node
- Throws:
javax.jcr.RepositoryException- if something goes wrong
-