[Zope-CMF] Workflow - Publish All Objects in Folder

Jo Meder jo@meder.de
Wed, 3 Apr 2002 09:38:14 +0200


Am 03.04.2002, 09:28 Uhr
	schrub Roel Van den Bergh <roel@planetinterior.com>:

> After running the following script under winZope 2.5.0 and CMF 1.2 with CMF
> Workflow Revision 2 (Submitted by: runyaga & Last Edited: 2002-02-27, found
> on ZopeLabs)
> 
> #create (Python) Script called, publish_all
> wf_tool=context.portal_workflow
> 
> print 'go go auto-publish'
> for o in context.contentValues():
>     try:
>         wf_tool.doActionFor(o, 'publish')
>     except:
>         print o.objectId() + ' didnt publish '
> 
> return printed
> 
> I get the following error:
> 
> Error Type: AttributeError
> Error Value: objectId


You could try to limit your actions

	if hasattr(o,"isPortalContent"):

to objects for which publishing is relevant. I don't know if this solves
your problem but since this is in my "publish_all"-code and I've never
run into the problem you describe, why not give it a try.


	Jo.


-- 
Internetmanufaktur Jo Meder ---------------------- Berlin, Germany
http://www.meder.de/ ------------------- fon: ++49-30-417 17 63 33
Kollwitzstr. 75 ------------------------ fax: ++49-30-417 17 63 45
10435 Berlin --------------------------- mob: ++49-170- 2 98 89 97
Public GnuPG-Key ---------- http://www.meder.de/keys/jo-pubkey.txt