[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.
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.
One answer
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.
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.
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.