You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by "Robert r. Sanders" <ro...@ipov.net> on 2004/12/30 00:54:14 UTC

WebdavResource getChildResources() : Directory Listing

I don't know how much support the WebDAV client lib has for being a 
generic WebDAV tool; but I am trying to use it as such.

Currently I am trying to connect to a Subversion server over WebDAV and 
list all resources in a collection/directory; the code is:

        WebdavResource resource = new WebdavResource("http://myserver/svn/", true);

        WebdavResources children = resource.getChildResources();


but when I iterate over the WebdavResources all I see is the collection 
itself, and any files it contains.  I know there are several 
sub-collections/directories, but they are not being reported.  I ended 
up installing Ethereal to see what was going on, so I can send the HTTP 
trace if that helps; but I thought I'd start without it in case I am 
missing something more basic.

Thanks,

-- 
    Robert r. Sanders
    Chief Technologist
    iPOV
    www.ipov.net


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: Slide/WCK does not run if included into a project/classpath

Posted by James Mason <ma...@apache.org>.
Tomcat has its own classloader that will load any .class file under
<your_webapp>/WEB-INF/classes and any .jar file under
<your_webapp>/WEB-INF/lib in to the classpath of <your_webapp>. To
include your classes in the sample application, either put your .class
files into slide/WEB-INF/classes or build a jar and put it in
slide/WEB-INF/lib.

-James

