Hi Ollie,

to avoid confusion first let me state that what you describe is a
problem with the command line client, not the client library itself.

I must admit that I haven't used the command line client much, as I
regard it more as an example application for the client library than a
WebDAV client for your daily use. There is another application called
"cadaver" (http://www.webdav.org/cadaver/) which I would recommend for
serious command line work.

As you propably have noticed there haven't been any changes to the
command line client for ages. Although I never expect it to be able to
compete with cadaver, I think it's time to get it a bit more up to
date. This means any patches you send are very welcome.

> Gents,
> 
> I would like to propose an enhancement to the Slide Client PropPatch 
> method such that the command line can be used to more fully expose the 
> webdavresource proppatchMethod signatures.   Currently only
> 
> webdavResource.proppatchMethod(
>                 path, new PropertyName("DAV:",name), value)
> 
> Is implemented and this does not allow specification of another 
> namespace other than DAV: nor does it allow for the boolean action 
> argument that would allow a property to be removed.
> 
> The later ability to remove properties is most easily accomplished by 
> adding a fourth optional argument to the existing
> 
> *propput path property value *
> 
> with
> 
> *propput path property value [set]*
> 
> where set = true|false|yes|no and true|yes|null = set and  false|no = remove
> 
> *note an alternative would be to not add a fourth argument and use a 
> lexicon for the value = "NULL" or "REMOVE" to indicate to remove the 
> property, i.e. set=false, but this would be less flexible as someone may 
> want to have a property set with either of those values but the code 
> would be simpler and require fewer changes to fewer files.
> 
> executing:
> 
> *void proppatch(String path, String prop, String value, boolean set)
>     {
>         String name=prop;
>         try {
>             if (set) {
>                 out.print("Putting property(" + name + ", " + value +
>                     ") to '" + path + "': ");
>             } else {
> **                out.print("Removing property(" + name + ") from '" + 
> path + "': ");*
> *            }
>             if (webdavResource.proppatchMethod(
>                 path, new PropertyName("DAV:", name), value, set) {
>                 out.println("succeeded.");
>             } else {
>                 out.println("failed.");
>                 out.println(webdavResource.getStatusMessage());
>             }
>         }
>         catch (Exception ex) {
>             handleException(ex);
>         }
>     }*
> 
> This will require changes to the Client.g, ClientParser.java and 
> Client.java.
> 
> For the namespace accomodation there are two approaches:
> 
> 1. Add another optional command line argument for the namespace (not my 
> favorite choice) like:
> 
> *propput path name value [namespaceUri] [set] *
> 
> where the lexer could determine if arg#4 was in the set 
> true|false|yes|no or a namespace Uri
> 
> executing:
> 
> *void proppatch(String path, String prop, String value, String 
> namespace, boolean set)
>     {
>         String name=prop;
>         if (namespace == null) {
>                namespace = "DAV:";  //could be imlemented by the lexer I 
> think.
>         }
>         try {
>             * if (set) {
>                 out.print("Putting property(" + name + ", " + value +
>                     ") to '" + path + "': ");
>             } else {
> **                out.print("Removing property(" + name + ") from '" + 
> path + "': ");*
> *            }
>             ***if (webdavResource.proppatchMethod(
>                 path, new PropertyName(namespace, name), value, set) {
>                 out.println("succeeded.");
>             } else {
>                 out.println("failed.");
>                 out.println(webdavResource.getStatusMessage());
>             }
>         }
>         catch (Exception ex) {
>             handleException(ex);
>         }
>     }*
> 
>   2.  Allow the name argument to be either with a namespace or not
> 
> *propput path name|namespace:name value [set]*
> 
> and let the lexer split them up.
> 

Cadaver uses another approach:

3. Introduce a new command "set namespace" (we are free to call it
   whatever we like) that sets the namespace to a custom value for all
   proppatchs issued afterwards.

> I volunteer to do the patches and am open to suggestions.
> 
> Ollie

Regards,
Ingo


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to