cancel
Showing results for 
Search instead for 
Did you mean: 

How to checkin a major docu

yyyyde
Champ in-the-making
Champ in-the-making
How can I manually set major version for a docu. I want to check out a docu from the service, then check the docu with major version and new content in the service.

             CheckoutResult checkOutResult = authoringService.checkout(itemsToCheckOut, parentReference);
        Reference workingCopyReference = checkOutResult.getWorkingCopies()[0];
        Predicate predicate = new Predicate(new Reference[]{workingCopyReference}, STORE, null);
        
                     ….update docu with the new content and major version…..
    
             NamedValue[] comments = new NamedValue[]{
                   Utils.createNamedValue("description", "update")};
                          
           
            
        authoringService.checkin(predicate, comments, false);

thanks
3 REPLIES 3

jefrainmx
Champ in-the-making
Champ in-the-making
Hi, have you receive any response? I do have the same problem i cannot check in major versions.

kumbach
Champ in-the-making
Champ in-the-making
How can I manually set major version for a docu. I want to check out a docu from the service, then check the docu with major version and new content in the service.

Silly question, but have you added the versionable aspect to your document?

mjuarez
Champ in-the-making
Champ in-the-making
try  whit this:


import org.alfresco.service.cmr.version.VersionType;
import org.alfresco.repo.version.VersionModel;

NamedValue[] comments = new NamedValue[]{
Utils.createNamedValue("description", "update"),Utils.createNamedValue(VersionModel.PROP_VERSION_TYPE, VersionType.MAJOR.toString())};

How update the properties in the version? I like update the title, author, desciption and the custom properties from my custom model.

Please help!!

Soory for my english, i'm from Argentina.

Cya!