Purchase your Section 508 Compliance Support guide now!

Purchase your Section 508 Compliance Support guide now!

Cognos 8 SDK -- Groups

You may be tasked with finding all groups that a particular Congos user belongs to for another piece of your Cognos SDK functionality.  If so, then you should note the difference in values between the default namespace entry of “:” and specifying a specific namespace id value.  I was only able to expose the Everyone group after setting the defaut namespace id value to “:”

 

 

 

public baseClass[] getGroups(string strNamespaceId)

        {

            string groups = "CAMID(\"" + strNamespaceId + "\")//group";

            propEnum[] props = new propEnum[] { propEnum.searchPath, propEnum.defaultName };

            baseClass[] groupObjects = new baseClass[]{};

            searchPathMultipleObject spMulti = new searchPathMultipleObject();

            spMulti.Value = groups;

 

            try{

                groupObjects = cmService.query(spMulti,props, new sort[]{}, new queryOptions());

            }

 

            catch (SoapException exSoap)

            {

                SoapExceptionHandler objEx = new SoapExceptionHandler(exSoap);

                MessageBox.Show(objEx.Details + objEx.Message + objEx.ErrorCode + objEx.Severity);

            }

 

            string[] groupSeachPaths = new string[groupObjects.Length];

 

            if (groupObjects.Length == 0)

            {

                MessageBox.Show("there were no Groups found");

            }

 

            return groupObjects;

        }