on 04-02-2015 10:26 AM
目前老板需求使用BW的数据源,在其他数据库里建立权限对应表对数据进行权限管理。
已经确定了使用WEBI来进行二次开发,建立登录界面。
输入账号密码后进入界面,里面是用户能够看到的所有报表的超链接,点击超链接后弹窗相关的对象条件,部分条件是权限限制内的。
需要哪些SDK,目前进度做到了界面登录到指定页面,超链的创建需要一次能够取到权限下所有的WEBI文档,这些如何做到?
求大神解答下,谢谢。
我的理解是贵公司的需求是,完成登陆后得到一个该用户所有权限能看到的webi一览的超链接吧。
其实在写代码的时候,直接执行CMS查询
select * from CI_INFOOBJECTS where SI_KIND = 'Webi'"
就可以了,如果是管理员便会返回所有的webi,而如果用户没那么多权限,则这个query只能返回他所有的能看到的webi的列表。
具体可参考下面的简易的code:
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="com.crystaldecisions.sdk.exception.SDKException"%>
<%@ page import="com.crystaldecisions.sdk.framework.ISessionMgr"%>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.*"%>
<%@ page import="com.crystaldecisions.sdk.occa.pluginmgr.*"%>
<%@ page import="com.crystaldecisions.sdk.plugin.CeProgID"%>
<%@ page import="com.crystaldecisions.sdk.plugin.desktop.user.*"%>
<%@ page import="com.crystaldecisions.sdk.properties.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.io.*"%>
<%@ page import="java.text.*"%>
<%@ page import="com.crystaldecisions.sdk.exception.*, com.crystaldecisions.sdk.framework.*,
com.crystaldecisions.sdk.occa.infostore.*, com.crystaldecisions.sdk.plugin.CeKind,
com.crystaldecisions.sdk.plugin.desktop.folder.*, java.util.*"%>
<% try {
String systemName = "localhost:6400";
String userName = request.getParameter("user");
String password = request.getParameter("pwd");
String authType = "secEnterprise";
IEnterpriseSession enterpriseSession=null;
ISessionMgr enterpriseSessionMgr = CrystalEnterprise.getSessionMgr();
enterpriseSession = enterpriseSessionMgr.logon(userName, password, systemName, authType);
IInfoStore infostore = (IInfoStore)enterpriseSession.getService("InfoStore");
IInfoObjects iwebi = infostore.query("select * from CI_INFOOBJECTS where SI_KIND = 'Webi'");
out.println("User is: " + userName + "<br><br>");
for (int i=0; i<iwebi.getResultSize(); i++){
out.println("<a href='https://answers.sap.com/BOE/OpenDocument/opendoc/openDocument.jsp?iDocID=" + ((IInfoObject)iwebi.get(i)).getID() + "'>" + ((IInfoObject)iwebi.get(i)).getTitle() + "</a><br>");
}
enterpriseSession.logoff();
} catch(SDKException e) {} %>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.