Task #17166 Fixing CSS for synoptic table and fixing allyears for FARM
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-transfer/uri-resolver@181231 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
0976438699
commit
636d05f435
|
@ -149,7 +149,14 @@
|
||||||
<Change>[Incident #16671] Fixing Catalogue Resolver in case of working
|
<Change>[Incident #16671] Fixing Catalogue Resolver in case of working
|
||||||
with INFRASTRUCTURE and VO scope
|
with INFRASTRUCTURE and VO scope
|
||||||
</Change>
|
</Change>
|
||||||
<Change>[Incident #16713] GN harvesting from CKAN does not work properly
|
<Change>[Incident #16713] GN harvesting from CKAN does not work
|
||||||
|
properly
|
||||||
|
</Change>
|
||||||
|
</Changeset>
|
||||||
|
<Changeset
|
||||||
|
component="org.gcube.data-transfer.uri-resolver.2-1-1"
|
||||||
|
date="${buildDate}">
|
||||||
|
<Change>[Incident #17180] Bug fixes
|
||||||
</Change>
|
</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
</ReleaseNotes>
|
</ReleaseNotes>
|
4
pom.xml
4
pom.xml
|
@ -9,9 +9,9 @@
|
||||||
</parent>
|
</parent>
|
||||||
<groupId>org.gcube.data.transfer</groupId>
|
<groupId>org.gcube.data.transfer</groupId>
|
||||||
<artifactId>uri-resolver</artifactId>
|
<artifactId>uri-resolver</artifactId>
|
||||||
<version>2.1.0-SNAPSHOT</version>
|
<version>2.1.1-SNAPSHOT</version>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
<description>The URI Resolver is an HTTP URI resolver implemented as an REST service which gives access trough HTTP to different gcube Resolvers and gCube Applications. </description>
|
<description>The URI Resolver is an HTTP URI resolver implemented as an REST service which gives access trough HTTP to different gcube Resolvers and gCube Applications.</description>
|
||||||
|
|
||||||
<scm>
|
<scm>
|
||||||
<connection>scm:svn:http://svn.d4science.research-infrastructures.eu/gcube/trunk/data-transfer/${project.artifactId}</connection>
|
<connection>scm:svn:http://svn.d4science.research-infrastructures.eu/gcube/trunk/data-transfer/${project.artifactId}</connection>
|
||||||
|
|
|
@ -26,6 +26,7 @@ import org.gcube.datatransfer.resolver.gis.entity.GisLayerItem;
|
||||||
import org.gcube.datatransfer.resolver.gis.exception.GeonetworkInstanceException;
|
import org.gcube.datatransfer.resolver.gis.exception.GeonetworkInstanceException;
|
||||||
import org.gcube.datatransfer.resolver.init.UriResolverSmartGearManagerInit;
|
import org.gcube.datatransfer.resolver.init.UriResolverSmartGearManagerInit;
|
||||||
import org.gcube.datatransfer.resolver.services.error.ExceptionManager;
|
import org.gcube.datatransfer.resolver.services.error.ExceptionManager;
|
||||||
|
import org.gcube.spatial.data.geonetwork.LoginLevel;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
@ -192,18 +193,23 @@ public class GisResolver {
|
||||||
* @return the gis layer for layer uuid
|
* @return the gis layer for layer uuid
|
||||||
* @throws Exception the exception
|
* @throws Exception the exception
|
||||||
*/
|
*/
|
||||||
protected GisLayerItem getGisLayerForLayerUUID(HttpServletRequest req, String scope, String gisUUID) throws Exception{
|
public GisLayerItem getGisLayerForLayerUUID(HttpServletRequest req, String scope, String gisUUID) throws Exception{
|
||||||
|
|
||||||
try {
|
try {
|
||||||
GeonetworkInstance gi = null;
|
GeonetworkInstance gi = null;
|
||||||
try {
|
try {
|
||||||
gi = LoadingGeonetworkInstanceCache.get(scope);
|
gi = LoadingGeonetworkInstanceCache.get(scope);
|
||||||
|
|
||||||
}catch(ExecutionException | InvalidCacheLoadException e){
|
}catch(ExecutionException | InvalidCacheLoadException e){
|
||||||
logger.error("Error on getting the Geonetwork Instance from cache for scope "+scope, e);
|
logger.error("Error on getting the Geonetwork Instance from cache for scope "+scope, e);
|
||||||
throw ExceptionManager.wrongParameterException(req, "Error on getting the Geonetwork Instance from cache for scope "+scope+". Is it registered for this scope: "+scope+"?", this.getClass(), help);
|
throw ExceptionManager.wrongParameterException(req, "Error on getting the Geonetwork Instance from cache for scope "+scope+". Is it registered for this scope: "+scope+"?", this.getClass(), help);
|
||||||
}
|
}
|
||||||
if(gi==null)
|
if(gi==null)
|
||||||
throw new Exception("GeonetworkInstance not instanciable in the scope: "+scope);
|
throw new Exception("GeonetworkInstance not instanciable in the scope: "+scope);
|
||||||
|
|
||||||
|
LoginLevel toLoginLevel = LoginLevel.SCOPE;
|
||||||
|
logger.info("Performing authentication on GN with "+LoginLevel.class.getSimpleName()+" "+toLoginLevel);
|
||||||
|
gi.getGeonetworkPublisher().login(toLoginLevel);
|
||||||
|
|
||||||
GisLayerItem gisLayerItem = MetadataConverter.getWMSOnLineResource(gi, gisUUID);
|
GisLayerItem gisLayerItem = MetadataConverter.getWMSOnLineResource(gi, gisUUID);
|
||||||
return gisLayerItem;
|
return gisLayerItem;
|
||||||
|
|
|
@ -23,7 +23,7 @@ public class CatalogueResolverTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
ScopeProvider.instance.set("/d4science.research-infrastructures.eu");
|
ScopeProvider.instance.set("/d4science.research-infrastructures.eu/gCubeApps/BiodiversityLab");
|
||||||
//ScopeProvider.instance.set("/d4science.research-infrastructures.eu");
|
//ScopeProvider.instance.set("/d4science.research-infrastructures.eu");
|
||||||
GatewayCKANCatalogueReference ckanCatalogueReference = CkanCatalogueConfigurationsReader.loadCatalogueEndPoints();
|
GatewayCKANCatalogueReference ckanCatalogueReference = CkanCatalogueConfigurationsReader.loadCatalogueEndPoints();
|
||||||
System.out.println(ckanCatalogueReference.toString());
|
System.out.println(ckanCatalogueReference.toString());
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
import org.gcube.common.scope.api.ScopeProvider;
|
||||||
|
import org.gcube.datatransfer.resolver.gis.entity.GisLayerItem;
|
||||||
|
import org.gcube.datatransfer.resolver.services.GisResolver;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -10,31 +11,44 @@
|
||||||
* Sep 7, 2016
|
* Sep 7, 2016
|
||||||
*/
|
*/
|
||||||
public class GisResolverTest {
|
public class GisResolverTest {
|
||||||
|
|
||||||
|
static String scope = "/d4science.research-infrastructures.eu/gCubeApps/BiodiversityLab";
|
||||||
/*public void resolve(){
|
static String gisUUID = "6b99efdf-2202-4b6f-aaa3-7e10e0bf09f4";
|
||||||
|
public static void main(String[] args) {
|
||||||
GisResolver gisResolver = new GisResolver();
|
GisResolver gisResolver = new GisResolver();
|
||||||
String scope = "/gcube/devsec/devVRE";
|
ScopeProvider.instance.set(scope);
|
||||||
String UUID = "177e1c3c-4a22-4ad9-b015-bfc443d16cb8";
|
//ServerParameters geonetworkParams = getCachedServerParameters(scope);
|
||||||
try {
|
try {
|
||||||
ServerParameters geonetworkParams = gisResolver.getCachedServerParameters(scope);
|
GisLayerItem gisLayerItem = gisResolver.getGisLayerForLayerUUID(null, scope, gisUUID);
|
||||||
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) {
|
} catch (Exception e) {
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 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();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue