38 lines
1.4 KiB
Java
38 lines
1.4 KiB
Java
package org.gcube.application.perform.service;
|
|
|
|
import java.io.IOException;
|
|
import java.net.MalformedURLException;
|
|
import java.nio.file.Paths;
|
|
import java.sql.SQLException;
|
|
import java.util.Arrays;
|
|
|
|
import org.gcube.application.perform.service.engine.PerformanceManager;
|
|
import org.gcube.application.perform.service.engine.impl.ExportCSVQuery;
|
|
import org.gcube.application.perform.service.engine.impl.PerformanceManagerImpl;
|
|
import org.gcube.application.perform.service.engine.model.CSVExportRequest;
|
|
import org.gcube.application.perform.service.engine.model.InternalException;
|
|
import org.gcube.application.perform.service.engine.model.importer.AnalysisType;
|
|
|
|
public class LoadSchemaTest {
|
|
|
|
public static void main(String[] args) throws MalformedURLException, IOException, SQLException, InternalException {
|
|
LocalConfiguration.init(Paths.get("src/main/webapp/WEB-INF/config.properties").toUri().toURL());
|
|
|
|
PerformServiceLifecycleManager.initSchema("src/main/webapp/WEB-INF");
|
|
|
|
TokenSetter.set("/gcube/preprod/preVRE");
|
|
PerformanceManagerImpl.initDatabase();
|
|
|
|
|
|
PerformanceManager mng =new PerformanceManagerImpl();
|
|
CSVExportRequest req=new CSVExportRequest(new AnalysisType("GROW_OUT_AGGREGATED", "GROW_OUT_AGGREGATED"));
|
|
req.addAreas(Arrays.asList("A1","A2"));
|
|
req.addFarmId(12682549l);
|
|
req.addPeriods(Arrays.asList("p1"));
|
|
req.addSpecies(Arrays.asList("Gadidae"));
|
|
|
|
System.out.println(mng.generateCSV(req));
|
|
}
|
|
|
|
}
|