Class CndImporter
- java.lang.Object
-
- org.apache.jackrabbit.commons.cnd.CndImporter
-
public final class CndImporter extends 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(Reader cnd, String systemId, NodeTypeManager nodeTypeManager, NamespaceRegistry namespaceRegistry, ValueFactory valueFactory, boolean reregisterExisting)Registers nodetypes incndformat.static NodeType[]registerNodeTypes(Reader cnd, Session session)Shortcut forstatic NodeType[]registerNodeTypes(Reader cnd, Session session, boolean reregisterExisting)Shortcut for
-
-
-
Method Detail
-
registerNodeTypes
public static NodeType[] registerNodeTypes(Reader cnd, Session session) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, UnsupportedRepositoryOperationException, ParseException, RepositoryException, IOException
Shortcut forregisterNodeTypes(cnd, "cnd input stream", wsp.getNodeTypeManager(), wsp.getNamespaceRegistry(), session.getValueFactory(), false);wherewspis the workspace of thesessionpassed.- Parameters:
cnd-session- the session to use for registering the node types- Returns:
- the registered node types
- Throws:
InvalidNodeTypeDefinitionExceptionNodeTypeExistsExceptionUnsupportedRepositoryOperationExceptionParseExceptionRepositoryExceptionIOException- See Also:
registerNodeTypes(Reader, String, NodeTypeManager, NamespaceRegistry, ValueFactory, boolean)
-
registerNodeTypes
public static NodeType[] registerNodeTypes(Reader cnd, Session session, boolean reregisterExisting) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, UnsupportedRepositoryOperationException, ParseException, RepositoryException, IOException
Shortcut forregisterNodeTypes(cnd, "cnd input stream", wsp.getNodeTypeManager(), wsp.getNamespaceRegistry(), session.getValueFactory(), reregisterExisting);wherewspis the workspace of thesessionpassed.- Parameters:
cnd-session- the session to use for registering the node typesreregisterExisting-trueif existing node types should be re-registered with those present in the cnd.falseotherwise.- Returns:
- the registered node types
- Throws:
InvalidNodeTypeDefinitionExceptionNodeTypeExistsExceptionUnsupportedRepositoryOperationExceptionParseExceptionRepositoryExceptionIOException- See Also:
registerNodeTypes(Reader, String, NodeTypeManager, NamespaceRegistry, ValueFactory, boolean)
-
registerNodeTypes
public static NodeType[] registerNodeTypes(Reader cnd, String systemId, NodeTypeManager nodeTypeManager, NamespaceRegistry namespaceRegistry, ValueFactory valueFactory, boolean reregisterExisting) throws ParseException, InvalidNodeTypeDefinitionException, NodeTypeExistsException, UnsupportedRepositoryOperationException, RepositoryException, IOException
Registers nodetypes incndformat.- Parameters:
cnd- a reader to the cnd. The reader is closed on return.systemId- a informative id of the given cnd input.nodeTypeManager- theNodeTypeManagerused for creating and registering theNodeTypeTemplates,NodeDefinitionTemplates andPropertyDefinitionTemplates defined in the cnd.namespaceRegistry- theNamespaceRegistryused for registering namespaces defined in the cnd.valueFactory- theValueFactoryused to createdefault value(s).reregisterExisting-trueif existing node types should be re-registered with those present in the cnd.falseotherwise.- Returns:
- the registered node types
- Throws:
ParseException- if the cnd cannot be parsedInvalidNodeTypeDefinitionException- if aNodeTypeDefinitionis invalid.NodeTypeExistsException- ifreregisterExistingisfalseand aNodeTypeDefinitionspecifies a node type name that is already registered.UnsupportedRepositoryOperationException- if theNodeTypeManagerdoes not support node type registration.IOException- if closing the cnd reader failsRepositoryException- if another error occurs.
-
-