Is there a way for an object to be notified that it has been modified? In particular, I want to create Relation objects that relate two arbitrary Folders. Creating the Relation object with a ZClass is easy (even for a newbie like me :-) ), but I need to update the relation links if the destination folder is moved. My thinking is that I need a parentChanged method that is invoked by a parent. parentChanged would then recursively invoke parentChanged for each of its child folders. The purpose of parentChanged would be to look for any relation objects that referenced the old location and either 1) change the reference to the new location if the old location is no longer valid (i.e. a Cut/Paste operation), or 2) add the new location if the old location is still valid (i.e. a Copy/Paste operation). This sounds expensive, and I'm not sure how to kick off the process. Does a "Paste" create a new instance? Thanks for the help, Bob Barter
Hi, Bob Barter wrote:
Is there a way for an object to be notified that it has been modified?
In particular, I want to create Relation objects that relate two arbitrary Folders. Creating the Relation object with a ZClass is easy (even for a newbie like me :-) ), but I need to update the relation links if the destination folder is moved.
if it is in aqisition path, <dtml-var object url> may help. It would give you the URL of the object whereever it is at the moment. May be, you could use ZCatalog otherwise. HTH Tino Wildenhain
Bob Barter wrote:
Is there a way for an object to be notified that it has been modified?
Use ZPatterns 0.4, it allows you to be notified of events - change, add and delete of objects. -- Itamar S.T. itamar@maxnm.com Fingerprint = D365 7BE8 B81E 2B18 6534 025E D0E7 92DB E441 411C
participants (3)
-
Bob Barter -
Itamar Shtull-Trauring -
Tino Wildenhain