Class ResizeAvatarPictureListener
java.lang.Object
org.nuxeo.ecm.user.center.profile.listeners.ResizeAvatarPictureListener
- All Implemented Interfaces:
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
Modifier and TypeFieldDescriptionprotected static final int
protected static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handleEvent
(Event event) Handle the given event.protected boolean
isBeforeUpdate
(Event event) protected void
resizeAvatar
(DocumentModel doc, Blob avatarImage)
-
Field Details
-
RESIZED_IMAGE_WIDTH
protected static final int RESIZED_IMAGE_WIDTH- See Also:
-
RESIZED_IMAGE_HEIGHT
protected static final int RESIZED_IMAGE_HEIGHT- See Also:
-
-
Constructor Details
-
ResizeAvatarPictureListener
public ResizeAvatarPictureListener()
-
-
Method Details
-
handleEvent
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
-
resizeAvatar
- Throws:
PropertyException
-