You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Michael Harris <mi...@gmail.com> on 2008/07/16 21:33:11 UTC

webdav integration

hello

new to jackrabbit.  I can setup a a TransientRepository and add nodes to it
(basically by following first hops). what i wanted to do next was access
that repo via the webdav api.

the question is, how do i do this in a junit environment without a
webserver?  Is it even possible?  So setup the Transient Repo in the test
setup, then have some sort
of simple client that accesses that repo via webdav.

I couldn't find any tutorials/help articles on this sort of thing.

thanx
-- 
---------------------
Michael Harris

Re: webdav integration

Posted by Michael Harris <mi...@gmail.com>.
alexander -- i found a number of problems with the code i posted before.

for starters, i wasn't specifying a url.  when i specify a url
localhost:8080/ i get a 404 error

so here is the setup code

server = new Server(8080);
Context root = new Context(server, "/", Context.SESSIONS);
root.addServlet(new ServletHolder(new RepoServlet()), "");

where RepoServlet returns a singleton TransientRepository.

does that look correct?

On Thu, Jul 17, 2008 at 3:11 PM, Alexander Klimetschek <ak...@day.com>
wrote:

> I have not much insight about the Jackrabbit WebDAV client, but AFAIK
> it is not a complete client. See this long thread
> http://markmail.org/message/tsyrrrhkp3godxgh which lists some other
> open source java webdav clients.
>
> Regards,
> Alex
>
> On Thu, Jul 17, 2008 at 8:57 PM, Michael Harris
> <mi...@gmail.com> wrote:
> > Alex
> >
> > ok Ive got a jetty instance imbedded in my test harness. Ive extended the
> > simple webdav servlet, subclassed it to return my repo, and attached it
> to
> > jetty.  Now I am trying to write some webdav client code.  Unfortunately
> the
> > documentation is exceedingly horrible.
> >
> > The first method I need to write is to just get a list of what is in the
> > repo.  the SearchMethod seems like it is the tool.  HOwever, I have no
> idea,
> > and the javadocs don't help, on what the search info should be.
> >
> > I know I am asking a lot, but here is what i have
> >
> > what i added to my test repo
> >
> >                Node root = session.getRootNode();
> >                Node assets = root.addNode("assets");
> >
> >                    // Store content
> >                    Node asset = assets.addNode("asset");
> >                    asset.setProperty("url", "http://asset1url.org");
> >                    asset.setProperty("name", "Asset 1");
> >                    asset.setProperty("typetype", "image");
> >
> >                    Node asset2 = assets.addNode("asset");
> >                    asset2.setProperty("url", "http://asset2url.org");
> >                    asset2.setProperty("name", "Asset 2");
> >                    asset2.setProperty("type", "image");
> >
> > my client code looks like
> >
> >        HttpClient client = new HttpClient();
> >        SearchMethod method = new SearchMethod("/", "", "");
> >        client.executeMethod(method);
> >        byte[] resp = method.getResponseBody();
> >        System.out.println(resp);
> >
> > I am getting a domexception when i run the client.  Any insight?
> >
> > org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or
> > change an object in a way which is incorrect with regard to namespaces.
> >    at
> >
> com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.checkNamespaceWF(CoreDocumentImpl.java:2388)
> >    at
> >
> com.sun.org.apache.xerces.internal.dom.ElementNSImpl.setName(ElementNSImpl.java:143)
> >    at
> >
> com.sun.org.apache.xerces.internal.dom.ElementNSImpl.<init>(ElementNSImpl.java:112)
> >    at
> >
> com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createElementNS(CoreDocumentImpl.java:1969)
> >    at
> > org.apache.jackrabbit.webdav.xml.DomUtil.createElement(DomUtil.java:401)
> >    at
> > org.apache.jackrabbit.webdav.xml.DomUtil.createElement(DomUtil.java:422)
> >    at
> >
> org.apache.jackrabbit.webdav.xml.DomUtil.addChildElement(DomUtil.java:477)
> >    at
> > org.apache.jackrabbit.webdav.search.SearchInfo.toXml(SearchInfo.java:158)
> >    at
> >
> org.apache.jackrabbit.webdav.client.methods.DavMethodBase.setRequestBody(DavMethodBase.java:198)
> >    at
> >
> org.apache.jackrabbit.webdav.client.methods.SearchMethod.<init>(SearchMethod.java:44)
> >    at
> >
> org.apache.jackrabbit.webdav.client.methods.SearchMethod.<init>(SearchMethod.java:36)
> >
> >
> >
> > On Thu, Jul 17, 2008 at 7:07 AM, Alexander Klimetschek <aklimets@day.com
> >
> > wrote:
> >
> >> Hi,
> >>
> >> you can extend the SimpleWebdavServlet (inside jackrabbit-jcr-server
> >> and you also need the jackrabbit-webdav lib). The only thing you will
> >> have to do is to overwrite the getRepository() method and provide your
> >> own (Transient)Repository. Then you need to have a servlet container
> >> started from within your application or junit test (I think Jetty is
> >> the simplest for this task).
> >>
> >> Have a look at the javadocs:
> >>
> >>
> http://jackrabbit.apache.org/api/1.4/org/apache/jackrabbit/webdav/simple/SimpleWebdavServlet.html
> >>
> >> See also http://wiki.apache.org/jackrabbit/WebDAV for some infos and
> >> links to the javadocs.
> >>
> >> Otherwise you can install a servlet container and deploy the entire
> >> jackrabbit-webapp.war:
> >>
> >>
> http://www.apache.org/dyn/closer.cgi/jackrabbit/binaries/jackrabbit-webapp-1.4.war
> >>
> >> Regards,
> >> Alex
> >>
> >> On Wed, Jul 16, 2008 at 9:33 PM, Michael Harris
> >> <mi...@gmail.com> wrote:
> >> > hello
> >> >
> >> > new to jackrabbit.  I can setup a a TransientRepository and add nodes
> to
> >> it
> >> > (basically by following first hops). what i wanted to do next was
> access
> >> > that repo via the webdav api.
> >> >
> >> > the question is, how do i do this in a junit environment without a
> >> > webserver?  Is it even possible?  So setup the Transient Repo in the
> test
> >> > setup, then have some sort
> >> > of simple client that accesses that repo via webdav.
> >> >
> >> > I couldn't find any tutorials/help articles on this sort of thing.
> >> >
> >> > thanx
> >> > --
> >> > ---------------------
> >> > Michael Harris
> >> >
> >>
> >>
> >>
> >> --
> >> Alexander Klimetschek
> >> alexander.klimetschek@day.com
> >>
> >
> >
> >
> > --
> > ---------------------
> > Michael Harris
> >
>
>
>
> --
> Alexander Klimetschek
> alexander.klimetschek@day.com
>



