Skip to content

Commit

Permalink
MONDRIAN: Integrate from abx @2761
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian/": change = 2763]
  • Loading branch information
julianhyde committed Oct 11, 2004
1 parent dd16df0 commit beffece
Show file tree
Hide file tree
Showing 250 changed files with 88,314 additions and 953 deletions.
108 changes: 57 additions & 51 deletions build.bat
@@ -1,73 +1,79 @@
@rem $Id$
@rem This software is subject to the terms of the Common Public License
@rem Agreement, available at the following URL:
@rem http://www.opensource.org/licenses/cpl.html.
@rem (C) Copyright 2001-2004 Kana Software, Inc. and others.
@rem All Rights Reserved.
@rem You must accept the terms of that agreement to use this software.
@echo off
setlocal

@set SRCROOT=%~dp0
rem $Id$
rem This software is subject to the terms of the Common Public License
rem Agreement, available at the following URL:
rem http://www.opensource.org/licenses/cpl.html.
rem (C) Copyright 2001-2004 Kana Software, Inc. and others.
rem All Rights Reserved.
rem You must accept the terms of that agreement to use this software.

@if exist "%HOME_DRIVE%" goto homeDriveOk
@set HOME_DRIVE=E
set SRCROOT=%~dp0

if exist "%HOME_DRIVE%" goto homeDriveOk
set HOME_DRIVE=E
:homeDriveOk

@if exist "%JAVA_HOME%" goto javaHomeOk
@set JAVA_HOME=%HOME_DRIVE%:/j2sdk1.4.1_01
@if exist "%JAVA_HOME%" goto javaHomeOk
@echo JAVA_HOME (%JAVA_HOME%) does not exist
@goto end
if exist "%JAVA_HOME%" goto javaHomeOk
set JAVA_HOME=%HOME_DRIVE%:/j2sdk1.4.1_01
if exist "%JAVA_HOME%" goto javaHomeOk
echo JAVA_HOME (%JAVA_HOME%) does not exist
goto end
:javaHomeOk

@set PATH=%JAVA_HOME%/bin;%PATH%
echo Using JAVA_HOME %JAVA_HOME%

set PATH=%JAVA_HOME%/bin;%PATH%

@if exist "%ANT_HOME%" goto antHomeOk
@set ANT_HOME=%HOME_DRIVE%:\apache-ant-1.6.1
@if exist "%ANT_HOME%" goto antHomeOk
@echo ANT_HOME (%ANT_HOME%) does not exist
@goto end
if exist "%ANT_HOME%" goto antHomeOk
set ANT_HOME=%HOME_DRIVE%/apache-ant-1.6.1
if exist "%ANT_HOME%" goto antHomeOk
echo ANT_HOME (%ANT_HOME%) does not exist
goto end
:antHomeOk

@if exist "%XALAN_HOME%" goto xalanHomeOk
@set XALAN_HOME=%HOME_DRIVE%:/xalan-j_2_6_0
@if exist "%XALAN_HOME%" goto xalanHomeOk
@echo XALAN_HOME (%XALAN_HOME%) does not exist
@goto end
if exist "%XALAN_HOME%" goto xalanHomeOk
set XALAN_HOME=%HOME_DRIVE%:/xalan-j_2_6_0
if exist "%XALAN_HOME%" goto xalanHomeOk
echo XALAN_HOME (%XALAN_HOME%) does not exist
goto end
:xalanHomeOk

@if exist "%JUNIT_HOME%" goto junitHomeOk
@set JUNIT_HOME=%HOME_DRIVE%:/junit3.8.1
@if exist "%JUNIT_HOME%" goto junitHomeOk
@echo JUNIT_HOME (%JUNIT_HOME%) does not exist
@goto end
if exist "%JUNIT_HOME%" goto junitHomeOk
set JUNIT_HOME=%HOME_DRIVE%:/junit3.8.1
if exist "%JUNIT_HOME%" goto junitHomeOk
echo JUNIT_HOME (%JUNIT_HOME%) does not exist
goto end
:junitHomeOk

@if exist "%CATALINA_HOME%" goto catalinaHomeOk
@set CATALINA_HOME=%HOME_DRIVE%:/jakarta-tomcat-5.0.25
@if exist "%CATALINA_HOME%" goto catalinaHomeOk
@echo CATALINA_HOME (%CATALINA_HOME%) does not exist
@goto end
if exist "%CATALINA_HOME%" goto catalinaHomeOk
set CATALINA_HOME=%HOME_DRIVE%:/jakarta-tomcat-5.0.25
if exist "%CATALINA_HOME%" goto catalinaHomeOk
echo CATALINA_HOME (%CATALINA_HOME%) does not exist
goto end
:catalinaHomeOk

