/** * Resolves uri path to a {@link BrixNode}. By default this method uses {@link * BrixConfig#getMapper()} to map the uri to a node path. * * @param uriPath uri path * @return node that maps to the <code>uriPath</code> or <code>null</code> if none */ public BrixNode getNodeForUriPath(final Path uriPath) { BrixNode node = null; // create desired nodepath final Path nodePath = brix.getConfig().getMapper().getNodePathForUriPath(uriPath.toAbsolute(), brix); if (nodePath != null) { // allow site plugin to translate the node path into an actual jcr // path final String jcrPath = SitePlugin.get().toRealWebNodePath(nodePath.toString()); // retrieve jcr session final String workspace = getWorkspace(); final JcrSession session = brix.getCurrentSession(workspace); if (session.itemExists(jcrPath)) { // node exists, return it node = (BrixNode) session.getItem(jcrPath); } } return node; }