Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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!


0 votes


Accepted answer

Permanent link
i found the problem
it was in the plugin.xml.
there was a space in the iitemTypeName="WorkItem " of the source endpoint.

thank you
Stefania
Ralph Schoon selected this answer as the correct answer

0 votes


2 other answers

Permanent link
you installed the plugin on the server and the client, right?
and restarted both, cold to force reload.

0 votes


Permanent link
dang computers.. so accurate!

0 votes

Comments

Not if you follow "Daily WTF" and see their Error'd posts :-)

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Apr 17 '13, 1:25 p.m.

Question was seen: 4,495 times

Last updated: Apr 18 '13, 1:55 p.m.

Confirmation Cancel Confirm