fixed bug not displaying the http links
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/notifications@94351 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
67cdce8ef7
commit
6877631a46
|
@ -50,8 +50,8 @@ public class SingleNotificationView extends Composite {
|
||||||
mainPanel.addStyleName("unread-notification");
|
mainPanel.addStyleName("unread-notification");
|
||||||
}
|
}
|
||||||
String notificationToShow = toShow.getDescription();
|
String notificationToShow = toShow.getDescription();
|
||||||
|
GWT.log(notificationToShow);
|
||||||
String removeMarkup = notificationToShow.replaceAll("&", "&");
|
String removeMarkup = notificationToShow.replaceAll("&", "&").replaceAll("<","<").replaceAll(">",">");
|
||||||
String actualHTML = new HTML(removeMarkup).getText();
|
String actualHTML = new HTML(removeMarkup).getText();
|
||||||
|
|
||||||
//in case of links behave differently, i know is terrible //TODO: write better code here i think
|
//in case of links behave differently, i know is terrible //TODO: write better code here i think
|
||||||
|
|
|
@ -84,6 +84,10 @@ public class NotificationsServiceImpl extends RemoteServiceServlet implements No
|
||||||
System.out.println("SessionID = " + sessionID);
|
System.out.println("SessionID = " + sessionID);
|
||||||
return SessionManager.getInstance().getASLSession(sessionID, user);
|
return SessionManager.getInstance().getASLSession(sessionID, user);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* set the user in development mode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public String getDevelopmentUser() {
|
public String getDevelopmentUser() {
|
||||||
String user = "test.user";
|
String user = "test.user";
|
||||||
//user = "massimiliano.assante";
|
//user = "massimiliano.assante";
|
||||||
|
@ -125,6 +129,7 @@ public class NotificationsServiceImpl extends RemoteServiceServlet implements No
|
||||||
try {
|
try {
|
||||||
for (Notification notification : store.getAllNotificationByUser(getASLSession().getUsername(), NotificationConstants.NOTIFICATION_NUMBER_PRE)) {
|
for (Notification notification : store.getAllNotificationByUser(getASLSession().getUsername(), NotificationConstants.NOTIFICATION_NUMBER_PRE)) {
|
||||||
Date dateWithoutTime = removeTimePart(notification.getTime());
|
Date dateWithoutTime = removeTimePart(notification.getTime());
|
||||||
|
notification.setDescription(replaceAmpersand(notification.getDescription()));
|
||||||
if (! toReturn.containsKey(dateWithoutTime)) {
|
if (! toReturn.containsKey(dateWithoutTime)) {
|
||||||
ArrayList<Notification> nots = new ArrayList<Notification>();
|
ArrayList<Notification> nots = new ArrayList<Notification>();
|
||||||
nots.add(notification);
|
nots.add(notification);
|
||||||
|
@ -239,6 +244,10 @@ public class NotificationsServiceImpl extends RemoteServiceServlet implements No
|
||||||
}
|
}
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
private String replaceAmpersand(String toReplace) {
|
||||||
|
String toReturn = toReplace.replaceAll("&", "&");
|
||||||
|
return toReturn;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setUserNotificationPreferences(Map<NotificationType, NotificationChannelType[]> enabledChannels) {
|
public boolean setUserNotificationPreferences(Map<NotificationType, NotificationChannelType[]> enabledChannels) {
|
||||||
|
|
Loading…
Reference in New Issue