This commit is contained in:
Lucio Lelii 2017-10-20 16:09:20 +00:00
parent 585b132d0f
commit ebaf785934
4 changed files with 26 additions and 15 deletions

View File

@ -0,0 +1,10 @@
package org.gcube.dataanalysis.wps.statisticalmanager.synchserver.algorithms;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface AlgorithmClassification {
String value() default "Others";
}

View File

@ -39,9 +39,9 @@ import org.slf4j.LoggerFactory;
public class StatisticalTypeToWPSType { public class StatisticalTypeToWPSType {
private static Logger logger = LoggerFactory.getLogger(StatisticalTypeToWPSType.class); private static Logger logger = LoggerFactory.getLogger(StatisticalTypeToWPSType.class);
public static Properties templates; public static Properties templates;
static String ABSTRACT = "#ABSTRACT#"; static String ABSTRACT = "#ABSTRACT#";
static String TITLE = "#TITLE#"; static String TITLE = "#TITLE#";
@ -51,9 +51,9 @@ public class StatisticalTypeToWPSType {
static String ID = "#ID#"; static String ID = "#ID#";
static String IDMETHOD = "#IDMETHOD#"; static String IDMETHOD = "#IDMETHOD#";
static String METHOD_ORDER = "#ORDER_VALUE#"; static String METHOD_ORDER = "#ORDER_VALUE#";
private int orderValue = 0; private int orderValue = 0;
public LinkedHashMap<String, IOWPSInformation> inputSet = new LinkedHashMap<String, IOWPSInformation>(); public LinkedHashMap<String, IOWPSInformation> inputSet = new LinkedHashMap<String, IOWPSInformation>();
public LinkedHashMap<String, IOWPSInformation> outputSet = new LinkedHashMap<String, IOWPSInformation>(); public LinkedHashMap<String, IOWPSInformation> outputSet = new LinkedHashMap<String, IOWPSInformation>();
public List<File> generatedFiles = new ArrayList<File>(); public List<File> generatedFiles = new ArrayList<File>();
@ -72,9 +72,10 @@ public class StatisticalTypeToWPSType {
return; return;
templates = new Properties(); templates = new Properties();
InputStream is = this.getClass().getClassLoader().getResourceAsStream("templates/classtemplate.properties"); try(InputStream is = this.getClass().getClassLoader().getResourceAsStream("templates/classtemplate.properties"))
templates.load(is); {
is.close(); templates.load(is);
}
} }
public StatisticalTypeToWPSType() throws Exception { public StatisticalTypeToWPSType() throws Exception {
@ -180,7 +181,7 @@ public class StatisticalTypeToWPSType {
String filenameDest = System.currentTimeMillis() + "_" + filename; String filenameDest = System.currentTimeMillis() + "_" + filename;
String destinationfile = new File(webpersistence, filenameDest).getAbsolutePath(); String destinationfile = new File(webpersistence, filenameDest).getAbsolutePath();
logger.debug("Copying file into a temporary file: " + destinationfile); logger.debug("Copying file into a temporary file: " + destinationfile);
FileManager.fileCopy(originalfile, destinationfile); FileManager.fileCopy(originalfile, destinationfile);
content = config.getParam(ConfigurationManager.webpathVariable) + filenameDest; content = config.getParam(ConfigurationManager.webpathVariable) + filenameDest;
localcontent = destinationfile; localcontent = destinationfile;
@ -319,11 +320,11 @@ public class StatisticalTypeToWPSType {
return null; return null;
} else if (stype instanceof TablesList) { } else if (stype instanceof TablesList) {
outputType = "csvFile"; outputType = "csvFile";
// outputType = "string"; // outputType = "string";
String template = ((TablesList) stype).getTemplates().get(0).name(); String template = ((TablesList) stype).getTemplates().get(0).name();
abstractStr += " [a sequence of http links separated by | , each indicating a table in UTF-8 encoding following this template: " + mapper.linksMap.get(template) + "]"; abstractStr += " [a sequence of http links separated by | , each indicating a table in UTF-8 encoding following this template: " + mapper.linksMap.get(template) + "]";
mimeType = "text/csv"; mimeType = "text/csv";
// mimeType = "text/plain"; // mimeType = "text/plain";
} }
outputType += isinput ? "Input" : "Output"; outputType += isinput ? "Input" : "Output";
@ -368,9 +369,9 @@ public class StatisticalTypeToWPSType {
fw.close(); fw.close();
} }
/* /*
* enum a { A, B }; * enum a { A, B };
*/ */

View File

@ -22,7 +22,7 @@ public class AlgorithmTest {
@Test @Test
public void executeAlgorithmsFromFile() throws Exception{ public void executeAlgorithmsFromFile() throws Exception{
String env = "pre"; String env = "proto";
Properties prop = new Properties(); Properties prop = new Properties();
prop.load(AlgorithmTest.class.getResourceAsStream("/test_params.properties")); prop.load(AlgorithmTest.class.getResourceAsStream("/test_params.properties"));

View File

@ -173,7 +173,7 @@
{PROTOCOL}://{HOST}/wps/WebProcessingService?request=Execute&service=WPS&Version=1.0.0&gcube-token={TOKEN}&lang=en-US&Identifier=org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.WEB_APP_PUBLISHER&DataInputs=ZipFile={PROTOCOL}://goo.gl/dYQ089; {PROTOCOL}://{HOST}/wps/WebProcessingService?request=Execute&service=WPS&Version=1.0.0&gcube-token={TOKEN}&lang=en-US&Identifier=org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.WEB_APP_PUBLISHER&DataInputs=ZipFile={PROTOCOL}://goo.gl/dYQ089;
#ECOPATH_WITH_ECOSIM #ECOPATH_WITH_ECOSIM
{PROTOCOL}://{HOST}/wps/WebProcessingService?Request=DescribeProcess&Service=WPS&Version=1.0.0&gcube-token={TOKEN}&Identifier=org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.ECOPATH_WITH_ECOSIM {PROTOCOL}://{HOST}/wps/WebProcessingService?Request=DescribeProcess&Service=WPS&Version=1.0.0&gcube-token={TOKEN}&Identifier=org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.ECOPATH_WITH_ECOSIM
{PROTOCOL}://{HOST}/wps/WebProcessingService?request=Execute&service=WPS&Version=1.0.0&gcube-token={TOKEN}&lang=en-US&Identifier=org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.ECOPATH_WITH_ECOSIM&DataInputs=Model File={PROTOCOL}://data.d4science.org/eHFkNmhoSUwxMVpmcElhcUlmQUpWaWRGSjQzNkFXNElHbWJQNStIS0N6Yz0;Config File={PROTOCOL}://data.d4science.org/ZGFWaGc4NjUrQmRmcElhcUlmQUpWbTNVQjhqdUV3OWdHbWJQNStIS0N6Yz0; {PROTOCOL}://{HOST}/wps/WebProcessingService?request=Execute&service=WPS&Version=1.0.0&gcube-token={TOKEN}&lang=en-US&Identifier=org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.ECOPATH_WITH_ECOSIM&DataInputs=Model File=http://data.d4science.org/eHFkNmhoSUwxMVpmcElhcUlmQUpWaWRGSjQzNkFXNElHbWJQNStIS0N6Yz0;Config File=http://data.d4science.org/ZGFWaGc4NjUrQmRmcElhcUlmQUpWbTNVQjhqdUV3OWdHbWJQNStIS0N6Yz0;
#OCCURRENCES_MERGER #OCCURRENCES_MERGER
{PROTOCOL}://{HOST}/wps/WebProcessingService?Request=DescribeProcess&Service=WPS&Version=1.0.0&gcube-token={TOKEN}&Identifier=org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.generators.OCCURRENCES_MERGER {PROTOCOL}://{HOST}/wps/WebProcessingService?Request=DescribeProcess&Service=WPS&Version=1.0.0&gcube-token={TOKEN}&Identifier=org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.generators.OCCURRENCES_MERGER
{PROTOCOL}://{HOST}/wps/WebProcessingService?request=Execute&service=WPS&Version=1.0.0&gcube-token={TOKEN}&lang=en-US&Identifier=org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.generators.OCCURRENCES_MERGER&DataInputs=final_Table_Name=MergedOcc;leftTableName={PROTOCOL}://data.d4science.org/QkNIYVp1dm81bnhmcElhcUlmQUpWbzlqZWlDbXpmaytHbWJQNStIS0N6Yz0;rightTableName={PROTOCOL}://data.d4science.org/QkNIYVp1dm81bnhmcElhcUlmQUpWbzlqZWlDbXpmaytHbWJQNStIS0N6Yz0;longitudeColumn=decimalLongitude;latitudeColumn=decimalLatitude;recordedByColumn=recordedBy;scientificNameColumn=scientificName;eventDateColumn=eventDate;lastModificationColumn=modified;spatialTolerance=0.5;confidence=80; {PROTOCOL}://{HOST}/wps/WebProcessingService?request=Execute&service=WPS&Version=1.0.0&gcube-token={TOKEN}&lang=en-US&Identifier=org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.generators.OCCURRENCES_MERGER&DataInputs=final_Table_Name=MergedOcc;leftTableName={PROTOCOL}://data.d4science.org/QkNIYVp1dm81bnhmcElhcUlmQUpWbzlqZWlDbXpmaytHbWJQNStIS0N6Yz0;rightTableName={PROTOCOL}://data.d4science.org/QkNIYVp1dm81bnhmcElhcUlmQUpWbzlqZWlDbXpmaytHbWJQNStIS0N6Yz0;longitudeColumn=decimalLongitude;latitudeColumn=decimalLatitude;recordedByColumn=recordedBy;scientificNameColumn=scientificName;eventDateColumn=eventDate;lastModificationColumn=modified;spatialTolerance=0.5;confidence=80;