COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => COGNOS Connection => Topic started by: blom0344 on 14 Apr 2010 01:47:57 AM

Title: Adding 'Owner' to the connection GUI replacing 'Modified'
Post by: blom0344 on 14 Apr 2010 01:47:57 AM
There is some documentation on adding and hiding UI Elements in Cognos connection, but I was wondering if anyone has a notion to add 'Owner' to the GUI instead of the fickle 'Modified' element.
Simply opening the properties of a report changes this modified date, making it pretty useless. Having the owner in the GUI would be a lot more usefull.
I fear though that this is hardcoded in the page definition and not configurable..
Title: Re: Adding 'Owner' to the connection GUI replacing 'Modified'
Post by: CognosPaul on 14 Apr 2010 06:29:55 AM
Wow, this sounds like a really fun challenge. In this case the GUI is definitely hardcodes into the template files. But that's never stopped anyone from trying to break it, has it?

The file that controls the list is ..\c8\templates\ps\logicsheets\presentation\main\presentation.xsl. In one of my previous posts I've shown how to hide some of the buttons. The modified date is in exactly the same area. The trick would just be finding how Cognos pulls the data for the owner, probably by looking for the logicsheet that controls the properties page, and replacing the modified with it.

I'll see what I can do once I have access to my test installation again.
Title: Re: Adding 'Owner' to the connection GUI replacing 'Modified'
Post by: blom0344 on 14 Apr 2010 01:26:46 PM
Good to read that you consider this a challenge   :D

I'd consider it a challenge too, but the trick is indeed where to look. I have found the existing documentation delivered by Cognos rather, well, 'lacking'.
Title: Re: Adding 'Owner' to the connection GUI replacing 'Modified'
Post by: CognosPaul on 04 May 2010 10:02:02 AM
Well, I've poked around a bit.

The file that needs to be modified is indeed ..\c8\templates\ps\logicsheets\presentation\main\presentation.xsl

The section that controls it starts at row 3156 (it may be different in yours, search for the phrase "this will give us the time formatted with the java").

You can find the details for generating the owner name in ..\c8\templates\ps\portal\properties_general.xts

The section for the owner starts at row 1421.

I haven't had the chance to modify the files, only to dig through them, but it shouldn't be too difficult to make the changes.
Title: Re: Adding 'Owner' to the connection GUI replacing 'Modified'
Post by: CognosPaul on 22 Jun 2010 09:41:16 AM
I was wrong! Apparently ..\c8\templates\ps\logicsheets\presentation\main\presentation.xsl goes somewhere else. I can't even figure out where that goes now.

My next bet is ..\c8\templates\ps\portal\cc\gen_page.xslt Lines 366 onwards seem to match the list in the portal. That looks like a good bet on controlling the generation of each row.

Hopefully tomorrow I'll have time to try some more.
Title: Re: Adding 'Owner' to the connection GUI replacing 'Modified'
Post by: CognosPaul on 23 Jun 2010 09:28:25 AM
I've decided to post my findings here as a reference. I can't even remember what happened last time I tried to rely on my memory.

Well, gen_page.xslt is definitely the place that controls it.

Changing <xsl:value-of select="xtsext:formatDateFromUTC( string( cm:modificationTime ), number( '2' ), number( '3' ),  string( $timeZone ),  string( $contentLocale ) )"/>
to <xsl:value-of select="'test'"/> will put test in each row.

Unfortunately the really obvious <xsl:value-of select="string(cm:owner)"/> doesn't work. I need to figure out which attributes I can use, and how I can link to related fields if I need.

I have no experience with XSL, so this is fun.
Title: Re: Adding 'Owner' to the connection GUI replacing 'Modified'
Post by: blom0344 on 02 Jul 2010 02:47:22 AM
Hi Paul,

I realized that I never made any reference to why I would want have the owner in the GUI.

We experience xml corruption when we try to locally open RS reports that are checked out of our source control system. (non-ASCII characters disappear from the XML) Because Cognos does not allow native locks on reports from within connection we are trying to avoid overwriting each others work by using VSS as a source control system.

Adding the owner to the GUI at least allows each developer to change the owner , making sure other developers spot it directly from connection.