It's all about the answers!

Ask a question

How to get the repository URI in an Advisor?


Cliff Gardiner (921234) | asked Dec 03 '18, 7:24 a.m.

Hi all,


in an advisor that prevents delivery of change sets under certain circumstances, I've been asked to write links to the 'bad' change sets to the log.  To do this, it seems I need to use Location.itemLocation() to get the change set's URI, but the 2nd argument to Location.itemLocation is the repository URI and I can't work out how to get it.

Just make life interesting, I'm developing the code in an RTC 6.0.6 development env, then I'll be reworking it as necessary in a 4.0.7 development env for deployment to a 5.0.2 server. Sadly we're not live with the v6 yet, but I'm working on that....

So, for each of versions 6.0.6 and 5.0.2, can anyone advise how I can get the repository URI from within an Advisor?

Accepted answer


permanent link
Ralph Schoon (63.3k33646) | answered Dec 03 '18, 7:38 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 You call getPublicRepositoryURL() in your code.


Your advisor inherits that from com.ibm.team.repository.service.AbstractService.getPublicRepositoryURL()

Cliff Gardiner selected this answer as the correct answer

Comments
Ralph Schoon commented Dec 03 '18, 7:40 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

This should be the same since 4.x. You should just make sure to use and compile for a correct Java version to make the code deployable in earlier versions. 


Cliff Gardiner commented Dec 03 '18, 8:09 a.m.

Thanks Ralph,


I had a feeling it was going to be something simple!  Hours of searching came up with nothing, though.  And thanks for responding so quickly.

Regards,
Cliff 


Ralph Schoon commented Dec 03 '18, 8:13 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I needed it for the same purpose, you did. And I share the experience of having searched for API. 


Did you know you can search for pattern? E.g. you can search the SDK for methods that match ublicURI this has helped me to find some well hidden stuff 8) 

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.