Package javax.jcr.nodetype

Examples of javax.jcr.nodetype.NodeTypeIterator.nextNodeType()


            }

            // 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


        // now search for all node types that are derived from base
        if (base != null) {
            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

            throws RepositoryException {

        NodeTypeIterator types = manager.getAllNodeTypes();
        // loop all node types
        while (types.hasNext()) {
            NodeType currentType = types.nextNodeType();
            NodeDefinition defsOfCurrentType[] =
                    currentType.getChildNodeDefinitions();

            // loop all child node defs of each node type
            for (int i = 0; i < defsOfCurrentType.length; i++) {
View Full Code Here

        // TODO improve. retrieve settable node type name from config.
        NodeTypeManager manager = session.getWorkspace().getNodeTypeManager();
        NodeTypeIterator nts = manager.getPrimaryNodeTypes();
        while (nts.hasNext()) {
            NodeType nt = nts.nextNodeType();
            String ntName = nt.getName();
            if (!nt.isAbstract()) {
                try {
                    node.setPrimaryType(ntName);
                    superuser.save();
View Full Code Here

        NodeTypeManager manager = session.getWorkspace().getNodeTypeManager();
        NodeTypeIterator nts = manager.getMixinNodeTypes();
        while (nts.hasNext()) {
            try {
                Node node = testRootNode.addNode(nodeName1, testNodeType);
                node.setPrimaryType(nts.nextNodeType().getName());
                fail("Node.setPrimaryType(String) must throw ConstraintViolationException if the specified node type name refers to a mixin.");
            } catch (ConstraintViolationException e) {
                // success
            } finally {
                // reset the changes.
View Full Code Here

        Session session = testRootNode.getSession();

        NodeTypeManager manager = session.getWorkspace().getNodeTypeManager();
        NodeTypeIterator nts = manager.getPrimaryNodeTypes();
        while (nts.hasNext()) {
            NodeType nt = nts.nextNodeType();
            if (nt.isAbstract()) {
                try {
                    Node node = testRootNode.addNode(nodeName1, testNodeType);
                    node.setPrimaryType(nt.getName());
                    fail("Node.setPrimaryType(String) must throw ConstraintViolationException if the specified node type name refers to an abstract node type.");
View Full Code Here

        NodeTypeManager manager = session.getWorkspace().getNodeTypeManager();
        NodeTypeIterator nts = manager.getPrimaryNodeTypes();

        while (nts.hasNext()) {
            String name = nts.nextNodeType().getName();
            if (!name.equals(node.getPrimaryNodeType().getName())) {
                return name;
            }
        }
        return null;
View Full Code Here

        NodeTypeManager ntMgr = superuser.getWorkspace().getNodeTypeManager();
        NodeTypeIterator it = ntMgr.getPrimaryNodeTypes();
        NodeType testNt = ntMgr.getNodeType(testNodeType);
        while (it.hasNext()) {
            NodeType nt = it.nextNodeType();
            if (!testNt.isNodeType(nt.getName())) {
                // perform test
                Query q = qomFactory.createQuery(qomFactory.selector(nt.getName(), "s"),
                        qomFactory.descendantNode("s", testRoot), null, null);
                checkResult(q.execute(), new Node[]{});
View Full Code Here

    public void testGetDeclaringNodeType() throws RepositoryException {

        NodeTypeIterator types = manager.getAllNodeTypes();
        // loop all node types
        while (types.hasNext()) {
            NodeType currentType = types.nextNodeType();
            PropertyDefinition defsOfCurrentType[] =
                    currentType.getPropertyDefinitions();

            // loop all property defs of each node type
            for (int i = 0; i < defsOfCurrentType.length; i++) {
View Full Code Here

    public void testIsAutoCreate() throws RepositoryException {

        NodeTypeIterator types = manager.getAllNodeTypes();
        // loop all node types
        while (types.hasNext()) {
            NodeType type = types.nextNodeType();
            PropertyDefinition defs[] = type.getPropertyDefinitions();
            for (int i = 0; i < defs.length; i++) {
                if (defs[i].isAutoCreated()) {
                    assertFalse("An auto create property must not be a " +
                            "residual set definition.",
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.