[Zope-PTK] PTK

Steve Alexander steve@cat-box.net
Sat, 17 Jun 2000 10:02:12 +0100


Tres Seaver wrote:
> 
> > A further question to the PTK:
> > As a standard, the documents created by a user are in his
> > member-directory and must be activated by a reviewer.
> > But in my Intranet-Solution I try to setup a hirarcical structure
> > and some users in the role of redakteures are made dokuments in a
> > specified folder or subfolder. To do this, I must setup some wizards
> > and templates.
> >
> > Can you give me some ideas for the rights way to do this?
> 
> Two things:
> 
> * The PTK has a role, "Contributor," which is allows the user holding
>   it to publish content without an "outside" review (obviously, you
>   would limit this role to "trusted" users).

I needed to have one particular PortalContent type that was always
available for all Members to add, and have instantly made public. 

I didn't want to make all Members into Contributors, because there are
other PortalContent types that I want to go through the review process.

I also wanted this PortalContent type to automatically choose its own
ID, if its ID was set to "auto", or not given.

Here's my solution, from the end of the addFoo() function:

    if id == 'auto' or id == None:
        id = int(DateTime().timeTime())
        while hasattr(self, str(id)):
            id = id +1
        id = 'foo-%06d' % id    
    o.id = id
    self._setObject(id,o)
    self._getOb(id)._review_action('made public', 'published', 'no need
to review', REQUEST)

    if RESPONSE is not None:
        RESPONSE.redirect(self.absolute_url()+'/'+id)


A question for the future of PTK: Should we be able to make different
PortalContent types have different reviewing policies? What is the best
way of decoupling the reviewing policy from the content type?

See also here: http://www.zope.org/Products/PTK/ZWiki/ReviewRevamp

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net