diff --git a/src/main/java/org/gcube/dataanalysis/StandardLocalExternalAlgorithm.java b/src/main/java/org/gcube/dataanalysis/StandardLocalExternalAlgorithm.java index 9de2de6..1f75cb7 100644 --- a/src/main/java/org/gcube/dataanalysis/StandardLocalExternalAlgorithm.java +++ b/src/main/java/org/gcube/dataanalysis/StandardLocalExternalAlgorithm.java @@ -8,8 +8,10 @@ import java.util.Map; import org.gcube.contentmanagement.lexicalmatcher.utils.AnalysisLogger; import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration; import org.gcube.dataanalysis.ecoengine.configuration.INFRASTRUCTURE; +import org.gcube.dataanalysis.ecoengine.datatypes.DatabaseType; import org.gcube.dataanalysis.ecoengine.datatypes.PrimitiveType; import org.gcube.dataanalysis.ecoengine.datatypes.StatisticalType; +import org.gcube.dataanalysis.ecoengine.datatypes.enumtypes.DatabaseParameters; import org.gcube.dataanalysis.ecoengine.datatypes.enumtypes.PrimitiveTypes; import org.gcube.dataanalysis.ecoengine.interfaces.Transducerer; import org.gcube.dataanalysis.ecoengine.utils.ResourceFactory; @@ -26,6 +28,15 @@ public abstract class StandardLocalExternalAlgorithm implements Transducerer { inputs.add(new PrimitiveType(Enum.class.getName(), itemsList, PrimitiveTypes.ENUMERATED, name, description, defaultvalue)); } + protected void addRemoteDatabaseInput(String name, String urlParameterName, String userParameterName, String passwordParameterName) { + inputs.add(new DatabaseType(DatabaseParameters.REMOTEDATABASERRNAME,name,"RR name")); + inputs.add(new DatabaseType(DatabaseParameters.REMOTEDATABASEURL,urlParameterName,"RR name")); + inputs.add(new DatabaseType(DatabaseParameters.REMOTEDATABASEUSERNAME,name,"RR name")); + inputs.add(new DatabaseType(DatabaseParameters.REMOTEDATABASEPASSWORD,name,"RR name")); + inputs.add(new DatabaseType(DatabaseParameters.REMOTEDATABASEDRIVER,name,"RR name")); + inputs.add(new DatabaseType(DatabaseParameters.REMOTEDATABASEDIALECT,name,"RR name")); + } + protected void addStringInput(String name, String description, String defaultvalue) { inputs.add(new PrimitiveType(String.class.getName(), null, PrimitiveTypes.STRING, name, description, defaultvalue)); } diff --git a/src/main/java/org/gcube/dataanalysis/fin/taxamatch/TaxaMatchTransducer.java b/src/main/java/org/gcube/dataanalysis/fin/taxamatch/TaxaMatchTransducer.java index 938926d..2058e9b 100644 --- a/src/main/java/org/gcube/dataanalysis/fin/taxamatch/TaxaMatchTransducer.java +++ b/src/main/java/org/gcube/dataanalysis/fin/taxamatch/TaxaMatchTransducer.java @@ -32,12 +32,17 @@ public class TaxaMatchTransducer extends StandardLocalExternalAlgorithm { String species = getInputParameter(Species); String genusOperator = getInputParameter(GenusOperator); String speciesOperator = getInputParameter(SpeciesOperator); - +/* String databaseIP = "biodiversity.db.i-marine.research-infrastructures.eu"; String databaseUser = "postgres"; String databasePwd = "0b1s@d4sc13nc3"; String databaseName = "fishbase"; - +*/ + String databaseIP = "biodiversity.db.i-marine.research-infrastructures.eu"; + String databaseUser = "postgres"; + String databasePwd = "0b1s@d4sc13nc3"; + String databaseName = "fishbase"; + log("Computing matching for " + genus + " " + species); log("With operators: " + genusOperator + " " + speciesOperator); if ((genus == null) || (species == null)) { @@ -76,6 +81,7 @@ public class TaxaMatchTransducer extends StandardLocalExternalAlgorithm { addStringInput(Species, "Species", "morhua"); addEnumerateInput(operators.values(), GenusOperator, "Comparison Operator for Genus", "" + operators.EQUAL); addEnumerateInput(operators.values(), SpeciesOperator, "Comparison Operator for Species", "" + operators.EQUAL); +// addRemoteDatabaseInput("FishBase"); } }