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 Dirk Verbeeck <di...@pandora.be> on 2001/09/01 02:28:05 UTC

Re: PROPATCH

I have looked at your sample program and did some small modification to
make it behave just like it is specified in the http RFC.
- finish each header line with \r\n and an empty line between header and
body.
- remove spaces from xml (not really needed but is nicer for xml parser)

I have run the program on tomcat 3 with slide deployed as webapp.
Tomcat 4 should make no difference but test your installation with the
slide client.

May I ask why you are not using the client API, is there some
restriction or a feature that is missing, or are you just learning the
protocol ?


Dirk


=============== Outbound Message Headers =================
PROPPATCH /slide/files/a HTTP/1.1
Host: localhost:8080
Connection: TE
TE: trailers, deflate, gzip, compress
Content-Type: text/xml
Content-Length: 142
=============== Outbound Message Body =================
<?xml version="1.0" ?><A:propertyupdate xmlns:A="DAV:"
xmlns:Z="DAV:"><A:set><A:prop><Z:test>dirk</Z:test></A:prop></A:set></A:propertyupdate>

=============== Inbound Stream =================
HTTP/1.0 207 Multi-Status
Set-Cookie2: JSESSIONID=l3oi6f9g61;Version=1;Discard;Path="/slide"
Set-Cookie: JSESSIONID=l3oi6f9g61;Path=/slide
Servlet-Engine: Tomcat Web Server/3.2.2 (JSP 1.1; Servlet 2.2; Java
1.3.0; Windows 98 4.90 x86; java.vendor=Sun Microsystems Inc.)

<?xml version="1.0" encoding="utf-8" ?><d:multistatus
xmlns:d="DAV"><d:response><d:href>/files/a</d:href><d:propstat><d:prop><Z:test
xmlns:Z="DAV:"/></d:prop><d:status>HTTP/1.1 200
OK</d:status></d:propstat></d:response></d:multistatus>
=============== Inbound Stream Complete =================




Vijaya Kumar wrote:

> Thanx Dirk, I got  the following response headers from the server. I
> attached the sequence with the source code in the txt file.In short, I
> got                            HTTP/1.1 200 OK
>                             Content-Length: 0
>                             Date: Tue, 28 Aug 2001 09:48:03 GMT
>                             Server: Apache Tomcat/4.0-b3 (HTTP/1.1
> Connector) but when I again get the Properties using PROPFIND the
> value that I set to that resource is not updated. Whats wrong with
> me?.

Re: Forbidden

Posted by Dirk Verbeeck <di...@pandora.be>.
Vijaya Kumar wrote:

>         When I run the samles in the examples/xml/Test.java folder in
> src.zip, it creates the folder named "files" in current working directory
> and the "bin" dir of Tomcat.

This test only creates a folder named "files" in current working directory
and runs to the end.

Here are the last part of the test:
Parent : /toto/2/3
Parent : /toto/2
Parent : /toto
Parent : /
Link test
Resolved link to /toto/1.txt
Retrieve the complex stuff
Time elapsed = 0.88 seconds
Operations / s = 11363.636363636364
Testing locking service
Lock Action : org.apache.slide.structure.ActionNode@a7efd
Kill lock Action : org.apache.slide.structure.ActionNode@171afc
Grant locking permission
08 Sep 2001 15:56:26 - WARNING - WARNING: No active transaction
Locking resource
08 Sep 2001 15:56:26 - WARNING - WARNING: No active transaction
Lock test1 - correct
Lock test2 - correct
08 Sep 2001 15:56:26 - WARNING - WARNING: No active transaction
Lock test3 - correct
Lock test4 - correct
Closing data sources


> Also I cannot create new folder in the slide
> namespace. Recieving Forbidden error.

Give write permission to your user on the parent folder.


Dirk


Forbidden

Posted by Vijaya Kumar <vi...@businex.com>.
        When I run the samles in the examples/xml/Test.java folder in
src.zip, it creates the folder named "files" in current working directory
and the "bin" dir of Tomcat. Also I cannot create new folder in the slide
namespace. Recieving Forbidden error.




Answers to PROPATCH and other questions

Posted by Dirk Verbeeck <di...@pandora.be>.
Here are the answers you requested.

Vijaya Kumar wrote:
<snip>

>  I run the same code with "webdav/Domain.xml" as it is in the webdav
> folder, I found the same headers to be passed to the server what you passed
> to it. And the response is not with multistatus, with 200 Ok. If you dont
> mind, can you test this code with webdav of Tomcat server.

> >   Whats the stand of Tomcat 4.0 b7 regarding PROPPATCH header in DAV
 > > Protocol. Does it supports PROPPATCH or not.
 >
 > No.
 >
 > > All other headers except
 > > PROPPATCH is working fine, but later is always responded with HTTP 200 Ok
 > > status but the operation is not success. Can any one have idea...Plz advice.
 >
 > Ok, I'll have it return something else. 403 or 501.
 >
 > Remy

With TOMCAT WEBDAV you get a response 200 on proppatch even it is not supported.
Remy confirmed it to you and is going to change that.

Back to the slide webdav...

> As u said I have created one folder inside Slide folder
> /files/a  in the webapps, then try to find the PROPFIND for that , but I get
> not found in .
Did you use a webdav client to create that folder ?
Slide stores its structure in a structure store (memory or database) and if you
create a directory on disk (content store), slide doesn't know about it.

> When I try to PROPPATCH  403 Forbidden appears.
Look at the bottom of domain.xml there are some lines you have to uncomment to give
the guest user read/write access.

