How to retrieve the publication webi document prompts using Enterprise SDK
This code gets the prompt values used by publication’s source webi documents using Enterprise Java SDK.
enterpriseSession = CrystalEnterprise.getSessionMgr().logon(username, password, cmsname, authType);
IInfoStore infoStore = (IInfoStore)enterpriseSession.getService(“”, “InfoStore”);
IInfoObjects oInfoObjects = (IInfoObjects)infoStore.query(“select * from ci_infoobjects where si_kind=’publication’ and si_name='<publication name>'”);
for(int i=0;i<oInfoObjects.size();i++)
{
IInfoObject oInfoObject = (IInfoObject) oInfoObjects.get(i);
IPublication publicationObject = (IPublication) oInfoObject;
Object[] idArray = publicationObject.getDocuments().toArray();
String clause = “(“;
for ( int j=0;j<idArray.length;j++)
{
clause += ((Integer)idArray[j]).intValue() + “,”;
}
clause = clause.substring(0,clause.length()-1) + “)”;
IInfoObjects webiObjects = infoStore.query(“select * from ci_infoobjects where si_id in ” + clause);
for (int j=0;j<webiObjects.size();j++)
{
IInfoObject webiObject = (IInfoObject) webiObjects.get(j);
IProperties promptsPropBag = (IProperties) publicationObject.getDocumentProcessingInfo(webiObject.getID()).getProperty(“SI_WEBI_PROMPTS”).getValue();
int numOfPrompt = ((Integer)promptsPropBag.getProperty(“SI_TOTAL”).getValue()).intValue();
for (int k=1; k <= numOfPrompt; k++)
{
out.println(“Prompt Name = ” + ((IProperties)promptsPropBag.getProperty(“” + k).getValue()).getProperty(“SI_NAME”).getValue().toString());
IProperties promptValuesBag = (IProperties) ((IProperties)promptsPropBag.getProperty(“” + k).getValue()).getProperty(“SI_VALUES”).getValue();
int numOfValues = ((Integer)promptValuesBag.getProperty(“SI_TOTAL”).getValue()).intValue();
for(int l=1; l <= numOfValues; l++)
{
out.println(“Prompt Value = ” + promptValuesBag.getProperty(“” + l).getValue().toString() );
}
}
}
}
enterpriseSession.logoff();
%>
Are there any resources for a beginner to understand BusinessObjects SDK from the ground level.
I know of http://www.sdn.sap.com/irj/boc/sdklibrary
however I'm not able to understand where to begin from. I have a good working knowledge of BusinessObjects Enterprise but don't seem to understand how and from where the SDK is altered. Looking forward to some guidance.
Thanks!
Rahul
Visit below URL to understand the basics of SDK.
http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/1010673f-6d64-2b10-5e99-b3775b254d5c
Regards,
Vanathi
HTH.