2

Currently I'm working in Cognos v10.1.2 . Is there any SDK to extract the contents of the Cognos Web Page?

We are developing a monitoring window for the end users where they can view the status of their report instead of mails and calls.

The access of MDC table which stores are reports names and its details is restricted. So, We need to create an SDK for it. Thanks in advance for your valuable help.

arunpandiyarajhen
  • 643
  • 12
  • 20
  • 51
  • What exactly are you trying to pull out using the SDK? – Andrew Nov 26 '13 at 16:34
  • @Andrew, I hope you are aware of the Administration Window in Cognos. I need extract the contents of the Current Activities and Past Activities tab. – arunpandiyarajhen Nov 26 '13 at 16:44
  • sure I know what you're talking about. I'm sure you can get at it through the SDK, yes, but I'm not sure why. An individual user can see the status of their own reports. – Andrew Nov 26 '13 at 17:20
  • @Andrew, In Cognos Admin tab, the Administrator can view the list of all the reports. There are many report consumers without cognos access. They should get to know the status of the reports which they use. – arunpandiyarajhen Nov 26 '13 at 18:04
  • Your consumers have no Cognos access, or they don't have administrator access? – Andrew Nov 26 '13 at 18:12
  • @Andrew, They don't have Cognos access. They are Bussiness Users. – arunpandiyarajhen Nov 26 '13 at 19:17
  • How do they submit reports? In any case, yes, anything you can do in Cognos Connection can be done in the SDK. I've never tried to do anything like that, but I imagine it would be pretty complex. – Andrew Nov 27 '13 at 03:36
  • You should probably consider licencing. If they are not licenced to see the status of your report, you're breaking licencing if you build something to get around it. For example you could probably write a content store query that gets this info but it would be breaking licencing as strictly speaking you need admin access to know this info. If you built something in the Cognos SDK you still have to authenticate and all security and licencing is preserved. i.e. if you query report execution status as a non user you won't get access. – Nick.Mc Dec 02 '13 at 04:04

1 Answers1

1

You need to review the available methods in the SDK and put together your own calls to pull the jobs and associated status information and wrap it in a web/desktop UI. This would include the login/SSO methods since you want to be able to securely filter to those jobs matching an authenticated user.

Lucky for us IBM provides sample code! Below is an example of pulling the owner of a schedule, the full code example is at http://www-01.ibm.com/support/docview.wss?uid=swg21645622.

Here's another good one showing how to pull all scheduled jobs from the content store: http://www-01.ibm.com/support/docview.wss?uid=swg21346334

Helpful hint: This requires that you login first, but you can avoid the byzantine IBM support site and search for "SDK samples" at this URL for more code examples: https://www-947.ibm.com/support/entry/myportal/product/cognos/cognos_support_(general)?productContext=117510243

public void getOwner(String sPath) 
{
    try 
    {           
        PropEnum props[] = new PropEnum[]{ PropEnum.searchPath, PropEnum.owner};

        //Query content store to get the schedule of the report
        BaseClass[] bc_sch = cmService.query(new SearchPathMultipleObject(sPath),props,new Sort[]{},new QueryOptions());
        if (bc_sch != null && bc_sch.length >0)
        {   
            //Get searchpath of schedule owner
            for (int i=0; i<bc_sch.length;i++)
            {
                Schedule schedule = (Schedule)bc_sch[i];                        
                BaseClass[] bc = schedule.getOwner().getValue();                    
                Account acct  = (Account) bc[0];
                String searchPath = acct.getSearchPath().getValue();

                PropEnum[] props_acct = new PropEnum[]{PropEnum.defaultName, PropEnum.userName, PropEnum.givenName, PropEnum.surname};

                // query Account to get account name info
                BaseClass[] bc_acct = cmService.query(new SearchPathMultipleObject(searchPath),props_acct,new Sort[]{},new QueryOptions());
                Account owner = (Account) bc_acct[0];

                String name = owner.getDefaultName().getValue();
                String user = owner.getUserName().getValue();
                String firstname = owner.getGivenName().getValue();
                String lastname = owner.getSurname().getValue();

                System.out.println("Owner is");
                System.out.println("userName: " + user);
                System.out.println("defaultName: " + name);
                System.out.println("firstname lastname: " + firstname + " " + lastname);                    
            }
        }
        else
            System.out.println("No schedule is found");

    }
Gene
  • 131
  • 6