jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r161082 - in incubator/jackrabbit/trunk/xdocs: arch/deploy.xml arch/deploy/howto-client.xml arch/deploy/howto-deploy.xml arch/deploy/howto-model1.xml arch/deploy/howto-model2.xml arch/deploy/howto-model3.xml navigation.xml
Date Tue, 12 Apr 2005 18:32:32 GMT
Author: jukka
Date: Tue Apr 12 11:32:31 2005
New Revision: 161082

URL: http://svn.apache.org/viewcvs?view=rev&rev=161082
Log:
JCR-102: Added documentation changes contributed by both Edgard Poce. Also did some reorganizing
and explaining of my own.

Added:
    incubator/jackrabbit/trunk/xdocs/arch/deploy/howto-client.xml
    incubator/jackrabbit/trunk/xdocs/arch/deploy/howto-model1.xml
    incubator/jackrabbit/trunk/xdocs/arch/deploy/howto-model2.xml
    incubator/jackrabbit/trunk/xdocs/arch/deploy/howto-model3.xml
Removed:
    incubator/jackrabbit/trunk/xdocs/arch/deploy/howto-deploy.xml
Modified:
    incubator/jackrabbit/trunk/xdocs/arch/deploy.xml
    incubator/jackrabbit/trunk/xdocs/navigation.xml

Modified: incubator/jackrabbit/trunk/xdocs/arch/deploy.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/xdocs/arch/deploy.xml?view=diff&r1=161081&r2=161082
==============================================================================
--- incubator/jackrabbit/trunk/xdocs/arch/deploy.xml (original)
+++ incubator/jackrabbit/trunk/xdocs/arch/deploy.xml Tue Apr 12 11:32:31 2005
@@ -29,7 +29,7 @@
 </p>
 <p>
 Jackrabbit is built to support a variety of different deployment models, 
-some of the possibilities on how to deploy Jackrabbit will be outlined here
+some of the possibilities on how to deploy Jackrabbit will be outlined here.
 </p>
 </section>
 
@@ -38,7 +38,7 @@
 For many applications, usually applications that run in a closed 
 context without interacting with other applications or data sources, 
 it might be desirable to bundle a content repository with the 
-application itself. 
+application itself.
 </p>
 <p>
 Jackrabbit is built for this lightweight model and allows obviously 

Added: incubator/jackrabbit/trunk/xdocs/arch/deploy/howto-client.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/xdocs/arch/deploy/howto-client.xml?view=auto&rev=161082
==============================================================================
--- incubator/jackrabbit/trunk/xdocs/arch/deploy/howto-client.xml (added)
+++ incubator/jackrabbit/trunk/xdocs/arch/deploy/howto-client.xml Tue Apr 12 11:32:31 2005
@@ -0,0 +1,97 @@
+<?xml version="1.0"?>
+<!--
+   Copyright 2004-2005 The Apache Software Foundation or its licensors,
+                       as applicable.
+
+   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.
+  -->
+<document>
+  <properties>
+    <title>JCR application HOWTO</title>
+  </properties>
+  <body>
+    <section name="JCR client application HOWTO">
+      <p>
+        This document describes the common configuration and initialization
+        code of a client application that uses a JCR content repository. The
+        application setup does not depend on the underlying deployment model,
+        implementation, or configuration of the content repository.
+      </p>
+      <p>
+        The instructions in this document apply to a J2EE web application
+        that uses JNDI to access the content repository. It should however
+        be easy to modify the instructions for other container environments.
+      </p>
+    </section>
+    <section name="J2EE web application instructions">
+      <p>
+        Follow the steps below to access a JNDI-bound content repository
+        within a J2EE web application. Example code is included after
+        this overview. See the deployment model howtos for instructions on
+        how to create the JNDI bindings for the standard deployment models.
+      </p>
+      <ol>
+        <li>
+          Place the JCR API jar in the <code>WEB-INF/lib</code> subdirectory
+          of your web application.
+        </li>
+        <li>
+          Declare the JNDI address under which you will request the
+          repository instance in the deployment descriptor.
+        </li>
+        <li>
+          Code your application to use the resource.
+        </li>
+      </ol>
+      <p>
+        Note that that none of your code or configuration needs to depend
+        on the underlying repository implementation or deployment model.
+        All those details are handled by the container and can easily be
+        changed without modifying your application. Just make sure that
+        you have documented the JCR repository level and optional features
+        your application requires so that your application can be deployed
+        in an appropriate environment.
+      </p>
+      <subsection name="Step 2 - Deployment descriptor">
+        <p>
+          Add the following snippet in your <code>web.xml</code>
+          deployment descriptor to declare your application's use of
+          a content repository resource.
+        </p>
+        <source><![CDATA[
+<resource-env-ref>
+  <description>Content Repository</description>
+  <resource-env-ref-name>jcr/repository</resource-env-ref-name>
+  <resource-env-ref-type>javax.jcr.Repository</resource-env-ref-type>
+</resource-env-ref>
+]]></source>
+        <p>
+          Note that the <code>java:comp/env/jcr</code> subcontext
+          is the preferred naming contxt for JCR content repository
+          resources.
+        </p>
+      </subsection>
+      <subsection name="Step 3 - Java code">
+        <p>
+          Use the following Java code snippet to get a reference to the
+          configured content repository instance.
+        </p>
+        <source><![CDATA[
+InitialContext context = new InitialContext();
+Context environment = (Context) context.lookup("java:comp/env");
+Repository repository = (Repository) environment.lookup("jcr/repository");
+]]></source>
+      </subsection>
+    </section>
+  </body>
+</document>

