Class ReadWriteNodeTypeManager

    • Constructor Detail

      • ReadWriteNodeTypeManager

        public ReadWriteNodeTypeManager()
    • Method Detail

      • createNodeTypeTemplate

        public javax.jcr.nodetype.NodeTypeTemplate createNodeTypeTemplate()
        Returns an empty NodeTypeTemplate which can then be used to define a node type and passed to NodeTypeManager.registerNodeType.
        Specified by:
        createNodeTypeTemplate in interface javax.jcr.nodetype.NodeTypeManager
        Overrides:
        createNodeTypeTemplate in class ReadOnlyNodeTypeManager
        Returns:
        A new empty NodeTypeTemplate.
        Since:
        JCR 2.0
      • createNodeTypeTemplate

        public javax.jcr.nodetype.NodeTypeTemplate createNodeTypeTemplate​(javax.jcr.nodetype.NodeTypeDefinition ntd)
                                                                   throws javax.jcr.nodetype.ConstraintViolationException
        Returns a NodeTypeTemplate from the given definition, which can then be used to define a node type and passed to NodeTypeManager.registerNodeType.
        Specified by:
        createNodeTypeTemplate in interface javax.jcr.nodetype.NodeTypeManager
        Overrides:
        createNodeTypeTemplate in class ReadOnlyNodeTypeManager
        Returns:
        A new NodeTypeTemplate.
        Throws:
        javax.jcr.nodetype.ConstraintViolationException
        Since:
        JCR 2.0
      • createNodeDefinitionTemplate

        public javax.jcr.nodetype.NodeDefinitionTemplate createNodeDefinitionTemplate()
        Returns an empty NodeDefinitionTemplate which can then be used to create a child node definition and attached to a NodeTypeTemplate.
        Specified by:
        createNodeDefinitionTemplate in interface javax.jcr.nodetype.NodeTypeManager
        Overrides:
        createNodeDefinitionTemplate in class ReadOnlyNodeTypeManager
        Returns:
        A new NodeDefinitionTemplate.
        Since:
        JCR 2.0
      • createPropertyDefinitionTemplate

        public javax.jcr.nodetype.PropertyDefinitionTemplate createPropertyDefinitionTemplate()
        Returns an empty PropertyDefinitionTemplate which can then be used to create a property definition and attached to a NodeTypeTemplate.
        Specified by:
        createPropertyDefinitionTemplate in interface javax.jcr.nodetype.NodeTypeManager
        Overrides:
        createPropertyDefinitionTemplate in class ReadOnlyNodeTypeManager
        Returns:
        A new PropertyDefinitionTemplate.
        Since:
        JCR 2.0
      • registerNodeType

        public javax.jcr.nodetype.NodeType registerNodeType​(javax.jcr.nodetype.NodeTypeDefinition ntd,
                                                            boolean allowUpdate)
                                                     throws javax.jcr.RepositoryException
        Registers a new node type or updates an existing node type using the specified definition and returns the resulting NodeType object.

        Typically, the object passed to this method will be a NodeTypeTemplate (a subclass of NodeTypeDefinition) acquired from NodeTypeManager.createNodeTypeTemplate and then filled-in with definition information.

        Specified by:
        registerNodeType in interface javax.jcr.nodetype.NodeTypeManager
        Overrides:
        registerNodeType in class ReadOnlyNodeTypeManager
        Parameters:
        ntd - an NodeTypeDefinition.
        allowUpdate - a boolean
        Returns:
        the registered node type
        Throws:
        javax.jcr.nodetype.NodeTypeExistsException - if allowUpdate is false and the NodeTypeDefinition specifies a node type name that is already registered.
        javax.jcr.RepositoryException - if another error occurs.
        Since:
        JCR 2.0
      • registerNodeTypes

        public final javax.jcr.nodetype.NodeTypeIterator registerNodeTypes​(javax.jcr.nodetype.NodeTypeDefinition[] ntds,
                                                                           boolean allowUpdate)
                                                                    throws javax.jcr.RepositoryException
        Registers or updates the specified array of NodeTypeDefinition objects. This method is used to register or update a set of node types with mutual dependencies. Returns an iterator over the resulting NodeType objects.

        The effect of the method is "all or nothing"; if an error occurs, no node types are registered or updated.

        Specified by:
        registerNodeTypes in interface javax.jcr.nodetype.NodeTypeManager
        Overrides:
        registerNodeTypes in class ReadOnlyNodeTypeManager
        Parameters:
        ntds - a collection of NodeTypeDefinitions
        allowUpdate - a boolean
        Returns:
        the registered node types.
        Throws:
        javax.jcr.nodetype.NodeTypeExistsException - if allowUpdate is false and a NodeTypeDefinition within the Collection specifies a node type name that is already registered.
        javax.jcr.RepositoryException - if another error occurs.
        Since:
        JCR 2.0
      • unregisterNodeType

        public void unregisterNodeType​(java.lang.String name)
                                throws javax.jcr.RepositoryException
        Unregisters the specified node type.
        Specified by:
        unregisterNodeType in interface javax.jcr.nodetype.NodeTypeManager
        Overrides:
        unregisterNodeType in class ReadOnlyNodeTypeManager
        Parameters:
        name - a String.
        Throws:
        javax.jcr.nodetype.NoSuchNodeTypeException - if no registered node type exists with the specified name.
        javax.jcr.RepositoryException - if another error occurs.
        Since:
        JCR 2.0
      • unregisterNodeTypes

        public void unregisterNodeTypes​(java.lang.String[] names)
                                 throws javax.jcr.RepositoryException
        Unregisters the specified set of node types. Used to unregister a set of node types with mutual dependencies.
        Specified by:
        unregisterNodeTypes in interface javax.jcr.nodetype.NodeTypeManager
        Overrides:
        unregisterNodeTypes in class ReadOnlyNodeTypeManager
        Parameters:
        names - a String array
        Throws:
        javax.jcr.nodetype.NoSuchNodeTypeException - if one of the names listed is not a registered node type.
        javax.jcr.RepositoryException - if another error occurs.
        Since:
        JCR 2.0