-- 
---------------------
Michael Harris

Re: webdav integration

Posted by Alexander Klimetschek <ak...@day.com>.
I have not much insight about the Jackrabbit WebDAV client, but AFAIK
it is not a complete client. See this long thread
http://markmail.org/message/tsyrrrhkp3godxgh which lists some other
open source java webdav clients.

Regards,
Alex

On Thu, Jul 17, 2008 at 8:57 PM, Michael Harris
<mi...@gmail.com> wrote:
> Alex
>
> ok Ive got a jetty instance imbedded in my test harness. Ive extended the
> simple webdav servlet, subclassed it to return my repo, and attached it to
> jetty.  Now I am trying to write some webdav client code.  Unfortunately the
> documentation is exceedingly horrible.
>
> The first method I need to write is to just get a list of what is in the
> repo.  the SearchMethod seems like it is the tool.  HOwever, I have no idea,
> and the javadocs don't help, on what the search info should be.
>
> I know I am asking a lot, but here is what i have
>
> what i added to my test repo
>
>                Node root = session.getRootNode();
>                Node assets = root.addNode("assets");
>
>                    // Store content
>                    Node asset = assets.addNode("asset");
>                    asset.setProperty("url", "http://asset1url.org");
>                    asset.setProperty("name", "Asset 1");
>                    asset.setProperty("typetype", "image");
>
>                    Node asset2 = assets.addNode("asset");
>                    asset2.setProperty("url", "http://asset2url.org");
>                    asset2.setProperty("name", "Asset 2");
>                    asset2.setProperty("type", "image");
>
> my client code looks like
>
>        HttpClient client = new HttpClient();
>        SearchMethod method = new SearchMethod("/", "", "");
>        client.executeMethod(method);
>        byte[] resp = method.getResponseBody();
>        System.out.println(resp);
>
> I am getting a domexception when i run the client.  Any insight?
>
> org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or
> change an object in a way which is incorrect with regard to namespaces.
>    at
> com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.checkNamespaceWF(CoreDocumentImpl.java:2388)
>    at
> com.sun.org.apache.xerces.internal.dom.ElementNSImpl.setName(ElementNSImpl.java:143)
>    at
> com.sun.org.apache.xerces.internal.dom.ElementNSImpl.<init>(ElementNSImpl.java:112)
>    at
> com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createElementNS(CoreDocumentImpl.java:1969)
>    at
> org.apache.jackrabbit.webdav.xml.DomUtil.createElement(DomUtil.java:401)
>    at
> org.apache.jackrabbit.webdav.xml.DomUtil.createElement(DomUtil.java:422)
>    at
> org.apache.jackrabbit.webdav.xml.DomUtil.addChildElement(DomUtil.java:477)
>    at
> org.apache.jackrabbit.webdav.search.SearchInfo.toXml(SearchInfo.java:158)
>    at
> org.apache.jackrabbit.webdav.client.methods.DavMethodBase.setRequestBody(DavMethodBase.java:198)
>    at
> org.apache.jackrabbit.webdav.client.methods.SearchMethod.<init>(SearchMethod.java:44)
>    at
> org.apache.jackrabbit.webdav.client.methods.SearchMethod.<init>(SearchMethod.java:36)
>
>
>
> On Thu, Jul 17, 2008 at 7:07 AM, Alexander Klimetschek <ak...@day.com>
> wrote:
>
>> Hi,
>>
>> you can extend the SimpleWebdavServlet (inside jackrabbit-jcr-server
>> and you also need the jackrabbit-webdav lib). The only thing you will
>> have to do is to overwrite the getRepository() method and provide your
>> own (Transient)Repository. Then you need to have a servlet container
>> started from within your application or junit test (I think Jetty is
>> the simplest for this task).
>>
>> Have a look at the javadocs:
>>
>> http://jackrabbit.apache.org/api/1.4/org/apache/jackrabbit/webdav/simple/SimpleWebdavServlet.html
>>
>> See also http://wiki.apache.org/jackrabbit/WebDAV for some infos and
>> links to the javadocs.
>>
>> Otherwise you can install a servlet container and deploy the entire
>> jackrabbit-webapp.war:
>>
>> http://www.apache.org/dyn/closer.cgi/jackrabbit/binaries/jackrabbit-webapp-1.4.war
>>
>> Regards,
>> Alex
>>
>> On Wed, Jul 16, 2008 at 9:33 PM, Michael Harris
>> <mi...@gmail.com> wrote:
>> > hello
>> >
>> > new to jackrabbit.  I can setup a a TransientRepository and add nodes to
>> it
>> > (basically by following first hops). what i wanted to do next was access
>> > that repo via the webdav api.
>> >
>> > the question is, how do i do this in a junit environment without a
>> > webserver?  Is it even possible?  So setup the Transient Repo in the test
>> > setup, then have some sort
>> > of simple client that accesses that repo via webdav.
>> >
>> > I couldn't find any tutorials/help articles on this sort of thing.
>> >
>> > thanx
>> > --
>> > ---------------------
>> > Michael Harris
>> >
>>
>>
>>
>> --
>> Alexander Klimetschek
>> alexander.klimetschek@day.com
>>
>
>
>
> --
> ---------------------
> Michael Harris
>



