You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by ju...@apache.org on 2010/12/08 18:58:16 UTC
svn commit: r1043555 - in /jackrabbit/branches/2.2: ./
jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/CndImporter.java
Author: jukka
Date: Wed Dec 8 17:58:15 2010
New Revision: 1043555
URL: http://svn.apache.org/viewvc?rev=1043555&view=rev
Log:
2.2: Merged revision 1043554 (JCR-2761)
Modified:
jackrabbit/branches/2.2/ (props changed)
jackrabbit/branches/2.2/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/CndImporter.java
Propchange: jackrabbit/branches/2.2/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Dec 8 17:58:15 2010
@@ -2,4 +2,4 @@
/jackrabbit/sandbox/JCR-1456:774917-886178
/jackrabbit/sandbox/JCR-2170:812417-816332
/jackrabbit/sandbox/tripod-JCR-2209:795441-795863
-/jackrabbit/trunk:1038201,1038203,1038205,1038657,1039064,1039347,1039408,1039422-1039423,1039888,1039946,1040033,1040090,1040459,1040601,1040606,1040661,1040958,1041379,1041439,1041761,1042643,1042647,1042978-1042982,1043084-1043086,1043088,1043343,1043357-1043358,1043430
+/jackrabbit/trunk:1038201,1038203,1038205,1038657,1039064,1039347,1039408,1039422-1039423,1039888,1039946,1040033,1040090,1040459,1040601,1040606,1040661,1040958,1041379,1041439,1041761,1042643,1042647,1042978-1042982,1043084-1043086,1043088,1043343,1043357-1043358,1043430,1043554
Modified: jackrabbit/branches/2.2/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/CndImporter.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/CndImporter.java?rev=1043555&r1=1043554&r2=1043555&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/CndImporter.java (original)
+++ jackrabbit/branches/2.2/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/cnd/CndImporter.java Wed Dec 8 17:58:15 2010
@@ -76,6 +76,36 @@ public final class CndImporter {
}
/**
+ * Shortcut for
+ * <pre>
+ * registerNodeTypes(cnd, "cnd input stream", wsp.getNodeTypeManager(),
+ * wsp.getNamespaceRegistry(), session.getValueFactory(), reregisterExisting);
+ * </pre>
+ * where <code>wsp</code> is the workspace of the <code>session</code> passed.
+ * @see #registerNodeTypes(Reader, String, NodeTypeManager, NamespaceRegistry, ValueFactory, boolean)
+ * @param cnd
+ * @param session the session to use for registering the node types
+ * @param reregisterExisting <code>true</code> if existing node types should be re-registered
+ * with those present in the cnd. <code>false</code> otherwise.
+ * @return the registered node types
+ *
+ * @throws InvalidNodeTypeDefinitionException
+ * @throws NodeTypeExistsException
+ * @throws UnsupportedRepositoryOperationException
+ * @throws ParseException
+ * @throws RepositoryException
+ * @throws IOException
+ */
+ public static NodeType[] registerNodeTypes(Reader cnd, Session session, boolean reregisterExisting)
+ throws InvalidNodeTypeDefinitionException, NodeTypeExistsException,
+ UnsupportedRepositoryOperationException, ParseException, RepositoryException, IOException {
+
+ Workspace wsp = session.getWorkspace();
+ return registerNodeTypes(cnd, "cnd input stream", wsp.getNodeTypeManager(), wsp.getNamespaceRegistry(),
+ session.getValueFactory(), reregisterExisting);
+ }
+
+ /**
* Registers nodetypes in <code>cnd</code> format.
* @param cnd a reader to the cnd. The reader is closed on return.
* @param systemId a informative id of the given cnd input.