AnsweredAssumed Answered

Multiple version creations while creating/updating

Question asked by satishvarmadandu on Mar 5, 2009
Latest reply on Sep 29, 2009 by jneeve
Hi,

How it is going o solve the problem for Update.

   When i try to update a file, i am using
Content contentRef = contentService.write(node, Constants.PROP_CONTENT, dataToUpdate, contentFormat);

But by calling this, it is creating a version. I want to disable version creation when i update a document as i want to make use of authoringService.createVersion()).

The reason is simple, i can get hold to the latest version that was created and i can find out the version label etc…  using
VersionResult res = authoringService.createVersion(predicate, versionComments, false)

But if i do both for the same update option, it end up creating 2 versions; one with contentService.write() & other with authoringService.createVersion().

One option is to use "remove aspect". But when i use this , this is removing the entire version chain. This is more of a serious problem. Is there any way to just hold of version creation when i call
contentService.write

Other option i have is

cml.setAddAspect(new CMLAddAspect[] { addVersionableAspect });
       
UpdateResult[] results = respositoryService.update(cml);

this will solve the problem, but i can not get hold to what version it created ( i want version label)… i can not get the versionObject in return type.

Any help would be appreciated.

Thanks,
-Satish

Outcomes