-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Re: webdav integration

Posted by Michael Harris <mi...@gmail.com>.
Alex

ok Ive got a jetty instance imbedded in my test harness. Ive extended the
simple webdav servlet, subclassed it to return my repo, and attached it to
jetty.  Now I am trying to write some webdav client code.  Unfortunately the
documentation is exceedingly horrible.

The first method I need to write is to just get a list of what is in the
repo.  the SearchMethod seems like it is the tool.  HOwever, I have no idea,
and the javadocs don't help, on what the search info should be.

I know I am asking a lot, but here is what i have

what i added to my test repo

                Node root = session.getRootNode();
                Node assets = root.addNode("assets");

                    // Store content
                    Node asset = assets.addNode("asset");
                    asset.setProperty("url", "http://asset1url.org");
                    asset.setProperty("name", "Asset 1");
                    asset.setProperty("typetype", "image");

                    Node asset2 = assets.addNode("asset");
                    asset2.setProperty("url", "http://asset2url.org");
                    asset2.setProperty("name", "Asset 2");
                    asset2.setProperty("type", "image");

my client code looks like

        HttpClient client = new HttpClient();
        SearchMethod method = new SearchMethod("/", "", "");
        client.executeMethod(method);
        byte[] resp = method.getResponseBody();
        System.out.println(resp);