@set CLASSPATH=%SRCROOT%/classes;%SRCROOT%/lib/javacup.jar;%SRCROOT%/lib/mondrian-xom.jar;%SRCROOT%/lib/mondrian-resource.jar
set CLASSPATH=%SRCROOT%..\classes;%SRCROOT%lib/javacup.jar;%SRCROOT%lib/mondrian-xom.jar;%SRCROOT%lib/mondrian-resource.jar

@rem To use Oracle, uncomment the next line and modify appropriately
@rem set ORACLE_HOME=%HOME_DRIVE%:/oracle/ora81
@if "%ORACLE_HOME%" == "" goto oracleHomeNotSet
@if exist "%ORACLE_HOME%" goto oracleHomeOk
@echo ORACLE_HOME (%ORACLE_HOME%) does not exist
@goto end
rem To use Oracle, uncomment the next line and modify appropriately
rem set ORACLE_HOME=%HOME_DRIVE%:/oracle/ora81
if "%ORACLE_HOME%" == "" goto oracleHomeNotSet
if exist "%ORACLE_HOME%" goto oracleHomeOk
echo ORACLE_HOME (%ORACLE_HOME%) does not exist
goto end
:oracleHomeOk
@set CLASSPATH=%CLASSPATH%;%ORACLE_HOME%/jdbc/lib/classes12.zip
set CLASSPATH=%CLASSPATH%;%ORACLE_HOME%/jdbc/lib/classes12.zip
:oracleHomeNotSet

@rem To use MySQL, uncomment the next 2 lines and modify appropriately
@rem set MYSQL_HOME=%HOME_DRIVE%:/MySQL
@rem set CLASSPATH=%CLASSPATH%;%MYSQL_HOME%/lib/mm.mysql-2.0.4-bin.jar
rem To use MySQL, uncomment the next 2 lines and modify appropriately
rem set MYSQL_HOME=%HOME_DRIVE%:/MySQL
rem set CLASSPATH=%CLASSPATH%;%MYSQL_HOME%/lib/mm.mysql-2.0.4-bin.jar

@rem To use Weblogic, uncomment the next line and modify appropriately.
@rem set WEBLOGIC_HOME=%HOME_DRIVE%:/bea/wlserver6.1
rem To use Weblogic, uncomment the next line and modify appropriately.
rem set WEBLOGIC_HOME=%HOME_DRIVE%:/bea/wlserver6.1

@%ANT_HOME%\bin\ant %1 %2 %3 %4 %5 %6 %7 %8 %9
%ANT_HOME%\bin\ant %1 %2 %3 %4 %5 %6 %7 %8 %9
:end
@rem end build.bat
endlocal
rem end build.bat
72 changes: 41 additions & 31 deletions build.xml
Expand Up @@ -76,19 +76,19 @@ ${lib.dir}/optional.jar,
${lib.dir}/xalan.jar,
${lib.dir}/xercesImpl.jar,
${lib.dir}/xml-apis.jar,
${lib.dir}/commons-dbcp-1.1.jar,
${lib.dir}/commons-pool-1.1.jar,
${lib.dir}/commons-dbcp.jar,
${lib.dir}/commons-pool.jar,
${testlib.dir}/junit.jar
demo/mysql/FoodMartDropTables.sql,
demo/mysql/FoodMartData.sql"/>

<path id="project.classpath">
<pathelement location="${classes.dir}"/>
<pathelement location="${lib.dir}/servlet-api.jar"/>
<pathelement location="${lib.dir}/servlet.jar"/>
<pathelement location="${lib.dir}/jsp-api.jar"/>
<pathelement location="${lib.dir}/commons-dbcp-1.1.jar"/>
<pathelement location="${lib.dir}/commons-dbcp.jar"/>
<pathelement location="${lib.dir}/commons-collections.jar"/>
<pathelement location="${lib.dir}/commons-pool-1.1.jar"/>
<pathelement location="${lib.dir}/commons-pool.jar"/>
<pathelement location="${lib.dir}/javacup.jar"/>
<pathelement location="${lib.dir}/mof.jar"/>
<pathelement location="${lib.dir}/jmi.jar"/>
Expand All @@ -106,7 +106,9 @@ demo/mysql/FoodMartData.sql"/>

<path id="project.test.classpath">
<path refid="project.classpath"/>
<pathelement location="${testlib.dir}/junit.jar"/>
<fileset dir="${testlib.dir}">
<include name="**/*.jar"/>
</fileset>
<pathelement location="${testclasses.dir}"/>
</path>

Expand Down Expand Up @@ -226,6 +228,7 @@ copy.properties"/>
classpathref="project.boot.classpath"
source="1.4">
<include name="mondrian/xom/**/*.java" />
<include name="mondrian/olap/MondrianException.java" />
</javac>
</target>

Expand Down Expand Up @@ -333,12 +336,15 @@ copy.properties"/>
<java classpathref="project.classpath" classname="mondrian.test.Main"
fork="yes">

<sysproperty key="mondrian.jdbcDrivers" value="${mondrian.jdbcDrivers}"/>
<sysproperty key="mondrian.test.foodmart.catalogURL" value="${mondrian.foodmart.catalogURL}"/>
<sysproperty key="mondrian.jdbcDrivers"
value="${mondrian.jdbcDrivers}"/>
<sysproperty key="mondrian.test.foodmart.catalogURL"
value="${mondrian.foodmart.catalogURL}"/>

<!-- mondrian.test.connectString is the mondrian connect-string.
Provider must be 'mondrian'. Jdbc is the Catalog is the -->
<sysproperty key="mondrian.test.connectString" value="Provider=mondrian;Jdbc='${mondrian.foodmart.jdbcURL}';Catalog='${mondrian.foodmart.catalogURL}';JdbcUser='${mondrian.foodmart.jdbcUser}';JdbcPassword='${mondrian.foodmart.jdbcPassword}'"/>
<sysproperty key="mondrian.test.connectString"
value="Provider=mondrian;Jdbc='${mondrian.foodmart.jdbcURL}';Catalog='${mondrian.foodmart.catalogURL}';JdbcUser='${mondrian.foodmart.jdbcUser}';JdbcPassword='${mondrian.foodmart.jdbcPassword}'"/>

</java>
</target>
Expand Down Expand Up @@ -381,10 +387,14 @@ in {mondrian.foodmart.jdbcURL}.">
<java classpathref="project.test.classpath" classname="mondrian.test.Main"
fork="yes">

<sysproperty key="mondrian.jdbcDrivers" value="${mondrian.jdbcDrivers}"/>
<sysproperty key="mondrian.foodmart.jdbcURL" value="${mondrian.foodmart.jdbcURL}"/>
<sysproperty key="mondrian.test.foodmart.catalogURL" value="${mondrian.foodmart.catalogURL}"/>
<sysproperty key="mondrian.test.connectString" value="Provider=mondrian;Jdbc='${mondrian.foodmart.jdbcURL}';Catalog='${mondrian.foodmart.catalogURL}'"/>
<sysproperty key="mondrian.jdbcDrivers"
value="${mondrian.jdbcDrivers}"/>
<sysproperty key="mondrian.foodmart.jdbcURL"
value="${mondrian.foodmart.jdbcURL}"/>
<sysproperty key="mondrian.test.foodmart.catalogURL"
value="${mondrian.foodmart.catalogURL}"/>
<sysproperty key="mondrian.test.connectString"
value="Provider=mondrian;Jdbc='${mondrian.foodmart.jdbcURL}';Catalog='${mondrian.foodmart.catalogURL}'"/>
<!-- tests require en_US locale -->
<sysproperty key="user.language" value="en"/>
<sysproperty key="user.region" value="US"/>
Expand All @@ -398,9 +408,12 @@ in {mondrian.foodmart.jdbcURL}.">
<classpath>
<path refid="project.test.classpath"/>
</classpath>
<sysproperty key="mondrian.jdbcDrivers" value="${mondrian.jdbcDrivers}"/>
<sysproperty key="mondrian.test.connectString" value="Provider=mondrian;Jdbc='${mondrian.foodmart.jdbcURL}';Catalog='${mondrian.foodmart.catalogURL}'"/>
<sysproperty key="mondrian.test.foodmart.catalogURL" value="${mondrian.foodmart.catalogURL}"/>
<sysproperty key="mondrian.jdbcDrivers"
value="${mondrian.jdbcDrivers}"/>
<sysproperty key="mondrian.test.connectString"
value="Provider=mondrian;Jdbc='${mondrian.foodmart.jdbcURL}';Catalog='${mondrian.foodmart.catalogURL}'"/>
<sysproperty key="mondrian.test.foodmart.catalogURL"
value="${mondrian.foodmart.catalogURL}"/>

<formatter type="xml" />

Expand Down Expand Up @@ -615,7 +628,7 @@ VERSION.txt"/>
<jar jarfile="${xom.jar.file}">
<fileset
dir="${classes.dir}"
includes="mondrian/xom/**/*.class"/>
includes="mondrian/xom/**/*.class,mondrian/olap/MondrianException.class"/>
</jar>

<delete file="${resource.jar.file}"/>
Expand Down Expand Up @@ -670,12 +683,9 @@ build mondrian.war as in the runtime environment.">
<copy todir="${lib.dir}">
<fileset dir="${ant.home}/lib" includes="ant.jar,optional.jar"/>
<fileset dir="${xalan.home}/bin" includes="xalan.jar,xml-apis.jar,xercesImpl.jar"/>
<fileset dir="${catalina.home}/common/lib" includes="commons-dbcp-1.1.jar,commons-pool-1.1.jar,commons-collections.jar,servlet-api.jar,jsp-api.jar"/>
<fileset dir="${catalina.home}/common/lib" includes="commons-dbcp.jar,commons-pool.jar,commons-collections.jar"/>
</copy>
<copy todir="${testlib.dir}">
<fileset dir="${junit.home}" includes="junit.jar"/>
</copy>
<!--

<extension id="junit.ext" extensionName="junit"/>
<jarlib-resolve property="junit.library" failOnError="false" checkExtension="false">
<extension refid="junit.ext"/>
Expand All @@ -686,15 +696,15 @@ build mondrian.war as in the runtime environment.">
<extension id="commons-dbcp.ext" extensionName="org.apache.commons.dbcp"/>
<jarlib-resolve property="commons-dbcp.library" failOnError="false" checkExtension="false">
<extension refid="commons-dbcp.ext"/>
<location location="${lib.dir}/commons-dbcp-1.1.jar"/>
<url url="http://gump.covalent.net/jars/latest/jakarta-commons/commons-dbcp.jar" destfile="${lib.dir}/commons-dbcp-1.1.jar"/>
<location location="${lib.dir}/commons-dbcp.jar"/>
<url url="http://gump.covalent.net/jars/latest/jakarta-commons/commons-dbcp.jar" destfile="${lib.dir}/commons-dbcp.jar"/>
</jarlib-resolve>

<extension id="commons-pool.ext" extensionName="org.apache.commons.pool"/>
<jarlib-resolve property="commons-pool.library" failOnError="false" checkExtension="false">
<extension refid="commons-pool.ext"/>
<location location="${lib.dir}/commons-pool-1.1.jar"/>
<url url="http://gump.covalent.net/jars/latest/jakarta-commons/commons-pool.jar" destfile="${lib.dir}/commons-pool-1.1.jar"/>
<location location="${lib.dir}/commons-pool.jar"/>
<url url="http://gump.covalent.net/jars/latest/jakarta-commons/commons-pool.jar" destfile="${lib.dir}/commons-pool.jar"/>
</jarlib-resolve>

<extension id="commons-collections.ext" extensionName="org.apache.commons.collections"/>
Expand Down Expand Up @@ -724,7 +734,7 @@ build mondrian.war as in the runtime environment.">
<location location="${lib.dir}/xercesImpl.jar"/>
<url url="http://gump.covalent.net/jars/latest/xml-xerces2/xercesImpl.jar" destfile="${lib.dir}/xercesImpl.jar"/>
</jarlib-resolve>
-->

</target>

<target name="war" depends="jar,copy-jars" description="
Expand All @@ -741,18 +751,18 @@ Assumes that mondrian.jar exists (use 'jar' target)">
update="yes"
webxml="${lib.dir}/web.xml">
<webinf dir="${webapp.dir}/WEB-INF" excludes="web.xml"/>
<!-- our FoodMart.xml may be newer than jpivot's -->
<!-- our FoodMart.xml may be newer than jpivot's -->
<webinf dir="${demo.dir}" prefix="WEB-INF/queries" includes="FoodMart.xml"/>
<fileset dir="${webapp.dir}" excludes="WEB-INF/**/*"/>
<!-- should already contain javacup.jar, xalan.jar, junit.jar -->
<!-- should already contain javacup.jar, xalan.jar, junit.jar -->
<lib dir="${lib.dir}" includes="
${name}.jar,
ant.jar,
jmi.jar,
mof.jar,
optional.jar,
commons-pool-1.1.jar,
commons-dbcp-1.1.jar,
commons-pool.jar,
commons-dbcp.jar,
" excludes="
javacup.jar,
xalan.jar,
Expand Down
20 changes: 16 additions & 4 deletions demo/FoodMart.xml
Expand Up @@ -48,7 +48,7 @@
</Hierarchy>
</Dimension>

<Dimension name="Time">
<Dimension name="Time" type="TimeDimension">
<Hierarchy hasAll="false" primaryKey="time_id">
<Table name="time_by_day"/>
<Level name="Year" column="the_year" type="Numeric" uniqueMembers="true" levelType="TimeYears"/>
Expand Down Expand Up @@ -137,8 +137,11 @@ fname + ' ' + lname
<SQL dialect="mysql">
CONCAT(`customer`.`fname`, ' ', `customer`.`lname`)
</SQL>
<SQL dialect="mssql">
fname + ' ' + lname
</SQL>
<SQL dialect="generic">
"lname"
lname
</SQL>
</KeyExpression>
<Property name="Gender" column="gender"/>
Expand Down Expand Up @@ -199,7 +202,7 @@ CONCAT(`customer`.`fname`, ' ', `customer`.`lname`)
<Measure name="Warehouse Sales" column="warehouse_sales" aggregator="sum"/>
<Measure name="Units Shipped" column="units_shipped" aggregator="sum"/>
<Measure name="Units Ordered" column="units_ordered" aggregator="sum"/>
<Measure name="Warehouse Profit" column="&quot;inventory_fact_1997&quot;.&quot;warehouse_sales&quot;-&quot;inventory_fact_1997&quot;.&quot;warehouse_cost&quot;" aggregator="sum"/>
<Measure name="Warehouse Profit" column="&quot;warehouse_sales&quot;-&quot;inventory_fact_1997&quot;.&quot;warehouse_cost&quot;" aggregator="sum"/>
</Cube>

<!-- Test a cube based upon a single table. -->
Expand Down Expand Up @@ -232,7 +235,7 @@ CONCAT(`customer`.`fname`, ' ', `customer`.`lname`)
<Table name="salary"/>
<!-- Use private "Time" dimension because key is different than public
"Time" dimension. -->
<Dimension name="Time" foreignKey="pay_date">
<Dimension name="Time" type="TimeDimension" foreignKey="pay_date">
<Hierarchy hasAll="false" primaryKey="the_date">
<Table name="time_by_day"/>
<Level name="Year" column="the_year" type="Numeric" uniqueMembers="true" levelType="TimeYears"/>
Expand Down Expand Up @@ -367,6 +370,9 @@ fname + ' ' + lname
<SQL dialect="mysql">
CONCAT(`customer`.`fname`, ' ', `customer`.`lname`)
</SQL>
<SQL dialect="mssql">
fname + ' ' + lname
</SQL>
<SQL dialect="generic">
"lname"
</SQL>
Expand Down Expand Up @@ -456,4 +462,10 @@ CONCAT(`customer`.`fname`, ' ', `customer`.`lname`)
</SchemaGrant>
</Role>

<Role name="No HR Cube">
<SchemaGrant access="all">
<CubeGrant cube="HR" access="none"/>
</SchemaGrant>
</Role>

</Schema>
Binary file modified lib/mondrian-resource.jar
Binary file not shown.
7 changes: 2 additions & 5 deletions src/main/mondrian/jolap/MondrianJolapDimension.java
Expand Up @@ -11,10 +11,7 @@
*/
package mondrian.jolap;

import mondrian.olap.Dimension;
import mondrian.olap.Hierarchy;
import mondrian.olap.Level;
import mondrian.olap.Property;
import mondrian.olap.*;

import javax.olap.OLAPException;
import javax.olap.metadata.CubeDimensionAssociation;
Expand Down Expand Up @@ -76,7 +73,7 @@ public void setTime(boolean input) throws OLAPException {
}

public boolean isTime() {
return dimension.getDimensionType() == Dimension.TIME;
return dimension.getDimensionType() == DimensionType.TimeDimension;
}

public void setMeasure(boolean input) throws OLAPException {
Expand Down

0 comments on commit beffece

Please sign in to comment.