On Thu, 2004-12-30 at 04:18 +0100, chilydev@gmx.net wrote:
> Hello,
> 
> I'm trying to implement WCK to use the Slide server functionality.
> 
> I've included the Slide CVS project in my Eclipse workspace as described in
> http://jakarta.apache.org/slide/getting-started.html
> and finally got it to build.
> 
> Then I've managed to do the building and deploying from CVS HEAD as described in
> http://wiki.apache.org/jakarta-slide/WckQuickStart
> (Section 1.1.)
> For this, i've set up a clean new Tomcat 5.0.28 installation.
> 
> When I'm running Tomcat, the WCK reference application (org.apache.slide.simple.reference) actually works and I can access WebDAV at
> http://localhost:8080/slide/ through the Windows Explorer.
> 
> The next step would be to implement the interface "org.apache.slide.simple.store.BasicWebdavStore" in my own project. Which requires
> to include jakarta-slide-wck-1.0.jar (and therefore slide-kernel-2.2pre1.jar as well) into the Tomcat classpath. But the strange
> thing about it is, that Slide obviously does not work as soon as you include one of it's libraries into the classpath.
> I always thought you have to include libs into the classpath, if u want to use them. Here it seems to be exactly the opposite.
> 
> If no Slide lib is in the classpath (and Slide works well), Tomcat gives a long output to stdout on startup with lots of info lines
> from Slide. If there are Slide libs in the classpath (and Slide doesn't work), there is no output from Slide, not even an Exception.
> It simply doesn't start.
> 
> I actually don't really understand, why WCK reference application worked in the first place, since none of the Slide libs was in the
> classpath. How do those libs get loaded? The only changes the ant deploy section of the WCK- build.xml does to the Tomcat
> installation is the additional start parameter "-Djava.security.auth.login.config=%CATALINA_HOME%/conf/jaas.config" and the Slide
> context in the server.xml.
> So why does it work without the classpath?
> And why doesn't it work as soon as you put the Slide libs into the classpath?
> How can I implement the BasicWebdavStore interface into any project, if I can't include the according lib into the classpath?
> 
> I'm using Windows 2000, Tomcat 5.0.28, Slide 2.2pre1, Eclipse 2.1.3.
> 
> Without the libs in the classpath, the WCK reference application is running with Tomcat started from the command line (startup.bat)
> as well as from Eclipse (with Sysdeo Tomcat Plugin).
> 
> I've tried using the Slide libs in
> %CATALINA_HOME%\webapps\slide\WEB-INF\lib
> and in
> %CATALINA_HOME%\common\lib
> 
> I've tried to include just
> slide-kernel-2.2pre1.jar
> 
> or
> slide-kernel-2.2pre1.jar and
> slide-roles-2.2pre1.jar and
> slide-stores-2.2pre1.jar and
> slide-webdavservlet-2.2pre1.jar
> as mentioned in
> http://jakarta.apache.org/slide/getting-started.html
> 
> or all libs together which are produced by ant deploy of the WCK- build.xml
> 
> Nothing works.
> Got no ideas left... :-(
> 
> 
> Big thanks for help,
> Chily
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Slide/WCK does not run if included into a project/classpath

Posted by ch...@gmx.net.
Hello,

I'm trying to implement WCK to use the Slide server functionality.

I've included the Slide CVS project in my Eclipse workspace as described in
http://jakarta.apache.org/slide/getting-started.html
and finally got it to build.

Then I've managed to do the building and deploying from CVS HEAD as described in
http://wiki.apache.org/jakarta-slide/WckQuickStart
(Section 1.1.)
For this, i've set up a clean new Tomcat 5.0.28 installation.

When I'm running Tomcat, the WCK reference application (org.apache.slide.simple.reference) actually works and I can access WebDAV at
http://localhost:8080/slide/ through the Windows Explorer.

The next step would be to implement the interface "org.apache.slide.simple.store.BasicWebdavStore" in my own project. Which requires
to include jakarta-slide-wck-1.0.jar (and therefore slide-kernel-2.2pre1.jar as well) into the Tomcat classpath. But the strange
thing about it is, that Slide obviously does not work as soon as you include one of it's libraries into the classpath.
I always thought you have to include libs into the classpath, if u want to use them. Here it seems to be exactly the opposite.

If no Slide lib is in the classpath (and Slide works well), Tomcat gives a long output to stdout on startup with lots of info lines
from Slide. If there are Slide libs in the classpath (and Slide doesn't work), there is no output from Slide, not even an Exception.
It simply doesn't start.

I actually don't really understand, why WCK reference application worked in the first place, since none of the Slide libs was in the
classpath. How do those libs get loaded? The only changes the ant deploy section of the WCK- build.xml does to the Tomcat
installation is the additional start parameter "-Djava.security.auth.login.config=%CATALINA_HOME%/conf/jaas.config" and the Slide
context in the server.xml.
So why does it work without the classpath?
And why doesn't it work as soon as you put the Slide libs into the classpath?
How can I implement the BasicWebdavStore interface into any project, if I can't include the according lib into the classpath?

I'm using Windows 2000, Tomcat 5.0.28, Slide 2.2pre1, Eclipse 2.1.3.

Without the libs in the classpath, the WCK reference application is running with Tomcat started from the command line (startup.bat)
as well as from Eclipse (with Sysdeo Tomcat Plugin).

I've tried using the Slide libs in
%CATALINA_HOME%\webapps\slide\WEB-INF\lib
and in
%CATALINA_HOME%\common\lib

I've tried to include just
slide-kernel-2.2pre1.jar

or
slide-kernel-2.2pre1.jar and
slide-roles-2.2pre1.jar and
slide-stores-2.2pre1.jar and
slide-webdavservlet-2.2pre1.jar
as mentioned in
http://jakarta.apache.org/slide/getting-started.html

or all libs together which are produced by ant deploy of the WCK- build.xml

Nothing works.
Got no ideas left... :-(


Big thanks for help,
Chily


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: WebdavResource getChildResources() : Directory Listing

Posted by Carlos Villegas <ca...@uniscope.jp>.
Subversion doesn't implement all of WebDAV, just what the svn client 
needs and most of svn functionality is done through a custom (but within 
the spec) report method. More complete generic WebDAV support is planned 
for future versions. Maybe the slide client is expecting some response 
not yet supported by subversion.

Carlos

James Mason wrote:
> Can you post traces for the request and response?
> 
> It might also be useful to compare the request/response when using the
> svn client.
> 
> -James
> 
> On Wed, 2004-12-29 at 17:54 -0600, Robert r. Sanders wrote:
> 
>>I don't know how much support the WebDAV client lib has for being a 
>>generic WebDAV tool; but I am trying to use it as such.
>>
>>Currently I am trying to connect to a Subversion server over WebDAV and 
>>list all resources in a collection/directory; the code is:
>>
>>        WebdavResource resource = new WebdavResource("http://myserver/svn/", true);
>>
>>        WebdavResources children = resource.getChildResources();
>>
>>
>>but when I iterate over the WebdavResources all I see is the collection 
>>itself, and any files it contains.  I know there are several 
>>sub-collections/directories, but they are not being reported.  I ended 
>>up installing Ethereal to see what was going on, so I can send the HTTP 
>>trace if that helps; but I thought I'd start without it in case I am 
>>missing something more basic.
>>
>>Thanks,
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: WebdavResource getChildResources() : Directory Listing

Posted by James Mason <ma...@apache.org>.
Sounds good. Let us know when/if you come up with anything.

-James

On Thu, 2004-12-30 at 08:30 -0600, Robert r. Sanders wrote:
> Yeah, that's what I kind of thought.  I am able to use the Slide client 
> library to do simple prop-gets, which although not optimal, is enough to 
> get me by for now.  If I have time I will try and trace down what the 
> exact problem is.
> 
> James Mason wrote:
> 
> >Well, based on the traces this certainly looks like a bug in the Slide
> >client library. Maybe it's getting confused by the duplicate namespaces,
> >or as you suggested, maybe it's dependent on a property Subversion isn't
> >returning.
> >
> >-James
> >
> >  
> >


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: WebdavResource getChildResources() : Directory Listing

Posted by "Robert r. Sanders" <ro...@ipov.net>.
Yeah, that's what I kind of thought.  I am able to use the Slide client 
library to do simple prop-gets, which although not optimal, is enough to 
get me by for now.  If I have time I will try and trace down what the 
exact problem is.

James Mason wrote:

>Well, based on the traces this certainly looks like a bug in the Slide
>client library. Maybe it's getting confused by the duplicate namespaces,
>or as you suggested, maybe it's dependent on a property Subversion isn't
>returning.
>
>-James
>
>  
>
-- 
    Robert r. Sanders
    Chief Technologist
    iPOV
    www.ipov.net


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: WebdavResource getChildResources() : Directory Listing

Posted by James Mason <ma...@apache.org>.
Well, based on the traces this certainly looks like a bug in the Slide
client library. Maybe it's getting confused by the duplicate namespaces,
or as you suggested, maybe it's dependent on a property Subversion isn't
returning.

-James

On Wed, 2004-12-29 at 21:24 -0600, Robert r. Sanders wrote:
> Of course.  Attached are the trace of the query from my previous 
> question; as well as a similar connection request/response using the 
> NetDrive client (I also have one from TortoiseSVN, but it seems to be 
> totally concerned with Subversion's custom properties).  Note that 
> NetDrive connects and displays the resources as expected.  Maybe the 
> properties for which Subversion is returning 404 on is throwing the 
> Slide library off?
> 
> James Mason wrote:
> 
> >Can you post traces for the request and response?
> >
> >It might also be useful to compare the request/response when using the
> >svn client.
> >
> >-James
> >
> >  
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: WebdavResource getChildResources() : Directory Listing

Posted by "Robert r. Sanders" <ro...@ipov.net>.
Of course.  Attached are the trace of the query from my previous 
question; as well as a similar connection request/response using the 
NetDrive client (I also have one from TortoiseSVN, but it seems to be 
totally concerned with Subversion's custom properties).  Note that 
NetDrive connects and displays the resources as expected.  Maybe the 
properties for which Subversion is returning 404 on is throwing the 
Slide library off?

James Mason wrote:

>Can you post traces for the request and response?
>
>It might also be useful to compare the request/response when using the
>svn client.
>
>-James
>
>  
>

-- 
    Robert r. Sanders
    Chief Technologist
    iPOV
    www.ipov.net


Re: WebdavResource getChildResources() : Directory Listing

Posted by James Mason <ma...@apache.org>.
Can you post traces for the request and response?

It might also be useful to compare the request/response when using the
svn client.

-James

On Wed, 2004-12-29 at 17:54 -0600, Robert r. Sanders wrote:
> I don't know how much support the WebDAV client lib has for being a 
> generic WebDAV tool; but I am trying to use it as such.
> 
> Currently I am trying to connect to a Subversion server over WebDAV and 
> list all resources in a collection/directory; the code is:
> 
>         WebdavResource resource = new WebdavResource("http://myserver/svn/", true);
> 
>         WebdavResources children = resource.getChildResources();
> 
> 
> but when I iterate over the WebdavResources all I see is the collection 
> itself, and any files it contains.  I know there are several 
> sub-collections/directories, but they are not being reported.  I ended 
> up installing Ethereal to see what was going on, so I can send the HTTP 
> trace if that helps; but I thought I'd start without it in case I am 
> missing something more basic.
> 
> Thanks,
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Solved: Re: WebdavResource getChildResources() : Directory Listing

Posted by "Robert r. Sanders" <ro...@ipov.net>.
I haven't had a chance to test this with other webDAV servers so I don't 
know the full implications; but the problem I was having seems to have 
nothing to do with xml, instead it was how the URIs of collections 
were/are being constructed.

In WebdavResource, line 1086:  URIUtil.getName(href) is used to get the 
name of the item; however as per the javadocs this method returns an 
empty string if href ends with a slash.  At least with subversion, all 
hrefs to collections are reported as ending with a slash; therefore no 
sub-collections are ever reported by the 
WebdavResource.listWebdavResources() or associated methods.

My fix:  replace URIUtil.getName(href)  with  getName(href)  this seems 
to work fine for me; although as I said I am not sure what, if any, 
implications this might have on other functionality.

-- 
    Robert r. Sanders
    Chief Technologist
    iPOV
    www.ipov.net


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: WebdavResource getChildResources() : Directory Listing

Posted by "Robert r. Sanders" <ro...@ipov.net>.
Interesting.  However, I think the problem has something to do with the 
XML Namespaces - the server response contains the same URI mapped to 2 
different names, and I think this is throwing the XML parsing of the 
webdav client off. I have been meaning to dig deeper into this and try 
to fix it and post a patch, but I the past couple of days I have been 
sick, so I haven't been able to get anything done in this area.

J H wrote:

> Robert,
>
> I had a similar problem some time ago.  I noticed that whenever a 
> parent collection contained a special character, it was returned 
> infinitely down the line.
>
> For example
> Collection 10~9 contains 3 children, getChildResources would return 
> 10~9 and the 3 children.  When I did a getChildren on the now nested 
> 10~9 collection, it would keep returning itself infinitely
>
>
> Ascii Art ;)
>
> -10~9
> |-----10~9
> |    |----------10~9
> |    |     |-----------------10~9
> |    |     |   |------------------------10~9
> |-----File 1
> |-----File 2
> |-----File 3
>
>>

-- 
    Robert r. Sanders
    Chief Technologist
    iPOV
    www.ipov.net


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


RE: WebdavResource getChildResources() : Directory Listing

Posted by J H <do...@hotmail.com>.
Robert,

I had a similar problem some time ago.  I noticed that whenever a parent 
collection contained a special character, it was returned infinitely down 
the line.

For example
Collection 10~9 contains 3 children, getChildResources would return 10~9 and 
the 3 children.  When I did a getChildren on the now nested 10~9 collection, 
it would keep returning itself infinitely


Ascii Art ;)

-10~9
|-----10~9
|    |----------10~9
|    |     |-----------------10~9
|    |     |   |------------------------10~9
|-----File 1
|-----File 2
|-----File 3

>From: "Robert r. Sanders" <ro...@ipov.net>
>Reply-To: "Slide Users Mailing List" <sl...@jakarta.apache.org>
>To: slide-user@jakarta.apache.org
>Subject: WebdavResource getChildResources() : Directory Listing
>Date: Wed, 29 Dec 2004 17:54:14 -0600
>
>I don't know how much support the WebDAV client lib has for being a generic 
>WebDAV tool; but I am trying to use it as such.
>
>Currently I am trying to connect to a Subversion server over WebDAV and 
>list all resources in a collection/directory; the code is:
>
>        WebdavResource resource = new 
>WebdavResource("http://myserver/svn/", true);
>
>        WebdavResources children = resource.getChildResources();
>
>
>but when I iterate over the WebdavResources all I see is the collection 
>itself, and any files it contains.  I know there are several 
>sub-collections/directories, but they are not being reported.  I ended up 
>installing Ethereal to see what was going on, so I can send the HTTP trace 
>if that helps; but I thought I'd start without it in case I am missing 
>something more basic.
>
>Thanks,
>
>--
>    Robert r. Sanders
>    Chief Technologist
>    iPOV
>    www.ipov.net
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: slide-user-help@jakarta.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org