0
votes

I am using jboss gatein 3.2 for my web application. In the gatein-resource.xml, i have upgraded from ext-js 3.2 to 3.4. which gives me java script error in the firebug console and all the ext-js components and menu of the gatein portlets are all also not loaded. This happens in the production mode only but works fine in the development mode. What could be wrong(ext-js 3.2 works fine in both development mode as well as production mode)

TypeError: eXo.portal.UIPortal is undefined

the bellow is my gatein resource.xml

<?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>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><!--RIMS_05.05_M1_BUG_35 -->
            <js-module>BarChart</js-module>
            <js-path>/javascript/charts/BarChart.js</js-path>
            <js-priority>1</js-priority>
         </param>
         <param><!--RIMS_05.05_M1_BUG_36 -->
            <js-module>LineChart</js-module>
            <js-path>/javascript/charts/LineChart.js</js-path>
            <js-priority>1</js-priority>
         </param>
    </javascript>

</gatein-resources>
2

2 Answers

0
votes

On the recent version of GateIn (GateIn 3.6) they changed the javascript importing syntax in gatein-resources.xml and resource compression mechanism . You can find more about that from This Link

0
votes

You need to update your gatein-resources.xml in order to be compliant with the new syntax:

  <scripts>
    <name>extJS</name>
    <script>
      <path>/javascript/lib/ext-2.1/adapter/ext/ext-base.js</path>
    </script>
    <script>
      <path>/javascript/lib/ext-2.1/ext-all.js</path>
    </script>
    .....
  </scripts>

GateIn 3.6 provides now on demand, flexible and parallel loading of JavaScript resources. So you can also use AMD(Asynchronous module definition). For a shared scope (Gatein support portal, portlet and shared scope), you can define your javascript modules like this:

<module>
  <name>extbase</name>
  <script>
    <path>/javascript/lib/ext-2.1/adapter/ext/ext-base.js</path>
  </script>
  <depends>
    <module>base</module>
  </depends>
</module>
<module>
  <name>extall</name>
  <script>
    <path>/javascript/lib/ext-2.1/ext-all.js</path>
  </script>
  <depends>
    <module>extbase</module>
  </depends>
</module> 
....

You can find more information about Javascript development in GateIn here : https://docs.jboss.org/author/display/GTNPORTAL35/JavaScript+Development