diff --git a/src/main/java/mondrian/olap/Category.java b/src/main/java/mondrian/olap/Category.java
deleted file mode 100644
index f9d0051..0000000
--- a/src/main/java/mondrian/olap/Category.java
+++ /dev/null
@@ -1,146 +0,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) 2003-2005 Julian Hyde
-// Copyright (C) 2005-2009 Pentaho
-// All Rights Reserved.
-*/
-package mondrian.olap;
-
-/**
- * Cut-down version of mondrian.olap.Category.
- */
-public class Category {
- /**
- * The singleton instance of Category
.
- */
- public static final Category instance = new Category();
-
- private Category() {
- }
-
- public static final int Unknown = 0;
-
- /**
- * Array
is an expression of array type.
- */
- public static final int Array = 1;
-
- /**
- * Dimension
is a dimension expression.
- */
- public static final int Dimension = 2;
-
- /**
- * Hierarchy
is a hierarchy expression.
- */
- public static final int Hierarchy = 3;
-
- /**
- * Level
is a level expression.
- */
- public static final int Level = 4;
-
- /**
- * Logical
is a boolean expression.
- */
- public static final int Logical = 5;
-
- /**
- * Member
is a member expression.
- */
- public static final int Member = 6;
-
- /**
- * Numeric
is a numeric expression.
- */
- public static final int Numeric = 7;
-
- /**
- * Set
is a set of members or tuples.
- */
- public static final int Set = 8;
-
- /**
- * String
is a string expression.
- */
- public static final int String = 9;
-
- /**
- * Tuple
is a tuple expression.
- */
- public static final int Tuple = 10;
-
- /**
- * Symbol
is a symbol, for example the BASC
- * keyword to the Order()
function.
- */
- public static final int Symbol = 11;
-
- /**
- * Cube
is a cube expression.
- */
- public static final int Cube = 12;
-
- /**
- * Value
is any expression yielding a string or numeric value.
- */
- public static final int Value = 13;
-
- /**
- * Integer
is an integer expression. This is a subtype of
- * {@link #Numeric}.
- */
- public static final int Integer = 15;
-
- /**
- * Represents a Null
value
- */
- public static final int Null = 16;
-
- /**
- * Represents an empty expression.
- */
- public static final int Empty = 17;
-
- /**
- * Represents a DataTime expression.
- */
- public static final int DateTime = 18;
-
- /**
- * Expression
is a flag which, when bitwise-OR-ed with a
- * category value, indicates an expression (as opposed to a constant).
- */
- public static final int Expression = 0;
- /** Constant
is a flag which, when bitwise-OR-ed with a
- * category value, indicates a constant (as opposed to an expression). */
- public static final int Constant = 64;
- /** Mask
is a mask to remove flags. */
- public static final int Mask = 31;
-
- /**
- * Returns whether a category represents a scalar type.
- *
- * @param category Category
- * @return Whether is scalar
- */
- public static boolean isScalar(int category) {
- switch (category & Mask) {
- case Value:
- case Logical:
- case Numeric:
- case Integer:
- case String:
- case DateTime:
- return true;
- default:
- return false;
- }
- }
-}
-
-// End Category.java
diff --git a/src/main/java/mondrian/olap/MondrianException.java b/src/main/java/mondrian/olap/MondrianException.java
deleted file mode 100644
index 26df0a3..0000000
--- a/src/main/java/mondrian/olap/MondrianException.java
+++ /dev/null
@@ -1,30 +0,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) 2002-2005 Julian Hyde
-// Copyright (C) 2005-2005 Pentaho and others
-// All Rights Reserved.
-*/
-package mondrian.olap;
-
-/**
- * Cut-down version of MondrianException.
- */
-public class MondrianException extends RuntimeException {
- public MondrianException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public String getLocalizedMessage() {
- return getMessage();
- }
-
- public String getMessage() {
- return "Mondrian Error:" + super.getMessage();
- }
-}
-
-// End MondrianException.java
diff --git a/src/main/java/mondrian/olap/MondrianProperties.java b/src/main/java/mondrian/olap/MondrianProperties.java
deleted file mode 100644
index e07a6cd..0000000
--- a/src/main/java/mondrian/olap/MondrianProperties.java
+++ /dev/null
@@ -1,53 +0,0 @@
-// Generated from MondrianProperties.xml.
-package mondrian.olap;
-
-import org.eigenbase.util.property.*;
-
-/**
- * Cut-down version of MondrianProperties.
- */
-public class MondrianProperties extends MondrianPropertiesBase {
- /**
- * Properties, drawn from {@link System#getProperties},
- * plus the contents of "mondrian.properties" if it
- * exists. A singleton.
- */
- private static final MondrianProperties instance =
- new MondrianProperties();
-
- private MondrianProperties() {
- }
-
- /**
- * Returns the singleton.
- *
- * @return Singleton instance
- */
- public static MondrianProperties instance() {
- // NOTE: We used to instantiate on demand, but
- // synchronization overhead was significant. See
- // MONDRIAN-978.
- return instance;
- }
-
- /**
- * If enabled, first row in the result of an XML/A drill-through request
- * will be filled with the total count of rows in underlying database.
- */
- public transient final BooleanProperty EnableTotalCount =
- new BooleanProperty(
- this, "mondrian.xmla.drillthroughTotalCount.enable", true);
-
- /**
- *
Property that defines - * whether to enable new naming behavior.
- * - *If true, hierarchies are named [Dimension].[Hierarchy]; if false, - * [Dimension.Hierarchy].
- */ - public transient final BooleanProperty SsasCompatibleNaming = - new BooleanProperty( - this, "mondrian.olap.SsasCompatibleNaming", true); -} - -// End MondrianProperties.java diff --git a/src/main/java/mondrian/olap/MondrianPropertiesBase.java b/src/main/java/mondrian/olap/MondrianPropertiesBase.java deleted file mode 100644 index 76c469e..0000000 --- a/src/main/java/mondrian/olap/MondrianPropertiesBase.java +++ /dev/null @@ -1,21 +0,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) 2001-2005 Julian Hyde -// Copyright (C) 2005-2011 Pentaho and others -// All Rights Reserved. -*/ -package mondrian.olap; - -import org.eigenbase.util.property.TriggerableProperties; - -/** - * Cut-down version of MondrianPropertiesBase. - */ -public abstract class MondrianPropertiesBase extends TriggerableProperties { -} - -// End MondrianPropertiesBase.java diff --git a/src/main/java/mondrian/olap/MondrianServer.java b/src/main/java/mondrian/olap/MondrianServer.java deleted file mode 100644 index e169a22..0000000 --- a/src/main/java/mondrian/olap/MondrianServer.java +++ /dev/null @@ -1,117 +0,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) 2006-2010 Pentaho -// All Rights Reserved. -*/ -package mondrian.olap; - -import java.util.*; - -/** - * Cut down version of MondrianServer to make olap4j-xmlaserver happy. - * Will obsolete soon. - */ -public class MondrianServer { - private static final MondrianServer INSTANCE = new MondrianServer(); - - private MondrianVersion version = new MondrianVersion() { - public String getVersionString() { - return null; - } - - public int getMajorVersion() { - return 0; - } - - public int getMinorVersion() { - return 0; - } - - public String getProductName() { - return null; - } - }; - - /** - * Returns the server with the given id. - * - *If id is null, returns the catalog-less server. (The catalog-less - * server can also be acquired using its id.)
- * - *If server is not found, returns null.
- * - * @param instanceId Server instance id - * @return Server, or null if no server with this id - */ - public static MondrianServer forId(String instanceId) { - return INSTANCE; - } - - /** - * Returns the version of this MondrianServer. - * - * @return Server's version - */ - public MondrianVersion getVersion() { - return version; - } - - /** - * Returns a list of MDX keywords. - * @return list of MDX keywords - */ - public ListFor example, if the full version string is "2.3.0", the major - * version is 2. - * - * @return major part of the version number - * @see java.sql.DatabaseMetaData#getDatabaseMajorVersion() - */ - int getMajorVersion(); - - /** - * Returns the minor part of the version number. - * - *
For example, if the full version string is "2.3.0", the minor - * version is 3. - * - * @return minor part of the version number - * - * @see java.sql.DatabaseMetaData#getDatabaseProductVersion() - */ - int getMinorVersion(); - - /** - * Retrieves the name of this database product. - * - * @return database product name - * @see java.sql.DatabaseMetaData#getDatabaseProductName() - */ - String getProductName(); - } - -} - -// End MondrianServer.java diff --git a/src/main/java/mondrian/xmla/DataSourcesConfig.java b/src/main/java/mondrian/xmla/DataSourcesConfig.java deleted file mode 100644 index e042702..0000000 --- a/src/main/java/mondrian/xmla/DataSourcesConfig.java +++ /dev/null @@ -1,370 +0,0 @@ -/* -// This java file was automatically generated -// from XOM model 'datasourcesconfig' -// on Tue Jul 17 22:05:45 PDT 2012 -// Do not edit this file by hand. -*/ - -package mondrian.xmla; -/** - * This is the XML model for XMLA DataSources Configuration. - *
This class was generated from XOM model 'datasourcesconfig' on Tue Jul 17 22:05:45 PDT 2012
- */
-public class DataSourcesConfig {
-
- public static java.lang.Class getXMLDefClass()
- {
- return DataSourcesConfig.class;
- }
-
- public static String[] _elements = {
- "DataSources",
- "DataSource",
- "DataSourceName",
- "DataSourceDescription",
- "URL",
- "DataSourceInfo",
- "ProviderName",
- "ProviderType",
- "AuthenticationMode",
- "Definition",
- "Catalogs",
- "Catalog"
- };
-
- /**
- * The list of data sources supported by XMLA service.
- */
- public static class DataSources extends org.eigenbase.xom.ElementDef
- {
- public DataSources()
- {
- }
-
- public DataSources(org.eigenbase.xom.DOMWrapper _def)
- throws org.eigenbase.xom.XOMException
- {
- try {
- org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", DataSourcesConfig.class);
- org.eigenbase.xom.NodeDef[] _tempArray;
- _tempArray = _parser.getArray(DataSource.class, 0, 0);
- dataSources = new DataSource[_tempArray.length];
- for (int _i = 0; _i < dataSources.length; _i++)
- dataSources[_i] = (DataSource)_tempArray[_i];
- } catch(org.eigenbase.xom.XOMException _ex) {
- throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage());
- }
- }
-
-
- /**
- * The list of data sources supported by XMLA service.
- */
- public DataSource[] dataSources; //optional array
-
- public String getName()
- {
- return "DataSources";
- }
-
- public void display(java.io.PrintWriter _out, int _indent)
- {
- _out.println(getName());
- displayElementArray(_out, "dataSources", dataSources, _indent+1);
- }
- public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent)
- {
- _out.beginTag("DataSources", new org.eigenbase.xom.XMLAttrVector()
- );
- displayXMLElementArray(_out, dataSources);
- _out.endTag("DataSources");
- }
- public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent)
- {
- DataSources _cother = (DataSources)_other;
- boolean _diff = displayElementArrayDiff("dataSources", dataSources, _cother.dataSources, _out, _indent+1);
- return _diff;
- }
- }
-
- /**
- * Definition of a data source.
- */
- public static class DataSource extends org.eigenbase.xom.ElementDef
- {
- public DataSource()
- {
- }
-
- public DataSource(org.eigenbase.xom.DOMWrapper _def)
- throws org.eigenbase.xom.XOMException
- {
- try {
- org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", DataSourcesConfig.class);
- name = _parser.getString(DataSourceName, true);
- description = _parser.getString(DataSourceDescription, true);
- url = _parser.getString(URL, true);
- dataSourceInfo = _parser.getString(DataSourceInfo, true);
- providerName = _parser.getString(ProviderName, true);
- providerType = _parser.getString(ProviderType, true);
- authenticationMode = _parser.getString(AuthenticationMode, true);
- catalogs = (Catalogs)_parser.getElement(Catalogs.class, true);
- } catch(org.eigenbase.xom.XOMException _ex) {
- throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage());
- }
- }
-
-
- /**
- * Name.
- */
- public String name; //required element
- /**
- * Description.
- */
- public String description; //required element
- /**
- * URL of Web Services invocation.
- */
- public String url; //required element
- /**
- * ConnectString of Mondrian (minus the catalog entry).
- * Required, but catalog may override.
- */
- public String dataSourceInfo; //required element
- /**
- * Customized Service Provider Name.
- */
- public String providerName; //required element
- /**
- * Ignored. Only return "MDP" for DISCOVER_DATASOURCES.
- */
- public String providerType; //required element
- /**
- * Ignored. Only return "Unauthenticated" for DISCOVER_DATASOURCES.
- */
- public String authenticationMode; //required element
- /**
- * One or more Catalogs.
- */
- public Catalogs catalogs; //required element
-
- public String getName()
- {
- return "DataSource";
- }
-
- public void display(java.io.PrintWriter _out, int _indent)
- {
- _out.println(getName());
- displayString(_out, "name", name, _indent+1);
- displayString(_out, "description", description, _indent+1);
- displayString(_out, "url", url, _indent+1);
- displayString(_out, "dataSourceInfo", dataSourceInfo, _indent+1);
- displayString(_out, "providerName", providerName, _indent+1);
- displayString(_out, "providerType", providerType, _indent+1);
- displayString(_out, "authenticationMode", authenticationMode, _indent+1);
- displayElement(_out, "catalogs", (org.eigenbase.xom.ElementDef) catalogs, _indent+1);
- }
- public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent)
- {
- _out.beginTag("DataSource", new org.eigenbase.xom.XMLAttrVector()
- );
- displayXMLString(_out, "DataSourceName", name);
- displayXMLString(_out, "DataSourceDescription", description);
- displayXMLString(_out, "URL", url);
- displayXMLString(_out, "DataSourceInfo", dataSourceInfo);
- displayXMLString(_out, "ProviderName", providerName);
- displayXMLString(_out, "ProviderType", providerType);
- displayXMLString(_out, "AuthenticationMode", authenticationMode);
- displayXMLElement(_out, (org.eigenbase.xom.ElementDef) catalogs);
- _out.endTag("DataSource");
- }
- public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent)
- {
- DataSource _cother = (DataSource)_other;
- boolean _diff = displayStringDiff("name", name, _cother.name, _out, _indent+1);
- _diff = _diff && displayStringDiff("description", description, _cother.description, _out, _indent+1);
- _diff = _diff && displayStringDiff("url", url, _cother.url, _out, _indent+1);
- _diff = _diff && displayStringDiff("dataSourceInfo", dataSourceInfo, _cother.dataSourceInfo, _out, _indent+1);
- _diff = _diff && displayStringDiff("providerName", providerName, _cother.providerName, _out, _indent+1);
- _diff = _diff && displayStringDiff("providerType", providerType, _cother.providerType, _out, _indent+1);
- _diff = _diff && displayStringDiff("authenticationMode", authenticationMode, _cother.authenticationMode, _out, _indent+1);
- _diff = _diff && displayElementDiff("catalogs", catalogs, _cother.catalogs, _out, _indent+1);
- return _diff;
- }
- // BEGIN pass-through code block ---
-public static final String PROVIDER_TYPE_TDP = "TDP";
- public static final String PROVIDER_TYPE_MDP = "MDP";
- public static final String PROVIDER_TYPE_DMP = "DMP";
- public static final String AUTH_MODE_UNAUTHENTICATED = "Unauthenticated";
- public static final String AUTH_MODE_AUTHENTICATED = "Authenticated";
- public static final String AUTH_MODE_INTEGRATED = "Integrated";
-
- public String getDataSourceName() {
- return name;
- }
-
- public String getDataSourceDescription() {
- return description;
- }
-
- public String getURL() {
- return url;
- }
-
- public String getDataSourceInfo() {
- return dataSourceInfo;
- }
-
- public String getProviderName() {
- return providerName;
- }
-
- public String[] getProviderType() {
- return new String[] {PROVIDER_TYPE_MDP};
- }
-
- public String getAuthenticationMode() {
- return authenticationMode;
- }
- // END pass-through code block ---
- }
-
- public static final String DataSourceName = "DataSourceName";
-
- public static final String DataSourceDescription = "DataSourceDescription";
-
- public static final String URL = "URL";
-
- public static final String DataSourceInfo = "DataSourceInfo";
-
- public static final String ProviderName = "ProviderName";
-
- public static final String ProviderType = "ProviderType";
-
- public static final String AuthenticationMode = "AuthenticationMode";
-
- public static final String Definition = "Definition";
-
- /**
- * The list of catalogs associated with a data source.
- */
- public static class Catalogs extends org.eigenbase.xom.ElementDef
- {
- public Catalogs()
- {
- }
-
- public Catalogs(org.eigenbase.xom.DOMWrapper _def)
- throws org.eigenbase.xom.XOMException
- {
- try {
- org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", DataSourcesConfig.class);
- org.eigenbase.xom.NodeDef[] _tempArray;
- _tempArray = _parser.getArray(Catalog.class, 0, 0);
- catalogs = new Catalog[_tempArray.length];
- for (int _i = 0; _i < catalogs.length; _i++)
- catalogs[_i] = (Catalog)_tempArray[_i];
- } catch(org.eigenbase.xom.XOMException _ex) {
- throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage());
- }
- }
-
-
- /**
- * The list of catalogs.
- */
- public Catalog[] catalogs; //optional array
-
- public String getName()
- {
- return "Catalogs";
- }
-
- public void display(java.io.PrintWriter _out, int _indent)
- {
- _out.println(getName());
- displayElementArray(_out, "catalogs", catalogs, _indent+1);
- }
- public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent)
- {
- _out.beginTag("Catalogs", new org.eigenbase.xom.XMLAttrVector()
- );
- displayXMLElementArray(_out, catalogs);
- _out.endTag("Catalogs");
- }
- public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent)
- {
- Catalogs _cother = (Catalogs)_other;
- boolean _diff = displayElementArrayDiff("catalogs", catalogs, _cother.catalogs, _out, _indent+1);
- return _diff;
- }
- }
-
- public static class Catalog extends org.eigenbase.xom.ElementDef
- {
- public Catalog()
- {
- }
-
- public Catalog(org.eigenbase.xom.DOMWrapper _def)
- throws org.eigenbase.xom.XOMException
- {
- try {
- org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", DataSourcesConfig.class);
- name = (String)_parser.getAttribute("name", "String", null, null, true);
- dataSourceInfo = _parser.getString(DataSourceInfo, false);
- definition = _parser.getString(Definition, true);
- } catch(org.eigenbase.xom.XOMException _ex) {
- throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage());
- }
- }
-
- public String name; // required attribute
-
- /**
- * ConnectString of Mondrian (minus the catalog entry).
- * This entry is optional; if present, it overrides the
- * DataSourceInfo within the DataSource.
- */
- public String dataSourceInfo; //optional element
- /**
- * URI of the schema definition file, for example
- * "/WEB-INF/schema/Marketing.xml".
- */
- public String definition; //required element
-
- public String getName()
- {
- return "Catalog";
- }
-
- public void display(java.io.PrintWriter _out, int _indent)
- {
- _out.println(getName());
- displayAttribute(_out, "name", name, _indent+1);
- displayString(_out, "dataSourceInfo", dataSourceInfo, _indent+1);
- displayString(_out, "definition", definition, _indent+1);
- }
- public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent)
- {
- _out.beginTag("Catalog", new org.eigenbase.xom.XMLAttrVector()
- .add("name", name)
- );
- displayXMLString(_out, "DataSourceInfo", dataSourceInfo);
- displayXMLString(_out, "Definition", definition);
- _out.endTag("Catalog");
- }
- public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent)
- {
- Catalog _cother = (Catalog)_other;
- boolean _diff = displayAttributeDiff("name", name, _cother.name, _out, _indent+1);
- _diff = _diff && displayStringDiff("dataSourceInfo", dataSourceInfo, _cother.dataSourceInfo, _out, _indent+1);
- _diff = _diff && displayStringDiff("definition", definition, _cother.definition, _out, _indent+1);
- return _diff;
- }
- }
-
-
-}
diff --git a/src/main/java/mondrian/xmla/DataSourcesConfig.xml b/src/main/java/mondrian/xmla/DataSourcesConfig.xml
deleted file mode 100644
index 59bffe1..0000000
--- a/src/main/java/mondrian/xmla/DataSourcesConfig.xml
+++ /dev/null
@@ -1,167 +0,0 @@
-
-
-
- The list of data sources supported by XMLA service. The list of catalogs associated with a data source. A condition is a {@link mondrian.olap.Util.Function1} whose return
+ * A condition is a {@link org.olap4j.xmla.server.impl.Util.Function1} whose return
* type is boolean.
*
* Restrictions are used in each Rowset's discovery request. If there is no
diff --git a/src/main/java/mondrian/xmla/RowsetDefinition.java b/src/main/java/mondrian/xmla/RowsetDefinition.java
index 6282cac..c1d8679 100644
--- a/src/main/java/mondrian/xmla/RowsetDefinition.java
+++ b/src/main/java/mondrian/xmla/RowsetDefinition.java
@@ -10,8 +10,8 @@
*/
package mondrian.xmla;
-import mondrian.olap.*;
-import mondrian.util.Composite;
+import org.olap4j.xmla.server.impl.Composite;
+import org.olap4j.xmla.server.impl.Util;
import org.olap4j.OlapConnection;
import org.olap4j.OlapException;
@@ -37,7 +37,8 @@
import java.text.SimpleDateFormat;
import java.util.*;
-import static mondrian.olap.Util.filter;
+import static org.olap4j.xmla.server.impl.Util.filter;
+
import static mondrian.xmla.XmlaConstants.*;
import static mondrian.xmla.XmlaHandler.getExtra;
@@ -1814,6 +1815,7 @@ public void populateImpl(
XmlaResponse response, OlapConnection connection, List
-
-