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

Identify file paths of changes within IOperationParticipant

Hi,

I am writing an IOperationParticipant for the com.ibm.team.scm.service.changehistory.modification Operation (Deliver (phase 2)). As part of the functionality I need to be able to determine the affected resources path during the following changes:
  1. File modification
  2. File addition
  3. File deletion
  4. File reparenting
1. and 3 (file modifications and deletions), are working fine using IScmService#configurationLocateAncestors for the IVersionableHandle retrieved from IChange#afterState() for a given change.

I am having trouble identifying how I can get the following information however (running in the Server as an IOperationParticipant):

2. File addition - how to find out what the path will be
4. File reparenting - how to find out what the path was (both the afterState and beforeState seem to yield the new path)

Any help much appreciated,

Dan

0 votes


Accepted answer

Permanent link
Ensure you are looking up the path in the context that you care about.
- Try using the source (ie. repository workspace) to look up the path in the case of the file addition.
- Try using the target (ie. stream) to look up the path in the case of reparenting.

You'll want to check your service configuration provider that you give to the the #configurationLocateAncestors call. Ensure you're using the provider for the correct context (source or target).
Dan Pollitt selected this answer as the correct answer

0 votes

Comments
Thanks for that, so far I have just been using the target stream. How would I access the other contexts you mention?

You asked about getting the other contexts. I assume you're using the deliver operation data.

AdvisableOperation#getOperationData returns an object. For a deliver operation, it is DeliverOperationData that can give you the source and target. If you're not already using this, this is the way to get the source and target for the deliver operation as well as other data such as the change sets.

Hi Tim,

Many thanks for this, and the pointer on obtaining the contexts - I am now able to access the path infomation I was looking for.

I did however notice that the object returned from AdvisableOperation#getOperationData was not an instancof DeliverOperationData but SCMDeltaSource so I used the source and target from the IChangeHistoryAddOperandDelta objects returned from IScmDeltaSource#getDeltas(IChangeHistoryAddOperandDelta.class) instead (version 4.0.0).

1 vote

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,939

Question asked: Mar 11 '14, 8:52 a.m.

Question was seen: 4,561 times

Last updated: Mar 11 '14, 8:34 p.m.

Confirmation Cancel Confirm