Class CndImporter

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static javax.jcr.nodetype.NodeType[] registerNodeTypes​(java.io.Reader cnd, java.lang.String systemId, javax.jcr.nodetype.NodeTypeManager nodeTypeManager, javax.jcr.NamespaceRegistry namespaceRegistry, javax.jcr.ValueFactory valueFactory, boolean reregisterExisting)
      Registers nodetypes in cnd format.
      static javax.jcr.nodetype.NodeType[] registerNodeTypes​(java.io.Reader cnd, javax.jcr.Session session)
      Shortcut for
      static javax.jcr.nodetype.NodeType[] registerNodeTypes​(java.io.Reader cnd, javax.jcr.Session session, boolean reregisterExisting)
      Shortcut for
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • registerNodeTypes

        public static javax.jcr.nodetype.NodeType[] registerNodeTypes​(java.io.Reader cnd,
                                                                      javax.jcr.Session session)
                                                               throws javax.jcr.nodetype.InvalidNodeTypeDefinitionException,
                                                                      javax.jcr.nodetype.NodeTypeExistsException,
                                                                      javax.jcr.UnsupportedRepositoryOperationException,
                                                                      ParseException,
                                                                      javax.jcr.RepositoryException,
                                                                      java.io.IOException
        Shortcut for
           registerNodeTypes(cnd, "cnd input stream", wsp.getNodeTypeManager(),
                  wsp.getNamespaceRegistry(), session.getValueFactory(), false);
         
        where wsp is the workspace of the session passed.
        Parameters:
        cnd -
        session - the session to use for registering the node types
        Returns:
        the registered node types
        Throws:
        javax.jcr.nodetype.InvalidNodeTypeDefinitionException
        javax.jcr.nodetype.NodeTypeExistsException
        javax.jcr.UnsupportedRepositoryOperationException
        ParseException
        javax.jcr.RepositoryException
        java.io.IOException
        See Also:
        registerNodeTypes(Reader, String, NodeTypeManager, NamespaceRegistry, ValueFactory, boolean)
      • registerNodeTypes

        public static javax.jcr.nodetype.NodeType[] registerNodeTypes​(java.io.Reader cnd,
                                                                      javax.jcr.Session session,
                                                                      boolean reregisterExisting)
                                                               throws javax.jcr.nodetype.InvalidNodeTypeDefinitionException,
                                                                      javax.jcr.nodetype.NodeTypeExistsException,
                                                                      javax.jcr.UnsupportedRepositoryOperationException,
                                                                      ParseException,
                                                                      javax.jcr.RepositoryException,
                                                                      java.io.IOException
        Shortcut for
           registerNodeTypes(cnd, "cnd input stream", wsp.getNodeTypeManager(),
                  wsp.getNamespaceRegistry(), session.getValueFactory(), reregisterExisting);
         
        where wsp is the workspace of the session passed.
        Parameters:
        cnd -
        session - the session to use for registering the node types
        reregisterExisting - true if existing node types should be re-registered with those present in the cnd. false otherwise.
        Returns:
        the registered node types
        Throws:
        javax.jcr.nodetype.InvalidNodeTypeDefinitionException
        javax.jcr.nodetype.NodeTypeExistsException
        javax.jcr.UnsupportedRepositoryOperationException
        ParseException
        javax.jcr.RepositoryException
        java.io.IOException
        See Also:
        registerNodeTypes(Reader, String, NodeTypeManager, NamespaceRegistry, ValueFactory, boolean)
      • registerNodeTypes

        public static javax.jcr.nodetype.NodeType[] registerNodeTypes​(java.io.Reader cnd,
                                                                      java.lang.String systemId,
                                                                      javax.jcr.nodetype.NodeTypeManager nodeTypeManager,
                                                                      javax.jcr.NamespaceRegistry namespaceRegistry,
                                                                      javax.jcr.ValueFactory valueFactory,
                                                                      boolean reregisterExisting)
                                                               throws ParseException,
                                                                      javax.jcr.nodetype.InvalidNodeTypeDefinitionException,
                                                                      javax.jcr.nodetype.NodeTypeExistsException,
                                                                      javax.jcr.UnsupportedRepositoryOperationException,
                                                                      javax.jcr.RepositoryException,
                                                                      java.io.IOException
        Registers nodetypes in cnd format.
        Parameters:
        cnd - a reader to the cnd. The reader is closed on return.
        systemId - a informative id of the given cnd input.
        nodeTypeManager - the NodeTypeManager used for creating and registering the NodeTypeTemplates, NodeDefinitionTemplates and PropertyDefinitionTemplates defined in the cnd.
        namespaceRegistry - the NamespaceRegistry used for registering namespaces defined in the cnd.
        valueFactory - the ValueFactory used to create default 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 parsed
        javax.jcr.nodetype.InvalidNodeTypeDefinitionException - if a NodeTypeDefinition is invalid.
        javax.jcr.nodetype.NodeTypeExistsException - if reregisterExisting is false and a NodeTypeDefinition specifies a node type name that is already registered.
        javax.jcr.UnsupportedRepositoryOperationException - if the NodeTypeManager does not support node type registration.
        java.io.IOException - if closing the cnd reader fails
        javax.jcr.RepositoryException - if another error occurs.