[Zope-CMF] Re: Abusing GenericSetup during traditional installs

yuppie y.2006_ at wcm-solutions.de
Mon Jul 31 08:47:23 EDT 2006

Hi Martin!

Martin Aspeli wrote:
> yuppie-2 wrote:
>>      # apply XML body to adapted workflow and environ
>>      adapted = queryMultiAdapter((obj, environ), IBody)
>>      adapted.body = body
> So, assigning the contents of a file to the body attribute of an IBody has
> the side-effect of initialising the context of the multi adapter from obj,
> environ -> IBody with the XML contents of that file?

If I did get your question right this is the answer:

The body attribute of IBody represents the settings of the object. The 
fact that DCWorkflowDefinitions store their settings in a persistent 
object tree is just an implementation detail you don't have to care 
about if you use the adapted object.

If you write a new XML body to adapted.body the settings of the workflow 
are changed. The body is not stored as a string, it is stored as object 
tree. (So yes, the workflow is 'initialized' with the settings defined 
in the XML file.) If you modify the object tree TTW reading adapted.body 
will return the XML representation of the modified settings. XML body 
and object tree are just two different ways to look at and modify the 
same settings.



More information about the Zope-CMF mailing list