COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: dipstm on 28 Mar 2008 09:26:06 AM

Title: Regarding modifying FM Model using SDK
Post by: dipstm on 28 Mar 2008 09:26:06 AM
Hi,
I need to modify my FM Model quite frequently bcoz we need to implement the data level security for the users
created in the group.Whenever a new user is added or deleted the FM Model shld be modified accordingly.
How can I achieve this using SDK? If anybody has done somthing of this sort then plz provide me with the steps to
implement.

Thanx,
Dipstm
Title: Re: Regarding modifying FM Model using SDK
Post by: tmacfarlane on 28 Mar 2008 12:33:19 PM
Wouldn't a more scalable solution involve only have the FM model changed for a change at the group level?  You could manage the users from within Cognos Connection by granting/denying permissions related to the groups of which they belong.

In order to access the FM model via the SDK you would have to :

private void getModel(string packageSearchPath)
        {

            propEnum[] props = new propEnum[] { propEnum.searchPath, propEnum.model };
            searchPathMultipleObject spMulti = new searchPathMultipleObject();
            spMulti.Value = packageSearchPath + "/model";
            string strXMLHeader = "<?xml version=" + "\"" + "1.0" + "\"" + " encoding=" + "\"" + "UTF-8" + "\"" + " ?>";
            string strXMLModel = null;

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

            for (int i = 0; i < model.Length; i++)
            {

                strXMLModel = strXMLHeader + ((model)model).model1.value;
                ...etc...
             }

            // your return value here
}
Title: Re: Regarding modifying FM Model using SDK
Post by: dipstm on 31 Mar 2008 04:05:38 AM
Hi,
Thanx  a lot for ur rply....

Can u plz let me knw where can I have the sample codes related to modifying FM Models using SDK. Actually I want to do a lot of things using SDK in FM like ... creating Groups,providing data level security for tht group , re-publishing packages,etc....

Plz let me knw....

Thanx,
Dipstm
Title: Re: Regarding modifying FM Model using SDK
Post by: tmacfarlane on 31 Mar 2008 01:48:05 PM
All of the code that I have is from code that I developed myself and reviewing the SDK Developer Guide from Cognos.