Class MondrianCatalogHelper

    • Constructor Detail

      • MondrianCatalogHelper

        @Deprecated
        public MondrianCatalogHelper​(org.pentaho.platform.api.repository2.unified.IAclNodeHelper aclHelper)
        Deprecated.
      • MondrianCatalogHelper

        public MondrianCatalogHelper()
      • MondrianCatalogHelper

        public MondrianCatalogHelper​(boolean useLegacyDbName)
    • Method Detail

      • getCatalogs

        protected List<MondrianCatalog> getCatalogs​(org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
      • catalogExists

        protected boolean catalogExists​(MondrianCatalog catalog,
                                        org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
        Performs a search for an existing catalog based on the datasource info and catalog definition.
        Parameters:
        catalog - The catalog to compare against
        pentahoSession - The session with which this request is associated (Used to locate the cache)
        Returns:
        True if an existing match has been found for the catalog
      • getCatalogFromCache

        protected MondrianCatalog getCatalogFromCache​(String context,
                                                      org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
      • getInstance

        @Deprecated
        public static MondrianCatalogHelper getInstance()
        Deprecated.
        Please use PentahoSystem.get to get the Mondrian Catalog Service
        TODO Delete this method. Calling this method ties you to this implementation.
      • init

        protected void init​(org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
      • makeDataSources

        protected mondrian.xmla.DataSourcesConfig.DataSources makeDataSources()
        Same as implemented in XmlaServlet except takes advantage of Spring's Resource framework.
      • generateInMemoryDatasourcesXml

        public String generateInMemoryDatasourcesXml​(org.pentaho.platform.api.repository2.unified.IUnifiedRepository unifiedRepository)
      • contextPathFromRequestContextHolder

        protected String contextPathFromRequestContextHolder()
      • appendCatalogsSection

        protected void appendCatalogsSection​(org.pentaho.platform.api.repository2.unified.IUnifiedRepository unifiedRepository,
                                             String etcMondrian,
                                             org.pentaho.platform.api.repository2.unified.RepositoryFile etcMondrianFolder,
                                             StringBuffer datasourcesXML)
      • parseDataSourcesUrl

        protected mondrian.xmla.DataSourcesConfig.DataSources parseDataSourcesUrl​(URL dataSourcesConfigUrl)
      • parseDataSources

        protected mondrian.xmla.DataSourcesConfig.DataSources parseDataSources​(String dataSourcesConfigString)
      • cleanseDataSourceInfo

        protected String cleanseDataSourceInfo​(String dataSourceInfo)
      • getDataSourcesConfig

        public String getDataSourcesConfig()
      • setDataSourcesConfig

        public void setDataSourcesConfig​(String dataSourcesConfig)
      • addCatalog

        public void addCatalog​(InputStream inputStream,
                               MondrianCatalog catalog,
                               boolean overwriteInRepossitory,
                               org.pentaho.platform.api.engine.IPentahoSession session)
        pass the input stream directly from data access PUC and schema workbench
        Specified by:
        addCatalog in interface IMondrianCatalogService
      • getRepository

        protected org.pentaho.platform.api.repository2.unified.IUnifiedRepository getRepository()
      • getAclHelper

        protected org.pentaho.platform.api.repository2.unified.IAclNodeHelper getAclHelper()
      • setAclHelper

        public void setAclHelper​(org.pentaho.platform.api.repository2.unified.IAclNodeHelper helper)
      • importSchema

        public void importSchema​(File mondrianFile,
                                 String databaseConnection,
                                 String parameters)
      • writeDataSources

        @Deprecated
        protected void writeDataSources​(mondrian.xmla.DataSourcesConfig.DataSources dataSources)
        Deprecated.
      • getCatalog

        public MondrianCatalog getCatalog​(String context,
                                          org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
        Description copied from interface: IMondrianCatalogService
        Returns the catalog with the given context - name or definition allowable. Returns null if context not recognized.
        Specified by:
        getCatalog in interface IMondrianCatalogService
        Parameters:
        context - Either the name of the catalog to fetch, or the catalog's definition string NOTE that the context can be the catalog name or the definition string for the catalog. If you are using the definition string to retrieve the catalog from the cache, you cannot be guaranteed what datasource is in play; so under these circumstances, this catalog's definition is the only part of the catalog that can be trusted. As this feature was added to enable looking up Mondrian roles from the schema, we don't much care which datasource is in play.
      • loadCatalogsIntoCache

        protected void loadCatalogsIntoCache​(mondrian.xmla.DataSourcesConfig.DataSources dataSources,
                                             org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
      • getCatalogAsString

        protected String getCatalogAsString​(org.pentaho.platform.api.engine.IPentahoSession ps,
                                            mondrian.xmla.DataSourcesConfig.Catalog catalog)
                                     throws Exception
        Throws:
        Exception
      • transformIntoCatalogList

        @Deprecated
        protected List<MondrianCatalog> transformIntoCatalogList​(mondrian.xmla.DataSourcesConfig.DataSources dataSources,
                                                                 org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
        Deprecated.
      • getCatalogComplementInfoMap

        public MondrianCatalogComplementInfo getCatalogComplementInfoMap​(String name)
        Method to access the MondrianCatalogComplementInfo taken a catalog name.
        Parameters:
        name - Catalog schema location
        Returns:
        MondrianCatalogComplementInfo object
      • loadMondrianSchema

        public MondrianSchema loadMondrianSchema​(String solutionLocation,
                                                 org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
        this method loads a mondrian schema
        Specified by:
        loadMondrianSchema in interface IMondrianCatalogService
        Parameters:
        solutionLocation - location of the schema
        pentahoSession - current session object
        Returns:
        Mondrian Schema object.
      • docAtUrlToString

        protected String docAtUrlToString​(String urlStr,
                                          org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
      • getSchema

        protected MondrianSchema getSchema​(String catalogName,
                                           org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
      • hasAccess

        protected boolean hasAccess​(MondrianCatalog cat,
                                    org.pentaho.platform.api.repository2.unified.RepositoryFilePermission permission)
        This (hacky) implementation bases its decision on whether or not the user has the permission (indicated by CatalogPermission) based on whether the user has permission on the file in the solution repository indicated by catalog.getDefinition().

        Why is this class even enforcing security anyway!?

      • getSolutionRepositoryRelativePath

        protected String getSolutionRepositoryRelativePath​(String path,
                                                           org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
      • isUseSchemaNameAsCatalogName

        public boolean isUseSchemaNameAsCatalogName()
      • setUseSchemaNameAsCatalogName

        public void setUseSchemaNameAsCatalogName​(boolean useSchemaNameAsCatalogName)
      • addToCatalog

        public static int addToCatalog​(String baseUrl,
                                       boolean enableXmla,
                                       String schemaSolutionPath,
                                       org.pentaho.platform.api.engine.IPentahoSession session,
                                       String jndiName,
                                       boolean overwrite)