Package javax.jcr.nodetype

Examples of javax.jcr.nodetype.NodeTypeIterator


                manager.getNodeType(type.getName()).getName(),
                type.getName());


        StringBuffer notExistingName = new StringBuffer("X");
        NodeTypeIterator types = manager.getAllNodeTypes();
        while (types.hasNext()) {
            // build a name which is for sure not existing
            // (":" of namespace prefix will be replaced later on)
            notExistingName.append(types.nextNodeType().getName());
        }
        try {
            manager.getNodeType(notExistingName.toString().replaceAll(":", ""));
            fail("getNodeType(String nodeTypeName) must throw a " +
                    "NoSuchNodeTypeException if no according NodeType " +
View Full Code Here


    /**
     * Test if getPrimaryNodeTypes does not return any mixin node types
     */
    public void testGetPrimaryNodeTypes() throws RepositoryException {
        NodeTypeIterator types = manager.getPrimaryNodeTypes();
        while (types.hasNext()) {
            assertFalse("getPrimaryNodeTypes() must not return mixin " +
                    "node types",
                    types.nextNodeType().isMixin());
        }
    }
View Full Code Here

    /**
     * Test if getMixinNodeTypes does return exclusively mixin node types
     */
    public void testGetMixinNodeTypes() throws RepositoryException {
        NodeTypeIterator types = manager.getMixinNodeTypes();
        while (types.hasNext()) {
            assertTrue("getMixinNodeTypes() must return exclusively mixin " +
                    "node types",
                    types.nextNodeType().isMixin());
        }
    }
View Full Code Here

    /**
     * Tests if all primary node types are subtypes of node type <code>nt:base</code>
     */
    public void testIfPrimaryNodeTypesAreSubtypesOfNTBase()
            throws RepositoryException {
        NodeTypeIterator types = manager.getPrimaryNodeTypes();
        while (types.hasNext()) {
            NodeType type = types.nextNodeType();
            assertTrue("Primary node type " + type.getName() +
                    " must inherit nt:base",
                    type.isNodeType("nt:base"));
        }
    }
View Full Code Here

                                                    boolean defaultPrimaryType,
                                                    boolean residual)
            throws RepositoryException {

        NodeTypeManager manager = session.getWorkspace().getNodeTypeManager();
        NodeTypeIterator types = manager.getAllNodeTypes();

        boolean overjump = false;

        while (types.hasNext()) {
            NodeType type = types.nextNodeType();

            // node types with more than one residual child node definition
            // will cause trouble in test cases. the implementation
            // might pick another definition than the definition returned by
            // this method, when a child node is set.
View Full Code Here

                                                    boolean isProtected,
                                                    boolean mandatory)
            throws RepositoryException {

        NodeTypeManager manager = session.getWorkspace().getNodeTypeManager();
        NodeTypeIterator types = manager.getAllNodeTypes();

        while (types.hasNext()) {
            NodeType type = types.nextNodeType();
            NodeDefinition nodeDefs[] = type.getDeclaredChildNodeDefinitions();

            for (int i = 0; i < nodeDefs.length; i++) {
                NodeDefinition nodeDef = nodeDefs[i];
View Full Code Here

                                                       boolean constraints,
                                                       boolean residual)
            throws RepositoryException {

        NodeTypeManager manager = session.getWorkspace().getNodeTypeManager();
        NodeTypeIterator types = manager.getAllNodeTypes();

        while (types.hasNext()) {
            NodeType type = types.nextNodeType();
            PropertyDefinition propDefs[] = type.getDeclaredPropertyDefinitions();
            for (int i = 0; i < propDefs.length; i++) {
                PropertyDefinition propDef = propDefs[i];

                if (propertyType != ANY_PROPERTY_TYPE &&
View Full Code Here

                                                       boolean isProtected,
                                                       boolean mandatory)
            throws RepositoryException {

        NodeTypeManager manager = session.getWorkspace().getNodeTypeManager();
        NodeTypeIterator types = manager.getAllNodeTypes();

        while (types.hasNext()) {
            NodeType type = types.nextNodeType();
            PropertyDefinition propDefs[] = type.getDeclaredPropertyDefinitions();
            for (int i = 0; i < propDefs.length; i++) {
                PropertyDefinition propDef = propDefs[i];

                if (propDef.getName().equals("*")) {
View Full Code Here

     */
    public static String getIllegalChildNodeType(NodeTypeManager manager,
                                                 String legalType)
            throws RepositoryException {

        NodeTypeIterator types = manager.getAllNodeTypes();
        while (types.hasNext()) {
            NodeType type = types.nextNodeType();
            if (!type.getName().equals(legalType)) {
                NodeType superTypes[] = type.getSupertypes();
                boolean isSubType = false;
                for (int i = 0; i < superTypes.length; i++) {
                    String name = superTypes[i].getName();
View Full Code Here

        String constraints[] = propDef.getValueConstraints();
        String nodeTypeNotSatisfied = null;

        NodeTypeManager manager = superuser.getWorkspace().getNodeTypeManager();
        NodeTypeIterator types = manager.getAllNodeTypes();

        // find a NodeType which is not satisfying the constraints
        findNodeTypeNotSatisfied:
            while (types.hasNext()) {
                NodeType type = types.nextNodeType();
                String name = type.getName();
                for (int i = 0; i < constraints.length; i++) {
                    if (name.equals(constraints[i])) {
                        continue findNodeTypeNotSatisfied;
                    }
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.