[Zope-CMF] programmatically publish content (was: Re: Advice please ....)

Norman Khine khine@btinternet.com
Fri, 17 Nov 2000 13:14:05 -0000


Hello Florent,
Thanks for this, what I was trying to do was to extend the how-to by Greg on
the CMFDefaultHotfix which changed the index_html that is generated when a
member joins to an image. What has happened since was that we ware able to
extend this and generate an index_html document and an image. So we have two
objects being added to the member folder on joining.

But what is happening is that because the image has not yet been made
published by the reviewer/manager of the portal, this image cannot display
itself within the index_html document being created. If I publish this
object, then the image renders correctly.

This leads us to this post, which solves some of the issue, but now I am
getting an error for

2001-11-17T12:57:30 ERROR(200) CMFCore.MembershipTool Error during wrapUser:

Type:Unauthorized
Value:Not authorized

Thanks

Norman

-----Original Message-----
From: zope-cmf-admin@zope.org [mailto:zope-cmf-admin@zope.org]On Behalf
Of Florent Guillaume
Sent: 17 November 2001 00:52
To: zope-cmf@zope.org
Subject: Re: [Zope-CMF] programmatically publish content (was: Re:
Advice please ....)


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

_______________________________________________
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