How manage timeout Session using java SDK?
Hi everyone !
I'm working with BO 4.1 and the Java SDK. I'm refreshing and exporting webi reports in my code. But it happens, sometimes, the report takes longer to refresh (when calling "setPrompts") and the session is over (timeout like when you're connected in the Launchpad).
Is there any specific way for me to test if the call to setPrompts ends without timeout? Because, now, if it ends by a timeout, I do not see anything and I'm exporting a blank document. No error or exception :-/
Do I have to use de EnterpriseSession?
Thanks in advance !
Hi Jerome,
To understand BO session management, refer to the below document.
http://scn.sap.com/community/bi-platform/blog/2013/11/27/session-management-bible
How do you specify that there is a timeout? Do you get timeout errors in web intelligence server logs?
Check whether enterprise session is still valid.
What is the approximate time delay you observe for setPrompts when you observe the timeout?
-Prithvi
Similar Messages
-
Creating a sample report using JAVA SDK
Hi,
I am trying to create a sample report using JAVA SDK.
I slelect 4 "free cells" and pass 4 different strings to it.
I even slelect the font colour and size. When i run the class and try to view the report in Infoview, I only seeblank blocks without any data. Now if I edit the report from infoview, and save the changes, I am able to see the data.
My issue is, Why am I not able to see the data when I run the java code.
Please find teh code below.
package com;
import java.awt.Color;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.businessobjects.rebean.wi.BinaryView;
import com.businessobjects.rebean.wi.DataProvider;
import com.businessobjects.rebean.wi.DataProviders;
import com.businessobjects.rebean.wi.DataSource;
import com.businessobjects.rebean.wi.DataSourceObject;
import com.businessobjects.rebean.wi.DocumentInstance;
import com.businessobjects.rebean.wi.DocumentLocaleType;
import com.businessobjects.rebean.wi.FontImpl;
import com.businessobjects.rebean.wi.FreeCell;
import com.businessobjects.rebean.wi.HTMLView;
import com.businessobjects.rebean.wi.OutputFormatType;
import com.businessobjects.rebean.wi.PageHeaderFooter;
import com.businessobjects.rebean.wi.Query;
import com.businessobjects.rebean.wi.Recordset;
import com.businessobjects.rebean.wi.Report;
import com.businessobjects.rebean.wi.ReportBody;
import com.businessobjects.rebean.wi.ReportCell;
import com.businessobjects.rebean.wi.ReportContainer;
import com.businessobjects.rebean.wi.ReportElement;
import com.businessobjects.rebean.wi.ReportEngine;
import com.crystaldecisions.sdk.framework.CrystalEnterprise;
import com.crystaldecisions.sdk.framework.IEnterpriseSession;
import com.crystaldecisions.sdk.framework.ISessionMgr;
import com.crystaldecisions.sdk.occa.infostore.IInfoObject;
import com.crystaldecisions.sdk.occa.infostore.IInfoObjects;
import com.crystaldecisions.sdk.occa.infostore.IInfoStore;
import com.crystaldecisions.sdk.plugin.CeKind;
public class Aug7th {
* @param args
public static void main(String[] args) {
// TODO Auto-generated method stub
String CMS = "pundl8136:6400";
String userID = "srivas";
String password = "morcom123";
String auth = "secEnterprise";
List<String> entire =new ArrayList<String>();
List<String> country =new ArrayList<String>();
List<String> resort =new ArrayList<String>();
IEnterpriseSession enterpriseSession;
try
ISessionMgr mySessionMgr = CrystalEnterprise.getSessionMgr();
enterpriseSession = mySessionMgr.logon(userID, password, CMS,auth);
if (enterpriseSession != null)
{//Create and store useful objects for the session.
IInfoStore iStore = (IInfoStore)enterpriseSession.getService("InfoStore");
ReportEngine reportEngine = (ReportEngine)enterpriseSession.getService("WebiReportEngine");
IInfoObject infoView = null;
String str = "SELECT SI_ID, SI_NAME, SI_PARENTID FROM CI_INFOOBJECTS WHERE (SI_KIND = '"+CeKind.WEBI+"' OR SI_KIND='FullClient') " +
"AND SI_INSTANCE = 'false' AND SI_NAME='Structure Test_001_Java' ORDER BY SI_NAME ASC ";
//String str = "SELECT SI_ID, SI_NAME, SI_PARENTID FROM CI_INFOOBJECTS ORDER BY SI_NAME ASC ";
IInfoObjects objInfoObjectsWIDs = (IInfoObjects) iStore.query(str);
System.out.println(objInfoObjectsWIDs.size());
IInfoObject objInfoObjectWID = (IInfoObject) objInfoObjectsWIDs.get(0);
DocumentInstance doc = reportEngine.openDocument(objInfoObjectWID.getID());
DataProviders dps = doc.getDataProviders();
// Retrieve the 1st data provider
DataProvider dp = dps.getItem(0);
// Retrieve the universe objects
DataSource ds = dp.getDataSource ();
Query q = dp.getQuery();
Recordset rs = dp.getResult(0);
// 0: assume query has one flow
rs.first();
// Print the column types. They can be Integer, String,
// or Date.
for (int i = 0; i < rs.getColumnCount(); i++) {
Class c = rs.getColumnType(i);
StringBuffer sbt = new StringBuffer();
if ( c.equals(Integer.class) )
sbt.append("Integer");
if ( c.equals(String.class) )
sbt.append("String");
if ( c.equals(Date.class) )
sbt.append("Date");
sbt.append(";");
System.out.println(sbt.toString());
System.out.println(rs.getColumnCount());
while (!rs.isLast()) {
// column names
StringBuffer sbn = new StringBuffer();
StringBuffer sbd = new StringBuffer();
for (int j = 0; j < rs.getColumnCount(); j++) {
sbn.append( rs.getColumnName(j).toString() );
sbn.append(";");
System.out.println("sbn "+sbn.toString());
// data
for (int k= 0; k< rs.getColumnCount(); k++) {
sbd.append( rs.getCellObject(k).toString() );
sbd.append(";");
entire.add(rs.getCellObject(k).toString());
System.out.println("sbd "+sbd.toString());
rs.next();
System.out.println(entire.size());
for(int i=0;i<entire.size();i++){
country.add(entire.get(i));
i++;
System.out.println("entireList "+entire.get(i));
resort.add(entire.get(i));
DataSourceObject city = ds.getClasses().getChildByName("Country");
DataSourceObject resorts = ds.getClasses().getChildAt(1);
dp.runQuery();
ReportContainer report = doc.createReport("Resort");
PageHeaderFooter header = report.getPageHeader();
FreeCell headerCell = header.createFreeCell("Resort Report");
PageHeaderFooter footer = report.getPageFooter();
FreeCell footerCell = footer.createFreeCell("Report Ends");
ReportBody body = report.createReportBody();
for(int k=0;k<resort.size();k++){
FreeCell res=body.createFreeCell(resort.get(k));
res.getAttachTo();
res.setHeight(15d);
res.setWidth(30d);
Color c = new Color(255,255,255);
Color c1 = new Color(255,0,0);
FontImpl fnt = (FontImpl)res.getFont();
fnt.getDecoration().setTextColor(c1);
res.setFont(fnt);
//res.deleteAttachment();
//res.setAttachTo(body,VAnchorType.BOTTOM,HAnchorType.NONE);
doc.applyFormat();
doc.refresh();
final String l_docToken = doc.getStorageToken();
final DocumentInstance l_docToSave = reportEngine.getDocumentFromStorageToken(l_docToken);
doc.saveAs("mor31",835,null,null);
doc.closeDocument();
str = "SELECT SI_ID, SI_NAME, SI_PARENTID FROM CI_INFOOBJECTS WHERE (SI_KIND = '"+CeKind.WEBI+"' OR SI_KIND='FullClient') " +
"AND SI_INSTANCE = 'false' AND SI_NAME='mor31' ORDER BY SI_NAME ASC ";
//String str = "SELECT SI_ID, SI_NAME, SI_PARENTID FROM CI_INFOOBJECTS ORDER BY SI_NAME ASC ";
objInfoObjectsWIDs = (IInfoObjects) iStore.query(str);
System.out.println(objInfoObjectsWIDs.size());
objInfoObjectWID = (IInfoObject) objInfoObjectsWIDs.get(0);
DocumentInstance doc1 = reportEngine.openDocument(objInfoObjectWID.getID());
String token = doc1.getStorageToken();
DocumentInstance doc2 = reportEngine.getDocumentFromStorageToken(token);
doc2.saveAs("123123", 835, null, null);
// doc.refresh();
//doc.save();
enterpriseSession.logoff();
catch(Exception e)
e.printStackTrace();duplicate post:
Sample report using JAVA SDK -
I am creating a cloud service on azure with 2 virtual machines using java sdk API. Service created successfully.
My input endpoint details are as follows.
INPUT ENDPOINTS
Head : 191.238.144.47:2400
Head : 191.238.144.47:22
Node0 : 191.238.144.47:43211
For Head instance port 2400 is for HTTPS and port 22 is for SSH and for Node0 instance port 43211 is for SSH.
But I am having problem with doing a ssh on Head instance. Sometimes it works sometimes doesn't. Same problem with HTTPS also.
I have some application running over there but when i try to access it thru browser sometimes it works but most of the time doesn't. When I restart the instances from azure portal, its works after
that(not always but most of the time).
Now I am confused what is going on there. I am creating cloud service and virtual machines using java sdk and setting input endpoints also. After creation of all instances i restart every instance programmatically .
I am not sure whether restart is required or not. It must be something to do with input endpoints only but not able to get the right thing i guess. When i do the same thing thru azure portal(creation of cloud service with virtual machines and setting up input
end points) everything works fine but not achieving the result when implementing it by java sdk API. Please help me.HI Nithin,
Thanks for your reply. I am setting the endpoints after creating my instances using update call. Here's the code snippet.
AzureService aServ = new AzureService(session);
if(aServ.checkNameAvailability(clusterName)) {
aServ.createHostedService(clusterName, "dbX cluster");
// Creating head instance
aServ.createHead(clusterName, imgName, headType, userName, pswd);
// Setting end points for head node
String name = "ssh";
int port = 22;
aServ.updateVMInputEndpoint(clusterName, "Head", name, port);
// Restarting head instance
aServ.restartVM(clusterName, "Head");
String roleName = "Node";
String tmpRoleName = "";
for(int i=0; i<noi; i++) {
port = 43210+(i+1);
tmpRoleName = roleName + i;
// Creating node instance
aServ.createVM(clusterName, tmpRoleName, imgName, nodeType, userName, pswd);
// Setting end points for node instance
aServ.updateVMInputEndpoint(clusterName, tmpRoleName, name, port);
// Restarting node instance
aServ.restartVM(clusterName, tmpRoleName);
// Method to update the input endpoint details
public void updateVMInputEndpoint(String clusterName, String vmName, String name, int port)
throws Exception {
VirtualMachineGetResponse resp = computeManagementClient.getVirtualMachinesOperations().
get(clusterName, clusterName, vmName);
VirtualMachineUpdateParameters updateParameters = new VirtualMachineUpdateParameters();
//get the configuration list
ArrayList<ConfigurationSet> configlist = resp.getConfigurationSets();
//get inputendpoint list and update it
ArrayList<InputEndpoint> endpointlist = configlist.get(0).getInputEndpoints();
InputEndpoint inputEndpoint = new InputEndpoint();
inputEndpoint.setEnableDirectServerReturn(false);
inputEndpoint.setPort(port);
inputEndpoint.setLocalPort(port);
inputEndpoint.setName(name);
inputEndpoint.setProtocol(InputEndpointTransportProtocol.TCP);
endpointlist.add(inputEndpoint);
// Open port for https on head node
if(vmName.equals("Head")) {
inputEndpoint = new InputEndpoint();
inputEndpoint.setEnableDirectServerReturn(false);
inputEndpoint.setPort(2400);
inputEndpoint.setLocalPort(2400);
inputEndpoint.setName("https");
inputEndpoint.setProtocol(InputEndpointTransportProtocol.TCP);
endpointlist.add(inputEndpoint);
updateParameters.setConfigurationSets(configlist);
//required for update
OSVirtualHardDisk osVirtualHardDisk = resp.getOSVirtualHardDisk();
updateParameters.setOSVirtualHardDisk(osVirtualHardDisk);
updateParameters.setRoleName(resp.getRoleName());
OperationResponse updtResp = computeManagementClient.getVirtualMachinesOperations().update(clusterName, clusterName, resp.getRoleName(), updateParameters);
And every time i am creating a new cloud service along with head and node instances. Region is "South Central US".
I am setting ProvisionGuestAgent field to true at instance creation time. Thank you. -
SAP BO Report Scheduling and Save as report using Java SDK
Hi All,
We have a java product which is integrated with SAP BO using Java SDK and we have certain java screen through which we select report prompt values and webi report gets run.
Now we want to give a functionality to save report to BO repository.
When user select certain check box from java screen a separate copy of the webi report should get saved under default folder on BO repository.
Also, we want user to choose the scheduling option from java screen only (and not the one which we use from BI Launchpad) due to certain access restriction. User does not have access to BI Launchpad. Only he can run report by selecting values through Java screen.
If i need to create a separate screen for scheduling as well as saving webi report then also i am ok with it.
P.S. i guess we need to work on Java SDK level. But could somebody please help me with the right direction?
Let me know in case requirement is not clear.Hi Ketan,
As you are on version BI 4.0 SP5 and would be migrating to BI 4.1, the best SDKs to use would be the Restful Webservices SDKs.
You have the options to schedule a webi report with prompts as well as the save feature which you require.
Please refer to the webi restful guides avialble at
For BI 4.0 SP5
http://help.sap.com/businessobject/product_guides/boexir4/en/xi4sp5_webi_restful_ws_en.pdf
For BI 4.1 SP4
http://help.sap.com/saphelpiis_sbo41sp4wi-sdk/frameset.htm
Refer to the below blog to understand the Restfull Webservices SDKs.
http://scn.sap.com/community/restful-sdk/blog/2013/09/07/scripting-web-intelligence-the-restful-raylight-web-services--learing-it
More blogs on Rest are available at
http://scn.sap.com/community/restful-sdk/content#filterID=contentstatus%5Bpublished%5D~objecttype~objecttype%5Bblogpost%5D
You can find the samples from the below link
http://scn.sap.com/community/restful-sdk/content#filterID=contentstatus%5Bpublished%5D~objecttype~objecttype%5Bdocument%5D
You would need to refer to the community below in case you have concerns about Rest SDKs.
http://scn.sap.com/community/restful-sdk
Thanks,
Prithvi -
How to send attachments using java application and outlook
Hi ,
I created an application in java which is as
on the Conference Tab i can schedule a conference and with the send command on page it map all the scheduled data to outlook(with all conference details) and using outlook send option the mails are send to appropriate user.
but now i want to modify this application such as when i use the send command from my jsp page it should attach the file that is in .vcs or .ics format for auto updation of user calender.
can any one know how to send attachment using java application .Last time I checked, SMS was a service between carriers and doing SMS yourself was really tricky. Some services existed to let you do it but as I recall they wanted non-trivial money.
However, most phone carriers provide an email-to-SMS bridge of some kind.
So the easiest thing is just to send an email.
That's sending from a non-phone to a phone. There's a J2ME library to send/receive SMS from/to a phone.
However, this is from memory, and a little out of date, so I could be entirely wrong. Hope it helps anyway. -
How to resize image using java imageio
Hello ,
I want to know how to resize image using java imageio.
I dont want to use java awt because i am writing a web application.
help is very much needed
thank you.Just use an AffineTransform !
Its much easier -
Hi all,
how to access OVD using Java?
Thanks,
Kumar.PHi,
You can just normal LDAP API codes to connect to OVD the same way you connect to other LDAP servers.
PFB sample code for connecting to OVD.
Properties props = new Properties();
try {
props.load(new FileInputStream("LdapCredentials.Properties"));
} catch (IOException e) {
// TODO
ldapurl = "ldap://hostname:390";
ldapUser = "cn=orcladmin,ou=Org12,dc=ovid,dc=com";
userPassword = "welcome1"; //"Killtheking123456";
userContext = "ou=Join1,dc=ovid,dc=com";
Now, you have to get Directory Context as shown below.
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, ldapurl);
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, username);
env.put(Context.SECURITY_CREDENTIALS, password);
//Initialize the Directory context
DirContext dCtx = new InitialDirContext(env);
Then you can perform search operations or new user creation etc., as you wish.
Does this help?
-Mahendra. -
How to use Java SDK to schedule a report in business objects
hi guys i am having a scenario , were the Java SDK will be passing the parameters dynamically to the report in business objects . the Java SDK is kicked by the file based events. this Java SDK will be on the unix server and the business object is also on the unix server. I am having the crystal reports in boe which need to be triggered by the Java SDK . such that the report is scheduled to a particular location on the unix for every week,when the java passes the parameters to the report in boe
Edited by: americansalt on Nov 4, 2010 11:30 AMYou can do this by using the BOE SDK. Here are some samples:
http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/806fc83f-18ba-2b10-f2b9-cbb49963fc93
Regards,
Stratos -
[BOXIR2] required before using JAVA SDK's
Hi,
I need somme information before begin the development of customisation of BusinessObjects XIR2.
My company using only the BusinessObjects reports (rep and unv file) from BusinessObjects 6.x with some VBA macro for interact with internal specific product.
Now, with the futur migration, the solution available is the conversion of JAVA framework of all VBA macros but before migration, i need information it's available by the JAVA SDK's.
Questions :
1° : It's possible to import all reports and universes from 'repository'to local folder ?
2° : It's possible to export all reports and universes from local folder to 'repository' ?
3° : it's possible to change the connexion for univers by one another ?
4° : it's possible to change the name of table in a specific universe (like CWD01 --> CWD01_2)?
5° : it's possible to add table,class and Objects into specific universe ?
It's very important for beginning the migration of BOXIR2.
Thank you,
GillesHi Michael,
What if i need to add an Global variable in the below code ?
Also can you please suggest me a book or reference documentation on how to use Groovy in ODI ? Thanks for your help.
//find the variable and add it to the load plan.
varTextGen = new OdiVariableTextGeneratorDwgImpl(odiInstance)
varFinder = (IOdiVariableFinder) odiInstance.getTransactionalEntityManager().getFinder(OdiVariable.class)
varName = "V_EXAMPLE_TWO"
var = varFinder.findByName(varName, projectName)
varId = var.getVariableId()
loadPlanVariable = loadPlan.addVariable(var, varTextGen) -
Error while trying to save a report using Java SDK for CR server 2011
I use the java sdk to update the report database jndi alias and then save the report. While saving the report, the utility throws the following exception. It only happens to 3 reports out of more than 70 reports. What could be the problem with report that is causing this problem ?
Thanks.
com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException: Failed to read data from report file C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\Data\CrystalRep
ortsRasServer\temp\{56586260-E771-4C63-BF8B-F3CF14BB508A}.rpt. Reason: Repository object could not be found.---- Error code:-2147467259 [CRSDK00000000] Error code name:failed
at com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException.throwReportSDKServerException(ReportSDKServerException.java:109)
at com.crystaldecisions.proxy.remoteagent.ExceptionHelper.throwResultInfoException(ExceptionHelper.java:192)
at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.sendSyncRequest(ReportClientDocument.java:803)
at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.doSave(ReportClientDocument.java:820)
at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.save(ReportClientDocument.java:2245)The error points to the report using a repository object that it cannot be found. What happens if you try and update the reports using the Crystal Report Designer instead of the SDK?
-
Migration from Crystal IX to BO-XI using java sdk-- very urgent
Post Author: Pranav.Sharma
CA Forum: Migration to XI R2
Need help in migration from Crystal Report IX to BO-XI.
Currently we are using CR IX and Java SDK to access reports from J2ee application. These reports reside on remote server where we have shared access to that directory.
We are accessing these reports through our j2ee application.Can anyone please elaborate whether we can use same SDK here with slight change in code probably in authentication related to CMS etc and calling mechanism or we have to go for BO java SDK alltogether. Is anything we are missing here?
Can anyone please help as we have to complete migration in 1-2 days.The first thing you will want to do is to publish all of your reports to Business Objects XI and make sure they all still work. Obviously they won't have the dynamic parameters anymore but you should just ensure they all work and are able to connect to their databases. You can use a tool like the publishing wizard to help you.
All the reports should now be available inside of XI.
Unfortunately you will need to manually modify all of the 400 reports to use the business objects Dynamic Cascading Parameters DCP.
There should be some DCP info in the Business Views documentation.
I hope this helps
Rob Horne<br /><a href="/blog/10">Rob's blog - http://diamond.businessobjects.com/robhorne</a> -
How to create Webservice using java
Hi Experts,
I am very new to Visual composer, can any one of you suggest how to create a webservice using java so that i can use that webservice in Visual Composer application.If it is possible please give me detailed description about it.
Regards,
Prasanna.Hi Prasanna,
See if my article is of any use to you:
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/b00917dc-ead4-2910-3ebb-b0a63e49ef10">How to Create a Web Service using an Enterprise JavaBean</a>
For creating Web Services, you won't need to do the MS SQL Part explained in my doc. You can just concentrate on the part where i explain how to create a Web Service using an EJB.
Bye
Ankur -
Possible to manage Windows processes using Java
Hi,
I'm looking to develop a standalone application that will be able to kill certain Windows processes...is such a thing possible using Java? If not, could someone point me in the direction of a technology that can achieve this?
Thanks[LEARN HOW TO RESEARCH YOURSELF!!! THEN ASK QUESTIONS LATER|http://tinyurl.com/yllkh3v]
Mel -
Dear All
How we can send SMS(Short Message Service) to mobile phones using java.
By Registering in some sites and using that user name and password we can send SMS.
But after some limited SMS we have to pay for further use.
I need some thing which we can use as free.
Can any one help me
Thanks in AdvanceThe easiest way would be to send a regular email to a Email to SMS gateway.
Check out the list of Email to SMS gateways at http://en.wikipedia.org/wiki/SMS_gateways -
How to send fax using java programming
i need to send files in my hard disk through fax using java programming.
i have found on the internet that it is possible to be implemented by using java.comm API and JTAPI. however, i don't know how...does anyone can tell me the details? also, as i know it will be a big project to send fax using such API. is that any other simple way to implement the fax function in java? thx a lot!To cse.mahbub:
Are you aware that you replied to a 5 1/2 year old question?
Please don't do that. Reply only to current questions.
Maybe you are looking for
-
How to open and XML file?
Does anyone have a way on Mac to open an XML file for viewing. This can be done with WIN Excel and XML toolkit but doesn't exist for Mac Excel in Office 2008. I can open with TextEdit but would like to see the info with headers and cells without all
-
How to apply a different "Go" button for search?
I am generating WebHelps in a lot of languages on RoboHelp 7.02.01. The English Search "Go" button does not really work for all languages but I have not yet figured out a neat way to replace it. The sample project uses (toolbar_searchbtn.gif), from t
-
Getting public ip address for a lan
hello is their a way to some how retrieve the public ip address of a lan? When i use the standard java get host method from a pc that's in a lan, all i get is the private lan ip address such has 192.x.x.x. this is useless to me if i want to make a co
-
Would the following two scenarios allow me to run BC with a Raid 0: 1. Put Vista and Mac OS on a single, largest possible Raptor 10k (or even 15k) boot drive, which would also run all apps. (Adobe CS3 programs, Final Cut Pro etc) Then have a few othe
-
SMARTFORM print in Vertical. Why????
Hi! I've created a smartform. When i print with local printer, local printer print in vertical an begin in right corner high. Smartform has much secondary windows in one page. In SPAD the format page ad others elements are correctly setted. If I prin