Mondrian XML/A 配置

简介

Mondrian是一个开放源代码的Rolap服务器,使用java开发的。它实现了xmla和jolap规范,而且自定义了一种使用mdx语言的客户端接口。

环境准备

1、JDK5及以上版本。

2、Tomcat6,其它版本没测过

3、Mondrian,当前最新版本为3.5.0,下载地址:http://mondrian.pentaho.com/

安装

1、安装JDK,配置JAVA_HOME环境变量

2、安装Tomcat

3、解压mondrian-3.5.0.zip,复制lib\mondrian.war到Tomcat的webapps目录下,启动Tomcat

4、进入/webapps/mondrian/WEB-INF目录,修改web.xml,注释掉DataSourcesConfig

<servlet>
    <servlet-name>MondrianXmlaServlet</servlet-name>
    <servlet-class>mondrian.xmla.impl.DynamicDatasourceXmlaServlet</servlet-class>
    <!-- 
      This is an example of how to add a callback to the XML/A servlet.
      It must implement mondrian.xmla.XmlaRequestCallback.
    <init-param>
      <param-name>Callbacks</param-name>
      <param-value>com.example.MyCallbackClass;com.example.SomeOtherCallback</param-value>
    </init-param>
    <init-param>
      <param-name>DataSourcesConfig</param-name>
      <param-value>/WEB-INF/datasources.xml</param-value>
    </init-param>
    -->
</servlet>

 5、修改datasources.xml

<?xml version="1.0"?>
<!--
  == This software is subject to the terms of the Eclipse Public License v1.0
  == Agreement, available at the following URL:
  == http://www.eclipse.org/legal/epl-v10.html.
  == You must accept the terms of that agreement to use this software.
  ==
  == Copyright (C) 2005-2006 Pentaho and others
  == All Rights Reserved.
  -->
<DataSources>
    <!-- 
         A data source is a collection of logically related Mondrian
         catalogs.

         The XMLA specification allows an XMLA provider to have
         multiple data sources, but some clients, particularly ones
         based on ADOMD.NET such as Simba's O2X client and Pentaho
         Spreadsheet Services, can only connect to the first declared
         data source. Therefore, we recommend that you use a single
         data source, containing multiple catalogs if necessary.
     -->
    <DataSource>
        <!--
             Name of the data source.
        -->
        <DataSourceName>Provider=Mondrian;DataSource=MyDW;</DataSourceName>

        <!--
             Description of the data source.
        -->
        <DataSourceDescription>Mondrian My Data Warehouse</DataSourceDescription>

        <!-- 
             The URL of the servlet.
        -->
        <URL>http://localhost:8080/mondrian/xmla</URL>

        <!--
             Mondrian connect string for the data source. If this data
             source contains multiple catalogs, omit the 'Catalog'
             property, and specify the URI of the schema.xml file in
             the catalog's <Definition> element.

             Catalogs can override the connect string with their own
             <DataSourceInfo> element.
          -->
        <DataSourceInfo>Provider=mondrian;Jdbc=jdbc:mysql://localhost:5029/mydw;JdbcUser=usr;JdbcPassword=pwd;JdbcDrivers=org.gjt.mm.mysql.Driver</DataSourceInfo>

        <!-- 
             Provider name must be 'Mondrian'.
        -->
        <ProviderName>Mondrian</ProviderName>

        <!-- 
             Provider type must be 'MDP'.
        -->
        <ProviderType>MDP</ProviderType>

        <!-- 
             Authentication mode. Allowable values are
             'Unauthenticated', 'Authenticated', 'Integrated'. 
        -->
        <AuthenticationMode>Unauthenticated</AuthenticationMode>

        <!-- 
             A data source contains one or more catalogs.
        -->
        <Catalogs>
            <!-- 
                Catalog names must match the name inside the
                schema.xml file, and must be unique across all data
                sources defined in this datasources.xml file.
            -->
            <Catalog name="mycube">
                <!--
                     Mondrian connect string for the data source. This
                     element is optional; if specified, it overrides the
                     data source's <DataSourceInfo> element. Typically,
                     you would use this element if the catalogs have
                     different JDBC data sources.
                 -->
                <!--
                <DataSourceInfo>Provider=mondrian;Jdbc=jdbc:odbc:MondrianFoodMart;JdbcDrivers=sun.jdbc.odbc.JdbcOdbcDriver</DataSourceInfo>
                 -->

                <!-- 
                    URI of the schema definition file.
                -->
                <Definition>/WEB-INF/queries/testcube.xml</Definition>
            </Catalog>
        </Catalogs>

    </DataSource>

</DataSources>

猜你喜欢

转载自customme.iteye.com/blog/1880591
今日推荐