if (relPath.contains("/")) { HierarchyResolver manager = ((UpdaterWorkspace) (session.getWorkspace())).getHierarchyResolver(); HierarchyResolver.Entry last = new HierarchyResolver.Entry(); manager.getItem(this, relPath, false, last); name = last.relPath;
public RemoteHierarchyResolver.RemoteHierarchyResult getItem(String ancestor, String path, boolean isProperty) throws InvalidItemStateException, RepositoryException, RemoteException { try { Node node; if ("/".equals(ancestor)) { node = session.getRootNode(); } else { node = session.getRootNode().getNode(ancestor.substring(1)); } RemoteHierarchyResult result = new RemoteHierarchyResult(); HierarchyResolver.Entry last = new HierarchyResolver.Entry(); Item item = resolver.getItem(node, path, isProperty, last); if(item != null) { if(item.isNode()) { result.item = getFactory().getRemoteNode((Node)item); } else { result.item = getFactory().getRemoteProperty((Property)item); } } else { result.item = null; } result.node = getFactory().getRemoteNode(node); result.relPath = last.relPath; return result; } catch (RepositoryException ex) { throw getRepositoryException(ex); } } }
@Override Value[] getPropertyValues(Node modified, Collection<String> dependencies) throws RepositoryException { /* FIXME: should read: * Property property = ((HippoWorkspace)(modified.getSession().getWorkspace())).getHierarchyResolver().getProperty(modified, propDef.getProperty("hipposys:relPath").getString()); * however this is broken because of a cast exception as the session is not wrapped */ HierarchyResolver.Entry lastNode = new HierarchyResolver.Entry(); Property property = new HierarchyResolverImpl().getProperty(modified, getRelativePath(), lastNode); if (property != null) { if (property.getParent().isNodeType("mix:referenceable")) { dependencies.add(property.getParent().getIdentifier()); } if (!property.getDefinition().isMultiple()) { return new Value[] { property.getValue() }; } else { return property.getValues(); } } else { if (lastNode.node.isNodeType("mix:referenceable")) { dependencies.add(lastNode.node.getIdentifier()); } } return null; }