Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Salvador Baena
Document versioning
November 19, 2012 8:53 AM
Answer

Salvador Baena

Rank: New Member

Posts: 8

Join Date: June 13, 2012

Recent Posts

Hello,

Working with the Documents and Media portlet we ended up having this doubt regarding the versioning of a document. We would like to know what it is to be done in order to move the version of a document from 1.x to 2.y. We have read so far that this happens when, while editing a document, it is indicated somewhere that this version is a major version, however, in our case, there is no such option and hence everytime changes are applied to a document the number of the version increases reaching even the 1.32 version.

I do not know if the above mentioned description was expressed clearly enough, but we would appreciate if anyone could bring some light to the topic.

Regards!!
Hitoshi Ozawa
RE: Document versioning
November 19, 2012 3:44 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

It used to be that users were able to set version number. However in recent releases, liferay automatically increase version number.
Salvador Baena
RE: Document versioning
November 20, 2012 1:07 AM
Answer

Salvador Baena

Rank: New Member

Posts: 8

Join Date: June 13, 2012

Recent Posts

Hello Hitoshi,

Yes, the version number is increased but we want to know how this increment works, based on what minor/major changes and more important how it is produced the change from a version 1.3 for example to a 2.0, that is what we were not able to find out yet.
Pavel Savinov
RE: Document versioning
November 20, 2012 1:47 AM
Answer

Pavel Savinov

Rank: Junior Member

Posts: 97

Join Date: September 24, 2012

Recent Posts

To understand it you can take a look at the EditFileEntryAction class of DL portlet, updateFileEntry method:
1   
2/* ... in updateFileEntry() ... */   
3boolean majorVersion = ParamUtil.getBoolean(
4    uploadPortletRequest, "majorVersion");

that means that you can pass boolean parameter, named majorVersion with value true to get a new major version. Otherwise(and by default) this parameter is absent. All you need is hook emoticon

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!