Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions application/pivot/common/README.container.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ split over several cross-referencing files, point
|---|---|---|
| `DAANSE_CATALOG_RESOURCE` | `/app/catalog/catalog.xmi` | Primary catalog mapping file (EMF XMI with a Catalog root element) |
| `DAANSE_CATALOG_ADDITIONAL_GLOBS` | *(unset)* | Comma separated glob patterns for additional mapping resources |
| `DAANSE_CONTEXT_NAME` | `daanse` | Name of the OLAP context |
| `DAANSE_CONTEXT_DESCRIPTION` | `Daanse XMLA Server` | Description of the OLAP context |
| `DAANSE_USE_AGGREGATES` | `false` | Use aggregate tables |
| `DAANSE_XMLA_PATH` | `/xmla` | Servlet pattern of the XMLA endpoint |
| `DAANSE_CORS_ENABLED` | `true` | Register the CORS filter |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ public static Configuration createEnvBasicContext(ConfigurationAdmin ca, String
filter(ServerConstants.PROP_IDENT, ServerConstants.IDENT_MAPPING));
props.put(Constants.BASIC_CONTEXT_REF_NAME_DIALECT_FACTORY + ServerConstants.TARGET_EXT,
filter(DaanseDialectConstants.DIALECT_NAME_PROPERTY, dialectName));
props.put("name", Env.get(ServerConstants.ENV_CONTEXT_NAME, ServerConstants.DEFAULT_CONTEXT_NAME));
props.put("description",
Env.get(ServerConstants.ENV_CONTEXT_DESCRIPTION, ServerConstants.DEFAULT_CONTEXT_DESCRIPTION));
props.put("useAggregates", Env.get(ServerConstants.ENV_USE_AGGREGATES, false));

configuration.update(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ private ServerConstants() {

public static final String ENV_CATALOG_RESOURCE = "DAANSE_CATALOG_RESOURCE";
public static final String ENV_CATALOG_ADDITIONAL_GLOBS = "DAANSE_CATALOG_ADDITIONAL_GLOBS";
public static final String ENV_CONTEXT_NAME = "DAANSE_CONTEXT_NAME";
public static final String ENV_CONTEXT_DESCRIPTION = "DAANSE_CONTEXT_DESCRIPTION";
public static final String ENV_USE_AGGREGATES = "DAANSE_USE_AGGREGATES";
public static final String ENV_XMLA_PATH = "DAANSE_XMLA_PATH";
public static final String ENV_CORS_ENABLED = "DAANSE_CORS_ENABLED";
Expand All @@ -91,7 +89,5 @@ private ServerConstants() {
public static final String ENV_CORS_ALLOW_CREDENTIALS = "DAANSE_CORS_ALLOW_CREDENTIALS";

public static final String DEFAULT_CATALOG_RESOURCE = "/app/catalog/catalog.xmi";
public static final String DEFAULT_CONTEXT_NAME = "daanse";
public static final String DEFAULT_CONTEXT_DESCRIPTION = "Daanse XMLA Server";
public static final String DEFAULT_XMLA_PATH = "/xmla";
}
4 changes: 3 additions & 1 deletion application/playground/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ log/*
catalog/*
!catalog/.keep
load/*
!load/.keep
!load/.keep
!load/*.cfg
!catalog/*.xmi
35 changes: 35 additions & 0 deletions application/playground/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,41 @@ The playground application source can be found at:
- Java development environment
- Understanding of security implications

## Default configuration

The `load/` directory is watched by Felix FileInstall (its default directory) and ships a
working two-database default: one catalog served from **PostgreSQL** and one from
**Oracle**, both published on the **same XMLA endpoint**.

| File(s) | Purpose |
|---|---|
| `daanse.jdbc.datasource.{postgresql,oracle}.DataSource-*.cfg` | one DataSource per database, tagged `daanse.ident=ds-pg` / `ds-ora` |
| `daanse.jdbc.datasource.pools.hikari.ConnectionPool-*.cfg` | one connection pool per DataSource |
| `daanse.rolap.mapping.model.provider.EmfMappingProvider-*.cfg` | one mapping per catalog XMI (`catalog/catalog.postgres.xmi`, `catalog/catalog.oracle.xmi`) |
| `daanse.rolap.core.BasicContext-*.cfg` | one context per catalog: pool + mapping + dialect (`POSTGRESQL` / `ORACLE`) |
| `daanse.olap.core.BasicContextGroup-main.cfg` | groups both contexts (`context.target=(daanse.ident=ctx-*)`) |
| `daanse.olap.xmla.connector.OlapXmlaConnector-main.cfg` | XMLA service over the group |
| `org.eclipse.daanse.xmla.server.whiteboard.servlet.XmlaServlet-main.cfg` | servlet at `/xmla` |

The endpoint is `http://localhost:8090/xmla` (HTTP port from the bndrun). Both catalogs —
`Playground Postgres` (cube `CubePostgres`) and `Playground Oracle` (cube `CubeOracle`) —
appear in `DBSCHEMA_CATALOGS` of that one endpoint; each expects a table
`fact("key","value")` / `FACT("KEY","VALUE")`.

Matching local databases:

```bash
podman run -d --name playground-pg -e POSTGRES_USER=daanse -e POSTGRES_PASSWORD=daanse \
-e POSTGRES_DB=daanse -p 5432:5432 docker.io/library/postgres:17-alpine
podman run -d --name playground-ora -e ORACLE_PASSWORD=admin -e APP_USER=daanse \
-e APP_USER_PASSWORD=daanse -p 1521:1521 docker.io/gvenzl/oracle-free:23-slim
```

Then create/seed the fact tables (`fact` lowercase in PostgreSQL, `FACT` uppercase in
Oracle service `FREEPDB1`) and start the server with `./start` (or
`java -jar target/daanse.playground.jar` from this directory — FileInstall resolves
`./load` and the mappings resolve `./catalog` relative to the working directory).

## Important Notes

⚠️ **Security Warning**: This application should only be used in development environments due to the increased attack surface from the comprehensive component set.
Expand Down
19 changes: 19 additions & 0 deletions application/playground/catalog/catalog.oracle.xmi
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:relational="http://www.omg.org/spec/CWM/1.1/resource/relational" xmlns:rolapcat="https://www.daanse.org/spec/org.eclipse.daanse.rolap.mapping/catalog" xmlns:rolapcube="https://www.daanse.org/spec/org.eclipse.daanse.rolap.mapping/olap/cube" xmlns:rolapmeas="https://www.daanse.org/spec/org.eclipse.daanse.rolap.mapping/olap/cube/measure" xmlns:rolapsrc="https://www.daanse.org/spec/org.eclipse.daanse.rolap.mapping/database/source">
<rolapcat:Catalog xmi:id="_catalog_ora" name="Playground Oracle" importedElement="_schema">
<ownedElement xsi:type="rolapsrc:TableSource" xmi:id="_tablesource_fact" name="FACT" table="_table_fact"/>
<ownedElement xsi:type="rolapcube:PhysicalCube" xmi:id="_cube_ora" name="CubeOracle" source="_tablesource_fact">
<measureGroups xmi:id="_measuregroup_ora" name="CubeOracle">
<measures xsi:type="rolapmeas:SumMeasure" xmi:id="_sum_value_ora" name="ValueSum" column="_column_fact_value"/>
</measureGroups>
</ownedElement>
</rolapcat:Catalog>
<relational:SQLSimpleType xmi:id="_sqlsimpletype_character_varying" name="CHARACTER VARYING" typeNumber="12"/>
<relational:SQLSimpleType xmi:id="_sqlsimpletype_integer" name="INTEGER" typeNumber="4"/>
<relational:Schema xmi:id="_schema" importer="_catalog_ora">
<ownedElement xsi:type="relational:Table" xmi:id="_table_fact" name="FACT">
<feature xsi:type="relational:Column" xmi:id="_column_fact_key" name="KEY" type="_sqlsimpletype_character_varying"/>
<feature xsi:type="relational:Column" xmi:id="_column_fact_value" name="VALUE" type="_sqlsimpletype_integer"/>
</ownedElement>
</relational:Schema>
</xmi:XMI>
19 changes: 19 additions & 0 deletions application/playground/catalog/catalog.postgres.xmi
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:relational="http://www.omg.org/spec/CWM/1.1/resource/relational" xmlns:rolapcat="https://www.daanse.org/spec/org.eclipse.daanse.rolap.mapping/catalog" xmlns:rolapcube="https://www.daanse.org/spec/org.eclipse.daanse.rolap.mapping/olap/cube" xmlns:rolapmeas="https://www.daanse.org/spec/org.eclipse.daanse.rolap.mapping/olap/cube/measure" xmlns:rolapsrc="https://www.daanse.org/spec/org.eclipse.daanse.rolap.mapping/database/source">
<rolapcat:Catalog xmi:id="_catalog_pg" name="Playground Postgres" importedElement="_schema">
<ownedElement xsi:type="rolapsrc:TableSource" xmi:id="_tablesource_fact" name="fact" table="_table_fact"/>
<ownedElement xsi:type="rolapcube:PhysicalCube" xmi:id="_cube_pg" name="CubePostgres" source="_tablesource_fact">
<measureGroups xmi:id="_measuregroup_pg" name="CubePostgres">
<measures xsi:type="rolapmeas:SumMeasure" xmi:id="_sum_value_pg" name="ValueSum" column="_column_fact_value"/>
</measureGroups>
</ownedElement>
</rolapcat:Catalog>
<relational:SQLSimpleType xmi:id="_sqlsimpletype_character_varying" name="CHARACTER VARYING" typeNumber="12"/>
<relational:SQLSimpleType xmi:id="_sqlsimpletype_integer" name="INTEGER" typeNumber="4"/>
<relational:Schema xmi:id="_schema" importer="_catalog_pg">
<ownedElement xsi:type="relational:Table" xmi:id="_table_fact" name="fact">
<feature xsi:type="relational:Column" xmi:id="_column_fact_key" name="key" type="_sqlsimpletype_character_varying"/>
<feature xsi:type="relational:Column" xmi:id="_column_fact_value" name="value" type="_sqlsimpletype_integer"/>
</ownedElement>
</relational:Schema>
</xmi:XMI>
13 changes: 11 additions & 2 deletions application/playground/daanse.playground.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
-runproperties: \
org.slf4j.simpleLogger.defaultLogLevel=error,\
org.osgi.service.http.port=8090,\
logback.configurationFile=${.}/logback.xml,\
daanse.probe.catalog.dir=${.}/catalog
logback.configurationFile=${.}/logback.xml

-runpath: \
ch.qos.logback.classic,\
Expand All @@ -33,7 +32,12 @@
bnd.identity;id='org.glassfish.hk2.osgi-resource-locator',\
bnd.identity;id='org.apache.felix.metatype',\
bnd.identity;id='org.eclipse.daanse.olap.xmla.connector',\
bnd.identity;id='org.eclipse.daanse.olap.xmla.connector.multidimensional',\
bnd.identity;id='org.eclipse.daanse.olap.xmla.connector.relational',\
bnd.identity;id='org.eclipse.daanse.olap.xmla.connector.relational.oledb',\
bnd.identity;id='org.eclipse.daanse.xmla.server.whiteboard.servlet',\
bnd.identity;id='org.eclipse.daanse.xmla.server.auth.roles',\
bnd.identity;id='org.eclipse.daanse.xmla.server.auth.dummy',\
bnd.identity;id='ch.qos.logback.classic',\
bnd.identity;id='org.eclipse.daanse.sql.jdbc.impl',\
bnd.identity;id='org.eclipse.daanse.mdx.parser.api',\
Expand Down Expand Up @@ -121,6 +125,9 @@
org.eclipse.daanse.olap.spi;version='[0.0.1,0.0.2)',\
org.eclipse.daanse.olap.util.format;version='[0.0.1,0.0.2)',\
org.eclipse.daanse.olap.xmla.connector;version='[0.0.1,0.0.2)',\
org.eclipse.daanse.olap.xmla.connector.multidimensional;version='[0.0.1,0.0.2)',\
org.eclipse.daanse.olap.xmla.connector.relational;version='[0.0.1,0.0.2)',\
org.eclipse.daanse.olap.xmla.connector.relational.oledb;version='[0.0.1,0.0.2)',\
org.eclipse.daanse.rolap.core;version='[0.0.1,0.0.2)',\
org.eclipse.daanse.rolap.mapping.model;version='[0.0.1,0.0.2)',\
org.eclipse.daanse.server.application.playground;version='[0.0.1,0.0.2)',\
Expand Down Expand Up @@ -163,6 +170,8 @@
org.eclipse.daanse.xmla.model.soap;version='[0.0.1,0.0.2)',\
org.eclipse.daanse.xmla.model.xmla;version='[0.0.1,0.0.2)',\
org.eclipse.daanse.xmla.server.adapter.emf;version='[0.0.1,0.0.2)',\
org.eclipse.daanse.xmla.server.auth.dummy;version='[0.0.1,0.0.2)',\
org.eclipse.daanse.xmla.server.auth.roles;version='[0.0.1,0.0.2)',\
org.eclipse.daanse.xmla.server.whiteboard.servlet;version='[0.0.1,0.0.2)',\
org.eclipse.emf.common;version='[2.44.0,2.44.1)',\
org.eclipse.emf.ecore;version='[2.41.0,2.41.1)',\
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
daanse.ident = "ds-ora"
serverName = "localhost"
portNumber = I"1521"
serviceName = "FREEPDB1"
user = "daanse"
.password = "daanse"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
daanse.ident = "pool-ora"
dataSource.target = "(daanse.ident=ds-ora)"
poolName = "playground-ora"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
daanse.ident = "pool-pg"
dataSource.target = "(daanse.ident=ds-pg)"
poolName = "playground-pg"
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
daanse.ident = "ds-pg"
host = "localhost"
port = i[ \
"5432", \
]
dbname = "daanse"
user = "daanse"
.password = "daanse"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
daanse.ident = "group-main"
context.target = "(daanse.ident=ctx-*)"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
daanse.ident = "xmla-main"
contextGroup.target = "(daanse.ident=group-main)"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
daanse.ident = "ctx-ora"
connectionPool.target = "(daanse.ident=pool-ora)"
catalogMappingSuppier.target = "(daanse.ident=map-ora)"
dialectFactory.target = "(org.eclipse.daanse.dialect.name=ORACLE)"
useAggregates = B"false"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
daanse.ident = "ctx-pg"
connectionPool.target = "(daanse.ident=pool-pg)"
catalogMappingSuppier.target = "(daanse.ident=map-pg)"
dialectFactory.target = "(org.eclipse.daanse.dialect.name=POSTGRESQL)"
useAggregates = B"false"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
daanse.ident = "map-ora"
resource.url = "./catalog/catalog.oracle.xmi"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
daanse.ident = "map-pg"
resource.url = "./catalog/catalog.postgres.xmi"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
osgi.http.whiteboard.servlet.pattern = "/xmla"
requirePrincipal = B"false"
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,6 @@ private void createContext(Path path, String matcherKey) throws IOException {
props.put(BASIC_CONTEXT_REF_NAME_DIALECT_FACTORY + TARGET_EXT, "(org.eclipse.daanse.dialect.name=DUCKDB)");
props.put(BASIC_CONTEXT_REF_NAME_CATALOG_MAPPING_SUPPLIER + TARGET_EXT, filterOfMatcherKey(matcherKey));

String catalog_path = path.toString();
String theDescription = "theDescription for " + catalog_path;

String name = path.toString();
if (name == null || name.isEmpty()) {
name = "not_set" + UUID.randomUUID().toString();
}
props.put("name", name);
props.put("description", theDescription);
props.put("catalog.path", catalog_path);
props.put("useAggregates", true);
props.put(KEY_FILE_CONTEXT_MATCHER, matcherKey);
configContext.update(props);
Expand Down
Loading