public Node getNodeByUUID(String uuid) throws RepositoryException { try { return session.getNodeByUUID(uuid); } catch (ItemNotFoundException e) { return null; } }
/** * Return node by UUID. */ @SuppressWarnings("deprecation") public Node getNodeByUUID(String uuid) throws ItemNotFoundException, RepositoryException { return getSession().getNodeByUUID(uuid); }
@SuppressWarnings( "deprecation" ) @Override public Node getNodeByUUID( String string ) throws ItemNotFoundException, RepositoryException { return session().getNodeByUUID(string); }
/** * Forwards the method call to the underlying session. The returned * node is wrapped into a node decorator using the decorator factory. * * @return decorated node */ public Node getNodeByUUID(String uuid) throws ItemNotFoundException, RepositoryException { Node node = session.getNodeByUUID(uuid); return factory.getNodeDecorator(this, node); }
/** * Return node by UUID. */ @SuppressWarnings("deprecation") public Node getNodeByUUID(String uuid) throws ItemNotFoundException, RepositoryException { return getSession().getNodeByUUID(uuid); }
@Override public Node getNodeByUUID(String uuid) throws ItemNotFoundException, RepositoryException { return getWrappedSession().getNodeByUUID(uuid); }
/** * Tests that session.getNodeByUUID() throws a ItemNotFoundException in case * of an invalid uuid. */ public void testGetNodeByUUIDFailure() throws RepositoryException { try { session.getNodeByUUID(RANDOM_UUID); fail("Not valid UUID should throw a ItemNotFoundException."); } catch (ItemNotFoundException infe) { // ok } }
private Node getActualNode(Session session, Node node) throws RepositoryException { NodeType type = node.getPrimaryNodeType(); if (type.getName().equals("nt:versionedChild")) { String uuid = node.getProperty("jcr:childVersionHistory").getValue().getString(); Node actualNode = session.getNodeByUUID(uuid); String name = actualNode.getName(); actualNode = session.getNodeByUUID(name); return actualNode; } return node; }
public Object getObject(Session session, Node parentNode, BeanDescriptor beanDescriptor, ClassDescriptor beanClassDescriptor, Class beanClass, Object parent) throws ObjectContentManagerException, RepositoryException,JcrMappingException { try { String uuid = parentNode.getProperty(beanDescriptor.getJcrName()).getString(); String path = session.getNodeByUUID(uuid).getPath(); return objectConverter.getObject(session, path); } catch (Exception e) { return null; } }
public Object getObject(String uuid, Session session) throws ObjectBeanManagerException { checkUUID(uuid); try { Node node = session.getNodeByUUID(uuid); return this.getObject(node); } catch (ItemNotFoundException e) { log.warn("ItemNotFoundException for uuid '{}'. Return null.", uuid); } catch (RepositoryException e) { log.error("RepositoryException for uuid '{}' : {}. Return null.",uuid, e); } return null; }
/** * @deprecated */ @Deprecated public Node getNodeByUUID(String uuid) throws RepositoryException { return NodeWrapper.wrap(getDelegate().getNodeByUUID(uuid), this); }
/** {@inheritDoc} */ @SuppressWarnings("deprecation") public RemoteNode getNodeByUUID(String uuid) throws RepositoryException, RemoteException { try { return getRemoteNode(session.getNodeByUUID(uuid)); } catch (RepositoryException ex) { throw getRepositoryException(ex); } }
@Override default Node getNodeByUUID(final String uuid) throws ItemNotFoundException, RepositoryException { return wrapItem(unwrapSession().getNodeByUUID(uuid)); }
public Node next() { String uuid = upstream.next(); javax.jcr.Session session = ((UserSession) Session.get()).getJcrSession(); try { return session.getNodeByUUID(uuid); } catch (ItemNotFoundException e) { log.info("Document {} has a reference to non-existing UUID {}", referenced.getDocumentPath(), uuid); } catch (RepositoryException e) { log.error(e.getMessage(), e); } return null; }
public void testGetVersionHistoryNodeByUUID() throws Exception { Node n = testRootNode.addNode(nodeName1, testNodeType); n.addMixin(JcrConstants.MIX_VERSIONABLE); superuser.save(); Node vh = superuser.getNodeByUUID(n.getProperty( JcrConstants.JCR_VERSIONHISTORY).getString()); assertNotNull(vh); }
private void findAndPrintNodeName(Node node) throws ValueFormatException, PathNotFoundException, RepositoryException { String UUID = node.getProperty("jcr:baseVersion").getString(); Node nodeFound = getRepo().getSession().getNodeByUUID(UUID); System.out.println("Node:" + nodeFound.getName()); }
@SuppressWarnings("deprecation") public void testGetNodeByUUID() throws RepositoryException { Node n = testRootNode.addNode(nodeName1, testNodeType); n.addMixin(mixVersionable); superuser.save(); VersionManager vMgr = superuser.getWorkspace().getVersionManager(); String uuid = vMgr.getVersionHistory(n.getPath()).getUUID(); assertTrue("Session.getNodeByUUID() did not return VersionHistory object for a nt:versionHistory node.", superuser.getNodeByUUID(uuid) instanceof VersionHistory); } }
@SuppressWarnings("deprecation") public void testGetNodeByUUID() throws RepositoryException { Node n = testRootNode.addNode(nodeName1, testNodeType); n.addMixin(mixVersionable); superuser.save(); VersionManager vMgr = superuser.getWorkspace().getVersionManager(); String uuid = vMgr.getBaseVersion(n.getPath()).getUUID(); assertTrue("Session.getNodeByUUID() did not return Version object for a nt:version node.", superuser.getNodeByUUID(uuid) instanceof Version); }
/** * Same as {@link #testAccessMovedReferenceableByUUID()} but calls save() * before accessing the node again. */ public void testAccessMovedReferenceableByUUID2() throws RepositoryException, NotExecutableException { String uuid = moveNode.getUUID(); //move the node doMove(moveNode.getPath(), destinationPath); superuser.save(); Node n = superuser.getNodeByUUID(uuid); assertTrue("After successful moving a referenceable node node, accessing the node by uuid must return the same node.", n.isSame(moveNode)); }
/** * Test if a moved referenceable node returns the same item than the moved * node. */ public void testAccessMovedReferenceableByUUID() throws RepositoryException, NotExecutableException { String uuid = moveNode.getUUID(); //move the node doMove(moveNode.getPath(), destinationPath); Node n = superuser.getNodeByUUID(uuid); assertTrue("After successful moving a referenceable node node, accessing the node by uuid must return the same node.", n.isSame(moveNode)); }