I am getting a domexception when i run the client.  Any insight?

org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or
change an object in a way which is incorrect with regard to namespaces.
    at
com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.checkNamespaceWF(CoreDocumentImpl.java:2388)
    at
com.sun.org.apache.xerces.internal.dom.ElementNSImpl.setName(ElementNSImpl.java:143)
    at
com.sun.org.apache.xerces.internal.dom.ElementNSImpl.<init>(ElementNSImpl.java:112)
    at
com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createElementNS(CoreDocumentImpl.java:1969)
    at
org.apache.jackrabbit.webdav.xml.DomUtil.createElement(DomUtil.java:401)
    at
org.apache.jackrabbit.webdav.xml.DomUtil.createElement(DomUtil.java:422)
    at
org.apache.jackrabbit.webdav.xml.DomUtil.addChildElement(DomUtil.java:477)
    at
org.apache.jackrabbit.webdav.search.SearchInfo.toXml(SearchInfo.java:158)
    at
org.apache.jackrabbit.webdav.client.methods.DavMethodBase.setRequestBody(DavMethodBase.java:198)
    at
org.apache.jackrabbit.webdav.client.methods.SearchMethod.<init>(SearchMethod.java:44)
    at
org.apache.jackrabbit.webdav.client.methods.SearchMethod.<init>(SearchMethod.java:36)



On Thu, Jul 17, 2008 at 7:07 AM, Alexander Klimetschek <ak...@day.com>
wrote:

> Hi,
>
> you can extend the SimpleWebdavServlet (inside jackrabbit-jcr-server
> and you also need the jackrabbit-webdav lib). The only thing you will
> have to do is to overwrite the getRepository() method and provide your
> own (Transient)Repository. Then you need to have a servlet container
> started from within your application or junit test (I think Jetty is
> the simplest for this task).
>
> Have a look at the javadocs:
>
> http://jackrabbit.apache.org/api/1.4/org/apache/jackrabbit/webdav/simple/SimpleWebdavServlet.html
>
> See also http://wiki.apache.org/jackrabbit/WebDAV for some infos and
> links to the javadocs.
>
> Otherwise you can install a servlet container and deploy the entire
> jackrabbit-webapp.war:
>
> http://www.apache.org/dyn/closer.cgi/jackrabbit/binaries/jackrabbit-webapp-1.4.war
>
> Regards,
> Alex
>
> On Wed, Jul 16, 2008 at 9:33 PM, Michael Harris
> <mi...@gmail.com> wrote:
> > hello
> >
> > new to jackrabbit.  I can setup a a TransientRepository and add nodes to
> it
> > (basically by following first hops). what i wanted to do next was access
> > that repo via the webdav api.
> >
> > the question is, how do i do this in a junit environment without a
> > webserver?  Is it even possible?  So setup the Transient Repo in the test
> > setup, then have some sort
> > of simple client that accesses that repo via webdav.
> >
> > I couldn't find any tutorials/help articles on this sort of thing.
> >
> > thanx
> > --
> > ---------------------
> > Michael Harris
> >
>
>
>
> --
> Alexander Klimetschek
> alexander.klimetschek@day.com
>



-- 
---------------------
Michael Harris

Re: webdav integration

Posted by Alexander Klimetschek <ak...@day.com>.
On Thu, Jul 17, 2008 at 5:06 PM, Michael Harris
<mi...@gmail.com> wrote:
> thanx for all your help.
>
> So there are two things here -- one is the webdav component of the app.  JR
> isn't going to be involved in this; we are using it just for prototyping,
> although we will use the JR-webdav client to access the sharepoint repo the
> organization uses.
>
> the second is the storage of our app content.  This content is xml.  the app
> is basically a web based xml editor.  we were thinking of using JR to store
> the xml file, as we have requiremens around versioning and locking.  So, if
> a repository is bundled with the app (deployment method one), do servlets
> even come into play?  We are using Struts as our web tier, and were going to
> wrap services around the repository functionality (get a file, lock a file,
> version a file, save a file, lock a file, etc).  In that approach, would the
> service layer be able to access the repo?  I assume we would have to build
> some functionality around managing the sessions that provide access ot the
> repo.

Yes, no problem, your services use the JCR API and map the service calls to it.