Added: incubator/jackrabbit/trunk/xdocs/arch/deploy/howto-model1.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/xdocs/arch/deploy/howto-model1.xml?view=auto&rev=161082
==============================================================================
--- incubator/jackrabbit/trunk/xdocs/arch/deploy/howto-model1.xml (added)
+++ incubator/jackrabbit/trunk/xdocs/arch/deploy/howto-model1.xml Tue Apr 12 11:32:31 2005
@@ -0,0 +1,121 @@
+<?xml version="1.0"?>
+<!--
+   Copyright 2004-2005 The Apache Software Foundation or its licensors,
+                       as applicable.
+
+   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.
+  -->
+<document>
+  <properties>
+    <title>Model 1: The (Web-) Application Bundle HOWTO</title>
+  </properties>
+  <body>
+    <section name="Model 1: The (Web-) Application Bundle HOWTO">
+      <p>
+        This document describes how to setup a Jackrabbit content repository
+        in the deployment model 1; The (Web-) Application Bunde. In this
+        deployment model, each application bundle uses its own local content
+        repository that is not visible to other applications. See the
+        <a href="howto-client.html">JCR client application HOWTO</a> for
+        instructions on how to use the configured content repository.
+      </p>
+      <p>
+        Note that it is also possible to bypass the JNDI mechanism by
+        including all the Jackrabbit startup and configuration code directly
+        in your application. This approach however makes a strong binding
+        between your application and the underlying repository implementation.
+      </p>
+      <p>
+        The instructions in this document apply to
+        <a href="http://jakarta.apache.org/tomcat/">Tomcat</a>
+        versions 4.x and 5.x. It should be easy to modify the
+        instructions for other container environments. 
+      </p>
+      <p>
+        <strong>Important:</strong> remember that two Jackrabbit instances
+        should never read from/write to the same physical storage.
+        This setup is not supported and will lead to corrupt data.
+      </p>
+    </section>
+    <section name="Tomcat instructions">
+      <p>
+        Follow the steps below to setup a model 1 Jackrabbit deployment
+        for your web application in Tomcat 4.x or 5.x. Example code for
+        both versions of Tomcat is included after this overview.
+      </p>
+      <ol>
+        <li>
+          Place the Jackrabbit jar file and all the dependencies (including
+          the JCR API jar file) under
+          <code>[Tomcat folder]/webapps/[your app]/WEB-INF/lib</code>.
+        </li>
+        <li>
+          Register a bindable repository factory in the context
+          scope. Configure the Java class name of the factory
+          implementation, as well as the repository configuration
+          file path and the repository home directory path. Use the
+          full path in both cases.
+        </li>
+      </ol>
+      <p>
+        <strong>Limitations:</strong> the application should not be
+        redeployed during the same JVM process to avoid creating duplicate
+        Jackrabbit instances with the same configuration. In case you want
+        to redeploy your application be sure to shutdown the repository
+        when your application is undeployed. It can be done by calling 
+        RepositoryImpl.shutdown() (e.g. in the destroy() method of a 
+        servlet).
+      </p>
+      <subsection name="Step 2 - Context configuration">
+        <p>
+          In Tomcat 4.x and 5.0, add the following snippet in
+          <code>server.xml</code> under the <code>Context</code>
element
+          of your web application.
+        </p>
+        <source><![CDATA[
+<Resource name="jcr/repository"
+          auth="Container"
+          type="javax.jcr.Repository"/>
+
+<ResourceParams name="jcr/repository">
+  <parameter>
+    <name>factory</name>
+    <value>org.apache.jackrabbit.core.jndi.BindableRepositoryFactory</value>
+  </parameter>
+  <parameter>
+    <name>configFilePath</name>
+    <value>[full path to repository.xml]</value>
+  </parameter>
+  <parameter>
+    <name>repHomeDir</name>
+    <value>[full path to the repository home folder]</value>
+  </parameter>
+</ResourceParams>
+]]></source>
+        <p>
+          In Tomcat 5.5, add the following snippet in your application's
+          <code>context.xml</code> file (or in the <code>server.xml</code>
+          file if you prefer central configuration).
+        </p>
+        <source><![CDATA[
+<Resource name="jcr/repository"
+          auth="Container"
+          type="javax.jcr.Repository"
+          factory="org.apache.jackrabbit.core.jndi.BindableRepositoryFactory"
+          configFilePath="[full path to repository.xml"
+          repHomeDir="[full path to the repository home folder]"/>
+]]></source>
+      </subsection>
+    </section>
+  </body>
+</document>

