Package org.hippoecm.frontend.model
Class JcrHelper
- java.lang.Object
-
- org.hippoecm.frontend.model.JcrHelper
-
public class JcrHelper extends Object
Helper class for common jcr operations
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Item
getPrimaryItem(Node node)
Retrieve the primary item of a node, according to the primary node type hierarchy.static Version
getVersionParent(Version version)
Find the first checked-in version of the parent of a node that contains a particular version of the child.static boolean
isNodeType(Node node, String type)
Determine whether node is of the specified type, by using the jcr:mixinTypes property.static boolean
isVirtualNode(Node node)
Determine whether node in question is a virtual node.static boolean
isVirtualRoot(Node node)
Determine whether the node is a virtual root node (facet search or facet navigation)
-
-
-
Method Detail
-
isNodeType
public static boolean isNodeType(Node node, String type) throws RepositoryException
Determine whether node is of the specified type, by using the jcr:mixinTypes property. This is necessary when a mixin has been added to the node, but the node hasn't been saved yet.- Parameters:
node
-type
-- Returns:
- true when the node is of the specified type
- Throws:
RepositoryException
-
getVersionParent
public static Version getVersionParent(Version version) throws ItemNotFoundException, RepositoryException
Find the first checked-in version of the parent of a node that contains a particular version of the child. I.e. given a version of a child, the oldest version of the parent that contains the child is returned.- Parameters:
version
-- Throws:
ItemNotFoundException
RepositoryException
-
getPrimaryItem
public static Item getPrimaryItem(Node node) throws ItemNotFoundException, RepositoryException
Retrieve the primary item of a node, according to the primary node type hierarchy. Plain JackRabbit only checks the declared items of a type, not the inherited ones.- Parameters:
node
-- Returns:
- primary item
- Throws:
ItemNotFoundException
RepositoryException
-
isVirtualNode
public static boolean isVirtualNode(Node node) throws RepositoryException
Determine whether node in question is a virtual node.- Parameters:
node
- the node to check for virtuality- Returns:
- whether the node is a virtual node or not
- Throws:
RepositoryException
-
isVirtualRoot
public static boolean isVirtualRoot(Node node) throws RepositoryException
Determine whether the node is a virtual root node (facet search or facet navigation)- Parameters:
node
-- Throws:
RepositoryException
-
-