ICEfaces-EE
  1. ICEfaces-EE
  2. IPCK-475

Some EE-specific resources get loaded multiple times with portlets

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-3.3.0.GA
    • Fix Version/s: EE-3.3.0.GA_P01
    • Component/s: Core Extensions
    • Labels:
      None
    • Environment:
      Portal portlet
    • Assignee Priority:
      P1

      Description

      Using and EE release, if you run any of the portlet examples, you'll notice resource loading issues when running multiple portlets on the same page. Most resources (e.g. jsf.js) only get loaded once. But EE resources like mobi.js and icefaces-ee.js get loaded once for each portlet.

        Activity

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

        To reproduce, run the chat-portlet example from EE 3.3 (or P01) on Liferay and review the resources added to the <head>. I see an instance of mobi.js and icefaces-ee.js per portlet. Other resources only appear once:

        Single Chat Instance on the page

        I pared down the resource scripts in the <head> to just our stuff (and removed any Liferay-specific attributes to make things easier to read). This set of scripts is for one chat portlet on the page. Basically one copy of everything except for the isHeadUpdateSuccessful setting. The mobi and icefaces-ee scripts are also missing a library name but that may or may not be important.

        <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_zj0IzXyYVXgj_javax.faces.resource=jsf.js&amp;_chatice2portlet_WAR_chatportlet_INSTANCE_zj0IzXyYVXgj_ln=javax.faces" type="text/javascript"></script>
        
        <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_zj0IzXyYVXgj_javax.faces.resource=bridge.js&amp;_chatice2portlet_WAR_chatportlet_INSTANCE_zj0IzXyYVXgj_ln=ice.core" type="text/javascript"></script>
        
        <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_zj0IzXyYVXgj_javax.faces.resource=icepush.js&amp;_chatice2portlet_WAR_chatportlet_INSTANCE_zj0IzXyYVXgj_ln=ice.push" type="text/javascript"></script>
        
        <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_zj0IzXyYVXgj_javax.faces.resource=icefaces-ee.js" type="text/javascript"></script>
        
        <script type="text/javascript">/*<![CDATA[*/document.documentElement.isHeadUpdateSuccessful=true;/*]]>*/</script>
        
        <script type="text/javascript">/*<![CDATA[*/document.documentElement.isHeadUpdateSuccessful=true;/*]]>*/</script>
        
        <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_zj0IzXyYVXgj_javax.faces.resource=mobi.js" type="text/javascript"></script> 
        

        Two Chat Instances on the page

        When I add a second chat instance, we can see some issues:

        • the icefaces-ee and mobi scripts showing up twice - properly namespaced for each separate portlet
        • no more isHeadUpdateSuccessful - just empty scripts
        <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_xrFWk5UMebWH_javax.faces.resource=jsf.js&amp;_chatice2portlet_WAR_chatportlet_INSTANCE_xrFWk5UMebWH_ln=javax.faces" type="text/javascript"></script>
        
        <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_xrFWk5UMebWH_javax.faces.resource=bridge.js&amp;_chatice2portlet_WAR_chatportlet_INSTANCE_xrFWk5UMebWH_ln=ice.core" type="text/javascript"></script>
        
        <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_xrFWk5UMebWH_javax.faces.resource=icepush.js&amp;_chatice2portlet_WAR_chatportlet_INSTANCE_xrFWk5UMebWH_ln=ice.push" type="text/javascript"></script>
        
        <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_xrFWk5UMebWH_javax.faces.resource=icefaces-ee.js" type="text/javascript"></script>
        
        <script type="text/javascript"></script>
        
        <script type="text/javascript"></script>
        
        <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_xrFWk5UMebWH_javax.faces.resource=mobi.js" type="text/javascript"></script><style type="text/css"></style>
        
        <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_zj0IzXyYVXgj_javax.faces.resource=icefaces-ee.js" type="text/javascript"></script>
        
        <script type="text/javascript"></script>
        
        <script type="text/javascript"></script>
        
        <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_zj0IzXyYVXgj_javax.faces.resource=mobi.js" type="text/javascript"></script>
        
        
        Show
        Deryk Sinotte added a comment - To reproduce, run the chat-portlet example from EE 3.3 (or P01) on Liferay and review the resources added to the <head>. I see an instance of mobi.js and icefaces-ee.js per portlet. Other resources only appear once: Single Chat Instance on the page I pared down the resource scripts in the <head> to just our stuff (and removed any Liferay-specific attributes to make things easier to read). This set of scripts is for one chat portlet on the page. Basically one copy of everything except for the isHeadUpdateSuccessful setting. The mobi and icefaces-ee scripts are also missing a library name but that may or may not be important. <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_zj0IzXyYVXgj_javax.faces.resource=jsf.js&amp;_chatice2portlet_WAR_chatportlet_INSTANCE_zj0IzXyYVXgj_ln=javax.faces" type="text/javascript"></script> <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_zj0IzXyYVXgj_javax.faces.resource=bridge.js&amp;_chatice2portlet_WAR_chatportlet_INSTANCE_zj0IzXyYVXgj_ln=ice.core" type="text/javascript"></script> <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_zj0IzXyYVXgj_javax.faces.resource=icepush.js&amp;_chatice2portlet_WAR_chatportlet_INSTANCE_zj0IzXyYVXgj_ln=ice.push" type="text/javascript"></script> <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_zj0IzXyYVXgj_javax.faces.resource=icefaces-ee.js" type="text/javascript"></script> <script type="text/javascript">/*<![CDATA[*/document.documentElement.isHeadUpdateSuccessful=true;/*]]>*/</script> <script type="text/javascript">/*<![CDATA[*/document.documentElement.isHeadUpdateSuccessful=true;/*]]>*/</script> <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_zj0IzXyYVXgj_javax.faces.resource=mobi.js" type="text/javascript"></script> Two Chat Instances on the page When I add a second chat instance, we can see some issues: the icefaces-ee and mobi scripts showing up twice - properly namespaced for each separate portlet no more isHeadUpdateSuccessful - just empty scripts <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_xrFWk5UMebWH_javax.faces.resource=jsf.js&amp;_chatice2portlet_WAR_chatportlet_INSTANCE_xrFWk5UMebWH_ln=javax.faces" type="text/javascript"></script> <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_xrFWk5UMebWH_javax.faces.resource=bridge.js&amp;_chatice2portlet_WAR_chatportlet_INSTANCE_xrFWk5UMebWH_ln=ice.core" type="text/javascript"></script> <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_xrFWk5UMebWH_javax.faces.resource=icepush.js&amp;_chatice2portlet_WAR_chatportlet_INSTANCE_xrFWk5UMebWH_ln=ice.push" type="text/javascript"></script> <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_xrFWk5UMebWH_javax.faces.resource=icefaces-ee.js" type="text/javascript"></script> <script type="text/javascript"></script> <script type="text/javascript"></script> <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_xrFWk5UMebWH_javax.faces.resource=mobi.js" type="text/javascript"></script><style type="text/css"></style> <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_zj0IzXyYVXgj_javax.faces.resource=icefaces-ee.js" type="text/javascript"></script> <script type="text/javascript"></script> <script type="text/javascript"></script> <script src="http://localhost:8080/web/guest/chat?_chatice2portlet_WAR_chatportlet_INSTANCE_zj0IzXyYVXgj_javax.faces.resource=mobi.js" type="text/javascript"></script>
        Ken Fyten made changes -
        Field Original Value New Value
        Assignee Ken Fyten [ ken.fyten ] Mircea Toma [ mircea.toma ]
        Fix Version/s EE-3.3.0.GA_P01 [ 11173 ]
        Affects Version/s EE-3.3.0.GA_P01 [ 11173 ]
        Assignee Priority P1 [ 10010 ]
        Hide
        Mircea Toma added a comment -

        Use ice.core.ee library name for the icefaces-ee.js to force portlet bridge to take into account the resource. For some reason the portlet bridge cannot identify resources without a library name but having the same name as being the same resource.

        Show
        Mircea Toma added a comment - Use ice.core.ee library name for the icefaces-ee.js to force portlet bridge to take into account the resource. For some reason the portlet bridge cannot identify resources without a library name but having the same name as being the same resource.
        Hide
        Mircea Toma added a comment -

        Replaced dynamic resources BridgeSetup.TestScript and BridgeSetup.CoreCSSOutput with normal resources that can be located in the jar. This makes the portlet bridge match the multiple resource instances and load the resource just once.

        Show
        Mircea Toma added a comment - Replaced dynamic resources BridgeSetup.TestScript and BridgeSetup.CoreCSSOutput with normal resources that can be located in the jar. This makes the portlet bridge match the multiple resource instances and load the resource just once.
        Mircea Toma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Mircea Toma added a comment -

        Forward ported to the trunk code the changes made in BridgeSetup.

        Show
        Mircea Toma added a comment - Forward ported to the trunk code the changes made in BridgeSetup.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #37452 Tue Aug 20 11:49:44 MDT 2013 mircea.toma IPCK-475 Replaced dynamic resources BridgeSetup.TestScript and BridgeSetup.CoreCSSOutput with normal resources that can be located in the jar. This makes the portlet bridge match the multiple resource instances and load the resource just once.
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/java/org/icefaces/impl/event/BridgeSetup.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/resources/META-INF/resource-dependency.xml
        Commit graph ADD /icefaces3/trunk/icefaces/core/src/main/resources/META-INF/resources/ice.core/core.css
        Commit graph ADD /icefaces3/trunk/icefaces/core/src/main/resources/META-INF/resources/ice.core/head-update-test.js
        Hide
        Mircea Toma added a comment -

        Forward ported to the EE trunk code the changes made for icefaces-ee.js resource.

        Show
        Mircea Toma added a comment - Forward ported to the EE trunk code the changes made for icefaces-ee.js resource.
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Assignee Mircea Toma [ mircea.toma ] Deryk Sinotte [ deryk.sinotte ]
        Hide
        Deryk Sinotte added a comment -

        Looks like it's mostly working. When running the showcase-portlet from the PO1 tag, I now see the following ICEfaces resources in the <head>. The only remaining resource that appears multiple times is mobi.js:

        Note: The output has been modified to be more readable.

        <link rel="stylesheet" type="text/css" href="[host and path]?portlet1_javax.faces.resource=jquery%2Fui%2Fjquery-ui.css&_portlet1_ln=icefaces.ace">
        
        <link rel="stylesheet" type="text/css" href="[host and path]?portlet1_javax.faces.resource=themes%2Fsam%2Ftheme.css&_portlet1_ln=icefaces.ace">
        
        <link rel="stylesheet" type="text/css" href="[host and path]?portlet1_javax.faces.resource=util%2Fcombined.css&_portlet1_ln=icefaces.ace">
        
        <link rel="stylesheet" type="text/css" href="[host and path]?portlet1_javax.faces.resource=override_styles.css&_portlet1_ln=ice.samples.showcase">
        
        <link rel="stylesheet" type="text/css" href="[host and path]?portlet1_javax.faces.resource=demo_template.css&_portlet1_ln=ice.samples.showcase">
        
        <link rel="stylesheet" type="text/css" href="[host and path]?portlet1_javax.faces.resource=showcase_styles.css&_portlet1_ln=ice.samples.showcase">
        
        <link rel="stylesheet" type="text/css" href="[host and path]?portlet1_javax.faces.resource=core.css&_portlet1_ln=ice.core">
        
        <script src="[host and path]?portlet1_javax.faces.resource=jsf.js&_portlet1_ln=javax.faces&_portlet1_stage=Development" type="text/javascript"></script>
        
        <script src="[host and path]?portlet1_javax.faces.resource=bridge.uncompressed.js&_portlet1_ln=ice.core" type="text/javascript"></script>
        
        <script src="[host and path]?portlet1_javax.faces.resource=icepush.uncompressed.js&_portlet1_ln=ice.push" type="text/javascript"></script>
        
        <script src="[host and path]?portlet1_javax.faces.resource=util%2Face-jquery.uncompressed.js&_portlet1_ln=icefaces.ace" type="text/javascript"></script>
        
        <script src="[host and path]?portlet1_javax.faces.resource=compat.uncompressed.js&_portlet1_ln=ice.compat" type="text/javascript"></script>
        
        <script src="[host and path]?portlet1_javax.faces.resource=icefaces-ee.js&_portlet1_ln=ice.core.ee" type="text/javascript"></script>
        
        <script src="[host and path]?portlet1_javax.faces.resource=head-update-test.js&_portlet1_ln=ice.core" type="text/javascript"></script>
        
        <script src="[host and path]?portlet1_javax.faces.resource=util%2Face-components.uncompressed.js&_portlet1_ln=icefaces.ace" type="text/javascript"></script>
        
        <script src="[host and path]?portlet1_javax.faces.resource=icefaces-compat.uncompressed.js&_portlet1_ln=ice.compat" type="text/javascript"></script>
        
        <script src="[host and path]?portlet1_javax.faces.resource=util%2Face-datatable.uncompressed.js&_portlet1_ln=icefaces.ace" type="text/javascript"></script>
        
        <script src="[host and path]?portlet1_javax.faces.resource=mobi.js" type="text/javascript"></script>
        
        <script src="[host and path]?portlet2_javax.faces.resource=mobi.js" type="text/javascript"></script> 
        
        Show
        Deryk Sinotte added a comment - Looks like it's mostly working. When running the showcase-portlet from the PO1 tag, I now see the following ICEfaces resources in the <head>. The only remaining resource that appears multiple times is mobi.js: Note: The output has been modified to be more readable. <link rel="stylesheet" type="text/css" href="[host and path]?portlet1_javax.faces.resource=jquery%2Fui%2Fjquery-ui.css&_portlet1_ln=icefaces.ace"> <link rel="stylesheet" type="text/css" href="[host and path]?portlet1_javax.faces.resource=themes%2Fsam%2Ftheme.css&_portlet1_ln=icefaces.ace"> <link rel="stylesheet" type="text/css" href="[host and path]?portlet1_javax.faces.resource=util%2Fcombined.css&_portlet1_ln=icefaces.ace"> <link rel="stylesheet" type="text/css" href="[host and path]?portlet1_javax.faces.resource=override_styles.css&_portlet1_ln=ice.samples.showcase"> <link rel="stylesheet" type="text/css" href="[host and path]?portlet1_javax.faces.resource=demo_template.css&_portlet1_ln=ice.samples.showcase"> <link rel="stylesheet" type="text/css" href="[host and path]?portlet1_javax.faces.resource=showcase_styles.css&_portlet1_ln=ice.samples.showcase"> <link rel="stylesheet" type="text/css" href="[host and path]?portlet1_javax.faces.resource=core.css&_portlet1_ln=ice.core"> <script src="[host and path]?portlet1_javax.faces.resource=jsf.js&_portlet1_ln=javax.faces&_portlet1_stage=Development" type="text/javascript"></script> <script src="[host and path]?portlet1_javax.faces.resource=bridge.uncompressed.js&_portlet1_ln=ice.core" type="text/javascript"></script> <script src="[host and path]?portlet1_javax.faces.resource=icepush.uncompressed.js&_portlet1_ln=ice.push" type="text/javascript"></script> <script src="[host and path]?portlet1_javax.faces.resource=util%2Face-jquery.uncompressed.js&_portlet1_ln=icefaces.ace" type="text/javascript"></script> <script src="[host and path]?portlet1_javax.faces.resource=compat.uncompressed.js&_portlet1_ln=ice.compat" type="text/javascript"></script> <script src="[host and path]?portlet1_javax.faces.resource=icefaces-ee.js&_portlet1_ln=ice.core.ee" type="text/javascript"></script> <script src="[host and path]?portlet1_javax.faces.resource=head-update-test.js&_portlet1_ln=ice.core" type="text/javascript"></script> <script src="[host and path]?portlet1_javax.faces.resource=util%2Face-components.uncompressed.js&_portlet1_ln=icefaces.ace" type="text/javascript"></script> <script src="[host and path]?portlet1_javax.faces.resource=icefaces-compat.uncompressed.js&_portlet1_ln=ice.compat" type="text/javascript"></script> <script src="[host and path]?portlet1_javax.faces.resource=util%2Face-datatable.uncompressed.js&_portlet1_ln=icefaces.ace" type="text/javascript"></script> <script src="[host and path]?portlet1_javax.faces.resource=mobi.js" type="text/javascript"></script> <script src="[host and path]?portlet2_javax.faces.resource=mobi.js" type="text/javascript"></script>
        Ken Fyten made changes -
        Assignee Deryk Sinotte [ deryk.sinotte ] Mircea Toma [ mircea.toma ]
        Hide
        Mircea Toma added a comment -

        Use ice.push.ee library name for the mobi.js to force the portlet bridge into referencing only once the resource. Added resource dependency metadata so that mobi.js is loaded after icepush.js. Introduced resource handler that can create compressed or uncompressed version for mobi.js.

        Show
        Mircea Toma added a comment - Use ice.push.ee library name for the mobi.js to force the portlet bridge into referencing only once the resource. Added resource dependency metadata so that mobi.js is loaded after icepush.js. Introduced resource handler that can create compressed or uncompressed version for mobi.js.
        Hide
        Mircea Toma added a comment -

        Use ice.push.ee library name for the mobi.js to force the portlet bridge into referencing only once the resource. Added resource dependency metadata so that mobi.js is loaded after icepush.js. Introduced resource handler that can create compressed or uncompressed version for mobi.js.

        Show
        Mircea Toma added a comment - Use ice.push.ee library name for the mobi.js to force the portlet bridge into referencing only once the resource. Added resource dependency metadata so that mobi.js is loaded after icepush.js. Introduced resource handler that can create compressed or uncompressed version for mobi.js.
        Hide
        Mircea Toma added a comment -

        Applied changes to 3.3.0_P01 branch as well.

        Show
        Mircea Toma added a comment - Applied changes to 3.3.0_P01 branch as well.
        Mircea Toma made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: