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 Chris O'Connell <CO...@centerpost.com> on 2004/11/29 16:17:55 UTC

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: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: getting started

Posted by Michael Smith <ms...@speedlegal.com>.
Julian Reschke wrote:
> Michael Smith wrote:
>> Though apparently the whole Label thing is a deprecated feature of 
>> webdav...
> 
> 
> No, not the LABEL feature per se, but the "Label" request header (it's 
> incompatible with HTTP/1.1 because in some way it behaves like a 
> variant, but then sometimes doesn't). See 
> <http://www.webdav.org/deltav/protocol/rfc3253-issues-list.htm>, issue 
> "8.3_ LABEL_HEADER".
> 
> Best regards, Julian
> 

Ah. Thanks for the clarification - I'd seen (at some distant point in 
the past) a reference to it being deprecated, but had forgotten the 
details.

Mike




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


Re: getting started

Posted by Julian Reschke <ju...@gmx.de>.
Michael Smith wrote:
> Chris O'Connell wrote:
> 
>> 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.
> 
> I did this by subclassing WebdavResource. I added an instance variable
> "private String label;", along with a getter and setter.
> 
> Then, I overrode getMethodData() to call
>   method.setHeader("Label", label);
> if label was non-null. Fairly simple.
> 
> Though apparently the whole Label thing is a deprecated feature of 
> webdav...

No, not the LABEL feature per se, but the "Label" request header (it's 
incompatible with HTTP/1.1 because in some way it behaves like a 
variant, but then sometimes doesn't). See 
<http://www.webdav.org/deltav/protocol/rfc3253-issues-list.htm>, issue 
"8.3_ LABEL_HEADER".

Best regards, Julian

-- 
<green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760

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


Re: getting started

Posted by Michael Smith <ms...@speedlegal.com>.
Chris O'Connell wrote:

> 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.

I did this by subclassing WebdavResource. I added an instance variable
"private String label;", along with a getter and setter.

Then, I overrode getMethodData() to call
   method.setHeader("Label", label);
if label was non-null. Fairly simple.

Though apparently the whole Label thing is a deprecated feature of webdav...

Mike

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


Re: getting started

Posted by Tim Frank <tf...@registrar.uoguelph.ca>.
Chris,

You will want to look at the PropFind/PropPatch methods for 
setting/retrieving properties. You can add in your own custom properties 
and namespace as well. Some of the functions in WebdavResource are a bit 
limiting, but you can always call the methods directly from the methods 
class if need be. Worst case you can write your own client library to do 
the HTTP calls.

Tim

Chris O'Connell wrote on 29/11/04 10:17 AM:
> 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: 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: getting started

Posted by kranga <kr...@k2d2.org>.
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" <kr...@k2d2.org>
To: "Slide Users Mailing List" <sl...@jakarta.apache.org>
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" <CO...@centerpost.com>
> To: "Slide Users Mailing List" <sl...@jakarta.apache.org>
> 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: 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
>


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


Re: getting started

Posted by kranga <kr...@k2d2.org>.
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" <CO...@centerpost.com>
To: "Slide Users Mailing List" <sl...@jakarta.apache.org>
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: 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