diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/ColumnListParameter.java b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/ColumnListParameter.java new file mode 100644 index 0000000..be50bd7 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/ColumnListParameter.java @@ -0,0 +1,68 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.shared.parameters; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + + +/** + * @author ceras + * + */ +public class ColumnListParameter extends Parameter implements Serializable { + + private static final long serialVersionUID = -6743494426144267089L; + String referredTabularParameterName; + List columnNames = new ArrayList(); + String value; + private String separator; + + public ColumnListParameter() { + super(); + this.typology = ParameterTypology.COLUMN_LIST; + } + + public ColumnListParameter(String name, String description, String referredTabularParameterName, String separator) { + super(name, ParameterTypology.COLUMN_LIST, description); + this.referredTabularParameterName = referredTabularParameterName; + this.separator = separator; + } + + /** + * @param referredTabularParameterName the referredTabularParameterName to set + */ + public void setReferredTabularParameterName(String referredTabularParameterName) { + this.referredTabularParameterName = referredTabularParameterName; + } + + /** + * @return the referredTabularParameterName + */ + public String getReferredTabularParameterName() { + return referredTabularParameterName; + } + + /** + * @return the value + */ + public String getValue() { + return value; + } + + + @Override + public void setValue(String value) { + this.value = value; + } + + /** + * @return the separator + */ + public String getSeparator() { + return separator; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/ColumnParameter.java b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/ColumnParameter.java new file mode 100644 index 0000000..f9c0b9b --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/ColumnParameter.java @@ -0,0 +1,82 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.shared.parameters; + +import java.io.Serializable; + + +/** + * @author ceras + * + */ +public class ColumnParameter extends Parameter implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -5084557326770554659L; + String referredTabularParameterName; + String defaultColumn; + String value; + + /** + * + */ + public ColumnParameter() { + super(); + this.typology = ParameterTypology.COLUMN; + } + + /** + * + */ + public ColumnParameter(String name, String description, String referredTabularParameterName, String defaultColumn) { + super(name, ParameterTypology.COLUMN, description); + this.referredTabularParameterName = referredTabularParameterName; + this.defaultColumn = defaultColumn; + } + + /** + * @param referredTabularParameterName the referredTabularParameterName to set + */ + public void setReferredTabularParameterName( + String referredTabularParameterName) { + this.referredTabularParameterName = referredTabularParameterName; + } + + /** + * @return the referredTabularParameterName + */ + public String getReferredTabularParameterName() { + return referredTabularParameterName; + } + + /** + * @return the defaultValue + */ + public String getDefaultColumn() { + return defaultColumn; + } + + /** + * @param defaultValue the defaultValue to set + */ + public void setDefaultColumn(String defaultColumn) { + this.defaultColumn = defaultColumn; + } + + /** + * @return the value + */ + public String getValue() { + return value; + } + + + @Override + public void setValue(String value) { + this.value = value; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/EnumParameter.java b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/EnumParameter.java new file mode 100644 index 0000000..546538c --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/EnumParameter.java @@ -0,0 +1,89 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.shared.parameters; + +import java.util.ArrayList; +import java.util.List; + +import com.google.gwt.user.client.rpc.IsSerializable; + +/** + * @author ceras + * + */ +public class EnumParameter extends Parameter implements IsSerializable { + + private static final long serialVersionUID = 1673874854501249519L; + List values = new ArrayList(); + String defaultValue; + String value; + + + /** + * + */ + public EnumParameter() { + super(); + this.typology = ParameterTypology.ENUM; + } + + /** + * @param type + * @param defaultValue + * @param value + */ + public EnumParameter(String name, String description, List values, String defaultValue) { + super(name, ParameterTypology.ENUM, description); + this.values = values; + this.defaultValue = defaultValue; + } + + + /** + * @return the defaultValue + */ + public String getDefaultValue() { + return defaultValue; + } + + /** + * @param defaultValue the defaultValue to set + */ + public void setDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + } + + /** + * @param values the values to set + */ + public void setValues(List values) { + this.values = values; + } + + /** + * @return the values + */ + public List getValues() { + return values; + } + + public void addValue(String value) { + this.values.add(value); + } + + /** + * @return the value + */ + @Override + public String getValue() { + return value; + } + + + @Override + public void setValue(String value) { + this.value = value; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/FileParameter.java b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/FileParameter.java new file mode 100644 index 0000000..4b31bcc --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/FileParameter.java @@ -0,0 +1,81 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.shared.parameters; + +import java.util.ArrayList; + +import com.google.gwt.user.client.rpc.IsSerializable; + +/** + * @author ceras + * + */ +public class FileParameter extends Parameter implements IsSerializable { + + private static final long serialVersionUID = -2967577990287112937L; + private String value; + private String defaultMimeType; + private ArrayList supportedMimeTypes; + /** + * + */ + public FileParameter() { + super(); + this.typology = ParameterTypology.FILE; + } + + /** + * + * @param name + * @param description + * @param fileName + * @param mimeType + */ + public FileParameter(String name, String description, String defaultMimeType, ArrayList supportedMimeTypes) { + super(name, ParameterTypology.FILE, description); + this.defaultMimeType = defaultMimeType; + this.supportedMimeTypes = supportedMimeTypes; + } + + public String getDefaultMimeType() { + return defaultMimeType; + } + + public void setDefaultMimeType(String defaultMimeType) { + this.defaultMimeType = defaultMimeType; + } + + public ArrayList getSupportedMimeTypes() { + return supportedMimeTypes; + } + + public void setSupportedMimeTypes(ArrayList supportedMimeTypes) { + this.supportedMimeTypes = supportedMimeTypes; + } + + /** + * + */ + public String getValue() { + return value; + } + + /** + * + */ + @Override + public void setValue(String value) { + this.value=value; + } + + @Override + public String toString() { + return "FileParameter [value=" + value + ", defaultMimeType=" + + defaultMimeType + ", supportedMimeTypes=" + + supportedMimeTypes + "]"; + } + + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/ListParameter.java b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/ListParameter.java new file mode 100644 index 0000000..e36d8aa --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/ListParameter.java @@ -0,0 +1,81 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.shared.parameters; + +import com.google.gwt.user.client.rpc.IsSerializable; + + +/** + * @author ceras + * + */ +public class ListParameter extends Parameter implements IsSerializable { + + private static final long serialVersionUID = 5405965026753332225L; + private String type; + private String value; + private String separator; + + /** + * + */ + public ListParameter() { + super(); + this.typology = ParameterTypology.LIST; + } + + /** + * @param defaultValue + * @param value + */ + public ListParameter(String name, String description, String type, String separator) { + super(name, ParameterTypology.LIST, description); + this.type = type; + this.separator = separator; + } + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + + + @Override + public void setValue(String value) { + this.value = value; + } + + + @Override + public String getValue() { + return value; + } + + /** + * @return the separator + */ + public String getSeparator() { + return separator; + } + + @Override + public String toString() { + return "ListParameter [type=" + type + ", value=" + value + + ", separator=" + separator + ", name=" + name + + ", description=" + description + ", typology=" + typology + + "]"; + } + + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/ObjectParameter.java b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/ObjectParameter.java new file mode 100644 index 0000000..0b5ad83 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/ObjectParameter.java @@ -0,0 +1,88 @@ + +package org.gcube.portlets.user.dataminermanager.shared.parameters; + +import com.google.gwt.user.client.rpc.IsSerializable; + +/** + * @author ceras + * + */ +public class ObjectParameter extends Parameter implements IsSerializable { + + private static final long serialVersionUID = 1058462575242430851L; + private String type; + private String defaultValue; + private String value; + + + /** + * + */ + public ObjectParameter() { + super(); + this.typology = ParameterTypology.OBJECT; + } + + + public ObjectParameter(String name, String description, String type, String defaultValue) { + super(name, ParameterTypology.OBJECT, description); + this.type = type; + this.defaultValue = defaultValue; + } + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + + /** + * @return the defaultValue + */ + public String getDefaultValue() { + return defaultValue; + } + + /** + * @param defaultValue the defaultValue to set + */ + public void setDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + } + + /** + * @return the value + */ + public String getValue() { + return value; + } + + + @Override + public void setValue(String value) { + this.value = value; + } + + + @Override + public String toString() { + return "ObjectParameter [type=" + type + ", defaultValue=" + + defaultValue + ", value=" + value + ", name=" + name + + ", description=" + description + ", typology=" + typology + + "]"; + } + + + + + + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/Parameter.java b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/Parameter.java new file mode 100644 index 0000000..d9c0cd8 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/Parameter.java @@ -0,0 +1,130 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.shared.parameters; + +import java.io.Serializable; + +/** + * + * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * + */ +public abstract class Parameter implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -555286289487491703L; + + public enum ParameterTypology { + OBJECT, TABULAR, FILE, ENUM, LIST, COLUMN, COLUMN_LIST, TABULAR_LIST + }; + + protected String name; + protected String description; + protected ParameterTypology typology; + + /** + * + */ + public Parameter() { + super(); + } + + /** + * @param name + * @param type + * @param description + * @param defaultValue + * @param value + */ + public Parameter(String name, ParameterTypology type, String description) { + super(); + this.name = name; + this.typology = type; + this.description = description; + } + + public abstract void setValue(String value); + + public abstract String getValue(); + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * @return the typology + */ + public ParameterTypology getTypology() { + return typology; + } + + /** + * @param typology + * the typology to set + */ + public void setTypology(ParameterTypology typology) { + this.typology = typology; + } + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * @param description + * the description to set + */ + public void setDescription(String description) { + this.description = description; + } + + public boolean isObject() { + return this.typology == ParameterTypology.OBJECT; + } + + public boolean isTabular() { + return this.typology == ParameterTypology.TABULAR; + } + + public boolean isFile() { + return this.typology == ParameterTypology.FILE; + } + + public boolean isEnum() { + return this.typology == ParameterTypology.ENUM; + } + + public boolean isList() { + return this.typology == ParameterTypology.LIST; + } + + public boolean isColumn() { + return this.typology == ParameterTypology.COLUMN; + } + + public boolean isColumnList() { + return this.typology == ParameterTypology.COLUMN_LIST; + } + + public boolean isTabularList() { + return this.typology == ParameterTypology.TABULAR_LIST; + } + + @Override + public String toString() { + return "Parameter [name=" + name + ", description=" + description + + ", typology=" + typology + "]"; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/TabularListParameter.java b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/TabularListParameter.java new file mode 100644 index 0000000..b3ce06f --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/TabularListParameter.java @@ -0,0 +1,106 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.shared.parameters; + +import java.io.Serializable; +import java.util.ArrayList; + +/** + * @author ceras + * + */ +public class TabularListParameter extends Parameter implements Serializable { + + private static final long serialVersionUID = -1786477950530892502L; + private String value; + private String separator; + private ArrayList templates = new ArrayList(); + private String defaultMimeType; + private ArrayList supportedMimeTypes; + + // private List tableNames = new ArrayList(); + + public TabularListParameter() { + super(); + this.typology = ParameterTypology.TABULAR_LIST; + } + + /** + * @param defaultValue + * @param value + */ + public TabularListParameter(String name, String description, + String separator, String defaultMimeType, + ArrayList supportedMimeTypes) { + super(name, ParameterTypology.TABULAR_LIST, description); + this.separator = separator; + this.defaultMimeType = defaultMimeType; + this.supportedMimeTypes = supportedMimeTypes; + } + + @Override + public void setValue(String value) { + this.value = value; + } + + @Override + public String getValue() { + return value; + } + + /** + * @return the separator + */ + public String getSeparator() { + return separator; + } + + /** + * @param templates + * the templates to set + */ + public void setTemplates(ArrayList templates) { + this.templates = templates; + } + + /** + * @return the templates + */ + public ArrayList getTemplates() { + return templates; + } + + public void addTemplate(String template) { + templates.add(template); + } + + public String getDefaultMimeType() { + return defaultMimeType; + } + + public void setDefaultMimeType(String defaultMimeType) { + this.defaultMimeType = defaultMimeType; + } + + public ArrayList getSupportedMimeTypes() { + return supportedMimeTypes; + } + + public void setSupportedMimeTypes(ArrayList supportedMimeTypes) { + this.supportedMimeTypes = supportedMimeTypes; + } + + public void setSeparator(String separator) { + this.separator = separator; + } + + @Override + public String toString() { + return "TabularListParameter [value=" + value + ", separator=" + + separator + ", templates=" + templates + ", defaultMimeType=" + + defaultMimeType + ", supportedMimeTypes=" + + supportedMimeTypes + "]"; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/TabularParameter.java b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/TabularParameter.java new file mode 100644 index 0000000..56ba1a6 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/shared/parameters/TabularParameter.java @@ -0,0 +1,113 @@ +/** + * + */ +package org.gcube.portlets.user.dataminermanager.shared.parameters; + +import java.io.Serializable; +import java.util.ArrayList; + +/** + * + * @author Giancarlo Panichi + * email: g.panichi@isti.cnr.it + * + */ +public class TabularParameter extends Parameter implements Serializable { + + private static final long serialVersionUID = 8038591467145151553L; + private String tableName; + private ArrayList templates = new ArrayList(); + private String defaultMimeType; + private ArrayList supportedMimeTypes; + + /** + * + */ + public TabularParameter() { + super(); + this.typology = ParameterTypology.TABULAR; + } + + /** + * + * @param name + * @param description + * @param tableName + */ + public TabularParameter(String name, String description, String tableName, + String defaultMimeType, ArrayList supportedMimeTypes) { + super(name, ParameterTypology.TABULAR, description); + this.tableName = tableName; + this.templates = null; + this.defaultMimeType = defaultMimeType; + this.supportedMimeTypes = supportedMimeTypes; + } + + /** + * + * @param name + * @param description + * @param tableName + * @param templates + */ + public TabularParameter(String name, String description, String tableName, + ArrayList templates, String defaultMimeType, + ArrayList supportedMimeTypes) { + super(name, ParameterTypology.TABULAR, description); + this.tableName = tableName; + this.templates = templates; + this.defaultMimeType = defaultMimeType; + this.supportedMimeTypes = supportedMimeTypes; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public ArrayList getTemplates() { + return templates; + } + + public void setTemplates(ArrayList templates) { + this.templates = templates; + } + + @Override + public String getValue() { + return getTableName(); + } + + @Override + public void setValue(String value) { + this.setTableName(value); + } + + public String getDefaultMimeType() { + return defaultMimeType; + } + + public void setDefaultMimeType(String defaultMimeType) { + this.defaultMimeType = defaultMimeType; + } + + public ArrayList getSupportedMimeTypes() { + return supportedMimeTypes; + } + + public void setSupportedMimeTypes(ArrayList supportedMimeTypes) { + this.supportedMimeTypes = supportedMimeTypes; + } + + @Override + public String toString() { + return "TabularParameter [tableName=" + tableName + ", templates=" + + templates + ", defaultMimeType=" + defaultMimeType + + ", supportedMimeTypes=" + supportedMimeTypes + "]"; + } + + +}