cubeNames = new ArrayList<String>();
cubeNames.add(Messages.getString("select_cube"));
String fileName = getMondrianSchemaFilename();
if(StringUtils.isEmpty(fileName)){
throw new AggDesignerException(Messages.getString("mondrian_file_null"));
}
File mondrianSchema = new File(getMondrianSchemaFilename());
if (mondrianSchema != null && mondrianSchema.exists() && mondrianSchema.isFile()) {
FileReader schemaReader = new FileReader(mondrianSchema);
final DOMWrapper def = xmlParser.parse(schemaReader);
MondrianDef.Schema tSchema = new MondrianDef.Schema(def);
for (MondrianDef.Cube cube : tSchema.cubes) {
logger.debug("cube: " + cube.name);
cubeNames.add(cube.name);
}
connectionModel.setSchemaName(tSchema.name);
} else {
throw new AggDesignerException("Error loading Mondrian Schema.");
}
} catch (FileNotFoundException e) {
throw new AggDesignerException("Schema source not found.", e);
} catch (XOMException e) {
throw new AggDesignerException("Error parsing schema source.", e);
}
return cubeNames;
}