use of mondrian.spi.impl.ServletContextCatalogLocator in project pentaho-platform by pentaho.
the class PentahoXmlaServlet method makeCatalogLocator.
@Override
protected CatalogLocator makeCatalogLocator(ServletConfig servletConfig) {
return new ServletContextCatalogLocator(servletConfig.getServletContext()) {
@Override
public String locate(String catalogPath) {
if (catalogPath.startsWith("mondrian:")) {
// $NON-NLS-1$
try {
FileSystemManager fsManager = VFS.getManager();
SolutionRepositoryVfsFileObject catalog = (SolutionRepositoryVfsFileObject) fsManager.resolveFile(catalogPath);
catalogPath = "solution:" + catalog.getFileRef();
} catch (FileSystemException e) {
logger.error(e.getMessage());
}
} else {
catalogPath = super.locate(catalogPath);
}
return catalogPath;
}
};
}
use of mondrian.spi.impl.ServletContextCatalogLocator in project mondrian by pentaho.
the class MdxQueryServlet method init.
/**
* Initializes the servlet.
*/
public void init(ServletConfig config) throws ServletException {
super.init(config);
connectString = config.getInitParameter("connectString");
Enumeration initParameterNames = config.getInitParameterNames();
while (initParameterNames.hasMoreElements()) {
String name = (String) initParameterNames.nextElement();
String value = config.getInitParameter(name);
MondrianProperties.instance().setProperty(name, value);
}
locator = new ServletContextCatalogLocator(config.getServletContext());
}
Aggregations