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 Stan Pinte <st...@wanadoo.be> on 2003/09/02 17:54:53 UTC

get the current version of a resource

hello,

I am trying to get the current version of a version controlled resource by 
doing the following stuff:

Enumeration report = resource.reportMethod(new HttpURL(hostPort + path), 
2);

         while (report.hasMoreElements())
         {
             Object element = report.nextElement();
             System.out.println(element);
         }

however, I always receive a

PoolThread-8, 02-Sep-2003 17:54:12, , REPORT, 404 "Not Found", 10 ms, 
/slide/files/test/one.xml

while the file is there...

any idea?

thanks a lot,

Stan.


-- 
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.167 / Virus Database: 259.11.3 - Release Date: 19/08/2003



Re: get the current version of a resource

Posted by Ingo Brunberg <ib...@fiz-chemie.de>.
There's a simple answer. The allprop request doesn't return the
checked-in/checked-out property. Just do a separate PROPFIND
requesting exactly those properties.

Regards,
Ingo

>hello,
>
>my report now works, but I have another problem:
>
>how to get the current revision URL for a given resource:
>
>if I do this:
>
>WebdavResource after = new WebdavResource(httpUrl);
>
>         //Enumeration enum = resource.propfindMethod(path, "D:version-name");
>         Enumeration enum = after.propfindMethod(2);
>         //should have exactly one result!!
>         int resultCount = 0;
>         String version = "";
>         while (enum.hasMoreElements())
>         {
>             Object element = enum.nextElement();
>             System.out.println("element: [" + element + "]");
>         }
>
>
>I see all the properties of my resource, but none of them is the version 
>URL, whereas it is clearly specified in the DeltaV specs that:
>
>
>3.2.1 DAV:checked-in (protected)
>    This property appears on a checked-in version-controlled resource,
>    and identifies a version that has the same content and dead
>    properties as the version-controlled resource.  This property is
>    removed when the resource is checked out, and then added back
>    (identifying a new version) when the resource is checked back in.
>    <!ELEMENT checked-in (href)>
>
>
>any idea?
>
>thanks,
>
>Stan.
>
>At 11:34 03/09/2003 +0200, Ingo Brunberg wrote:
>
>>Hi Stan,
>>
>>I have tried this kind of REPORT (version-tree) and it works for
>>me. The only problem on the client side could be your HttpURL. There
>>is a problem if you write this:
>>
>>new HttpURL(hostPort, path)
>>
>>instead of
>>
>>new HttpURL(hostPort + path)
>>
>>Before you are going to capture a tcp trace as suggested by Peter,
>>please check what the getEscapedPath() method of your HttpURL object
>>returns.
>>
>>Btw., why do you path a depth of 2 to the method? It should be one of
>>DepthSupport.DEPTH_0, DepthSupport.DEPTH_1 or
>>DepthSupport.DEPTH_INFINITY.
>>
>>Regards,
>>Ingo
>>
>> > hello,
>> >
>> > I am trying to get the current version of a version controlled resource by
>> > doing the following stuff:
>> >
>> > Enumeration report = resource.reportMethod(new HttpURL(hostPort + path),
>> > 2);
>> >
>> >          while (report.hasMoreElements())
>> >          {
>> >              Object element = report.nextElement();
>> >              System.out.println(element);
>> >          }
>> >
>> > however, I always receive a
>> >
>> > PoolThread-8, 02-Sep-2003 17:54:12, , REPORT, 404 "Not Found", 10 ms,
>> > /slide/files/test/one.xml
>> >
>> > while the file is there...
>> >
>> > any idea?
>> >
>> > thanks a lot,
>> >
>> > Stan.


Re: get the current version of a resource

Posted by Stan Pinte <st...@axone.be>.
hello,

my report now works, but I have another problem:

how to get the current revision URL for a given resource:

if I do this:

WebdavResource after = new WebdavResource(httpUrl);

         //Enumeration enum = resource.propfindMethod(path, "D:version-name");
         Enumeration enum = after.propfindMethod(2);
         //should have exactly one result!!
         int resultCount = 0;
         String version = "";
         while (enum.hasMoreElements())
         {
             Object element = enum.nextElement();
             System.out.println("element: [" + element + "]");
         }


I see all the properties of my resource, but none of them is the version 
URL, whereas it is clearly specified in the DeltaV specs that:


3.2.1 DAV:checked-in (protected)
    This property appears on a checked-in version-controlled resource,
    and identifies a version that has the same content and dead
    properties as the version-controlled resource.  This property is
    removed when the resource is checked out, and then added back
    (identifying a new version) when the resource is checked back in.
    <!ELEMENT checked-in (href)>


any idea?

thanks,

Stan.

At 11:34 03/09/2003 +0200, Ingo Brunberg wrote:

