|
|
|
@ -17,7 +17,6 @@ import org.gcube.portal.databook.shared.Like;
|
|
|
|
|
import org.gcube.portal.databook.shared.PrivacyLevel;
|
|
|
|
|
import org.gcube.portal.databook.shared.ShowUserStatisticAction;
|
|
|
|
|
import org.gcube.portal.databook.shared.UserInfo;
|
|
|
|
|
import org.gcube.portlets.user.gcubewidgets.client.ClientScopeHelper;
|
|
|
|
|
import org.gcube.portlets.user.newsfeed.client.FilterType;
|
|
|
|
|
import org.gcube.portlets.user.newsfeed.client.NewsFeed;
|
|
|
|
|
import org.gcube.portlets.user.newsfeed.client.NewsService;
|
|
|
|
@ -211,7 +210,7 @@ public class NewsFeedPanel extends Composite {
|
|
|
|
|
eventBus.addHandler(SelectedUserEvent.TYPE, new SelectedUserEventHandler() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onSelectedUser(SelectedUserEvent event) {
|
|
|
|
|
final String profilePageURL = GCubePortalConstants.PREFIX_GROUP_URL + ClientScopeHelper.extractOrgFriendlyURL(Location.getHref()) +GCubePortalConstants.USER_PROFILE_FRIENDLY_URL;
|
|
|
|
|
final String profilePageURL = GCubePortalConstants.PREFIX_GROUP_URL + extractOrgFriendlyURL(Location.getHref()) +GCubePortalConstants.USER_PROFILE_FRIENDLY_URL;
|
|
|
|
|
Location.assign(profilePageURL+"?"+
|
|
|
|
|
Encoder.encode(GCubeSocialNetworking.USER_PROFILE_OID)+"="+
|
|
|
|
|
Encoder.encode(event.getSelectedUser().getId()));
|
|
|
|
@ -443,7 +442,7 @@ public class NewsFeedPanel extends Composite {
|
|
|
|
|
@Override
|
|
|
|
|
public void onSuccess(EnhancedFeed result) {
|
|
|
|
|
if (result.getFeed().getType() == FeedType.DISABLED) {
|
|
|
|
|
final String profilePageURL = GCubePortalConstants.PREFIX_GROUP_URL + ClientScopeHelper.extractOrgFriendlyURL(Location.getHref()) +GCubePortalConstants.USER_PROFILE_FRIENDLY_URL;
|
|
|
|
|
final String profilePageURL = GCubePortalConstants.PREFIX_GROUP_URL + extractOrgFriendlyURL(Location.getHref()) +GCubePortalConstants.USER_PROFILE_FRIENDLY_URL;
|
|
|
|
|
String usrLink = "<a class=\"link\" href=\""+profilePageURL+"?"+
|
|
|
|
|
Encoder.encode(GCubeSocialNetworking.USER_PROFILE_OID)+"="+
|
|
|
|
|
Encoder.encode(result.getFeed().getEntityId())+"\">"+result.getFeed().getFullName()+
|
|
|
|
@ -1475,4 +1474,19 @@ public class NewsFeedPanel extends Composite {
|
|
|
|
|
public static String getCurrentScope() {
|
|
|
|
|
return currentScope;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|