public class MondrianCatalogHelper extends Object implements IAclAwareMondrianCatalogService
XmlaServlet
.)Modifier and Type | Class and Description |
---|---|
protected static class |
MondrianCatalogHelper.CatalogPermission |
Modifier and Type | Field and Description |
---|---|
static String |
MONDRIAN_CATALOG_CACHE_REGION |
static String |
MONDRIAN_DATASOURCE_FOLDER |
Constructor and Description |
---|
MondrianCatalogHelper() |
MondrianCatalogHelper(boolean useLegacyDbName) |
MondrianCatalogHelper(org.pentaho.platform.api.repository2.unified.IAclNodeHelper aclHelper)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
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
|
void |
addCatalog(InputStream schemaInputStream,
MondrianCatalog catalog,
boolean overwrite,
org.pentaho.platform.api.repository2.unified.RepositoryFileAcl acl,
org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
new method to pass the input stream directly from data access put and post schema
|
void |
addCatalog(MondrianCatalog catalog,
boolean overwrite,
org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
use the in memory session value of input stream (used by test harness)
|
static int |
addToCatalog(String baseUrl,
boolean enableXmla,
String schemaSolutionPath,
org.pentaho.platform.api.engine.IPentahoSession session,
String jndiName,
boolean overwrite) |
protected void |
appendCatalogsSection(org.pentaho.platform.api.repository2.unified.IUnifiedRepository unifiedRepository,
String etcMondrian,
org.pentaho.platform.api.repository2.unified.RepositoryFile etcMondrianFolder,
StringBuffer datasourcesXML) |
protected String |
applyDSP(org.pentaho.platform.api.engine.IPentahoSession ps,
String catalogDsInfo,
String catalogDefinition) |
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.
|
protected String |
cleanseDataSourceInfo(String dataSourceInfo) |
protected String |
contextPathFromRequestContextHolder() |
protected String |
docAtUrlToString(String urlStr,
org.pentaho.platform.api.engine.IPentahoSession pentahoSession) |
protected List<MondrianCatalog> |
filter(List<MondrianCatalog> origList,
org.pentaho.platform.api.engine.IPentahoSession pentahoSession,
boolean jndiOnly) |
String |
generateInMemoryDatasourcesXml(org.pentaho.platform.api.repository2.unified.IUnifiedRepository unifiedRepository) |
org.pentaho.platform.api.repository2.unified.RepositoryFileAcl |
getAclFor(String catalogName) |
protected org.pentaho.platform.api.repository2.unified.IAclNodeHelper |
getAclHelper() |
MondrianCatalog |
getCatalog(String context,
org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
Returns the catalog with the given context - name or definition allowable.
|
protected String |
getCatalogAsString(org.pentaho.platform.api.engine.IPentahoSession ps,
mondrian.xmla.DataSourcesConfig.Catalog catalog) |
MondrianCatalogComplementInfo |
getCatalogComplementInfoMap(String name)
Method to access the MondrianCatalogComplementInfo taken a catalog name.
|
protected MondrianCatalog |
getCatalogFromCache(String context,
org.pentaho.platform.api.engine.IPentahoSession pentahoSession) |
protected List<MondrianCatalog> |
getCatalogs(org.pentaho.platform.api.engine.IPentahoSession pentahoSession) |
String |
getDataSourcesConfig() |
static MondrianCatalogHelper |
getInstance()
Deprecated.
Please use PentahoSystem.get to get the Mondrian Catalog Service
|
protected MondrianCatalogRepositoryHelper |
getMondrianCatalogRepositoryHelper() |
protected org.pentaho.platform.api.repository2.unified.IUnifiedRepository |
getRepository() |
protected MondrianSchema |
getSchema(String catalogName,
org.pentaho.platform.api.engine.IPentahoSession pentahoSession) |
protected String |
getSolutionRepositoryRelativePath(String path,
org.pentaho.platform.api.engine.IPentahoSession pentahoSession) |
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() . |
void |
importSchema(File mondrianFile,
String databaseConnection,
String parameters) |
protected void |
init(org.pentaho.platform.api.engine.IPentahoSession pentahoSession) |
boolean |
isUseSchemaNameAsCatalogName() |
List<MondrianCatalog> |
listCatalogs(org.pentaho.platform.api.engine.IPentahoSession pentahoSession,
boolean jndiOnly)
Lists all catalogs (filtered according to access control rules).
|
protected void |
loadCatalogsIntoCache(mondrian.xmla.DataSourcesConfig.DataSources dataSources,
org.pentaho.platform.api.engine.IPentahoSession pentahoSession) |
MondrianSchema |
loadMondrianSchema(String solutionLocation,
org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
this method loads a mondrian schema
|
protected Map<String,MondrianCatalogComplementInfo> |
makeCatalogComplementInfoMap(org.eigenbase.xom.DOMWrapper doc) |
protected Map<String,MondrianCatalog> |
makeCatalogMap(List<MondrianCatalog> cats) |
protected mondrian.xmla.DataSourcesConfig.DataSources |
makeDataSources()
Same as implemented in
XmlaServlet except takes advantage of Spring's Resource framework. |
protected MondrianSchema |
makeSchema(String catalogStr) |
protected mondrian.xmla.DataSourcesConfig.DataSources |
parseDataSources(String dataSourcesConfigString) |
protected mondrian.xmla.DataSourcesConfig.DataSources |
parseDataSourcesUrl(URL dataSourcesConfigUrl) |
protected String |
readDataSourcesContent(URL dataSourcesConfigUrl) |
void |
reInit(org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
Flushes the catalog cache.
|
void |
removeCatalog(String catalogName,
org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
This method removes a mondrian catalog from the JCR repository.
|
void |
setAclFor(String catalogName,
org.pentaho.platform.api.repository2.unified.RepositoryFileAcl acl) |
void |
setAclHelper(org.pentaho.platform.api.repository2.unified.IAclNodeHelper helper) |
void |
setDataSourcesConfig(String dataSourcesConfig) |
void |
setUseSchemaNameAsCatalogName(boolean useSchemaNameAsCatalogName) |
protected List<MondrianCatalog> |
transformIntoCatalogList(mondrian.xmla.DataSourcesConfig.DataSources dataSources,
org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
Deprecated.
|
protected void |
writeDataSources(mondrian.xmla.DataSourcesConfig.DataSources dataSources)
Deprecated.
|
public static final String MONDRIAN_DATASOURCE_FOLDER
public static String MONDRIAN_CATALOG_CACHE_REGION
@Deprecated public MondrianCatalogHelper(org.pentaho.platform.api.repository2.unified.IAclNodeHelper aclHelper)
public MondrianCatalogHelper()
public MondrianCatalogHelper(boolean useLegacyDbName)
protected List<MondrianCatalog> getCatalogs(org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
protected boolean catalogExists(MondrianCatalog catalog, org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
catalog
- The catalog to compare againstpentahoSession
- The session with which this request is associated (Used to locate the cache)protected MondrianCatalog getCatalogFromCache(String context, org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
@Deprecated public static MondrianCatalogHelper getInstance()
protected void init(org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
public void reInit(org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
IMondrianCatalogService
reInit
in interface IMondrianCatalogService
protected mondrian.xmla.DataSourcesConfig.DataSources makeDataSources()
XmlaServlet
except takes advantage of Spring's Resource framework.public String generateInMemoryDatasourcesXml(org.pentaho.platform.api.repository2.unified.IUnifiedRepository unifiedRepository)
protected String contextPathFromRequestContextHolder()
protected void appendCatalogsSection(org.pentaho.platform.api.repository2.unified.IUnifiedRepository unifiedRepository, String etcMondrian, org.pentaho.platform.api.repository2.unified.RepositoryFile etcMondrianFolder, StringBuffer datasourcesXML)
protected mondrian.xmla.DataSourcesConfig.DataSources parseDataSourcesUrl(URL dataSourcesConfigUrl)
protected String readDataSourcesContent(URL dataSourcesConfigUrl) throws IOException
IOException
protected mondrian.xmla.DataSourcesConfig.DataSources parseDataSources(String dataSourcesConfigString)
protected Map<String,MondrianCatalogComplementInfo> makeCatalogComplementInfoMap(org.eigenbase.xom.DOMWrapper doc)
protected Map<String,MondrianCatalog> makeCatalogMap(List<MondrianCatalog> cats)
public String getDataSourcesConfig()
public void setDataSourcesConfig(String dataSourcesConfig)
public List<MondrianCatalog> listCatalogs(org.pentaho.platform.api.engine.IPentahoSession pentahoSession, boolean jndiOnly)
IMondrianCatalogService
listCatalogs
in interface IMondrianCatalogService
jndiOnly
- return only JNDI-based catalogspublic void addCatalog(MondrianCatalog catalog, boolean overwrite, org.pentaho.platform.api.engine.IPentahoSession pentahoSession) throws MondrianCatalogServiceException
addCatalog
in interface IMondrianCatalogService
overwrite
- true to overwrite existing catalog (based on match with definition and effectiveDataSourceInfoMondrianCatalogServiceException
public void addCatalog(InputStream inputStream, MondrianCatalog catalog, boolean overwriteInRepossitory, org.pentaho.platform.api.engine.IPentahoSession session)
addCatalog
in interface IMondrianCatalogService
public void addCatalog(InputStream schemaInputStream, MondrianCatalog catalog, boolean overwrite, org.pentaho.platform.api.repository2.unified.RepositoryFileAcl acl, org.pentaho.platform.api.engine.IPentahoSession pentahoSession) throws MondrianCatalogServiceException
addCatalog
in interface IAclAwareMondrianCatalogService
schemaInputStream
- catalog
- overwrite
- acl
- catalog ACLpentahoSession
- MondrianCatalogServiceException
protected org.pentaho.platform.api.repository2.unified.IUnifiedRepository getRepository()
protected MondrianCatalogRepositoryHelper getMondrianCatalogRepositoryHelper()
protected org.pentaho.platform.api.repository2.unified.IAclNodeHelper getAclHelper()
public void setAclHelper(org.pentaho.platform.api.repository2.unified.IAclNodeHelper helper)
public void setAclFor(String catalogName, org.pentaho.platform.api.repository2.unified.RepositoryFileAcl acl)
setAclFor
in interface IAclAwareMondrianCatalogService
public org.pentaho.platform.api.repository2.unified.RepositoryFileAcl getAclFor(String catalogName)
getAclFor
in interface IAclAwareMondrianCatalogService
public void importSchema(File mondrianFile, String databaseConnection, String parameters)
@Deprecated protected void writeDataSources(mondrian.xmla.DataSourcesConfig.DataSources dataSources)
public MondrianCatalog getCatalog(String context, org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
IMondrianCatalogService
null
if context not
recognized.getCatalog
in interface IMondrianCatalogService
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.protected void loadCatalogsIntoCache(mondrian.xmla.DataSourcesConfig.DataSources dataSources, org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
protected String applyDSP(org.pentaho.platform.api.engine.IPentahoSession ps, String catalogDsInfo, String catalogDefinition) throws Exception
Exception
protected String getCatalogAsString(org.pentaho.platform.api.engine.IPentahoSession ps, mondrian.xmla.DataSourcesConfig.Catalog catalog) throws Exception
Exception
@Deprecated protected List<MondrianCatalog> transformIntoCatalogList(mondrian.xmla.DataSourcesConfig.DataSources dataSources, org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
public MondrianCatalogComplementInfo getCatalogComplementInfoMap(String name)
name
- Catalog schema locationpublic MondrianSchema loadMondrianSchema(String solutionLocation, org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
loadMondrianSchema
in interface IMondrianCatalogService
solutionLocation
- location of the schemapentahoSession
- current session objectprotected String docAtUrlToString(String urlStr, org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
protected MondrianSchema getSchema(String catalogName, org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
protected MondrianSchema makeSchema(String catalogStr)
protected List<MondrianCatalog> filter(List<MondrianCatalog> origList, org.pentaho.platform.api.engine.IPentahoSession pentahoSession, boolean jndiOnly)
protected boolean hasAccess(MondrianCatalog cat, org.pentaho.platform.api.repository2.unified.RepositoryFilePermission permission)
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!?protected String getSolutionRepositoryRelativePath(String path, org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
public boolean isUseSchemaNameAsCatalogName()
public void setUseSchemaNameAsCatalogName(boolean useSchemaNameAsCatalogName)
public static int addToCatalog(String baseUrl, boolean enableXmla, String schemaSolutionPath, org.pentaho.platform.api.engine.IPentahoSession session, String jndiName, boolean overwrite)
public void removeCatalog(String catalogName, org.pentaho.platform.api.engine.IPentahoSession pentahoSession) throws MondrianCatalogServiceException
removeCatalog
in interface IMondrianCatalogService
catalogName
- the name of the catalog to removepentahoSession
- current session objectMondrianCatalogServiceException
Copyright © 2018 Hitachi Vantara. All rights reserved.