But I could imagine that using the WebDAV server already gives all you
need (since you mentioned your services work with files). In that case
you "only" need a WebDAV client - you don't need to do much on the
server side then.

You should also have a look at Sling, which is a thin web application
framework on top of JCR. It provides XML and JSON views of the nodes
and properties in a RESTful way. Files in the repository (nt:file) are
delivered as in a static webserver. And developing with Sling makes
much more fun than Struts ;-):

http://incubator.apache.org/sling/

http://incubator.apache.org/sling/site/links.html


> or am i totally off here?
>
> Every "deploy in app server" wiki entry assumes oracle.  they all have setup
> jndi with oracle parts.  Do we need a db?  Doesn't the repo run on disk (or
> i should say, can't jackrabbit just run on the filesystem?)

You can configure a so-called PersistenceManager for storing the data.
You can use the Derby bundle persistence manager (default
configuration in most repository.xmls) that uses an embedded Apache
Derby database. Have a look at

http://jackrabbit.apache.org/jackrabbit-configuration.html

and

http://wiki.apache.org/jackrabbit/PersistenceManagerFAQ

and

http://wiki.apache.org/jackrabbit/DataStore

(DataStore is a separate and faster storage for binary data, such as
files stored in the repository).

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Re: webdav integration

Posted by Michael Harris <mi...@gmail.com>.
Alex

thanx for all your help.

So there are two things here -- one is the webdav component of the app.  JR
isn't going to be involved in this; we are using it just for prototyping,
although we will use the JR-webdav client to access the sharepoint repo the
organization uses.

the second is the storage of our app content.  This content is xml.  the app
is basically a web based xml editor.  we were thinking of using JR to store
the xml file, as we have requiremens around versioning and locking.  So, if
a repository is bundled with the app (deployment method one), do servlets
even come into play?  We are using Struts as our web tier, and were going to
wrap services around the repository functionality (get a file, lock a file,
version a file, save a file, lock a file, etc).  In that approach, would the
service layer be able to access the repo?  I assume we would have to build
some functionality around managing the sessions that provide access ot the
repo.

or am i totally off here?

Every "deploy in app server" wiki entry assumes oracle.  they all have setup
jndi with oracle parts.  Do we need a db?  Doesn't the repo run on disk (or
i should say, can't jackrabbit just run on the filesystem?)

michael.

On Thu, Jul 17, 2008 at 10:26 AM, Alexander Klimetschek <ak...@day.com>
wrote:

> Depends on what you want. Have a look at the deployment models:
>
> http://jackrabbit.apache.org/deployment-models.html
>
> (2) is the model I described before. If the repo is available via
> JNDI, all applications can share the same repository.
>
> You can also have a repository for each application (1), but then you
> need to put the necessary jackrabbit servlets into all your webapps
> and make sure you use a different repository home (and different
> persistence manager stores, eg. different databases).
>
> Regards,
> Alex
>
> On Thu, Jul 17, 2008 at 3:30 PM, Michael Harris
> <mi...@gmail.com> wrote:
> > so does the JR-webapp.war get deployed along side my applications war?
> >
> > On Thu, Jul 17, 2008 at 9:15 AM, Alexander Klimetschek <aklimets@day.com
> >
> > wrote:
> >
> >> On Thu, Jul 17, 2008 at 1:55 PM, Michael Harris
> >> <mi...@gmail.com> wrote:
> >> > hey
> >> >
> >> > thanx for the reply.  does one need the jackrabbit-webapp.war to use
> >> webdav
> >> > interface?  if you need jetty, you are saying there is no way to
> access
> >> the
> >> > repo without the servlet engine.  I guess that makes sense.
> >> >
> >> > so if I deploy the jackrabbit jars and deps with my application war,
> and
> >> > have some sort of startup code that creates a TransientRepo (using a
> >> struts
> >> > plugin), can I then access that repo via webdav by going to
> >> > localhost/myapp/repo-dir?
> >>
> >> If you use the jackrabbit-webapp.war, it does everything for you: it
> >> includes a RepositoryStartupServlet that will start a repository,
> >> starts the webdav servlet for it and makes it available via jndi.
> >>
> >> Have a look at
> >>
> >> http://jackrabbit.apache.org/jackrabbit-web-application.html
> >>
> >> and at the web.xml, in which you see the various Servlets and config
> >> options:
> >>
> >>
> >>
> https://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/web.xml
> >>
> >> Regards,
> >> Alex
> >>
> >> --
> >> Alexander Klimetschek
> >> alexander.klimetschek@day.com
> >>
> >
> >
> >
> > --
> > ---------------------
> > Michael Harris
> >
>
>
>
> --
> Alexander Klimetschek
> alexander.klimetschek@day.com
>



