[Zope-CMF] Published content...

Florent Guillaume fg@nuxeo.com
Thu, 20 Mar 2003 19:56:24 +0100


In article <3E789201.190FA01B@brookes.ac.uk> you write:
> (The 'getObjectsByPortalType' function simply returns a list of just 'Staff
> Member' types from 'objectItems('Document')' since there are other content
> types in here that are 'Document' which we don't want.) 
> 
> This works fine until a 'Staff Member' is added but left 'un-published',
> when viewing the page the user is prompted to login! Bad! 
> 
> I would have thought that 'objectItems()' would just return published
> content. I guess not! 
>
> Any ideas how we show the page with just the published content? 

objectItems is a pure Zope function, it doesn't know about CMF workflows.

You'll have to filter objects by visibility first (see LazyFilter).

Then if you have visible objects beyond those in the published state,
you'll have to filter on the review_state (or whatever your workflow
state variables is). To do that do something like:

  context.portal_workflow.getInfoFor(ob, 'review_state') == 'published'

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@nuxeo.com