Added: incubator/jackrabbit/trunk/xdocs/arch/deploy/howto-model2.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/xdocs/arch/deploy/howto-model2.xml?view=auto&rev=161082
==============================================================================
--- incubator/jackrabbit/trunk/xdocs/arch/deploy/howto-model2.xml (added)
+++ incubator/jackrabbit/trunk/xdocs/arch/deploy/howto-model2.xml Tue Apr 12 11:32:31 2005
@@ -0,0 +1,120 @@
+<?xml version="1.0"?>
+<!--
+   Copyright 2004-2005 The Apache Software Foundation or its licensors,
+                       as applicable.
+
+   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.
+  -->
+<document>
+  <properties>
+    <title>Model 2: Shared J2EE Resource HOWTO</title>
+  </properties>
+  <body>
+    <section name="Model 2: Shared J2EE Resource HOWTO">
+      <p>
+        This document describes how to use a Jackrabbit content repository
+        in the deployment model 2: Shared J2EE Resource. In this deployment
+        model, a central content repository resource managed by an application
+        server is used by multiple different applications. See the
+        <a href="howto-client.html">JCR client application HOWTO</a> for
+        instructions on how to use the configured content repository.
+      </p>
+      <p>
+        This how-to contains instructions for
+        <a href="http://jakarta.apache.org/tomcat/">Tomcat</a>
+        versions 4.x and 5.x. It should be easy to modify the
+        instructions for other container environments.
+      </p>
+    </section>
+    <section name="Tomcat instructions">
+      <p>
+        Follow the steps below to setup a model 2 Jackrabbit deployment
+        for your Tomcat 4.x or 5.x installation. Example code for
+        both versions of Tomcat is included after this overview.
+      </p>
+      <ol>
+        <li>
+          Place the Jackrabbit jar file and all the dependencies (including
+          the JCR API jar file) under <code>[Tomcat folder]/common/lib</code>.
+        </li>
+        <li>
+          Register the bindable repository factory as a global resource.
+        </li>
+        <li>
+          Link the global resource to a context scoped JNDI address.
+        </li>
+      </ol>
+      <subsection name="Step 2 - Resource configuration">
+        <p>
+          <strong>Note:</strong> This step is essentially the same as
+          step 2 in the <a href="howto-model1.html">Model 1 HOWTO</a>.
+          The only differences are in the (arbitrary) naming of the resource
+          and placing of the configuration elements. The difference in
+          the end result is that the configured repository is bound to
+          the global JNDI context instead of a local one.
+        </p>
+        <p>
+          In Tomcat 4.x and 5.0, add the following snippet in
+          <code>server.xml</code> under the <code>GlobalNamingResources</code>
+          element.
+        </p>
+        <source><![CDATA[
+<Resource name="jcr/globalRepository"
+          auth="Container"
+          type="javax.jcr.Repository"/>
+
+<ResourceParams name="jcr/globalRepository">
+  <parameter>
+    <name>factory</name>
+    <value>org.apache.jackrabbit.core.jndi.BindableRepositoryFactory</value>
+  </parameter>
+  <parameter>
+    <name>configFilePath</name>
+    <value>[full path to repository.xml]</value>
+  </parameter>
+  <parameter>
+    <name>repHomeDir</name>
+    <value>[full path to the repository home folder]</value>
+  </parameter>
+</ResourceParams>
+]]></source>
+        <p>
+          In Tomcat 5.5, add the following snippet in <code>server.xml</code>
+          under the <code>GlobalNamingResources</code> element.
+        </p>
+        <source><![CDATA[
+<Resource name="jcr/globalRepository"
+          auth="Container"
+          type="javax.jcr.Repository"
+          factory="org.apache.jackrabbit.core.jndi.BindableRepositoryFactory"
+          configFilePath="[full path to repository.xml"
+          repHomeDir="[full path to the repository home folder]"/>
+]]></source>
+      </subsection>
+      <subsection name="Step 3 - Resource link">
+        <p>
+          In Tomcat versions 4.x and 5.0, add the following snippet
+          in <code>server.xml</code> under the <code>Context</code>
element
+          of your web application. In Tomcat version 5.5, add the snippet
+          in your application's <code>context.xml</code> file (or in the
+          <code>server.xml</code> file if you prefer central configuration).
+        </p>
+        <source><![CDATA[
+<ResourceLink name="jcr/repository"
+              global="jcr/globalRepository"
+              type="javax.jcr.Repository"/>
+]]></source>
+      </subsection>
+    </section>
+  </body>
+</document>

