Enhancements on Override for public ids during geonetwork harvesting
Updated pom version at 1.8.0 git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-transfer/uri-resolver@130913 82a268e6-3cf1-43bd-a215-b396298e98cffeature/18038
parent
44eeedec96
commit
406af9e14d
@ -0,0 +1,51 @@
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
/**
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Jul 29, 2016
|
||||
*/
|
||||
public class GeonetworkMefServiceTest {
|
||||
|
||||
/*
|
||||
public static void main(String[] args) throws ServletException {
|
||||
|
||||
String path = "/geonetwork/gcube_devsec_devVRE/srv/en/mef.export";
|
||||
String queryString = "p1=1&p2=2";
|
||||
String pathWithoutGN = path.substring(SERVLET_GEONETWORK.length()+1, path.length());
|
||||
logger.debug("servlet path without "+SERVLET_GEONETWORK + " is:" +pathWithoutGN);
|
||||
String[] params = pathWithoutGN.split("/");
|
||||
|
||||
System.out.println(Arrays.asList(params));
|
||||
|
||||
if(params[0]==null || params[0].isEmpty()){
|
||||
logger.error("Scope is null or empty, you must set a valid scope /geonetwork/root_vo_vre");
|
||||
throw new ServletException("Scope is null or empty, you must set a valid scope /geonetwork/root_vo_vre");
|
||||
}
|
||||
|
||||
String scopeValue = getScope(params[0]);
|
||||
logger.debug("scope value is: "+scopeValue);
|
||||
String newURI = SERVLET_GEONETWORK + "?" + GeonetworkResolver.SCOPE + "=" + scopeValue;
|
||||
|
||||
if(params.length>1){
|
||||
String remainPath = "";
|
||||
// newURI +="&remainPath=";
|
||||
for (int i = 1; i < params.length; i++) {
|
||||
String httpGetParam = params[i];
|
||||
if(httpGetParam!=null && !httpGetParam.isEmpty())
|
||||
remainPath+="/"+httpGetParam;
|
||||
}
|
||||
|
||||
newURI +="&"+GeonetworkResolver.REMAIN_PATH+"="+remainPath;
|
||||
}
|
||||
|
||||
|
||||
if(queryString!=null && !queryString.isEmpty())
|
||||
newURI+="&"+queryString;
|
||||
|
||||
logger.debug("forward "+newURI);
|
||||
}*/
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
import javax.servlet.ServletException;
|
||||
|
||||
import org.gcube.datatransfer.resolver.GeonetworkRequestDecoder;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
/**
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Jul 27, 2016
|
||||
*/
|
||||
public class GeonetworkRequestDecoderTest {
|
||||
|
||||
|
||||
//@Test
|
||||
public void test1() throws ServletException{
|
||||
String request = "/geonetwork/gcube_devsec_devVRE#filterpublicids";
|
||||
System.out.println("Testing request: "+request);
|
||||
GeonetworkRequestDecoder gd = new GeonetworkRequestDecoder(request,"");
|
||||
System.out.println(gd);
|
||||
}
|
||||
|
||||
//@Test
|
||||
public void test2() throws ServletException{
|
||||
String request = "/geonetwork/gcube_devsec_devVRE#noauthentication";
|
||||
System.out.println("Testing request: "+request);
|
||||
GeonetworkRequestDecoder gd = new GeonetworkRequestDecoder(request,"");
|
||||
System.out.println(gd);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void test3() throws ServletException{
|
||||
String request = "/gcube_devsec";
|
||||
System.out.println("Testing request: "+request);
|
||||
GeonetworkRequestDecoder gd = new GeonetworkRequestDecoder(request,"");
|
||||
System.out.println(gd);
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue