Hello,

The new Five/Zope3 views ".browser.exportviews" that ContentPortlet now
uses has caused a regression for the search_type == 'related' option
of ContentPortlet.

To be more precise:

In CPSPortlets/skins/cpsportlets_widgets/getContentItems.py there is
a case for search_type == 'related' that tries to get the Subject
of the "context object". When in a web page, when
CPSPortlets/skins/cpsportlets_widgets/widget_portlet_content.pt
calls getContentItems.py, the "context object" is the container
in which the web page rendering the portlet resides.
But with the new Five/Zope3 views for the exports the portlet
is not accessed within a folder container, but directly from
the portlet container.
For example this portlet is accessed directly
http://non.aux.racketiciels.info/.cps_portlets/actu-racketiciel/rss_2_0/actu-racketiciel.rss
and there isn't any knowledge passed that this portlet export
is done from http://non.aux.racketiciels.info/

To fix this I can think of two solutions:

a) Pass an "rpath" argument to the portlet view, something like:
http://non.aux.racketiciels.info/.cps_portlets/actu-racketiciel/rss_2_0/actu-racketiciel.rss?container_rpath=sections/gdt/racketiciel-info
But that doesn't look really good.

b) Craft the URL of the Five view like
href string:${ptlurl}/${format}/${container_rpath}/${export_name}
instead of the actual
href string:${ptlurl}/${format}/${export_name}
That would give something like
http://non.aux.racketiciels.info/.cps_portlets/actu-racketiciel/rss_2_0/sections/gdt/racketiciel-info/actu-racketiciel.rss
And this looks a little better.



What do you think?

Thanks,

-- 
Marc-Aurèle DARCHE          http://cps-cms.org/
AFUL                        http://aful.org/
Association Francophone des Utilisateurs de Logiciels Libres
French speaking Libre Software Users' Association
_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel

Reply via email to