Class ResizeAvatarPictureListener
- java.lang.Object
-
- org.nuxeo.ecm.user.center.profile.listeners.ResizeAvatarPictureListener
-
- All Implemented Interfaces:
EventListener
public class ResizeAvatarPictureListener extends Object implements EventListener
- Author:
- rlegall Listener to handle the maximum dimensions of the avatar picture. This listener is triggered on DocumentEventTypes.BEFORE_DOC_UPDATE events. It verifies if the picture width is above 300 pixels and its height above 200. In that case, the picture saved in the rich profile is a resized version of it which fits those constrains.
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
RESIZED_IMAGE_HEIGHT
protected static int
RESIZED_IMAGE_WIDTH
-
Constructor Summary
Constructors Constructor Description ResizeAvatarPictureListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
handleEvent(Event event)
Handle the given event.protected boolean
isBeforeUpdate(Event event)
protected void
resizeAvatar(DocumentModel doc, Blob avatarImage)
-
-
-
Field Detail
-
RESIZED_IMAGE_WIDTH
protected static final int RESIZED_IMAGE_WIDTH
- See Also:
- Constant Field Values
-
RESIZED_IMAGE_HEIGHT
protected static final int RESIZED_IMAGE_HEIGHT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ResizeAvatarPictureListener
public ResizeAvatarPictureListener()
-
-
Method Detail
-
handleEvent
public void handleEvent(Event event)
Description copied from interface:EventListener
Handle the given event. The listener can cancel the event by callingEvent.cancel()
- Specified by:
handleEvent
in interfaceEventListener
- Parameters:
event
- the event
-
isBeforeUpdate
protected boolean isBeforeUpdate(Event event)
-
resizeAvatar
protected void resizeAvatar(DocumentModel doc, Blob avatarImage) throws PropertyException
- Throws:
PropertyException
-
-