本文整理了Java中javax.jcr.Session.getNodeByUUID()
方法的一些代码示例,展示了Session.getNodeByUUID()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Session.getNodeByUUID()
方法的具体详情如下:
包路径:javax.jcr.Session
类名称:Session
方法名:getNodeByUUID
[英]Returns the node specified by the given UUID. Only applies to nodes that expose a UUID, in other words, those of mixin node type mix:referenceable
[中]返回给定UUID指定的节点。仅适用于公开UUID的节点,换句话说,那些mixin节点类型mix:referenceable
代码示例来源:origin: org.chromattic/chromattic.core
public Node getNodeByUUID(String uuid) throws RepositoryException {
try {
return session.getNodeByUUID(uuid);
}
catch (ItemNotFoundException e) {
return null;
}
}
代码示例来源:origin: apache/jackrabbit
/**
* Return node by UUID.
*/
@SuppressWarnings("deprecation")
public Node getNodeByUUID(String uuid)
throws ItemNotFoundException, RepositoryException {
return getSession().getNodeByUUID(uuid);
}
代码示例来源:origin: ModeShape/modeshape
@SuppressWarnings( "deprecation" )
@Override
public Node getNodeByUUID( String string ) throws ItemNotFoundException, RepositoryException {
return session().getNodeByUUID(string);
}
代码示例来源:origin: org.onehippo.cms7/hippo-repository-connector
/**
* 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);
}
代码示例来源:origin: org.apache.jackrabbit/jackrabbit-jca
/**
* Return node by UUID.
*/
@SuppressWarnings("deprecation")
public Node getNodeByUUID(String uuid)
throws ItemNotFoundException, RepositoryException {
return getSession().getNodeByUUID(uuid);
}
代码示例来源:origin: info.magnolia/magnolia-core
@Override
public Node getNodeByUUID(String uuid) throws ItemNotFoundException, RepositoryException {
return getWrappedSession().getNodeByUUID(uuid);
}
代码示例来源:origin: apache/jackrabbit
/**
* 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
}
}
代码示例来源:origin: org.apache.jackrabbit/jackrabbit-ocm
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;
}
代码示例来源:origin: org.apache.jackrabbit/jackrabbit-ocm
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;
}
}
代码示例来源:origin: org.onehippo.ecm.hst/hst-content-beans
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;
}
代码示例来源:origin: brix-cms/brix-cms
/**
* @deprecated
*/
@Deprecated
public Node getNodeByUUID(String uuid) throws RepositoryException {
return NodeWrapper.wrap(getDelegate().getNodeByUUID(uuid), this);
}
代码示例来源:origin: apache/jackrabbit
/** {@inheritDoc} */
@SuppressWarnings("deprecation")
public RemoteNode getNodeByUUID(String uuid)
throws RepositoryException, RemoteException {
try {
return getRemoteNode(session.getNodeByUUID(uuid));
} catch (RepositoryException ex) {
throw getRepositoryException(ex);
}
}
代码示例来源:origin: Adobe-Consulting-Services/acs-aem-commons
@Override
default Node getNodeByUUID(final String uuid) throws ItemNotFoundException, RepositoryException {
return wrapItem(unwrapSession().getNodeByUUID(uuid));
}
代码示例来源:origin: org.onehippo.cms7/hippo-addon-publication-workflow-frontend
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;
}
代码示例来源:origin: apache/jackrabbit-oak
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);
}
代码示例来源:origin: org.chtijbug.drools/guvnor-repository
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());
}
代码示例来源:origin: apache/jackrabbit-oak
@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);
}
}
代码示例来源:origin: apache/jackrabbit-oak
@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);
}
代码示例来源:origin: apache/jackrabbit
/**
* 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));
}
代码示例来源:origin: apache/jackrabbit
/**
* 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));
}
内容来源于网络,如有侵权,请联系作者删除!