Ticket #2281 (closed defect: fixed)

Opened 9 years ago

Last modified 9 years ago

Recreate renderJS

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


There is currently no CPSDesignerThemes equivalent of the renderJS method.

Its purpose is to include in the page head element all javascript resources needed by portlets (in the case of custom portlets, this is part of the portlet fields).

Without this, CPSDesignerThemes is almost unusable for portlets requiring javascript resources. This has been tolerable up to now, because with migrated themes from CPSSkins, we had a call to CPSSkins' renderJS method, thanks to the cps URL scheme, and this works approximatively, namely as long as the theme is not edited to change slots or new portlet slots don't need any JS resource, and CPSSkins' original theme is still present.

CPSDesignerThemes' version should rely on the recently introduced request resource registry (see #837).

As a side note, there will be a difference: CPSSkins' renderJS aggregates all the needed JS code and is loaded by a single separated HTTP request, whereas the registry will trigger a request per JS file. Therefore CPSSkins better complies to recommendations of tools like  YSlow (minimizing the number of requests), which of course don't consider the server-side cost of such an aggregation. CPSSkins' renderJS has always been a pain to cache, because of its query URL part (page id).

Providing such a single request inclusion for all portlets could be a later evolution, possibly optional and more general than portlets.

Change History

comment:1 Changed 9 years ago by gracinet

  • Component changed from CPS (global) to CPSDesignerThemes

comment:2 Changed 9 years ago by gracinet

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

Done and pushed

Note: See TracTickets for help on using tickets.