removed client scope helper dependency

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/notifications@144464 82a268e6-3cf1-43bd-a215-b396298e98cf
Feature/23194
Massimiliano Assante 7 years ago
parent b9bcfceece
commit 706185757b

@ -5,7 +5,6 @@ import org.gcube.portal.databook.client.GCubeSocialNetworking;
import org.gcube.portal.databook.client.util.Encoder;
import org.gcube.portal.databook.shared.Notification;
import org.gcube.portal.databook.shared.NotificationType;
import org.gcube.portlets.user.gcubewidgets.client.ClientScopeHelper;
import org.gcube.portlets.user.gcubewidgets.client.elements.Span;
import org.gcube.portlets.user.notifications.client.view.templates.images.NotificationImages;
@ -67,7 +66,7 @@ public class SingleNotificationView extends Composite {
actualHTML = actualHTML.length() > 200 ? actualHTML.substring(0, 200) + " ..." : actualHTML;
String profilePageURL = GCubePortalConstants.PREFIX_GROUP_URL +
ClientScopeHelper.extractOrgFriendlyURL(Location.getHref()) +"/"+GCubePortalConstants.USER_PROFILE_FRIENDLY_URL;
extractOrgFriendlyURL(Location.getHref()) +"/"+GCubePortalConstants.USER_PROFILE_FRIENDLY_URL;
notificationText.setHTML(
"<a class=\"link\" href=\""+profilePageURL+"?"+
@ -159,4 +158,18 @@ public class SingleNotificationView extends Composite {
return images.generic();
}
}
public static String extractOrgFriendlyURL(String portalURL) {
String groupRegEx = "/group/";
if (portalURL.contains(groupRegEx)) {
String[] splits = portalURL.split(groupRegEx);
String friendlyURL = splits[1];
if (friendlyURL.contains("/")) {
friendlyURL = friendlyURL.split("/")[0];
} else {
friendlyURL = friendlyURL.split("\\?")[0].split("\\#")[0];
}
return "/"+friendlyURL;
}
return null;
}
}

Loading…
Cancel
Save