>  Is it possible to change any of one/more properties of the DAV resource say
>  add new property like author.
>  <author>
>      <name>somebody</name>
>      <href>somebody@somewhere.com</href>
>  </author>
Yes, you can add any property you want, the property value must be valid XML like
your example.

>  How to overcome this problem. B'cas when I go through the
>  redirection draft, when creating new resource I need to change its
>  resourcetype property to "redirected-ref". Plz advice.
The redirection draft and MKRESOURCE isn't supported yet in slide.
But you can do a proppatch on the resourcetype.
I just created a collection and changed its resourcetype.


Dirk


Re: PROPATCH

Posted by Vijaya Kumar <vi...@businex.com>.
Hi,
        I want to know the basics of the protocol before using the client
API, for that only i'm trying this. I already gain maximum, Instead of using
the GetMethod in API, before using that I'm interested to know what kind of
effort was taken by the developer who designs that API.

        Actually when I first use Slide, when it creates a new folder in the
server namespace, I got exited and want to know how it is happening, now
things getting more and more interesting with DAV and its extensions.  You
dont think the restrictions or missing facilities like so. I'm not that much
deeper with Slide. Just now only I start using  client.

        I already got the HttpCommons package code through ur mail
attachment. From that onwards Im looking into Client codes.

         I run the same code with "webdav/Domain.xml" as it is in the webdav
folder, I found the same headers to be passed to the server what you passed
to it. And the response is not with multistatus, with 200 Ok. If you dont
mind, can you test this code with webdav of Tomcat server.

     Its smart idea of creating xml body as you did, to avoid the space
usage. The reason I use the spaces are just to get the visual meaning full
on the screen. That is what u get in much prettier.

Thanx.
Vijay
=============== Outbound Message Headers =================
PROPPATCH /webdav/Domain.xml HTTP/1.1
Host: 192.168.0.5:8080
Connection: TE
TE: trailers, deflate, gzip, compress
Content-Type: text/xml
Content-Length: 142

=============== Outbound Message Body =================
<?xml version="1.0" ?><A:propertyupdate xmlns:A="DAV:"
xmlns:Z="DAV:"><A:set><A:
prop><Z:test>dirk</Z:test></A:prop></A:set></A:propertyupdate>

=============== Inbound Stream =================
HTTP/1.1 200 OK
Content-Length: 0
Date: Sat, 01 Sep 2001 12:15:40 GMT
Server: Apache Tomcat/4.0-b3 (HTTP/1.1 Connector)




----- Original Message -----
From: "Dirk Verbeeck" <di...@pandora.be>
To: <sl...@jakarta.apache.org>
Sent: Saturday, September 01, 2001 5:58 AM
Subject: Re: PROPATCH


> I have looked at your sample program and did some small modification to
> make it behave just like it is specified in the http RFC.
> - finish each header line with \r\n and an empty line between header and
> body.
> - remove spaces from xml (not really needed but is nicer for xml parser)

     Its smart idea of creating xml body as you did, to avoid the space
usage. The reason I use the spaces are just to get the visual meaning full
on the screen. That is what u get in much prettier.

> I have run the program on tomcat 3 with slide deployed as webapp.
> Tomcat 4 should make no difference but test your installation with the
> slide client.

        If you dont mind, can you test this code with webdav namespace in of
Tomcat server webapps.


> May I ask why you are not using the client API, is there some
> restriction or a feature that is missing, or are you just learning the
> protocol ?

       I want to know the basics of the protocol before uising the client,
for that only i'm trying this. I already gain maximum, Instead of using the
GetMethod in API, before using that I'm interested to know what kind of
effort was taken by the developer who designs that API.

        Actually when I first use Slide, when it creates a new folder in the
server namespace, I got exited and want to know how it is happening, now
things getting more and more interesting with DAV and its extensions.  You
dont think the restrictions or missing facilities like so. I'm not that much
deeper with Slide. Just now only I start using  client.

        I already got the HttpCommons package code through ur mail
attachment. From that onwards Im looking into Client codes.


>
> Dirk
>
>
> =============== Outbound Message Headers =================
> PROPPATCH /slide/files/a HTTP/1.1
> Host: localhost:8080
> Connection: TE
> TE: trailers, deflate, gzip, compress
> Content-Type: text/xml
> Content-Length: 142
> =============== Outbound Message Body =================
> <?xml version="1.0" ?><A:propertyupdate xmlns:A="DAV:"
>
xmlns:Z="DAV:"><A:set><A:prop><Z:test>dirk</Z:test></A:prop></A:set></A:prop
ertyupdate>
>
> =============== Inbound Stream =================
> HTTP/1.0 207 Multi-Status
> Set-Cookie2: JSESSIONID=l3oi6f9g61;Version=1;Discard;Path="/slide"
> Set-Cookie: JSESSIONID=l3oi6f9g61;Path=/slide
> Servlet-Engine: Tomcat Web Server/3.2.2 (JSP 1.1; Servlet 2.2; Java
> 1.3.0; Windows 98 4.90 x86; java.vendor=Sun Microsystems Inc.)
>
> <?xml version="1.0" encoding="utf-8" ?><d:multistatus
>
xmlns:d="DAV"><d:response><d:href>/files/a</d:href><d:propstat><d:prop><Z:te
st
> xmlns:Z="DAV:"/></d:prop><d:status>HTTP/1.1 200
> OK</d:status></d:propstat></d:response></d:multistatus>
> =============== Inbound Stream Complete =================