Package javax.jcr.nodetype

Examples of javax.jcr.nodetype.NodeTypeIterator


        look for a a node type that includes mix:referenceable but isn't any
        of the known internal nodetypes that ev. cannot be created through a
        session-import
        */
        String referenceableNt = null;
        NodeTypeIterator it = superuser.getWorkspace().getNodeTypeManager().getPrimaryNodeTypes();
        while (it.hasNext() && referenceableNt == null) {
            NodeType nt = it.nextNodeType();
            String ntName = nt.getName();
            if (nt.isNodeType(mixReferenceable) &&
                    !nt.isAbstract() &&
                    // TODO: improve....
                    // ignore are built-in nodetypes (mostly version related)
View Full Code Here


                    // search for nodes where jcr:primaryType is set to this type
                    addTypeConstraint(new PrimaryTypeComparision(resolvedName));
                }

                // now search for all node types that are derived from base
                NodeTypeIterator allTypes = ntMgr.getAllNodeTypes();
                while (allTypes.hasNext()) {
                    NodeType nt = allTypes.nextNodeType();
                    NodeType[] superTypes = nt.getSupertypes();
                    if (Arrays.asList(superTypes).contains(base)) {
                        if (nt.isMixin()) {
                            addTypeConstraint(new MixinComparision(nt.getName()));
                        } else {
View Full Code Here

            names = new String[]{ntName};
        } else {
            if (ntNames == null) {
                NodeTypeManager ntMgr = session.getWorkspace().getNodeTypeManager();
                ntNames = new HashMap<String, String[]>();
                NodeTypeIterator it = ntMgr.getAllNodeTypes();
                while (it.hasNext()) {
                    String name = it.nextNodeType().getName();
                    String localName = name;
                    int idx = name.indexOf(':');
                    if (idx != -1) {
                        localName = name.substring(idx + 1);
                    }
View Full Code Here

            return name;
        }
        if (propertyNames == null) {
            propertyNames = new HashMap<String, String>();
            NodeTypeManager ntMgr = session.getWorkspace().getNodeTypeManager();
            NodeTypeIterator it = ntMgr.getAllNodeTypes();
            while (it.hasNext()) {
                NodeType nt = it.nextNodeType();
                PropertyDefinition[] defs = nt.getDeclaredPropertyDefinitions();
                for (PropertyDefinition def : defs) {
                    String pn = def.getName();
                    if (!pn.equals("*")) {
                        String localName = pn;
View Full Code Here

            return name;
        }
        if (childNodeNames == null) {
            childNodeNames = new HashMap<String, String>();
            NodeTypeManager ntMgr = session.getWorkspace().getNodeTypeManager();
            NodeTypeIterator it = ntMgr.getAllNodeTypes();
            while (it.hasNext()) {
                NodeType nt = it.nextNodeType();
                NodeDefinition[] defs = nt.getDeclaredChildNodeDefinitions();
                for (NodeDefinition def : defs) {
                    String cnn = def.getName();
                    if (!cnn.equals("*")) {
                        String localName = cnn;
View Full Code Here

                                NameFormat.format(node.getValue(), nsMappings)));
                terms.add(t);
            }

            // now search for all node types that are derived from base
            NodeTypeIterator allTypes = ntMgr.getAllNodeTypes();
            while (allTypes.hasNext()) {
                NodeType nt = allTypes.nextNodeType();
                NodeType[] superTypes = nt.getSupertypes();
                if (Arrays.asList(superTypes).contains(base)) {
                    String ntName = nsMappings.translatePropertyName(nt.getName(),
                            session.getNamespaceResolver());
                    Term t;
View Full Code Here

        if (slingRepository != null) {
            Session session = null;
            try {
                session = slingRepository.loginAdministrative(null);
                NodeTypeManager ntm = session.getWorkspace().getNodeTypeManager();
                NodeTypeIterator it = ntm.getAllNodeTypes();
                List<NodeType> sortedTypes = sortTypes(it);

                for (NodeType nt : sortedTypes) {
                    pw.printf("[%s]", nt.getName());
View Full Code Here

    }

    @Override
    public NodeTypeIterator getPrimaryNodeTypes() throws RepositoryException {
        List<NodeType> list = Lists.newArrayList();
        NodeTypeIterator iterator = getAllNodeTypes();
        while (iterator.hasNext()) {
            NodeType type = iterator.nextNodeType();
            if (!type.isMixin()) {
                list.add(type);
            }
        }
        return new NodeTypeIteratorAdapter(list);
View Full Code Here

    }

    @Override
    public NodeTypeIterator getMixinNodeTypes() throws RepositoryException {
        List<NodeType> list = Lists.newArrayList();
        NodeTypeIterator iterator = getAllNodeTypes();
        while (iterator.hasNext()) {
            NodeType type = iterator.nextNodeType();
            if (type.isMixin()) {
                list.add(type);
            }
        }
        return new NodeTypeIteratorAdapter(list);
View Full Code Here

                                resolver.getJCRName(node.getValue())));
                terms.add(t);
            }

            // now search for all node types that are derived from base
            NodeTypeIterator allTypes = ntMgr.getAllNodeTypes();
            while (allTypes.hasNext()) {
                NodeType nt = allTypes.nextNodeType();
                NodeType[] superTypes = nt.getSupertypes();
                if (Arrays.asList(superTypes).contains(base)) {
                    Name n = session.getQName(nt.getName());
                    String ntName = nsMappings.translateName(n);
                    Term t;
View Full Code Here

TOP

Related Classes of javax.jcr.nodetype.NodeTypeIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.