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

        Hide
        Deryk Sinotte added a comment -

        Assigning to Ken for discussion with component team.

        Show
        Deryk Sinotte added a comment - Assigning to Ken for discussion with component team.
        Hide
        Ken Fyten added a comment -

        The commit for svn rev. # 24366 to icefaces2/trunk has resulted in the SliderEntry demo in ace-showcase failing violently with the following errors:

        WARNING: JSF1064: Unable to find or serve resource, assets/skins/sam/thumb-x.png, from library, yui/3_1_1.
        Apr 11, 2011 10:39:17 AM com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException
        SEVERE: Error Rendering View[/sliderEntry.xhtml]
        java.lang.NullPointerException
        at org.icefaces.component.sliderentry.SliderEntry.getThumbUrl(SliderEntry.java:104)
        at org.icefaces.component.sliderentry.SliderEntryRenderer.encodeBegin(SliderEntryRenderer.java:185)
        at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:820)
        at org.icefaces.component.sliderentry.SliderEntry.encodeBegin(SliderEntry.java:47)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1754)
        at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
        at org.icefaces.impl.renderkit.RendererWrapper.encodeChildren(RendererWrapper.java:54)
        at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
        at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304)
        at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105)
        at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
        at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304)
        at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105)
        at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
        at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304)
        at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105)
        at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
        at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304)
        at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105)
        at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759)
        at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:401)
        at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
        at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:410)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:680)

        ( NOTE that the icefaces2/branches/icefaces-2.0.x-maintenance commit seems fine, however ).

        Show
        Ken Fyten added a comment - The commit for svn rev. # 24366 to icefaces2/trunk has resulted in the SliderEntry demo in ace-showcase failing violently with the following errors: WARNING: JSF1064: Unable to find or serve resource, assets/skins/sam/thumb-x.png, from library, yui/3_1_1. Apr 11, 2011 10:39:17 AM com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException SEVERE: Error Rendering View [/sliderEntry.xhtml] java.lang.NullPointerException at org.icefaces.component.sliderentry.SliderEntry.getThumbUrl(SliderEntry.java:104) at org.icefaces.component.sliderentry.SliderEntryRenderer.encodeBegin(SliderEntryRenderer.java:185) at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:820) at org.icefaces.component.sliderentry.SliderEntry.encodeBegin(SliderEntry.java:47) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1754) at javax.faces.render.Renderer.encodeChildren(Renderer.java:168) at org.icefaces.impl.renderkit.RendererWrapper.encodeChildren(RendererWrapper.java:54) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304) at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304) at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304) at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304) at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759) at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:401) at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:410) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:680) ( NOTE that the icefaces2/branches/icefaces-2.0.x-maintenance commit seems fine, however ).
        Hide
        Ken Fyten added a comment -

        Fixed mismatched YUI version string in URL (3_1_1 vs 3_3_0):

        [11:38:09] - svn commit -m "ICE-6782: Fixed mismatched YUI version string in URL (3_1_1 vs 3_3_0)." 1 item(s)
        [11:38:09] - Sending /Users/Ken/Code/svn/icefaces2/icefaces/ace/component/src/org/icefaces/component/sliderentry/SliderEntry.java
        [11:38:09] - Transmitting file data.
        [11:38:10] - Refreshing files state...
        [11:38:10] - Refresh done
        [11:38:10] - Committed revision 24371

        Show
        Ken Fyten added a comment - Fixed mismatched YUI version string in URL (3_1_1 vs 3_3_0): [11:38:09] - svn commit -m " ICE-6782 : Fixed mismatched YUI version string in URL (3_1_1 vs 3_3_0)." 1 item(s) [11:38:09] - Sending /Users/Ken/Code/svn/icefaces2/icefaces/ace/component/src/org/icefaces/component/sliderentry/SliderEntry.java [11:38:09] - Transmitting file data. [11:38:10] - Refreshing files state... [11:38:10] - Refresh done [11:38:10] - Committed revision 24371

          People

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

            Dates

            • Created:
              Updated:
              Resolved: