ICEfaces
  1. ICEfaces
  2. ICE-7728

Avoid call to createResource during restoreState in BridgeSetup$NonTransientJavascriptResourceOutput

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: EE-3.0.0.BETA, 3.0.1
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces 3 portal

      Description

      During the work done for http://jira.icefaces.org/browse/ICE-7684, we implemented a fix to solve a problem with the ace:dateExporter component when running on a portlet. The original problem in that case was related to the following section of code:

             public void restoreState(FacesContext context, Object state) {
                  //call method from super-class to restore the component attributes first
                  super.restoreState(context, state);
                  Map attributes = getAttributes();
                  String name = (String) attributes.get("name");
                  String library = (String) attributes.get("library");
                  String version = (String) attributes.get("version");

                  ResourceHandler resourceHandler = context.getApplication().getResourceHandler();
      --> Resource r = resourceHandler.createResource(name, fixResourceParameter(library));
                  String path = r.getRequestPath();
                  if (version == null) {
                      script = path;
                  } else {
                      if (path.contains("?")) {
                          script = path + "&v=" + version;
                      } else {
                          script = path + "?v=" + version;
                      }
                  }
              }

      There are 2 reasons for evaluating and potentially removing the createResource() call during restoreState().

      1) It exposes an issue in the PortletFaces Bridge where the request wrapper we set is replaced by the original raw request and the request parameter values are lost (see ICE-7684 for more details).

      2) It may be unnecessarily performance intensive.

        Issue Links

          Activity

          Deryk Sinotte created issue -
          Hide
          Deryk Sinotte added a comment -

          Assigning to Mircea for a future release.

          Show
          Deryk Sinotte added a comment - Assigning to Mircea for a future release.
          Deryk Sinotte made changes -
          Field Original Value New Value
          Estimated Complexity Low
          Salesforce Case []
          Fix Version/s 3.1 [ 10312 ]
          Assignee Priority P2
          Assignee Mircea Toma [ mircea.toma ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #27686 Mon Feb 06 17:43:48 MST 2012 mircea.toma ICE-7728 Save calculated script URL in the component's attribute map and then restore the URL from the map instead of recreating it.
          Files Changed
          Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/java/org/icefaces/impl/event/BridgeSetup.java
          Hide
          Mircea Toma added a comment -

          Modified NonTransientJavascriptResourceOutput code to save calculated script URL in the component's attribute map and then restore the URL from the map instead of recreating it.

          Show
          Mircea Toma added a comment - Modified NonTransientJavascriptResourceOutput code to save calculated script URL in the component's attribute map and then restore the URL from the map instead of recreating it.
          Mircea Toma made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Salesforce Case []
          Fix Version/s EE-3.0.0.GA [ 10262 ]
          Fix Version/s 3.1 [ 10312 ]
          Hide
          Ken Fyten added a comment -

          Please add this to the 3.0.x-maintenance branch also for 3.0.1.

          Show
          Ken Fyten added a comment - Please add this to the 3.0.x-maintenance branch also for 3.0.1.
          Ken Fyten made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #27799 Mon Feb 13 07:58:38 MST 2012 mircea.toma ICE-7728 Save calculated script URL in the component's attribute map and then restore the URL from the map instead of recreating it.
          Files Changed
          Commit graph MODIFY /icefaces3/branches/icefaces-3.0.x-maintenance/icefaces/core/src/main/java/org/icefaces/impl/event/BridgeSetup.java
          Hide
          Mircea Toma added a comment -

          Applied patch to 3.0.x maintenance branch.

          Show
          Mircea Toma added a comment - Applied patch to 3.0.x maintenance branch.
          Mircea Toma made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Deryk Sinotte made changes -
          Link This issue blocks ICE-7713 [ ICE-7713 ]
          Ken Fyten made changes -
          Fix Version/s EE-3.0.0.BETA [ 10324 ]
          Fix Version/s 3.0.1 [ 10282 ]
          Fix Version/s EE-3.0.0.GA [ 10262 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Assignee Priority P2

            People

            • Assignee:
              Mircea Toma
              Reporter:
              Deryk Sinotte
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: