Class CndImporter
- java.lang.Object
-
- org.apache.jackrabbit.commons.cnd.CndImporter
-
public final class CndImporter extends java.lang.Object
Utility class for importing compact node type definitions.- See Also:
CompactNodeTypeDefReader
,TemplateBuilderFactory
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static NodeType[]
registerNodeTypes(java.io.Reader cnd, java.lang.String systemId, NodeTypeManager nodeTypeManager, NamespaceRegistry namespaceRegistry, ValueFactory valueFactory, boolean reregisterExisting)
Registers nodetypes incnd
format.static NodeType[]
registerNodeTypes(java.io.Reader cnd, Session session)
Shortcut forstatic NodeType[]
registerNodeTypes(java.io.Reader cnd, Session session, boolean reregisterExisting)
Shortcut for
-
-
-
Method Detail
-
registerNodeTypes
public static NodeType[] registerNodeTypes(java.io.Reader cnd, Session session) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, UnsupportedRepositoryOperationException, ParseException, RepositoryException, java.io.IOException
Shortcut forregisterNodeTypes(cnd, "cnd input stream", wsp.getNodeTypeManager(), wsp.getNamespaceRegistry(), session.getValueFactory(), false);
wherewsp
is the workspace of thesession
passed.- Parameters:
cnd
-session
- the session to use for registering the node types- Returns:
- the registered node types
- Throws:
InvalidNodeTypeDefinitionException
NodeTypeExistsException
UnsupportedRepositoryOperationException
ParseException
RepositoryException
java.io.IOException
- See Also:
registerNodeTypes(Reader, String, NodeTypeManager, NamespaceRegistry, ValueFactory, boolean)
-
registerNodeTypes
public static NodeType[] registerNodeTypes(java.io.Reader cnd, Session session, boolean reregisterExisting) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, UnsupportedRepositoryOperationException, ParseException, RepositoryException, java.io.IOException
Shortcut forregisterNodeTypes(cnd, "cnd input stream", wsp.getNodeTypeManager(), wsp.getNamespaceRegistry(), session.getValueFactory(), reregisterExisting);
wherewsp
is the workspace of thesession
passed.- Parameters:
cnd
-session
- the session to use for registering the node typesreregisterExisting
-true
if existing node types should be re-registered with those present in the cnd.false
otherwise.- Returns:
- the registered node types
- Throws:
InvalidNodeTypeDefinitionException
NodeTypeExistsException
UnsupportedRepositoryOperationException
ParseException
RepositoryException
java.io.IOException
- See Also:
registerNodeTypes(Reader, String, NodeTypeManager, NamespaceRegistry, ValueFactory, boolean)
-
registerNodeTypes
public static NodeType[] registerNodeTypes(java.io.Reader cnd, java.lang.String systemId, NodeTypeManager nodeTypeManager, NamespaceRegistry namespaceRegistry, ValueFactory valueFactory, boolean reregisterExisting) throws ParseException, InvalidNodeTypeDefinitionException, NodeTypeExistsException, UnsupportedRepositoryOperationException, RepositoryException, java.io.IOException
Registers nodetypes incnd
format.- Parameters:
cnd
- a reader to the cnd. The reader is closed on return.systemId
- a informative id of the given cnd input.nodeTypeManager
- theNodeTypeManager
used for creating and registering theNodeTypeTemplate
s,NodeDefinitionTemplate
s andPropertyDefinitionTemplate
s defined in the cnd.namespaceRegistry
- theNamespaceRegistry
used for registering namespaces defined in the cnd.valueFactory
- theValueFactory
used to createdefault value(s)
.reregisterExisting
-true
if existing node types should be re-registered with those present in the cnd.false
otherwise.- Returns:
- the registered node types
- Throws:
ParseException
- if the cnd cannot be parsedInvalidNodeTypeDefinitionException
- if aNodeTypeDefinition
is invalid.NodeTypeExistsException
- ifreregisterExisting
isfalse
and aNodeTypeDefinition
specifies a node type name that is already registered.UnsupportedRepositoryOperationException
- if theNodeTypeManager
does not support node type registration.java.io.IOException
- if closing the cnd reader failsRepositoryException
- if another error occurs.
-
-