[Zope-CMF] Users are not able to add custom factory types such as CMFPhotoalbum and MeetingCMF
Tres Seaver
tseaver@palladion.com
Tue, 29 May 2001 09:34:14 -0400
jimbo wrote:
> Hi,
> Thanks that helped. I somehow overlooked the Pythonscript
> constuctor part in the portlpoll tutorial this time.
> I'm now able to add the Meeting product based on the following;
> ZObject, _ZClass_for_PortalContent, ZObjectManager,
> _ZClass_for_DefaultDublinCoreImpl.
>
> I tried to basically follow the same procedure to add another object
> into the meeting class and now get the following error.
>
> Error type: Unauthorized
> Error value: The object /tacomaplace/mtg1/Attendee, which is
> contained in "/tacomaplace/mtg1", is marked as private.
>
>
> <!--#comment-->
> Make the URL ID autogenerated
> <!--#/comment-->
> <dtml-call "REQUEST.set('ts', ZopeTime())">
> <dtml-call "REQUEST.set('Autoid',_.str(_.int(ts)))">
> <dtml-call "REQUEST.set('id', Autoid)">
>
> <Highlighted_line>
> <dtml-with "Attendee.createInObjectManager(REQUEST['id'], REQUEST)">
> </Highlighted_line>
>
> <dtml-call "propertysheets.Basic.manage_editProperties(REQUEST)">
>
>
> The portal is tacomaplace, and mtg1 is the public Meeting. I've
> tried a quick search on creating public objects in the cmf and not
> much out there. I know check the source. Can I get pointed in
> the right direction?
By the usage, 'Attendee' is a ZClass, correct? You will still need
to get its product/factory dispatchers into the context before adding
it, e.g.:
<dtml-with expr="manage_addProduct['MeetingProduct']">
<dtml-call Attendee_add>
</dtml-with>
Have a look at the URLs in the "Add" list of the ZMI: note that
most (all?) of them have the structure,
"manage_addProduct/ProductName/factoryName". This incantation is
required to get the correct contstruction / security context
established. "Product" classes (like your Meeting/Attendee, or
like CMF's Document/Link/NewsItem) can't be created directly by
through-the-web code, because TTW code can't call the methods which
"seat" them into their containers.
Tres.
--
===============================================================
Tres Seaver tseaver@digicool.com
Digital Creations "Zope Dealers" http://www.zope.org