Added: incubator/jackrabbit/trunk/xdocs/arch/deploy/howto-model3.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/xdocs/arch/deploy/howto-model3.xml?view=auto&rev=161082
==============================================================================
--- incubator/jackrabbit/trunk/xdocs/arch/deploy/howto-model3.xml (added)
+++ incubator/jackrabbit/trunk/xdocs/arch/deploy/howto-model3.xml Tue Apr 12 11:32:31 2005
@@ -0,0 +1,123 @@
+<?xml version="1.0"?>
+<!--
+   Copyright 2004-2005 The Apache Software Foundation or its licensors,
+                       as applicable.
+
+   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.
+  -->
+<document>
+  <properties>
+    <title>Model 3: The Repository Server HOWTO</title>
+  </properties>
+  <body>
+    <section name="Model 3: The Repository Server HOWTO">
+      <p>
+        This document describes how to use a Jackrabbit content repository
+        in the deployment model 3: The Repository Server. In this deployment
+        model, a separate repository server is running outside the virtual
+        machine the client application is running in. A repository server
+        can serve multiple applications running on separate JVMs on separate
+        network hosts. See the <a href="howto-client.html">JCR client
+        application HOWTO</a> for instructions on how to use the configured
+        content repository server.
+      </p>
+      <p>
+        Note that JCR specification defines no standard communication
+        protocol for inter-JVM repository access, and that Jackrabbit
+        supports no such protocol by default. However, the Jackrabbit
+        <code>contrib</code> subdirectory contains tools for using JCR
+        content repositories over the RMI and Webdav protocols (see the
+        <code>jcr-rmi</code> and <code>jcr-server</code> contrib
packages).
+      </p>
+      <p>
+        This how-to contains instructions for accessing a JCR-RMI server
+        in <a href="http://jakarta.apache.org/tomcat/">Tomcat</a>
+        versions 4.x and 5.x. It should be easy to modify the instructions
+        for other container environments and communication protocols.
+      </p>
+      <p>
+        In addition to the following the instructions in this document,
+        you also need to have an already running JCR-RMI server. See the
+        JCR-RMI javadocs for instructions on how to setup such a server.
+      </p>
+      <p>
+        <strong>Warning:</strong> The current JCR-RMI library is designed
+        for simplicity, not performance. You will probably experience major
+        performance issues if you try running any non-trivial applications
+        on top of JCR-RMI.
+      </p>
+    </section>
+    <section name="Tomcat instructions">
+      <p>
+        Follow the steps below to setup a model 3 JCR-RMI client deployment
+        for your web application in Tomcat 4.x or 5.x. Example code for
+        both versions of Tomcat is included after this overview.
+      </p>
+      <p>
+        Note that these instructions closely follow the
+        <a href="howto-model1.html">Model 1 HOWTO</a> instructions. By making
+        similar changes (change the factory class and parameters of the
+        repository) to the <a href="howto-model2.html">Model 2 HOWTO</a>
+        instructions, you can setup a shared JCR-RMI client deployment for
+        all applications in the container.
+      </p>
+      <ol>
+        <li>
+          Place the JCR-RMI jar file and its dependencies (including the
+          JCR API jar) under
+          <code>[Tomcat folder]/webapps/[your app]/WEB-INF/lib</code>.
+          You can find the jcr-rmi implementation under the contrib 
+          folder of the Jackrabbit source distribution. 
+        </li>
+        <li>
+          Register the JCR-RMI client repository factory in the context scope.
+        </li>
+      </ol>
+      <subsection name="Step 2 - Context configuration">
+        <p>
+          In Tomcat 4.x and 5.0, add the following snippet in
+          <code>server.xml</code> under the <code>Context</code>
element
+          of your web application.
+        </p>
+        <source><![CDATA[
+<Resource name="jcr/repository"
+          auth="Container"
+          type="javax.jcr.Repository"/>
+
+<ResourceParams name="jcr/repository">
+  <parameter>
+    <name>factory</name>
+    <value>org.apache.jackrabbit.rmi.client.ClientRepositoryFactory</value>
+  </parameter>
+  <parameter>
+    <name>url</name>
+    <value>[The RMI URL of the repository]</value>
+  </parameter>
+</ResourceParams>
+]]></source>
+        <p>
+          In Tomcat 5.5, add the following snippet in your application's
+          <code>context.xml</code> file (or in the <code>server.xml</code>
+          file if you prefer central configuration).
+        </p>
+        <source><![CDATA[
+<Resource name="jcr/repository"
+          auth="Container"
+          type="javax.jcr.Repository"
+          factory="org.apache.jackrabbit.rmi.client.ClientRepositoryFactory"
+          url="[The RMI URL of the repository]"/>
+]]></source>
+      </subsection>
+    </section>
+  </body>
+</document>

