Ingo,
Were you able to run the code? I get a class cast exception when trying
to cast it to ResponseEntity. When I print .getClass().toString() I see that
all the elements are java.lang.String. This is consistent with what I see in
the source code...After all the reportMethod(URL, vector) simply calls
reportMethod(URL, vector, int). Looks like a bug to me.
On another note (I will post this as a separate email to get better
visibility): Using MySQL as the store, I've run into what looks like a
serious error. I created 6 versions of a given file. I stopped tomcat and
started it and the reportMethod() started failing with an Internal Server
Error. After some investigation, I see that the property_value field of the
properties table holds 255 characters and the version-set property maxes
that out when v1.4 is created! Is this a bug or am I doing something wrong?
It works as long as I don't shutdown tomcat. Am I shutting down tomcat
wrong?
-Karthik
----- Original Message -----
From: "Ingo Brunberg" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 17, 2004 4:16 AM
Subject: Re: How can I determine what version has a given label
> You already guessed it. The main problem is that the different methods
> return different results depending on which signature you use, and
> what gets returned in each case is not even documented.
>
> When you call reportMethod(URL, properties) and omit the depth you get
> an Enumeration of raw ResponseEntity objects.
>
> Try the following code snippet:
>
> Vector properties = new Vector();
> properties.addElement("label-name-set");
> properties.addElement("version-name");
> Enumeration e = resource.reportMethod(resource.getHttpURL(),
> properties);
> while (e.hasMoreElements()) {
> ResponseEntity entity = (ResponseEntity) e.nextElement();
> int status = entity.getStatusCode();
> if (status < 200 || status >= 300) {
> // error
> continue;
> }
> Enumeration props = entity.getProperties();
> while (props.hasMoreElements()) {
> BaseProperty baseProp =
> (BaseProperty) props.nextElement();
> String propName = baseProp.getLocalName();
> if (propName.equals("version-name")) {
> System.out.println(
> "version name: " + baseProp.getPropertyAsString());
> } else if (propName.equals("label-name-set")) {
> NodeList labels =
> baseProp.getElement().getElementsByTagNameNS(
> "DAV:", "label-name");
> numLabels = labels.getLength();
> for (int i = 0; i < numLabels; i++) {
> System.out.println("label " + i + ": "
> labels.item(i).getFirstChild().getNodeValue());
> }
> }
> }
> }
>
> Regards,
> Ingo
>
> > The reportMethod(URL, properties, depth) gets the correct XML response
back,
> > however the enumeration class that is returned only has strings in it
and
> > shows up blank for the label-name-set prop. I'm not sure if the bug is
in
> > the method or in the underlying ReportMethod class at this point, but
I'm
> > sure it is a bug. I'm implementing a workaround by subclassing
> > WebdavResouce. Perhaps I could submit that after I get it to work
properly?
> >
> > ----- Original Message -----
> > From: "Michael Smith" <[EMAIL PROTECTED]>
> > To: "Slide Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Wednesday, June 16, 2004 9:00 PM
> > Subject: Re: How can I determine what version has a given label
> >
> >
> > > Ingo Brunberg wrote:
> > > >>kranga wrote:
> > > >>
> > > >>>I've tried using propfind <path> label-name-set and this returns
blank.
> > The
> > > >>>label property holds a set of labels as a revision can have
multiple
> > labels.
> > > >>>How do I query the labels out? Someone please help!
> > > >>
> > > >>You need to do your propfind (for label-name-set) on the version
paths.
> > > >>There's no simple/quick way to say 'give me a list of all the labels
> > > >>that are set on any version of this resource' (an argument could
> > > >>certainly be made that this would be a useful thing, though) as far
as I
> > > >>know.
> > > >
> > > >
> > > > No, there is a way of doing this. Just use the REPORT method on your
> > > > version controlled resource and ask for the label-name-set.
> > >
> > > Ah. My mistake - I was using the RFC as my reference (since I have a
> > > helpful printed out copy sitting next to me). The relevant REPORT (and
> > > the deprecation of the Label header) was added in the errata, which I
> > > hadn't read.
> > >
> > > >
> > > >
> > > >>Fetching a particular version with a label set is, of course, much
> > > >>simpler - just set the Label header appropriately.
> > > >>
> > > >>Mike
> > > >
> > > >
> > > > The Label header is deprecated. I'm not sure if it is supported by
> > > > Slide anyway. You have to find out (from the results of the REPORT
> > > > method) which version has a given label set. Then you request
exactly
> > > > that version by a simple GET.
> > >
> > > Label header is supported by slide - it's quite useful. The REPORT
> > > approach is sensible too, of course, but I haven't checked if slide
> > > supports it.
> > >
> > > Mike
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]