Skip to content

Commit

Permalink
Updated the example configuration code for each of the sequencers. Fi…
Browse files Browse the repository at this point in the history
…xed a small typo in the configuration chapter.

git-svn-id: https://svn.jboss.org/repos/modeshape/trunk@1021 76366958-4244-0410-ad5e-bbfabb93f86b
  • Loading branch information
bcarothers-xx committed Jun 9, 2009
1 parent b6e3706 commit 85720f9
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ config.mimeTypeDetector("Extension Detector")
<sect1 id="using_dna_whats_next">
<title>What's next</title>
<para>
This chapter outline how you configure JBoss DNA, how you then access a <code>javax.jcr.Repository</code> instance,
This chapter outlines how you configure JBoss DNA, how you then access a <code>javax.jcr.Repository</code> instance,
and use the standard JCR API to interact with the repository. The
<link linkend="jcr">next chapter</link> talks about using the JCR API with your JBoss DNA repository.
</para>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@
<title>Compact Node Type (CND) Sequencer</title>
<para>
This sequencer processes JCR Compact Node Definition (CND) files
to extract the node definitions with their property definitions, and inserts these into the repository using JCR standard notation.
to extract the node definitions with their property definitions, and inserts these into the repository using JCR built-in types.
The node structure generated by this sequencer is equivalent to the node structure used in <code>/jcr:system/jcr:nodeTypes</code>.
</para>

<para>
This sequencer can be added to the repository configuration like so:
<programlisting>
JcrConfiguration config = ...

config.sequencer("CND Sequencer")
.usingClass("org.jboss.dna.sequencer.cnd.CndSequencer")
.loadedFromClasspath()
.setDescription("Sequences CND files to extract the node type definitions")
.sequencingFrom("//(*.cnd[*])/jcr:content[@jcr:data]")
.andOutputtingTo("/nodeTypes/$1");

</programlisting>
</para>
</chapter>
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,16 @@
</para>
<para>
To use this sequencer, simply include the <code>dna-sequencer-images</code> JAR
in your application and configure the Sequencing Service to use this sequencer using something similar to:
in your application and configure the &JcrConfiguration; to use this sequencer using something similar to:
</para>
<programlisting>
String name = "Image Sequencer";
String desc = "Sequences image files to extract the characteristics of the image";
String classname = "org.jboss.dna.sequencer.images.ImageMetadataSequencer";
String[] classpath = null; // Use the current classpath
String[] pathExpressions = {"//(*.(jpg|jpeg|gif|bmp|pcx|png|iff|ras|pbm|pgm|ppm|psd)[*])/jcr:content[@jcr:data] =&gt; /images/$1"};
&SequencerConfig; sequencerConfig = new &SequencerConfig;(name, desc, classname,
classpath, pathExpressions);
sequencingService.addSequencer(sequencerConfig);
JcrConfiguration config = ...
config.sequencer("Image Sequencer")
.usingClass("org.jboss.dna.sequencer.image.ImageMetadataSequencer")
.loadedFromClasspath()
.setDescription("Sequences image files to extract the characteristics of the image")
.sequencingFrom("//(*.(jpg|jpeg|gif|bmp|pcx|png|iff|ras|pbm|pgm|ppm|psd)[*])/jcr:content[@jcr:data]")
.andOutputtingTo("/images/$1");

</programlisting>
</chapter>
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@
</para>
<para>
To use this sequencer, simply include the <code>dna-sequencer-java</code> JAR (plus all of the JARs that it is dependent upon)
in your application and configure the Sequencing Service to use this sequencer using something similar to:
in your application and configure the &JcrConfiguration; to use this sequencer using something similar to:
</para>
<programlisting>
String name = "Java Sequencer";
String desc = "Sequences java files to extract the characteristics of the Java source";
String classname = "org.jboss.dna.sequencer.java.JavaMetadataSequencer";
String[] classpath = null; // Use the current classpath
String[] pathExpressions = {"//(*.java[*])/jcr:content[@jcr:data] =&gt; /java/$1"};
&SequencerConfig; sequencerConfig = new &SequencerConfig;(name, desc, classname,
classpath, pathExpressions);
this.sequencingService.addSequencer(sequencerConfig);
JcrConfiguration config = ...

config.sequencer("Java Sequencer")
.usingClass("org.jboss.dna.sequencer.java.JavaMetadataSequencer")
.loadedFromClasspath()
.setDescription("Sequences java files to extract the characteristics of the Java source")
.sequencingFrom("//(*.(java)[*])/jcr:content[@jcr:data]")
.andOutputtingTo("/java/$1");
</programlisting>
</chapter>
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,24 @@
<title><trademark class='registered'>Microsoft Office</trademark> Document Sequencer</title>
<para>
This sequencer is included in JBoss DNA and processes Microsoft Office documents, including Word documents, Excel spreadsheets,
and PowerPoint presentations. With documents, the sequencer extracts the internal structure based on Heading styles.
and PowerPoint presentations. With documents, the sequencer attempts to infer the internal structure from the heading styles.
With presentations, the sequencer extracts the slides, titles, text and slide thumbnails.
With spreadsheets, the sequencer extracts the names of the sheets. And, the sequencer extracts for all the files the
general file information, including the name of the author, title, keywords, subject, comments, and various dates.
</para>
<para>
To use this sequencer, simply include the <code>dna-sequencer-msoffice</code> JAR and all of the
<ulink url="http://poi.apache.org/">POI</ulink> JARs
in your application and configure the Sequencing Service to use this sequencer using something similar to:
in your application and configure the &JcrConfiguration; to use this sequencer using something similar to:
</para>
<programlisting>
String name = "Microsoft Office Document Sequencer";
String desc = "Sequences MS Office documents, including spreadsheets and presentations";
String classname = "org.jboss.dna.sequencer.msoffice.MSOfficeMetadataSequencer";
String[] classpath = null; // Use the current classpath
String[] pathExpressions = {"//(*.(doc|docx|ppt|pps|xls)[*])/jcr:content[@jcr:data] =&gt; /msoffice/$1"};
&SequencerConfig; sequencerConfig = new &SequencerConfig;(name, desc, classname,
classpath, pathExpressions);
sequencingService.addSequencer(sequencerConfig);
JcrConfiguration config = ...

