I define a UserEntryListener in liferay hook:
package com.ggd543.liferay.listener;
public class UserEntryListener extends BaseModelListener<User> {
@Override
public void onAfterCreate(User model) throws ModelListenerException {
System.out.println("==== onAfterCreate - uuid: " + model.getUuid());
}
@Override
public void onAfterRemove(User model) throws ModelListenerException {
System.out.println("==== onAfterRemove - uuid: " + model.getUserId());
}
@Override
public void onAfterUpdate(User model) throws ModelListenerException {
System.out.println("==== onAfterUpdate user - uuid: " + model.getUuid());
}
@Override
public void onBeforeCreate(User model) throws ModelListenerException {
System.out.println("==== onBeforeCreate - uuid: " + model.getUuid());
}
@Override
public void onBeforeRemove(User model) throws ModelListenerException {
System.out.println("==== onBeforeRemove - uuid: " + model.getUuid());
}
@Override
public void onBeforeUpdate(User model) throws ModelListenerException {
System.out.println("==== onBeforeUpdate user");
}
}
and in docroot/WEB-INF/src/portal-ext/properties
:
value.object.listener.com.liferay.portal.model.User=com.ggd543.liferay.listener.UserEntryListener
After deploy the hook onto liferay 6.0.6 bundled with Jboss 5.1.0 GA, I found that no matter create, update and remove action is performed through control pannel , the corresponding callback method of UserEntryListener
is unable to invoke.