【问题标题】:tenant-aware datasource in pentaho BItenant-aware datasource in pentaho BI
【发布时间】:2013-02-13 17:22:15
【问题描述】:

我们有几个客户(公司),每个客户都有单独的数据库,即 companyA 有 databaseA,CompanyB 有 databaseB ...等等,所以我想要实现的是,在 pentaho 用户控制台中,所有这些公司都使用相同的报告,但是使用不同的数据源,例如 CompanyA,CompanyB..etc 将有权访问该文件夹具有的名为“Reports”的解决方案文件夹 报告列表,例如每周销售报告,所以我希望每周销售报告在登录用户来自公司 A 时使用公司 A 的数据库,并在登录用户来自公司 B 时使用公司 B 的数据库,

我试过this,但我收到了这个错误

XmlBeanDefinitionStoreException: Line 67 in XML document from file [C:\pentaho2 
biserver-ce\pentaho-solutions\system\pentahoObjects.spring.xml] is invalid; nes 
ed exception is org.xml.sax.SAXParseException; lineNumber: 67; columnNumber: 50 
 The value of attribute "value" associated with an element type "property" must 
not contain the '<' character. 

它在抱怨&lt;property name="datasourceNameFormat" value="&lt;![CDATA[{0}-{1}]]&gt;

关于导致此错误的原因的任何想法,或者是否有任何其他方法可以做到这一点 谢谢

【问题讨论】:

    标签: pentaho


    【解决方案1】:

    我不确定你的方式,但完全有可能拥有动态 jndi。您可以在 xaction 中的变量中添加 jndi,并可以在 xaction 中使用它来区分目标数据库。

    <inputs> 
    <JNDDDI type="string"> 
      <sources> 
        <request>JNDDDI</request> 
      </sources>  
      <default-value><![CDATA[jndi_database1]]></default-value> 
    </JNDDDI>
    

    ....

    <action-definition> 
    <component-name>SQLLookupRule</component-name>
    <action-type>hourly</action-type>
    <action-inputs> 
      <JNDDDI type="string"/>
    </action-inputs>
    <action-outputs> 
      <prepared_component type="sql-query"/> 
    </action-outputs>
    <component-definition> 
      <jndi>{JNDDDI}</jndi>  
      <query><![CDATA[select ...from ...]]></query>  
      <live><![CDATA[true]]></live> 
    </component-definition> 
    

    如果您使用 JasperReport 组件,也是如此。

    【讨论】:

    • 我在哪里可以获得有关如何实现此目的的文档或 wiki 文章?我是新手,我尝试使用 Xaction 传递 JNDI,但我想必须在 xaction 中指定 SQL(select 语句)并将查询结果提供给报告,如果报告是使用元数据数据源创建的呢?我可以使用 xaction 将 JNDI 传递给元数据吗?
    • 我如何为 CDE 报告参考实现相同的东西点击这里link
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-02-17
    • 1970-01-01
    • 2022-12-02
    • 2013-05-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多