Programmatically updated Document version is incrementing by 1 not with 0.1

thumbnail
Kalai Arasan, modified 6 Years ago. Regular Member Posts: 127 Join Date: 1/2/13 Recent Posts

Hi,

 

When I am Programmatically updating the Document , File version is incrementing by 1(1.0,2.0,3.0,etc.,) . But while updating the document manually version is incrementing by 0.1(1.0,1.1,1.2,1.3,etc.,). Why this difference exist in liferaydxp?

How to make the increment as unique in both ways?

thumbnail
Gnaniyar Zubair, modified 6 Years ago. Liferay Master Posts: 724 Join Date: 12/19/07 Recent Posts

 

How are you updating the Document ? I think it is updating with Minor version. 

 

Try updating the document with MAJOR version.

 

DLVersionNumberIncrease.MINOR   [AUTOMATIC, MAJOR, MINOR]

thumbnail
Kalai Arasan, modified 6 Years ago. Regular Member Posts: 127 Join Date: 1/2/13 Recent Posts

 

Thankyou Zubair for the update. We need to programmatically update the document with Minor version. Is there any way to do that? And I can't able to access this class DLVersionNumberIncrease.

thumbnail
Gnaniyar Zubair, modified 6 Years ago. Liferay Master Posts: 724 Join Date: 12/19/07 Recent Posts
I think DLVersionNumberIncrease  class should be from impl. 
thumbnail
Kalai Arasan, modified 6 Years ago. Regular Member Posts: 127 Join Date: 1/2/13 Recent Posts


DLVersionNumberIncrease is not having impl class and I found model class like below.

https://github.com/liferay/liferay-portal/blob/master/portal-kernel/src/com/liferay/document/library/kernel/model/DLVersionNumberIncrease.java.

As per the DLVersionNumberIncrease, if we set MajorVersion as false, it should increment with Minor version but it's not working as expected.