How to get the repository URI in an Advisor?
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
You call getPublicRepositoryURL() in your code.
Your advisor inherits that from com.ibm.team.repository.service.AbstractService.getPublicRepositoryURL()
Comments
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.
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
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)