diff --git a/src/main/java/org/gcube/portal/clientcontext/client/GCubeClientContext.java b/src/main/java/org/gcube/portal/clientcontext/client/GCubeClientContext.java index 4e8d085..7b4a9eb 100644 --- a/src/main/java/org/gcube/portal/clientcontext/client/GCubeClientContext.java +++ b/src/main/java/org/gcube/portal/clientcontext/client/GCubeClientContext.java @@ -9,7 +9,6 @@ import com.google.gwt.core.client.EntryPoint; */ public class GCubeClientContext implements EntryPoint { public static final String VRE_ID_ATTR_NAME = "gcube-vreid"; - public static final String USER_ID_ATTR_NAME = "gcube-userId"; public void onModuleLoad() {} @@ -21,38 +20,5 @@ public class GCubeClientContext implements EntryPoint { } return groupId; }-*/; - - public static native String getCurrentUserId() /*-{ - var userId; - if ($wnd.Liferay != null) { - userId = $wnd.Liferay.ThemeDisplay.getUserId(); - console.log("current userid is = " + userId); - } - return userId; - }-*/; - - public static native void injectContext() /*-{ - if ($wnd.Liferay != null) { - var userId; - var groupId; - if ($wnd.Liferay.ThemeDisplay.isSignedIn()) { - userId = $wnd.Liferay.ThemeDisplay.getUserId(); - groupId = $wnd.Liferay.ThemeDisplay.getScopeGroupId(); - console.log('userId is = ' + userId); - console.log("groupId is = " + groupId); - } - else { - groupId = $wnd.Liferay.ThemeDisplay.getScopeGroupId(); - console.log('Not logged in, injecting groupId only'); - } - - $wnd.XMLHttpRequest.prototype.realSend = $wnd.XMLHttpRequest.prototype.send; - var newSend = function(vData) { - this.setRequestHeader(@org.gcube.portal.clientcontext.client.GCubeClientContext::USER_ID_ATTR_NAME, userId); - this.setRequestHeader(@org.gcube.portal.clientcontext.client.GCubeClientContext::VRE_ID_ATTR_NAME, groupId); - this.realSend(vData); - }; - $wnd.XMLHttpRequest.prototype.send = newSend; - } - }-*/; + }