private Node getCanonicalNode(final Node node) throws RepositoryException { if (node instanceof HippoNode) { return ((HippoNode) node).getCanonicalNode(); } else { return node; } }
private Node getCanonicalNode(final Node node) throws RepositoryException { if (node instanceof HippoNode) { return ((HippoNode) node).getCanonicalNode(); } else { return node; } } }
public static Node getCanonical(Node n) { if(n instanceof HippoNode) { HippoNode hnode = (HippoNode)n; try { Node canonical = hnode.getCanonicalNode(); if(canonical == null) { log.debug("Cannot get canonical node for '{}'. This means there is no phyiscal equivalence of the " + "virtual node. Return null", n.getPath()); } return canonical; } catch (RepositoryException e) { log.error("Repository exception while fetching canonical node. Return null" , e); return null; } } return n; }
protected Node getCanonicalNode(JcrNodeModel model) throws RepositoryException { Node node = model.getNode(); if (node instanceof HippoNode) { return ((HippoNode) node).getCanonicalNode(); } else { return node; } }
private boolean isVirtual(Node node) throws RepositoryException { return node instanceof HippoNode && !node.isSame(((HippoNode) node).getCanonicalNode()); }
canonicalNode = ((HippoNode) node).getCanonicalNode();
private static boolean isVirtual(final Node node) throws RepositoryException { // skip virtual nodes if (node instanceof HippoNode) { HippoNode hn = (HippoNode) node; try { Node canonicalNode = hn.getCanonicalNode(); if (canonicalNode == null) { return true; } if (!canonicalNode.isSame(hn)) { return true; } } catch (ItemNotFoundException infe) { return true; } } return false; }
protected Workflow getWorkflow(Node node, String category) throws RepositoryException { HippoWorkspace wsp = (HippoWorkspace) node.getSession().getWorkspace(); WorkflowManager workflowMgr = wsp.getWorkflowManager(); Node canonicalNode = ((HippoNode) node).getCanonicalNode(); return workflowMgr.getWorkflow(category, canonicalNode); }
@Override public void init(JcrNodeModel model) throws RepositoryException { if (!model.getNode().hasNode(HST_CONFIGURATION)) { throw new IllegalArgumentException("Facet select " + HST_CONFIGURATION + " not found"); } Node root = model.getNode().getNode(HST_CONFIGURATION); if (!root.hasNode(HST_CONFIGURATION)) { throw new IllegalArgumentException("Node " + HST_CONFIGURATION + " not found"); } HippoNode hroot = (HippoNode) root.getNode(HST_CONFIGURATION); root = hroot.getCanonicalNode(); this.model = new JcrNodeModel(root); }
public RemoteNode getCanonicalNode() throws RepositoryException, RemoteException { try { Node result = node.getCanonicalNode(); return (result == null ? null : getRemoteNode(result)); } catch (RepositoryException ex) { throw getRepositoryException(ex); } }
private void populateCanonicalPath(){ if(isDetached()){ log.info("Jcr Node is detached. Cannot get canonical path"); return; } this.canonicalPath = this.nodePath; if(jcrNode instanceof HippoNode) { try { Node canonical = ((HippoNode)jcrNode).getCanonicalNode(); if(canonical != null) { this.canonicalPath = canonical.getPath(); } else { log.info("The canonical path of a virtual only node is the path of the virtual node"); this.canonicalPath = jcrNode.getPath(); } } catch (RepositoryException e) { throw new RuntimeRepositoryException(e); } } }
private void populateIdentifier(){ if(isDetached()){ log.info("Jcr Node is detached. Cannot get identifier"); return; } if(jcrNode instanceof HippoNode) { try { Node canonical = ((HippoNode)jcrNode).getCanonicalNode(); if(canonical != null) { this.identifier = canonical.getIdentifier(); } else { log.debug("Node '{}' is virtual only. Using virtual path as identifier", jcrNode.getPath()); this.identifier = jcrNode.getPath(); } } catch (RepositoryException e) { throw new RuntimeRepositoryException(e); } } }
@Override public void visit(Node node) throws RepositoryException { if (node instanceof HippoNode) { try { Node canonical = ((HippoNode) node).getCanonicalNode(); if (canonical == null || !canonical.isSame(node)) { return; } } catch (ItemNotFoundException e) { // canonical node no longer exists return; } } super.visit(node); }
@IndexField(ignoreInCompound = true) public String getComparePath() { if (comparePath != null) { return comparePath; } HippoNode node = (HippoNode)getNode(); if (node == null) { throw new IllegalStateException("Cannot get comparePath if jcr node is null"); } Node canonical = null; try { canonical = node.getCanonicalNode(); if (canonical == null) { // virtual only comparePath = node.getPath(); } else { comparePath = canonical.getPath(); } } catch (RepositoryException e) { throw new IllegalStateException("Cannot get comparePath", e); } return comparePath; }
private void check(Node node) throws RepositoryException { if (log.isTraceEnabled()) { log.trace("traverse: {}", node.getPath()); } if (node instanceof HippoNode) { Node canonical = ((HippoNode)node).getCanonicalNode(); if (canonical == null || !canonical.isSame(node)) { return; } } if (node.getPath().equals("/jcr:system")) { return; } for (NodeIterator iter = node.getNodes(); iter.hasNext();) { Node child = iter.nextNode(); if (child != null) { check(child); } } for (PropertyIterator iter = node.getProperties(); iter.hasNext();) { iter.nextProperty(); } } }
private javax.jcr.Node getCanonicalHandleNode() { if(canonicalHandleNode != null) { return canonicalHandleNode; } if(this.getNode() == null) { log.info("Cannot get handle uuid for detached node '{}'", this.getPath()); return null; } try { // first get the canonical handle. Because we can have a document in a faceted resultset, we first need to get the // canonical node of the document, and then fetch the parent javax.jcr.Node canonical = ((HippoNode) getNode()).getCanonicalNode(); if (canonical == null) { log.info("We cannot get the canonical handle uuid for a document that does not have a canonical version. Node '{}'. Return null", getNode().getPath()); return null; } final javax.jcr.Node parent = canonical.getParent(); if (parent != null && parent.isNodeType(HippoNodeType.NT_HANDLE)) { canonicalHandleNode = parent; } } catch (RepositoryException e) { log.error("Cannot get handle uuid for node '"+this.getPath()+"'", e); } return canonicalHandleNode; }
Node canonical = hn.getCanonicalNode(); if (canonical == null) { log.debug("Cannot get canonical for a node that is virtual only: '{}'. Return null", this.getPath());
Node canonical = ((HippoNode) node).getCanonicalNode(); if (canonical == null) { log.warn("Skipped {}, no canonical node available", node.getPath());
try { HstVirtualizer virtualizer = ctxWCC.getVirtualizer(this.getNode()); Node canonical = ((HippoNode)this.getNode()).getCanonicalNode(); if(canonical == null) { log.debug("Cannot get canonical for a node that is virtual only: '{}'. It's contextual bean is just the current bean", this.getPath());
Node canonicalNode = null; if(node instanceof HippoNode) { canonicalNode = ((HippoNode)node).getCanonicalNode();