/** * Get the most accurate and complete version available of the information * represented in the current node if available. * * @param node * @param defaultNode * @return the node with the most accurate representation of this node if available. * @throws java.lang.IllegalArgumentException when canonical node is not found for the node. * @throws java.lang.RuntimeException when the repository throws a general repository exception */ public static Node getCanonicalNode(Node node) { return getCanonicalNode(node, null); }
private Node getCanonicalNode(Node folderNode) throws ObjectBeanPersistenceException { folderNode = NodeUtils.getCanonicalNode(folderNode); if(folderNode == null) { throw new ObjectBeanPersistenceException("Cannot perform workflow on a node that does not have a canonical version"); } return folderNode; }
Node canonicalNode = NodeUtils.getCanonicalNode(bean.getNode());
HippoBean bean = (HippoBean) wpm.getObject(itemPath); Node contentNode = bean.getNode(); contentNode = NodeUtils.getCanonicalNode(contentNode, contentNode); Workflow workflow = wpm.getWorkflow(category, contentNode);
WorkflowPersistenceManager wpm = createWorkflowPersistenceManager(servletRequest); HippoBean contentBean = (HippoBean) wpm.getObject(itemPath); Workflow wf = wpm.getWorkflow(category, NodeUtils.getCanonicalNode(contentBean.getNode()));
Node canonicalParentNode = NodeUtils.getCanonicalNode(bean.getNode());
curNode = NodeUtils.getCanonicalNode(curNode, curNode);
Node canonicalNode = NodeUtils.getCanonicalNode(node);
Node canonicalFolderNode = NodeUtils.getCanonicalNode(candidateNode);
curNode = NodeUtils.getCanonicalNode(curNode);
HippoBean contentBean = (HippoBean) content; Node contentNode = contentBean.getNode(); contentNode = NodeUtils.getCanonicalNode(contentNode, contentNode); binder = contentNodeBinders.get(contentNode.getPrimaryNodeType().getName()); } catch (Exception e) {
protected void createNodeByWorkflow(Node folderNode, String nodeTypeName, String name) throws ObjectBeanPersistenceException { try { folderNode = NodeUtils.getCanonicalNode(folderNode, folderNode); Workflow wf = getWorkflow(folderNodeWorkflowCategory, folderNode); if (wf instanceof FolderWorkflow) { FolderWorkflow fwf = (FolderWorkflow) wf; String category = documentAdditionWorkflowCategory; if (nodeTypeName.equals(folderNodeTypeName)) { category = folderAdditionWorkflowCategory; } String added = fwf.add(category, nodeTypeName, name); if (added == null) { throw new ObjectBeanPersistenceException("Failed to add document/folder for type '" + nodeTypeName + "'. Make sure there is a prototype."); } } else { throw new ObjectBeanPersistenceException("The workflow is not a FolderWorkflow for " + folderNode.getPath() + ": " + wf); } } catch (RepositoryException e) { throw new ObjectBeanPersistenceException(e); } catch (RemoteException e) { throw new ObjectBeanPersistenceException(e); } catch (WorkflowException e) { throw new ObjectBeanPersistenceException(e); } }
Node canonical = NodeUtils.getCanonicalNode(contentBean.getNode()); Node handleNode = canonical.getParent(); String nodeName = handleNode.getName(); HippoBean folderBean = contentBean.getParentBean(); Node folderNode = NodeUtils.getCanonicalNode(folderBean.getNode());
canonicalNode = NodeUtils.getCanonicalNode(node);
Node contentNode = contentBean.getNode(); path = contentNode.getPath(); contentNode = NodeUtils.getCanonicalNode(contentNode, contentNode); Workflow wf = getWorkflow(documentNodeWorkflowCategory, contentNode);
jcrItem = jcrItem.getParent(); Node canonical = NodeUtils.getCanonicalNode((Node) jcrItem); if(canonical == null || !canonical.isSame(jcrItem)) { log.warn("An event handler will be registered for a virtual node. Virtual nodes never have events. You should take the canonical location most likely. Virtual path = " + absolutePath);