COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => SDK => Topic started by: dipstm on 15 Feb 2008 06:54:53 AM

Title: Regarding retrieving SearchPath of the users
Post by: dipstm on 15 Feb 2008 06:54:53 AM
Hi All,
         I want to display the names of user alongwith the searchpath of users created in the namespaces using Cognos 8 SDK. If anybody has already implemented similar functionality please let me know the solution for the same.

Many Thanx in advance

Regards,
Dipstm
Title: Re: Regarding retrieving SearchPath of the users
Post by: tmacfarlane on 25 Mar 2008 09:20:22 PM
hello, here's a snippet to get you started.


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;

        }