[Zope-CMF] Abusing GenericSetup during traditional installs

Martin Aspeli optilude at gmx.net
Mon Jul 31 11:40:29 EDT 2006



yuppie-2 wrote:
> 
> 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.
> 

Right. I cringe slightly when writing to a property has side-effects beyond
just storing a value (possibly with some checks or transformations, of
course). In this case, it seems it does a lot more (changing portal_workflow
for this implementation), in which case I think a method like update() would
be more clear. 

I'm really just spelling that out to make sure I got it right, it's not that
big a deal - if it works, it works, and I'm happy. As I said, I'll probably
add a thin API around it for e.g. doing workflow imports and another for
doing FTI imports or whatnot.

Martin
-- 
View this message in context: http://www.nabble.com/Abusing-GenericSetup-during-traditional-installs-tf2014550.html#a5578250
Sent from the Zope - CMF list2 forum at Nabble.com.



More information about the Zope-CMF mailing list