From e082f323c799cf01b21a81c7d4103e096380bbb1 Mon Sep 17 00:00:00 2001 From: Francesco Mangiacrapa Date: Wed, 7 Sep 2016 13:07:46 +0000 Subject: [PATCH] 4953: Uri Resolver: remove jumps of scope from Readers (for Generic and Runtime resource) Task-Url: https://support.d4science.org/issues/4953 All jumps has been removed When is need to set scope in order to discovery a certain resource in a specific scope in the end the original scope is restored git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-transfer/uri-resolver@131174 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../ApplicationProfileReader.java | 34 +++--- .../applicationprofile/ScopeUtil.java | 48 ++++---- .../resolver/gis/GeoRuntimeReader.java | 13 ++- .../resolver/gis/GeonetworkInstance.java | 11 +- .../resolver/gis/GisResolver.java | 12 +- .../gis/geonetwork/GeonetworkResolver.java | 54 ++++++--- .../gis/geonetwork/HTTPCallsUtils.java | 104 +++++++++++++++++- src/main/webapp/index.jsp | 21 +++- src/test/java/GeonetworkQueryTest.java | 58 ++++++++++ src/test/java/GisResolverTest.java | 39 +++++++ 10 files changed, 316 insertions(+), 78 deletions(-) create mode 100644 src/test/java/GeonetworkQueryTest.java create mode 100644 src/test/java/GisResolverTest.java diff --git a/src/main/java/org/gcube/datatransfer/resolver/applicationprofile/ApplicationProfileReader.java b/src/main/java/org/gcube/datatransfer/resolver/applicationprofile/ApplicationProfileReader.java index 5be2ff5..954c038 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/applicationprofile/ApplicationProfileReader.java +++ b/src/main/java/org/gcube/datatransfer/resolver/applicationprofile/ApplicationProfileReader.java @@ -11,18 +11,18 @@ import javax.xml.parsers.DocumentBuilderFactory; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.gcube.common.resources.gcore.utils.XPathHelper; -import org.gcube.common.scope.api.ScopeProvider; import org.gcube.resources.discovery.client.api.DiscoveryClient; import org.gcube.resources.discovery.client.queries.api.Query; import org.gcube.resources.discovery.client.queries.impl.QueryBox; import org.w3c.dom.Node; import org.xml.sax.InputSource; + /** + * The Class ApplicationProfileReader. * * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it - * @Oct 13, 2014 - * + * Sep 6, 2016 */ public class ApplicationProfileReader { @@ -42,9 +42,10 @@ public class ApplicationProfileReader { /** + * Instantiates a new application profile reader. * * @param scope - the scope to be searched - * @param genericResource - the name of generic resource + * @param secondaryType the secondary type * @param portletClassName - the AppId of generic resource */ public ApplicationProfileReader(String scope, String secondaryType, String portletClassName) { @@ -54,13 +55,18 @@ public class ApplicationProfileReader { this.applicationProfile = readProfileFromInfrastrucure(); } + /** + * Gets the application profile. + * + * @return the application profile + */ public ApplicationProfile getApplicationProfile() { return applicationProfile; } /** - * this method looks up the applicationProfile profile among the ones available in the infrastructure - * @param portletClassName your servlet class name will be used ad unique identifier for your applicationProfile + * this method looks up the applicationProfile profile among the ones available in the infrastructure. + * * @return the applicationProfile profile */ private ApplicationProfile readProfileFromInfrastrucure() { @@ -68,21 +74,16 @@ public class ApplicationProfileReader { ApplicationProfile appProf = new ApplicationProfile(); String queryString = GcubeQuery.getGcubeGenericQueryString(secondaryType, appId); - logger.info("Trying to fetch applicationProfile profile from the infrastructure for " + secondaryType + " scope: " + scope); + logger.info("Trying to fetch ApplicationProfile in the scope: "+scope+", SecondaryType: " + secondaryType + ", AppId: " + appId); try { - String infra = ScopeUtil.getInfrastructureNameFromScope(this.scope); - ScopeProvider.instance.set(infra); - logger.info("scope provider set instance: "+infra); - Query q = new QueryBox(queryString); - DiscoveryClient client = client(); List appProfile = client.submit(q); if (appProfile == null || appProfile.size() == 0) - throw new ApplicationProfileNotFoundException("Your applicationProfile is not registered in the infrastructure"); + throw new ApplicationProfileNotFoundException("ApplicationProfile with SecondaryType: " + secondaryType + ", AppId: " + appId +" is not registered in the scope: "+scope); else { String elem = appProfile.get(0); DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); @@ -116,7 +117,6 @@ public class ApplicationProfileReader { logger.warn("Null or empty element in " + appProf.getName()); } - currValue = helper.evaluate("/Resource/Profile/Body/EndPoint[Scope='"+scope.toString()+"']/Scope/text()"); if (currValue != null && currValue.size() > 0) { @@ -168,13 +168,13 @@ public class ApplicationProfileReader { } catch (Exception e) { logger.error("Error while trying to fetch applicationProfile profile from the infrastructure", e); return null; - }finally{ - logger.info("Resetting scope provider..."); - ScopeProvider.instance.reset(); } } + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ @Override public String toString() { StringBuilder builder = new StringBuilder(); diff --git a/src/main/java/org/gcube/datatransfer/resolver/applicationprofile/ScopeUtil.java b/src/main/java/org/gcube/datatransfer/resolver/applicationprofile/ScopeUtil.java index e1c611c..a13b632 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/applicationprofile/ScopeUtil.java +++ b/src/main/java/org/gcube/datatransfer/resolver/applicationprofile/ScopeUtil.java @@ -1,5 +1,5 @@ /** - * + * */ package org.gcube.datatransfer.resolver.applicationprofile; @@ -15,29 +15,29 @@ public class ScopeUtil { private static final String SCOPE_SEPARATOR = "/"; public static final Logger logger = LoggerFactory.getLogger(ScopeUtil.class); - - - public static String getInfrastructureNameFromScope(String scope) throws Exception{ - if(scope==null || scope.isEmpty()){ - throw new Exception("Scope is null or empty"); - } - - if(!scope.startsWith(SCOPE_SEPARATOR)){ - logger.warn("Input scope: "+scope+" not have / is a really scope?"); - scope = SCOPE_SEPARATOR+scope; - logger.warn("Tentative as scope: "+scope); - } - String[] splitScope = scope.split(SCOPE_SEPARATOR); - - String rootScope = SCOPE_SEPARATOR + splitScope[1]; - - if(rootScope.length()<2){ - throw new Exception("Infrastructure name not found in "+scope); - } - - return rootScope; - - } +// public static String getInfrastructureNameFromScope(String scope) throws Exception{ +// +// if(scope==null || scope.isEmpty()){ +// throw new Exception("Scope is null or empty"); +// } +// +// if(!scope.startsWith(SCOPE_SEPARATOR)){ +// logger.warn("Input scope: "+scope+" not have / is a really scope?"); +// scope = SCOPE_SEPARATOR+scope; +// logger.warn("Tentative as scope: "+scope); +// } +// +// String[] splitScope = scope.split(SCOPE_SEPARATOR); +// +// String rootScope = SCOPE_SEPARATOR + splitScope[1]; +// +// if(rootScope.length()<2){ +// throw new Exception("Infrastructure name not found in "+scope); +// } +// +// return rootScope; +// +// } } diff --git a/src/main/java/org/gcube/datatransfer/resolver/gis/GeoRuntimeReader.java b/src/main/java/org/gcube/datatransfer/resolver/gis/GeoRuntimeReader.java index d8c1857..2799cc1 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/gis/GeoRuntimeReader.java +++ b/src/main/java/org/gcube/datatransfer/resolver/gis/GeoRuntimeReader.java @@ -40,13 +40,15 @@ public class GeoRuntimeReader { { ServerParameters parameters = new ServerParameters(); - + String originalScope = null; try{ boolean isGeoserver = geoservice.equals(GEO_SERVICE.GEOSERVER); String resourceName = isGeoserver ? GEOSERVER_RESOURCE_NAME : GEONETWORK_RESOURCE_NAME; + originalScope = ScopeProvider.instance.get(); + ScopeProvider.instance.set(scope); SimpleQuery query = queryFor(ServiceEndpoint.class); @@ -91,8 +93,13 @@ public class GeoRuntimeReader { }catch (Exception e) { logger.error("Sorry, an error occurred on reading parameters in Runtime Resources",e); }finally{ - logger.info("Resetting scope provider..."); - ScopeProvider.instance.reset(); + if(originalScope!=null && !originalScope.isEmpty()){ + ScopeProvider.instance.set(originalScope); + logger.info("scope provider setted to orginal scope: "+originalScope); + }else{ + ScopeProvider.instance.reset(); + logger.info("scope provider reset"); + } } return parameters; diff --git a/src/main/java/org/gcube/datatransfer/resolver/gis/GeonetworkInstance.java b/src/main/java/org/gcube/datatransfer/resolver/gis/GeonetworkInstance.java index f0c3227..336238b 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/gis/GeonetworkInstance.java +++ b/src/main/java/org/gcube/datatransfer/resolver/gis/GeonetworkInstance.java @@ -68,7 +68,9 @@ public class GeonetworkInstance { public GeonetworkInstance(String scope, boolean authenticate, LoginLevel level) throws GeonetworkInstanceException { logger.debug("Instancing GeonetworkInstance with scope: "+scope + ", authenticate: "+authenticate +", login level: "+level); this.scope = scope; + String originalScope = null; try { + originalScope = ScopeProvider.instance.get(); ScopeProvider.instance.set(scope); logger.info("setting scope "+scope); createInstanceGeonetworkPublisher(authenticate, level); @@ -77,8 +79,13 @@ public class GeonetworkInstance { logger.warn(message, e); throw new GeonetworkInstanceException(message); }finally{ - logger.info("resetting scope"); - ScopeProvider.instance.reset(); + if(originalScope!=null && !originalScope.isEmpty()){ + ScopeProvider.instance.set(originalScope); + logger.info("scope provider setted to orginal scope: "+originalScope); + }else{ + ScopeProvider.instance.reset(); + logger.info("scope provider reset"); + } } } diff --git a/src/main/java/org/gcube/datatransfer/resolver/gis/GisResolver.java b/src/main/java/org/gcube/datatransfer/resolver/gis/GisResolver.java index 490c0bb..e405ca7 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/gis/GisResolver.java +++ b/src/main/java/org/gcube/datatransfer/resolver/gis/GisResolver.java @@ -19,7 +19,6 @@ import javax.servlet.http.HttpServletResponse; import org.apache.commons.io.IOUtils; import org.gcube.datatransfer.resolver.applicationprofile.ApplicationProfileReader; -import org.gcube.datatransfer.resolver.applicationprofile.ScopeUtil; import org.gcube.datatransfer.resolver.gis.GeoRuntimeReader.GEO_SERVICE; import org.gcube.datatransfer.resolver.gis.GeonetworkAccessParameter.GeonetworkLoginLevel; import org.gcube.datatransfer.resolver.gis.entity.ServerParameters; @@ -155,17 +154,16 @@ public class GisResolver extends HttpServlet{ if(cachedGisViewerApplHostname==null) reseCacheGisViewerApplicationHostname(); - String infra = ScopeUtil.getInfrastructureNameFromScope(scope); logger.info("Tentative of recovering gis viewer application hostname from cache for scope: "+scope); - String gisViewerAppHostname = cachedGisViewerApplHostname.get(infra); + String gisViewerAppHostname = cachedGisViewerApplHostname.get(scope); if(gisViewerAppHostname==null){ logger.info("Gis viewer application hostname is null, reading from application profile.."); if(gisViewerAppPropertyReader==null) resetGisViewerAppEndPoint(); - ApplicationProfileReader reader = new ApplicationProfileReader(infra, gisViewerAppPropertyReader.getGenericResource(), gisViewerAppPropertyReader.getAppId()); + ApplicationProfileReader reader = new ApplicationProfileReader(scope, gisViewerAppPropertyReader.getGenericResource(), gisViewerAppPropertyReader.getAppId()); String url = reader.getApplicationProfile().getUrl(); - cachedGisViewerApplHostname.put(infra, url); + cachedGisViewerApplHostname.put(scope, url); logger.info("Updated GisViewerApplication cache! Scope "+scope+" linking "+url); return url; }else @@ -363,7 +361,7 @@ public class GisResolver extends HttpServlet{ logger.trace("omitted contextPath: "+contextPath); return url.toString(); } - /* + public static void main(String[] args) { GisResolver gisResolver = new GisResolver(); String scope = "/gcube/devsec/devVRE"; @@ -388,5 +386,5 @@ public class GisResolver extends HttpServlet{ // TODO Auto-generated catch block e.printStackTrace(); } - }*/ + } } diff --git a/src/main/java/org/gcube/datatransfer/resolver/gis/geonetwork/GeonetworkResolver.java b/src/main/java/org/gcube/datatransfer/resolver/gis/geonetwork/GeonetworkResolver.java index 7a983f1..d5e3db3 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/gis/geonetwork/GeonetworkResolver.java +++ b/src/main/java/org/gcube/datatransfer/resolver/gis/geonetwork/GeonetworkResolver.java @@ -35,6 +35,7 @@ import org.gcube.datatransfer.resolver.gis.GeonetworkInstance; import org.gcube.datatransfer.resolver.gis.GeonetworkServiceInterface; import org.gcube.datatransfer.resolver.gis.entity.ServerParameters; import org.gcube.datatransfer.resolver.gis.exception.IllegalArgumentException; +import org.gcube.datatransfer.resolver.gis.geonetwork.HTTPCallsUtils.HttpResponse; import org.gcube.datatransfer.resolver.gis.util.GetResponseRecordFilter; import org.gcube.spatial.data.geonetwork.configuration.Configuration; import org.gcube.spatial.data.geonetwork.model.Account; @@ -153,19 +154,34 @@ public class GeonetworkResolver extends HttpServlet{ logger.trace("Purged query string from "+remainValue+" is: "+newQueryString); String gnGetlURL = newQueryString==null || newQueryString.isEmpty()? baseURL : baseURL+"?"+newQueryString; logger.info("Sending get request to URL: "+gnGetlURL); - String response = httpUtils.get(gnGetlURL); - logger.info("Response return Content-Type: "+httpUtils.getLastContentType()); - resp.setContentType(httpUtils.getLastContentType()); - InputStream in = IOUtils.toInputStream(response); - OutputStream out = resp.getOutputStream(); - try{ - int bytes = IOUtils.copy(in, out); - if(bytes==0) - logger.warn("ResponseBody is empty, returning empty resp"); - }catch(Exception e){ - logger.error("Error on copy response:", e); - }finally{ - IOUtils.closeQuietly(in); + HttpResponse response = httpUtils.get(gnGetlURL); + + switch(response.getStatus()){ + case HttpServletResponse.SC_OK: + + logger.info("Response return Content-Type: "+httpUtils.getLastContentType()); + resp.setContentType(httpUtils.getLastContentType()); + InputStream in = IOUtils.toInputStream(response.getResponse()); + OutputStream out = resp.getOutputStream(); + try{ + int bytes = IOUtils.copy(in, out); + if(bytes==0) + logger.warn("ResponseBody is empty, returning empty resp"); + }catch(Exception e){ + logger.error("Error on copy response:", e); + }finally{ + IOUtils.closeQuietly(in); + } + + break; + + case HttpServletResponse.SC_FORBIDDEN: + + sendError(resp, response.getStatus(), "Sorry, you are not authorized to perform this request"); + break; + + default: + sendError(resp, response.getStatus(), "Sorry, an error occurred on resolving geonetwork request with scope "+scopeValue); } } catch (IllegalArgumentException e){ @@ -252,6 +268,7 @@ public class GeonetworkResolver extends HttpServlet{ String noAuthentication = req.getParameter(PARAMETER_NO_AUTHENTICATION); boolean filterPublicMetadataIDsB = false; boolean noAuthenticationB = false; + String originalScope = null; if (scope == null || scope.equals("")) { logger.debug("Scope not found"); @@ -279,6 +296,8 @@ public class GeonetworkResolver extends HttpServlet{ GeonetworkServiceInterface gntwAccess = new GeonetworkAccessParameter(scope, null); GeonetworkInstance gnInstance = gntwAccess.getGeonetworkInstance(); + originalScope = ScopeProvider.instance.get(); + ScopeProvider.instance.set(scope); logger.info("set scope provider "+scope); Configuration config = gnInstance.getGeonetworkPublisher().getConfiguration(); @@ -380,8 +399,13 @@ public class GeonetworkResolver extends HttpServlet{ sendError(resp, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, error); return; }finally{ - ScopeProvider.instance.reset(); - logger.info("scope provider reset"); + if(originalScope!=null && !originalScope.isEmpty()){ + ScopeProvider.instance.set(originalScope); + logger.info("scope provider setted to orginal scope: "+originalScope); + }else{ + ScopeProvider.instance.reset(); + logger.info("scope provider reset"); + } } } diff --git a/src/main/java/org/gcube/datatransfer/resolver/gis/geonetwork/HTTPCallsUtils.java b/src/main/java/org/gcube/datatransfer/resolver/gis/geonetwork/HTTPCallsUtils.java index 09578cc..cbcb014 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/gis/geonetwork/HTTPCallsUtils.java +++ b/src/main/java/org/gcube/datatransfer/resolver/gis/geonetwork/HTTPCallsUtils.java @@ -130,7 +130,7 @@ public class HTTPCallsUtils { * @return The HTTP response as a String if the HTTP response code was 200 (OK). * @throws MalformedURLException the malformed url exception */ - public String get(String url) throws MalformedURLException { + public HttpResponse get(String url) throws MalformedURLException { GetMethod httpMethod = null; try { @@ -146,7 +146,7 @@ public class HTTPCallsUtils { logger.warn("ResponseBody is empty"); return null; } else { - return response; + return new HttpResponse(HttpStatus.SC_OK, response); } } else { logger.info("("+lastHttpStatus+") " + HttpStatus.getStatusText(lastHttpStatus) + " -- " + url ); @@ -160,13 +160,13 @@ public class HTTPCallsUtils { httpMethod.releaseConnection(); } - return null; + return new HttpResponse(lastHttpStatus, null); } /** * Show content type. * - * @param entity the entity + * @param method the new content type */ private void setContentType(HttpMethod method) { final Header contentTypeHeader=method.getResponseHeader("Content-Type"); @@ -174,6 +174,8 @@ public class HTTPCallsUtils { } /** + * Gets the last content type. + * * @return the lastContentType */ public String getLastContentType() { @@ -342,6 +344,7 @@ public class HTTPCallsUtils { * * @param url The URL where to connect to. * @param requestEntity The request to be sent. + * @param parameterMap the parameter map * @return The HTTP response as a String if the HTTP response code was 200 (OK). * the HTTP response or null on errors. */ @@ -667,4 +670,97 @@ public class HTTPCallsUtils { } } + + /** + * The Class HttpResponse. + * + * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it + * Sep 7, 2016 + */ + public class HttpResponse { + int status; + String response; + + /** + * Instantiates a new http response. + */ + public HttpResponse() { + + // TODO Auto-generated constructor stub + } + + /** + * Instantiates a new http response. + * + * @param status the status + * @param response the response + */ + public HttpResponse(int status, String response) { + + super(); + this.status = status; + this.response = response; + } + + + /** + * Gets the status. + * + * @return the status + */ + public int getStatus() { + + return status; + } + + + /** + * Gets the response. + * + * @return the response + */ + public String getResponse() { + + return response; + } + + + /** + * Sets the status. + * + * @param status the status to set + */ + public void setStatus(int status) { + + this.status = status; + } + + + /** + * Sets the response. + * + * @param response the response to set + */ + public void setResponse(String response) { + + this.response = response; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + + StringBuilder builder = new StringBuilder(); + builder.append("HttpResponse [status="); + builder.append(status); + builder.append(", response="); + builder.append(response); + builder.append("]"); + return builder.toString(); + } + + } + } diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index 0a61660..92b60a0 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -1,6 +1,15 @@ - - -

