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;
}
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;
}
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;
}
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;
}
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);
}
Aggregations