Fórumok

Log the user's activity whenever she opens a portlet or submits data to it

Pratibha Sahai, módosítva 8 év-val korábban

Log the user's activity whenever she opens a portlet or submits data to it

New Member Bejegyzések: 12 Csatlakozás dátuma: 2014.11.27. Legújabb bejegyzések
Hello Team,

I am working on a project that has multiple portlets in it. I need to log the information whenever a portlet is opened or data in it is submitted to database or a search is made.

Can you please guide me how can I achieve this?

Thanks,
Pratibha
thumbnail
David H Nebinger, módosítva 8 év-val korábban

RE: Log the user's activity whenever she opens a portlet or submits data to

Liferay Legend Bejegyzések: 14919 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
Well, portlets aren't really opened at all, they're just sitting on a page waiting for use...

That aside, you're talking about auditing. Audit portlet is available for EE and there's a wiki page about adding auditing to custom portlets. Putting the two together will give you the information you're looking for.

https://www.liferay.com/community/wiki/-/wiki/Main/Adding+Auditing+Functionality+to+Portlets
Pratibha Sahai, módosítva 8 év-val korábban

RE: Log the user's activity whenever she opens a portlet or submits data to

New Member Bejegyzések: 12 Csatlakozás dátuma: 2014.11.27. Legújabb bejegyzések
By opening a portlet, I mean when a render/doView method of a portlet is called.

and this needs to be done only for some portlets and not all of them. How can we achieve that.

Thanks,
Pratibha
thumbnail
Andew Jardine, módosítva 8 év-val korábban

RE: Log the user's activity whenever she opens a portlet or submits data to

Liferay Legend Bejegyzések: 2416 Csatlakozás dátuma: 2010.12.22. Legújabb bejegyzések
As David has suggested -- https://www.liferay.com/community/wiki/-/wiki/Main/Adding+Auditing+Functionality+to+Portlets

You just need to add this fucntionality to the portlets you want audited, for the actions you want to audit. For example, you would add an audit message creation for the render method (assuming Liferay MVC portlet), and again in whatever action handler you have defined. Following this guide does not mean that it would be applied to ALL portlets.