Examples of UtilNotification


Examples of org.encuestame.utils.web.notification.UtilNotification

    /**
     * Test {@link UtilNotification}.
     */
    @Test
    public void testUtilNotification(){
        final UtilNotification nt = new UtilNotification();
        nt.setAdditionalDescription("additional des");
        nt.setDate("1 hour");
        nt.setDescription("description");
        nt.setHour("1");
        nt.setIcon("icon");
        nt.setId(1L);
        nt.setType("TWEETPOLL");
        assertNotNull(nt.getAdditionalDescription());
        assertNotNull(nt.getDate());
        assertNotNull(nt.getDescription());
        assertNotNull(nt.getHour());
        assertNotNull(nt.getIcon());
        assertNotNull(nt.getType());
    }
View Full Code Here

Examples of org.encuestame.utils.web.notification.UtilNotification

     * @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;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.