sending message via dom for explore_vres_landing_page

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@146690 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2017-04-07 14:16:32 +00:00
parent 3e130d6ae6
commit 5011dbc176
1 changed files with 15 additions and 5 deletions

View File

@ -21,6 +21,7 @@ import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.http.client.URL;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.json.client.JSONValue;
import com.google.gwt.user.client.Cookies;
import com.google.gwt.user.client.Window;
@ -216,7 +217,15 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
rootPanel.add(this);
updateSize();
// listen for DOM messages
listenForPostMessage();
// send message about gateway url
JSONObject obj = new JSONObject();
String landingPageVREs = Window.Location.getProtocol() + "//" + Window.Location.getHostName() + "/explore";
JSONString value = new JSONString(landingPageVREs);
obj.put("explore_vres_landing_page", value);
postMessage(obj.toString());
}
public static String getLatestSelectedProductIdentifier(){
@ -320,9 +329,10 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
/**
* Post message.
*
* @param msg the msg
* @param msg the msg (as json)
*/
protected native void postMessage(String msg) /*-{
console.log("Sending message " + msg);
$wnd.postMessage(msg, "*");
}-*/;