ITPub博客

首页 > 应用开发 > IT综合 > 【BO-SDK】 BO InfoView embed apps (内嵌应用界面) 从InfoView登陆界面获取logonToken获得连接session: [EnterpriseSession][I

【BO-SDK】 BO InfoView embed apps (内嵌应用界面) 从InfoView登陆界面获取logonToken获得连接session: [EnterpriseSession][I

原创 IT综合 作者:xiangjinling 时间:2010-08-23 14:01:06 0 删除 编辑

request ——> InfoViewConstants.INFOVIEW_SESSION——>CrystalIdentity——>LogonTokenMgr

[@more@]

具体代码:

<%@ page import="com.crystaldecisions.sdk.occa.infostore.IInfoStore" %>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.IInfoObject" %>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.IInfoObjects" %>
<%@ page import="com.crystaldecisions.sdk.exception.SDKException" %>
<%@ page import="com.crystaldecisions.sdk.plugin.desktop.report.IReport" %>
<%@ page import="com.crystaldecisions.sdk.framework.IEnterpriseSession" %>

<%@ page import="com.businessobjects.infoview.common.InfoViewConstants"%>
<%@ page import="com.businessobjects.infoview.common.Utilities"%>
<%@ page import="com.businessobjects.infoview.common.CrystalIdentity"%>
<%@ page import="com.crystaldecisions.sdk.framework.internal.SessionMgr"%>
<%@ page import="com.crystaldecisions.sdk.framework.CrystalEnterprise"%>
<%@ page import="com.crystaldecisions.sdk.framework.ISessionMgr"%>

关键语句:

String token = ((CrystalIdentity)request.getSession().getAttribute(InfoViewConstants.INFOVIEW_SESSION)).getSession().getLogonTokenMgr().getDefaultToken();
//SessionMgr sessionMgr = new SessionMgr();
ISessionMgr sessionMgr = CrystalEnterprise.getSessionMgr();
IEnterpriseSession enterpriseSession = sessionMgr.logonWithToken(token);

IInfoStore iStore=(IInfoStore)enterpriseSession.getService("InfoStore");

其他处理:

String name=((CrystalIdentity)request.getSession().getAttribute(InfoViewConstants.INFOVIEW_SESSION)).getSession().getUserInfo().getUserName();
String auth=((CrystalIdentity)request.getSession().getAttribute(InfoViewConstants.INFOVIEW_SESSION)).getSession().getUserInfo().getAuthenMethod();
long pass=((CrystalIdentity)request.getSession().getAttribute(InfoViewConstants.INFOVIEW_SESSION)).getSession().getUserInfo().getPasswordExpiry();
out.println("UserName:"+name);
out.println("auth:"+auth);
out.println("pass:"+pass);

后续处理:

IInfoObjects result;
try {
result = iStore.query( "Select * From "

+ "CI_INFOOBJECTS Where SI_ID='37048'" );//26710

IInfoObject report = (IInfoObject) result.get(0);
IReport reporto=(IReport)report;
out.println("
");
out.println("


");
out.println("Report Name is:"+reporto.getTitle());

}
catch (SDKException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/24167472/viewspace-1037255/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-06-29

  • 博文量
    19
  • 访问量
    26371