The URI resolver

-

See wiki page: URI Resolver gCube Wiki

- - + + + + + + + Page Redirection + + + + If you are not redirected automatically, follow the link to example + + \ No newline at end of file diff --git a/src/test/java/GeonetworkQueryTest.java b/src/test/java/GeonetworkQueryTest.java new file mode 100644 index 0000000..72946bb --- /dev/null +++ b/src/test/java/GeonetworkQueryTest.java @@ -0,0 +1,58 @@ +import it.geosolutions.geonetwork.util.GNSearchRequest; + +import org.gcube.common.scope.api.ScopeProvider; +import org.gcube.spatial.data.geonetwork.GeoNetwork; +import org.gcube.spatial.data.geonetwork.GeoNetworkReader; +import org.gcube.spatial.data.geonetwork.LoginLevel; +import org.junit.Test; + +/** + * + * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it + * Aug 31, 2016 + */ +public class GeonetworkQueryTest { + + private String[] scopes = {"/gcube/devsec/devVRE"}; + + private String[] scopesProd = {"/d4science.research-infrastructures.eu"}; + + @Test + public void getCount() throws Exception{ + try{ + for(String scope:scopes){ + ScopeProvider.instance.set(scope); + GeoNetworkReader reader=GeoNetwork.get(); + final GNSearchRequest req=new GNSearchRequest(); + // req.addParam("keyword", "Thredds"); + req.addParam(GNSearchRequest.Param.any,""); + int publicCount=reader.query(req).getCount(); + reader.login(LoginLevel.CKAN); + int totalCount=reader.query(req).getCount(); + System.out.println("SCOPE "+scope+" found "+totalCount+" (public : "+publicCount+", private :"+(totalCount-publicCount)+")"); + } + }catch(Exception e){ + e.printStackTrace(); + } + } + + +// @Test + public void getCountProd() throws Exception{ + try{ + for(String scope:scopesProd){ + ScopeProvider.instance.set(scope); + GeoNetworkReader reader=GeoNetwork.get(); + final GNSearchRequest req=new GNSearchRequest(); + // req.addParam("keyword", "Thredds"); + req.addParam(GNSearchRequest.Param.any,"Thredds"); + int publicCount=reader.query(req).getCount(); + reader.login(LoginLevel.SCOPE); + int totalCount=reader.query(req).getCount(); + System.out.println("SCOPE "+scope+" found "+totalCount+" (public : "+publicCount+", private :"+(totalCount-publicCount)+")"); + } + }catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/src/test/java/GisResolverTest.java b/src/test/java/GisResolverTest.java new file mode 100644 index 0000000..f0c8c18 --- /dev/null +++ b/src/test/java/GisResolverTest.java @@ -0,0 +1,39 @@ + + +/** + * + */ +/** + * + * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it + * Sep 7, 2016 + */ +public class GisResolverTest { + + +// public void resolve(){ +// GisResolver gisResolver = new GisResolver(); +// String scope = "/gcube/devsec/devVRE"; +// String UUID = "177e1c3c-4a22-4ad9-b015-bfc443d16cb8"; +// try { +// ServerParameters geonetworkParams = gisResolver.getCachedServerParameters(scope); +// String wmsRequest = gisResolver.getLayerWmsRequest(scope, UUID, geonetworkParams); +// System.out.println("Final url is: " + wmsRequest); +// wmsRequest = URLEncoder.encode(wmsRequest, UTF_8); +// System.out.println("Encoded WMS request is: " + wmsRequest); +// String gisPortletUrl = gisResolver.getGisViewerApplicationURL(scope); +// System.out.println("Gis Viewer Application url is: " + gisPortletUrl); +//// logger.info("WmsRequest is: " + wmsRequest); +//// wmsRequest = encodeURLWithParamDelimiter(wmsRequest); +//// logger.info("Encoded url is: " + wmsRequest); +//// wmsRequest = appendParamReplacement(wmsRequest); +// gisPortletUrl+="?wmsrequest="+wmsRequest; +// +// System.out.println(gisPortletUrl); +//// urlRedirect(req, resp, gisPortletUrl); +// } catch (Exception e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } +}