Skip to content

Commit

Permalink
MONDRIAN:
Browse files Browse the repository at this point in the history
* Allows JPivot 1.5 to use XML/A against Mondrian 2.0.1, not taking into account the latest compiled expression changes. To get mondrian.war stable again, we will need to upgrade JPivot.
* New XML/A tests now run as part of a full test run - they were being skipped.
* Mondrian taglib working again - DriverManager fix
* mondrian.war will include XML/A test examples that can be run as part of XML for Analysis Tester UI.
* Derby build works.

[git-p4: depot-paths = "//open/mondrian/": change = 4955]
  • Loading branch information
Sherman Wood committed Jan 5, 2006
1 parent 2b12018 commit 15f2c78
Show file tree
Hide file tree
Showing 22 changed files with 525 additions and 228 deletions.
51 changes: 29 additions & 22 deletions build.xml
Expand Up @@ -172,6 +172,7 @@ demo/access/MondrianFoodMart.mdb"/>
<fileset dir="${testclasses.dir}" includes="**/*.class,**/*.properties"/>
<fileset dir="." includes="${generated.java.files},${generated.lib.files}"/>
<fileset dir="demo/derby/foodmart"/>
<fileset dir="${build.dir}" />
</delete>
</target>

Expand Down Expand Up @@ -280,6 +281,10 @@ unzip-FoodMartAccessDB"/>
<include name="javax/**/*.java"/>
<include name="org/**/*.java"/>
</javac>
<copy file="src/main/mondrian/rolap/aggmatcher/DefaultRules.xml"
todir="${classes.dir}"/>
<copy file="src/main/mondrian/rolap/aggmatcher/DefaultRulesSchema.xml"
todir="${classes.dir}"/>
</target>

<target name="compile.tests" depends="info,compile.java">
Expand Down Expand Up @@ -697,10 +702,6 @@ doc/**/*.xml"

<target name="jar" depends="compile,compile.tests">
<mkdir dir="${lib.dir}" />
<copy file="src/main/mondrian/rolap/aggmatcher/DefaultRules.xml"
todir="${classes.dir}"/>
<copy file="src/main/mondrian/rolap/aggmatcher/DefaultRulesSchema.xml"
todir="${classes.dir}"/>
<zip
zipfile="${jar.file}"
update="true">
Expand Down Expand Up @@ -788,7 +789,7 @@ You should set scp.user, scp.password and scp.path in build.properties">
</copy>
</target>

<target name="war" depends="copy-jars,jar,compile.tests" description="
<target name="war" depends="jar,compile.tests" description="
Creates mondrian.war based upon jpivot.war.
Assumes that mondrian.jar exists (use 'jar' target)">
<filter filtersfile="mondrian.properties"/>
Expand All @@ -798,20 +799,19 @@ Assumes that mondrian.jar exists (use 'jar' target)">
<delete file="${lib.dir}/web.xml"/>
<copy file="${webapp.dir}/WEB-INF/web-jpivot.xml"
filtering="true" tofile="${lib.dir}/web.xml"/>
<!-- always replace jpivot's index.jsp -->
<copy overwrite="yes" file="${webapp.dir}/index.jsp" tofile="${lib.dir}/index.jsp"/>


<war warfile="${war.file}"
update="yes"
webxml="${lib.dir}/web.xml">
<webinf dir="${webapp.dir}/WEB-INF" excludes="web.xml,web-jpivot.xml"/>
<!-- 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/**/*"/>
<fileset dir="${lib.dir}" includes="index.jsp"/>
<fileset dir="${webapp.dir}" excludes="WEB-INF/**/*,index.jsp"/>
<lib dir="${lib.dir}" includes="${name}.jar"/>
<lib dir="${lib.dir}" includes="eigenbase-*.jar"/>
<classes dir="${testclasses.dir}" includes="mondrian/xmla/*.*"/>
<lib dir="${testlib.dir}" includes="xmlunit*.jar"/>
<classes dir="${javatest.dir}" includes="mondrian/xmla/**/*.xml"/>
<classes dir="${testclasses.dir}" includes="mondrian/xmla/test/**/*.*"/>
<classes dir="${testclasses.dir}" includes="mondrian/test/TestContext.*"/>
</war>
</target>
Expand All @@ -823,27 +823,34 @@ Assumes that mondrian.jar exists (use 'jar' target)">
<target name="derby-war" depends="jar,compile.tests,unzip-FoodMartDerbyDB" description="
Creates mondrian-embedded.war based upon jpivot.war for Derby with embedded database.">
<filter filtersfile="mondrian.properties"/>
<mkdir dir="${lib.dir}" />
<delete dir="${build.dir}/mondrian-embedded" />
<mkdir dir="${build.dir}/mondrian-embedded" />
<delete file="${war.embeddedDb.file}"/>
<copy file="${lib.dir}/jpivot.war" tofile="${war.embeddedDb.file}"/>
<delete file="${lib.dir}/web.xml"/>
<!-- always replace jpivot's index.jsp -->
<copy overwrite="yes" file="${webapp.dir}/index.jsp" tofile="${lib.dir}/index.jsp"/>
<unzip src="${lib.dir}/jpivot.war" dest="${build.dir}/mondrian-embedded"/>

