[Zope-CMF] multiple publish of Documents, Images
Jens Hauser
Jens Hauser" <hauser@jam-gmbh.de
Fri, 20 Sep 2002 11:50:18 +0200
Hi Florent,
I solved the problem (for my situation ;-)
I just changed my script to contain a try/ except statement, which doesn't
produce any output put simply skips those objects which can't be published.
I think, in fact the problem comes from folders which can't be published at my
site.
#########CUT
wf_tool = context.portal_workflow
stack = [context]
for object in stack:
if object.isPrincipiaFolderish:
children = object.contentValues()
for child in children:
if not child.id in ['allgemeines','img','pdf','aktuelles',
'Members','news']:
stack.append(child)
try:
wf_tool.doActionFor( object, 'publish', comment="auto published" )
except:
print
#########CUT
This script publishes everything in the actual folder and all subfolders which
is not named "allgemeines", "img, ...
Thanks to all,
Jens
On Thu, 19 Sep 2002 13:16:52 +0000 (UTC), Florent Guillaume wrote:
>Do a try/except around doActionFor to identify which object has
>problems. Then for that object check which workflows it effectively
>follows in the Workflow tab of the ZMI for that object. That'll help
>diagnose things.
>
>Florent
>
>Jens Hauser <hauser@jam-gmbh.de> wrote:
>> Hi all,
>>
>> yes, it's me again... :-(
>>
>>
>> I can reduce my problem to the following situation:
>>
>> If I use Chris' original script I get the error message listed below -
>> workflow exception.
>>
>> ##############CUT original script
>> wf_tool = context.portal_workflow
>> stack = [context]
>> for object in stack:
>> wf_tool.doActionFor( object, 'publish', comment="Your comment" )
>> if object.isPrincipiaFolderish:
>> children = objects.contentValues()
>> for child in children:
>> if not id in ['allgemeines','img','pdf','aktuelles',
>> 'Members','news','thumbs']:
>> stack.append(child)
>> ##############CUT original script
>>
>> If I reduce the script to publish only an actual image (and do not look for
>> any subdirectories within the actual directory, that very special image is
>> published. Seems like some of the objects within the directory cannot be
>> published or lead into the given error...
>>
>> Anybody out there with an idea? It's blowing my mind ...
>>
>> Regards,
>> Jens
>>
>> >>> Zope Error
>> >>> Zope has encountered an error while publishing this resource.
>> >>>
>> >>> Error Type: WorkflowException
>> >>> Error Value: No workf
>> >>> found.
>> >>>
>> >>> Traceback (innermost last):
>> >>> File /opt/zope/lib/python/ZPublisher/Publish.py, line 223, in
>> publish_module
>> >>> File /opt/zope/lib/python/ZPublisher/Publish.py, line 187, in publish
>> >>> File /opt/zope/lib/python/Zope/__init__.py, line 226, in
>> >>> zpublisher_exception_hook
>> >>> (Object: LockableItem)
>> >>> File /opt/zope/lib/python/ZPublisher/Publish.py, line 171, in publish
>> >>> File /opt/zope/lib/python/ZPublisher/mapply.py, line 160, in mapply
>> >>> (Object: publish_site)
>> >>> File /opt/zope/lib/python/ZPublisher/Publish.py, line 112, in call_object
>> >>> (Object: publish_site)
>> >>> File /opt/zope/lib/python/Shared/DC/Scripts/Bindings.py, line 324, in
>> >>> __call__
>> >>> (Object: publish_site)
>> >>> File /opt/zope/lib/python/Shared/DC/Scripts/Bindings.py, line 354, in
>> >>> _bindAndExec
>> >>> (Object: publish_site)
>> >>> File /opt/zope/lib/python/Products/PythonScripts/PythonScript.py, line
>> 363,
>> >>> in _exec
>> >>> (Object: publish_site)
>> >>> (Info: ({'script': <PythonScript instance at 8b197f0>, 'context':
>> >>> <PortalFolder instance at 8bfba28>, 'container': <CMFSite instance at
>> >>> 9633ab8>, 'traverse_subpath': []}, (), {}, None))
>> >>> File Script (Python), line 4, in publish_site
>> >>> (Object: guarded_getattr)
>> >>> File /opt/zope/lib/python/Products/CMFCore/WorkflowTool.py, line 499, in
>> >>> doActionFor
>> >>> (Object: LockableItem)
>> >>> WorkflowException: (see above)
>--
>Florent Guillaume, Nuxeo (Paris, France)
>+33 1 40 33 79 87 http://nuxeo.com mailto:fg@nuxeo.com
>
>_______________________________________________
>Zope-CMF maillist - Zope-CMF@zope.org
>http://lists.zope.org/mailman/listinfo/zope-cmf
>
>See http://collector.zope.org/CMF for bug reports and feature requests
j.a.m. GmbH
Computer, Systemberatung, Webhosting, Softwareentwicklung
Eschersheimer Landstraße 471
60431 Frankfurt am Main
fon (069) 46 09 88 - 13
fax (069) 46 09 88 - 78
url http://www.jam-gmbh.de
Haben Sie schon Jamail probiert? Den eMailer für personalisierte Serien-Mails? Jetzt testen: http://www.jamail.de
Already tried Jamail? Visit the personalized massmailer @ http://www.jamail.de/us/
-----------------------
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.