Package javax.jcr.nodetype

Examples of javax.jcr.nodetype.NodeTypeIterator


                                                    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

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

     * requested child node def. Test runs for all existing node types.
     */
    public void testGetDeclaringNodeType()
            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

     * does not return "*")
     */
    public void testIsAutoCreate()
            throws RepositoryException {

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

     * runs for all existing node types.
     */
    public void testGetRequiredPrimaryTypes()
            throws RepositoryException {

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

            for (int i = 0; i < defs.length; i++) {
                assertTrue("getRequiredPrimaryTypes() must never return an " +
                        "empty array.",
View Full Code Here

     * the required primary types. Test runs for all existing node types.
     */
    public void testGetDefaultPrimaryTypes()
            throws RepositoryException {

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

            for (int i = 0; i < defs.length; i++) {

                NodeDefinition def = defs[i];
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.