how to add versionable aspect to a existing document using cmis

cancel
Showing results for 
Search instead for 
Did you mean: 
suneetha
Member II

how to add versionable aspect to a existing document using cmis

Hi, 

     we did a bulkimport and the documents doesn't have versionable aspect set on them. Now for some of documents i have to add versions using CMIS 1.1. I am doing checkout and checkin, the checkin call with contentstream, the document is not versioned. I tried adding cm:versionable object but got unknown type error. Please advice on how to make the existing document versionable and checkin new version.

3 Replies
afaust
Master

Re: how to add versionable aspect to a existing document using cmis

With only CMIS at hand it is not possible to just add the versionable aspect to documents in Alfresco. That aspect is part of the base domain type for documents in CMIS which is why Alfresco filters it out as an aspect via the CMIS APIs, so you cannot set it e.g. via secondaryObjectTypeIds.

The most reliable option would be to do some patching / batch processing with Alfresco means, i.e. using Repository-tier Java code or some scripts via the JavaScript Console. There you can add the aspect to all the documents that are missing it.

suneetha
Member II

Re: how to add versionable aspect to a existing document using cmis

Thanks for the Response Axel, could you please advice what would the best and reliable option to do this on large amount of documents.

afaust
Master

Re: how to add versionable aspect to a existing document using cmis

It's not a question of what I would recommend - it's a question of what you are capable of doing / familiar with. There would be no point in recommending you to use the Java-based batch processing and patching functionalities of Alfresco if you have not yet developed anything within Alfresco using Java API yet, as you would be easily overwhelmed. Also "large amount of documents" can be very variable. For me, a "large amount" is anything more than 100.000 or even a million documents.

So, with that in mind:

a) Have you ever programmed an extension to Alfresco using its Java APIs?

b) Have you ever worked with the Script API of Alfresco or the JavaScript Console addon?

c) How many documents are we talking about in general?