The Cognos Content Store contains the metadata representation of items such as reports, query items, report views, and security settings. The Cognos SDK code can call the Content Manager’s .query() method to search for and retrieve Content Store items. The getObjects() method is an example of searching the Content Store and finding either all Content Store package items or all report items for a specified package.
public baseClass[] getObjects(contentManagerService1 _cmService, string _path, string _package)
{
propEnum[] _props = new propEnum[]{propEnum.searchPath,propEnum.defaultName,propEnum.objectClass, propEnum.modificationTime, propEnum.connectionString, propEnum.creationTime, propEnum.link, propEnum.specification, propEnum.version, propEnum.defaultName, propEnum.portalPages, propEnum.ancestors, propEnum.owner};
if(_cmService != null)
{
sort[] _sort = {new sort()};
_sort[0].order=orderEnum.ascending;
_sort[0].propName=propEnum.defaultName;
_packagePath = "/content//package/*";
_reportPath = "/content/package[@name='" + _package + "']/report//*";
searchPathMultipleObject _spMulti = new searchPathMultipleObject();
if (_path == "packageConfiguration")
{
_path = _packagePath;
}
else if (_path == "report")
{
_path = _reportPath;
}
else
{
_path = null;
}
_spMulti.Value = _path;
try
{
//Query Cognos 8 and return the Base Class Array to the calling method
baseClass[] _bc = _cmService.query(_spMulti, _props, _sort, new queryOptions());
if(_bc != null)
{
//if the search request returned results
if(_bc.Length > 0)
{
return _bc;
}
else
{
return null;
}
}
}
catch(Exception ex)
{
_ErrMsg = ex.Message.ToString();
return null;
}
}
//no results found
return(null);
}
Cognos 8 SDK google search
New C8 SDK Utility --- Cognos 8 Modification Check
The BI Centre C8 Modification Check provides a Cognos SDK developer with a workable C# solution that will allow you to:
· Search the Content Store for items that have been modified after a selected date value
For example, if you were looking for all reports that were modified on June 3rd, 2008 then you would select the date June 2nd, 2008. The code will search for all items that have been modified after the selected date value from the date control.
The results of the search are then rendered to a text box control.
· Search the Content Store for items that have been modified after a selected date value
For example, if you were looking for all reports that were modified on June 3rd, 2008 then you would select the date June 2nd, 2008. The code will search for all items that have been modified after the selected date value from the date control.
The results of the search are then rendered to a text box control.