on 06-13-2013 7:59 AM
Hi All,
I am I am trying to undersnad attributes of Publication, I have some automated Publications which runs from JAVA/.NET code. I pass the ID to the prompt and then the publication runs and dynamic participants recieve the PDF/Excel on FTP and Sharepoint.
I need to make the destination dynamic, like on onlyy some conditions the output to go to FTP, or Sharepoint , or both, the logic can be written in the code easily.
I want to know the class, atribut eof Ipub or GetDestination or what whill be used to even set the destination using the code,.
Thanks,
Avinash
HI Avinash,
Below is the code snippet to update/change destination email address in a publication recurring schedule:
<%@ 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.exception.SDKException" %>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.IInfoStore" %>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.IInfoObjects" %>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.IInfoObject" %>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.* "%>
<%@ page import="com.crystaldecisions.sdk.plugin.desktop.user.*" %>
<%@ page import="com.crystaldecisions.sdk.plugin.CeProgID.*" %>
<%@ page import="com.crystaldecisions.sdk.properties.*" %>
<%@ page import="com.businessobjects.sdk.plugin.desktop.publication.*" %>
<html>
<body><%
String status=null;
String systemName = "localhost:6400";
String userName = "Administrator";
String password = "";
String authType = "secEnterprise";
IEnterpriseSession enterpriseSession=null;
IInfoObjects results=null;
IInfoStore iStore=null;
try
{
ISessionMgr enterpriseSessionMgr = CrystalEnterprise.getSessionMgr();
enterpriseSession = enterpriseSessionMgr.logon(userName, password, systemName, authType);
iStore = (IInfoStore)enterpriseSession.getService("InfoStore");
IInfoObjects oIInfoObjects = iStore.query("Select * from ci_infoobjects where si_kind='Publication' and si_recurring=1");
for(int i=0; i<oIInfoObjects.getResultSize();i++)
{
IPublication publication =(IPublication)oIInfoObjects.get(i);
IDestinations destinations = publication.getSchedulingInfo().getDestinations();
for (Object o:destinations)
{
IDestination destination = (IDestination)o;
IProperties properties = destination.properties();
IProperties ppt = properties.getProperties("SI_DEST_SCHEDULEOPTIONS");
IProperties mailAddress = ppt.getProperties("SI_MAIL_ADDRESSES");
IProperty address = (IProperty) mailAddress.getProperty("1");
String email = (String) address.getValue();
out.println(email);
address.setValue("abc@xyz.com, abc@sap.com");
}
out.println("Successfully changed email address for publication");
}
iStore.commit(oIInfoObjects);
}
catch(Exception e)
{
out.println(e);
}
%>
</body>
</html>
Hope it helps.
Regards,
Anchal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
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.