RTC how to register my custom link type
RTC 4.0.2
I have a custom link type.
I want to retrieve it via code the work item that has that specific custom link type.
I have some code that was suppose to do the retrieve of the link of my link type....that but it does not work. Not sure if it is stopped to work with RTC 4.0.2 or 4.0.1...
Anyway I debug the code and it seems that the links are there but then another method that call all the link will remove the link type that are not registered.
How do i register a custom link type?
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
ILinkQueryPage linkQueryPage = linkServiceLibrary.findLinksBySource(
new String[] { linkTypeId },
new IReference[] { workItemReference } );
ILinkCollection linkCollection = linkQueryPage.getAllLinksFromHereOn();
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
linkQueryPage contains my new type linked work items but linkQueryPage.getAllLinksFromHereOn();
wipes them out because .getAllLinksFromHereOn(); remove the unregistered link type.
thanks
Stefania
here is the RTC API called from getAllLinksFromHereOn()
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
com.ibm.team.links.common.internal.LinkQueryPage.getAllLinksFromHereOn()
public ILinkCollection getAllLinksFromHereOn() {
return new LinkCollection(contents);
}
com.ibm.team.links.common.internal.LinkCollection.LinkCollection(Collection<ILink>)
public LinkCollection(Collection<ILink> c) {
super();
list = removeUnknownLinks(c == null ? new ArrayList<ILink>() : c);
}
com.ibm.team.links.common.internal.LinkCollection.removeUnknownLinks(Collection<ILink>)
private Collection<ILink> removeUnknownLinks(Collection<ILink> allLinks) {
// TODO: While iterating, the hashmap by name can also be created
List<ILink> knownLinks = new ArrayList<ILink>();
if (allLinks == null)
return knownLinks;
for (ILink link : allLinks) {
if (ILinkTypeRegistry.INSTANCE.isRegistered(link.getLinkTypeId()))
knownLinks.add(link);
}
return knownLinks;
}
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
my links are removed because they are not registered!
I have a custom link type.
I want to retrieve it via code the work item that has that specific custom link type.
I have some code that was suppose to do the retrieve of the link of my link type....that but it does not work. Not sure if it is stopped to work with RTC 4.0.2 or 4.0.1...
Anyway I debug the code and it seems that the links are there but then another method that call all the link will remove the link type that are not registered.
How do i register a custom link type?
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
ILinkQueryPage linkQueryPage = linkServiceLibrary.findLinksBySource(
new String[] { linkTypeId },
new IReference[] { workItemReference } );
ILinkCollection linkCollection = linkQueryPage.getAllLinksFromHereOn();
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
linkQueryPage contains my new type linked work items but linkQueryPage.getAllLinksFromHereOn();
wipes them out because .getAllLinksFromHereOn(); remove the unregistered link type.
thanks
Stefania
here is the RTC API called from getAllLinksFromHereOn()
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
com.ibm.team.links.common.internal.LinkQueryPage.getAllLinksFromHereOn()
public ILinkCollection getAllLinksFromHereOn() {
return new LinkCollection(contents);
}
com.ibm.team.links.common.internal.LinkCollection.LinkCollection(Collection<ILink>)
public LinkCollection(Collection<ILink> c) {
super();
list = removeUnknownLinks(c == null ? new ArrayList<ILink>() : c);
}
com.ibm.team.links.common.internal.LinkCollection.removeUnknownLinks(Collection<ILink>)
private Collection<ILink> removeUnknownLinks(Collection<ILink> allLinks) {
// TODO: While iterating, the hashmap by name can also be created
List<ILink> knownLinks = new ArrayList<ILink>();
if (allLinks == null)
return knownLinks;
for (ILink link : allLinks) {
if (ILinkTypeRegistry.INSTANCE.isRegistered(link.getLinkTypeId()))
knownLinks.add(link);
}
return knownLinks;
}
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
my links are removed because they are not registered!