diff --git a/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/view/GCubeCkanDataCatalogPanel.java b/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/view/GCubeCkanDataCatalogPanel.java index ea304b4..cf35cb6 100644 --- a/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/view/GCubeCkanDataCatalogPanel.java +++ b/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/view/GCubeCkanDataCatalogPanel.java @@ -4,7 +4,9 @@ package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.view; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.GCubeCkanDataCatalog; import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.resource.CkanPortletResources; @@ -17,6 +19,7 @@ import com.google.gwt.core.client.GWT; import com.google.gwt.event.logical.shared.ResizeEvent; import com.google.gwt.event.logical.shared.ResizeHandler; import com.google.gwt.event.shared.HandlerManager; +import com.google.gwt.http.client.URL; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.Frame; @@ -60,11 +63,22 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate { ckanOrganizationsPanel = new CkanOrganizationsPanel(this); initPanel(); setTopPanelVisible(true); - String pathParameter = - Window.Location.getParameter(GCubeCkanDataCatalog.GET_PATH_PARAMETER); - String queryParameter = - Window.Location.getParameter(GCubeCkanDataCatalog.GET_QUERY_PARAMETER); + // decode parameters (they could have been encoded) + Map paramsMap = new HashMap(2); + String queryParameters = Window.Location.getQueryString(); + if(queryParameters != null){ + String decoded = URL.decodeQueryString(queryParameters); // equals should be encoded too (%3D) + String[] params = decoded.substring(decoded.indexOf("?") + 1).split("&"); + for (int i = 0; i < params.length; i++) { + String[] queryAndValue = params[i].split("="); + paramsMap.put(queryAndValue[0], queryAndValue[1]); + } + GWT.log("Extracted parameters are " + paramsMap); + } + + String pathParameter = paramsMap.get(GCubeCkanDataCatalog.GET_PATH_PARAMETER); //Window.Location.getParameter(GCubeCkanDataCatalog.GET_PATH_PARAMETER); + String queryParameter = paramsMap.get(GCubeCkanDataCatalog.GET_QUERY_PARAMETER);// Window.Location.getParameter(GCubeCkanDataCatalog.GET_QUERY_PARAMETER); String currentPortletUrl = Window.Location.getHref().split("\\?")[0];// ignore get parameters GCubeCkanDataCatalog.service.getCKanConnector( diff --git a/src/main/resources/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/GCubeCkanDataCatalog.gwt.xml b/src/main/resources/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/GCubeCkanDataCatalog.gwt.xml index edaee34..680fe1e 100644 --- a/src/main/resources/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/GCubeCkanDataCatalog.gwt.xml +++ b/src/main/resources/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/GCubeCkanDataCatalog.gwt.xml @@ -25,6 +25,8 @@ + +