[Zope-CMF] publish multiple objects/editions?

Tres Seaver tseaver@palladion.com
Mon, 03 Dec 2001 17:14:25 -0500


alan runyan wrote:

> no.  what I meant is in the folder_contents (or another mechanism) to check
> off a list of things to publish at once.
> here is the case from this morning:
> 
> guy who publishes reports.
> 
> uploads 4 files (.xls)
> create a document that contains hyperlinks to 4 other files (.xls)
> 
> now lets say we want to publish them all at once, put them in 'pending' in 1
> sweep.

I have a method I use on the dogbowl for publishing (mostly
rejecting, actually, so I can reuse the "no test content" comment):
The form derives from the stock 'search', but hard-codes the
review_state query;  the processor is a simple Python script, like
so:

## Script (Python) "publishItems"
##parameters=items, comment=''
##title=
##
wf_tool = context.portal_workflow # XXX getToolByName
for path in items:
     object = context.restrictedTraverse( path )
     wf_tool.doActionFor( object, 'publish', comment=comment )

context.REQUEST[ 'RESPONSE' ].redirect( '%s/review?%s'
                    % ( context.portal_url()
                      , 'portal_status_message=Items+published.'
                      ) )dav:/CMF/portal_skins/common/>



Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com