on 09-04-2009 4:41 PM
Hi,
We are using opendoc to link up reports from a java based web app.
The webapp creates a session and then creates a token off the session. getDefaulttoken() is being used to get the token.
The token is being used by the opendoc call to view a report.
There is a independent thread created in the app which logs off the session after the opendoc call has been made.
We are seeing that when the opendoc call is made it creates another session and it's being used to view the report.
Thus after the opendoc call there are two sessions created in the system. Our background threads goes and cleans up the first session but the session created by open doc is still there and can't be accessed by the java app for clean up.
Is this expected behavior of opendoc? is there any parameter which needs to be updated to make sure opendoc doesn't create a new session?
Thanks,
Sumit
Using the defaulttoken will create a new session when using opendocument. The only way for it not to create a new session is to create a wcatoken. IEnterpriseSession.getLogonTokenMgr().createWCAToken("", 5, 5). This is the way to have it share the same session instead of creating a new one. If you have code that is cleaning up the original session, you will need to be careful when you log it off, as it will effectively kill your opendocument page from being able to perform any further actions, ie paging, exporting, etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Adam,
Thanks for your reponse.
I posted this in a message to SAP and they came back saying that there is no means to utilize OpenDoc w/o creating a new session.
They recommended using the viewer directly instead of redirecting to an opendoc call.
Opendoc creates a new session automatically whenever it's being used to open a report, using the viewer would help go around that.
Thanks,
Sumit
Following is the code for url reporting with Opendocument:
<%@ 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"%>
<%
try{
String systemName = "admin-09db244eb";
String userName = "Administrator";
String password = "";
String authType = "secEnterprise";
IEnterpriseSession enterpriseSession=null;
if (enterpriseSession == null)
{
ISessionMgr enterpriseSessionMgr = CrystalEnterprise.getSessionMgr();
enterpriseSession = enterpriseSessionMgr.logon(userName, password, systemName, authType);
}
ILogonTokenMgr logonTokenMgr = enterpriseSession.getLogonTokenMgr();
String defaultToken = logonTokenMgr.createWCAToken("",20,10);
response.sendRedirect("http://admin-09db244eb:8080/OpenDocument/opendoc/openDocument.jsp?iDocID="6011"&sRefresh=Y&token="+defaultToken);
}
catch(Exception e){
}
Make the necessary changes in the code(ex: cmsname,iDocID,etc.) accordingly.
Regards,
Anuj
Following is the code for url reporting with Opendocument:
<%@ 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"%>
<%
try{
String systemName = "admin-09db244eb";
String userName = "Administrator";
String password = "";
String authType = "secEnterprise";
IEnterpriseSession enterpriseSession=null;
if (enterpriseSession == null)
{
ISessionMgr enterpriseSessionMgr = CrystalEnterprise.getSessionMgr();
enterpriseSession = enterpriseSessionMgr.logon(userName, password, systemName, authType);
}
ILogonTokenMgr logonTokenMgr = enterpriseSession.getLogonTokenMgr();
String defaultToken = logonTokenMgr.createWCAToken("",20,10);
response.sendRedirect("http://admin-09db244eb:8080/OpenDocument/opendoc/openDocument.jsp?iDocID="6011"&sRefresh=Y&token="+defaultToken);
}
catch(Exception e){
}
Make necessary changes in the code (ex: cmsname,iDocID,etc.) accordingly.
Regards,
Anuj
User | Count |
---|---|
79 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.