mondrian.spi.impl
Class FilterDynamicSchemaProcessor

java.lang.Object
  extended by mondrian.spi.impl.FilterDynamicSchemaProcessor
All Implemented Interfaces:
DynamicSchemaProcessor
Direct Known Subclasses:
LocalizingDynamicSchemaProcessor

public class FilterDynamicSchemaProcessor
extends Object
implements DynamicSchemaProcessor

Implementation of DynamicSchemaProcessor which allows a derived class to easily process a schema file.

Mondrian's default mechanism for loading schema files, if no DynamicSchemaProcessor is specified, is to use Apache VFS (virtual file system) to resolve the URL to a stream, and to read the contents of the stream into a string.

FilterDynamicSchemaProcessor implements exactly the same mechanism, but makes it easy for a derived class to override the mechanism. For example:

Since:
Mar 30, 2007
Author:
jhyde
 

Constructor Summary
FilterDynamicSchemaProcessor()
           
 
Method Summary
protected  String filter(String schemaUrl, Util.PropertyList connectInfo, InputStream stream)
          Reads the contents of a schema as a stream and returns the result as a string.
 String processSchema(String schemaUrl, Util.PropertyList connectInfo)
          Modifies a Mondrian schema.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterDynamicSchemaProcessor

public FilterDynamicSchemaProcessor()
Method Detail

processSchema

public String processSchema(String schemaUrl,
                            Util.PropertyList connectInfo)
                     throws Exception
Modifies a Mondrian schema.

An implementation should generally interpret the URL string as an Apache VFS (virtual file system) URL.

FilterDynamicSchemaProcessor's implementation of this method reads from the URL supplied (that is, it does not perform URL translation) and passes it through the filter(java.lang.String, mondrian.olap.Util.PropertyList, java.io.InputStream) method.

Specified by:
processSchema in interface DynamicSchemaProcessor
Throws:
Exception - if an error occurs
Parameters:
schemaUrl - the URL of the catalog
connectInfo - Connection properties
Returns:
the modified schema

filter

protected String filter(String schemaUrl,
                        Util.PropertyList connectInfo,
                        InputStream stream)
                 throws Exception
Reads the contents of a schema as a stream and returns the result as a string.

The default implementation returns the contents of the schema unchanged.

Throws:
Exception - if an error occurs
Parameters:
schemaUrl - the URL of the catalog
connectInfo - Connection properties
stream - Schema contents represented as a stream
Returns:
the modified schema

SourceForge.net_Logo