cancel
Showing results for 
Search instead for 
Did you mean: 

OpenCMIS auto version when update properties in Community 5.0c

danielgonzález
Champ in-the-making
Champ in-the-making
Hi.

I'm developing a Java Application wich uses OpenCMIS to communicate with Alfresco Repository. When I update a document's properties a new version is always created. I've read a lot about the subject, but the only solutions I've found are those suggesting setting the autoVersion and autoVersionOnUpdateProps properties to false in the contentModel.xml. But in the Community 5.0 version of Alfresco the Content Model is inside a jar.

So, is there any simple way to do this? Or do I have to create a custom content type just for this?

Thanks.
11 REPLIES 11

afaust
Legendary Innovator
Legendary Innovator
Hello,

I've always found that setting the autoVersion / autoVersionOnUpdateProps to false in the contentModel.xml to be a poor / brute-force solution. The alternative would be to develop a behaviour (automation policy) that sets these properties when new documents are created, but based on some selection criteria, e.g. only for actual documents (and not objects that simply share the base type) within actual site document libraries or other company home root folders (and not wiki, blog or other containers).

Regards
Axel

Thank you for your fast answer. I will try your solution as sonn as I fix another problem wich is driving me insane.

Hi,

Did you find a solution ? If yes, Could you share it ? I gave up few month ago about this Smiley Sad

afaust
Legendary Innovator
Legendary Innovator
Hello,

in addition to my first response, I'd also like to point out that you can set the following property to false in alfresco-global.properties to disable auto-versioning: "version.store.enableAutoVersioning"

Regards
Axel

Hello,

Does it works with Alfresco 5.0.c ? Cause your answers mainly refers to Alfresco 4.x Smiley Sad

afaust
Legendary Innovator
Legendary Innovator
Hello,

my answer refers to Alfresco in general - nowhere did I say "Alfresco 4.x". Only my profile states "Alfresco 4.2" because that is what I am mainly using due to my work.
The specific answers of this thread also apply to Alfresco 5.

Regards
Axel

Hello,

Does your last method disable autoVersioning on the property update ? or it disable autoVersioning even for content update ?

Thanks

afaust
Legendary Innovator
Legendary Innovator
Hello,

it disables autoVersioning regardless of what is changed.

Regards
Axel

phil98
Champ in-the-making
Champ in-the-making
Hi
I've tried to update form 5.0.a to 5.0.c
this below was working on 5.0.a but don't seem to work in 5.0.c
version.store.enableAutoVersioning=false


And it's painful "to reinvent the wheel" when upgrading alfresco !!


Rem: I'am trying to devellop a web frontend with php/curl

I've made a new try.
In fact if you change a property in share thee's no version change but when you try with curl there's a change of version here is my cmd:
curl -X PUT -umoaa:XXXXXX  "http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom/entry?id=4165fb1c-282e-4d..." -H 'Content-Type:application/atom+xml;type=entry;charset=UTF-8' -d @ModProp.xml 

And here is the MoProp.xml file

<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:alf="http://www.alfresco.org" >
<cmisra:object>
   <cmis:properties>
      <cmis:propertyString propertyDefinitionId="cm:description">
         <cmis:value>nouvel essai toto</cmis:value>
      </cmis:propertyString>
   </cmis:properties>
</cmisra:object>
</entry>


perhaps somtehing wrong with the curl command or the xml data file ??
Thanks