ICEfaces
  1. ICEfaces
  2. ICE-6782

Slider component resource not resolving when run as a portlet

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-EE-Beta1, 2.0.1
    • Fix Version/s: EE-2.0.0.GA, 2.0.2
    • Component/s: None
    • Labels:
      None
    • Environment:
      ICEfaces 2 portal portlet ACE slider

      Description

      The default "thumb" resources for the Slider are not properly resolving in a portlet. If we assume we have the Slider on a portal page with the following URL:

      http://localhost:8080/web/guest/ace-maint

      there are are a couple of "thumb-*" images that are being rendered out. Firebug shows 404 not found for:

      http://localhost:8080/web/guest/javax.faces.resource/assets/skins/sam/thumb-x.png.jsf?ln=yui/3_1_1
      http://localhost:8080/web/guest/javax.faces.resource/assets/skins/sam/thumb-y.png.jsf?ln=yui/3_1_1

      These URLs are missing information about the portlet namespace and other Liferay attributes. I can manually get it to resolve in the browser by taking a copy of a resource that is resolving and simply massaging it into a working one like so:

      http://localhost:8080/web/guest/ace-maint?_slider_WAR_aceshowcaseportlet_INSTANCE_R8mz_javax.faces.resource=assets/skins/sam/thumb-x.png&_slider_WAR_aceshowcaseportlet_INSTANCE_R8mz_ln=yui%2F3_1_1&p_p_cacheability=cacheLevelPage&p_p_col_count=1&p_p_col_id=column-1&p_p_id=slider_WAR_aceshowcaseportlet_INSTANCE_R8mz&p_p_lifecycle=2&p_p_mode=view&p_p_state=normal

      Looking at the SliderEntry.java class, we have the following code:

          public String getThumbUrl() {
           String thumbUrl = super.getThumbUrl();
           if (null == thumbUrl) {
           if ("x".equals(getAxis())) {
           thumbUrl = "javax.faces.resource/assets/skins/sam/thumb-x.png.jsf?ln=yui/3_3_0";
           } else {
           thumbUrl = "javax.faces.resource/assets/skins/sam/thumb-y.png.jsf?ln=yui/3_3_0";
           }
           }
           return thumbUrl;
          }

      It's not possible to simply hard code in URL references like this and have them successfully resolve. For portlets, this will miss portal specific attributes as well as the namespacing. This is particulary true in portlets but it could be relevant in a stock servlet application as well.

        Activity

        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24371 Mon Apr 11 11:37:44 MDT 2011 ken.fyten ICE-6782: Fixed mismatched YUI version string in URL (3_1_1 vs 3_3_0).
        Files Changed
        Commit graph MODIFY /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/sliderentry/SliderEntry.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24366 Fri Apr 08 17:48:40 MDT 2011 deryk.sinotte ICE-6782: fix resource resolution to that it works in portlets as well
        Files Changed
        Commit graph MODIFY /icefaces2/branches/icefaces-2.0.x-maintenance/icefaces/ace/component/src/org/icefaces/component/sliderentry/SliderEntry.java
        Commit graph MODIFY /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/sliderentry/SliderEntry.java

          People

          • Assignee:
            Ken Fyten
            Reporter:
            Deryk Sinotte
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: