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

Participant: commit a workingcopy into the stream

I'm working on a server-side participant to change files after delivery.

How can i commit a workingcopy of an IFileItem into the stream?
I have read alot about scmService.batchCommit, but i cannot figure out what are the correct parameters to associate.

Is there some example available? - i have tried this:
https://jazz.net/forum/questions/163448/how-to-add-a-file-in-a-workspace-on-a-serverside-extension
https://www.ibm.com/developerworks/community/blogs/7685ca43-63d4-4946-89fd-58d379a896d1/entry/how_to_read_and_write_a_file_in_the_repository_directly_without_having_to_create_a_workspace?lang=ru


0 votes

Comments

The usual pattern in RTC is to prevent a delivery to a stream that doesn't have the changes you want - that way the stream is moved from one known valid state to the next known valid state. Can you update your question to describe the changes you want to make?

Evan,


My goal is to change  the files' content and user-properties.
e.g. automatically assign language definitions (enterprise extensions for system Z)
or changing content like inserting a header with copyright information if it's not already there.

So before the delivery takes place, the file and property changes should be made by a follow-up so other delivers accept changes with correct state into their sandbox. 

Don't know the impact for the developer who delivers: his resource will probably get out-of-sync?

is this a good practice or would you suggest doing it outerwise?
(i'd like to keep the plugin on servers, not in the eclipse IDE since not all customers are using eclipse)

The recommended approach is to have a delivery advisor that requires the change sets to have the content you want. 


As you say, that stops the user's sandbox from going out of sync, and it gives the user a chance to verify the content that is present in their workspace, rather than creating new content that wasn't present at the time of testing. 

I suggest that you create a server-side delivery (phase 2 - operation id com.ibm.team.scm.service.changehistory.modification ) advisor. Then add a client side quick fix (using extension point com.ibm.team.process.client.advisorProblemResolutions ) that makes the changes you want.


Be the first one to answer this question!

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

Question asked: Feb 06 '15, 10:45 a.m.

Question was seen: 2,821 times

Last updated: Feb 13 '15, 9:41 a.m.

Confirmation Cancel Confirm