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

        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>
        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.
        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.
        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.
        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>
        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.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: