on 05-30-2016 5:34 PM
Hi,
I'm in 4.1 SP2 cluster mode. My audit level configuration change when my server restart every day !!! So I want to write a java pg with SDK like in tuto.
try
{
// Initialize the Session Manager
boSessionMgr = CrystalEnterprise.getSessionMgr();
// Logon to the Session Manager to create a new BOE session.
boEnterpriseSession = boSessionMgr.logon(userName, password, cmsName, authType);
//Retrieve the InfoStore object
boInfoStore = (IInfoStore) boEnterpriseSession.getService("", "InfoStore");
String auditQuery = "SELECT SI_AUDIT_EVENTS, SI_AUDIT_LEVELS FROM CI_SYSTEMOBJECTS WHERE SI_KIND='" + IAuditEventInfo.KIND + "'";
IInfoObjects infoObjects = boInfoStore.query(auditQuery);
IAuditEventInfo auditEventInfo = (IAuditEventInfo) infoObjects.get(0);
auditEventInfo.setCurrentAuditLevel(AuditEventLevel.COMPLETE);
boInfoStore.commit(infoObjects);
}
it doesn't work !
If I print the level just after commit it's OK, but If I check by CMC or rerun the prog , yhe level stay OFF.
thanks for your return
Hi Sophie,
I gave a quick try on the below code snippet & it is working as expected. I have tried this on BI 4.1 SP3.
I am posting my code snippet below for your reference:
-----------------------------------------------------------------------------
import com.businessobjects.sdk.plugin.desktop.auditeventinfo2.IAuditEventInfo;
import com.businessobjects.sdk.plugin.desktop.auditeventinfo2.IAuditEventInfo.AuditEventLevel;
import com.crystaldecisions.sdk.exception.SDKException;
import com.crystaldecisions.sdk.framework.CrystalEnterprise;
import com.crystaldecisions.sdk.framework.IEnterpriseSession;
import com.crystaldecisions.sdk.occa.infostore.IInfoObjects;
import com.crystaldecisions.sdk.occa.infostore.IInfoStore;
public class ConfigureAuditLevel {
public static void main(String[] args) throws SDKException {
IEnterpriseSession enterpriseSession=CrystalEnterprise.getSessionMgr().logon("Administrator", "<Password>", "<Your BO-Server Name>", "secEnterprise");
IInfoStore infoStore=(IInfoStore) enterpriseSession.getService("", "InfoStore");
IInfoObjects objs= infoStore.query("SELECT * FROM CI_SYSTEMOBJECTS WHERE SI_KIND='" + IAuditEventInfo.KIND + "'");
IAuditEventInfo auditEventInfo = (IAuditEventInfo) objs.get(0);
auditEventInfo.setCurrentAuditLevel(AuditEventLevel.COMPLETE);
infoStore.commit(objs);
System.out.println("Audit Level Changes Done!!!");
enterpriseSession.logoff();
System.out.println("Log off Success!!!");
}
}
-----------------------------------------------------------------------------
The changes are reflected back once we logoff from CMC & relogin again.
Can you please confirm that Auditing level changes are not reflected after relogging to CMC, after running the code?
Thanks,
Shailendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.