config.sequencer("Microsoft Office Document Sequencer")
.usingClass("org.jboss.dna.sequencer.msoffice.MSOfficeMetadataSequencer")
.loadedFromClasspath()
.setDescription("Sequences MS Office documents, including spreadsheets and presentations")
.sequencingFrom("//(*.(*.(doc|docx|ppt|pps|xls)[*])/jcr:content[@jcr:data]")
.andOutputtingTo("/msoffice/$1");
</programlisting>
</chapter>
17 changes: 9 additions & 8 deletions docs/reference/src/main/docbook/en-US/content/sequencers/mp3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,16 @@
</para>
<para>
To use this sequencer, simply include the <code>dna-sequencer-mp3</code> JAR and the <ulink url="http://www.jthink.net/jaudiotagger/">JAudioTagger</ulink>
library in your application and configure the Sequencing Service to use this sequencer using something similar to:
library in your application and configure the &JcrConfiguration; to use this sequencer using something similar to:
</para>
<programlisting>
String name = "MP3 Sequencer";
String desc = "Sequences MP3 files to extract the ID3 tags of the audio file";
String classname = "org.jboss.dna.sequencer.mp3.Mp3MetadataSequencer";
String[] pathExpressions = {"//(*.mp3[*])/jcr:content[@jcr:data] =&gt; /mp3s/$1"};
&SequencerConfig; sequencerConfig = new &SequencerConfig;(name, desc, classname,
classpath, pathExpressions);
this.sequencingService.addSequencer(sequencerConfig);
JcrConfiguration config = ...

config.sequencer("MP3 Sequencer")
.usingClass("org.jboss.dna.sequencer.mp3.Mp3MetadataSequencer")
.loadedFromClasspath()
.setDescription("Sequences MP3 files to extract the ID3 tags of the audio file")
.sequencingFrom("//(*.mp3[*])/jcr:content[@jcr:data]")
.andOutputtingTo("/mp3s/$1");
</programlisting>
</chapter>
13 changes: 12 additions & 1 deletion docs/reference/src/main/docbook/en-US/content/sequencers/xml.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@
<chapter id="xml-sequencer">
<title>XML Document Sequencer</title>
<para>
This sequencer stores the structure and data of an XML file into the repository.
This sequencer stores the structure and data of an XML file into the repository. DTD, entity, comments,
and other content are maintained by the sequencer in the output structure.
</para>
<programlisting>
JcrConfiguration config = ...

config.sequencer("XML Sequencer")
.usingClass("org.jboss.dna.sequencer.xml.XmlSequencer")
.loadedFromClasspath()
.setDescription("Sequences XML documents and maps their data into the repository")
.sequencingFrom("//(*.xml[*])/jcr:content[@jcr:data]")
.andOutputtingTo("/xml/$1");
</programlisting>
</chapter>
22 changes: 12 additions & 10 deletions docs/reference/src/main/docbook/en-US/content/sequencers/zip.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,21 @@
<title>ZIP File Sequencer</title>
<para>
The ZIP file sequencer is included in JBoss DNA and extracts the files and folders contained in the ZIP archive file,
extracting the files and folders into the repository using JCR's <code>nt:file</code> and <code>nt:folder</code> node types.
extracting the files and folders into the repository using JCR's <code>nt:file</code> and <code>nt:folder</code>
built-in node types. The structure of the output thus matches the logical structure of the contents of the ZIP file.
</para>
<para>
To use this sequencer, simply include the <code>dna-sequencer-zip</code> JAR
in your application and configure the Sequencing Service to use this sequencer using something similar to:
in your application and configure the &JcrConfiguration; to use this sequencer using something similar to:
</para>
<programlisting>
String name = "ZIP Sequencer";
String desc = "Sequences ZIP archives to extract the files and folders";
String classname = "org.jboss.dna.sequencer.zip.ZipSequencer";
String[] pathExpressions = {"//(*.zip[*])/jcr:content[@jcr:data] =&gt; /zips/$1"};
&SequencerConfig; sequencerConfig = new &SequencerConfig;(name, desc, classname,
classpath, pathExpressions);
this.sequencingService.addSequencer(sequencerConfig);
</programlisting>
JcrConfiguration config = ...

config.sequencer("ZIP Sequencer")
.usingClass("org.jboss.dna.sequencer.zip.ZipSequencer")
.loadedFromClasspath()
.setDescription("Sequences compressed files to extract the internal file and folder structure")
.sequencingFrom("//(*.(zip|gz|jar|war|ear)[*])/jcr:content[@jcr:data]")
.andOutputtingTo("/zips/$1");
</programlisting>
</chapter>

0 comments on commit 85720f9

Please sign in to comment.