隨筆 - 37  文章 - 14  trackbacks - 0
          <2007年6月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          1234567

          常用鏈接

          留言簿

          隨筆分類

          隨筆檔案

          文章分類

          相關鏈接

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          在Schema里的Dimension、Level、Measure標簽都有一個caption屬性,在shecma里有個measuresCaption屬性,Hierarchy里有個allMemberCaption屬性都是國際化顯示用的。格式為:caption="%{}"
          通過以下幾個步驟便可實現國際化         
          一、修改Schema如下
          .
                  
          <Dimension foreignKey="TIME_ID" name="TIME">
                      
          <Hierarchy hasAll="true" allMemberName="All time" primaryKey="TIME_ID" allMemberCaption="%{compensation.dimension.time.allmember.caption}">
                          
          <Table name="TIME_TO_MONTH">
                          
          </Table>
                          
          <Level name="YEAR" table="TIME_TO_MONTH" column="YEAR" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
                          
          </Level>
                          
          <Level name="QUARTER" table="TIME_TO_MONTH" column="QUARTER" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
                          
          </Level>
                          
          <Level name="MONTH" table="TIME_TO_MONTH" column="MONTH" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
                          
          </Level>
                      
          </Hierarchy>
                  
          </Dimension>
                  
          <Measure name="UOT1" column="UOT1" caption="%{compension.measure.uot1.caption}" datatype="Numeric" formatString="#,##0.###" aggregator="sum">
                  
          </Measure>
          二、在WEB Application 的classes里創建對應的國際化文件,命名如下locale_zh_CN.properties
          compensation.dimension.time.allmember.caption=\u5168\u90e8\u65f6\u95f4
          compensation.dimension.position.allmember.caption=\u5168\u90e8\u8d44\u4f4d
          compension.measure.uot1.caption=1.5\u500d\u52a0\u73ed\u65f6\u6570
          compension.measure.uot2.caption=2\u500d\u52a0\u73ed\u65f6\u6570
          compension.measure.uot3.caption=3\u500d\u52a0\u73ed\u65f6\u6570
          三、在classes里添加mondrian.properties文件(默認是在WEB-INF下),并添加下面兩個屬性
          Locale:用于指定要使用的語言
          mondrian.rolap.localePropFile:國際化文件絕對路徑
          Locale=zh_CN
          mondrian.rolap.localePropFile=D:\\JAVA\\Tomcat5.5\\webapps\\mondrian\\WEB-INF\\classes\\locale.properties
          四、在顯示的頁面上的<jp>標簽里添加dynLocale="zh_CN" dynResolver="mondrian.i18n.LocalizingDynamicSchemaProcessor"
          <jp:mondrianQuery id="query01" jdbcDriver="oracle.jdbc.OracleDriver" dynLocale="zh_CN" dynResolver="mondrian.i18n.LocalizingDynamicSchemaProcessor" jdbcUrl="jdbc:oracle:thin:@*.*.*.*:1521:wiptest" jdbcUser="oee" jdbcPassword="oee" catalogUri="/WEB-INF/queries/Compensation.xml">
          select {[Measures].[UOT1],[Measures].[UOT2],[Measures].[UOT3]} ON columns,
          {([TIME].[All time],[POSITION].[All position], [DEPT]) } on rows
          FROM [Compensation]
          </jp:mondrianQuery>
          關于國際化功能實現相關代碼在LocalizingDynamicSchemaProcessor和MondrianProperties兩個類里。
          posted on 2007-06-14 14:51 扭曲的鉛筆 閱讀(1410) 評論(1)  編輯  收藏 所屬分類: BI

          FeedBack:
          # re: Mondrian國際化 2007-12-12 17:16 ll
          頂一下,謝謝正需要  回復  更多評論
            
          主站蜘蛛池模板: 滨海县| 驻马店市| 太仆寺旗| 汽车| 邵武市| 西安市| 宁陵县| 墨竹工卡县| 阜城县| 普陀区| 革吉县| 化州市| 黎川县| 青铜峡市| 阜阳市| 寻乌县| 宜兰市| 高州市| 台北县| 阜新市| 化隆| 右玉县| 郑州市| 陇川县| 新疆| 渝中区| 潢川县| 宾阳县| 西昌市| 顺义区| 微博| 石景山区| 鸡西市| 榆社县| 仪陇县| 随州市| 克什克腾旗| 孝义市| 崇信县| 涟源市| 邵武市|