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

How to get ProviderFactory on client ?

Team,

<self-answered question>

Suppose you want to get ChangeSetLinks programmatically on a client.
You found ChangeSetLinks.findLinks(providerFactory, changeSetHandle, linkTypeIds, monitor)

You have a changeSetHandle, get the linkTypeIds by:
new String[] { ILinkConstants.CHANGESET_WORKITEM_LINKTYPE_ID }
(as seen in Ralph Schoons Blog)

But how to obtain a providerFactory on the client?

0 votes



One answer

Permanent link
The providerFactory can be obtained by:
(ProviderFactory) teamRepository.getClientLibrary(ProviderFactory.class)

Thus,

List<ILink> links ChangeSetLinks
   .findLinks(
   (ProviderFactory) teamRepository.getClientLibrary(ProviderFactory.class),
    changeSetHandle,
    new String[] { ILinkConstants.CHANGESET_WORKITEM_LINKTYPE_ID },
    monitor);

will get you all work item links from a change set handle.

1 vote

Comments

very cool. thanks Arne!

mow, in my copy stream utility, I really need to fixup all the links, because all the workitem numbers have changed,.   I know what the new workitem number is for all the old info.

I haven't looked.. is there an easy way to create the links too?

I'm assuming like all other cases,  the link itself is immuatable, so has to be deleted and recreated to have the right ends.

Sam, I have not dabbled with link creation too much yet, but once I do and I find an easy way, I will share.
- Arne

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
× 10,941

Question asked: Mar 22 '14, 3:53 a.m.

Question was seen: 4,950 times

Last updated: Mar 24 '14, 6:25 a.m.

Confirmation Cancel Confirm