[dna-commits] DNA SVN: r892 - in tags/dna-0.4/docs/examples/gettingstarted/repositories/src: main/config and 3 other directories.

dna-commits at lists.jboss.org dna-commits at lists.jboss.org
Wed May 6 16:40:31 EDT 2009


Author: bcarothers
Date: 2009-05-06 16:40:31 -0400 (Wed, 06 May 2009)
New Revision: 892

Added:
   tags/dna-0.4/docs/examples/gettingstarted/repositories/src/main/config/run.cmd
Modified:
   tags/dna-0.4/docs/examples/gettingstarted/repositories/src/main/assembly/basic.xml
   tags/dna-0.4/docs/examples/gettingstarted/repositories/src/main/java/org/jboss/example/dna/repository/RepositoryClient.java
   tags/dna-0.4/docs/examples/gettingstarted/repositories/src/main/resources/configRepository.xml
   tags/dna-0.4/docs/examples/gettingstarted/repositories/src/test/java/org/jboss/example/dna/repository/RepositoryClientTest.java
Log:
Backed DNA-395 patches from trunk into 0.4 branch

Modified: tags/dna-0.4/docs/examples/gettingstarted/repositories/src/main/assembly/basic.xml
===================================================================
--- tags/dna-0.4/docs/examples/gettingstarted/repositories/src/main/assembly/basic.xml	2009-05-06 20:25:57 UTC (rev 891)
+++ tags/dna-0.4/docs/examples/gettingstarted/repositories/src/main/assembly/basic.xml	2009-05-06 20:40:31 UTC (rev 892)
@@ -26,6 +26,10 @@
       <fileMode>0744</fileMode>
     </file>
     <file>
+      <source>src/main/config/run.cmd</source>
+      <fileMode>0744</fileMode>
+    </file>
+    <file>
       <source>src/main/resources/log4j.properties</source>
       <fileMode>0644</fileMode>
     </file>

Added: tags/dna-0.4/docs/examples/gettingstarted/repositories/src/main/config/run.cmd
===================================================================
--- tags/dna-0.4/docs/examples/gettingstarted/repositories/src/main/config/run.cmd	                        (rev 0)
+++ tags/dna-0.4/docs/examples/gettingstarted/repositories/src/main/config/run.cmd	2009-05-06 20:40:31 UTC (rev 892)
@@ -0,0 +1 @@
+java -Djava.ext.dirs=./lib -cp dna-example-repositories-0.5-SNAPSHOT.jar org.jboss.example.dna.repository.RepositoryClient %*

Modified: tags/dna-0.4/docs/examples/gettingstarted/repositories/src/main/java/org/jboss/example/dna/repository/RepositoryClient.java
===================================================================
--- tags/dna-0.4/docs/examples/gettingstarted/repositories/src/main/java/org/jboss/example/dna/repository/RepositoryClient.java	2009-05-06 20:25:57 UTC (rev 891)
+++ tags/dna-0.4/docs/examples/gettingstarted/repositories/src/main/java/org/jboss/example/dna/repository/RepositoryClient.java	2009-05-06 20:40:31 UTC (rev 892)
@@ -160,6 +160,12 @@
 
         Graph aircraft = Graph.create("Aircraft", sources, context);
         aircraft.importXmlFrom(location + "/aircraft.xml").into("/");
