Ticket #2283 (closed defect: fixed)

Opened 9 years ago

Last modified 9 years ago

Portlet exports frail and not pluggable enough

Reported by: gracinet Owned by: gracinet
Priority: P2 Milestone: CPS 3.5.2
Component: CPSPortlets Version: 3.5.1
Severity: normal Keywords:
Cc:

Description

These exports are currently mostly used for syndication (rss export, atom export), but could be more general : podcasts (actually an extension of rss 2.0), playlists, custom xml formats for various ajax based renderings (rotating images, e,g).

To create a new export, one must override cps_portlet_macros which defines all of them, and that is not convenient. A zope.component approach would be better.

Also, the export goes through the whole CPSDocument rendering (layouts etc.). This way too expensive, and it's really hard to guarantee that they won't start with a blank line (breaking XML validity), although CPSDocument currently does a strip(), precisely to avoid that, or more generally introduce a typical HTML tag around.

Change History

comment:1 Changed 9 years ago by gracinet

Done and pushed : full rewriting in Zope 3/ZTK style, for Content Portlet only. I believe the result to be much cleaner and easier to extend.

To define a new export, one has to subclass Products.CPSPortlets.exportviews.BaseExport and mimic the declarations from CPSPortlets' browser/configure.zcml.

The syndication links of Content Portlet have been switched to these new-style exports. The old methods and links should be considered as deprecated, but they must stay around, in order not to break people's feed readers subscriptions.

comment:2 Changed 9 years ago by gracinet

A remaining issue with existing portlets : the folder_path parameter of Content Portlet is a relative path, but it may (or even must) start with a slash. The new-style export helper does not accept a leading slash.

comment:3 Changed 9 years ago by gracinet

  • Status changed from new to closed
  • Resolution set to fixed

This latest issue has been fixed a while ago. Otherwise it works really well.

Note: See TracTickets for help on using tickets.