InfoView logo update script

I would like to update the CMS database with a new value for the InfoView logo file. The select statement is:

SELECT SI_LOGO_URL FROM CI_APPOBJECTS WHERE SI_KIND=‘InfoView’

How do I then script an update of SI_LOGO_URL to a different logo file?

I need to have automated processes run a script to change the InfoView logo file name.

Looking for syntax here.

Thanks


john.paulson (BOB member since 2012-11-19)

This is the .jsp script I am using to retieve the property bag, but I cannot retieve the property I need to update SI_LOGO_URL

Any suggestions on how to get the property SI_LOGO_URL and update it?

<%@ page language=“java” contentType=“text/html;charset=UTF-8”%>
<%@ page import=“com.crystaldecisions.sdk.framework.CrystalEnterprise”%>
<%@ page import=“com.crystaldecisions.sdk.framework.IEnterpriseSession”%>
<%@ page import=“com.crystaldecisions.sdk.occa.infostore.IInfoObject”%>
<%@ page import=“com.crystaldecisions.sdk.occa.infostore.IInfoObjects”%>
<%@ page import=“com.crystaldecisions.sdk.occa.infostore.IInfoStore”%>
<%@ page import=“com.crystaldecisions.enterprise.ocaframework."%>
<%@ page import="java.util.
”%>
<%@ page import=“java.io.*”%>

<%

String userName = “administrator”;
String password = “password”;
String CMSName = “xxxxxxxx:6400”;
String iQuery = “SELECT * FROM CI_APPOBJECTS WHERE SI_KIND=‘InfoView’”;

IEnterpriseSession ceSession = null;

try{

ceSession = CrystalEnterprise.getSessionMgr().logon(userName, password, CMSName, "secEnterprise");
IInfoStore iStore = (IInfoStore)(ceSession.getService("InfoStore"));
IInfoObjects iObjects = iStore.query(iQuery);
IInfoObject iObject = (IInfoObject) iObjects.get(0);

/* IProperties iObjectProperties = iObject.properties();
IProperty iObjectProperty = iObjectProperties.getProperty(CePropertyID.SI_LOGO_URL);
String iObjectValue = (String) iObjectProperty.getValue();*/
iStore.commit(iObjects);
out.println(iObject);

}catch(Exception ex) {
out.println(ex.getMessage());
}finally{
if(ceSession != null) ceSession.logoff();
}

%>


john.paulson (BOB member since 2012-11-19)

This .jsp script will reurn the requested value. Uncomment the two lines near the end to set the value as desired.

<%@ page language=“java” contentType=“text/html;charset=UTF-8”%>
<%@ page import=“com.crystaldecisions.sdk.framework.CrystalEnterprise”%>
<%@ page import=“com.crystaldecisions.sdk.framework.IEnterpriseSession”%>
<%@ page import=“com.crystaldecisions.sdk.occa.infostore.IInfoObject”%>
<%@ page import=“com.crystaldecisions.sdk.occa.infostore.IInfoObjects”%>
<%@ page import=“com.crystaldecisions.sdk.occa.infostore.IInfoStore”%>
<%@ page import=“com.crystaldecisions.enterprise.ocaframework."%>
<%@ page import="com.crystaldecisions.sdk.properties.
”%>
<%@ page import=“java.util."%>
<%@ page import="java.io.
”%>

<%

String userName = “Administrator”;
String password = “password”;
String CMSName = “xxxxxxxx:6400”;
String iQuery = “SELECT * FROM CI_APPOBJECTS WHERE SI_KIND=‘InfoView’”;

IEnterpriseSession ceSession = null;

try{

ceSession = CrystalEnterprise.getSessionMgr().logon(userName, password, CMSName, "secEnterprise");
IInfoStore iStore = (IInfoStore)(ceSession.getService("InfoStore"));
IInfoObjects iObjects = iStore.query(iQuery);
IInfoObject iObject = (IInfoObject) iObjects.get(0);
IProperties iObjectProperties = iObject.properties();
String iObjectValue = (String) iObjectProperties.getProperty("SI_LOGO_URL").getValue();

/* iObjectProperties.getProperty(“SI_LOGO_URL”).setValue(“yourfile.ext”);/
/
iStore.commit(iObjects);*/
out.println(iObjectValue);

}catch(Exception ex) {
out.println(ex.getMessage());
}finally{
if(ceSession != null) ceSession.logoff();
}

%>


john.paulson (BOB member since 2012-11-19)