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

How to check in multiple files in workspace using IScmService or using plain java api?

 Currently I am succeeded to check in single file in workspace , but I want to check in multiple files using batchCommit() or commit() method. Does anyone have idea of how to commit/check in multiple files using client side api/plain java api?

0 votes


Accepted answer

Permanent link

 I have published what I know about this API and here this is done: https://rsjazz.wordpress.com/2013/10/15/extracting-an-archive-into-jazz-scm-using-the-plain-java-client-libraries/


The files are in a zip file, but that should be irrelevant.

Ralph Schoon selected this answer as the correct answer

0 votes

Comments

 Hi @Ralph Schoon thanks for your valuable answer...I already tried this but it has multiple calls of commit() for each file, but while I am checking "Metronome" to check API call by eclipse client, eclipse call method batchCommit(), it commit and save no.of files in single shot. Do you have any idea about how to use this batchCommit() or how to check in multiple files in single shot?

If I would want to know how  batchCommit() works, I would use a development environment set up according to the RTC Extensions Workspace and then use the Eclipse Java Search to search for the usage of the method batchCommit(). 


One other answer

Permanent link
If you are writing a client-side plugin, here's the corresponding API:

ITeamRepository repo = getRepo();
IWorkspaceHandle workspaceHandle = getWorkspace();
IWorkspaceManager wm = ScmPlatform.getWorkspaceManager(repo);
IWorkspaceConnection wc = wm.getWorkspaceConnection(workspaceHandle, monitor);

From here you can use the wc#commit(...) method. Note: this method has an argument called 'configOp' that is a Collection of IConfigurationOps. So you first create a new List<IConfigurationOps>, then iterate across the files (IVersionable) you want to check-in, call this: wc.configurationOpFactory().save(versionable);  and then add that return result to your 'configOp' collection, then make the wc#commit(...) API call.

0 votes

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

Question asked: Jan 23 '19, 5:59 a.m.

Question was seen: 1,723 times

Last updated: Jan 23 '19, 3:49 p.m.

Confirmation Cancel Confirm