-- 
---------------------
Michael Harris

Re: webdav integration

Posted by Alexander Klimetschek <ak...@day.com>.
Depends on what you want. Have a look at the deployment models:

http://jackrabbit.apache.org/deployment-models.html

(2) is the model I described before. If the repo is available via
JNDI, all applications can share the same repository.

You can also have a repository for each application (1), but then you
need to put the necessary jackrabbit servlets into all your webapps
and make sure you use a different repository home (and different
persistence manager stores, eg. different databases).

Regards,
Alex

On Thu, Jul 17, 2008 at 3:30 PM, Michael Harris
<mi...@gmail.com> wrote:
> so does the JR-webapp.war get deployed along side my applications war?
>
> On Thu, Jul 17, 2008 at 9:15 AM, Alexander Klimetschek <ak...@day.com>
> wrote:
>
>> On Thu, Jul 17, 2008 at 1:55 PM, Michael Harris
>> <mi...@gmail.com> wrote:
>> > hey
>> >
>> > thanx for the reply.  does one need the jackrabbit-webapp.war to use
>> webdav
>> > interface?  if you need jetty, you are saying there is no way to access
>> the
>> > repo without the servlet engine.  I guess that makes sense.
>> >
>> > so if I deploy the jackrabbit jars and deps with my application war, and
>> > have some sort of startup code that creates a TransientRepo (using a
>> struts
>> > plugin), can I then access that repo via webdav by going to
>> > localhost/myapp/repo-dir?
>>
>> If you use the jackrabbit-webapp.war, it does everything for you: it
>> includes a RepositoryStartupServlet that will start a repository,
>> starts the webdav servlet for it and makes it available via jndi.
>>
>> Have a look at
>>
>> http://jackrabbit.apache.org/jackrabbit-web-application.html
>>
>> and at the web.xml, in which you see the various Servlets and config
>> options:
>>
>>
>> https://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/web.xml
>>
>> Regards,
>> Alex
>>
>> --
>> Alexander Klimetschek
>> alexander.klimetschek@day.com
>>
>
>
>
> --
> ---------------------
> Michael Harris
>



-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Re: webdav integration

Posted by Michael Harris <mi...@gmail.com>.
so does the JR-webapp.war get deployed along side my applications war?

On Thu, Jul 17, 2008 at 9:15 AM, Alexander Klimetschek <ak...@day.com>
wrote:

> On Thu, Jul 17, 2008 at 1:55 PM, Michael Harris
> <mi...@gmail.com> wrote:
> > hey
> >
> > thanx for the reply.  does one need the jackrabbit-webapp.war to use
> webdav
> > interface?  if you need jetty, you are saying there is no way to access
> the
> > repo without the servlet engine.  I guess that makes sense.
> >
> > so if I deploy the jackrabbit jars and deps with my application war, and
> > have some sort of startup code that creates a TransientRepo (using a
> struts
> > plugin), can I then access that repo via webdav by going to
> > localhost/myapp/repo-dir?
>
> If you use the jackrabbit-webapp.war, it does everything for you: it
> includes a RepositoryStartupServlet that will start a repository,
> starts the webdav servlet for it and makes it available via jndi.
>
> Have a look at
>
> http://jackrabbit.apache.org/jackrabbit-web-application.html
>
> and at the web.xml, in which you see the various Servlets and config
> options:
>
>
> https://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/web.xml
>
> Regards,
> Alex
>
> --
> Alexander Klimetschek
> alexander.klimetschek@day.com
>



-- 
---------------------
Michael Harris

Re: webdav integration

Posted by Alexander Klimetschek <ak...@day.com>.
On Thu, Jul 17, 2008 at 1:55 PM, Michael Harris
<mi...@gmail.com> wrote:
> hey
>
> thanx for the reply.  does one need the jackrabbit-webapp.war to use webdav
> interface?  if you need jetty, you are saying there is no way to access the
> repo without the servlet engine.  I guess that makes sense.
>
> so if I deploy the jackrabbit jars and deps with my application war, and
> have some sort of startup code that creates a TransientRepo (using a struts
> plugin), can I then access that repo via webdav by going to
> localhost/myapp/repo-dir?

