On 6/12/06, Lixin Chu <[EMAIL PROTECTED]> wrote:
I realized that proppatchmethod will create a new version for a versioned
resource.
if this is true, I am afraid that I cannot make use of this mechanism to
support custome properties.
Is it really true ?
The specific custome property I would like to have is a list of users who
are interested in the update of the resource (file or folder). I wanted to
do something when the watched resource is changed (new version uploaded, or
deleted for example).
I notice that there is a subscribe method, but do not know how to program
it; googled but did not find detailed enough examples.
any idea ?
As of the notification :
2 make a long story short you have to implement your subscriber (
implements org.apache.webdav.lib.Subscriber ) in order to reply to the
listener. The method that's being called is public void notify(String
uri, Map information) ; This way you can implement your emailer .
What I did was mantaining a list of users/resource/type of
subscription in a private webdav folder so that I didn't have to
bother with users deleting properties that mattered from the resources
themselves .
In my implementation of Subscriber I had something like
public void notify(String uri, Map information) {
printInfos(uri,information,logger);
if ( users != null && !users.isEmpty() ){
sendSmtpMail(message + "\n\n" +
createMessageBody(uri,information));
} else {
logger.warning("users list is empty");
}
}
Then you have to implement your own methods for sending email .
I'll come back on this if you need more.
Cheers
Marco
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]