Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| ModeShape Distribution 3.0.0.Alpha6
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.modeshape.jcr.api.nodetype
Interface NodeTypeManager

All Superinterfaces:
  NodeTypeManager

    public interface NodeTypeManager

extends NodeTypeManager

An extension of JCR 2.0's `NodeTypeManager` interface, with methods to support registering node type definitions from CND and Jackrabbit XML files.

Method Summary
`NodeTypeIterator` | `registerNodeTypes(File file, boolean allowUpdate)` Registers or updates the node type definitions per the Compact Node Definition (CND) file given by the supplied file.
`NodeTypeIterator` | `registerNodeTypes(InputStream stream, boolean allowUpdate)` Registers or updates the node type definitions per the Compact Node Definition (CND) file given by the supplied stream.
`NodeTypeIterator` | `registerNodeTypes(URL url, boolean allowUpdate)` Registers or updates the node type definitions per the Compact Node Definition (CND) file given by the supplied URL.

Methods inherited from interface javax.jcr.nodetype.NodeTypeManager
`createNodeDefinitionTemplate, createNodeTypeTemplate, createNodeTypeTemplate, createPropertyDefinitionTemplate, getAllNodeTypes, getMixinNodeTypes, getNodeType, getPrimaryNodeTypes, hasNodeType, registerNodeType, registerNodeTypes, unregisterNodeType, unregisterNodeTypes`

Method Detail

### registerNodeTypes

    NodeTypeIterator registerNodeTypes(InputStream stream,
                                       boolean allowUpdate)
                                       throws IOException,
                                              InvalidNodeTypeDefinitionException,
                                              NodeTypeExistsException,
                                              UnsupportedRepositoryOperationException,
                                              RepositoryException

  Registers or updates the node type definitions per the Compact Node Definition (CND) file given by the supplied stream. 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.

  Parameters:
    `stream` - the stream containing the node type definitions in CND format
    `allowUpdate` - a boolean stating whether existing node type definitions should be modified/updated
  Returns:
    the registered node types.
  Throws:
    `IOException` - if there is a problem reading from the supplied stream
    `InvalidNodeTypeDefinitionException` - if a `NodeTypeDefinition` within the `Collection` is invalid or if the `Collection` contains an object of a type other than `NodeTypeDefinition`.
    `NodeTypeExistsException` - if `allowUpdate` is `false` and a `NodeTypeDefinition` within the `Collection` specifies a node type name that is already registered.
    `UnsupportedRepositoryOperationException` - if this implementation does not support node type registration.
    `RepositoryException` - if another error occurs.

### registerNodeTypes

    NodeTypeIterator registerNodeTypes(File file,
                                       boolean allowUpdate)
                                       throws IOException,
                                              InvalidNodeTypeDefinitionException,
                                              NodeTypeExistsException,
                                              UnsupportedRepositoryOperationException,
                                              RepositoryException

  Registers or updates the node type definitions per the Compact Node Definition (CND) file given by the supplied file. 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.

  Parameters:
    `file` - the file containing the node types
    `allowUpdate` - a boolean stating whether existing node type definitions should be modified/updated
  Returns:
    the registered node types.
  Throws:
    `IOException` - if there is a problem reading from the supplied stream
    `InvalidNodeTypeDefinitionException` - if a `NodeTypeDefinition` within the `Collection` is invalid or if the `Collection` contains an object of a type other than `NodeTypeDefinition`.
    `NodeTypeExistsException` - if `allowUpdate` is `false` and a `NodeTypeDefinition` within the `Collection` specifies a node type name that is already registered.
    `UnsupportedRepositoryOperationException` - if this implementation does not support node type registration.
    `RepositoryException` - if another error occurs.

### registerNodeTypes

    NodeTypeIterator registerNodeTypes(URL url,
                                       boolean allowUpdate)
                                       throws IOException,
                                              InvalidNodeTypeDefinitionException,
                                              NodeTypeExistsException,
                                              UnsupportedRepositoryOperationException,
                                              RepositoryException

  Registers or updates the node type definitions per the Compact Node Definition (CND) file given by the supplied URL. 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.

  Parameters:
    `url` - the URL that can be resolved to the file containing the node type definitions in CND format
    `allowUpdate` - a boolean stating whether existing node type definitions should be modified/updated
  Returns:
    the registered node types.
  Throws:
    `IOException` - if there is a problem reading from the supplied stream
    `InvalidNodeTypeDefinitionException` - if a `NodeTypeDefinition` within the `Collection` is invalid or if the `Collection` contains an object of a type other than `NodeTypeDefinition`.
    `NodeTypeExistsException` - if `allowUpdate` is `false` and a `NodeTypeDefinition` within the `Collection` specifies a node type name that is already registered.
    `UnsupportedRepositoryOperationException` - if this implementation does not support node type registration.
    `RepositoryException` - if another error occurs.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| ModeShape Distribution 3.0.0.Alpha6
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.