Search in sources :

Example 1 with DynamicSchemaProcessor

use of mondrian.spi.DynamicSchemaProcessor in project mondrian by pentaho.

the class DynamicSchemaProcessorTest method testDSPBasics.

/**
 * Tests to make sure that our base DynamicSchemaProcessor works, with no
 * replacement. Does not test Mondrian is able to connect with the schema
 * definition.
 */
public void testDSPBasics() {
    DynamicSchemaProcessor dsp = new BaseDsp();
    Util.PropertyList dummy = new Util.PropertyList();
    String processedSchema = "";
    try {
        processedSchema = dsp.processSchema("", dummy);
    } catch (Exception e) {
        // TODO some other assert failure message
        assertEquals(0, 1);
    }
    Assert.assertEquals(TEMPLATE_SCHEMA, processedSchema);
}
Also used : DynamicSchemaProcessor(mondrian.spi.DynamicSchemaProcessor) Util(mondrian.olap.Util)

Example 2 with DynamicSchemaProcessor

use of mondrian.spi.DynamicSchemaProcessor in project pentaho-platform by pentaho.

the class MondrianCatalogHelper method applyDSP.

protected String applyDSP(IPentahoSession ps, String catalogDsInfo, String catalogDefinition) throws Exception {
    PropertyList pl = Util.parseConnectString(catalogDsInfo);
    String dsp = pl.get(RolapConnectionProperties.DynamicSchemaProcessor.name());
    if (dsp != null) {
        if (MondrianCatalogHelper.logger.isDebugEnabled()) {
            // $NON-NLS-1$
            MondrianCatalogHelper.logger.debug("applyDSP: " + dsp);
        }
        DynamicSchemaProcessor dynProc = ClassResolver.INSTANCE.instantiateSafe(dsp);
        pl.put("Locale", getLocale().toString());
        return dynProc.processSchema(catalogDefinition, pl);
    } else {
        return docAtUrlToString(catalogDefinition, ps);
    }
}
Also used : PropertyList(mondrian.olap.Util.PropertyList) LocalizingDynamicSchemaProcessor(mondrian.i18n.LocalizingDynamicSchemaProcessor) DynamicSchemaProcessor(mondrian.spi.DynamicSchemaProcessor)

Aggregations

DynamicSchemaProcessor (mondrian.spi.DynamicSchemaProcessor)2 LocalizingDynamicSchemaProcessor (mondrian.i18n.LocalizingDynamicSchemaProcessor)1 Util (mondrian.olap.Util)1 PropertyList (mondrian.olap.Util.PropertyList)1