Skip to content

Commit

Permalink
SEAMJCR-6 Added more documentation. Cleaned up test cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnament committed Mar 5, 2011
1 parent 5d6f8e2 commit 068ab9a
Show file tree
Hide file tree
Showing 10 changed files with 311 additions and 18 deletions.
30 changes: 30 additions & 0 deletions docs/src/main/docbook/en-US/event-mapping.xml
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
JBoss, Home of Professional Open Source
Copyright [2010], Red Hat, Inc., and individual contributors
by the @authors tag. See the copyright.txt in the distribution for a
full listing of individual contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<chapter id="jcr-eventmapping">
<title>Seam JCR - Event Mapping</title>

<para>
TODO
</para>


<!--
vim:et:ts=3:sw=3:tw=120
-->
</chapter>
56 changes: 56 additions & 0 deletions docs/src/main/docbook/en-US/jackrabbit.xml
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
JBoss, Home of Professional Open Source
Copyright [2010], Red Hat, Inc., and individual contributors
by the @authors tag. See the copyright.txt in the distribution for a
full listing of individual contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<chapter id="jcr-jackrabbit">
<title>Seam JCR - JackRabbit Integration</title>

<section id="jcr-jr-installation">
<title>JackRabbit Integration Installation</title>
<para>
In order to activate JackRabbit support within your application, you need to include JackRabbit on your classpath. At a minimum, the following
maven dependency must be satisfied.
</para>
<programlisting role="XML"><![CDATA[<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-core</artifactId>
<version>${jackrabbit.version}</version>
</dependency>]]>
</programlisting>
<tip>
<para>
Substitute ${jackrabbit.version} for the JackRabbit version you are running against. Currently, Seam JCR tests against 2.2.4. Please review JackRabbit documentation to determine any additional dependencies.
</para>
</tip>
</section>
<section id="jcr-jr-usage">
<title>Usage</title>
<para>
In order to use JackRabbit's Repository and Session objects in your application, you must define an injection point using the JcrRepository annotation based on JackRabbit's required configuration parameters.
</para>
<programlisting role="java"><![CDATA[
@Inject @JcrRepository(name="org.modeshape.jcr.URL",value="file:path/to/modeshape.xml?repositoryName=MyRepo")
Repository repository;
@Inject @JcrRepository(name="org.modeshape.jcr.URL",value="file:path/to/modeshape.xml?repositoryName=MyRepo")
Session session;]]></programlisting>
</section>

<!--
vim:et:ts=3:sw=3:tw=120
-->
</chapter>
62 changes: 57 additions & 5 deletions docs/src/main/docbook/en-US/jcr-introduction.xml
Expand Up @@ -17,13 +17,65 @@
-->
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<chapter id="jcr-introduction">
<title>Seam JCR - Introduction</title>
<title>Seam JCR - Introduction</title>
<section id="jcr-intro">
<title>Introduction</title>
<para>
The Seam JCR Module aims to simplify the integration points between JCR
implementations and CDI applications.
</para>

<para>
TO DO
</para>

<para>
The Seam JCR module is compatible with JCR 2.0 implementations. It strictly compiles against JCR 2.0. However,
test cases are executed against both ModeShape and JackRabbit to ensure compatibility.
</para>
</section>

