Wicket
  1. Wicket
  2. WICKET-647 New Wicket Portlet support
  3. WICKET-651

New Wicket Portlet support: extending IHeaderResponse and its usage to allow plugging in custom HeaderResponse writing

    Details

    • Type: Sub-task Sub-task
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.0-beta2, 1.3.0-beta3
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      IHeaderResponse is used in HtmlHeaderContainer and AjaxRequesTarget for collecting header contributions to be streamed out first before the rest of the response.

      In a portal environment the real response isn't under control of a portlet and writing to the html head section of a page isn't possible (yet, Portlet API 2.0 might add some support for it).

      As a simple solution, a portlet can embed (loading external) javascript and/or css directly into the markup, but it shouldn't wrap it in a <head></head> section as HtmlHeaderContainer is doing right now.
      Furthermore, some portals might already provide some custom extensions which could allow porlets to contribute to the final page head section (Jetspeed-2 for instance does).

      To allow intercepting HeaderResponse writing, I'm extending IHeaderResponse with a close() and isClosed() methods so a plugged in HeaderResponse implementation will be able to know when the response should be flushed.
      Furthermore, I'm moving the getResponse() method up to HeaderResponse (final) and delegate it to a new protected abstract getRealResponse() method.
      Finally, the HtmlHeaderContainer will check the new RenderContext.getHeaderResponse() to see if a custom IHeaderResponse implementation should be used (the default implementation will return null).

      These changes all are non-intrusive and without any functional side-effect and could be applied to the Wicket core trunk without dependencies on the real portlet support.

        Activity

        Martin Grigorov made changes -
        Component/s wicket-portlet [ 12311803 ]
        Ate Douma made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Ate Douma added a comment -

        Through the default provided EmbeddedPortletHeaderResponse this already works quite nicely.
        I haven't even yet started integrating this in the proprietary (for now, until Portlet API 2.0) header extension of Jetspeed-2, but it doesn't even seem to really needed.
        Something to look into further once Portlet API 2.0 containers become available.

        Show
        Ate Douma added a comment - Through the default provided EmbeddedPortletHeaderResponse this already works quite nicely. I haven't even yet started integrating this in the proprietary (for now, until Portlet API 2.0) header extension of Jetspeed-2, but it doesn't even seem to really needed. Something to look into further once Portlet API 2.0 containers become available.
        Ate Douma made changes -
        Affects Version/s 1.3.0-beta3 [ 12312533 ]
        Ate Douma made changes -
        Status Resolved [ 5 ] Reopened [ 4 ]
        Resolution Fixed [ 1 ]
        Hide
        Ate Douma added a comment -

        Switching to a new 1.3.0-beta3-portlet-support branch

        Show
        Ate Douma added a comment - Switching to a new 1.3.0-beta3-portlet-support branch
        Ate Douma made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Ate Douma added a comment -

        Implemented

        Show
        Ate Douma added a comment - Implemented
        Ate Douma created issue -

          People

          • Assignee:
            Ate Douma
            Reporter:
            Ate Douma
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development