+
+        Graph vehicles = Graph.create("Vehicles", sources, context);
+        vehicles.create("/Vehicles");
+        vehicles.importXmlFrom(location + "/cars.xml").into("/Vehicles");
+        vehicles.importXmlFrom(location + "/aircraft.xml").into("/Vehicles");
+    
     }
 
     /**

Modified: tags/dna-0.4/docs/examples/gettingstarted/repositories/src/main/resources/configRepository.xml
===================================================================
--- tags/dna-0.4/docs/examples/gettingstarted/repositories/src/main/resources/configRepository.xml	2009-05-06 20:25:57 UTC (rev 891)
+++ tags/dna-0.4/docs/examples/gettingstarted/repositories/src/main/resources/configRepository.xml	2009-05-06 20:40:31 UTC (rev 892)
@@ -31,34 +31,7 @@
     <dna:sources jcr:primaryType="nt:unstructured">
         <dna:source jcr:name="SourceA" jcr:primaryType="nt:unstructured" dna:name="Cars" dna:classname="org.jboss.dna.graph.connector.inmemory.InMemoryRepositorySource" dna:retryLimit="3" defaultWorkspaceName="default"/>
         <dna:source jcr:name="SourceB" jcr:primaryType="nt:unstructured" dna:name="Aircraft" dna:classname="org.jboss.dna.graph.connector.inmemory.InMemoryRepositorySource" defaultWorkspaceName="default"/>
-        <dna:source jcr:name="SourceC" jcr:primaryType="nt:unstructured" dna:name="Vehicles" dna:classname="org.jboss.dna.connector.federation.FederatedRepositorySource" 
-                    dna:repositoryName="Configuration Repository"
-                    dna:configurationSourceName="Configuration" 
-                    dna:configurationWorkspaceName="default"
-                    dna:configurationSourcePath="/jcr:system/dna:federatedRepositories/Vehicles" 
-                    dna:repositoryConnectionFactoryJndiName="/dna/connectionFactory"
-                    dna:executionContextFactoryJndiName="/dna/contextFactory"/>
+        <dna:source jcr:name="SourceC" jcr:primaryType="nt:unstructured" dna:name="Vehicles" dna:classname="org.jboss.dna.graph.connector.inmemory.InMemoryRepositorySource" defaultWorkspaceName="default"/>
         <dna:source jcr:name="SourceD" jcr:primaryType="nt:unstructured" dna:name="Cache" dna:classname="org.jboss.dna.graph.connector.inmemory.InMemoryRepositorySource" defaultWorkspaceName="default"/>
     </dna:sources>
-    <dna:federatedRepositories jcr:primaryType="nt:unstructured">
-        <!-- This section defines from where the content of the 'Vehicles' federated repository is obtained.
-             The name of this node must match the 'name' of the source listed above. -->
-        <dna:federatedRepository jcr:name="Vehicles" jcr:primaryType="nt:unstructured">
-            <!-- Define the workspace(s) for this repository -->
-            <dna:workspaces jcr:primaryType="nt:unstructured">
-                <dna:workspace jcr:name="default" jcr:primaryType="nt:unstructured">
-                    <!-- Define how the content in the 'Cache' source is to map to the federated cache -->
-                    <dna:cache jcr:primaryType="nt:unstructured" dna:sourceName="Cache" dna:workspaceName="default" dna:projectionRules="/ => /" />
-                    <!-- Define how the content in the difference sources maps to the federated/unified repository.
-                         This example puts the 'Cars' and 'Aircraft' content underneath '/vehicles', but the
-                         'Configuration' content (which is defined by this file) will appear under '/'. -->
-                    <dna:projections jcr:primaryType="nt:unstructured">
-                        <dna:projection jcr:primaryType="nt:unstructured" jcr:name="Cars" dna:workspaceName="default"  dna:projectionRules="/Vehicles => /" />
-                        <dna:projection jcr:primaryType="nt:unstructured" jcr:name="Aircraft" dna:workspaceName="default"  dna:projectionRules="/Vehicles => /" />
-                        <dna:projection jcr:primaryType="nt:unstructured" jcr:name="Configuration" dna:workspaceName="default"  dna:projectionRules="/ => /" />
-                    </dna:projections>
-                </dna:workspace>
-            </dna:workspaces>
-        </dna:federatedRepository>
-    </dna:federatedRepositories>
 </jcr:system>
\ No newline at end of file

Modified: tags/dna-0.4/docs/examples/gettingstarted/repositories/src/test/java/org/jboss/example/dna/repository/RepositoryClientTest.java
===================================================================
--- tags/dna-0.4/docs/examples/gettingstarted/repositories/src/test/java/org/jboss/example/dna/repository/RepositoryClientTest.java	2009-05-06 20:25:57 UTC (rev 891)
+++ tags/dna-0.4/docs/examples/gettingstarted/repositories/src/test/java/org/jboss/example/dna/repository/RepositoryClientTest.java	2009-05-06 20:40:31 UTC (rev 892)
@@ -110,7 +110,7 @@
         client.startRepositories();
 
         getNodeInfo("Configuration", "/jcr:system");
-        assertThat(children, hasItems("dna:sources", "dna:federatedRepositories"));
+        //assertThat(children, hasItems("dna:sources", "dna:federatedRepositories"));
         assertThat(properties.containsKey("jcr:primaryType"), is(true));
         // assertThat(properties.containsKey("dna:uuid"), is(true));
         assertThat(properties.size() >= 1, is(true));
@@ -225,13 +225,13 @@
         client.startRepositories();
 
         getNodeInfo("Vehicles", "/");
-        assertThat(children, hasItems("Vehicles", "jcr:system"));
+        //assertThat(children, hasItems("Vehicles", "jcr:system"));
 
         getNodeInfo("Vehicles", "/Vehicles");
         assertThat(children, hasItems("Cars", "Aircraft"));
 
         getNodeInfo("Vehicles", "/");
-        assertThat(children, hasItems("Vehicles", "jcr:system"));
+        //assertThat(children, hasItems("Vehicles", "jcr:system"));
 
         getNodeInfo("Vehicles", "/Vehicles/Cars/Hybrid");
         assertThat(children, hasItems("Toyota Prius", "Toyota Highlander", "Nissan Altima"));




More information about the dna-commits mailing list