Modified: incubator/jackrabbit/trunk/xdocs/navigation.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/xdocs/navigation.xml?view=diff&r1=161081&r2=161082
==============================================================================
--- incubator/jackrabbit/trunk/xdocs/navigation.xml (original)
+++ incubator/jackrabbit/trunk/xdocs/navigation.xml Tue Apr 12 11:32:31 2005
@@ -25,7 +25,10 @@
         <item name="JSR-170 Levels"         href="/arch/overview/jcrlevels.html"/>
       </item>
       <item name="Deployment&#xA0;Models"   href="/arch/deploy.html" collapse="true">
-        <item name="Deployment&#xA0;HOWTO"  href="/arch/deploy/howto-deploy.html"/>
+        <item name="Application HOWTO"      href="/arch/deploy/howto-client.html"/>
+        <item name="Model 1 HOWTO"          href="/arch/deploy/howto-model1.html"/>
+        <item name="Model 2 HOWTO"          href="/arch/deploy/howto-model2.html"/>
+        <item name="Model 3 HOWTO"          href="/arch/deploy/howto-model3.html"/>
       </item>
       <item name="Core&#xA0;Operations"     href="/arch/operate/index.html"  collapse="true">
         <item name="Start-up,&#xA0;Initialize" href="/arch/operate/startup.html"/>



Mime
View raw message