pentaho BI中的租户感知数据源

时间:2013-02-13 17:22:15

标签: pentaho

我们有几个客户(公司),每个客户都有单独的数据库,即公司A有数据库A,公司B有数据库B等,所以我想要实现的是,在pentaho用户控制台中,所有这些公司都使用相同的报告但例如,使用不同的datasoruce CompanyA,CompanyB..etc可以访问此文件夹中名为“Reports”的解决方案文件夹 一个报告列表,例如weeklySales_report所以我希望weeklySales_report在loged-in用户来自companyA时使用CompanyA的数据库,当登录用户来自companyB时使用CompanyB的数据库,

我试过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. 

抱怨<property name="datasourceNameFormat" value="<![CDATA[{0}-{1}]]>

有关导致此错误的原因的任何想法,或者是否有其他方法可以执行此操作 感谢

1 个答案:

答案 0 :(得分: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组件也一样。

相关问题