[dna-issues] [JBoss JIRA] Commented: (DNA-461) new item in source doesn't appear in federated source projection
Randall Hauch (JIRA)
jira-events at lists.jboss.org
Wed Jun 17 10:00:56 EDT 2009
[ https://jira.jboss.org/jira/browse/DNA-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12472516#action_12472516 ]
Randall Hauch commented on DNA-461:
-----------------------------------
The example uses the following configuration for the "virtual" workspace in the "Vehicles" repository source:
<dna:projections>
<dna:projection jcr:name="Cars projection" dna:source="Cars" dna:workspaceName="workspace1">
<dna:projectionRules>/Vehicles/Cars => /Cars</dna:projectionRules>
</dna:projection>
<dna:projection jcr:name="Aircarft projection" dna:source="Aircraft" dna:workspaceName="workspace2">
<dna:projectionRules>/Vehicles/Aircraft => /Aircraft</dna:projectionRules>
</dna:projection>
<dna:projection jcr:name="System projection" dna:source="System" dna:workspaceName="default">
<dna:projectionRules>/jcr:system => /</dna:projectionRules>
</dna:projection>
</dna:projections>
Note that the "/Cars" node from the "Cars" repository is being projected, so any sibling of "/Cars" will not be. (I admit there are too many "Cars" words, making it hard to tell a node from a repository source from a repository.
Try creating a "/Cars/Honda" node in the "Cars" repository, and then see if there is a "/Vehicles/Cars/Honda" node.
> new item in source doesn't appear in federated source projection
> -----------------------------------------------------------------
>
> Key: DNA-461
> URL: https://jira.jboss.org/jira/browse/DNA-461
> Project: DNA
> Issue Type: Bug
> Components: Connectors, Examples, Federation
> Affects Versions: 0.5
> Environment: Mac OS 10.5.7 with JVM 1.6 and maven 2.1
> Reporter: Luiz Fernando Teston
>
> I'm not sure if it is a bug or an error in my configuration or environment. I just follow the examples without getting the CNDs and also without importing the example data. When I create some new item using the graph api this item is created in a correct way on the repository source that I'm using (example: cars) but it doesn't appears on the projection on federated source (example: vehicles/cars). I created this test case that should be used on doc/examples/repository project. I also did this same test using the JAAS configuration.
> package org.jboss.example.dna.repository;
> import static org.hamcrest.core.Is.is;
> import static org.hamcrest.core.IsNull.notNullValue;
> import static org.junit.Assert.assertThat;
> import java.net.URL;
> import org.jboss.dna.graph.Graph;
> import org.jboss.dna.jcr.JcrConfiguration;
> import org.jboss.dna.jcr.JcrEngine;
> import org.junit.Test;
> public class FederationOnDifferentSourcesTest {
> @Test
> public void shouldHaveProjectionInsideFederatedSource()
> throws Exception {
> JcrConfiguration configuration = new JcrConfiguration();
> URL configUrl = Thread.currentThread().getContextClassLoader()
> .getResource("configRepository.xml");
> assertThat(configUrl, is(notNullValue()));
> configuration.loadFrom(configUrl);
> JcrEngine engine = configuration.build();
> engine.start();
> Graph vehiclesGraph = engine.getGraph("Vehicles");
>
> assertThat(vehiclesGraph.getNodeAt("/Cars"), is(notNullValue()));
> }
> @Test
> public void shouldCreateItemOnSourceRepositoryAndShowTheSameItemOnFederatedSource()
> throws Exception {
> JcrConfiguration configuration = new JcrConfiguration();
> URL configUrl = Thread.currentThread().getContextClassLoader()
> .getResource("configRepository.xml");
> assertThat(configUrl, is(notNullValue()));
> configuration.loadFrom(configUrl);
> JcrEngine engine = configuration.build();
> engine.start();
> Graph carsGraph = engine.getGraph("Cars");
>
> carsGraph.create("/Honda");
> assertThat(carsGraph.getNodeAt("/Honda"), is(notNullValue()));
> Graph vehiclesGraph = engine.getGraph("Vehicles");
> assertThat(vehiclesGraph.getNodeAt("/Cars/Honda"), is(notNullValue()));
> }
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the dna-issues
mailing list