use of org.pentaho.platform.plugin.action.mondrian.catalog.MondrianCube in project pentaho-platform by pentaho.
the class UserConsoleResource method getMondrianCatalogs.
/**
* Return the list of mondrian cubes in the platform
*
* @return list of cubes
*/
@GET
@Path("/cubes")
@Facet(name = "Unsupported")
@Produces({ APPLICATION_JSON, APPLICATION_XML })
public List<Cube> getMondrianCatalogs() {
ArrayList<Cube> cubes = new ArrayList<Cube>();
IMondrianCatalogService catalogService = PentahoSystem.get(IMondrianCatalogService.class, "IMondrianCatalogService", UserConsoleService.getPentahoSession());
List<MondrianCatalog> catalogs = catalogService.listCatalogs(UserConsoleService.getPentahoSession(), true);
for (MondrianCatalog cat : catalogs) {
for (MondrianCube cube : cat.getSchema().getCubes()) {
cubes.add(new Cube(cat.getName(), cube.getName(), cube.getId()));
}
}
return cubes;
}
Aggregations