Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Tung Nguyen Vu
User activities tracking feature
July 12, 2011 8:51 PM
Answer

Tung Nguyen Vu

Rank: New Member

Posts: 1

Join Date: July 12, 2011

Recent Posts

Hello,
Does Liferay portal provides a way to track user activity? I want to track and report user activities. For ex: Who connected?, What did the user do on the portal?, ...
Can everyone help me on solving this problem?
Thanks
Philippe CHEIPE
RE: User activities tracking feature
July 13, 2011 1:07 AM
Answer

Philippe CHEIPE

Rank: Junior Member

Posts: 61

Join Date: August 12, 2010

Recent Posts

Yes, we also had this need several times. Usually for banking customers where security services allways ask to track any action on the portal.

The best solution we found is to use ModelListeners on the different entities you want to track modifications on. You just have to implement them in a hook.

ModelListeners usage is, for example, defined here

This allow you to log any action on any Liferay object. It's quite quick and powerfull.

The only problem you may be facing is to be able to log the user that performed the action (the user id is not simply accessible from the model listener). We found a solution. I put it here .

Hope it helps.
Sergey Rolich
RE: User activities tracking feature
October 21, 2012 8:57 PM
Answer

Sergey Rolich

Rank: New Member

Posts: 13

Join Date: April 4, 2012

Recent Posts

I wanted to write a log with Service Builder in the database, but I have a hook out such errors:
1com.liferay.portal.ResourceActionsException: There are no actions associated with the resource com.b2e.kudos.logjournal.database.model.LogEntity
2    at com.liferay.portal.service.impl.ResourceLocalServiceImpl.validate(ResourceLocalServiceImpl.java:1348)
3    at com.liferay.portal.service.impl.ResourceLocalServiceImpl.addResources(ResourceLocalServiceImpl.java:845)
4    at com.liferay.portal.service.impl.ResourceLocalServiceImpl.addResources(ResourceLocalServiceImpl.java:147)
5    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
6    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
7    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
8    at java.lang.reflect.Method.invoke(Method.java:597)

As you implement a record in the database?