Purchase your Section 508 Compliance Support guide now!

Purchase your Section 508 Compliance Support guide now!

Cognos 8 SDK -- count of objects in content store

If your Cognos 8 SDK application requires that you determine the number of objects that are contained within the content store then you need to use the query method for the Content Manager Service.

private int CSObjectCount = 0;

public void countContentStoreObjects(String objectSearchPath)
{
PropEnum props [] = new PropEnum[]{PropEnum.searchPath,PropEnum.defaultName};

try
{
SearchPathMultipleObject srchPath = new SearchPathMultipleObject(objectSearchPath);
BaseClass bc [] = new BaseClass[]{};
bc = cmService.query(srchPath,props, new Sort[]{},new QueryOptions());

if (bc != null)
CSObjectCount = bc.length;
}
catch(java.rmi.RemoteException remoteEx)
{
System.out.println("ERROR Exception - querying:\n" + remoteEx);
return;
}
}