Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
mickael bruna
Document library - AfterUpdateDocument
October 14, 2013 9:00 AM

mickael bruna

Rank: Junior Member

Posts: 66

Join Date: October 14, 2013

Recent Posts


I would like execute a code when a document is modify by a user.

I try to create liferay-hook with a systemListener who implements ModelListener<DLFileVersion>, but this method "onAfterUpdate" is call a lot of time during modification and I don't know if the document is really modify or not. I don't know if it's a new version or the same.

I try with ModelListener<DLFileEntry> and it's the same problem : when I open my document for modify, the method "onAfterUpdate" is call 3 times. I don't want execute my code 3 times, I just want execute when the document is realy modify.

Do you have a solution for execute a code only the document is modify by a user?

Thank for your answers.
Amos Fong
RE: Document library - AfterUpdateDocument
October 16, 2013 4:29 PM

Amos Fong


Rank: Liferay Legend

Posts: 1954

Join Date: October 7, 2008

Recent Posts

Hi Mickael,

I think what you want to do is hook the DLFileEntryLocalServiceImpl.update method. That method should only be called once when a document is modified.

More info here:

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