Mondrian DSPs and Ctools

53 views
Skip to first unread message

Pedro Alves

unread,
Aug 13, 2015, 1:01:22 PM8/13/15
to pentaho-...@googlegroups.com


New blog post in http://pedroalves-bi.blogspot.pt/2015/08/useful-tips-making-pentaho-cda-use.html

----

[Useful Tips] Making Pentaho CDA use a DynamicSchemaProcessor


Long time no blogging. Gotta change that.

Here's a quick and useful tip for those wanting to set up row level securing in Pentaho using mondrian Dynamic Schema Processors.

Mondian Dynamic Schema Processors

DSPs are a very common way to add dynamic roles to mondrian. In a nutshell (cause I won't explain here all the stuff behind it), when you add security to mondrian, you have to specify a set of Roles in the mondrian.xml file.

However, there are times where we can't have all the roles on the schema file. That's where DSPs come into play. Here's basically how they work:

Picture that I shamelessly stole from David Fombella

So in essence, a DSP is just a post processor that takes the original mondrian schema and outputs the final modrian schema. How that DSP is written depends on the developer, but it's usually a java snippet. Example here.

Using it from CDA


So once we get it working we will surely want to take advantage of the Ctools to use the DSP datasource. And CDA needs the DSP to be explicitly defined in the schema properties. Here's how we add it:

Pentaho User Console => Manage Data Sources => Select Analysis Schema => Edit

And add 2 settings:

  • DynamicSchemaProcessor: com.yourcompany.yourclassDSP
  • UseContentChecksum: true

So we get into something like:

Manage datasources screen

From that point on, you're all set. Your queries will take advantage of that DSP.


Cheers


-pedro

Fernando Maia da Mota

unread,
Jun 23, 2016, 4:51:53 PM6/23/16
to pentaho-...@googlegroups.com, Pedro Alves, Marcello Pontes
Olá prezados,

Estou fazendo alguns testes com o Cubeguard + CDA.

Estou com dois pontos que gostaria de verificar (Marcello e Pedro) se é isso mesmo ou se temos bugs.

  1. Na edição de um dashboard via CDE, quando seleciono um conexão do tipo "mdx over mondrianJndi" e tento listar as opções na propriedade "Mondrian Schema" a lista está vazia. Verifiquei que no console dá erro quando o CDE vai buscar a lista de schemas (log e screen em anexo). 
    • Por enquanto estou inserindo na mão o schema da seguinte forma: mondrian:/nomeMeuSchema
  2. Quando faço o acesso ao painel com o cache da consulta habilitado, o CDA está fazendo cache da primeira consulta realizada, ou seja, para a primeira consulta ele respeita o DSP para as demais não. Quando desabilito o cache o CDA respeita perfeitamente as regras estabelecidas vis DSP.
    • Isso está certo ou errado? só poderei usar DSP sem o cache habilitado?

PS. No saiku com o mondrian compartilhado o DSP está sendo respeitado perfeitamente.


Obrigado pela atenção.



--
You received this message because you are subscribed to the Google Groups "Pentaho Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pentaho-commun...@googlegroups.com.
To post to this group, send email to pentaho-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pentaho-community/CAC_LyUiaeJ4UvKvZAXkSc0CjD8DwtgeQXUw9b%3Dk_00kcjivg1A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
log_erro1.txt
Screen Shot 2016-06-23 at 16.30.28.png

Fernando Maia da Mota

unread,
Jun 23, 2016, 5:46:43 PM6/23/16
to Marcello Pontes, pentaho-...@googlegroups.com
Oi Marcelo, versão 5 mesmo.

On Thu, Jun 23, 2016 at 5:41 PM, Marcello Pontes <bal...@gmail.com> wrote:
Faalaa, Fernando. 

1. Dashboard q tu se refere eh um painel novo, neh? Vou assumir q sim. 

Isso, um novo painel CDE+CDF+CDA.
 

Nao deveria haver interferencia do CG. Q versao da suite tu ta usando?

Estou testando no Pentaho 5.4, CDA versão 16.01.22.
 

2. Ja usamos aqui em producao com cache e o comportamento eh ok. Talvez algo relacionado a 6 - pra q ainda nao testamos o CG. 

Sobre o saiku sim.. Fundamental usar o mondrian da plataforma. 

Abraco :)

Fernando Maia da Mota

unread,
Jun 24, 2016, 9:04:22 AM6/24/16
to Marcello Pontes, pentaho-...@googlegroups.com
Marcello,

Bom dia!

Pode me informar por favor qual a versão do CDA que você possuí em produção?

Ainda travado nisso...


Fernando Maia da Mota

unread,
Jun 24, 2016, 10:37:55 AM6/24/16
to pentaho-...@googlegroups.com
Olá pessoal,

Com relação ao ponto 1 está resolvido, nos meus testes foi necessário mapear o usuário admin no step "Hierarchies/Measures to be allowed" para que funcionasse perfeitamente. Inicialmente estava dando privilégio "all" ao schema para o usuário através do step "SchemaGrantAll".

O ponto 2 continua sem cache, mesmo após as correções.

Fernando Maia da Mota

unread,
Jun 30, 2016, 11:50:02 AM6/30/16
to Marcello Pontes, pentaho-...@googlegroups.com
Olá novamente Marcello,

Estou tentando reutilizar o DSP criado com o Cubeguard em relatórios criados com o PRD+Mondrian.

O erro apresentado nos logs é que não é possível encontrar o cubo em que estou tentado rodar a query:

mondrian.olap.MondrianException: Mondrian Error:MDX cube 'MeuCuboOLAP' not found


Realizando uma breve pesquisa, encontrei este post http://thejavatar.com/apply-dynamic-schema-processor-to-a-report-created-in-the-report-designer, portanto, adicionei o seguinte código em query script:

function initQuery(dataRow) {
dataFactory.setDynamicSchemaProcessor("com.oncase.olap.security.DynamicMappedRolesSchemaProcessor");
}


Alguma sugestão? você utiliza/ou o cubeguard em relatórios que consultam o mondrian?

Agradeço a atenção.


Fernando Maia da Mota

unread,
Jun 30, 2016, 11:52:53 AM6/30/16
to Marcello Pontes, pentaho-...@googlegroups.com
Complementando...

obviamente não houve sucesso ao adicionar a função initQuery.

=)

Fernando Maia da Mota

unread,
Jun 30, 2016, 12:15:24 PM6/30/16
to Marcello Pontes, pentaho-...@googlegroups.com
Olá pessoal,

Resolvido!.

Além de ser necessário adicionar o código a seguir em query script:

function initQuery(dataRow) {
dataFactory.setDynamicSchemaProcessor("com.oncase.olap.security.DynamicMappedRolesSchemaProcessor");
}

Também é necessário configurar o arquivo cubeguard/cubeguard.properties, principalmente a propriedade cubeguard.rulesEndpointPath.

Valeu...
Reply all
Reply to author
Forward
0 new messages