If you use the jackrabbit-webapp.war, it does everything for you: it
includes a RepositoryStartupServlet that will start a repository,
starts the webdav servlet for it and makes it available via jndi.

Have a look at

http://jackrabbit.apache.org/jackrabbit-web-application.html

and at the web.xml, in which you see the various Servlets and config options:

https://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/web.xml

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Re: webdav integration

Posted by Michael Harris <mi...@gmail.com>.
hey

thanx for the reply.  does one need the jackrabbit-webapp.war to use webdav
interface?  if you need jetty, you are saying there is no way to access the
repo without the servlet engine.  I guess that makes sense.

so if I deploy the jackrabbit jars and deps with my application war, and
have some sort of startup code that creates a TransientRepo (using a struts
plugin), can I then access that repo via webdav by going to
localhost/myapp/repo-dir?



On Thu, Jul 17, 2008 at 7:07 AM, Alexander Klimetschek <ak...@day.com>
wrote:

> Hi,
>
> you can extend the SimpleWebdavServlet (inside jackrabbit-jcr-server
> and you also need the jackrabbit-webdav lib). The only thing you will
> have to do is to overwrite the getRepository() method and provide your
> own (Transient)Repository. Then you need to have a servlet container
> started from within your application or junit test (I think Jetty is
> the simplest for this task).
>
> Have a look at the javadocs:
>
> http://jackrabbit.apache.org/api/1.4/org/apache/jackrabbit/webdav/simple/SimpleWebdavServlet.html
>
> See also http://wiki.apache.org/jackrabbit/WebDAV for some infos and
> links to the javadocs.
>
> Otherwise you can install a servlet container and deploy the entire
> jackrabbit-webapp.war:
>
> http://www.apache.org/dyn/closer.cgi/jackrabbit/binaries/jackrabbit-webapp-1.4.war
>
> Regards,
> Alex
>
> On Wed, Jul 16, 2008 at 9:33 PM, Michael Harris
> <mi...@gmail.com> wrote:
> > hello
> >
> > new to jackrabbit.  I can setup a a TransientRepository and add nodes to
> it
> > (basically by following first hops). what i wanted to do next was access
> > that repo via the webdav api.
> >
> > the question is, how do i do this in a junit environment without a
> > webserver?  Is it even possible?  So setup the Transient Repo in the test
> > setup, then have some sort
> > of simple client that accesses that repo via webdav.
> >
> > I couldn't find any tutorials/help articles on this sort of thing.
> >
> > thanx
> > --
> > ---------------------
> > Michael Harris
> >
>
>
>
> --
> Alexander Klimetschek
> alexander.klimetschek@day.com
>



-- 
---------------------
Michael Harris

Re: webdav integration

Posted by Alexander Klimetschek <ak...@day.com>.
Hi,

you can extend the SimpleWebdavServlet (inside jackrabbit-jcr-server
and you also need the jackrabbit-webdav lib). The only thing you will
have to do is to overwrite the getRepository() method and provide your
own (Transient)Repository. Then you need to have a servlet container
started from within your application or junit test (I think Jetty is
the simplest for this task).

Have a look at the javadocs:
http://jackrabbit.apache.org/api/1.4/org/apache/jackrabbit/webdav/simple/SimpleWebdavServlet.html

See also http://wiki.apache.org/jackrabbit/WebDAV for some infos and
links to the javadocs.

Otherwise you can install a servlet container and deploy the entire
jackrabbit-webapp.war:
http://www.apache.org/dyn/closer.cgi/jackrabbit/binaries/jackrabbit-webapp-1.4.war

Regards,
Alex

On Wed, Jul 16, 2008 at 9:33 PM, Michael Harris
<mi...@gmail.com> wrote:
> hello
>
> new to jackrabbit.  I can setup a a TransientRepository and add nodes to it
> (basically by following first hops). what i wanted to do next was access
> that repo via the webdav api.
>
> the question is, how do i do this in a junit environment without a
> webserver?  Is it even possible?  So setup the Transient Repo in the test
> setup, then have some sort
> of simple client that accesses that repo via webdav.
>
> I couldn't find any tutorials/help articles on this sort of thing.
>
> thanx
> --
> ---------------------
> Michael Harris
>



-- 
Alexander Klimetschek
alexander.klimetschek@day.com