<section id="maven-dependencies">
<title>Maven dependency configuration</title>
<para>
If you are using
<ulink url="http://maven.apache.org/">Maven</ulink> as your build tool, you can add the
following single dependency to your pom.xml file to include Seam JCR:
</para>
<programlisting role="XML"><![CDATA[<dependency>
<groupId>org.jboss.seam.jcr</groupId>
<artifactId>seam-jcr</artifactId>
<version>${seam.jcr.version}</version>
</dependency>]]>
</programlisting>
<tip>
<para>
Substitute the expression ${seam.jcr.version} with the most recent or appropriate version of Seam JCR.
Alternatively, you can create a
<ulink
href="http://www.sonatype.com/books/mvnref-book/reference/resource-filtering-sect-properties.html#resource-filtering-sect-user-defined">Maven
user-defined property
</ulink> to satisfy this substitution so you can centrally manage the version.
</para>
</tip>
<para>
Alternatively, you can use the API at compile time and only include the implementation at runtime. This protects
you from inadvertantly depending on an implementation class.
</para>
<programlisting role="XML"><![CDATA[<dependency>
<groupId>org.jboss.seam.jcr</groupId>
<artifactId>seam-jcr-api</artifactId>
<version>${seam.jcr.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jboss.seam.jcr</groupId>
<artifactId>seam-jcr-impl</artifactId>
<version>${seam.jcr.version}</version>
<scope>runtime</scope>
</dependency>]]>
</programlisting>
</section>
<para>
In addition to your Seam JCR dependencies, you must also declare a dependency on a JCR Implementation.
</para>
<!--
vim:et:ts=3:sw=3:tw=120
-->
Expand Down
4 changes: 3 additions & 1 deletion docs/src/main/docbook/en-US/master.xml
Expand Up @@ -25,7 +25,9 @@

<title>Seam JCR</title>
<xi:include href="jcr-introduction.xml"/>

<xi:include href="modeshape.xml"/>
<xi:include href="jackrabbit.xml"/>
<xi:include href="event-mapping.xml"/>
<!--
vim:et:ts=3:sw=3:tw=120
-->
Expand Down
60 changes: 60 additions & 0 deletions docs/src/main/docbook/en-US/modeshape.xml
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
JBoss, Home of Professional Open Source
Copyright [2010], Red Hat, Inc., and individual contributors
by the @authors tag. See the copyright.txt in the distribution for a
full listing of individual contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<chapter id="jcr-modeshape">
<title>Seam JCR - JBoss ModeShape Integration</title>

<section id="jcr-ms-installation">
<title>ModeShape Integration Installation</title>
<para>
In order to activate ModeShape support within your application, you need to include ModeShape on your classpath. At a minimum, the following
maven dependencies must be satisfied.
</para>
<programlisting role="XML"><![CDATA[<dependency>
<groupId>org.modeshape</groupId>
<artifactId>modeshape-jcr</artifactId>
<version>${modeshape.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
<version>${lucene.version}</version>
</dependency>]]>
</programlisting>
<tip>
<para>
Substitute ${modeshape.version} for the ModeShape version you are running against. Currently, Seam JCR tests against 2.4.0.Final. In addition, Lucene is required to run ModeShape. Please consult the ModeShape getting stated guide for exact versions.
</para>
</tip>
</section>
<section id="jcr-ms-usage">
<title>Usage</title>
<para>
In order to use ModeShape's Repository and Session objects in your application, you must define an injection point using the JcrRepository annotation based on ModeShape's required configuration parameters. Please review the ModeShape getting started guide for further details.
</para>
<programlisting role="java"><![CDATA[
@Inject @JcrRepository(name="org.modeshape.jcr.URL",value="file:path/to/modeshape.xml?repositoryName=MyRepo")
Repository repository;
@Inject @JcrRepository(name="org.modeshape.jcr.URL",value="file:path/to/modeshape.xml?repositoryName=MyRepo")
Session session;]]></programlisting>
</section>
<!--
vim:et:ts=3:sw=3:tw=120
-->
</chapter>
90 changes: 90 additions & 0 deletions impl/derby.log
@@ -0,0 +1,90 @@
----------------------------------------------------------------
2011-03-04 02:58:48.672 GMT:
Booting Derby version The Apache Software Foundation - Apache Derby - 10.5.3.0 - (802917): instance a816c00e-012e-7ecd-9f93-000003175390
on database directory /src/git/seam/jcr/impl/target/version/db

Database Class Loader started - derby.database.classpath=''
----------------------------------------------------------------
2011-03-04 02:59:02.275 GMT:
Booting Derby version The Apache Software Foundation - Apache Derby - 10.5.3.0 - (802917): instance 9a4840c2-012e-7ecd-9f93-000003175390
on database directory /src/git/seam/jcr/impl/target/workspaces/default/db

Database Class Loader started - derby.database.classpath=''
----------------------------------------------------------------
2011-03-04 02:59:16.311 GMT:
Booting Derby version The Apache Software Foundation - Apache Derby - 10.5.3.0 - (802917): instance 2a754187-012e-7ecd-9f93-000003175390
on database directory /src/git/seam/jcr/impl/target/workspaces/security/db

Database Class Loader started - derby.database.classpath=''

2011-03-04 02:59:30.407 GMT:
Shutting down instance 9a4840c2-012e-7ecd-9f93-000003175390
----------------------------------------------------------------

2011-03-04 02:59:31.583 GMT:
Shutting down instance 2a754187-012e-7ecd-9f93-000003175390
----------------------------------------------------------------

2011-03-04 02:59:32.573 GMT:
Shutting down instance a816c00e-012e-7ecd-9f93-000003175390
----------------------------------------------------------------
----------------------------------------------------------------
2011-03-04 02:59:32.912 GMT:
Booting Derby version The Apache Software Foundation - Apache Derby - 10.5.3.0 - (802917): instance b0130259-012e-7ecd-9f93-000003175390
on database directory /src/git/seam/jcr/impl/target/version/db

Database Class Loader started - derby.database.classpath=''
----------------------------------------------------------------
2011-03-04 02:59:33.312 GMT:
Booting Derby version The Apache Software Foundation - Apache Derby - 10.5.3.0 - (802917): instance 7bff826d-012e-7ecd-9f93-000003175390
on database directory /src/git/seam/jcr/impl/target/workspaces/default/db

Database Class Loader started - derby.database.classpath=''
----------------------------------------------------------------
2011-03-04 02:59:34.389 GMT:
Booting Derby version The Apache Software Foundation - Apache Derby - 10.5.3.0 - (802917): instance 50f04282-012e-7ecd-9f93-000003175390
on database directory /src/git/seam/jcr/impl/target/workspaces/security/db

Database Class Loader started - derby.database.classpath=''

2011-03-04 02:59:34.859 GMT:
Shutting down instance 7bff826d-012e-7ecd-9f93-000003175390
----------------------------------------------------------------

2011-03-04 02:59:34.981 GMT:
Shutting down instance 50f04282-012e-7ecd-9f93-000003175390
----------------------------------------------------------------

2011-03-04 02:59:35.093 GMT:
Shutting down instance b0130259-012e-7ecd-9f93-000003175390
----------------------------------------------------------------
----------------------------------------------------------------
2011-03-04 02:59:35.777 GMT:
Booting Derby version The Apache Software Foundation - Apache Derby - 10.5.3.0 - (802917): instance 8ef50298-012e-7ecd-9f93-000003175390
on database directory /src/git/seam/jcr/impl/target/version/db

Database Class Loader started - derby.database.classpath=''
----------------------------------------------------------------
2011-03-04 02:59:36.132 GMT:
Booting Derby version The Apache Software Foundation - Apache Derby - 10.5.3.0 - (802917): instance 7c1c82ac-012e-7ecd-9f93-000003175390
on database directory /src/git/seam/jcr/impl/target/workspaces/default/db

Database Class Loader started - derby.database.classpath=''
----------------------------------------------------------------
2011-03-04 02:59:36.754 GMT:
Booting Derby version The Apache Software Foundation - Apache Derby - 10.5.3.0 - (802917): instance 725802c1-012e-7ecd-9f93-000003175390
on database directory /src/git/seam/jcr/impl/target/workspaces/security/db

Database Class Loader started - derby.database.classpath=''

2011-03-04 02:59:37.369 GMT:
Shutting down instance 7c1c82ac-012e-7ecd-9f93-000003175390
----------------------------------------------------------------

2011-03-04 02:59:37.513 GMT:
Shutting down instance 725802c1-012e-7ecd-9f93-000003175390
----------------------------------------------------------------

2011-03-04 02:59:37.614 GMT:
Shutting down instance 8ef50298-012e-7ecd-9f93-000003175390
----------------------------------------------------------------
Expand Up @@ -34,6 +34,7 @@
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

Expand All @@ -46,6 +47,7 @@
* @author George Gastaldi
*
*/
//@Ignore
@RunWith(Arquillian.class)
public class JcrCDIEventListenerTest
{
Expand Down
Expand Up @@ -27,13 +27,15 @@
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

/**
*
* @author johnament
*/
@Ignore
@RunWith(Arquillian.class)
public class RepositoryInjectTest {
@Deployment
Expand Down
Expand Up @@ -29,6 +29,7 @@
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;

Expand Down Expand Up @@ -70,4 +71,8 @@ public void testProduceSession()
{
assertNotNull("JCR Session should have been injected", session);
}
@After
public void tearDown() {
session.logout();
}
}

0 comments on commit 068ab9a

Please sign in to comment.