We can embed a dashboard in a jsp file and deploy it as a web application on the web application server.Here we create a token using SAP BusinessObjects Enterprise Java SDK and that token is used to interact with the BI platform.We can hardcode the BOE server name,username,password and authentication type so that the users are not prompted for credentials when they view dashboards based on data connections which interact with platform.Below are the steps to achieve this functionality.
Create a dashboard based on Qaaws/ Live Office/BIWS connection which connects to the BI platform.
In the Data manager add a flash variable CELogonToken.
Export the dashboard to swf say Test.swf
Step 1:Export the dashboard to html and view its source and it would look like below.
<HTML>
<HEAD>
<TITLE>Test.swf</TITLE>
</HEAD>
<BODY>
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
WIDTH="800" HEIGHT="600" id="myMovieName">
<PARAM NAME=FlashVars VALUE="CELogonToken=">
<PARAM NAME="movie" VALUE="Test.swf">
<PARAM NAME="quality" VALUE="high">
<PARAM NAME="bgcolor" VALUE="#FFFFFF">
<PARAM NAME="play" VALUE="true">
<PARAM NAME="loop" VALUE="true">
<PARAM NAME=bgcolor VALUE="#FFFFFF">
<EMBED src="Test.swf" quality=high bgcolor=#FFFFFF WIDTH="800" HEIGHT="600"
NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash"
play="true" loop="true"
FlashVars="CELogonToken="
PLUGINSPAGE="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</EMBED>
</OBJECT>
</BODY>
</HTML>
Step 2:JSP code to create a token using SAP BusinessObjects Enterprise Java SDK
Below is the JSP code to generate a token where we hardcode some parameters like systemName,userName,password and authType
<%@ page import="com.crystaldecisions.sdk.exception.SDKException" %>
<%@ page import="com.crystaldecisions.sdk.framework.CrystalEnterprise" %>
<%@ page import="com.crystaldecisions.sdk.framework.IEnterpriseSession" %>
<%@ page import="com.crystaldecisions.sdk.framework.ISessionMgr" %>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.IInfoStore" %>
<%@ page import="com.crystaldecisions.sdk.occa.security.ILogonTokenMgr"%>
<%! String defaultToken =null; %>
<%
try
{
String systemName = "BOBJprod";
String userName = "administrator";
String password = "Secure09";
String authType = "secEnterprise";
IEnterpriseSession enterpriseSession=null;
ISessionMgr enterpriseSessionMgr = CrystalEnterprise.getSessionMgr();
enterpriseSession = enterpriseSessionMgr.logon(userName, password, systemName, authType);
ILogonTokenMgr logonTokenMgr = enterpriseSession.getLogonTokenMgr();
defaultToken = logonTokenMgr.getDefaultToken();
}
catch(Exception e)
{
out.println(e);
}
%>
Step 3:Embedding the html into the jsp
Copy the html code from step1 and paste it below the jsp code in step2 and modify the first PARAM tag by adding a expression <%=defaultToken%>(highlighted in italic bold in the below code).
<%@ page import="com.crystaldecisions.sdk.exception.SDKException" %>
<%@ page import="com.crystaldecisions.sdk.framework.CrystalEnterprise" %>
<%@ page import="com.crystaldecisions.sdk.framework.IEnterpriseSession" %>
<%@ page import="com.crystaldecisions.sdk.framework.ISessionMgr" %>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.IInfoStore" %>
<%@ page import="com.crystaldecisions.sdk.occa.security.ILogonTokenMgr"%>
<%! String defaultToken =null; %>
<%
try
{
String systemName = "BOBJprod";
String userName = "administrator";
String password = "Secure09";
String authType = "secEnterprise";
IEnterpriseSession enterpriseSession=null;
ISessionMgr enterpriseSessionMgr = CrystalEnterprise.getSessionMgr();
enterpriseSession = enterpriseSessionMgr.logon(userName, password, systemName, authType);
ILogonTokenMgr logonTokenMgr = enterpriseSession.getLogonTokenMgr();
defaultToken = logonTokenMgr.getDefaultToken();
}
catch(Exception e)
{
out.println(e);
}
%>
<HTML>
<HEAD>
<TITLE>Test.swf</TITLE>
</HEAD>
<BODY>
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
WIDTH="800" HEIGHT="600" id="myMovieName">
<PARAM NAME=FlashVars VALUE="CELogonToken=<%=defaultToken%>">
<PARAM NAME="movie" VALUE="Test.swf">
<PARAM NAME="quality" VALUE="high">
<PARAM NAME="bgcolor" VALUE="#FFFFFF">
<PARAM NAME="play" VALUE="true">
<PARAM NAME="loop" VALUE="true">
<PARAM NAME=bgcolor VALUE="#FFFFFF">
<EMBED src="Test.swf" quality=high bgcolor=#FFFFFF WIDTH="800" HEIGHT="600"
NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash"
play="true" loop="true"
FlashVars="CELogonToken="
PLUGINSPAGE="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</EMBED>
</OBJECT>
</BODY>
</HTML>
Now save this complete code mentioned in this step as Test.jsp .
Step 4:View the dashboard i.e access the jsp page in browser
For SAP BO XI 3.1 place the two files i.e Test.jsp (from step3) and Test.swf inside InfoViewApp that is inside webapps folder.
Now to view the dashboard go to the url http://server:port/InfoViewApp/Test.jsp we see that we are not prompted for the credentials.
In BI 4.0 you need to place these two files i.e Test.jsp and Test.swf inside explorer folder that is inside webapps folder.
Now to view the dashboard go to the url http://server:port/explorer/Test.jsp we see that we are not prompted for the credentials.
If you dont want to put these two files that is jsp and the swf inside the InfoviewApp or explorer folder then you can create your own web application as below:--
1)Copy the lib folder (which is inside the java folder) from installation directory of the BO as below
C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java.This lib folder has all the jars that are required for running jsp
2)Create a directory inside the web-apps folder say MyApp
3)Inside this folder paste your Test.jsp and Test.swf file
4)Inside the MyApp folder create another folder that is WEB-INF
5)Inside WEB-INF paste the lib folder
Restart the tomcat
Now access the jsp file as http://server:port/MyApp/Test.jsp