[Zope-CMF] Users are not able to add custom factory types such as CMFPhotoalbum and MeetingCMF
jimbo
jimbo@tacomaplace.com
Mon, 4 Jun 2001 12:05:41 -0700
Hello,
Bear with me a second here while I try and understand how to work with the CMF to add custom types.
>jimbo wrote:
>> I'm now able to add the Meeting product based on the following;
ManagedMeetClass based on
>> ZObject, _ZClass_for_PortalContent, ZObjectManager,
>
>> _ZClass_for_DefaultDublinCoreImpl.
>>
>> I tried to basically follow the same procedure to add another object
called Attendee
>> 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)">
>>
Seems to me this next line is getting called otherwise I would get a name error on Attendee.
>> <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>
See above problem. If the error message is telling me "Error value: The object /tacomaplace/mtg1/Attendee" Means to me the object was created, but I'm unable to view it. Seems it "is marked as private".
>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.
It looks like the CMFPhotoablum product needs to change it's constructor to reflect this. Instead of using pythonscript it uses DTML.
Thanks,
-Jimbo