Search in sources :

Example 1 with SolutionRepositoryVfsFileObject

use of org.pentaho.platform.repository.solution.filebased.SolutionRepositoryVfsFileObject 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;
        }
    };
}
Also used : FileSystemException(org.apache.commons.vfs2.FileSystemException) ServletContextCatalogLocator(mondrian.spi.impl.ServletContextCatalogLocator) DefaultFileSystemManager(org.apache.commons.vfs2.impl.DefaultFileSystemManager) FileSystemManager(org.apache.commons.vfs2.FileSystemManager) SolutionRepositoryVfsFileObject(org.pentaho.platform.repository.solution.filebased.SolutionRepositoryVfsFileObject)

Aggregations

ServletContextCatalogLocator (mondrian.spi.impl.ServletContextCatalogLocator)1 FileSystemException (org.apache.commons.vfs2.FileSystemException)1 FileSystemManager (org.apache.commons.vfs2.FileSystemManager)1 DefaultFileSystemManager (org.apache.commons.vfs2.impl.DefaultFileSystemManager)1 SolutionRepositoryVfsFileObject (org.pentaho.platform.repository.solution.filebased.SolutionRepositoryVfsFileObject)1