[Zope-CMF] Re: [dev] newstyle content creation

Charlie Clark charlie at begeistert.org
Mon Jun 30 11:35:09 EDT 2008


Am 13.05.2008 um 23:39 schrieb yuppie:

>> If a new style factory is specified in the FTI a view of that name  
>> is looked up on the adding view of the container. This is from  
>> plone.app.contentmenu.menu.FactoriesSubMenuItem:
>> addingview = queryMultiAdapter((addContext, self.request), name='+')
>> if addingview is not None:
>>    addview = queryMultiAdapter((addingview, self.request),  
>> name=fti.factory)
>>    if addview is not None:
>>        return '%s/+/%s' % (baseUrl, fti.factory,)
>
> That means view name and factory name have to be the same. The  
> portal type is not passed to the view, so it has to be hardcoded  
> inside the view. Not very flexible, but if factory and view are only  
> used for one hardcoded portal type it works.


Any more thoughts on this? I agree with you that the hardcoded  
approach above isn't nice but can't think of a nice way to square the  
circle where the add forms are registered for the container and not  
the new object.

Is it possible to do something with actions? Either by defining an  
additional category such as "add" on the objects themselves? That  
would be easy enough from the object's perspective but would conflict  
with the current lookup on the folder category. This shouldn't be too  
bad as this could be replaced by looking at the allowed_content_types.  
But I guess this might have the same complexity and performance  
problems as relying on IAdding.

Charlie
--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226





More information about the Zope-CMF mailing list