Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Dynamic Schema Processor with Pentaho-Suite 5.3

  1. #1
    Join Date
    May 2015
    Posts
    2

    Question Dynamic Schema Processor with Pentaho-Suite 5.3

    Hi,

    I'm trying to use Mondrian with Dynamic Schema Processor within Pentaho-Suite 5.3.0.0-213 CE. I have a very simple cube where the cube- and schema-names have placeholders. It's only a test, so I want to change the placeholder to one fix String.
    <Schema name="##NAME##">
    [...]
    <Dimension type="StandardDimension" visible="true" highCardinality="false" name="Summary" caption="Summary">
    <Hierarchy visible="true" hasAll="true" allMemberName="All summaries" primaryKey="DIM_SUMMARY_KEY">
    <Table name="DIM_SUMMARY" schema="ACCOUNT_##NAME##">
    [...]

    My DSP looks like that:
    package dsp.ownimport java.io.InputStream;
    import java.util.regex.PatternSyntaxException;
    import mondrian.i18n.LocalizingDynamicSchemaProcessor;
    import mondrian.olap.Util;


    public class DSPtest extends
    LocalizingDynamicSchemaProcessor {
    private static final String PLACEHOLDER = "##NAME##";
    private static final String OVERWRITER = "MIKE";

    @Override
    public String filter (String schemaUrl, Util.PropertyList connectInfo, InputStream stream) throws Exception {
    String schema = super.filter(schemaUrl, connectInfo, stream);
    try {
    schema = schema.replaceAll(PLACEHOLDER, OVERWRITER);
    } catch (PatternSyntaxException pse) {
    pse.printStackTrace();
    return schema;
    }
    return schema;
    }
    }
    I exported this class as jar-file by Eclipse and copied it to [..]/biserver-ce/tomcat/webapps/pentaho/WEB-INF/lib.
    At Pentaho BI-Suite I went to [Manage Data Sources] > [Gear-symbol] > [Import Analysis]. I opened the xml-file (where a short extract u can see above) as "Mondrian File" and selected "Manually enter data source parameter values". I set the following key->value pairs:
    Key Value
    DataSource dbConnection
    UseContentChecksum true
    DynamicSchemaProcessor dsp.own.DSPtest
    EnableXmla false








    At this moment I can save this and the Mondrian-File is displayed as ##NAME##. If I restart Pentaho bi-server and go to [Manage Data Sources] again, the name is displayed as MIKE. I think the DSP-jar was loaded and works. At this time I can not do any changes to this settings, because I'm not able to save it. The "Mondrian File" is displayed as MIKE.mondrian.xml and I think this is the reason for it.

    If I go to [Create New] > [JPivot View] there is schema MIKE displayed. I choose my Cube (they are all displayed with MIKE instead of ##NAME## in their names) and press ok.
    An error occurred while rendering Pivot.jsp. Please see the log for details.

    At [..]/biserver-ce/tomcat/logs/pentaho.log I found:
    2015-05-15 17:31:13,022 ERROR [org.pentaho.platform.repository2.unified.jcr.JcrAclNodeHelper] Error retrieving ACL Node java.lang.NullPointerException
    at org.pentaho.platform.repository2.unified.jcr.JcrAclNodeHelper$1.call(JcrAclNodeHelper.java:54)
    at org.pentaho.platform.repository2.unified.jcr.JcrAclNodeHelper$1.call(JcrAclNodeHelper.java:51)
    at org.pentaho.platform.engine.security.SecurityHelper.runAsSystem(SecurityHelper.java:394)
    at org.pentaho.platform.repository2.unified.jcr.JcrAclNodeHelper.getAclNode(JcrAclNodeHelper.java:51)
    at org.pentaho.platform.repository2.unified.jcr.JcrAclNodeHelper.hasAclNode(JcrAclNodeHelper.java:46)
    at org.pentaho.platform.repository2.unified.jcr.JcrAclNodeHelper.canAccess(JcrAclNodeHelper.java:82)
    at org.pentaho.platform.plugin.action.mondrian.catalog.MondrianCatalogHelper.hasAccess(MondrianCatalogHelper.java:1038)
    at org.pentaho.platform.plugin.action.mondrian.catalog.MondrianCatalogHelper.getCatalog(MondrianCatalogHelper.java:759)
    at org.pentaho.platform.plugin.action.mondrian.mapper.MondrianAbstractPlatformUserRoleMapper.getMondrianRolesFromCatalog(MondrianAbstractPlatformUserRoleMapper.java:86)
    at org.pentaho.platform.plugin.action.mondrian.mapper.MondrianAbstractPlatformUserRoleMapper.mapConnectionRoles(MondrianAbstractPlatformUserRoleMapper.java:182)
    at org.pentaho.platform.plugin.services.connections.mondrian.MDXConnection.mapPlatformRolesToMondrianRolesHelper(MDXConnection.java:196)
    at org.pentaho.platform.plugin.services.connections.mondrian.MDXConnection.mapPlatformRolesToMondrianRoles(MDXConnection.java:183)
    at org.pentaho.platform.plugin.services.connections.mondrian.MDXConnection.init(MDXConnection.java:232)
    at org.pentaho.platform.plugin.services.connections.mondrian.MDXConnection.init(MDXConnection.java:138)
    at org.pentaho.platform.plugin.services.connections.mondrian.MDXConnection.setProperties(MDXConnection.java:99)
    at org.pentaho.platform.engine.services.connection.PentahoConnectionFactory.getConnection(PentahoConnectionFactory.java:124)
    at org.pentaho.platform.plugin.action.mondrian.MondrianModelComponent.getInitialQuery(MondrianModelComponent.java:126)
    at org.pentaho.platform.plugin.action.mondrian.MondrianModelComponent.getInitialQuery(MondrianModelComponent.java:276)
    at org.pentaho.jpivot.PivotViewComponent.executeAction(PivotViewComponent.java:469)
    [...]
    2015-05-15 17:31:13,428 ERROR [com.tonbeller.jpivot.mondrian.MondrianModel] Mondrian Error:MDX cube 'MIKE_SUMCUBE' not found
    2015-05-15 17:31:13,428 ERROR [com.tonbeller.jpivot.tags.OlapModelProxy]
    com.tonbeller.jpivot.olap.model.OlapException: Mondrian Error:MDX cube 'MIKE_SUMCUBE' not found
    at com.tonbeller.jpivot.mondrian.MondrianModel.initialize(MondrianModel.java:557)
    at com.tonbeller.jpivot.olap.model.OlapModelDecorator.initialize(OlapModelDecorator.java:132)
    at com.tonbeller.jpivot.tags.OlapModelProxy$MyState.initialize(OlapModelProxy.java:77)
    [...]
    If I play "manually DSP" and open the xml by a text-editor, replace ##NAME## by MIKE, load it in Pentaho-BI-Server and open the same cube then it works very fine. And this is nothing else as the DSP should do.

    I hope anyone can give me a hint where my mistake is and how I'm able to use DSP for my application.

  2. #2

    Default

    Prior to the first release of Pentho 5, the Pivot viewer (found in /pentaho/jsp/Pivot.jsp) had hardcoded the DynamicSchemaProcessor as "mondrian.i18n.LocalizingDynamicSchemaProcessor". So, in that days, if you wanted a DSP working with JPivot, you had to edit your Pivot.jsp
    When porting this jsp into a native pentaho plugin, I believe that they retain that piece of code, but now is more hard to fix it.
    I'm trying to figure how Saiku solved this issue, because they already did.
    You can also contact info@stratebi.com, because they have some alternative.

  3. #3
    Join Date
    Aug 2013
    Posts
    11

    Default

    I felt in a similar problem.
    Did you find a solution?

    Thanks

    Regards

  4. #4

    Default

    It is already solved for STPivot (a brand of JPivot developed by Stratebi).
    Applying the same patch for the Pivot plugin is also posible, but I recommend to get in touch with info@stratebi.com and ask for a copy of STPivot.

  5. #5
    Join Date
    Jun 2015
    Posts
    24

    Default

    I'm using dynamic schema processor with pentaho 5.3. Everything works fine... but one thing:
    It is expected that the schema should be built once by each user login but I wonder why the schema is rebuilt before running each mdx query!!! and due to this issue the performance is badly affected!
    Any advice please?!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.