[Zope-CMF] Workflow - Publish All Objects in Folder
Roel Van den Bergh
roel@planetinterior.com
Wed, 3 Apr 2002 14:01:25 +0200
I changend the script to:
def publishcontainer(container,path):
ov=map(lambda x:(x.id,x), container.objectValues())
ov.sort()
for (oid,obj) in ov:
if not (hasattr(obj,"isPortalContent") or obj.isPrincipiaFolderish):
continue
review_state=""
if hasattr(obj,"isPortalContent"):
print "ID: ",path+"/"+str(obj.id)
review_state=context.portal_workflow.getInfoFor(obj,'review_state','')
#print review_state
# if review_state!="published" and hasattr(context,"portal_workflow"):
# try:
# context.portal_workflow.doActionFor(obj,'publish')
# print "now published<br>"
# except:
# print "publishing",str(obj.id),"failed<br>"
# elif review_state=="published":
# print "is already published<br>"
if hasattr(obj,"objectValues"):
print publishcontainer(obj,path+"/"+str(obj.id))
return printed
...
The ID listed does not show the actual ID of the file, only its path
...
ID:
RMW/FTP/Download/Fases/0340%20Quaregnon/01%20Surveyor%20Plans%20-%20SP/Drawi
ngs/ ID:
RMW/FTP/Download/Fases/0340%20Quaregnon/01%20Surveyor%20Plans%20-%20SP/Drawi
ngs/ ID:
RMW/FTP/Download/Fases/0340%20Quaregnon/01%20Surveyor%20Plans%20-%20SP/Drawi
ngs/
...
-----Oorspronkelijk bericht-----
Van: zope-cmf-admin@zope.org [mailto:zope-cmf-admin@zope.org]Namens Jo
Meder
Verzonden: woensdag 3 april 2002 13:26
Aan: Zope-Cmf@Zope. Org
Onderwerp: Re: [Zope-CMF] Workflow - Publish All Objects in Folder
Am 03.04.2002, 13:13 Uhr
schrub Roel Van den Bergh <roel@planetinterior.com>:
> When I try your script I get the following:
>
> This is the Script (Python) "publish_all" in
> http://w2roelv.planetinterior.com:8080/RMW/FTP
> Trying to publish all unpublished content
> publishing Download failed
[...]
> Should the content be in a 'pending' state?
No, that's no prerequisite. There seems to be something strange with your
setup and I really cannot guess what it is. Perhaps you can comment out
the try/except around the part that says "failed" and retry. That should
at least give you a traceback stating what prevents the script from
publishing the object.
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
_______________________________________________
Zope-CMF maillist - Zope-CMF@zope.org
http://lists.zope.org/mailman/listinfo/zope-cmf
See http://www.zope.org/Products/PTK/Tracker for bug reports and feature
requests