ICEfaces
  1. ICEfaces
  2. ICE-5562

Download Resource component on Component-showcase Facelet-enhanced does not work as expected

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.2-EE-GA_P02
    • Fix Version/s: 1.8.2-EE-GA_P01, 1.8.3
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      Component-showcase Facelet-enhanced version only
    • Assignee Priority:
      P1

      Description

      Download Resource component on Component-showcase Facelet-enhanced does not work as expected.
      Try to download a pdf file resource with a dynamic filename(FF.pdf), Following is seen:

      "Could not find resource at /component-showcase/block/resource/MTYxMjU0MDAwMw==/ff.pdf"

        Activity

        Hide
        Mark Collette added a comment -

        This also does not work with the regular Facelets component-showcase, it just fails differently. With Facelets-enhanced, when you change the name of the file, it fails to register that resource, so the file is not found. With Facelets, when you go to change the name of the file, it simply does not change the resource link, so it can still find and download the old, now incorrect, file name.

        Show
        Mark Collette added a comment - This also does not work with the regular Facelets component-showcase, it just fails differently. With Facelets-enhanced, when you change the name of the file, it fails to register that resource, so the file is not found. With Facelets, when you go to change the name of the file, it simply does not change the resource link, so it can still find and download the old, now incorrect, file name.
        Hide
        Mark Collette added a comment -

        With the Facelets case, made it detect when a file name change has happened, and deregister the old resource, and register it anew, with the new file name, which then gets the new path to be rendered, reflecting the changes.

        Show
        Mark Collette added a comment - With the Facelets case, made it detect when a file name change has happened, and deregister the old resource, and register it anew, with the new file name, which then gets the new path to be rendered, reflecting the changes.
        Hide
        Mark Collette added a comment -

        The Facelets-enhanced code path is different, because it is in a UIData container, while the Facelets example is not. OutputResource treats these as different cases.

        Show
        Mark Collette added a comment - The Facelets-enhanced code path is different, because it is in a UIData container, while the Facelets example is not. OutputResource treats these as different cases.
        Hide
        Mark Collette added a comment -

        Backed off on the de-registering/re-registering approach, and added a way for the resource registry to detect, when a Resource is being registered, that's already been registered, when the file name has changed, and update all the dispatching to work with the new file name. Then changed OutputResource to always be registering resources, even when they're previously been registered, to allow the update to occur. The reality is that we can't detect all the scenarios of Resource objects changing, so focusing on optimisations to not register old Resource objects is pointless. The cost is just the CPU/time of calculating the digest, which were were incurring anyway.

        Tested against ICE-5422, to ensure was not introducing a regression there.

        icefaces-ee-1.8.2_P01
        Subversion 21130
        icefaces\icefaces\component\src\com\icesoft\faces\component\outputresource\OutputResource.java
        icefaces\icefaces\core\src\com\icesoft\faces\webapp\http\common\standard\ModifiablePathDispatcherServer.java
        icefaces\icefaces\core\src\com\icesoft\faces\webapp\http\core\ResourceDispatcher.java

        TRUNK
        Subversion 21131
        icefaces\icefaces\component\src\com\icesoft\faces\component\outputresource\OutputResource.java
        icefaces\icefaces\core\src\com\icesoft\faces\webapp\http\common\standard\ModifiablePathDispatcherServer.java
        icefaces\icefaces\core\src\com\icesoft\faces\webapp\http\core\ResourceDispatcher.java

        Show
        Mark Collette added a comment - Backed off on the de-registering/re-registering approach, and added a way for the resource registry to detect, when a Resource is being registered, that's already been registered, when the file name has changed, and update all the dispatching to work with the new file name. Then changed OutputResource to always be registering resources, even when they're previously been registered, to allow the update to occur. The reality is that we can't detect all the scenarios of Resource objects changing, so focusing on optimisations to not register old Resource objects is pointless. The cost is just the CPU/time of calculating the digest, which were were incurring anyway. Tested against ICE-5422 , to ensure was not introducing a regression there. icefaces-ee-1.8.2_P01 Subversion 21130 icefaces\icefaces\component\src\com\icesoft\faces\component\outputresource\OutputResource.java icefaces\icefaces\core\src\com\icesoft\faces\webapp\http\common\standard\ModifiablePathDispatcherServer.java icefaces\icefaces\core\src\com\icesoft\faces\webapp\http\core\ResourceDispatcher.java TRUNK Subversion 21131 icefaces\icefaces\component\src\com\icesoft\faces\component\outputresource\OutputResource.java icefaces\icefaces\core\src\com\icesoft\faces\webapp\http\common\standard\ModifiablePathDispatcherServer.java icefaces\icefaces\core\src\com\icesoft\faces\webapp\http\core\ResourceDispatcher.java
        Hide
        Joanne Bai added a comment -

        Verified with success during the release testing cycle.

        Show
        Joanne Bai added a comment - Verified with success during the release testing cycle.

          People

          • Assignee:
            Mark Collette
            Reporter:
            Mandeep Hayher
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: