[Product-Developers] Re: content_type category portlets

Enrique Perez eperez at yaco.es
Thu Apr 15 09:07:11 UTC 2010


Martin Aspeli wrote:
> On 14 April 2010 23:22, Enrique Perez <eperez at yaco.es> wrote:
>> Hi,
>>
>> I'm trying to assign a portlet to a manager with an assignment of category
>> content_type. This is with a vanilla plone-4.0b1-1. The only addition to a
>> vanilla plone is, in the portlets.xml of the GS profile of CMFPlone,
>>
>> <assignment name="news" category="content_type" key="Folder"
>>     manager="plone.rightcolumn" type="portlets.News" visible="True">
>>   <property name="count">5</property>
>> </assignment>
>>
>> and then run the import step. However, after this (and adding a folder and a
>> news item), I cannot see the portlet in any Folder object. Inspecting the
>> portlet manager, I see that:
>>
>> ipdb> manager = getUtility(IPortletManager, name=u"plone.rightcolumn")
>> ipdb> manager['content_type']['Folder']
>> <plone.app.portlets.storage.PortletAssignmentMapping object at
>> 0x2aaaac9c57d0>
>>
>> I've got a PortletAssignmentMapping... If I delete it and add a
>> PortletCategoryMapping instead, like:
>>
>>
>> ipdb> del manager['content_type']['Folder']
>> ipdb> manager['content_type']['Folder'] = PortletCategoryMapping()
>> ipdb> from plone.app.portlets.portlets.news import Assignment
>> ipdb> manager['content_type'][u'Folder']['news'] = Assignment()
>>
>> The portlet shows properly in Folders. I'm I missing something, or is this a
>> bug?
> 
> Sounds like it.
> 
> What's the data structure if you do it TTW (types control panel)?
> What if you do it TTW and export?
> 

Thanks for the reply, even though you've managed to throw me back into 
confusion  :-)
If I do it TTW, the portlet shows right away; if I export the 
configuration, I get the exact same xml snippet as above; but if I 
inspect the manager, I see that I have, for the 
['content_type']['Folder'] keys, a PortletAssignmentMapping and not a 
PortletCategoryMapping. I'll  keep digging into the issue.


-- 
Enrique Pérez Arnaud <eperez at yaco.es>
Yaco Sistemas SL| http://www.yaco.es
C/ Rioja 5, 41001 Sevilla (España)
Tel: (+34) 954 50 00 57
Fax 954 50 09 29





More information about the Product-Developers mailing list