AnsweredAssumed Answered

Version history does not include property updates

Question asked by sepgs2004 on Jul 20, 2018
Latest reply on Jul 21, 2018 by afaust

Alfresco 5.1, CMIS.

 

Let us say we upload/index a document (v1.0). Let us say we update its custom properties afterwards.

Then, we upload a new version (v1.1) of the document.

Now when I see the history, the old version (v1.0) does not have the updated custom properties.

Before making a new version (v1.1), does it not make sense for v1.0 to have all that was before v1.1

In a way, I lost all the update values in between 1.0 and 1.1

 

For example, we store the user ids of users, who have viewed the content of the document, into a array/list property called "viewers". This array/list property is a custom property on the document.

Let us say, the users u1 and u2, have viewed respectively the document so far after it has been created.

Now before creating a new version of the same document, if I see the values of the properties, I can see the value for the viewers property as "u2, u1".

Now once I upload a new version of the document, the new (and the latest) version (v1.1) does not have any viewers and it is correct. However, if I view the version history, and look into version (v1.0), I see the viewers property empty. And now the latest version (v1.1) also do not have any viewers, which is actually correct. However, there are users who viewed the earlier version v1.0. You see, I lost the viewers on the initial version.

How do I go about maintaining the viewers for version v1.0?

 

We do not have our custom model defined with mandatory aspect:versionable. I do not know if we have to do this. Even without this, when we checkout and checkin, I see the versions getting created.

 

I read this online:

Any properties that you set on a file are saved with the current version of a file, and written to the Version History after a major update; for example, when a new file is uploaded. This means that if you save properties in version 1.0, they are saved in the Version History of version 1.1.

The property version.store.enableAutoVersionOnUpdateProps is set to false by default. This means that the version history is not incremented when using Edit Properties in Share. Set this property to version.store.enableAutoVersionOnUpdateProps=true in alfresco-global.properties to enable this property.

 

I have a hard time understanding the above.

 

Does anyone have this problem?

Or am I seeing things incorrectly?

Outcomes