It's all about the answers!

Ask a question

Participant: commit a workingcopy into the stream


N. VD (842034) | asked Feb 06 '15, 10:45 a.m.
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



Comments
Evan Hughes commented Feb 09 '15, 10:43 a.m.
JAZZ DEVELOPER

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?


N. VD commented Feb 13 '15, 5:11 a.m.

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)


Evan Hughes commented Feb 13 '15, 9:41 a.m.
JAZZ DEVELOPER

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 to post your answer.