public class JcrHelper extends Object
| Constructor and Description |
|---|
JcrHelper(javax.jcr.Session session)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
javax.jcr.Property |
addNodeProperty(String nodePath,
String propertyName,
String propertyValue,
int propertyType)
Adds property to node under specified path.
|
void |
copyNode(javax.jcr.Node node,
javax.jcr.Node destinationParent)
Copies nodes.
|
void |
copyNode(String nodePath,
String destinationPath)
Copies nodes.
|
void |
createNode(String parentNodePath,
String nodeName,
String nodeType)
Creates new node.
|
void |
createNode(String parentNodePath,
String nodeName,
String nodeType,
Map<String,org.apache.commons.lang3.tuple.Pair<String,Integer>> properties)
Creates new node.
|
void |
deleteNode(String nodePath,
javax.jcr.Session session)
Deletes node under specified path.
|
javax.jcr.Node |
getNode(String nodePath)
Gets node under specified path.
|
javax.jcr.Property |
getNodeProperty(String nodePath,
String propertyName) |
Boolean |
hasNodeProperty(String nodePath,
String propertyName)
Checks if node has specified property
|
Boolean |
hasNodePropertyValue(String nodePath,
String propertyName,
String propertyValue)
Checks if specified node property has specified value
|
void |
removeNodeProperty(String nodePath,
String propertyName)
Removes node property.
|
public JcrHelper(javax.jcr.Session session)
session - JCR sessionpublic javax.jcr.Node getNode(String nodePath) throws javax.jcr.RepositoryException
nodePath - Absolute path to node.javax.jcr.RepositoryException - if problem with jcr repository occurredpublic void createNode(String parentNodePath, String nodeName, String nodeType, Map<String,org.apache.commons.lang3.tuple.Pair<String,Integer>> properties) throws javax.jcr.RepositoryException
parentNodePath - Absolute path to parent node.nodeName - The name of the node to create.nodeType - Node type, like nt:unstructured.properties - Map of properties, where key is property name,
value is Pair
of
PropertyType)>.javax.jcr.RepositoryException - if problem with jcr repository occurredpublic void createNode(String parentNodePath, String nodeName, String nodeType) throws javax.jcr.RepositoryException
parentNodePath - Absolute path to parent node.nodeName - The name of the node to create.nodeType - Node type, like nt:unstructured.javax.jcr.RepositoryException - if problem with jcr repository occurredpublic void copyNode(String nodePath, String destinationPath) throws javax.jcr.RepositoryException
nodePath - Absolute path to node.destinationPath - Absolute path to new node parent.javax.jcr.RepositoryException - if problem with jcr repository occurredpublic void copyNode(javax.jcr.Node node,
javax.jcr.Node destinationParent)
throws javax.jcr.RepositoryException
node - Node to copydestinationParent - Destination parent nodejavax.jcr.RepositoryException - if problem with jcr repository occurredpublic void deleteNode(String nodePath, javax.jcr.Session session) throws javax.jcr.RepositoryException
nodePath - Absolute path to node.session - jcr sessionjavax.jcr.RepositoryException - if problem with jcr repository occurredpublic javax.jcr.Property addNodeProperty(String nodePath, String propertyName, String propertyValue, int propertyType) throws javax.jcr.RepositoryException
nodePath - Absolute path to node.propertyName - Property name.propertyValue - Property value.propertyType - Property type PropertyType.javax.jcr.RepositoryException - if problem with jcr repository occurredpublic void removeNodeProperty(String nodePath, String propertyName) throws javax.jcr.RepositoryException
nodePath - Absolute path to node.propertyName - Property name.javax.jcr.RepositoryException - if problem with jcr repository occurredpublic javax.jcr.Property getNodeProperty(String nodePath, String propertyName) throws javax.jcr.RepositoryException
nodePath - Absolute path to node.propertyName - Property name.javax.jcr.RepositoryException - if problem with jcr repository occurredpublic Boolean hasNodeProperty(String nodePath, String propertyName) throws javax.jcr.RepositoryException
nodePath - Absolute path to node.propertyName - Property name.javax.jcr.RepositoryException - if problem with jcr repository occurredpublic Boolean hasNodePropertyValue(String nodePath, String propertyName, String propertyValue) throws javax.jcr.RepositoryException
nodePath - Absolute path to node.propertyName - Property name.propertyValue - Property value.javax.jcr.RepositoryException - if problem with jcr repository occurredCopyright © 2016–2018 Cognifide Ltd.. All rights reserved.