Giter Site home page Giter Site logo

pentaho-dynamicschemaprocessor's Introduction

pentaho-dynamicschemaprocessor

Example DynamicSchemaProcessor (DSP) for Pentaho that uses a JNDI connection. Depending on the userrole and username it gives full, restrictet (to certain tenants) or no access to the user.

What does it need?

Copy resulting jar to Pentaho server

...\pentaho-server-ee\pentaho-server\tomcat\webapps\pentaho\WEB-INF\lib

JNDI connection parameters in pentaho server

.../pentaho-server/tomcat/conf/context.xml

<Context>
    ...
    ...
    <Resource 
    	name="jdbc/ExampleJNDI" 
    	auth="Container" type="javax.sql.DataSource"
    	factory="org.apache.commons.dbcp.BasicDataSourceFactory" 
    	maxActive="20" 
    	maxIdle="5"
    	maxWait="10000" 
    	username="myuser" 
    	password="mypassword" 
    	driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
    	url="jdbc:sqlserver://localhost:1433;DatabaseName=myDatabaseName"
    />
</Context>

.../pentaho-server/tomcat/webapps/pentaho/web-inf/web.xml

<web-app>
    ...
    ...
    <resource-ref>
    	<description>My Connection</description>
    	<res-ref-name>jdbc/ExampleJNDI</res-ref-name>
    	<res-type>javax.sql.DataSource</res-type>
    	<res-auth>Container</res-auth>
    </resource-ref>
    ...
</web-app>

Add SQL security where clause to Mondrian Schema

This clause in the schema will be replaced from the DSP during runtime depending on the role/user.

...
<Cube name="....">
    <Table name="t_Example" schema="dbo" alias="Example">
      <SQL dialect="generic">
        <![CDATA[SECURITY_PATTERN#Example.idTenant IN (%TENANT_IDS%)#]]>
      </SQL>
    </Table>
    ...
</Cube>

If you want so see the logs from the DSP in pentaho.xml

Set the loglevel for your namespace in log4j.xml

...
<category name="org.migaman.pentaho.example.dsp">
    <priority value="INFO"/>
</category>
...

Can't find Pentaho libraries?

Pentaho Maven Repository
http://nexus.pentaho.org/content/groups/omni

~/.m2/settings.xml example
https://github.com/pentaho/maven-parent-poms/blob/master/maven-support-files/settings.xml

pentaho-dynamicschemaprocessor's People

Contributors

migaman avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.