Package org.hippoecm.frontend.model
Class JcrHelper
java.lang.Object
org.hippoecm.frontend.model.JcrHelper
Helper class for common jcr operations
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
isNodeType
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
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
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
Determine whether the node is a virtual root node (facet search or facet navigation)- Parameters:
node
-- Throws:
RepositoryException
-