How would I go about listing all the packages in the root folder of my cognos environment? I have code that lists all the packages in my cognos environement, but its listing all the packages within those packages as well. Any ideas? Or can someone point me to the documentation that explains doing this?
private static List<CognosPackage> GetPackageList(contentManagerService1 cognos, propEnum[] props, sort[] s, queryOptions qo, string searchPath)
{
string path = searchPath + "/package";
searchPathMultipleObject foldersSearchPath = new searchPathMultipleObject();
foldersSearchPath.Value = path;
baseClass[] bcFolders = cognos.query(foldersSearchPath, props, s, qo);
List<CognosPackage> packages = new List<CognosPackage>();
for (int i = 0; i < bcFolders.Length; i++)
{
if (bcFolders[i].permissions.value.Length > 0)
{
CognosPackage c = new CognosPackage();
c.searchPath = bcFolders[i].searchPath.value;
c.name = bcFolders[i].defaultName.value;
packages.Add(c);
}
}
return packages;
}
Nevermind figured it out. Just have to put "content" in front of "/package".
I'd be interested to hear how this works for you. I tried the same thing with reports (see SearchPathMultipleObject weirdness (http://www.cognoise.com/index.php/topic,26188.0.html)), but the results aren't always complete. It's like it doesn't always recurse into all sub-directories or something.