<delete>
<fileset dir="${build.dir}/mondrian-embedded" includes="index.jsp,xmla.jsp"/>
<fileset dir="${build.dir}/mondrian-embedded/WEB-INF" includes="datasources.xml,mondrian.properties"/>
<fileset dir="${build.dir}/mondrian-embedded/WEB-INF/queries" includes="*.jsp,*.xml"/>
<fileset dir="${build.dir}/mondrian-embedded/WEB-INF/lib" includes="${name}.jar,eigenbase-*.jar,*.xml"/>
</delete>

<war warfile="${war.embeddedDb.file}"
update="yes"
webxml="${demo.dir}/derby/web.xml">
<webinf dir="${webapp.dir}/WEB-INF" excludes="web.xml,web-jpivot.xml"/>
<!-- We pick up the libs from JPivot here -->
<webinf dir="${build.dir}/mondrian-embedded/WEB-INF" excludes="web.xml,web-jpivot.xml"/>
<webinf dir="${webapp.dir}/WEB-INF" excludes="web.xml,web-jpivot.xml,datasources.xml"/>
<webinf dir="${demo.dir}/derby" includes="queries/*.jsp,datasources.xml"/>
<!-- 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/**/*"/>
<fileset dir="${lib.dir}" includes="index.jsp"/>
<fileset dir="${build.dir}/mondrian-embedded" excludes="WEB-INF/**/*"/>
<fileset dir="${webapp.dir}" excludes="index.jsp,busy.jsp,error.jsp,WEB-INF/**/*"/>
<lib dir="${lib.dir}" includes="${name}.jar"/>
<lib dir="${lib.dir}" includes="eigenbase-*.jar"/>
<lib dir="${testlib.dir}" includes="derby.jar"/>
<lib dir="${testlib.dir}" includes="xmlunit*.jar,derby.jar"/>
<classes dir="${demo.dir}/derby" includes="foodmart/**/*.*"/>
<classes dir="${testclasses.dir}" includes="mondrian/xmla/*.*"/>
<classes dir="${javatest.dir}" includes="mondrian/xmla/**/*.xml"/>
<classes dir="${testclasses.dir}" includes="mondrian/xmla/test/**/*.*"/>
<classes dir="${testclasses.dir}" includes="mondrian/test/TestContext.*"/>
</war>
</target>
Expand Down
6 changes: 3 additions & 3 deletions demo/derby/datasources.xml
@@ -1,10 +1,10 @@
<?xml version="1.0"?>
<DataSources>
<DataSource>
<DataSourceName>MondrianFoodMart</DataSourceName>
<DataSourceName>Provider=Mondrian;DataSource=MondrianFoodMart;</DataSourceName>
<DataSourceDescription>FoodMart 2000 Data Warehouse</DataSourceDescription>
<URL>http://localhost:8080/mondrian/xmla</URL>
<DataSourceInfo>Provider=mondrian;Jdbc='jdbc:derby:classpath:/foodmart';Catalog=/WEB-INF/queries/FoodMart.xml;JdbcDrivers=org.apache.derby.jdbc.EmbeddedDriver;RoleXX='California manager';JdbcUser=APP;JdbcPassword=APP</DataSourceInfo>
<URL>http://localhost:8080/mondrian-embedded/xmla</URL>
<DataSourceInfo>Provider=mondrian;Jdbc='jdbc:derby:classpath:/foodmart';Catalog=/WEB-INF/queries/FoodMart.xml;JdbcDrivers=org.apache.derby.jdbc.EmbeddedDriver;JdbcUser=APP;JdbcPassword=APP;PoolNeeded=false;</DataSourceInfo>
<ProviderName>Mondrian</ProviderName>
<ProviderType>MDP</ProviderType>
<AuthenticationMode>Unauthenticated</AuthenticationMode>
Expand Down
21 changes: 21 additions & 0 deletions demo/derby/queries/xmla.jsp
@@ -0,0 +1,21 @@
<%@ page session="true" pageEncoding="UTF-8" contentType="text/html; charset=ISO-8859-1" %>
<%@ taglib uri="http://www.tonbeller.com/jpivot" prefix="jp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>


<!--
* Change uri attribute to your deployment of this webapp.
* The dataSource attribute is necessary for Mondrian's XMLA.
-->
<jp:xmlaQuery id="query01"
uri="http://localhost:8080/mondrian-embedded/xmla"
dataSource="Provider=Mondrian;DataSource=MondrianFoodMart;"
catalog="FoodMart">
select
{[Measures].[Unit Sales], [Measures].[Store Cost], [Measures].[Store Sales]} on columns,
{([Promotion Media].[All Media], [Product].[All Products])} ON rows
from Sales
where ([Time].[1997])
</jp:xmlaQuery>

