public class UserProfileEventListener
extends org.exoplatform.container.component.BaseComponentPlugin
<configuration> [..] <external-component-plugins> <target-component>org.exoplatform.services.organization.OrganizationService</target-component> <component-plugin> <name>my.user.profile.listener</name> <set-method>addListenerPlugin</set-method> <type>my.package.MyUserProfileEventListener</type> <description>your listener description</description> </component-plugin> </external-component-plugins> [...] /configuration>
Constructor and Description |
---|
UserProfileEventListener() |
Modifier and Type | Method and Description |
---|---|
void |
postDelete(UserProfile user)
When you register the listener to the organization service.
|
void |
postSave(UserProfile user,
boolean isNew)
When you register the listener to the organization service.
|
void |
preDelete(UserProfile user)
When you register the listener to the organization service.
|
void |
preSave(UserProfile user,
boolean isNew)
When you register the listener with the organization service.
|
public void preSave(UserProfile user, boolean isNew) throws Exception
UserProfileHandler.saveUserProfile(UserProfile, boolean)
method
before the user profile instance is saved to the database.user
- The user profile instance that will be saved.isNew
- if there is an user profile record already in the database or
notException
- The developer can decide to throw the exception or not.
If he throw an exception, then the organization service should
not persist the new record and the change of the user profile
instance to the database.public void postSave(UserProfile user, boolean isNew) throws Exception
UserProfileHandler.saveUserProfile(UserProfile, boolean)
method
after the user profile instance is saved to the database.user
- The user profile instance that is already saved in the
database. But not commited yetisNew
- if there is an user profile record already in the database or
notException
- The developer can decide to throw the exception or not.
If he throw an exception, then the organization service should
not persist the new record and the change of the user profile
instance to the database. The database state should be roled back
to the state before the saveUserProfile(..) method is called.public void preDelete(UserProfile user) throws Exception
UserProfileHandler.removeUserProfile(String, boolean)
method
before the user profile instance is removed from the database.user
- The user to be removedException
- The developer can decide what to do in his overrided
method. If the developer throw an exception. The organization
service should not removed the user profile recordpublic void postDelete(UserProfile user) throws Exception
UserProfileHandler.removeUserProfile(String, boolean)
method
after the user profile instance is removed from the database.user
- The user instance that is already removed from the databaseException
- The developer can decide what to do in his overrided
method. If the developer throw an exception. The organization
service should role back the database to the state before the
removeUserProfile(..) is called.Copyright © 2003–2019 eXo Platform SAS. All rights reserved.