cancel
Showing results for 
Search instead for 
Did you mean: 

update file content without new version

leftright
Champ on-the-rise
Champ on-the-rise
I am using  ContentWriter   in my webscripts/workflow actions   to update the contents of certain files in workflow in the following way:


     ContentWriter writer = this.registry.getContentService().getWriter(nodeRef,
                                  ContentModel.PROP_CONTENT, true);
               
     writer.setEncoding(encoding);
     writer.setMimetype(Mime);
     writer.putContent(file);



The problem is that each time I update file contents, I get a new version of file and since this updates occur multiple times in workflow,
I get many versions for a file. How can I update in java webscripts/actions contents of an existing file without new version each time I perform update.
Thank you for your answers.
1 REPLY 1

kavilash23
Champ on-the-rise
Champ on-the-rise
Hello,

You can use the behaviourFilter class to disable behaviours at the beginning of your code then enable them back again at the end of your code.