简体   繁体   English

Pentaho Mondrian OLAP架构角色

[英]Pentaho Mondrian OLAP Schema Roles

I have a Mondrian server webapp up and running to handle MDX queries, fetch data from the OLAP cubes defined in our Mondrian Schema, and return the XMLA required by the front-end GUI application to show the queried data. 我已经启动并运行一个Mondrian服务器Web应用程序,以处理MDX查询,从我们的Mondrian模式中定义的OLAP多维数据集中获取数据,并返回前端GUI应用程序所需的XMLA以显示查询的数据。

That all works, but now I'm trying to add permission Roles, and I've stumbled upon a very confusing problem. 一切正常,但是现在我试图添加权限角色,并且偶然发现了一个非常令人困惑的问题。

Now I thought this would be as easy as to add another parameter "role" and send that. 现在,我认为这就像添加另一个参数“ role”并将其发送一样容易。 However, this is throwing me an odd error. 但是,这使我感到奇怪。

I'm using SmartGWT to connect to the Mondrian XMLA service. 我正在使用SmartGWT连接到Mondrian XMLA服务。

    public static OlapConnection getConnection() throws Exception {
    Class.forName("org.olap4j.driver.xmla.XmlaOlap4jDriver");
    java.util.Properties p = new Properties();
    String role = "role1";
    p.put("server", "http://domain.be:8080/mondrian/xmla");
    p.put("user", "user");
    p.put("password", "password");
    p.put("role","\""+role+"\"");
    String dbUrl = "jdbc:xmla:";
    Connection connectionXMLA = DriverManager.getConnection(dbUrl, p);
    OlapWrapper wrapper = (OlapWrapper) connectionXMLA;
    OlapConnection olapConnection = wrapper.unwrap(OlapConnection.class);
    return olapConnection;

Roles are defined in the schema which also holds the cube, as this: 在也包含多维数据集的架构中定义角色,如下所示:

<Role name="role1">
<SchemaGrant access="none">
      <CubeGrant cube="VehicleSales" access="all"/>
  <CubeGrant cube="Contract" access="none"/>
</SchemaGrant>

<Role name="role2">
<SchemaGrant access="none">
      <CubeGrant cube="VehicleSales" access="none"/>
  <CubeGrant cube="Contract" access="all"/>
</SchemaGrant>

When using the "role" parameter, I get this error: 使用“ role”参数时,出现以下错误:

12:30:50.930 [ERROR] [smartgwtolap] 12:30:50.928:TMR9:WARN:RPCManager:org.olap4j.OlapException: XMLA 12:30:50.930 [错误] [smartgwtolap] 12:30:50.928:TMR9:WARN:RPCManager:org.olap4j.OlapException:XMLA

provider gave exception: 提供者给出了例外:

 <faultcode> SOAP-ENV:Server.00HSBB01 </faultcode> <faultstring> XMLA SOAP Body processing error </faultstring> <faultactor> Mondrian </faultactor> <detail> <XA:error xmlns:XA="mondrian sourceforge net"> <code> 00HSBB01 </code> <desc> The Mondrian XML: Mondrian Error:Internal error: Rowset 'DISCOVER_PROPERTIES' does not support property 'Roles' </desc> </XA:error> </detail> </SOAP-ENV:Fault> 

Request was: DISCOVER_PROPERTIES &quot;role1&quot; 请求是:DISCOVER_PROPERTIES“角色1” Data undefined - response: {operationId: "listCubes_fetch", clientContext: Obj, context: Obj, transactionNum: 0, httpResponseCode: 200, httpResponseText: "//isc_RPCResponseStart-->[{"data":"org.o..."[1497], xmlHttpRequest: Obj, transport: "xmlHttpRequest", status: -1, clientOnly: undef, httpHeaders: Obj, isStructured: true, callbackArgs: null, results: Obj, data: "org.olap4j.OlapException: XMLA provider ..."[1243], invalidateCache: false, isDSResponse: true, queueStatus: -1, startRow: 0, endRow: 0, totalRows: 0} com.smartgwt.client.core.JsObject$SGWT_WARN: 12:30:50.928:TMR9:WARN:RPCManager:org.olap4j.OlapException: XMLA provider gave exception: SOAP-ENV:Server.00HSBB01 XMLA SOAP Body processing error Mondrian 00HSBB01 The Mondrian XML: Mondrian Error:Internal error: Rowset 'DISCOVER_PROPERTIES' does not support property 'Roles' 数据未定义-响应:{operationId:“ listCubes_fetch”,clientContext:Obj,上下文:Obj,transactionNum:0,httpResponseCode:200,httpResponseText:“ // isc_RPCResponseStart-> [{” data“:” org.o ... “ [1497],xmlHttpRequest:对象,传输:” xmlHttpRequest“,状态:-1,clientOnly:undef,httpHeaders:Obj,isStructured:true,callbackArgs:空,结果:对象,数据:” org.olap4j.OlapException:XMLA提供者...“ [1243],invalidateCache:false,isDSResponse:true,queueStatus:-1,startRow:0,endRow:0,totalRows:0} com.smartgwt.client.core.JsObject $ SGWT_WARN:12:30: 50.928:TMR9:WARN:RPCManager:org.olap4j.OlapException:XMLA提供程序给出了异常:SOAP-ENV:Server.00HSBB01 XMLA SOAP正文处理错误Mondrian 00HSBB01 Mondrian XML:Mondrian错误:内部错误:行集'DISCOVER_PROPERTIES'不支持属性“角色”
Request was: DISCOVER_PROPERTIES &quot;role1&quot; 请求是:DISCOVER_PROPERTIES“角色1” Data undefined - response: {operationId: "listCubes_fetch", clientContext: Obj, context: Obj, transactionNum: 0, httpResponseCode: 200, httpResponseText: "//isc_RPCResponseStart-->[{"data":"org.o..."[1497], xmlHttpRequest: Obj, transport: "xmlHttpRequest", status: -1, clientOnly: undef, httpHeaders: Obj, isStructured: true, callbackArgs: null, results: Obj, data: "org.olap4j.OlapException: XMLA provider ..."[1243], invalidateCache: false, isDSResponse: true, queueStatus: -1, startRow: 0, endRow: 0, totalRows: 0} at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.inv 数据未定义-响应:{operationId:“ listCubes_fetch”,clientContext:Obj,上下文:Obj,transactionNum:0,httpResponseCode:200,httpResponseText:“ // isc_RPCResponseStart-> [{” data“:” org.o ... “ [1497],xmlHttpRequest:对象,传输:” xmlHttpRequest“,状态:-1,clientOnly:undef,httpHeaders:Obj,isStructured:true,callbackArgs:空,结果:对象,数据:” org.olap4j.OlapException:XMLA provider ...” [1243],invalidateCache:false,isDSResponse:true,queueStatus:-1,startRow:0,endRow:0,totalRows:0},位于sun.reflect.NativeConstructorAccessorImpl.newInstance0(本地方法),位于sun.reflect .com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor处的java.lang.reflect.Constructor.newInstance(未知源)处的sun.reflect.DelegatingConstructorAccessorImpl.newInstance(未知源)处的.NativeConstructorAccessorImpl.newInstance(未知源) .java:105)com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)com.google.gwt.dev.shell.OophmSessionHandler.inv oke(OophmSessionHandler.java:172) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364) at java.lang.Thread.run(Unknown Source) com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)上的oke(OophmSessionHandler.java:172)com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)上的oke(OophmSessionHandler.java:172)在com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)处在java.lang.Thread.run(未知源)

Other random parameters, such as "foo" or "bar", return no error whatsoever and are simply ignored. 其他随机参数,例如“ foo”或“ bar”,则不返回任何错误,并且将被忽略。 So "role" definitely does trigger something, but sadly not anything I can work with. 因此,“角色”肯定会触发某些内容,但遗憾的是我无法使用任何内容。

Anyone that can offer some insight? 有人可以提供一些见识吗? It is very much appreciated. 这是非常赞赏。 I have found something about the Pentaho XmlaHandler which accepts a role as an argument, but this seems to be something used inside of Mondrian and not necessarily something I can immediately use in SmartGWT - I think. 我已经找到了有关Pentaho XmlaHandler的信息,该信息接受角色作为参数,但这似乎是在Mondrian内部使用的,而不一定是我可以立即在SmartGWT中使用的东西。

Thanks for reading! 谢谢阅读!

EDIT 编辑

The snippet below returns error: 以下代码段返回错误:

java.lang.RuntimeException: org.olap4j.OlapException: Failed to obtain the database product name. java.lang.RuntimeException:org.olap4j.OlapException:无法获取数据库产品名称。

        Connection connectionXMLA = DriverManager.getConnection(dbUrl, p);
    OlapWrapper wrapper = (OlapWrapper) connectionXMLA;
    OlapConnection olapConnection = wrapper.unwrap(OlapConnection.class);
    String role = "role2";
    olapConnection.setRoleName(role);
    return olapConnection;

getAvailableRoleNames() function does return the roles specified in the schema file. getAvailableRoleNames()函数确实返回模式文件中指定的角色。 If I comment out the setRoleName(role) part it works just fine. 如果我注释掉setRoleName(role)部分,它就可以正常工作。

This isn't the way to set a role in olap4j. 这不是在olap4j中设置角色的方法。 Try using OlapConnection.setRoleName . 尝试使用OlapConnection.setRoleName

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM