Tapestry 5
  1. Tapestry 5
  2. TAP5-1476

Deprecate MultiZoneUpdate, replace with an injectable service to collect zone updates

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.3
    • Fix Version/s: 5.3
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      MultiZoneUpdate presumes that there's a single place where all the zone to be updated are known. This is not necessarilly the case.

      I'd like to see something like:

      @Inject
      private ZoneUpdater zoneUpdater();

      Object onSuccess()

      { zoneUpdater.update("foo", fooBlock); zoneUpdater.update("bar", barBlock); return myZone.getBody(); }

      The main point here is that different event handlers would all be able to invoke ZoneUpdater.update() .

      This would also allow a single response to render main content (for the requesting Zone on the client) plus zone updates to named zones.

      1. zone_updater_with_zone-updater_as_return.patch
        41 kB
        Taha Hafeez
      2. zone_updater_with_zone-updater_as_return.patch
        41 kB
        Taha Hafeez
      3. zone-updater.patch
        37 kB
        Taha Hafeez

        Activity

        Hide
        Hudson added a comment -

        Integrated in tapestry-trunk-freestyle #437 (See https://builds.apache.org/job/tapestry-trunk-freestyle/437/)
        TAP5-1476: Rename methods on AjaxResponseRenderer
        Add a test for AjaxResponseRenderer.addCallback()
        Fix a bug in AjaxResponseRenderer.addCallback() where the filter did not invoke the next renderer, which prevent most of the content from being constructed
        TAP5-1476: Update the demo page for MultiZoneUpdate to use the new AjaxResponseRenderer API as well
        TAP5-1476: Work out implementation of AjaxResponseRenderer and re-implement MultiZoneUpdateEventResultProcessor to mostly work by invoking AjaxResponseRenderer methods
        TAP5-1476: Move SingleZonePartialRendererFilter to an internal package
        TAP5-1476: Mark MultiZoneUpdate as deprecated
        TAP5-1476: Mark MultiZoneUpdateEventResultProcessor as deprecated, and move it to a more appropriate internal package
        TAP5-1476: Start of work on AjaxResponseRenderer

        hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1151571
        Files :

        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/MultiZoneUpdateEventResultProcessor.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/MultiZoneUpdateDemo.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/AjaxResponseRendererImpl.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/MultiZoneUpdateDemo.js
        • /tapestry/tapestry5/trunk/tapestry-core/src/test/app1/MultiZoneUpdateDemo.tml
        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ajax/AjaxResponseRenderer.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ajax/JavaScriptCallback.java

        hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1151570
        Files :

        • /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/MultiZoneUpdateDemo.java

        hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1151569
        Files :

        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/MultiZoneUpdateEventResultProcessor.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/AjaxResponseRendererImpl.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/SingleZonePartialRendererFilter.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ajax/AjaxResponseRenderer.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ajax/JavaScriptCallback.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ajax/SetupZonesFilter.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java

        hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1151567
        Files :

        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/MultiZoneUpdateEventResultProcessor.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/SingleZonePartialRendererFilter.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ajax/SetupZonesFilter.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ajax/SingleZonePartialRendererFilter.java

        hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1151566
        Files :

        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ajax/AjaxResponseRenderer.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/ajax/MultiZoneUpdate.java

        hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1151565
        Files :

        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/MultiZoneUpdateEventResultProcessor.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageRenderQueue.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ajax/MultiZoneUpdateEventResultProcessor.java
        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java

        hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1151564
        Files :

        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ajax/AjaxResponseRenderer.java
        Show
        Hudson added a comment - Integrated in tapestry-trunk-freestyle #437 (See https://builds.apache.org/job/tapestry-trunk-freestyle/437/ ) TAP5-1476 : Rename methods on AjaxResponseRenderer Add a test for AjaxResponseRenderer.addCallback() Fix a bug in AjaxResponseRenderer.addCallback() where the filter did not invoke the next renderer, which prevent most of the content from being constructed TAP5-1476 : Update the demo page for MultiZoneUpdate to use the new AjaxResponseRenderer API as well TAP5-1476 : Work out implementation of AjaxResponseRenderer and re-implement MultiZoneUpdateEventResultProcessor to mostly work by invoking AjaxResponseRenderer methods TAP5-1476 : Move SingleZonePartialRendererFilter to an internal package TAP5-1476 : Mark MultiZoneUpdate as deprecated TAP5-1476 : Mark MultiZoneUpdateEventResultProcessor as deprecated, and move it to a more appropriate internal package TAP5-1476 : Start of work on AjaxResponseRenderer hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1151571 Files : /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/MultiZoneUpdateEventResultProcessor.java /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/MultiZoneUpdateDemo.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/AjaxResponseRendererImpl.java /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java /tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/MultiZoneUpdateDemo.js /tapestry/tapestry5/trunk/tapestry-core/src/test/app1/MultiZoneUpdateDemo.tml /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ajax/AjaxResponseRenderer.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ajax/JavaScriptCallback.java hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1151570 Files : /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/MultiZoneUpdateDemo.java hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1151569 Files : /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/MultiZoneUpdateEventResultProcessor.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/AjaxResponseRendererImpl.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/SingleZonePartialRendererFilter.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ajax/AjaxResponseRenderer.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ajax/JavaScriptCallback.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ajax/SetupZonesFilter.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1151567 Files : /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/MultiZoneUpdateEventResultProcessor.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/SingleZonePartialRendererFilter.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ajax/SetupZonesFilter.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ajax/SingleZonePartialRendererFilter.java hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1151566 Files : /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ajax/AjaxResponseRenderer.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/ajax/MultiZoneUpdate.java hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1151565 Files : /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ajax/MultiZoneUpdateEventResultProcessor.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageRenderQueue.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ajax/MultiZoneUpdateEventResultProcessor.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1151564 Files : /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/ajax/AjaxResponseRenderer.java
        Hide
        Howard M. Lewis Ship added a comment -

        Sorry I didn't use your patch, but I think you'll like the end result.

        Show
        Howard M. Lewis Ship added a comment - Sorry I didn't use your patch, but I think you'll like the end result.
        Hide
        Taha Hafeez added a comment -

        Granted license

        Show
        Taha Hafeez added a comment - Granted license
        Hide
        Taha Hafeez added a comment -

        Added AjaxUpdaterEventRequestProcessor for handling ZoneUpdater as return value from ajax request. Please see http://tapestry.1045711.n5.nabble.com/Re-jira-Updated-TAP5-1476-Deprecate-MultiZoneUpdate-replace-with-an-injectable-service-to-collect-zos-tp4556067p4556114.html

        Show
        Taha Hafeez added a comment - Added AjaxUpdaterEventRequestProcessor for handling ZoneUpdater as return value from ajax request. Please see http://tapestry.1045711.n5.nabble.com/Re-jira-Updated-TAP5-1476-Deprecate-MultiZoneUpdate-replace-with-an-injectable-service-to-collect-zos-tp4556067p4556114.html
        Hide
        Taha Hafeez added a comment -

        Patch which injects a ZoneUpdater into the Environment. The processing is done by ZoneUpdaterProcessor. Does a modification to AjaxComponentEventRequestHandler.java

        Show
        Taha Hafeez added a comment - Patch which injects a ZoneUpdater into the Environment. The processing is done by ZoneUpdaterProcessor. Does a modification to AjaxComponentEventRequestHandler.java
        Hide
        Tom van Dijk added a comment -

        Okay, what if I have an actionLink without a zone parameter and I simply want to update zones depending on server state?
        And what if sometimes I just update no zones at all?

        Show
        Tom van Dijk added a comment - Okay, what if I have an actionLink without a zone parameter and I simply want to update zones depending on server state? And what if sometimes I just update no zones at all?

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Howard M. Lewis Ship
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development