diff --git a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/SingleNotificationView.java b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/SingleNotificationView.java index dd639c0..bc501a1 100644 --- a/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/SingleNotificationView.java +++ b/src/main/java/org/gcube/portlets/user/notifications/client/view/templates/SingleNotificationView.java @@ -50,8 +50,8 @@ public class SingleNotificationView extends Composite { mainPanel.addStyleName("unread-notification"); } String notificationToShow = toShow.getDescription(); - - String removeMarkup = notificationToShow.replaceAll("&", "&"); + GWT.log(notificationToShow); + String removeMarkup = notificationToShow.replaceAll("&", "&").replaceAll("<","<").replaceAll(">",">"); String actualHTML = new HTML(removeMarkup).getText(); //in case of links behave differently, i know is terrible //TODO: write better code here i think diff --git a/src/main/java/org/gcube/portlets/user/notifications/server/NotificationsServiceImpl.java b/src/main/java/org/gcube/portlets/user/notifications/server/NotificationsServiceImpl.java index e23cc25..005c81f 100644 --- a/src/main/java/org/gcube/portlets/user/notifications/server/NotificationsServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/notifications/server/NotificationsServiceImpl.java @@ -84,6 +84,10 @@ public class NotificationsServiceImpl extends RemoteServiceServlet implements No System.out.println("SessionID = " + sessionID); return SessionManager.getInstance().getASLSession(sessionID, user); } + /** + * set the user in development mode + * @return + */ public String getDevelopmentUser() { String user = "test.user"; //user = "massimiliano.assante"; @@ -125,6 +129,7 @@ public class NotificationsServiceImpl extends RemoteServiceServlet implements No try { for (Notification notification : store.getAllNotificationByUser(getASLSession().getUsername(), NotificationConstants.NOTIFICATION_NUMBER_PRE)) { Date dateWithoutTime = removeTimePart(notification.getTime()); + notification.setDescription(replaceAmpersand(notification.getDescription())); if (! toReturn.containsKey(dateWithoutTime)) { ArrayList nots = new ArrayList(); nots.add(notification); @@ -239,7 +244,11 @@ public class NotificationsServiceImpl extends RemoteServiceServlet implements No } return toReturn; } - + private String replaceAmpersand(String toReplace) { + String toReturn = toReplace.replaceAll("&", "&"); + return toReturn; + } + @Override public boolean setUserNotificationPreferences(Map enabledChannels) { return store.setUserNotificationPreferences(getASLSession().getUsername(), enabledChannels);