0

我正在为我的 Web 应用程序使用 jboss Gatein 3.2。在gatein-resource.xml 中,我已从ext-js 3.2 升级到3.4。这给了我在firebug控制台中的java脚本错误,并且所有ext-js组件和gatein portlet的菜单也都没有加载。这仅在生产模式下发生,但在开发模式下工作正常。可能出了什么问题(ext-js 3.2 在开发模式和生产模式下都可以正常工作)

TypeError: eXo.portal.UIPortal is undefined

下面是我的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>
4

2 回答 2

0

在最新版本的 GateIn (GateIn 3.6) 中,他们更改了 gatein-resources.xml 中的 javascript 导入语法和资源压缩机制。您可以从此链接找到更多相关信息

于 2013-10-09T08:42:44.327 回答
0

您需要更新 gatein-resources.xml 以符合新语法:

  <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 现在提供按需、灵活和并行的 JavaScript 资源加载。所以你也可以使用 AMD(异步模块定义)。对于共享范围(Gatein 支持门户、portlet 和共享范围),您可以像这样定义您的 javascript 模块:

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

您可以在 GateIn 中找到更多关于 Javascript 开发的信息: https ://docs.jboss.org/author/display/GTNPORTAL35/JavaScript+Development

于 2013-10-31T12:03:57.203 回答