* @param request
* @return
*/
public UtilNotification convertNotificationToBean(
final Notification notification, final HttpServletRequest request) {
final UtilNotification utilNotification = new UtilNotification();
// If the creation date is within the range of 48 hours shown the
// relative date otherwise the original date.
if(DateUtil.isWithinCurrentDate(notification.getCreated())){
utilNotification.setDate(this.convertRelativeTimeToString(notification.getCreated(), request));
}
else {
utilNotification.setDate(DateUtil.SIMPLE_DATE_FORMAT
.format(notification.getCreated()));
}
utilNotification.setDescription(this.convertNotificationMessage(
notification.getDescription(), request, new Object[] {}));
utilNotification.setId(notification.getNotificationId());
utilNotification.setHour(DateUtil.SIMPLE_TIME_FORMAT
.format(notification.getCreated()));
utilNotification.setIcon(convertNotificationIconMessage(notification
.getDescription()));
utilNotification.setType(notification.getDescription().name());
utilNotification.setUrl(notification.getUrlReference());
utilNotification.setReaded(notification.getReaded());
utilNotification.setAdditionalDescription(notification
.getAdditionalDescription());
return utilNotification;
}