added extractOrgFriendlyURL method
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/gcube-widgets@126756 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
9c246a1168
commit
e9fbcf32bd
|
@ -10,4 +10,19 @@ public class ClientScopeHelper {
|
||||||
return GWT.create(ScopeService.class);
|
return GWT.create(ScopeService.class);
|
||||||
//Window.Location.getHref();
|
//Window.Location.getHref();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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…
Reference in New Issue