Use prod legacy IS coordinates

This commit is contained in:
Fabio Sinibaldi 2022-10-26 18:00:50 +02:00
parent f65edeea4e
commit 6244694f0d
1 changed files with 19 additions and 2 deletions

View File

@ -4,15 +4,20 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.gcube.application.cms.tests.TokenSetter; import org.gcube.application.cms.tests.TokenSetter;
import org.gcube.application.geoportal.client.legacy.ConcessioniManagerI; import org.gcube.application.geoportal.client.legacy.ConcessioniManagerI;
import org.gcube.application.geoportal.client.legacy.MongoConcessioniPlugin;
import org.gcube.application.geoportal.client.legacy.StatefulMongoConcessioniPlugin;
import org.gcube.application.geoportal.client.plugins.GeoportalAbstractPlugin;
import org.gcube.application.geoportal.client.utils.Serialization; import org.gcube.application.geoportal.client.utils.Serialization;
import org.gcube.application.geoportal.common.model.legacy.AssociatedContent; import org.gcube.application.geoportal.common.model.legacy.AssociatedContent;
import org.gcube.application.geoportal.common.model.legacy.Concessione; import org.gcube.application.geoportal.common.model.legacy.Concessione;
import org.gcube.application.geoportal.common.model.legacy.PersistedContent; import org.gcube.application.geoportal.common.model.legacy.PersistedContent;
import org.gcube.application.geoportal.common.model.legacy.WorkspaceContent; import org.gcube.application.geoportal.common.model.legacy.WorkspaceContent;
import org.gcube.common.clients.ProxyBuilderImpl;
import org.gcube.common.storagehub.client.dsl.FileContainer; import org.gcube.common.storagehub.client.dsl.FileContainer;
import org.gcube.common.storagehub.client.dsl.StorageHubClient; import org.gcube.common.storagehub.client.dsl.StorageHubClient;
import org.gcube.common.storagehub.model.exceptions.StorageHubException; import org.gcube.common.storagehub.model.exceptions.StorageHubException;
import javax.ws.rs.client.WebTarget;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
@ -36,10 +41,11 @@ public class Import {
File dir=new File("import"+System.currentTimeMillis()); File dir=new File("import"+System.currentTimeMillis());
dir.mkdirs(); dir.mkdirs();
String sourceContext="/d4science.research-infrastructures.eu/D4OS/GeoNA-Prototype"; String sourceContext="/d4science.research-infrastructures.eu/D4OS/GNA";
// String sourceContext="/pred4s/preprod/preVRE"; // String sourceContext="/pred4s/preprod/preVRE";
Boolean saveFilesLocally=false; Boolean saveFilesLocally=false;
@ -48,8 +54,19 @@ public class Import {
StorageHubClient sgClient=new StorageHubClient(); StorageHubClient sgClient=new StorageHubClient();
// need to override IS coordinates
StatefulMongoConcessioniPlugin stateful_mongo_concessioni_plugin= new StatefulMongoConcessioniPlugin(){
@Override
public String serviceClass(){return "Application";}
@Override
public String serviceName(){return "GeoPortal";}
};;
ConcessioniManagerI sourceManager= new ProxyBuilderImpl<WebTarget, ConcessioniManagerI>(stateful_mongo_concessioni_plugin).build();
ConcessioniManagerI sourceManager= statefulMongoConcessioni().build();
ArrayList<Concessione> found=new ArrayList<>(); ArrayList<Concessione> found=new ArrayList<>();
Map<String,String> errors = new HashMap<>(); Map<String,String> errors = new HashMap<>();