3 Replies Latest reply on Oct 28, 2013 2:53 AM by vstorm83

    merged.js - issue in production mode

    poornima.abhi

      Hi All,

       

      I have a web application deployed in GateIn 3.2. It works fine with Ext js 3.2 .Recently i upgraded Exj js library from 3.2 to 3.4.It works fine in development mode with -Dexo.product.developing=true.

      But when deployed in production mode, -Dexo.product.developing=false, merged.js gives java-script issues.

      At this point i cant maximize minimize portlets  and the menu drop down is also not appearing correctly..

      javascript error in my firebug console is given bellow

       

      Type Error: eXo.portal.UIPortal is undefined


      What could be wrong?? In gatein-resources.xml, i have not changed the ext js priority.It is same as before, when ext js 3.2 was used. Do i have to change any configuration?


      Thanks in advance..


      gatein-resources.xml is given below.(Marked ext related configurations in bold)


      <?xml version="1.0" encoding="UTF-8"?>

      <gatein-resources

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_resources_1_1 http://www.gatein.org/xml/ns/gatein_resources_1_1"

          xmlns="http://www.gatein.org/xml/ns/gatein_resources_1_1">

       

          <javascript>

                <param>

                   <js-module>popupJS</js-module>

                   <js-path>/javascript/popup/popup.js</js-path>

                   <js-priority>1</js-priority>

               </param>

               <param>

                   <js-module>validateSessionJS</js-module>

                   <js-path>/javascript/commons/validateSession.js</js-path>

                   <js-priority>1</js-priority>

               </param>

              <param>

                   <js-module>extbaseJS</js-module>

                   <js-path>/javascript/lib/ext-2.1/adapter/ext/ext-base.js</js-path>

                   <js-priority>1</js-priority>

               </param>

               <param>

                   <js-module>extallJS</js-module>

                   <js-path>/javascript/lib/ext-2.1/ext-all.js</js-path>

                   <js-priority>2</js-priority>

               </param>

               <param>

                   <js-module>extcommonsJS</js-module>

                   <js-path>/javascript/commons/extCommons.js</js-path>

                   <js-priority>3</js-priority>

               </param>

                <param>

                   <js-module>dateJS</js-module>

                   <js-path>/javascript/date/date.js</js-path>

                   <js-priority>2</js-priority>

               </param>

               <param>

                   <js-module>extcalendarJS</js-module>

                   <js-path>/javascript/commons/extcalendar.js</js-path>

                   <js-priority>2</js-priority>

               </param>

             <param>

                   <js-module>cismstableJS</js-module>

                   <js-path>/javascript/tables/cismstable.js</js-path>

                   <js-priority>1</js-priority>

               </param>

                <param>

                   <js-module>viewJS</js-module>

                   <js-path>/javascript/tables/view.js</js-path>

                   <js-priority>1</js-priority>

               </param>

               <param>

                   <js-module>validationJS</js-module>

                   <js-path>/javascript/commons/validation.js</js-path>

                   <js-priority>1</js-priority>

               </param>

               <param>

                   <js-module>commonslookupJS</js-module>

                   <js-path>/javascript/commons/commons-lookup.js</js-path>

                   <js-priority>1</js-priority>

               </param>

              

              <!--  <param>

                   <js-module>fusionChartsJS</js-module>

                   <js-path>/javascript/charts/FusionCharts.js</js-path>

                   <js-priority>1</js-priority>

               </param>

                <param>

                   <js-module>securityCharts</js-module>

                   <js-path>/javascript/charts/securityChart.js</js-path>

                   <js-priority>1</js-priority>

               </param> -->

               <param>

                   <js-module>DwrProxy</js-module>

                   <js-path>/javascript/lib/DwrProxy.js</js-path>

                   <js-priority>4</js-priority>

               </param>

                <param>

                   <js-module>dynamicColumn</js-module>

                   <js-path>/javascript/commons/dynamicColumn.js</js-path>

                   <js-priority>5</js-priority>

               </param>

               <param>

                   <js-module>dateUtils</js-module>

                   <js-path>/javascript/date/dateUtils.js</js-path>

                   <js-priority>2</js-priority>

               </param>

              <param>

                   <js-module>extObjectPopup</js-module>

                   <js-path>/javascript/extWidgets/extObjectPopup/extObjectPopup.js</js-path>

                   <js-priority>5</js-priority>

               </param>

                <param>

                   <js-module>Spotlight</js-module>

                   <js-path>/javascript/lib/ext-2.1/Spotlight.js</js-path>

                   <js-priority>5</js-priority>

               </param>

              <param>

                   <js-module>ExtColumnHeader</js-module>

                   <js-path>/javascript/lib/ext-2.1/ColumnHeaderGroup.js</js-path>

                   <js-priority>5</js-priority>

               </param>

                <param>

                   <js-module>toolTreeTrends</js-module>

                   <js-path>/javascript/dtree/toolTreeTrends.js</js-path>

                   <js-priority>6</js-priority>

               </param>

               <param>

                   <js-module>toolTreeThreat</js-module>

                   <js-path>/javascript/dtree/toolTree.js</js-path>

                   <js-priority>4</js-priority>

               </param>

               <param>

                   <js-module>dynamicColumn</js-module>

                   <js-path>/javascript/commons/dropdownGrid.js</js-path>

                   <js-priority>6</js-priority>

               </param>

               <param>

                   <js-module>rgraph</js-module>

                   <js-path>/javascript/charts/RGraph.common.core.js</js-path>

                   <js-priority>6</js-priority>

               </param>

               <param>

                   <js-module>BarChart</js-module>

                   <js-path>/javascript/charts/BarChart.js</js-path>

                   <js-priority>1</js-priority>

               </param>

               <param>

                   <js-module>LineChart</js-module>

                   <js-path>/javascript/charts/LineChart.js</js-path>

                   <js-priority>1</js-priority>

               </param>

          </javascript>

         

      </gatein-resources>

        • 1. Re: merged.js - issue in production mode
          theute

          Please try a more recent version, you likely face an issue with the resource compressor and as far as I remember we changed it a while ago.

          • 2. Re: merged.js - issue in production mode
            poornima.abhi

            Hi Heute,

             

            Thanks for your valuable reply.

            I did try with GateIn 3.6. But it is not importing any javascripts  from gatein-resource.xml file [not only ext - javascripts].I did two approaches .

            Herewith, am attaching both. Where did i go wrong?, pls correct me... am really stuck...pls help..

            Approach Number -1

            <?xml version="1.0" encoding="UTF-8"?>

            <gatein-resources xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_resources_1_3 http://www.gatein.org/xml/ns/gatein_resources_1_3"

                xmlns="http://www.gatein.org/xml/ns/gatein_resources_1_3">

             

              

                <scripts>

                        <name>extcalendarJS</name>

                        <script>

                          <path>/javascript/commons/extcalendar.js</path>

                        </script>

                </scripts>

              

                 <scripts>

                        <name>DwrProxy</name>

                        <script>

                          <path>/javascript/lib/DwrProxy.js</path>

                        </script>

                </scripts>

                <scripts>

                        <name>dynamicColumn</name>

                        <script>

                          <path>/javascript/commons/dynamicColumn.js</path>

                        </script>

                </scripts>

                  <scripts>

                        <name>dateUtils</name>

                        <script>

                          <path>/javascript/date/dateUtils.js</path>

                        </script>

                </scripts>

                <scripts>

                        <name>extObjectPopup</name>

                        <script>

                          <path>/javascript/extWidgets/extObjectPopup/extObjectPopup.js</path>

                        </script>

                </scripts>

                <scripts>

                        <name>Spotlight</name>

                        <script>

                          <path>/javascript/lib/ext-2.1/Spotlight.js</path>

                        </script>

                </scripts>

                <scripts>

                        <name>ExtColumnHeader</name>

                        <script>

                          <path>/javascript/lib/ext-2.1/ColumnHeaderGroup.js</path>

                        </script>

                </scripts>

              

              

            </gatein-resources>

            Approach No -2

            <?xml version="1.0" encoding="UTF-8"?>

            <gatein-resources xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_resources_1_3 http://www.gatein.org/xml/ns/gatein_resources_1_3"

                xmlns="http://www.gatein.org/xml/ns/gatein_resources_1_3">

             

                <module>

                    <name>popupJS</name>

                    <script>/javascript/popup/popup.js</script>

                </module>

                <module>

                        <name>validateSessionJS</name>

                        <script>/javascript/commons/validateSession.js</script>

                </module>

                <module>

                        <name>extbaseJS</name>

                        <script>/javascript/lib/ext-2.1/adapter/ext/ext-base.js</script>

                </module>

                <module>

                        <name>extallJS</name>

                        <script>/javascript/lib/ext-2.1/ext-all.js</script>

                </module>

                <module>

                        <name>extcommonsJS</name>

                        <script>/javascript/commons/extCommons.js</script>

                </module>

                <module>

                        <name>dateJS</name>

                        <script>/javascript/date/date.js</script>

                </module>

                <module>

                        <name>dateUtils</name>

                        <script>/javascript/date/dateUtils.js</script>

                </module>

                <module>

                        <name>extObjectPopup</name>

                        <script>/javascript/extWidgets/extObjectPopup/extObjectPopup.js</script>

                </module>

                <module>

                        <name>Spotlight</name>

                        <script>/javascript/lib/ext-2.1/Spotlight.js</script>

                </module>

                <module>

                        <name>ExtColumnHeader</name>

                        <script>/javascript/lib/ext-2.1/ColumnHeaderGroup.js</script>

                </module>

               

            </gatein-resources>

             

            Thanks in advance,

             

            Poornima

            • 3. Re: merged.js - issue in production mode
              vstorm83

              Do you find any error for parsing JS in the server's console, some thing like described in this thread https://community.jboss.org/message/840611#840611 (In dev mode, JS files are not compressed, maybe that's why it works in dev-mode)

               

              newest GateIn version provide new machanism that support AMD JS. You should use that new way if your JS is AMD modules. But even if you don't migrate gatein-resources.xml, it should works like before --> Problem with js files while migrating from gatein 3.2 to 3.6

               

              If you use the new provided tags: <scripts> and <module> to declare your portlet JS files, they should be AMD or GMD, more details on this:JavaScript in GateIn - GateIn Portal 3.5 - Project Documentation Editor

              Note :

              - you'll need to make some migration on portlet's JS files, or you'll need to use "<adapter>" tag to transform your JS to GMD or AMD native modules (pls read the doc for details)

              - you still need to resolve all issue with Closure compiler, GateIn use Closure to compress all JS files, even AMD modules