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.

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

Ollie



Reply via email to