Author: rhauch
Date: 2009-06-10 17:23:19 -0400 (Wed, 10 Jun 2009)
New Revision: 1035
Added:
trunk/docs/examples/gettingstarted/repositories/src/main/resources/vehicles.cnd
Removed:
trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/FederatedLexicon.java
trunk/docs/examples/gettingstarted/repositories/src/main/resources/virtual.cnd
Modified:
trunk/dna-graph/src/main/java/org/jboss/dna/graph/DnaLexicon.java
trunk/dna-graph/src/main/java/org/jboss/dna/graph/ExecutionContext.java
trunk/dna-graph/src/main/java/org/jboss/dna/graph/Location.java
trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/BranchedMirrorProjector.java
trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/FederatedRepositoryConnection.java
trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/ForkRequestProcessor.java
trunk/dna-graph/src/test/java/org/jboss/dna/graph/connector/federation/AbstractFederatedRepositorySourceIntegrationTest.java
trunk/dna-graph/src/test/java/org/jboss/dna/graph/connector/federation/FederatedRepositorySourceTest.java
trunk/dna-jcr/src/test/resources/config/configRepository.xml
trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryLibrary.java
trunk/docs/examples/gettingstarted/repositories/src/main/java/org/jboss/example/dna/repository/RepositoryClient.java
trunk/docs/examples/gettingstarted/repositories/src/main/resources/aircraft.xml
trunk/docs/examples/gettingstarted/repositories/src/main/resources/cars.xml
trunk/docs/examples/gettingstarted/repositories/src/main/resources/configRepository.xml
trunk/docs/examples/gettingstarted/repositories/src/test/java/org/jboss/example/dna/repository/RepositoryClientTest.java
trunk/docs/gettingstarted/src/main/docbook/en-US/content/downloading_and_running.xml
trunk/docs/gettingstarted/src/main/docbook/en-US/content/repository_example.xml
trunk/docs/gettingstarted/src/main/docbook/en-US/content/using_dna.xml
trunk/docs/reference/src/main/docbook/en-US/content/jcr/configuration.xml
Log:
DNA-449 Federation connector does not find it's configuration when imported using the
JcrConfiguration
Quite a few relatively minor tweaks, all related to getting the federated repository
source recognizing and reading its configuration.
Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/DnaLexicon.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/DnaLexicon.java 2009-06-10 21:22:34
UTC (rev 1034)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/DnaLexicon.java 2009-06-10 21:23:19
UTC (rev 1035)
@@ -47,7 +47,7 @@
public static final Name NAMESPACE_URI = new BasicName(Namespace.URI,
"uri");
public static final Name WORKSPACES = new BasicName(Namespace.URI,
"workspaces");
- public static final Name SOURCE_NAME = new BasicName(Namespace.URI,
"sourceName");
+ public static final Name SOURCE_NAME = new BasicName(Namespace.URI,
"source");
public static final Name WORKSPACE_NAME = new BasicName(Namespace.URI,
"workspaceName");
public static final Name DEFAULT_WORKSPACE_NAME = new BasicName(Namespace.URI,
"defaultWorkspaceName");
public static final Name PROJECTION = new BasicName(Namespace.URI,
"projection");
Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/ExecutionContext.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/ExecutionContext.java 2009-06-10
21:22:34 UTC (rev 1034)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/ExecutionContext.java 2009-06-10
21:23:19 UTC (rev 1035)
@@ -31,7 +31,6 @@
import org.jboss.dna.common.component.StandardClassLoaderFactory;
import org.jboss.dna.common.util.CheckArg;
import org.jboss.dna.common.util.Logger;
-import org.jboss.dna.graph.connector.federation.FederatedLexicon;
import org.jboss.dna.graph.mimetype.ExtensionBasedMimeTypeDetector;
import org.jboss.dna.graph.mimetype.MimeTypeDetector;
import org.jboss.dna.graph.property.NamespaceRegistry;
@@ -328,7 +327,6 @@
namespaceRegistry.register(JcrMixLexicon.Namespace.PREFIX,
JcrMixLexicon.Namespace.URI);
namespaceRegistry.register(JcrNtLexicon.Namespace.PREFIX,
JcrNtLexicon.Namespace.URI);
namespaceRegistry.register(DnaLexicon.Namespace.PREFIX,
DnaLexicon.Namespace.URI);
- namespaceRegistry.register(FederatedLexicon.Namespace.PREFIX,
DnaLexicon.Namespace.URI);
// namespaceRegistry.register("dnadtd",
"http://www.jboss.org/dna/dtd/1.0");
// namespaceRegistry.register("dnaxml",
"http://www.jboss.org/dna/xml/1.0");
}
Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/Location.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/Location.java 2009-06-10 21:22:34
UTC (rev 1034)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/Location.java 2009-06-10 21:23:19
UTC (rev 1035)
@@ -577,7 +577,7 @@
}
sb.append("]");
if (hasPath) {
- sb.append("<");
+ sb.append(">");
}
}
return sb.toString();
Modified:
trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/BranchedMirrorProjector.java
===================================================================
---
trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/BranchedMirrorProjector.java 2009-06-10
21:22:34 UTC (rev 1034)
+++
trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/BranchedMirrorProjector.java 2009-06-10
21:23:19 UTC (rev 1035)
@@ -71,13 +71,16 @@
if (firstTopLevelPaths.size() != 1) return null;
List<Path> secondTopLevelPaths =
second.getRules().get(0).getTopLevelPathsInRepository(pathFactory);
if (secondTopLevelPaths.size() != 1) return null;
- // We're good, so create the instance ...
Path firstTopLevelPath = firstTopLevelPaths.get(0);
Path secondTopLevelPath = secondTopLevelPaths.get(0);
if (firstTopLevelPath.isRoot()) {
+ // We're good, so create the instance ...
return new BranchedMirrorProjector(context, projections, first, second,
secondTopLevelPath,
secondRule.getPathInSource(secondTopLevelPath, pathFactory));
}
+ // the second top-level path must be a root ...
+ if (!secondTopLevelPath.isRoot()) return null;
+ // We're good, so create the instance ...
return new BranchedMirrorProjector(context, projections, second, first,
firstTopLevelPath,
firstRule.getPathInSource(firstTopLevelPath,
pathFactory));
}
Deleted:
trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/FederatedLexicon.java
===================================================================
---
trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/FederatedLexicon.java 2009-06-10
21:22:34 UTC (rev 1034)
+++
trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/FederatedLexicon.java 2009-06-10
21:23:19 UTC (rev 1035)
@@ -1,42 +0,0 @@
-/*
- * JBoss DNA (
http://www.jboss.org/dna)
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * See the AUTHORS.txt file in the distribution for a full listing of
- * individual contributors.
- *
- * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
- * is licensed to you under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * JBoss DNA is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.dna.graph.connector.federation;
-
-import org.jboss.dna.graph.DnaLexicon;
-import org.jboss.dna.graph.property.Name;
-import org.jboss.dna.graph.property.basic.BasicName;
-
-/**
- * @author Randall Hauch
- */
-public class FederatedLexicon extends DnaLexicon {
-
- public static final Name WORKSPACES = new BasicName(Namespace.URI,
"workspaces");
- public static final Name CACHE = new BasicName(Namespace.URI, "cache");
- public static final Name PROJECTION = new BasicName(Namespace.URI,
"projection");
- public static final Name PROJECTIONS = new BasicName(Namespace.URI,
"projections");
- public static final Name SOURCE_NAME = new BasicName(Namespace.URI,
"sourceName");
- public static final Name WORKSPACE_NAME = new BasicName(Namespace.URI,
"workspaceName");
- public static final Name DEFAULT_WORKSPACE_NAME = new BasicName(Namespace.URI,
"defaultWorkspaceName");
-}
Modified:
trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/FederatedRepositoryConnection.java
===================================================================
---
trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/FederatedRepositoryConnection.java 2009-06-10
21:22:34 UTC (rev 1034)
+++
trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/FederatedRepositoryConnection.java 2009-06-10
21:23:19 UTC (rev 1035)
@@ -156,7 +156,7 @@
// Figure out whether we should asynchronously do the forking ...
boolean synchronousStep1 = shouldProcessSynchronously(request);
- final boolean awaitAllSubtasks = false;
+ final boolean awaitAllSubtasks = true;
// Prepare for trace-level logging ...
if (stopwatch != null) stopwatch.start();
Modified:
trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/ForkRequestProcessor.java
===================================================================
---
trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/ForkRequestProcessor.java 2009-06-10
21:22:34 UTC (rev 1034)
+++
trunk/dna-graph/src/main/java/org/jboss/dna/graph/connector/federation/ForkRequestProcessor.java 2009-06-10
21:23:19 UTC (rev 1035)
@@ -329,6 +329,7 @@
*/
public String call() throws Exception {
final RepositoryConnection connection =
connectionFactory.createConnection(sourceName);
+ assert connection != null;
try {
connection.execute(context, composite);
} finally {
@@ -1129,7 +1130,10 @@
if (projectedFromNode == null) return;
ProjectedNode projectedIntoNode = project(request.into(), request.inWorkspace(),
request, true);
if (projectedIntoNode == null) return;
- ProjectedNode projectedBeforeNode = request.before() != null ?
project(request.before(), request.inWorkspace(), request, true) : null;
+ ProjectedNode projectedBeforeNode = request.before() != null ?
project(request.before(),
+
request.inWorkspace(),
+ request,
+ true) :
null;
// Limitation: only able to project the move if the 'from' and
'into' are in the same source & projection ...
while (projectedFromNode != null) {
@@ -1166,8 +1170,9 @@
boolean sameLocation = fromProxy.isSameLocationAsOriginal() &&
intoProxy.isSameLocationAsOriginal();
// Create the pushed-down request ...
- MoveBranchRequest pushDown = new MoveBranchRequest(fromProxy.location(),
intoProxy.location(), beforeProxy.location(), intoProxy.workspaceName(),
- request.desiredName(),
request.conflictBehavior());
+ MoveBranchRequest pushDown = new MoveBranchRequest(fromProxy.location(),
intoProxy.location(), beforeProxy.location(),
+ intoProxy.workspaceName(),
request.desiredName(),
+ request.conflictBehavior());
// Create the federated request ...
FederatedRequest federatedRequest = new FederatedRequest(request);
federatedRequest.add(pushDown, sameLocation, false, fromProxy.projection(),
intoProxy.projection());
Modified:
trunk/dna-graph/src/test/java/org/jboss/dna/graph/connector/federation/AbstractFederatedRepositorySourceIntegrationTest.java
===================================================================
---
trunk/dna-graph/src/test/java/org/jboss/dna/graph/connector/federation/AbstractFederatedRepositorySourceIntegrationTest.java 2009-06-10
21:22:34 UTC (rev 1034)
+++
trunk/dna-graph/src/test/java/org/jboss/dna/graph/connector/federation/AbstractFederatedRepositorySourceIntegrationTest.java 2009-06-10
21:23:19 UTC (rev 1035)
@@ -33,6 +33,7 @@
import java.util.Map;
import org.jboss.dna.common.statistic.Stopwatch;
import org.jboss.dna.common.util.CheckArg;
+import org.jboss.dna.graph.DnaLexicon;
import org.jboss.dna.graph.ExecutionContext;
import org.jboss.dna.graph.Graph;
import org.jboss.dna.graph.Location;
@@ -180,9 +181,9 @@
config.createIfMissing(wsPath);
config.createIfMissing(wsPath + "/dna:projections");
config.createAt(projectionPath)
- .with(FederatedLexicon.PROJECTION_RULES, (Object[])projectionRules)
- .with(FederatedLexicon.SOURCE_NAME, sourceName)
- .with(FederatedLexicon.WORKSPACE_NAME, workspaceName)
+ .with(DnaLexicon.PROJECTION_RULES, (Object[])projectionRules)
+ .with(DnaLexicon.SOURCE_NAME, sourceName)
+ .with(DnaLexicon.WORKSPACE_NAME, workspaceName)
.and();
// Make sure the source and workspace exist ...
graphFor(sourceName, workspaceName);
Modified:
trunk/dna-graph/src/test/java/org/jboss/dna/graph/connector/federation/FederatedRepositorySourceTest.java
===================================================================
---
trunk/dna-graph/src/test/java/org/jboss/dna/graph/connector/federation/FederatedRepositorySourceTest.java 2009-06-10
21:22:34 UTC (rev 1034)
+++
trunk/dna-graph/src/test/java/org/jboss/dna/graph/connector/federation/FederatedRepositorySourceTest.java 2009-06-10
21:23:19 UTC (rev 1035)
@@ -40,6 +40,7 @@
import javax.naming.Reference;
import javax.naming.spi.ObjectFactory;
import javax.security.auth.callback.CallbackHandler;
+import org.jboss.dna.graph.DnaLexicon;
import org.jboss.dna.graph.ExecutionContext;
import org.jboss.dna.graph.Graph;
import org.jboss.dna.graph.Subgraph;
@@ -118,25 +119,25 @@
Graph.Batch batch = configRepository.batch();
batch.create("/a").and();
batch.create("/a/b").and();
- batch.create("/a/b/Test
Repository").with(FederatedLexicon.DEFAULT_WORKSPACE_NAME,
"fedSpace").and();
+ batch.create("/a/b/Test
Repository").with(DnaLexicon.DEFAULT_WORKSPACE_NAME, "fedSpace").and();
batch.create("/a/b/Test Repository/dna:workspaces").and();
batch.create("/a/b/Test Repository/dna:workspaces/fedSpace").and();
batch.create("/a/b/Test Repository/dna:workspaces/fedSpace/dna:cache")
- .with(FederatedLexicon.PROJECTION_RULES, "/ => /")
- .with(FederatedLexicon.SOURCE_NAME, "cache source")
- .with(FederatedLexicon.WORKSPACE_NAME, "cacheSpace")
- .with(FederatedLexicon.TIME_TO_EXPIRE, 100000)
+ .with(DnaLexicon.PROJECTION_RULES, "/ => /")
+ .with(DnaLexicon.SOURCE_NAME, "cache source")
+ .with(DnaLexicon.WORKSPACE_NAME, "cacheSpace")
+ .with(DnaLexicon.TIME_TO_EXPIRE, 100000)
.and();
batch.create("/a/b/Test
Repository/dna:workspaces/fedSpace/dna:projections").and();
batch.create("/a/b/Test
Repository/dna:workspaces/fedSpace/dna:projections/projection1")
- .with(FederatedLexicon.PROJECTION_RULES, "/ => /s1")
- .with(FederatedLexicon.SOURCE_NAME, "source 1")
- .with(FederatedLexicon.WORKSPACE_NAME, "s1 workspace")
+ .with(DnaLexicon.PROJECTION_RULES, "/ => /s1")
+ .with(DnaLexicon.SOURCE_NAME, "source 1")
+ .with(DnaLexicon.WORKSPACE_NAME, "s1 workspace")
.and();
batch.create("/a/b/Test
Repository/dna:workspaces/fedSpace/dna:projections/projection2")
- .with(FederatedLexicon.PROJECTION_RULES, "/ => /s2")
- .with(FederatedLexicon.SOURCE_NAME, "source 2")
- .with(FederatedLexicon.WORKSPACE_NAME, "s2 worskspace")
+ .with(DnaLexicon.PROJECTION_RULES, "/ => /s2")
+ .with(DnaLexicon.SOURCE_NAME, "source 2")
+ .with(DnaLexicon.WORKSPACE_NAME, "s2 worskspace")
.and();
batch.execute();
Modified: trunk/dna-jcr/src/test/resources/config/configRepository.xml
===================================================================
--- trunk/dna-jcr/src/test/resources/config/configRepository.xml 2009-06-10 21:22:34 UTC
(rev 1034)
+++ trunk/dna-jcr/src/test/resources/config/configRepository.xml 2009-06-10 21:23:19 UTC
(rev 1035)
@@ -66,7 +66,7 @@
</dna:mimeTypeDetectors>
<!-- JCR Repositories. This is required, with a separate repository for each JCR
repository instance. -->
<dna:repositories>
- <dna:repository jcr:name="Car Repository"
dna:sourceName="Cars">
+ <dna:repository jcr:name="Car Repository"
dna:source="Cars">
<dna:options>
<dna:option jcr:name="projectNodeTypes"
dna:value="true"/>
<dna:option jcr:name="jaasLoginConfigName"
dna:value="dna-jcr"/>
Modified:
trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryLibrary.java
===================================================================
---
trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryLibrary.java 2009-06-10
21:22:34 UTC (rev 1034)
+++
trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryLibrary.java 2009-06-10
21:23:19 UTC (rev 1035)
@@ -373,7 +373,7 @@
* @see
org.jboss.dna.graph.connector.RepositoryContext#getExecutionContext()
*/
public ExecutionContext getExecutionContext() {
- return getExecutionContext();
+ return RepositoryLibrary.this.getExecutionContext();
}
/**
Modified:
trunk/docs/examples/gettingstarted/repositories/src/main/java/org/jboss/example/dna/repository/RepositoryClient.java
===================================================================
---
trunk/docs/examples/gettingstarted/repositories/src/main/java/org/jboss/example/dna/repository/RepositoryClient.java 2009-06-10
21:22:34 UTC (rev 1034)
+++
trunk/docs/examples/gettingstarted/repositories/src/main/java/org/jboss/example/dna/repository/RepositoryClient.java 2009-06-10
21:23:19 UTC (rev 1035)
@@ -99,7 +99,6 @@
private String jaasContextName;
private UserInterface userInterface;
private LoginContext loginContext;
- private ExecutionContext context;
private JcrEngine engine;
/**
@@ -144,9 +143,9 @@
// in the configuration file, but this approach is easy and allows us to define
the node types
// using the CND format in one or multiple files.
String locationOfCndFiles = userInterface.getLocationOfCndFiles();
- configuration.repository("aircraft
repository").addNodeTypes(locationOfCndFiles + "/aircraft.cnd");
- configuration.repository("car
repository").addNodeTypes(locationOfCndFiles + "/cars.cnd");
- configuration.repository("virtual").addNodeTypes(locationOfCndFiles +
"/virtual.cnd");
+ configuration.repository("Aircraft").addNodeTypes(locationOfCndFiles +
"/aircraft.cnd");
+ configuration.repository("Car").addNodeTypes(locationOfCndFiles +
"/cars.cnd");
+ configuration.repository("Vehicles").addNodeTypes(locationOfCndFiles +
"/vehicles.cnd");
// Now create the JCR engine ...
engine = configuration.build();
@@ -157,11 +156,9 @@
// populate these repositories here by importing from files. First do the
configuration repository ...
String location = this.userInterface.getLocationOfRepositoryFiles();
- // Now import the content for the two in-memory repositories ...
- Graph cars = engine.getGraph("Cars");
- cars.importXmlFrom(location + "/cars.xml").into("/");
- Graph aircraft = engine.getGraph("Aircraft");
- aircraft.importXmlFrom(location +
"/aircraft.xml").into("/");
+ // Now import the content for the two in-memory repository sources ...
+ engine.getGraph("Cars").importXmlFrom(location +
"/cars.xml").into("/");
+ engine.getGraph("Aircraft").importXmlFrom(location +
"/aircraft.xml").into("/");
}
/**
@@ -307,13 +304,12 @@
case DNA: {
try {
// Use the DNA Graph API to read the properties and children of the
node ...
- ExecutionContext context = this.context;
+ ExecutionContext context = this.engine.getExecutionContext();
if (loginContext != null) {
JaasSecurityContext security = new
JaasSecurityContext(loginContext);
- context = this.context.with(security);
+ context = context.with(security);
}
Graph graph = engine.getGraph(context, sourceName);
- graph.useWorkspace("default");
org.jboss.dna.graph.Node node = graph.getNodeAt(pathToNode);
if (properties != null) {
@@ -351,6 +347,7 @@
String input ) {
if (current == null) current = "/";
if (input == null || input.length() == 0) return current;
+ ExecutionContext context = this.engine.getExecutionContext();
PathFactory factory = context.getValueFactories().getPathFactory();
Path inputPath = factory.create(input);
if (inputPath.isAbsolute()) {
Modified: trunk/docs/examples/gettingstarted/repositories/src/main/resources/aircraft.xml
===================================================================
---
trunk/docs/examples/gettingstarted/repositories/src/main/resources/aircraft.xml 2009-06-10
21:22:34 UTC (rev 1034)
+++
trunk/docs/examples/gettingstarted/repositories/src/main/resources/aircraft.xml 2009-06-10
21:23:19 UTC (rev 1035)
@@ -24,31 +24,33 @@
~ 51 Franklin Street, Fifth Floor
~ Boston, MA 02110-1301 USA
-->
-<Aircraft
xmlns:jcr="http://www.jcp.org/jcr/1.0"
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
xmlns="http://jboss.org/dna/examples/aircraft/1.0">
- <Business>
- <Aircraft jcr:name="Gulfstream V" maker="Gulfstream"
model="G-V" introduced="1995" range="5800nm"
cruiseSpeed="488kt" crew="2" emptyWeight="46200lb"
url="http://en.wikipedia.org/wiki/Gulfstream_V"/>
- <Aircraft jcr:name="Learjet 45" maker="Learjet"
model="LJ45" introduced="1995" numberBuilt="264+"
crew="2" emptyWeight="13695lb" range="2120nm"
cruiseSpeed="457kt"
url="http://en.wikipedia.org/wiki/Learjet_45"/>
+<Aircraft
xmlns:jcr="http://www.jcp.org/jcr/1.0"
+
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
+
xmlns:air="http://jboss.org/dna/examples/aircraft/1.0"
jcr:primaryType="nt:unstructured">
+ <Business jcr:primaryType="nt:unstructured">
+ <air:Aircraft jcr:name="Gulfstream V" maker="Gulfstream"
model="G-V" introduced="1995" range="5800nm"
cruiseSpeed="488kt" crew="2" emptyWeight="46200lb"
url="http://en.wikipedia.org/wiki/Gulfstream_V"/>
+ <air:Aircraft jcr:name="Learjet 45" maker="Learjet"
model="LJ45" introduced="1995" numberBuilt="264+"
crew="2" emptyWeight="13695lb" range="2120nm"
cruiseSpeed="457kt"
url="http://en.wikipedia.org/wiki/Learjet_45"/>
</Business>
- <Commercial>
- <Aircraft jcr:name="Boeing 777" maker="Boeing"
model="777-200LR" introduced="1995" numberBuilt="731+"
maxRange="7500nm" emptyWeight="326000lb"
cruiseSpeed="560mph"
url="http://en.wikipedia.org/wiki/Boeing_777"/>
- <Aircraft jcr:name="Boeing 767" maker="Boeing"
model="767-200" introduced="1982" numberBuilt="966+"
maxRange="3950nm" emptyWeight="176650lb"
cruiseSpeed="530mph"
url="http://en.wikipedia.org/wiki/Boeing_767"/>
- <Aircraft jcr:name="Boeing 787" maker="Boeing"
model="787-3" introduced="2009" range="3050nm"
emptyWeight="223000lb" cruiseSpeed="561mph"
url="http://en.wikipedia.org/wiki/Boeing_787"/>
- <Aircraft jcr:name="Boeing 757" maker="Boeing"
model="757-200" introduced="1983" numberBuilt="1050"
range="3900nm" maxWeight="255000lb" cruiseSpeed="530mph"
url="http://en.wikipedia.org/wiki/Boeing_757"/>
- <Aircraft jcr:name="Airbus A380" maker="Airbus"
model="A380-800" introduced="2007" numberBuilt="18"
range="8200nm" maxWeight="1235000lb" cruiseSpeed="647mph"
url="http://en.wikipedia.org/wiki/Airbus_a380"/>
- <Aircraft jcr:name="Airbus A340" maker="Airbus"
model="A340-200" introduced="1993" numberBuilt="354"
range="8000nm" maxWeight="606300lb" cruiseSpeed="557mph"
url="http://en.wikipedia.org/wiki/Airbus_A-340"/>
- <Aircraft jcr:name="Airbus A310" maker="Airbus"
model="A310-200" introduced="1983" numberBuilt="255"
cruiseSpeed="850km/h" emptyWeight="176312lb" range="3670nm"
url="http://en.wikipedia.org/wiki/Airbus_A-310"/>
- <Aircraft jcr:name="Embraer RJ-175" maker="Embraer"
model="ERJ170-200" introduced="2004" range="3334km"
cruiseSpeed="481kt" emptyWeight="21810kg"
url="http://en.wikipedia.org/wiki/EMBRAER_170"/>
+ <Commercial jcr:primaryType="nt:unstructured">
+ <air:Aircraft jcr:name="Boeing 777" maker="Boeing"
model="777-200LR" introduced="1995" numberBuilt="731+"
maxRange="7500nm" emptyWeight="326000lb"
cruiseSpeed="560mph"
url="http://en.wikipedia.org/wiki/Boeing_777"/>
+ <air:Aircraft jcr:name="Boeing 767" maker="Boeing"
model="767-200" introduced="1982" numberBuilt="966+"
maxRange="3950nm" emptyWeight="176650lb"
cruiseSpeed="530mph"
url="http://en.wikipedia.org/wiki/Boeing_767"/>
+ <air:Aircraft jcr:name="Boeing 787" maker="Boeing"
model="787-3" introduced="2009" range="3050nm"
emptyWeight="223000lb" cruiseSpeed="561mph"
url="http://en.wikipedia.org/wiki/Boeing_787"/>
+ <air:Aircraft jcr:name="Boeing 757" maker="Boeing"
model="757-200" introduced="1983" numberBuilt="1050"
range="3900nm" maxWeight="255000lb" cruiseSpeed="530mph"
url="http://en.wikipedia.org/wiki/Boeing_757"/>
+ <air:Aircraft jcr:name="Airbus A380" maker="Airbus"
model="A380-800" introduced="2007" numberBuilt="18"
range="8200nm" maxWeight="1235000lb" cruiseSpeed="647mph"
url="http://en.wikipedia.org/wiki/Airbus_a380"/>
+ <air:Aircraft jcr:name="Airbus A340" maker="Airbus"
model="A340-200" introduced="1993" numberBuilt="354"
range="8000nm" maxWeight="606300lb" cruiseSpeed="557mph"
url="http://en.wikipedia.org/wiki/Airbus_A-340"/>
+ <air:Aircraft jcr:name="Airbus A310" maker="Airbus"
model="A310-200" introduced="1983" numberBuilt="255"
cruiseSpeed="850km/h" emptyWeight="176312lb" range="3670nm"
url="http://en.wikipedia.org/wiki/Airbus_A-310"/>
+ <air:Aircraft jcr:name="Embraer RJ-175" maker="Embraer"
model="ERJ170-200" introduced="2004" range="3334km"
cruiseSpeed="481kt" emptyWeight="21810kg"
url="http://en.wikipedia.org/wiki/EMBRAER_170"/>
</Commercial>
- <Vintage>
- <Aircraft jcr:name="Fokker Trimotor" maker="Fokker"
model="F.VII" introduced="1925" cruiseSpeed="170km/h"
emptyWeight="3050kg" crew="2"
url="http://en.wikipedia.org/wiki/Fokker_trimotor"/>
- <Aircraft jcr:name="P-38 Lightning" maker="Lockheed"
model="P-38" designedBy="Kelly Johnson" introduced="1941"
numberBuilt="10037" rateOfClimb="4750ft/min" range="1300mi"
emptyWeight="12780lb" crew="1"
url="http://en.wikipedia.org/wiki/P-38_Lightning"/>
- <Aircraft jcr:name="A6M Zero" maker="Mitsubishi"
model="A6M" designedBy="Jiro Horikoshi" introduced="1940"
numberBuilt="11000" crew="1" emptyWeight="3704lb"
serviceCeiling="33000ft" maxSpeed="331mph" range="1929mi"
rateOfClimb="3100ft/min"
url="http://en.wikipedia.org/wiki/A6M_Zero"/>
- <Aircraft jcr:name="Bf 109" maker="Messerschmitt"
model="Bf 109" introduced="1937"
url="http://en.wikipedia.org/wiki/BF_109"/>
- <Aircraft jcr:name="Wright Flyer" maker="Wright Brothers"
introduced="1903" range="852ft" maxSpeed="30mph"
emptyWeight="605lb" crew="1"/>
+ <Vintage jcr:primaryType="nt:unstructured">
+ <air:Aircraft jcr:name="Fokker Trimotor" maker="Fokker"
model="F.VII" introduced="1925" cruiseSpeed="170km/h"
emptyWeight="3050kg" crew="2"
url="http://en.wikipedia.org/wiki/Fokker_trimotor"/>
+ <air:Aircraft jcr:name="P-38 Lightning" maker="Lockheed"
model="P-38" designedBy="Kelly Johnson" introduced="1941"
numberBuilt="10037" rateOfClimb="4750ft/min" range="1300mi"
emptyWeight="12780lb" crew="1"
url="http://en.wikipedia.org/wiki/P-38_Lightning"/>
+ <air:Aircraft jcr:name="A6M Zero" maker="Mitsubishi"
model="A6M" designedBy="Jiro Horikoshi" introduced="1940"
numberBuilt="11000" crew="1" emptyWeight="3704lb"
serviceCeiling="33000ft" maxSpeed="331mph" range="1929mi"
rateOfClimb="3100ft/min"
url="http://en.wikipedia.org/wiki/A6M_Zero"/>
+ <air:Aircraft jcr:name="Bf 109" maker="Messerschmitt"
model="Bf 109" introduced="1937"
url="http://en.wikipedia.org/wiki/BF_109"/>
+ <air:Aircraft jcr:name="Wright Flyer" maker="Wright
Brothers" introduced="1903" range="852ft"
maxSpeed="30mph" emptyWeight="605lb" crew="1"/>
</Vintage>
- <Homebuilt>
- <Aircraft jcr:name="Long-EZ" maker="Rutan Aircraft
Factory" model="61" emptyWeight="760lb"
fuelCapacity="200L" maxSpeed="185kt" since="1976"
range="1200nm"
url="http://en.wikipedia.org/wiki/Rutan_Long-EZ"/>
- <Aircraft jcr:name="Cirrus VK-30" maker="Cirrus Design"
model="VK-30" emptyWeight="2400lb" maxLoad="1200lb"
maxSpeed="250mph" rateOfClimb="1500ft/min" range="1300mi"
url="http://en.wikipedia.org/wiki/Cirrus_VK-30"/>
- <Aircraft jcr:name="Van's RV-4" maker="Van's
Aircraft" model="RV-4" introduced="1980"
emptyWeight="905lb" maxLoad="500lb" maxSpeed="200mph"
rateOfClimb="2450ft/min" range="725mi"
url="http://en.wikipedia.org/wiki/Van%27s_Aircraft_RV-4"/>
+ <Homebuilt jcr:primaryType="nt:unstructured">
+ <air:Aircraft jcr:name="Long-EZ" maker="Rutan Aircraft
Factory" model="61" emptyWeight="760lb"
fuelCapacity="200L" maxSpeed="185kt" since="1976"
range="1200nm"
url="http://en.wikipedia.org/wiki/Rutan_Long-EZ"/>
+ <air:Aircraft jcr:name="Cirrus VK-30" maker="Cirrus
Design" model="VK-30" emptyWeight="2400lb"
maxLoad="1200lb" maxSpeed="250mph" rateOfClimb="1500ft/min"
range="1300mi"
url="http://en.wikipedia.org/wiki/Cirrus_VK-30"/>
+ <air:Aircraft jcr:name="Van's RV-4" maker="Van's
Aircraft" model="RV-4" introduced="1980"
emptyWeight="905lb" maxLoad="500lb" maxSpeed="200mph"
rateOfClimb="2450ft/min" range="725mi"
url="http://en.wikipedia.org/wiki/Van%27s_Aircraft_RV-4"/>
</Homebuilt>
</Aircraft>
\ No newline at end of file
Modified: trunk/docs/examples/gettingstarted/repositories/src/main/resources/cars.xml
===================================================================
--- trunk/docs/examples/gettingstarted/repositories/src/main/resources/cars.xml 2009-06-10
21:22:34 UTC (rev 1034)
+++ trunk/docs/examples/gettingstarted/repositories/src/main/resources/cars.xml 2009-06-10
21:23:19 UTC (rev 1035)
@@ -26,25 +26,25 @@
-->
<Cars
xmlns:jcr="http://www.jcp.org/jcr/1.0"
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
-
xmlns="http://jboss.org/dna/examples/cars/1.0">
- <Hybrid>
- <Car jcr:name="Toyota Prius" maker="Toyota"
model="Prius" year="2008" msrp="$21,500"
userRating="4.2" valueRating="5" mpgCity="48"
mpgHighway="45"/>
- <Car jcr:name="Toyota Highlander" maker="Toyota"
model="Highlander" year="2008" msrp="$34,200"
userRating="4" valueRating="5" mpgCity="27"
mpgHighway="25"/>
- <Car jcr:name="Nissan Altima" maker="Nissan"
model="Altima" year="2008" msrp="$18,260"
mpgCity="23" mpgHighway="32"/>
+
xmlns:car="http://jboss.org/dna/examples/cars/1.0"
jcr:primaryType="nt:unstructured">
+ <Hybrid jcr:primaryType="nt:unstructured">
+ <car:Car jcr:name="Toyota Prius" maker="Toyota"
model="Prius" year="2008" msrp="$21,500"
userRating="4.2" valueRating="5" mpgCity="48"
mpgHighway="45"/>
+ <car:Car jcr:name="Toyota Highlander" maker="Toyota"
model="Highlander" year="2008" msrp="$34,200"
userRating="4" valueRating="5" mpgCity="27"
mpgHighway="25"/>
+ <car:Car jcr:name="Nissan Altima" maker="Nissan"
model="Altima" year="2008" msrp="$18,260"
mpgCity="23" mpgHighway="32"/>
</Hybrid>
- <Sports>
- <Car jcr:name="Aston Martin DB9" maker="Aston Martin"
model="DB9" year="2008" msrp="$171,600"
userRating="5" mpgCity="12" mpgHighway="19"
lengthInInches="185.5" wheelbaseInInches="108.0" engine="5,935 cc
5.9 liters V 12"/>
- <Car jcr:name="Infiniti G37" maker="Infiniti"
model="G37" year="2008" msrp="$34,900"
userRating="3.5" valueRating="4" mpgCity="18"
mpgHighway="24" />
+ <Sports jcr:primaryType="nt:unstructured">
+ <car:Car jcr:name="Aston Martin DB9" maker="Aston Martin"
model="DB9" year="2008" msrp="$171,600"
userRating="5" mpgCity="12" mpgHighway="19"
lengthInInches="185.5" wheelbaseInInches="108.0" engine="5,935 cc
5.9 liters V 12"/>
+ <car:Car jcr:name="Infiniti G37" maker="Infiniti"
model="G37" year="2008" msrp="$34,900"
userRating="3.5" valueRating="4" mpgCity="18"
mpgHighway="24" />
</Sports>
- <Luxury>
- <Car jcr:name="Cadillac DTS" maker="Cadillac"
model="DTS" year="2008" engine="3.6-liter V6"
userRating="0"/>
- <Car jcr:name="Bentley Continental" maker="Bentley"
model="Continental" year="2008" msrp="$170,990"
mpgCity="10" mpgHighway="17" />
- <Car jcr:name="Lexus IS350" maker="Lexus"
model="IS350" year="2008" msrp="$36,305"
mpgCity="18" mpgHighway="25" userRating="4"
valueRating="5" />
+ <Luxury jcr:primaryType="nt:unstructured">
+ <car:Car jcr:name="Cadillac DTS" maker="Cadillac"
model="DTS" year="2008" engine="3.6-liter V6"
userRating="0"/>
+ <car:Car jcr:name="Bentley Continental" maker="Bentley"
model="Continental" year="2008" msrp="$170,990"
mpgCity="10" mpgHighway="17" />
+ <car:Car jcr:name="Lexus IS350" maker="Lexus"
model="IS350" year="2008" msrp="$36,305"
mpgCity="18" mpgHighway="25" userRating="4"
valueRating="5" />
</Luxury>
- <Utility>
- <Car jcr:name="Land Rover LR2" maker="Land Rover"
model="LR2" year="2008" msrp="$33,985"
userRating="4.5" valueRating="5" mpgCity="16"
mpgHighway="23" />
- <Car jcr:name="Land Rover LR3" maker="Land Rover"
model="LR3" year="2008" msrp="$48,525"
userRating="5" valueRating="2" mpgCity="12"
mpgHighway="17" />
- <Car jcr:name="Hummer H3" maker="Hummer"
model="H3" year="2008" msrp="$30,595"
userRating="3.5" valueRating="4" mpgCity="13"
mpgHighway="16" />
- <Car jcr:name="Ford F-150" maker="Ford"
model="F-150" year="2008" msrp="$23,910"
userRating="4" valueRating="1" mpgCity="14"
mpgHighway="20" />
+ <Utility jcr:primaryType="nt:unstructured">
+ <car:Car jcr:name="Land Rover LR2" maker="Land Rover"
model="LR2" year="2008" msrp="$33,985"
userRating="4.5" valueRating="5" mpgCity="16"
mpgHighway="23" />
+ <car:Car jcr:name="Land Rover LR3" maker="Land Rover"
model="LR3" year="2008" msrp="$48,525"
userRating="5" valueRating="2" mpgCity="12"
mpgHighway="17" />
+ <car:Car jcr:name="Hummer H3" maker="Hummer"
model="H3" year="2008" msrp="$30,595"
userRating="3.5" valueRating="4" mpgCity="13"
mpgHighway="16" />
+ <car:Car jcr:name="Ford F-150" maker="Ford"
model="F-150" year="2008" msrp="$23,910"
userRating="4" valueRating="1" mpgCity="14"
mpgHighway="20" />
</Utility>
</Cars>
\ No newline at end of file
Modified:
trunk/docs/examples/gettingstarted/repositories/src/main/resources/configRepository.xml
===================================================================
---
trunk/docs/examples/gettingstarted/repositories/src/main/resources/configRepository.xml 2009-06-10
21:22:34 UTC (rev 1034)
+++
trunk/docs/examples/gettingstarted/repositories/src/main/resources/configRepository.xml 2009-06-10
21:23:19 UTC (rev 1035)
@@ -24,7 +24,7 @@
~ 51 Franklin Street, Fifth Floor
~ Boston, MA 02110-1301 USA
-->
-<configuration
xmlns="http://www.jboss.org/dna/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0">
+<configuration
xmlns:dna="http://www.jboss.org/dna/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0">
<!--
Define the sources for the content. These sources are directly accessible using the
DNA-specific Graph API.
In fact, this is how the DNA JCR implementation works. You can think of these as
being similar to
@@ -50,7 +50,7 @@
under '/Vehicles/Cars', while all the 'Aircraft' content appears
under '/Vehicles/Aircraft'.
-->
<dna:source jcr:name="Vehicles">
-
<dna:classname>org.jboss.dna.graph.connector.federated.FederatedRepositorySource</dna:classname>
+
<dna:classname>org.jboss.dna.graph.connector.federation.FederatedRepositorySource</dna:classname>
<dna:workspaces>
<!--
Unlike some other repository sources, federated sources have to define
all of their workspaces,
@@ -61,11 +61,11 @@
<dna:workspace jcr:name="virtual">
<dna:projections>
<!-- Project the 'Cars' content, starting with the
'/Cars' node. -->
- <dna:projection jcr:name="Cars projection"
dna:source="Cars" dna:workspace="workspace1">
+ <dna:projection jcr:name="Cars projection"
dna:source="Cars" dna:workspaceName="workspace1">
<dna:projectionRules>/Vehicles/Cars =>
/Cars</dna:projectionRules>
</dna:projection>
<!-- Project the 'Aicraft' content, starting with the
'/Aircraft' node. -->
- <dna:projection jcr:name="Aircarft projection"
dna:source="Aircraft" dna:workspace="workspace2">
+ <dna:projection jcr:name="Aircarft projection"
dna:source="Aircraft" dna:workspaceName="workspace2">
<dna:projectionRules>/Vehicles/Aircraft =>
/Aircraft</dna:projectionRules>
</dna:projection>
</dna:projections>
@@ -114,15 +114,15 @@
Define a JCR repository that accesses the 'Cars' source directly.
This of course is optional, since we could access the same content through
'vehicles'.
-->
- <dna:repository jcr:name="car repository">
+ <dna:repository jcr:name="Cars">
<!-- Specify the source that should be used for the repository -->
- <source>Cars</source>
+ <dna:source>Cars</dna:source>
<!-- Define the options for the JCR repository, using camelcase version of
JcrRepository.Option names -->
- <options jcr:primaryType="dna:options"/>
+ <dna:options jcr:primaryType="dna:options">
<jaasLoginConfigName jcr:primaryType="dna:option"
dna:value="dna-jcr"/>
- </options>
+ </dna:options>
<!-- Define any custom node types. Importing CND files via
JcrConfiguration is equivalent to specifying here. -->
- <nodeTypes jcr:primaryType="dna:nodeTypes"/>
+ <dna:nodeTypes jcr:primaryType="dna:nodeTypes"/>
<!-- Define any namespaces for this repository, other than those already
defined by JCR or DNA -->
<namespaces jcr:primaryType="dna:namespaces">
<car jcr:primaryType="dna:namespace"
dna:uri="http://jboss.org/dna/examples/cars/1.0"/>
@@ -132,34 +132,34 @@
Define a JCR repository that accesses the 'Aircraft' source directly.
This of course isn't really necessary for this example, since we could access
the same content through 'vehicles'.
-->
- <dna:repository jcr:name="aircraft repository">
+ <dna:repository jcr:name="Aircraft">
<!-- Specify the source that should be used for the repository -->
- <source>Aircraft</source>
+ <dna:source>Aircraft</dna:source>
<!-- Define the options for the JCR repository, using camelcase version of
JcrRepository.Option names -->
- <options jcr:primaryType="dna:options"/>
+ <dna:options jcr:primaryType="dna:options">
<jaasLoginConfigName jcr:primaryType="dna:option"
dna:value="dna-jcr"/>
- </options>
+ </dna:options>
</dna:repository>
<!--
Define a JCR repository that accesses the 'Vehicles' federated source
directly,
which is defined in the sources to be a projection of the 'Cars' and
'Vehicles' content.
-->
<!-- Define a JCR repository that accesses the 'Vehicles' federated
source directly -->
- <dna:repository jcr:name="vehicles">
+ <dna:repository jcr:name="Vehicles">
<!-- Specify the source that should be used for the repository -->
- <source>Vehicles</source>
+ <dna:source>Vehicles</dna:source>
<!-- Define the options for the JCR repository, using camelcase version of
JcrRepository.Option names -->
- <options jcr:primaryType="dna:options">
+ <dna:options jcr:primaryType="dna:options">
<projectNodeTypes jcr:primaryType="dna:option"
dna:value="false"/>
<jaasLoginConfigName jcr:primaryType="dna:option"
dna:value="dna-jcr"/>
- </options>
+ </dna:options>
<!-- Define any custom node types. Importing CND files via
JcrConfiguration is equivalent to specifying here. -->
- <nodeTypes jcr:primaryType="dna:nodeTypes"/>
+ <dna:nodeTypes jcr:primaryType="dna:nodeTypes"/>
<!-- Define any namespaces for this repository, other than those already
defined by JCR, DNA or by imported content. -->
- <namespaces jcr:primaryType="dna:namespaces">
+ <dna:namespaces jcr:primaryType="dna:namespaces">
<car jcr:primaryType="dna:namespace"
dna:uri="http://jboss.org/dna/examples/cars/1.0"/>
<air jcr:primaryType="dna:namespace"
dna:uri="http://jboss.org/dna/examples/aircraft/1.0"/>
- </namespaces>
+ </dna:namespaces>
</dna:repository>
</dna:repositories>
</configuration>
\ No newline at end of file
Copied: trunk/docs/examples/gettingstarted/repositories/src/main/resources/vehicles.cnd
(from rev 1034,
trunk/docs/examples/gettingstarted/repositories/src/main/resources/virtual.cnd)
===================================================================
--- trunk/docs/examples/gettingstarted/repositories/src/main/resources/vehicles.cnd
(rev 0)
+++
trunk/docs/examples/gettingstarted/repositories/src/main/resources/vehicles.cnd 2009-06-10
21:23:19 UTC (rev 1035)
@@ -0,0 +1,79 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+//------------------------------------------------------------------------------
+// N A M E S P A C E S
+//------------------------------------------------------------------------------
+<jcr='http://www.jcp.org/jcr/1.0'>
+<nt='http://www.jcp.org/jcr/nt/1.0'>
+<mix='http://www.jcp.org/jcr/mix/1.0'>
+<air='http://jboss.org/dna/examples/aircraft/1.0'>
+<car='http://jboss.org/dna/examples/cars/1.0'>
+
+//------------------------------------------------------------------------------
+// N O D E T Y P E S
+//------------------------------------------------------------------------------
+
+[car:Car] > nt:unstructured
+ - car:maker (string)
+ - car:model (string)
+ - car:year (string) < '(19|20)\d{2}' // any 4 digit
number starting with '19' or '20'
+ - car:msrp (string) < '[$]\d{1,3}[,]?\d{3}([.]\d{2})?' // of the form
"$X,XXX.ZZ", "$XX,XXX.ZZ" or "$XXX,XXX.ZZ"
+ // where '.ZZ' is
optional
+ - car:userRating (long) < '[1,5]' // any value from 1
to 5 (inclusive)
+ - car:valueRating (long) < '[1,5]' // any value from 1
to 5 (inclusive)
+ - car:mpgCity (long) < '(0,]' // any value
greater than 0
+ - car:mpgHighway (long) < '(0,]' // any value
greater than 0
+ - car:lengthInInches (double) < '(0,]' // any value
greater than 0
+ - car:wheelbaseInInches (double) < '(0,]' // any value
greater than 0
+ - car:engine (string)
+
+[air:Aircraft] > nt:unstructured
+ - air:maker (string)
+ - air:model (string)
+ - air:designedBy (string)
+ - air:introduced (string) < '(19|20)\d{2}' // any 4 digit
number starting with '19' or '20'
+ - air:range (string) // any integer (with optional
',' every 1000s place)
+ < '\d{1,3}(,?\d{3})*\s*(nm|m|km|mi|ft)' // followed by
'nm', 'm', 'km', 'mi', or 'ft'
+ - air:maxSpeed (string) // any integer (with optional
',' every 1000s place)
+ < '\d{1,3}(,?\d{3})*\s*(kt|mph|km/h|kmph)' // followed by
'kt', 'mph', 'km/h' or 'kmph'
+ - air:takeoffSpeed (string) // any integer (with optional
',' every 1000s place)
+ < '\d{1,3}(,?\d{3})*\s*(kt|mph|km/h|kmph)' // followed by
'kt', 'mph', 'km/h' or 'kmph'
+ - air:cruiseSpeed (string) // any integer (with optional
',' every 1000s place)
+ < '\d{1,3}(,?\d{3})*\s*(kt|mph|km/h|kmph)' // followed by
'kt', 'mph', 'km/h' or 'kmph'
+ - air:emptyWeight (string) // any integer (with optional
',' every 1000s place)
+ < '\d{1,3}(,?\d{3})*\s*(lb|kg)' // followed by
'lb' or 'kg'
+ - air:maxWeight (string) // any integer (with optional
',' every 1000s place)
+ < '\d{1,3}(,?\d{3})*\s*(lb|kg)' // followed by
'lb' or 'kg'
+ - air:rateOfClimb (string) // any integer (with optional
',' every 1000s place)
+ < '\d{1,3}(,?\d{3})*\s*(ft|km|m)/(s|min)' // followed by
'ft/s', 'ft/min', 'km/s', 'km/min', 'm/s', or
'm/min'
+ - air:serviceCeiling (string) // any integer (with optional
',' every 1000s place)
+ < '\d{1,3}(,?\d{3})*\s*(nm|m|km|mi|ft)' // followed by
'nm', 'm', 'km', 'mi', or 'ft'
+ - air:fuelCapacity (string) // any integer (with optional
',' every 1000s place)
+ < '\d{1,3}(,?\d{3})*\s*(lb|kg|gal|L)' // followed by
'lb', 'kg', 'gal', or 'L'
+ - air:crew (long) < '[0,)' // any
non-negative value
+ - air:numberBuilt (string) // any integer (with optional
',' every 1000s place)
+ < '\d{1,3}(,?\d{3})*\s*[+]?' , // optionally
followed by '+'
+ '([<>]\s*)?\d{1,3}(,?\d{3})*' // or prefixed
by '<' or '>'
+ - air:url (string)
Deleted: trunk/docs/examples/gettingstarted/repositories/src/main/resources/virtual.cnd
===================================================================
---
trunk/docs/examples/gettingstarted/repositories/src/main/resources/virtual.cnd 2009-06-10
21:22:34 UTC (rev 1034)
+++
trunk/docs/examples/gettingstarted/repositories/src/main/resources/virtual.cnd 2009-06-10
21:23:19 UTC (rev 1035)
@@ -1,79 +0,0 @@
-/*
- * JBoss DNA (
http://www.jboss.org/dna)
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * See the AUTHORS.txt file in the distribution for a full listing of
- * individual contributors.
- *
- * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
- * is licensed to you under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * JBoss DNA is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-//------------------------------------------------------------------------------
-// N A M E S P A C E S
-//------------------------------------------------------------------------------
-<jcr='http://www.jcp.org/jcr/1.0'>
-<nt='http://www.jcp.org/jcr/nt/1.0'>
-<mix='http://www.jcp.org/jcr/mix/1.0'>
-<air='http://jboss.org/dna/examples/aircraft/1.0'>
-<car='http://jboss.org/dna/examples/cars/1.0'>
-
-//------------------------------------------------------------------------------
-// N O D E T Y P E S
-//------------------------------------------------------------------------------
-
-[car:Car] > nt:unstructured
- - car:maker (string)
- - car:model (string)
- - car:year (string) < '(19|20)\d{2}' // any 4 digit
number starting with '19' or '20'
- - car:msrp (string) < '[$]\d{1,3}[,]?\d{3}([.]\d{2})?' // of the form
"$X,XXX.ZZ", "$XX,XXX.ZZ" or "$XXX,XXX.ZZ"
- // where '.ZZ' is
optional
- - car:userRating (long) < '[1,5]' // any value from 1
to 5 (inclusive)
- - car:valueRating (long) < '[1,5]' // any value from 1
to 5 (inclusive)
- - car:mpgCity (long) < '(0,]' // any value
greater than 0
- - car:mpgHighway (long) < '(0,]' // any value
greater than 0
- - car:lengthInInches (double) < '(0,]' // any value
greater than 0
- - car:wheelbaseInInches (double) < '(0,]' // any value
greater than 0
- - car:engine (string)
-
-[air:Aircraft] > nt:unstructured
- - air:maker (string)
- - air:model (string)
- - air:designedBy (string)
- - air:introduced (string) < '(19|20)\d{2}' // any 4 digit
number starting with '19' or '20'
- - air:range (string) // any integer (with optional
',' every 1000s place)
- < '\d{1,3}(,?\d{3})*\s*(nm|m|km|mi|ft)' // followed by
'nm', 'm', 'km', 'mi', or 'ft'
- - air:maxSpeed (string) // any integer (with optional
',' every 1000s place)
- < '\d{1,3}(,?\d{3})*\s*(kt|mph|km/h|kmph)' // followed by
'kt', 'mph', 'km/h' or 'kmph'
- - air:takeoffSpeed (string) // any integer (with optional
',' every 1000s place)
- < '\d{1,3}(,?\d{3})*\s*(kt|mph|km/h|kmph)' // followed by
'kt', 'mph', 'km/h' or 'kmph'
- - air:cruiseSpeed (string) // any integer (with optional
',' every 1000s place)
- < '\d{1,3}(,?\d{3})*\s*(kt|mph|km/h|kmph)' // followed by
'kt', 'mph', 'km/h' or 'kmph'
- - air:emptyWeight (string) // any integer (with optional
',' every 1000s place)
- < '\d{1,3}(,?\d{3})*\s*(lb|kg)' // followed by
'lb' or 'kg'
- - air:maxWeight (string) // any integer (with optional
',' every 1000s place)
- < '\d{1,3}(,?\d{3})*\s*(lb|kg)' // followed by
'lb' or 'kg'
- - air:rateOfClimb (string) // any integer (with optional
',' every 1000s place)
- < '\d{1,3}(,?\d{3})*\s*(ft|km|m)/(s|min)' // followed by
'ft/s', 'ft/min', 'km/s', 'km/min', 'm/s', or
'm/min'
- - air:serviceCeiling (string) // any integer (with optional
',' every 1000s place)
- < '\d{1,3}(,?\d{3})*\s*(nm|m|km|mi|ft)' // followed by
'nm', 'm', 'km', 'mi', or 'ft'
- - air:fuelCapacity (string) // any integer (with optional
',' every 1000s place)
- < '\d{1,3}(,?\d{3})*\s*(lb|kg|gal|L)' // followed by
'lb', 'kg', 'gal', or 'L'
- - air:crew (long) < '[0,)' // any
non-negative value
- - air:numberBuilt (string) // any integer (with optional
',' every 1000s place)
- < '\d{1,3}(,?\d{3})*\s*[+]?' , // optionally
followed by '+'
- '([<>]\s*)?\d{1,3}(,?\d{3})*' // or prefixed
by '<' or '>'
- - air:url (string)
Modified:
trunk/docs/examples/gettingstarted/repositories/src/test/java/org/jboss/example/dna/repository/RepositoryClientTest.java
===================================================================
---
trunk/docs/examples/gettingstarted/repositories/src/test/java/org/jboss/example/dna/repository/RepositoryClientTest.java 2009-06-10
21:22:34 UTC (rev 1034)
+++
trunk/docs/examples/gettingstarted/repositories/src/test/java/org/jboss/example/dna/repository/RepositoryClientTest.java 2009-06-10
21:23:19 UTC (rev 1035)
@@ -34,6 +34,7 @@
import java.util.Map;
import org.junit.After;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.mockito.MockitoAnnotations;
import org.mockito.MockitoAnnotations.Mock;
@@ -60,6 +61,8 @@
client.setUserInterface(userInterface);
client.setApi(getApi());
stub(userInterface.getLocationOfRepositoryFiles()).toReturn(new
File("src/main/resources").getAbsolutePath());
+ stub(userInterface.getLocationOfCndFiles()).toReturn(new
File("src/main/resources").getAbsolutePath());
+ stub(userInterface.getRepositoryConfiguration()).toReturn(new
File("src/main/resources/configRepository.xml"));
}
@After
@@ -96,21 +99,22 @@
@Test
public void shouldStartupWithoutError() throws Exception {
client.startRepositories();
- assertThat(client.getNamesOfRepositories(), hasItems("Aircraft",
"Cars", "Configuration", "Vehicles", "Cache"));
+ assertThat(client.getNamesOfRepositories(), hasItems("Aircraft",
"Car", "Vehicles"));
}
@Test
public void shouldStartupWithoutErrorMoreThanOnce() throws Exception {
client.startRepositories();
- assertThat(client.getNamesOfRepositories(), hasItems("Aircraft",
"Cars", "Configuration", "Vehicles", "Cache"));
+ assertThat(client.getNamesOfRepositories(), hasItems("Aircraft",
"Car", "Vehicles"));
}
+ @Ignore
@Test
public void shouldHaveContentFromConfigurationRepository() throws Throwable {
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 +229,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"));
@@ -252,6 +256,8 @@
assertProperty("wheelbaseInInches", "108.0");
assertProperty("engine", "5,935 cc 5.9 liters V 12");
+ getNodeInfo("Vehicles", "/Vehicles/Aircraft");
+
getNodeInfo("Vehicles", "/Vehicles/Aircraft/Vintage/Wright
Flyer");
assertThat(children.size(), is(0));
assertThat(properties.containsKey("jcr:primaryType"), is(true));
@@ -272,10 +278,10 @@
@Test
public void shouldBeAbleToExecuteTestsRepeatedly() throws Throwable {
for (int i = 0; i != 5; ++i) {
- shouldHaveContentFromConfigurationRepository();
+ // shouldHaveContentFromConfigurationRepository();
shouldHaveContentFromCarsRepository();
shouldHaveContentFromAircraftRepository();
- // shouldHaveContentFromVehiclesRepository();
+ shouldHaveContentFromVehiclesRepository();
}
}
}
Modified:
trunk/docs/gettingstarted/src/main/docbook/en-US/content/downloading_and_running.xml
===================================================================
---
trunk/docs/gettingstarted/src/main/docbook/en-US/content/downloading_and_running.xml 2009-06-10
21:22:34 UTC (rev 1034)
+++
trunk/docs/gettingstarted/src/main/docbook/en-US/content/downloading_and_running.xml 2009-06-10
21:23:19 UTC (rev 1035)
@@ -224,8 +224,9 @@
</listitem>
<listitem>
<para><emphasis
role="strong"><code>aircraft.cnd</code></emphasis>,
<emphasis
role="strong"><code>cars.cnd</code></emphasis>,
- and <emphasis
role="strong"><code>virtual.cnd</code></emphasis> are the
CND files used for the three different JCR Repositories
- set up in the example. The <emphasis
role="strong"><code>virtual.cnd</code></emphasis> is just a
combination of the other two.
+ and <emphasis
role="strong"><code>vehicles.cnd</code></emphasis> are the
CND files used for the three different JCR Repositories
+ set up in the example. The <emphasis
role="strong"><code>vehicles.cnd</code></emphasis> is just
a combination of the other two
+ (with duplicates removed).
</para>
</listitem>
<listitem>
Modified: trunk/docs/gettingstarted/src/main/docbook/en-US/content/repository_example.xml
===================================================================
---
trunk/docs/gettingstarted/src/main/docbook/en-US/content/repository_example.xml 2009-06-10
21:22:34 UTC (rev 1034)
+++
trunk/docs/gettingstarted/src/main/docbook/en-US/content/repository_example.xml 2009-06-10
21:23:19 UTC (rev 1035)
@@ -263,9 +263,9 @@
// in the configuration file, but this approach is easy and allows us to define the
node types
// using the CND format in one or multiple files.
String locationOfCndFiles = userInterface.getLocationOfCndFiles();
- configuration.repository("aircraft
repository").addNodeTypes(locationOfCndFiles + "/aircraft.cnd");
- configuration.repository("car repository").addNodeTypes(locationOfCndFiles
+ "/cars.cnd");
- configuration.repository("virtual").addNodeTypes(locationOfCndFiles +
"/virtual.cnd");
+ configuration.repository("Aircraft").addNodeTypes(locationOfCndFiles +
"/aircraft.cnd");
+ configuration.repository("Cars").addNodeTypes(locationOfCndFiles +
"/cars.cnd");
+ configuration.repository("Vehicles").addNodeTypes(locationOfCndFiles +
"/vehicles.cnd");
// Now create the JCR engine ...
engine = configuration.build();
Modified: trunk/docs/gettingstarted/src/main/docbook/en-US/content/using_dna.xml
===================================================================
--- trunk/docs/gettingstarted/src/main/docbook/en-US/content/using_dna.xml 2009-06-10
21:22:34 UTC (rev 1034)
+++ trunk/docs/gettingstarted/src/main/docbook/en-US/content/using_dna.xml 2009-06-10
21:23:19 UTC (rev 1035)
@@ -179,7 +179,7 @@
This of course is optional, since we could access the same content through
'vehicles'.
-->
<dna:repository jcr:name="car repository"
dna:source="Cars">
- <options jcr:primaryType="dna:options"/>
+ <options jcr:primaryType="dna:options">
<jaasLoginConfigName jcr:primaryType="dna:option"
dna:value="dna-jcr"/>
</options>
</dna:repository>
Modified: trunk/docs/reference/src/main/docbook/en-US/content/jcr/configuration.xml
===================================================================
--- trunk/docs/reference/src/main/docbook/en-US/content/jcr/configuration.xml 2009-06-10
21:22:34 UTC (rev 1034)
+++ trunk/docs/reference/src/main/docbook/en-US/content/jcr/configuration.xml 2009-06-10
21:23:19 UTC (rev 1035)
@@ -179,7 +179,7 @@
This of course is optional, since we could access the same content through
'vehicles'.
-->
<dna:repository jcr:name="car repository"
dna:source="Cars">
- <options jcr:primaryType="dna:options"/>
+ <options jcr:primaryType="dna:options">
<jaasLoginConfigName jcr:primaryType="dna:option"
dna:value="dna-jcr"/>
</options>
</dna:repository>