<?xml version="1.0" encoding="ISO-8859-1"?>

<document>

  <properties>
        <author email="ozeigermann@apache.org">Oliver Zeigermann</author>
        <title>WebDAV JCA Connector</title>
    </properties>
  
  <body>

  <section name="Using Slide's WebDAV JCA Connector">
  	<p><em>Caution:</em> This applies to Slide 2.x, x>0 only as the JCA connector is not part of the Slide 2.0 release</p>

    <subsection name="What is Slide's WebDAV JCA Connector good for">
<p>Generally a connector complying to Sun's JCA specification is good
for plugging enterprise information systems (EIS) into J2EE
servers. Plugging means adding connections to them to the container's
connection pooling facilities and include the EIS into the container's
transaction management.</p>
<p> In the case of the WebDAV connector Slide is
such an EIS. All this allows to upload/download/modify resources to Slide in the same
transaction as e.g. EJB or JDBC stuff involving other datasources.
</p>
</subsection>

	<subsection name="How to I set it up and deploy it">
<ol>
<li>Get the latest version of the webdavclient from the CVS or get it from releases starting with 2.1beta1.</li>
<li>For every J2EE container extra deployment descriptors for connectors are need. Currently, this only provided for JBoss. Thus you will have to make sure you have at least JBoss 3.2.3 installed.</li>
<li>Copy build.properties.sample to build.properties in the
webdavclient dir and modify it to let property jboss.deploy.dir point
to the deployment dir of JBoss. E.g. mine is set to
"E:/Programme/jboss-3.2.3/server/default/deploy".</li>
<li>Create the connector and demo application and deploy it to JBoss
using <code>ant clean deploy-jca-exmaple-jboss</code></li>
<li>To try the example assure a Slide server runs on your local
machine listening to port 8888. If you want it to run somewhere else
you will need to change TestServlet.java in
<code>webdavclient/connector/example/src/java/connector</code> and
rebuild the connector</li>
<li>Now invoke the example servlet <code>http://localhost:8080/connector-example</code> (replace host and port with the server JBoss is running on)</li>
<li>If everything works ok you will see an output like this:<br/>
<pre>

Tx: org.jboss.tm.usertx.client.ServerVMClientUserTransaction@92af24
Factory: org.apache.webdav.connector.WebDAVConnectionFactory@dcdffc
Connection1: org.apache.webdav.connector.WebDAVConnection@1bdbf9d
WR1: http://localhost:8888/slide/files
WR2: http://localhost:8888/slide/files
WR1 sees Content
WR2 sees this before commit
HTTP Status 404 - Not Found: No object found at /files/file1

type Status report

message Not Found: No object found at /files/file1

description The requested resource (Not Found: No object found at /files/file1) 
is not available.
Apache Tomcat/5.0.16

WR2 sees this after commit Content
</pre>
otherwise you will get nasty exceptions that you might want to post to
the Slide user list.
</li>
<li>Have a look at the TestServlet in
<code>webdavclient/connector/example/src/java/connector</code>. There
you can see that JNDI lookups for a user transaction and for the
webdav connection factory are done. Now a transaction is started and a
webdav connection is created from the factory. Upon creation it will
be enlistet in the transaction already started. The rest should be
pretty obvious. </li> 
</ol>
</subsection>
  </section>

</body>
</document>
