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

[URGENT] How to commit changes to a file existing in RTC repository programmatically?

Hello everyone,
Please I have a very urgent matter.
Using Java Plain Client API, I am able to create files and folders and commit them in the workspace and then deliver them into the stream.
Now, as the files exist in the repository, I have local copy of them that have changes and I want to commit these changes through Java Plain Client.
Thank you so much for your help.

0 votes



One answer

Permanent link
I think there are a couple of ways you can do this.

1. With your IWorkspaceConnection, use #getConfigurationFactory() to get a ISaveOp. When you create the ISaveOp, you specify the IVersionable that you want to save. Then you call IWorkspaceConnection#commit() to perform the check-in.

2. Use IOperationFactory.instance.getCheckinOperation() to create a check-in operation. You'll have to get the ISharingManager with FileSystemCore#getSharingManager() to create a shareable that represents the file you want to check-in. Then add a request to your check-in operation. Your check-in operation also needs a dilemma handler when you create it. This will allow you to tell what the operation should do when it encounters a decision point during execution.

0 votes

Comments

Thank you Tim.
However, I am not able to create the ISaveOp and don't how to use it to save the IVersionable. Can you give more details about it?
Thank you so much :)

Thank you Tim.
However, I am not able to create the ISaveOp and don't how to use it to save the IVersionable. Can you give more details about it?
Thank you so much :)

What happens when you try to create the ISaveOp?

Hi Tim,


I have a similar requirement as Karim, but am unable to find the getConfigurationFactory method you mention. I am also unable to call getItem() from ISaveOp (lack of knowledge/experience with RTC). Do you have a short example of how to implement your solution #1? Thanks!

Peter

I believe it was a typo on my part because it's #configurationOpFactory() where you can create the ops. It seems you already know this because you have a ISaveOp.

You'll have to post a code sample to explain what's wrong with your #getItem() call or at least post the error you get when trying to call it.

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

Question asked: Feb 15 '13, 2:43 p.m.

Question was seen: 5,311 times

Last updated: Sep 25 '13, 2:30 p.m.

Confirmation Cancel Confirm