private void explodeSubtypes(String nodeType, Set<String> set) throws RepositoryException { set.add(nodeType); NodeTypeIterator it = ntMgr.getNodeType(nodeType).getSubtypes(); while(it.hasNext()) { String subnt = String.valueOf(it.next()); if (!set.contains(subnt)) { set.add(subnt); explodeSubtypes(subnt, set); } } }
private void explodeSubtypes(String nodeType, Set<String> set) throws RepositoryException { set.add(nodeType); NodeTypeIterator it = ntMgr.getNodeType(nodeType).getSubtypes(); while(it.hasNext()) { String subnt = String.valueOf(it.next()); if (!set.contains(subnt)) { set.add(subnt); explodeSubtypes(subnt, set); } } }
private void explodeSubtypes(String nodeType, Set<String> set) throws RepositoryException { set.add(nodeType); NodeTypeIterator it = ntMgr.getNodeType(nodeType).getSubtypes(); while(it.hasNext()) { String subnt = String.valueOf(it.next()); if (!set.contains(subnt)) { set.add(subnt); explodeSubtypes(subnt, set); } } }
@Override public List<NodeType> nodeTypes() throws RepositoryException { LocalSession localSession = getLocalSession(); List<NodeType> types = new ArrayList<NodeType>(); NodeTypeIterator its = localSession.getSession().getWorkspace().getNodeTypeManager().getAllNodeTypes(); while (its.hasNext()) { types.add((NodeType)its.next()); } return types; }
@Override public List<NodeType> nodeTypes() throws RepositoryException { LocalSession localSession = getLocalSession(); List<NodeType> types = new ArrayList<NodeType>(); NodeTypeIterator its = localSession.getSession().getWorkspace().getNodeTypeManager().getAllNodeTypes(); while (its.hasNext()) { types.add((NodeType)its.next()); } return types; }
private List<ExtensibleType> getTypesList(final String typeName) { final Session session = getSession(); try { final List<ExtensibleType> list = new ArrayList<>(); final NodeTypeManager typeMgr = session.getWorkspace().getNodeTypeManager(); final NodeTypeIterator typeItr = typeMgr.getPrimaryNodeTypes(); final NodeType extensibleType = typeMgr.getNodeType(typeName); while (typeItr.hasNext()) { final NodeType nodeType = (NodeType) typeItr.next(); if (nodeType.isNodeType(extensibleType.getName()) && !nodeType.equals(extensibleType)) { String nodeTypePath = ExtensionsConstants.TYPES + "/" + nodeType.getName(); if (session.getRootNode().hasNode(nodeTypePath)) { final Node typeNode = session.getRootNode().getNode(nodeTypePath); list.add(new JcrExtensibleType(typeNode, nodeType)); } } } return list; } catch (RepositoryException e) { throw new MetadataRepositoryException("Failed to lookup all extensible types", e); } }
public NodeType getNodeType(String s) throws NoSuchNodeTypeException, RepositoryException { NodeType matchNt = null; NodeType nt = null; boolean matchNTFound = false; // TODO hack to support all nodes in greg other than jcr repo if(s != null && s.equals("")) { return getNodeType("default"); } NodeTypeIterator it = getAllNodeTypes(); while (it.hasNext()) { nt = (NodeType) it.next(); if ((nt != null) && (nt.getName() != null) && (nt.getName().equals(s))) { matchNt = nt; matchNTFound = true; break; } } if (!matchNTFound) { throw new NoSuchNodeTypeException("Invalid suffix for a Node Type :" + s); } return matchNt; }
NodeType type = (NodeType) typeItr.next();
NodeType t = (NodeType) types.next(); String name = t.getName(); name = "Node_" + name.replaceAll(":", "_");