MyEclipse 10
saiku2.5源码
saiku-server-foodmart-2.5.zip
type=OLAP
name=testdatasource
driver=mondrian.olap4j.MondrianOlap4jDriver
location=jdbc:mondrian:Jdbc=jdbc:mysql://localhost:3306/testdatasource;Catalog=res:testdatasource/testdatasource.xml;
username=root
password=111111
解释下上面一条的的参数
type=OLAP就不多说了,先按固定的来
name=testdatasource 数据源名称
driver=mondrian.olap4j.MondrianOlap4jDriver 可以理解为固定的,Mondrian的
修改内容为如下(重点是红色内容): InputStream in = readVirtualFile(catalogUrl); try { return IOUtils.toString(in,"utf-8"); //-----------------此行为红色行 } finally { IOUtils.closeQuietly(in); } 或者按照网上说的另外一种方式,整体替换为如下内容,也可以,不过下面的编码必须写你的schema文件的编码: try { final byte[] bytes = Util. readFully(in, 1024); final char[] chars = new char[bytes. length]; for ( int i = 0; i < chars. length; i++) { chars[i] = ( char) bytes[i]; } String str = new String(bytes,"utf-8").replace("\ufeff" , "" );//加replace("\ufeff", "")是为了过滤"UTF-8无BOM格式文件"的开头 return str; } finally { if (in != null) { in.close(); } }
2、再找到文件 mondrian.rolap.RolapSchema.lo
解决办法,需要修改4个地方的编码:
修改 xml = new String( (byte[]) f.getEntity());为 xml = new String( (byte[]) f.getEntity(),"utf-8");
修改 InputSource source = new InputSource( ( new ByteArrayInputStream( xml.getBytes() ) ) );为 InputSource source = new InputSource( ( new ByteArrayInputStream( xml.getBytes("UTF-8") ) ) );
修改 InputStreamReader reader = new InputStreamReader(repoFile.getContent().getInputStream());为 InputStreamReader reader = new InputStreamReader(repoFile.getContent().getInputStream(),"UTF-8");
修改 OutputStreamWriter ow = new OutputStreamWriter(repoFile.getContent().getOutputStream());为 OutputStreamW
1、Setting.js中有个配置项:'saiku.olap.query.automatic_execution': 'true',
1、Setting.js中有个配置项:'saiku.olap.query.automatic_execution': 'true',
2、在Repository界面双击saiku文件查询不自动,需要在Workspace.js文件的410行附近,修改如下代码,将其中调用query.run的代码注释
if (typeof isNew != "undefined") { //this.query.run(false); }
by 刘迎光@萤火虫工作室
OpenBI交流群:495266201
MicroService 微服务交流群:217722918
mail: liuyg#liuyingguang.cn
博主首页(防止爬虫):http://blog.liuyingguang.cn
OpenBI问答社区:http://openbi.liuyingguang.cn/
<repository> <id>mine</id> <name>public Releases</name> <layout>default</layout> </repository> <repository> <id>mine-meteorite-bi-release</id> <name>publ |