Search in sources :

Example 1 with Parser

use of org.eigenbase.xom.Parser in project mondrian by pentaho.

the class RolapSchemaTest method wrapStrSources.

private static DOMWrapper wrapStrSources(String resStr) throws XOMException {
    final Parser xmlParser = XOMUtil.createDefaultParser();
    final DOMWrapper def = xmlParser.parse(resStr);
    return def;
}
Also used : DOMWrapper(org.eigenbase.xom.DOMWrapper) Parser(org.eigenbase.xom.Parser)

Example 2 with Parser

use of org.eigenbase.xom.Parser in project mondrian by pentaho.

the class RolapUtilTest method wrapStrSources.

private static DOMWrapper wrapStrSources(String resStr) throws XOMException {
    final Parser xmlParser = XOMUtil.createDefaultParser();
    final DOMWrapper def = xmlParser.parse(resStr);
    return def;
}
Also used : DOMWrapper(org.eigenbase.xom.DOMWrapper) Parser(org.eigenbase.xom.Parser)

Example 3 with Parser

use of org.eigenbase.xom.Parser in project mondrian by pentaho.

the class SqlMemberSourceTest method wrapStrSources.

private static DOMWrapper wrapStrSources(String resStr) throws XOMException {
    final Parser xmlParser = XOMUtil.createDefaultParser();
    final DOMWrapper def = xmlParser.parse(resStr);
    return def;
}
Also used : DOMWrapper(org.eigenbase.xom.DOMWrapper) Parser(org.eigenbase.xom.Parser)

Example 4 with Parser

use of org.eigenbase.xom.Parser in project mondrian by pentaho.

the class RolapSchema method createCube.

public Cube createCube(String xml) {
    RolapCube cube;
    try {
        final Parser xmlParser = XOMUtil.createDefaultParser();
        final DOMWrapper def = xmlParser.parse(xml);
        final String tagName = def.getTagName();
        if (tagName.equals("Cube")) {
            // Create empty XML schema, to keep the method happy. This is
            // okay, because there are no forward-references to resolve.
            final MondrianDef.Schema xmlSchema = new MondrianDef.Schema();
            MondrianDef.Cube xmlDimension = new MondrianDef.Cube(def);
            cube = new RolapCube(this, xmlSchema, xmlDimension, false);
        } else if (tagName.equals("VirtualCube")) {
            // Need the real schema here.
            MondrianDef.Schema xmlSchema = getXMLSchema();
            MondrianDef.VirtualCube xmlDimension = new MondrianDef.VirtualCube(def);
            cube = new RolapCube(this, xmlSchema, xmlDimension, false);
        } else {
            throw new XOMException("Got <" + tagName + "> when expecting <Cube>");
        }
    } catch (XOMException e) {
        throw Util.newError(e, "Error while creating cube from XML [" + xml + "]");
    }
    return cube;
}
Also used : ByteString(mondrian.util.ByteString) Parser(org.eigenbase.xom.Parser)

Example 5 with Parser

use of org.eigenbase.xom.Parser in project mondrian by pentaho.

the class XmlaSupport method getDataSources.

public static DataSourcesConfig.DataSources getDataSources(String connectString, Map<String, String> catalogNameUrls) throws XOMException {
    String str = getDataSourcesText(connectString, catalogNameUrls);
    StringReader dsConfigReader = new StringReader(str);
    final Parser xmlParser = XOMUtil.createDefaultParser();
    final DOMWrapper def = xmlParser.parse(dsConfigReader);
    return new DataSourcesConfig.DataSources(def);
}
Also used : Parser(org.eigenbase.xom.Parser)

Aggregations

Parser (org.eigenbase.xom.Parser)12 DOMWrapper (org.eigenbase.xom.DOMWrapper)5 ByteString (mondrian.util.ByteString)3 XOMException (org.eigenbase.xom.XOMException)2 java.io (java.io)1 ArrayList (java.util.ArrayList)1 MondrianDef (mondrian.olap.MondrianDef)1 DataSources (mondrian.xmla.DataSourcesConfig.DataSources)1 FileSystemException (org.apache.commons.vfs2.FileSystemException)1