03-05-2009 02:45 PM
03-05-2009 04:09 PM
04-21-2009 12:09 PM
04-27-2009 09:07 AM
Hi,
I found the solution and posting here. This moght be helpful if anyone is searching for this
Here is the way .
1) Search for "contentModel.xml" file . This will be under tomcat/webapps/alfresco/WEB-INF/classes/alfresco/model/contentModel.xml
2) Look for "<aspect name="cm:versionable">" inside that and make "<property name="cm:initialVersion">" & "<property name="cm:autoVersion">" as false.
By updating this, it wont add a version by default. Now you will get more control on when to add a version and you can do that by
VersionResult res = authoringService.createVersion(predicateVersion, ….versioncomments, false);
We can get the versionLabel & other version properties from this returned object.
-Satish
09-29-2009 03:38 PM
// Add the versionable aspect to the document. This will allows the content to be versioned
makeVersionable(repositoryService, contentReference);
// Use authoring service to checkout file, update content, then check back in with major revision
AuthoringServiceSoapBindingStub authoringService = WebServiceFactory.getAuthoringService();
// Checkout the document to update, placing the working document in the same folder
Predicate itemsToCheckOut = new Predicate(new Reference[]{contentReference}, null, null);
CheckoutResult checkOutResult = authoringService.checkout(itemsToCheckOut, null);
// Get a reference to the working copy
Reference workingCopyReference = checkOutResult.getWorkingCopies()[0];
// Update the content of the working copy
ContentFormat contentFormat = new ContentFormat(MIME_TYPE, "UTF-8");
contentService.write(workingCopyReference, Constants.PROP_CONTENT, bytearray, contentFormat);
// Now check the working copy in with a description of the change made that will be recorded in the version history
Predicate predicate = new Predicate(new Reference[]{workingCopyReference}, null, null);
NamedValue[] revisionType = new NamedValue[]{Utils.createNamedValue("versionType", "MAJOR")};
authoringService.checkin(predicate, revisionType, false);
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.