<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<style type="text/css">body{margin-left:10px;margin-right:10px;margin-top:0px;margin-bottom:0px;}</style>
</head>
<body marginleft="10" marginright="10" margintop="0" marginbottom="0">
<font face="Geneva" size="+0" color="#000000" style="font-family:Geneva;font-size:10pt;color:#000000;">Garrett Smith wrote:<br>
<br>
</font><span style="background-color:#d0d0d0"><font face="Geneva" size="+0" color="#000000" style="font-family:Geneva;font-size:10pt;color:#000000;">What is the difference between 'content' that gets modified and the<br>
object that gets modified.</font></span><font face="Geneva" size="+0" color="#000000" style="font-family:Geneva;font-size:10pt;color:#000000;"><br>
<br>
In my understanding the difference stems from the filesystem <br>
metaphor behind Zope. The &quot;content&quot; of a Zope object corresponds <br>
to the content of a file, while other attributes are more like descriptive <br>
metadata (e.g. modification time).<br>
The distinction however is not clear cut because content objects<br>
can be much more complex than simple files and metadata can also be stored<br>
in annotations.<br>
<br>
In my use case, however, it makes sense to draw such a distinction <br>
because I'm using the filesystem to store versions. <br>
Content in this sense is simply that what can be edited by opening and writing files.<br>
Since Zope3 supports WebDAV and FTP something similar is probably needed for <br>
other systems too. <br>
<br>
But I could also live with ObjectModifiedEvents only. &nbsp;<br>
I've to check all aspects of an object anyway, because<br>
the non-content parts of an object are versionable too. Currently I loop over<br>
all versionable attributes (which are provided by special adapters) and<br>
try to detect all differences between new and old versions of an object.<br>
<br>
A more radical approach would be to specify in each ObjectModifiedEvent<br>
which aspects of an object changed. By aspect I mean the schema and the modified<br>
field within the schema:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;class IPerson(Interface) :<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;age = Attribute(&quot;The age of the person&quot;)<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;class Person(object) :<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;implements(IPerson)<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;person = Person()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;person.age = 42<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zope.event.notify( ObjectModifiedEvent(person, aspect=IPerson[&quot;age&quot;]))<br>
<br>
File content then could be handled as a special case :<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;file.data = &quot;42&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zope.event.notify( ObjectModifiedEvent(person, aspect=IFile[&quot;data&quot;]))<br>
<br>
With this extension the ObjectModifiedEvents would be more informative and a loop over all versionable<br>
attributes in my application would become unnecessary. &nbsp;This would also make updates of<br>
&nbsp;catalogs more efficient.<br>
<br>
Regards<br>
Uwe Oestermeier<br>
</font>
</body></html>