Access Custom LinkTypes via Java API?
![]()
I have created some new custom linktypes by following instructions on the forum and extending the com.ibm.team.repository.common.linkTypes extension point. I have the linkTypes deployed to my server and my Eclipse client. Now I need to find a way to access these links programatically. I found references that say I should use ILinkTypeRegistry.INSTANCE.getLinkType(<custom linktype>). I tried this using the ID of the linktype I created in my extension. The call above returns null. I seem to remember seeing some mention of another step that needs to be taken if you want to access your linktypes from the API, but I can't find that now.
Does anyone know what needs to be done in order to make custom linktypes available through the Java API? Thanks, Jamie. |
3 answers
![]()
I was unable to find a way to get my custom linktype usable from PlainJava client code.
I added the plugin jar to classpath, but because it has no code there is no way to force load it. Sam Comments Thank you for your reply. Have you investigated using the REST interface? I am starting down that path as a co-worker believes the Visual Studio client relies on the REST interface and it has access to the linktypes (maybe it is just using web parts via REST that know how to work with them...) Not being able to access the linktypes via external programs makes the linktypes less beneficial than we originally hoped.
An update... I tried formulating a REST URL to get the data for a work item with the custom links, and it comes back with the links (in the form of <rtc_cm:{linktype endpoint id} oslc_cm:collref="{url to linked workitem}"/>). So it looks like I will be able to access the custom links via REST. Now I just need to learn how to work with the REST API via Java or Perl...
|
![]()
Update yet again. My co-worker helped me look at the Java API project and suggested that I add the .jar file for my extension to the directory with the Plain Java Client JAR files and then add the .jar file to my Java project build path. Once I did that, I now have access to my custom linktypes from my Java code. I get some warnings regarding Invalid icon URLs when it tries loading the linktype in com.ibm.team.links.common.internal.registry.LinkTypeRegistry$Impl createIconURL . Other than the warning, things seem to be working just fine. When I have some time, I will try cleaning up this warning...
|
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.