Merge pull request #7 from nawroth/master

work on SDN docs
This commit is contained in:
Michael Hunger
2011-10-18 05:45:40 -07:00
12 changed files with 96 additions and 62 deletions

68
pom.xml
View File

@@ -140,6 +140,9 @@
<dist.accessKey>s3 access key</dist.accessKey>
<dist.secretKey>s3 secret key</dist.secretKey>
-->
<docbook.srcDir>${basedir}/src/docbkx</docbook.srcDir>
<docbook.snippetsDir>${basedir}/spring-data-neo4j/target/docbkx</docbook.snippetsDir>
<docbook.generatedDir>${basedir}/target/classes</docbook.generatedDir>
</properties>
<profiles>
<profile>
@@ -264,11 +267,37 @@
<version>3.1.0.RELEASE</version>
</extension>
</extensions>
<plugins>
<resources>
<resource>
<directory>${docbook.srcDir}</directory>
<filtering>false</filtering>
</resource>
<resource>
<directory>${docbook.snippetsDir}</directory>
<filtering>false</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>resources</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.agilejava.docbkx</groupId>
<artifactId>docbkx-maven-plugin</artifactId>
<version>2.0.8</version>
<version>2.0.11</version>
<executions>
<execution>
<id>single-page</id>
@@ -276,8 +305,9 @@
<goal>generate-html</goal>
</goals>
<configuration>
<sourceDirectory>${docbook.generatedDir}</sourceDirectory>
<keepRelativeImageUris>true</keepRelativeImageUris>
<htmlCustomization>${basedir}/src/docbkx/resources/xsl/html.xsl</htmlCustomization>
<htmlCustomization>${docbook.generatedDir}/resources/xsl/html.xsl</htmlCustomization>
<useExtensions>1</useExtensions>
<highlightSource>1</highlightSource>
<highlightDefaultLanguage></highlightDefaultLanguage>
@@ -286,8 +316,8 @@
file="${basedir}/target/docbkx/html/index.html"/>
<copy todir="${basedir}/target/site/reference/html" flatten="true">
<fileset dir="${basedir}/src/docbkx/">
<exclude name="${basedir}/src/docbkx/resources/*"/>
<fileset dir="${basedir}/target/classes/">
<exclude name="${docbook.generatedDir}/resources/*"/>
<include name="**/*.png"/>
<include name="**/*.gif"/>
<include name="**/*.jpg"/>
@@ -295,7 +325,7 @@
</copy>
<copy todir="${basedir}/target/site/reference/html">
<fileset dir="${basedir}/src/docbkx/resources">
<fileset dir="${docbook.generatedDir}/resources">
<include name="**/*.css"/>
<include name="**/*.png"/>
<include name="**/*.gif"/>
@@ -312,9 +342,9 @@
<goal>generate-rtf</goal>
</goals>
<configuration>
<imgSrcPath>${basedir}/src/docbkx/</imgSrcPath>
<admonGraphicsPath>${basedir}/src/docbkx/resources/images/</admonGraphicsPath>
<sourceDirectory>${basedir}/src/docbkx/</sourceDirectory>
<imgSrcPath>${docbook.generatedDir}/</imgSrcPath>
<admonGraphicsPath>${docbook.generatedDir}/resources/images/</admonGraphicsPath>
<sourceDirectory>${docbook.generatedDir}/</sourceDirectory>
<fopExtensions>0</fopExtensions>
<fop1Extensions>0</fop1Extensions>
<useExtensions>0</useExtensions>
@@ -334,9 +364,10 @@
<goal>generate-pdf</goal>
</goals>
<configuration>
<imgSrcPath>${basedir}/src/docbkx/</imgSrcPath>
<admonGraphicsPath>${basedir}/src/docbkx/resources/images/</admonGraphicsPath>
<foCustomization>${basedir}/src/docbkx/resources/xsl/fopdf.xsl</foCustomization>
<sourceDirectory>${docbook.generatedDir}</sourceDirectory>
<imgSrcPath>${docbook.generatedDir}/</imgSrcPath>
<admonGraphicsPath>${docbook.generatedDir}/resources/images/</admonGraphicsPath>
<foCustomization>${docbook.generatedDir}/resources/xsl/fopdf.xsl</foCustomization>
<useExtensions>1</useExtensions>
<highlightSource>1</highlightSource>
<highlightDefaultLanguage></highlightDefaultLanguage>
@@ -354,9 +385,10 @@
<goal>generate-html</goal>
</goals>
<configuration>
<sourceDirectory>${docbook.generatedDir}</sourceDirectory>
<keepRelativeImageUris>true</keepRelativeImageUris>
<chunkedOutput>true</chunkedOutput>
<htmlCustomization>${basedir}/src/docbkx/resources/xsl/html_chunk.xsl</htmlCustomization>
<htmlCustomization>${docbook.generatedDir}/resources/xsl/html_chunk.xsl</htmlCustomization>
<useExtensions>1</useExtensions>
<highlightSource>1</highlightSource>
<highlightDefaultLanguage></highlightDefaultLanguage>
@@ -368,15 +400,15 @@
</fileset>
</move>
<copy todir="${basedir}/target/site/reference/multi">
<fileset dir="${basedir}/src/docbkx/resources">
<fileset dir="${docbook.generatedDir}/resources">
<include name="**/*.png"/>
<include name="**/*.gif"/>
<include name="**/*.jpg"/>
</fileset>
</copy>
<copy todir="${basedir}/target/site/reference/multi" flatten="true">
<fileset dir="${basedir}/src/docbkx">
<exclude name="${basedir}/src/docbkx/resources/*"/>
<fileset dir="${docbook.generatedDir}">
<exclude name="${docbook.generatedDir}/resources/*"/>
<include name="**/*.css"/>
<include name="**/*.png"/>
<include name="**/*.gif"/>
@@ -406,8 +438,8 @@
<chunkedOutput>false</chunkedOutput>
<draftWatermarkImage/>
<htmlStylesheet>css/html.css</htmlStylesheet>
<sourceDirectory>${basedir}/src/docbkx/</sourceDirectory>
<!--foCustomization>${basedir}/src/docbkx/resources/xsl/fopdf.xsl</foCustomization-->
<sourceDirectory>${docbook.generatedDir}/</sourceDirectory>
<!--foCustomization>${docbook.generatedDir}/resources/xsl/fopdf.xsl</foCustomization-->
<xincludeSupported>true</xincludeSupported>
<entities>
<entity>

