Problem with the new Five/Zope3 views for feed export of the ContentPortlet
"M.-A. DARCHE" <[email protected]> Thu, 06 Oct 2011 15:34:29 +0200
| Newsgroups | gmane.comp.web.zope.cps.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello,
The new Five/Zope3 views ".browser.exportviews" that ContentPortlet now
uses has caused a regression for the search_type =3D=3D 'related' option
of ContentPortlet.
To be more precise:
In CPSPortlets/skins/cpsportlets_widgets/getContentItems.py there is
a case for search_type =3D=3D '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/act=
u-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/act=
u-racketiciel.rss?container_rpath=3Dsections/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/sec=
tions/gdt/racketiciel-info/actu-racketiciel.rss
And this looks a little better.
What do you think?
Thanks,
-- =
Marc-Aur=E8le 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