<c:set var="title01" scope="session">Accessing Mondrian By XMLA</c:set>
10 changes: 5 additions & 5 deletions demo/derby/web.xml
Expand Up @@ -31,15 +31,15 @@ database which is exploded in the class path of the WAR.

<context-param>
<param-name>connectString</param-name>
<param-value>Provider=mondrian;Jdbc='jdbc:derby:classpath:/foodmart';Catalog=/WEB-INF/queries/FoodMart.xml;JdbcDrivers=org.apache.derby.jdbc.EmbeddedDriver;RoleXX='California manager';JdbcUser=APP;JdbcPassword=APP</param-value>
<param-value>Provider=mondrian;Jdbc='jdbc:derby:classpath:/foodmart';Catalog=/WEB-INF/queries/FoodMart.xml;JdbcDrivers=org.apache.derby.jdbc.EmbeddedDriver;JdbcUser=APP;JdbcPassword=APP;PoolNeeded=false;</param-value>
</context-param>

<filter>
<filter-name>JPivotController</filter-name>
<filter-class>com.tonbeller.wcf.controller.RequestFilter</filter-class>
<init-param>
<param-name>indexJSP</param-name>
<param-value>/index.jsp</param-value>
<param-value>/index.html</param-value>
<description>forward to this page if session is new</description>
</init-param>
<init-param>
Expand Down Expand Up @@ -81,13 +81,13 @@ database which is exploded in the class path of the WAR.
<servlet-class>mondrian.web.servlet.MDXQueryServlet</servlet-class>
<init-param>
<param-name>connectString</param-name>
<param-value>Provider=mondrian;Jdbc='jdbc:derby:classpath:/foodmart';Catalog=/WEB-INF/queries/FoodMart.xml;JdbcDrivers=org.apache.derby.jdbc.EmbeddedDriver;RoleXX='California manager';JdbcUser=APP;JdbcPassword=APP</param-value>
<param-value>Provider=mondrian;Jdbc='jdbc:derby:classpath:/foodmart';Catalog=/WEB-INF/queries/FoodMart.xml;JdbcDrivers=org.apache.derby.jdbc.EmbeddedDriver;JdbcUser=APP;JdbcPassword=APP;PoolNeeded=false;</param-value>
</init-param>
</servlet>

<servlet>
<servlet-name>MondrianXmlaServlet</servlet-name>
<servlet-class>mondrian.xmla.XmlaServlet</servlet-class>
<servlet-class>mondrian.xmla.impl.DefaultXmlaServlet</servlet-class>
<init-param>
<param-name>DataSourcesConfig</param-name>
<param-value>datasources.xml</param-value>
Expand Down Expand Up @@ -138,7 +138,7 @@ database which is exploded in the class path of the WAR.
</servlet-mapping>

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>

<taglib>
Expand Down
Binary file modified lib/jpivot.war
Binary file not shown.
5 changes: 3 additions & 2 deletions src/main/mondrian/olap/DriverManager.java
Expand Up @@ -12,6 +12,7 @@

package mondrian.olap;
import mondrian.rolap.RolapConnection;
import mondrian.rolap.RolapConnectionProperties;
import mondrian.spi.impl.ServletContextCatalogLocator;

import javax.servlet.ServletContext;
Expand Down Expand Up @@ -55,13 +56,13 @@ public static Connection getConnection(
private static void fixup(
Util.PropertyList connectionProperties,
ServletContext servletContext) {
String catalog = connectionProperties.get("catalog");
String catalog = connectionProperties.get(RolapConnectionProperties.Catalog);
if (servletContext != null) {
final ServletContextCatalogLocator locator =
new ServletContextCatalogLocator(servletContext);
final String newCatalog = locator.locate(catalog);
if (!newCatalog.equals(catalog)) {
connectionProperties.put("catalog", catalog);
connectionProperties.put(RolapConnectionProperties.Catalog, newCatalog);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion testsrc/main/mondrian/test/Main.java
Expand Up @@ -145,7 +145,7 @@ public static Test suite() throws Exception {
suite.addTestSuite(AccessControlTest.class);
suite.addTestSuite(ParserTest.class);
suite.addTestSuite(ParentChildHierarchyTest.class);
suite.addTestSuite(XmlaTest.class);
suite.addTest(XmlaTest.suite());
if (isRunOnce()) suite.addTestSuite(TestCalculatedMembers.class);
suite.addTestSuite(RaggedHierarchyTest.class);
suite.addTestSuite(CompatibilityTest.class);
Expand Down

0 comments on commit 15f2c78

Please sign in to comment.