View File

@@ -9,8 +9,8 @@
<spring:url value="/resources/spring/Spring.js" var="spring_url" />
<spring:url value="/resources/spring/Spring-Dojo.js" var="spring_dojo_url" />
<spring:url value="/resources/images/favicon.ico" var="favicon" />
<link rel="stylesheet" type="text/css" media="screen" href="${roo_css_url}"><!-- required for FF3 and Opera --></link>
<link rel="stylesheet" type="text/css" href="${tundra_url}"><!-- required for FF3 and Opera --></link>
<link rel="stylesheet" type="text/css" media="screen" href="${roo_css_url}" /><!-- required for FF3 and Opera -->
<link rel="stylesheet" type="text/css" href="${tundra_url}" /><!-- required for FF3 and Opera -->
<link rel="SHORTCUT ICON" href="${favicon}" />
<!-- Get the user local from the page context (it was set by Spring MVC's locale resolver) -->

View File

@@ -25,7 +25,7 @@ import static org.junit.Assert.fail;
public abstract class DocumentingTestBase {
private static final String DOCBOOK_DIR = "src/docbkx";
private static final String DOCBOOK_DIR = "target/docbkx";
private static final String SRC_TEST_JAVA = "src/test/java";
protected String title;
protected String snippetTitle;
@@ -52,7 +52,7 @@ public abstract class DocumentingTestBase {
}
private File docbookDirectory() {
return new File(determineRoot(),DOCBOOK_DIR);
return new File (new File(determineRoot(),module()), DOCBOOK_DIR);
}
protected File getSnippetFileName(File directory, String name) {
@@ -130,9 +130,9 @@ public abstract class DocumentingTestBase {
protected File determineRoot() {
File currentDirectory = currentDirectory();
if (new File(currentDirectory,DOCBOOK_DIR).exists()) return currentDirectory;
if (new File(currentDirectory,module()).exists()) return currentDirectory;
currentDirectory = currentDirectory.getParentFile();
if (new File(currentDirectory,DOCBOOK_DIR).exists()) return currentDirectory;
if (new File(currentDirectory,module()).exists()) return currentDirectory;
throw new IllegalStateException("Can't determine root directory, started at "+currentDirectory());
}
}

View File

@@ -63,17 +63,17 @@
We also appreciate very much the foresight of Rod Johnson and Emil Eifrem to initiate the project, and now
also providing great forewords. Their leadership inspired collaboration between the engineering teams at
SpringSource and Neo Technology, a tremendous help during the making of Spring Data Neo4j.
 
</para>
 
<para>
Last but not least we thank our vibrant community, both in the Spring Forums as well as on the Neo4j
Mailing list and on many other places on the internet for giving us feedback, reporting issues and suggesting
improvements. Without that important feedback we wouldn't be where we are today.
 
</para>
</section>  
<para>
Enjoy the book!
</para>
</section>
</preface>

View File

@@ -63,12 +63,13 @@
persists fields explicitly annotated with <code>@GraphProperty</code>. JPA will ignore these fields.
</para>
</section>
<section><title>Example</title>
<para>
The following example is taken from the
<ulink url="http://github.com/SpringSource/spring-data-neo4j-examples">Spring Data Neo4j examples</ulink>
myrestaurants-social project:
</para>
<example>
<para><example>
<title>Cross-store node entity</title>
<programlisting language="java"><![CDATA[@Entity
@Table(name = "user_account")
@@ -114,7 +115,8 @@ public class UserAccount {
}
}
]]></programlisting>
</example>
</example></para>
</section>
</section>
<section>
<title>Configuring cross-store persistence</title>

View File

@@ -31,23 +31,23 @@
Neo4j has been in commercial development for 10 years and in production for over 7 years.
Most importantly it has a helpful and contributing community surrounding it, but it also:
<itemizedlist>
<listitem>has an intuitive graph-oriented model for data representation. Instead of tables, rows,
<listitem><simpara>has an intuitive graph-oriented model for data representation. Instead of tables, rows,
and columns, you work with a graph consisting of
<ulink url="http://wiki.neo4j.org/content/Getting_Started">nodes, relationships, and properties</ulink>.
</listitem>
<listitem>has a disk-based, native storage manager optimized for storing graph structures
</simpara></listitem>
<listitem><simpara>has a disk-based, native storage manager optimized for storing graph structures
with maximum performance and scalability.
</listitem>
<listitem>is scalable. Neo4j can handle graphs with many billions of nodes/relationships/properties on
</simpara></listitem>
<listitem><simpara>is scalable. Neo4j can handle graphs with many billions of nodes/relationships/properties on
a single machine, but can also be scaled out across multiple machines for high availability.
</listitem>
<listitem>has a powerful traversal framework for traversing in the node space.
</listitem>
<listitem>can be deployed as a standalone server or an embedded database with a very small
</simpara></listitem>
<listitem><simpara>has a powerful traversal framework for traversing in the node space.
</simpara></listitem>
<listitem><simpara>can be deployed as a standalone server or an embedded database with a very small
distribution footprint (~700k jar).
</listitem>
<listitem>has a Java <ulink url="http://api.neo4j.org/">API</ulink>.
</listitem>
</simpara></listitem>
<listitem><simpara>has a Java <ulink url="http://api.neo4j.org/">API</ulink>.
</simpara></listitem>
</itemizedlist>
</para>
<para>
@@ -132,9 +132,9 @@ for (Path position : traversalDescription.traverse(myStartNode)) {
Spring Data Neo4j provides automatic indexing via the @Indexed annotation, eliminating the need
for manual index management.
</para>
<note>
<note><para>
Modifying Neo4j indexes also requires transactions.
</note>
</para></note>
<example>
<title>Index usage</title>
<programlisting language="java"><![CDATA[IndexManager indexManager = graphDb.index();

View File

@@ -21,7 +21,7 @@
</para>
<para>
Spring Data Neo4j allows, at anytime, to drop down to the <xref linkend="neo4j" >Neo4j-API</xref> level to execute functionality with
Spring Data Neo4j allows, at anytime, to drop down to the Neo4j-API, see <xref linkend="neo4j" /> level to execute functionality with
the highest performance possible.
</para>
<para>
@@ -46,16 +46,16 @@
</para>
<para>
To use advanced functionality like traversals, Cypher and Gremlin, a basic understanding of the graph data model is required.
The graph data model is explained in the chapter about <xref linkend="neo4j">Neo4j</xref>.
The graph data model is explained in the chapter about Neo4j, see <xref linkend="neo4j" />.
</para>
<para>
Relationships between entities are first class citizens in a graph database and therefore worth a separate
<xref linkend="reference:programming_model:relationships" >chapter</xref> describing their usage in Spring Data Neo4j.
chapter (<xref linkend="reference:programming_model:relationships" />) describing their usage in Spring Data Neo4j.
</para>
<para>
To add fields that are just backed by graph operations is a bit more involved. First you should know
about traversals, Cypher queries and Gremlin expressions.
Those are explained in the <xref linkend="neo4j" >Neo4j-API</xref> chapter. Then you can start adding purely
Those are explained in <xref linkend="neo4j" />Neo4j-API. Then you can start adding purely
dynamically gathered fields to your entities.
</para>
<para>
@@ -124,7 +124,7 @@
</para>
<para>
Being a Spring Data library, Spring Data Neo4j also implements a comprehensive template for interacting with the Neo4j graph database.
The <xref linkend="reference:template">Neo4jTemplate</xref> provides all basic graph operations as well as advanced querying with
The Neo4jTemplate (<xref linkend="reference:template" />) provides all basic graph operations as well as advanced querying with
Indexes, Cypher, Gremlin and Traversals with a convenient API.
</para>
<para>

View File

@@ -45,7 +45,7 @@
<ulink url="http://download.eclipse.org/tools/ajdt/36/dev/update">http://download.eclipse.org/tools/ajdt/36/dev/update</ulink>).
The current version that does not show incorrect errors is AspectJ 1.6.12.RELEASE (included in STS 2.8.0), previous versions are reported
to mislead the user.
</para> ¸
</para>
<note>
<para>
There might be some issues with the eclipse maven plugin not adding AspectJ files correctly to the build path.
@@ -68,4 +68,4 @@
give the compiler at least 512 MB of RAM.
</para>
</section>
</section>
</section>

View File

@@ -91,12 +91,12 @@ Person mark = graphRepository.findAllByQuery("people-search", "name", "ma*");
</example>
</para>
<note>
<note><para>
Please note that indexes are currently created on demand, so whenever an index that doesn't exist
is requested from a query or get operation it is created. This is subject to change but has
currently the implication that those indexes won't be configured as fulltext which causes
subsequent fulltext updates to those indexes to fail.
</note>
</para></note>
</section>
<section>
<title>Manual index access</title>

View File

@@ -22,7 +22,7 @@
<para>
If the <code>partial</code> attribute is set to true, this entity takes part in a cross-store setting,
where the entity lives in both the graph database and a JPA data source. See
<xref linkend="cross-store"/> for more information.
<xref linkend="reference:cross-store"/> for more information.
</para>
<para>
Entity fields can be annotated with <code>@GraphProperty</code>, <code>@RelatedTo</code>,
@@ -94,11 +94,11 @@ public class Group {
]]></programlisting>
</example>
<para>
<note>
<note>
<para>
Please note that this annotation can also be used on repository methods.
</note>
</para>
</para>
</note>
</section>
<section>
<title>@GraphTraversal: fields as traversal result views</title>
@@ -132,4 +132,4 @@ public class Group {
</example>
</section>
</section>
</section>

View File

@@ -81,12 +81,12 @@ public class MovieController {
<para>
Accessing the URI showed the single added movie on screen.
</para>
<note>
<note><para>
Pardon the misused GET parameter for that (don't try this at home, the
<ulink url="http://restinpractice.com">REST guys</ulink> will hunt you down). This is only for
running it from the browser address line. The next iteration of this website would use a button
with POST.
</note>
</para></note>
</section>
<section>
<title>Inspecting the datastore</title>

View File

@@ -9,7 +9,7 @@
classes clean. Spring Data Neo4j promised to do the heavy lifting for us, so we continued investigating it.
</para>
<para>
Spring Data Neo4j depends heavily on AspectJ <xref linkend="reference:aspectj-details">features</xref>.
Spring Data Neo4j depends heavily on AspectJ, see <xref linkend="reference:aspectj-details" />.
Some parts of our classes would get new behavior,
but it would not be visible in our code. The upside of this is that you get rid of a lot of boilerplate
code.