>Hi Stan,
>
>I have tried this kind of REPORT (version-tree) and it works for
>me. The only problem on the client side could be your HttpURL. There
>is a problem if you write this:
>
>new HttpURL(hostPort, path)
>
>instead of
>
>new HttpURL(hostPort + path)
>
>Before you are going to capture a tcp trace as suggested by Peter,
>please check what the getEscapedPath() method of your HttpURL object
>returns.
>
>Btw., why do you path a depth of 2 to the method? It should be one of
>DepthSupport.DEPTH_0, DepthSupport.DEPTH_1 or
>DepthSupport.DEPTH_INFINITY.
>
>Regards,
>Ingo
>
> > hello,
> >
> > I am trying to get the current version of a version controlled resource by
> > doing the following stuff:
> >
> > Enumeration report = resource.reportMethod(new HttpURL(hostPort + path),
> > 2);
> >
> >          while (report.hasMoreElements())
> >          {
> >              Object element = report.nextElement();
> >              System.out.println(element);
> >          }
> >
> > however, I always receive a
> >
> > PoolThread-8, 02-Sep-2003 17:54:12, , REPORT, 404 "Not Found", 10 ms,
> > /slide/files/test/one.xml
> >
> > while the file is there...
> >
> > any idea?
> >
> > thanks a lot,
> >
> > Stan.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: slide-user-help@jakarta.apache.org
>
>
>
>
>--
>Incoming mail is certified Virus Free.
>Checked by AVG Anti-Virus (http://www.grisoft.com).
>Version: 7.0.167 / Virus Database: 259.11.3 - Release Date: 19/08/2003


-- 
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.167 / Virus Database: 259.11.3 - Release Date: 19/08/2003



Re: get the current version of a resource

Posted by Stan Pinte <st...@axone.be>.
I solved the problem, thanks a lot, it was a wrong HttpUrl.

thanks again.

Stan.

At 11:34 03/09/2003 +0200, you wrote:

>Hi Stan,
>
>I have tried this kind of REPORT (version-tree) and it works for
>me. The only problem on the client side could be your HttpURL. There
>is a problem if you write this:
>
>new HttpURL(hostPort, path)
>
>instead of
>
>new HttpURL(hostPort + path)
>
>Before you are going to capture a tcp trace as suggested by Peter,
>please check what the getEscapedPath() method of your HttpURL object
>returns.
>
>Btw., why do you path a depth of 2 to the method? It should be one of
>DepthSupport.DEPTH_0, DepthSupport.DEPTH_1 or
>DepthSupport.DEPTH_INFINITY.
>
>Regards,
>Ingo
>
> > hello,
> >
> > I am trying to get the current version of a version controlled resource by
> > doing the following stuff:
> >
> > Enumeration report = resource.reportMethod(new HttpURL(hostPort + path),
> > 2);
> >
> >          while (report.hasMoreElements())
> >          {
> >              Object element = report.nextElement();
> >              System.out.println(element);
> >          }
> >
> > however, I always receive a
> >
> > PoolThread-8, 02-Sep-2003 17:54:12, , REPORT, 404 "Not Found", 10 ms,
> > /slide/files/test/one.xml
> >
> > while the file is there...
> >
> > any idea?
> >
> > thanks a lot,
> >
> > Stan.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: slide-user-help@jakarta.apache.org
>
>
>
>
>--
>Incoming mail is certified Virus Free.
>Checked by AVG Anti-Virus (http://www.grisoft.com).
>Version: 7.0.167 / Virus Database: 259.11.3 - Release Date: 19/08/2003


-- 
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.167 / Virus Database: 259.11.3 - Release Date: 19/08/2003



Re: get the current version of a resource

Posted by Ingo Brunberg <ib...@fiz-chemie.de>.
Hi Stan,

I have tried this kind of REPORT (version-tree) and it works for
me. The only problem on the client side could be your HttpURL. There
is a problem if you write this:

new HttpURL(hostPort, path)

instead of

new HttpURL(hostPort + path)

Before you are going to capture a tcp trace as suggested by Peter,
please check what the getEscapedPath() method of your HttpURL object
returns.

Btw., why do you path a depth of 2 to the method? It should be one of
DepthSupport.DEPTH_0, DepthSupport.DEPTH_1 or
DepthSupport.DEPTH_INFINITY.

Regards,
Ingo

> hello,
> 
> I am trying to get the current version of a version controlled resource by 
> doing the following stuff:
> 
> Enumeration report = resource.reportMethod(new HttpURL(hostPort + path), 
> 2);
> 
>          while (report.hasMoreElements())
>          {
>              Object element = report.nextElement();
>              System.out.println(element);
>          }
> 
> however, I always receive a
> 
> PoolThread-8, 02-Sep-2003 17:54:12, , REPORT, 404 "Not Found", 10 ms, 
> /slide/files/test/one.xml
> 
> while the file is there...
> 
> any idea?
> 
> thanks a lot,
> 
> Stan.