Class JCRSupportImpl
java.lang.Object
org.apache.sling.servlets.post.impl.helper.JCRSupportImpl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkin
(org.apache.sling.api.resource.Resource rsrc) void
checkoutIfNecessary
(org.apache.sling.api.resource.Resource resource, List<Modification> changes, VersioningConfiguration versioningConfiguration) Copy thesrc
item into thedstParent
node.getItem
(org.apache.sling.api.resource.Resource rsrc) getNode
(org.apache.sling.api.resource.Resource rsrc) getPropertyType
(Object node, String name) boolean
hasSession
(org.apache.sling.api.resource.ResourceResolver resolver) static boolean
isAncestorOrSameNode
(javax.jcr.Node src, javax.jcr.Node dest) determines if the 2 nodes are in ancestor relationship or identicalisFileNodeType
(org.apache.sling.api.resource.ResourceResolver resolver, String nodeType) boolean
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
boolean
isVersionable
(org.apache.sling.api.resource.Resource rsrc) void
void
setPrimaryNodeType
(Object node, String type) void
setTypedProperty
(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
public boolean isVersionable(org.apache.sling.api.resource.Resource rsrc) throws org.apache.sling.api.resource.PersistenceException - Throws:
org.apache.sling.api.resource.PersistenceException
-
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 resource, 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) -
isNodeType
-
isFileNodeType
-
isPropertyProtectedOrNewAutoCreated
public boolean isPropertyProtectedOrNewAutoCreated(Object n, String name) throws org.apache.sling.api.resource.PersistenceException - Throws:
org.apache.sling.api.resource.PersistenceException
-
isNewNode
-
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
-
getPropertyType
public Integer getPropertyType(Object node, String name) throws org.apache.sling.api.resource.PersistenceException - Throws:
org.apache.sling.api.resource.PersistenceException
-
storeAsReference
public Modification storeAsReference(Object n, String name, String[] values, int type, boolean multiValued) 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) -
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
-
getItem
-
setPrimaryNodeType
public void setPrimaryNodeType(Object node, String type) 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
-
copy
public String copy(Object src, Object dstParent, String name) throws org.apache.sling.api.resource.PersistenceException Copy thesrc
item into thedstParent
node. The name of the newly created item is set toname
.- Parameters:
src
- The item to copy to the new locationdstParent
- The node into which thesrc
node is to be copiedname
- The name of the newly created item. If this isnull
the new item gets the same name as thesrc
item.- Returns:
- the name of the newly created object
- Throws:
org.apache.sling.api.resource.PersistenceException
- May be thrown in case of any problem copying the content.org.apache.sling.api.resource.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
-