Updated Boolean support

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/data-miner-manager-cl@134519 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2016-11-22 13:32:47 +00:00
parent aa26b7fc9d
commit 7cda53e606
4 changed files with 29 additions and 15 deletions

View File

@ -70,7 +70,7 @@ public abstract class SClient implements Serializable{
throws Exception; throws Exception;
/** /**
* Cance a computation * Cancel a computation
* *
* @param computationId computation Id * @param computationId computation Id
* @return * @return

View File

@ -190,9 +190,15 @@ public class WPS2DM {
guessPrimitiveType(guessedType), defaultValue); guessPrimitiveType(guessedType), defaultValue);
} }
} else } else {
converted = new ListParameter(id, title, String.class.getName(), if(guessedType.compareTo(Boolean.class.getName())==0){
converted = new ObjectParameter(id, title, guessedType, defaultValue);
} else {
converted = new ListParameter(id, title, String.class.getName(),
SEPARATOR); SEPARATOR);
}
}
return converted; return converted;
} }
@ -401,9 +407,14 @@ public class WPS2DM {
} }
if (values.length > 1) { if (values.length > 1) {
ObjectParameter conv = (ObjectParameter) converted; ObjectParameter conv = (ObjectParameter) converted;
converted = new EnumParameter(conv.getName(), if (conv.getType() != null
conv.getDescription(), enumValues, && !conv.getType().isEmpty()
conv.getDefaultValue()); && conv.getType().compareToIgnoreCase(
Boolean.class.getName()) != 0){
converted = new EnumParameter(conv.getName(),
conv.getDescription(), enumValues,
conv.getDefaultValue());
}
} }
} }
} else if (wpsType.isSetComplexData()) { } else if (wpsType.isSetComplexData()) {
@ -525,6 +536,9 @@ public class WPS2DM {
return Long.class.getName(); return Long.class.getName();
else if (typeS.contains("short")) else if (typeS.contains("short"))
return Short.class.getName(); return Short.class.getName();
else if (typeS.contains("boolean"))
return Boolean.class.getName();
} }
return String.class.getName(); return String.class.getName();
@ -538,6 +552,7 @@ public class WPS2DM {
} }
public static String guessPrimitiveType(String type) { public static String guessPrimitiveType(String type) {
if (type.equals(Integer.class.getName())) { if (type.equals(Integer.class.getName())) {
return Integer.class.getName(); return Integer.class.getName();
} else if (type.equals(String.class.getName())) { } else if (type.equals(String.class.getName())) {

View File

@ -19,7 +19,7 @@ public class Resource implements Serializable {
private static final long serialVersionUID = 1417885805472591661L; private static final long serialVersionUID = 1417885805472591661L;
public enum ResourceType { public enum ResourceType {
OBJECT, FILE, TABULAR, MAP, IMAGE, ERROR OBJECT, FILE, TABULAR, MAP, IMAGE
}; };
private String resourceId, name, description; private String resourceId, name, description;
@ -128,9 +128,7 @@ public class Resource implements Serializable {
return this.resourceType == ResourceType.IMAGE; return this.resourceType == ResourceType.IMAGE;
} }
public boolean isError() {
return this.resourceType == ResourceType.ERROR;
}
@Override @Override
public String toString() { public String toString() {

View File

@ -60,7 +60,7 @@ public class BionymLocalTest extends TestCase {
.startComputation(operator); .startComputation(operator);
logger.debug("Started ComputationId: " + computationId); logger.debug("Started ComputationId: " + computationId);
monitoringComputation(computationId, sClient); monitoringComputation(computationId, sClient);
} }
assertTrue("Success", true); assertTrue("Success", true);
@ -159,15 +159,16 @@ public class BionymLocalTest extends TestCase {
EnumParameter parserName=new EnumParameter(); EnumParameter parserName=new EnumParameter();
parserName.setName("Parser_Name"); parserName.setName("Parser_Name");
parserName.setValue("SIMPLE"); parserName.setValue("SIMPLE");
EnumParameter activatePreparsingProcessing=new EnumParameter(); ObjectParameter activatePreparsingProcessing = new ObjectParameter();
activatePreparsingProcessing.setName("Activate_Preparsing_Processing"); activatePreparsingProcessing.setName("Activate_Preparsing_Processing");
activatePreparsingProcessing.setValue("true"); activatePreparsingProcessing.setValue("true");
EnumParameter useStemmedGenusAndSpecies=new EnumParameter(); ObjectParameter useStemmedGenusAndSpecies=new ObjectParameter();
useStemmedGenusAndSpecies.setName("Use_Stemmed_Genus_and_Species"); useStemmedGenusAndSpecies.setName("Use_Stemmed_Genus_and_Species");
useStemmedGenusAndSpecies.setValue("false"); useStemmedGenusAndSpecies.setValue("false");
EnumParameter accuracyVsSpeed=new EnumParameter(); EnumParameter accuracyVsSpeed=new EnumParameter();
accuracyVsSpeed.setName("Accuracy_vs_Speed"); accuracyVsSpeed.setName("Accuracy_vs_Speed");
accuracyVsSpeed.setValue("MAX_ACCURACY"); accuracyVsSpeed.setValue("MAX_ACCURACY");