My bad - the method header went missing :)
pURL = URL for which you want to get labeled version
pLabel = Label string
public String getVersionByLabel(String pURL, String pLabel)
----- Original Message -----
From: "kranga" <[EMAIL PROTECTED]>
To: "Slide Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, November 29, 2004 1:30 PM
Subject: Re: getting started
> Try this code. It will return the URL for the resource that has a given
> label. You can then do a get on the href returned.
>
> boolean found = false;
> String version = null;
>
> WebdavResource res = getResource(pURL);
>
> PropertyName name = new PropertyName("DAV:", "label-name-set");
> Vector v = new Vector();
> v.add(name);
>
> Enumeration enum = res.reportMethod(res.getHttpURL(), v);
> while (enum.hasMoreElements() && !found)
> {
> Object o = enum.nextElement();
> if (o instanceof ResponseEntity)
> {
> ResponseEntity ent = (ResponseEntity)o;
> Enumeration enum1 = ent.getProperties();
> while (enum1.hasMoreElements() && !found)
> {
> Object o1 = enum1.nextElement();
> if (o1 instanceof BaseProperty)
> {
> BaseProperty prop = (BaseProperty)o1;
>
> NodeList list = prop.getElement().
> getElementsByTagNameNS("DAV:", "label-name");
> for (int i = 0; i < list.getLength(); i++)
> {
> String temp = list.item(i).getFirstChild().
> getNodeValue();
> if (temp.compareTo(pLabel) == 0)
> {
> found = true;
> break;
> }
> }
> }
> }
> if (found == true)
> {
> version = ent.getHref();
> }
> }
> }
> return version;
>
>
> ----- Original Message -----
> From: "Chris O'Connell" <[EMAIL PROTECTED]>
> To: "Slide Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Monday, November 29, 2004 10:17 AM
> Subject: getting started
>
>
> I'm still trying to 'figure out' Slide, and I think I'm missing a few
> things. Or, at least I'm missing the one big thing that makes everything
> else fall into place.
>
> I want to use Slide as the back end for a content management application.
> We are going to store media files (.wav files, images etc.). The users
will
> be able to go to the web site, look at (or hear) the current version of
the
> media. If they want to make a change, they can upload a new version of
the
> media file and we drop it into Slide. They also will be able to
potentially
> see (hear) all old versions of the file.
>
> We also want to be able to group files together and then drop labels on
> those files and then get the labeled version of a file. So, maybe
Hello.wav
> is currently on version 1.6, but 1.3 is labeled 'Production'. Without
> knowing the version number, we want the user to be able to get
'Production'.
>
> So, I have been playing with the WebdavResource, and it doesn't look like
> there is any way to use that class to do any of the labeling/getting that
we
> want to do. I can call the 'reportMethod(...)' on the WebdavResource, and
> it will return the path to each version of a file and I can then get that
> version, but I can't figure out how do use the labeling.
>
> So, if anyone could fill in what I am missing, I would really appreciate
it.
> Do people write their own client Socket to connect to the Servlet and push
> over HTTP/Webdav Headers to do what they want to do?
>
> Thanks, Chris
>
> ---------------------------------------------------------------------
> 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]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]