public class GroupEventListener
extends org.exoplatform.container.component.BaseComponentPlugin
<configuration> [..] <external-component-plugins> <target-component>org.exoplatform.services.organization.OrganizationService</target-component> <component-plugin> <name>my.group.listener</name> <set-method>addListenerPlugin</set-method> <type>my.package.MyGroupEventListener</type> <description>your listener description</description> </component-plugin> </external-component-plugins> [...] /configuration>
Constructor and Description |
---|
GroupEventListener() |
Modifier and Type | Method and Description |
---|---|
void |
postDelete(Group group)
This method should be called after the group has been removed from the
database but not commited yet.
|
void |
postSave(Group group,
boolean isNew)
This method is called after the group has been saved but not commited yet
|
void |
preDelete(Group group)
This method is called before a group should be deleted
|
void |
preSave(Group group,
boolean isNew)
This method is called before the group is persisted to the database.
|
public void preSave(Group group, boolean isNew) throws Exception
group
- The group to be savedisNew
- if the group is a new record in the database or notException
- The developer can decide to throw an exception or not. If
the listener throw an exception, the organization service should
not save/update the group to the databasepublic void postSave(Group group, boolean isNew) throws Exception
group
- The group has been saved.isNew
- if the group is a new record in the database or notException
- The developer can decide to throw the exception or not.
If the method throw an exception. The organization service should
role back the data to the state before the method
GroupHandler.addChild(..) or GroupHandler.saveGroup(..) is
called.public void preDelete(Group group) throws Exception
group
- the group to be deleteException
- The developer can decide to throw the exception or not.
If the method throw an exception. The organization service should
not remove the group record from the database.public void postDelete(Group group) throws Exception
group
- The group has been removed.Exception
- The developer can decide to throw the exception or not.
If the method throw the exception, the organization service
should role back the database to the state before the method
GroupHandler.removeGroup(..) is called.Copyright © 2003-2018 eXo Platform SAS. All Rights Reserved.