[Zope-CMF] programmatically publish content (was: Re: Advice please ....)
Florent Guillaume
fg@nuxeo.com
17 Nov 2001 00:51:54 GMT
I'm not sure what the exact problem is, but try to use code like:
imagename = 'myimage.gif'
home = context.portal_membership.getHomeFolder()
image = home[imagename]
context.portal_workflow.doActionFor(image, 'publish')
Adapt as needed.
Florent
Grégoire Weber <gregoire.weber@switzerland.org> wrote:
> Hi Norman,
>
> I tried to find a solution for your problem but I couldn't find it. Sorry.
>
> There are two hints I can give you (and others on the list):
>
> 1) Calling "ob.portal_workflow.doActionFor(ob, 'submit', comment='')"
> in "MembershipTool.createMemberarea" prompts for a password, what is
> not intended
>
> 2) To add a <dtml-call "portal_workflow.doActionFor(ob, 'submit')">
> in portal_skins/generic/logged_in (by customizing it) should work
> because the user is logged in. But I could find out how to get
> a specific object by name in this DTML method.
>
> I'am not sure if 'published' will work. 'submit' should because a logged
> in member is able to submit a item for review.
>
> Please cc me if you find a solution. I would be interested also.
>
> Greetings, Greg
>
>
> At 13:56 10.11.01 -0000, you wrote:
> > Hello Gregoire,
> >
> > Sorry to bother you like this, but I am a bit stuck, in trying to figure on
> > how to extend your example for the CMFDefaultHotfix so that the index page
> > that contains an image -- is being generated and both to have a
> > review_state= 'published'.
> >
> > Here is the background to why I want to do this:
> >
> > I am using MySQLUserFolder which has ~40K members, everything works fine,
> > meaning that when a user is authenticated through MySQL the CMF creates a
> > folder which has an image and an index_html.dtml method. The problem is that
> > you cannot see the image until you actually publish it. What I need is to be
> > able to make the initial index_html and Image files published, until a
> > member changes them.
> >
> > Try out my CMF site at http://www.khine.net/ I hope it makes sense.
> >
> > Many thanks for your help.
> >
> > Norman
> >
> > zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
> > zz/********/z/****\zzz|****\*\zz|*******|z
> > z/^^^^^^^^/z/******\zz|*^^^^|*|z|*|^^^^^|z norman khine
> > zzzzzz/**/z|**/^^\**|z|*|zzz|*|z|*|zzzzzzz mailto:norman@khine.net
> > zzzzz/**/zz|*|zzzz|*|z|****/*/zz|*****|zzz purley
> > z/******/zz|*|zzzz|*|z|*|^^zzzzz|*|^^^|zzz UK
> > zzZ/**/zzzz|**\^^/**|z|*|zzzzzzz|*|zzzzzzz
> > zz/******/zz\******/zz|*|zzzzzzz|*|*****|z
> > z/^^^^^^/zzzz\^^^^/zzz|^|zzzzzzz|^^^^^^^|z
> > zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
> >
> >
> >
> _____________________________________
> Grégoire Weber
> Rigistr. 31
> CH-8006 Zürich
> Switzerland
> phone: +41-(0)1-361 66 11
> mobile: +41-(0)79-44 11 457
> mailto:gregoire.weber@switzerland.org
>
> _______________________________________________
> 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
>
--
Florent Guillaume, Nuxeo SARL (Paris, France)
+33 1 40 33 79 10 http://nuxeo.com mailto:fg@nuxeo.com