2521: Explore the possibility to port the StatMan interface onto Dataminer

https://support.d4science.org/issues/2521

Fixed TableListParameter layout 

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/data-miner-manager@128443 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2016-05-03 16:03:00 +00:00
parent c964cc69ad
commit 199039a0e0
21 changed files with 567301 additions and 335421 deletions

View File

@ -3,6 +3,8 @@
*/ */
package org.gcube.portlets.user.dataminermanager.client.bean.parameters; package org.gcube.portlets.user.dataminermanager.client.bean.parameters;
import java.util.ArrayList;
import com.google.gwt.user.client.rpc.IsSerializable; import com.google.gwt.user.client.rpc.IsSerializable;
/** /**
@ -12,9 +14,9 @@ import com.google.gwt.user.client.rpc.IsSerializable;
public class FileParameter extends Parameter implements IsSerializable { public class FileParameter extends Parameter implements IsSerializable {
private static final long serialVersionUID = -2967577990287112937L; private static final long serialVersionUID = -2967577990287112937L;
private String mimeType;
private String value; private String value;
private String defaultMimeType;
private ArrayList<String> supportedMimeTypes;
/** /**
* *
*/ */
@ -30,20 +32,27 @@ public class FileParameter extends Parameter implements IsSerializable {
* @param fileName * @param fileName
* @param mimeType * @param mimeType
*/ */
public FileParameter(String name, String description, String mimeType) { public FileParameter(String name, String description, String defaultMimeType, ArrayList<String> supportedMimeTypes) {
super(name, ParameterTypology.FILE, description); super(name, ParameterTypology.FILE, description);
this.mimeType = mimeType; this.defaultMimeType = defaultMimeType;
this.supportedMimeTypes = supportedMimeTypes;
} }
public String getMimeType() { public String getDefaultMimeType() {
return mimeType; return defaultMimeType;
} }
public void setMimeType(String mimeType) { public void setDefaultMimeType(String defaultMimeType) {
this.mimeType = mimeType; this.defaultMimeType = defaultMimeType;
} }
public ArrayList<String> getSupportedMimeTypes() {
return supportedMimeTypes;
}
public void setSupportedMimeTypes(ArrayList<String> supportedMimeTypes) {
this.supportedMimeTypes = supportedMimeTypes;
}
/** /**
* *
@ -62,10 +71,11 @@ public class FileParameter extends Parameter implements IsSerializable {
@Override @Override
public String toString() { public String toString() {
return "FileParameter [mimeType=" + mimeType + ", value=" + value return "FileParameter [value=" + value + ", defaultMimeType="
+ ", name=" + name + ", description=" + description + defaultMimeType + ", supportedMimeTypes="
+ ", typology=" + typology + "]"; + supportedMimeTypes + "]";
} }
} }

View File

@ -5,26 +5,27 @@ package org.gcube.portlets.user.dataminermanager.client.bean.parameters;
import java.io.Serializable; import java.io.Serializable;
/** /**
* *
* @author Giancarlo Panichi * @author Giancarlo Panichi email: <a
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a> * href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* *
*/ */
public abstract class Parameter implements Serializable { public abstract class Parameter implements Serializable {
/** /**
* *
*/ */
private static final long serialVersionUID = -555286289487491703L; private static final long serialVersionUID = -555286289487491703L;
public enum ParameterTypology {OBJECT, TABULAR, FILE, ENUM, LIST, COLUMN, COLUMN_LIST, TABULAR_LIST};
public enum ParameterTypology {
String name; OBJECT, TABULAR, FILE, ENUM, LIST, COLUMN, COLUMN_LIST, TABULAR_LIST
String description; };
ParameterTypology typology;
protected String name;
protected String description;
protected ParameterTypology typology;
/** /**
* *
*/ */
@ -49,17 +50,11 @@ public abstract class Parameter implements Serializable {
public abstract void setValue(String value); public abstract void setValue(String value);
public abstract String getValue(); public abstract String getValue();
/**
* @return the name
*/
public String getName() { public String getName() {
return name; return name;
} }
/**
* @param name the name to set
*/
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
@ -70,14 +65,15 @@ public abstract class Parameter implements Serializable {
public ParameterTypology getTypology() { public ParameterTypology getTypology() {
return typology; return typology;
} }
/** /**
* @param typology the typology to set * @param typology
* the typology to set
*/ */
public void setTypology(ParameterTypology typology) { public void setTypology(ParameterTypology typology) {
this.typology = typology; this.typology = typology;
} }
/** /**
* @return the description * @return the description
*/ */
@ -86,12 +82,13 @@ public abstract class Parameter implements Serializable {
} }
/** /**
* @param description the description to set * @param description
* the description to set
*/ */
public void setDescription(String description) { public void setDescription(String description) {
this.description = description; this.description = description;
} }
public boolean isObject() { public boolean isObject() {
return this.typology == ParameterTypology.OBJECT; return this.typology == ParameterTypology.OBJECT;
} }
@ -107,19 +104,19 @@ public abstract class Parameter implements Serializable {
public boolean isEnum() { public boolean isEnum() {
return this.typology == ParameterTypology.ENUM; return this.typology == ParameterTypology.ENUM;
} }
public boolean isList() { public boolean isList() {
return this.typology == ParameterTypology.LIST; return this.typology == ParameterTypology.LIST;
} }
public boolean isColumn() { public boolean isColumn() {
return this.typology == ParameterTypology.COLUMN; return this.typology == ParameterTypology.COLUMN;
} }
public boolean isColumnList() { public boolean isColumnList() {
return this.typology == ParameterTypology.COLUMN_LIST; return this.typology == ParameterTypology.COLUMN_LIST;
} }
public boolean isTabularList() { public boolean isTabularList() {
return this.typology == ParameterTypology.TABULAR_LIST; return this.typology == ParameterTypology.TABULAR_LIST;
} }
@ -129,7 +126,5 @@ public abstract class Parameter implements Serializable {
return "Parameter [name=" + name + ", description=" + description return "Parameter [name=" + name + ", description=" + description
+ ", typology=" + typology + "]"; + ", typology=" + typology + "]";
} }
} }

View File

@ -6,7 +6,6 @@ package org.gcube.portlets.user.dataminermanager.client.bean.parameters;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
/** /**
* @author ceras * @author ceras
* *
@ -17,8 +16,10 @@ public class TabularListParameter extends Parameter implements Serializable {
private String value; private String value;
private String separator; private String separator;
private ArrayList<String> templates = new ArrayList<String>(); private ArrayList<String> templates = new ArrayList<String>();
//private List<String> tableNames = new ArrayList<String>(); private String defaultMimeType;
private ArrayList<String> supportedMimeTypes;
// private List<String> tableNames = new ArrayList<String>();
public TabularListParameter() { public TabularListParameter() {
super(); super();
@ -29,57 +30,77 @@ public class TabularListParameter extends Parameter implements Serializable {
* @param defaultValue * @param defaultValue
* @param value * @param value
*/ */
public TabularListParameter(String name, String description, String separator) { public TabularListParameter(String name, String description,
String separator, String defaultMimeType,
ArrayList<String> supportedMimeTypes) {
super(name, ParameterTypology.TABULAR_LIST, description); super(name, ParameterTypology.TABULAR_LIST, description);
this.separator = separator; this.separator = separator;
this.defaultMimeType = defaultMimeType;
this.supportedMimeTypes = supportedMimeTypes;
} }
@Override @Override
public void setValue(String value) { public void setValue(String value) {
this.value = value; this.value = value;
} }
@Override @Override
public String getValue() { public String getValue() {
return value; return value;
} }
/** /**
* @return the separator * @return the separator
*/ */
public String getSeparator() { public String getSeparator() {
return separator; return separator;
} }
/** /**
* @param templates the templates to set * @param templates
* the templates to set
*/ */
public void setTemplates(ArrayList<String> templates) { public void setTemplates(ArrayList<String> templates) {
this.templates = templates; this.templates = templates;
} }
/** /**
* @return the templates * @return the templates
*/ */
public ArrayList<String> getTemplates() { public ArrayList<String> getTemplates() {
return templates; return templates;
} }
public void addTemplate(String template) { public void addTemplate(String template) {
templates.add(template); templates.add(template);
} }
public String getDefaultMimeType() {
return defaultMimeType;
}
public void setDefaultMimeType(String defaultMimeType) {
this.defaultMimeType = defaultMimeType;
}
public ArrayList<String> getSupportedMimeTypes() {
return supportedMimeTypes;
}
public void setSupportedMimeTypes(ArrayList<String> supportedMimeTypes) {
this.supportedMimeTypes = supportedMimeTypes;
}
public void setSeparator(String separator) {
this.separator = separator;
}
@Override @Override
public String toString() { public String toString() {
return "TabularListParameter [value=" + value + ", separator=" return "TabularListParameter [value=" + value + ", separator="
+ separator + ", templates=" + templates + ", name=" + name + separator + ", templates=" + templates + ", defaultMimeType="
+ ", description=" + description + ", typology=" + typology + defaultMimeType + ", supportedMimeTypes="
+ "]"; + supportedMimeTypes + "]";
} }
} }

View File

@ -7,7 +7,9 @@ import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
/** /**
* @author ceras *
* @author Giancarlo Panichi
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* *
*/ */
public class TabularParameter extends Parameter implements Serializable { public class TabularParameter extends Parameter implements Serializable {
@ -15,6 +17,8 @@ public class TabularParameter extends Parameter implements Serializable {
private static final long serialVersionUID = 8038591467145151553L; private static final long serialVersionUID = 8038591467145151553L;
private String tableName; private String tableName;
private ArrayList<String> templates = new ArrayList<String>(); private ArrayList<String> templates = new ArrayList<String>();
private String defaultMimeType;
private ArrayList<String> supportedMimeTypes;
/** /**
* *
@ -24,17 +28,19 @@ public class TabularParameter extends Parameter implements Serializable {
this.typology = ParameterTypology.TABULAR; this.typology = ParameterTypology.TABULAR;
} }
/** /**
* *
* @param name * @param name
* @param description * @param description
* @param tableName * @param tableName
*/ */
public TabularParameter(String name, String description, String tableName) { public TabularParameter(String name, String description, String tableName,
String defaultMimeType, ArrayList<String> supportedMimeTypes) {
super(name, ParameterTypology.TABULAR, description); super(name, ParameterTypology.TABULAR, description);
this.tableName = tableName; this.tableName = tableName;
this.templates = null; this.templates = null;
this.defaultMimeType = defaultMimeType;
this.supportedMimeTypes = supportedMimeTypes;
} }
/** /**
@ -45,10 +51,13 @@ public class TabularParameter extends Parameter implements Serializable {
* @param templates * @param templates
*/ */
public TabularParameter(String name, String description, String tableName, public TabularParameter(String name, String description, String tableName,
ArrayList<String> templates) { ArrayList<String> templates, String defaultMimeType,
ArrayList<String> supportedMimeTypes) {
super(name, ParameterTypology.TABULAR, description); super(name, ParameterTypology.TABULAR, description);
this.tableName = tableName; this.tableName = tableName;
this.templates = templates; this.templates = templates;
this.defaultMimeType = defaultMimeType;
this.supportedMimeTypes = supportedMimeTypes;
} }
public String getTableName() { public String getTableName() {
@ -77,11 +86,28 @@ public class TabularParameter extends Parameter implements Serializable {
this.setTableName(value); this.setTableName(value);
} }
public String getDefaultMimeType() {
return defaultMimeType;
}
public void setDefaultMimeType(String defaultMimeType) {
this.defaultMimeType = defaultMimeType;
}
public ArrayList<String> getSupportedMimeTypes() {
return supportedMimeTypes;
}
public void setSupportedMimeTypes(ArrayList<String> supportedMimeTypes) {
this.supportedMimeTypes = supportedMimeTypes;
}
@Override @Override
public String toString() { public String toString() {
return "TabularParameter [tableName=" + tableName + ", templates=" return "TabularParameter [tableName=" + tableName + ", templates="
+ templates + ", name=" + name + ", description=" + description + templates + ", defaultMimeType=" + defaultMimeType
+ ", typology=" + typology + "]"; + ", supportedMimeTypes=" + supportedMimeTypes + "]";
} }
} }

View File

@ -0,0 +1,18 @@
package org.gcube.portlets.user.dataminermanager.client.custom;
import com.sencha.gxt.cell.core.client.ProgressBarCell;
import com.sencha.gxt.widget.core.client.ProgressBar;
/**
*
* @author Giancarlo Panichi email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class GreenProgressBar extends ProgressBar {
public GreenProgressBar() {
super(new ProgressBarCell(new GreenProgressBarAppaearance()));
}
}

View File

@ -0,0 +1,18 @@
package org.gcube.portlets.user.dataminermanager.client.custom;
import com.sencha.gxt.cell.core.client.ProgressBarCell;
import com.sencha.gxt.widget.core.client.ProgressBar;
/**
*
* @author Giancarlo Panichi email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class RedProgressBar extends ProgressBar {
public RedProgressBar() {
super(new ProgressBarCell(new RedProgressBarAppaearance()));
}
}

View File

@ -47,6 +47,7 @@ public class ComputationPanel extends FramedPanel implements HasComputationReady
create(); create();
} }
private void init() { private void init() {
setHeaderVisible(false); setHeaderVisible(false);
setBodyStyle("backgroundColor:white;"); setBodyStyle("backgroundColor:white;");

View File

@ -220,7 +220,7 @@ public class ComputationParametersPanel extends SimpleContainer {
OperatorFieldWidget fieldWidget = new OperatorFieldWidget(p); OperatorFieldWidget fieldWidget = new OperatorFieldWidget(p);
fieldWidgetsMap.put(p.getName(), fieldWidget); fieldWidgetsMap.put(p.getName(), fieldWidget);
vParameters.add(fieldWidget.getParameterLabel(), vParameters.add(fieldWidget.getParameterLabel(),
new VerticalLayoutData(1, -1, new Margins())); new VerticalLayoutData(1, -1, new Margins(0)));
} }
for (Parameter p : operator.getOperatorParameters()) { for (Parameter p : operator.getOperatorParameters()) {
@ -266,7 +266,9 @@ public class ComputationParametersPanel extends SimpleContainer {
} }
parametersPanel.getElement().getStyle().setPaddingBottom(0, Unit.PX); parametersPanel.getElement().getStyle().setPaddingBottom(0, Unit.PX);
submit.setVisible(true); submit.setVisible(true);
parametersPanel.forceLayout();
forceLayout(); forceLayout();
} catch (Throwable e) { } catch (Throwable e) {
Log.error("Error in show form:" + e.getLocalizedMessage()); Log.error("Error in show form:" + e.getLocalizedMessage());
e.printStackTrace(); e.printStackTrace();

View File

@ -9,8 +9,8 @@ import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus;
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus.Status; import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus.Status;
import org.gcube.portlets.user.dataminermanager.client.bean.Operator; import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider; import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider;
import org.gcube.portlets.user.dataminermanager.client.custom.GreenProgressBarAppaearance; import org.gcube.portlets.user.dataminermanager.client.custom.GreenProgressBar;
import org.gcube.portlets.user.dataminermanager.client.custom.RedProgressBarAppaearance; import org.gcube.portlets.user.dataminermanager.client.custom.RedProgressBar;
import org.gcube.portlets.user.dataminermanager.client.events.CancelComputationExecutionRequestEvent; import org.gcube.portlets.user.dataminermanager.client.events.CancelComputationExecutionRequestEvent;
import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync; import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync;
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3; import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
@ -22,7 +22,6 @@ import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.i18n.client.NumberFormat; import com.google.gwt.i18n.client.NumberFormat;
import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.rpc.AsyncCallback;
import com.sencha.gxt.cell.core.client.ProgressBarCell;
import com.sencha.gxt.core.client.util.Margins; import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.widget.core.client.ProgressBar; import com.sencha.gxt.widget.core.client.ProgressBar;
import com.sencha.gxt.widget.core.client.button.TextButton; import com.sencha.gxt.widget.core.client.button.TextButton;
@ -134,8 +133,7 @@ public class ComputationStatusPanel extends SimpleContainer {
int index=vert.getWidgetIndex(progressBar); int index=vert.getWidgetIndex(progressBar);
vert.remove(index); vert.remove(index);
//TODO //TODO
ProgressBarCell cell=new ProgressBarCell(new GreenProgressBarAppaearance()); progressBar =new GreenProgressBar();
progressBar =new ProgressBar(cell);
progressBar.updateProgress(1, "Computation Complete"); progressBar.updateProgress(1, "Computation Complete");
progressBar.addStyleName("progressBar-complete"); progressBar.addStyleName("progressBar-complete");
vert.insert(progressBar, index, new VerticalLayoutData(1, -1, new Margins(20))); vert.insert(progressBar, index, new VerticalLayoutData(1, -1, new Margins(20)));
@ -155,8 +153,7 @@ public class ComputationStatusPanel extends SimpleContainer {
int index=vert.getWidgetIndex(progressBar); int index=vert.getWidgetIndex(progressBar);
vert.remove(index); vert.remove(index);
//TODO //TODO
ProgressBarCell cell=new ProgressBarCell(new RedProgressBarAppaearance()); progressBar =new RedProgressBar();
progressBar =new ProgressBar(cell);
progressBar.updateProgress(1, "Computation Fail"); progressBar.updateProgress(1, "Computation Fail");
progressBar.getElement().getStyle().setMarginBottom(36, Unit.PX); progressBar.getElement().getStyle().setMarginBottom(36, Unit.PX);
progressBar.addStyleName("progressBar-failed"); progressBar.addStyleName("progressBar-failed");
@ -207,8 +204,7 @@ public class ComputationStatusPanel extends SimpleContainer {
int index=vert.getWidgetIndex(progressBar); int index=vert.getWidgetIndex(progressBar);
vert.remove(index); vert.remove(index);
//TODO //TODO
ProgressBarCell cell=new ProgressBarCell(new RedProgressBarAppaearance()); progressBar =new RedProgressBar();
progressBar =new ProgressBar(cell);
progressBar.updateProgress(1, "Failed to get the status"); progressBar.updateProgress(1, "Failed to get the status");
progressBar.getElement().getStyle().setMarginBottom(36, Unit.PX); progressBar.getElement().getStyle().setMarginBottom(36, Unit.PX);
progressBar.addStyleName("progressBar-failed"); progressBar.addStyleName("progressBar-failed");

View File

@ -5,6 +5,7 @@ package org.gcube.portlets.user.dataminermanager.client.parametersfield;
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter; import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter;
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
import org.gcube.portlets.user.dataminermanager.shared.StringUtil;
import com.google.gwt.user.client.ui.Widget; import com.google.gwt.user.client.ui.Widget;
import com.sencha.gxt.core.client.util.Margins; import com.sencha.gxt.core.client.util.Margins;
@ -43,7 +44,7 @@ public class BooleanFld extends AbstractFld {
.equals("FALSE")); .equals("FALSE"));
else else
checkBox.setValue(false); checkBox.setValue(false);
checkBox.setBoxLabel(p.getName()); checkBox.setBoxLabel(StringUtil.getCapitalWords(p.getName()));
HtmlLayoutContainer descr; HtmlLayoutContainer descr;

View File

@ -66,6 +66,7 @@ public class EnumFld extends AbstractFld {
horiz.add(descr, new BoxLayoutData(new Margins())); horiz.add(descr, new BoxLayoutData(new Margins()));
fieldContainer.add(horiz); fieldContainer.add(horiz);
fieldContainer.forceLayout();
} }

View File

@ -6,14 +6,12 @@ package org.gcube.portlets.user.dataminermanager.client.parametersfield;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ListParameter; import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ListParameter;
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter; import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter;
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
import com.google.gwt.user.client.ui.Widget; import com.google.gwt.user.client.ui.Widget;
import com.sencha.gxt.core.client.util.Margins; import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData; import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutPack; import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutPack;
import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer; import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer;
@ -21,9 +19,6 @@ import com.sencha.gxt.widget.core.client.container.HtmlLayoutContainer;
import com.sencha.gxt.widget.core.client.container.MarginData; import com.sencha.gxt.widget.core.client.container.MarginData;
import com.sencha.gxt.widget.core.client.container.SimpleContainer; import com.sencha.gxt.widget.core.client.container.SimpleContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.form.TextField;
/** /**
* *
@ -37,7 +32,7 @@ public class ListStringFld extends AbstractFld {
private HBoxLayoutContainer horiz; private HBoxLayoutContainer horiz;
private SimpleContainer listContainer; private SimpleContainer listContainer;
private VerticalLayoutContainer vp; private VerticalLayoutContainer vp;
private List<Item> items; private List<StringItem> items;
private ListParameter listParameter; private ListParameter listParameter;
/** /**
@ -51,8 +46,7 @@ public class ListStringFld extends AbstractFld {
listContainer = new SimpleContainer(); listContainer = new SimpleContainer();
vp = new VerticalLayoutContainer(); vp = new VerticalLayoutContainer();
items = new ArrayList<Item>(); items = new ArrayList<StringItem>();
addField(null);
listContainer.add(vp, new MarginData(new Margins())); listContainer.add(vp, new MarginData(new Margins()));
fieldContainer = new SimpleContainer(); fieldContainer = new SimpleContainer();
@ -77,47 +71,61 @@ public class ListStringFld extends AbstractFld {
horiz.add(descr, new BoxLayoutData(new Margins(0))); horiz.add(descr, new BoxLayoutData(new Margins(0)));
fieldContainer.add(horiz); fieldContainer.add(horiz);
fieldContainer.forceLayout(); addField(null);
} }
private void addField(Item upperItem) { protected void addField(StringItem upperItem) {
ObjectParameter objPar = new ObjectParameter(listParameter.getName(), ObjectParameter objPar = new ObjectParameter(listParameter.getName(),
listParameter.getDescription(), listParameter.getType(), null); listParameter.getDescription(), listParameter.getType(), null);
if (upperItem == null) { if (upperItem == null) {
Item item = new Item(objPar, true); StringItem item = new StringItem(this, objPar, true);
items.add(item); items.add(item);
vp.add(item, new VerticalLayoutData(1, -1, new Margins())); vp.add(item);
} else { } else {
// search the position of the upper item // search the position of the upper item
int pos = 0; int pos = items.indexOf(upperItem);
for (int i = 0; i < items.size(); i++) if (pos > -1) {
if (items.get(i) == upperItem) { upperItem.showCancelButton();
pos = i; upperItem.forceLayout();
break; StringItem item = new StringItem(this, objPar, false);
} items.add(pos + 1, item);
vp.insert(item, pos + 1);//don't use new VerticalLayoutData(1, -1,new Margins(0))
upperItem.showCancelButton(); } else {
Item item = new Item(objPar, false); upperItem.forceLayout();
items.add(pos + 1, item); StringItem item = new StringItem(this, objPar, true);
vp.insert(item, pos + 1); items.add(item);
vp.add(item);//don't use new VerticalLayoutData(-1, -1, new Margins(0))
}
} }
forceLayout();
} }
protected void forceLayout(){
vp.forceLayout();
horiz.forceLayout();
fieldContainer.forceLayout();
}
/** /**
* @param item * @param item
*/ */
protected void removeField(Item item) { protected void removeField(StringItem item) {
items.remove(item); items.remove(item);
vp.remove(item); vp.remove(item);
if (items.size() == 1) { if (items.size() == 1) {
items.get(0).hideCancelButton(); items.get(0).hideCancelButton();
items.get(0).forceLayout();
} }
forceLayout();
} }
/** /**
@ -128,7 +136,7 @@ public class ListStringFld extends AbstractFld {
String separator = listParameter.getSeparator(); String separator = listParameter.getSeparator();
String value = ""; String value = "";
boolean first = true; boolean first = true;
for (Item item : items) { for (StringItem item : items) {
String itemValue = item.getValue(); String itemValue = item.getValue();
if (itemValue != null && !itemValue.contentEquals("")) { if (itemValue != null && !itemValue.contentEquals("")) {
value += (first ? "" : separator) + itemValue; value += (first ? "" : separator) + itemValue;
@ -152,7 +160,7 @@ public class ListStringFld extends AbstractFld {
@Override @Override
public boolean isValid() { public boolean isValid() {
boolean valid = false; boolean valid = false;
for (Item item : items) for (StringItem item : items)
if (item.isValid()) { if (item.isValid()) {
valid = true; valid = true;
break; break;
@ -160,80 +168,6 @@ public class ListStringFld extends AbstractFld {
return valid; return valid;
} }
private class Item extends HBoxLayoutContainer {
private TextField field;
private TextButton addBtn;
private TextButton removeBtn;
/**
* @param objPar
*/
public Item(ObjectParameter objectParameter, boolean first) {
super();
field = new TextField();
field.setAllowBlank(false);
addBtn = new TextButton("");
addBtn.setIcon(DataMinerManager.resources.add());
addBtn.addSelectHandler(new SelectEvent.SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
addField(Item.this);
forceLayout();
vp.forceLayout();
fieldContainer.forceLayout();
}
});
removeBtn = new TextButton("");
removeBtn.setIcon(DataMinerManager.resources.cancel());
removeBtn.addSelectHandler(new SelectEvent.SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
removeField(Item.this);
forceLayout();
vp.forceLayout();
fieldContainer.forceLayout();
}
});
removeBtn.setVisible(!first);
setPack(BoxLayoutPack.START);
setEnableOverflow(false);
add(field, new BoxLayoutData(new Margins()));
add(addBtn, new BoxLayoutData(new Margins()));
add(removeBtn, new BoxLayoutData(new Margins()));
forceLayout();
}
public void showCancelButton() {
removeBtn.setVisible(true);
}
public void hideCancelButton() {
removeBtn.setVisible(false);
}
public String getValue() {
return field.getCurrentValue();
}
public boolean isValid() {
return field.isValid();
}
}
} }

View File

@ -6,6 +6,7 @@ package org.gcube.portlets.user.dataminermanager.client.parametersfield;
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ListParameter; import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ListParameter;
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter; import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter;
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
import org.gcube.portlets.user.dataminermanager.shared.StringUtil;
import com.allen_sauer.gwt.log.client.Log; import com.allen_sauer.gwt.log.client.Log;
import com.sencha.gxt.widget.core.client.form.FieldLabel; import com.sencha.gxt.widget.core.client.form.FieldLabel;
@ -19,12 +20,10 @@ import com.sencha.gxt.widget.core.client.form.FieldLabel;
public class OperatorFieldWidget { public class OperatorFieldWidget {
private Parameter parameter; private Parameter parameter;
private AbstractFld field; private AbstractFld field;
private FieldLabel parameterLabel; private FieldLabel parameterLabel;
/** /**
*
*/ */
public OperatorFieldWidget(Parameter p) { public OperatorFieldWidget(Parameter p) {
super(); super();
@ -49,12 +48,12 @@ public class OperatorFieldWidget {
field = new FileFld(p); field = new FileFld(p);
if (field == null) { if (field == null) {
parameterLabel = new FieldLabel(null, p.getName()); parameterLabel = new FieldLabel(null, StringUtil.getCapitalWords(p.getName()));
parameterLabel.setLabelWidth(200); parameterLabel.setLabelWidth(200);
parameterLabel.setLabelWordWrap(true); parameterLabel.setLabelWordWrap(true);
} else { } else {
parameterLabel = new FieldLabel(field.getWidget(), p.getName()); parameterLabel = new FieldLabel(field.getWidget(), StringUtil.getCapitalWords(p.getName()));
parameterLabel.setLabelWidth(200); parameterLabel.setLabelWidth(200);
parameterLabel.setLabelWordWrap(true); parameterLabel.setLabelWordWrap(true);
} }

View File

@ -0,0 +1,92 @@
package org.gcube.portlets.user.dataminermanager.client.parametersfield;
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.ObjectParameter;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.form.TextField;
/**
*
* @author Giancarlo Panichi
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class StringItem extends HBoxLayoutContainer {
private ListStringFld parent;
private TextField field;
private TextButton addBtn;
private TextButton removeBtn;
/**
* @param objPar
*/
public StringItem(ListStringFld parent, ObjectParameter objectParameter, boolean first) {
super();
this.parent=parent;
create(objectParameter,first);
}
private void create( ObjectParameter objectParameter, boolean first){
field = new TextField();
field.setAllowBlank(false);
addBtn = new TextButton("");
addBtn.setIcon(DataMinerManager.resources.add());
addBtn.addSelectHandler(new SelectEvent.SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
parent.addField(StringItem.this);
}
});
removeBtn = new TextButton("");
removeBtn.setIcon(DataMinerManager.resources.cancel());
removeBtn.addSelectHandler(new SelectEvent.SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
parent.removeField(StringItem.this);
}
});
removeBtn.setVisible(!first);
setPack(BoxLayoutPack.START);
setEnableOverflow(false);
add(field, new BoxLayoutData(new Margins()));
add(addBtn, new BoxLayoutData(new Margins()));
add(removeBtn, new BoxLayoutData(new Margins()));
forceLayout();
}
public void showCancelButton() {
removeBtn.setVisible(true);
}
public void hideCancelButton() {
removeBtn.setVisible(false);
}
public String getValue() {
return field.getCurrentValue();
}
public boolean isValid() {
return field.isValid();
}
}

View File

@ -0,0 +1,269 @@
package org.gcube.portlets.user.dataminermanager.client.parametersfield;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.TabularParameter;
import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync;
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple;
import org.gcube.portlets.user.dataminermanager.shared.exception.ExpiredSessionServiceException;
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
import org.gcube.portlets.widgets.wsexplorer.client.select.WorkspaceExplorerSelectDialog;
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
import org.gcube.portlets.widgets.wsexplorer.shared.ItemType;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.sencha.gxt.core.client.dom.XDOM;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.form.TextField;
/**
*
* @author Giancarlo Panichi email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class TabItem extends HBoxLayoutContainer {
private TabularListFld parent;
private TextButton selectButton;
private TextButton selectButton2;
private TableItemSimple selectedTableItem;
private TextButton addBtn;
private TextButton removeBtn;
private TextField tableDescription;
private WorkspaceExplorerSelectDialog wselectDialog;
/**
*
* @param tabularListFld
* @param tabularParameter
* @param first
*/
public TabItem(TabularListFld parent, TabularParameter tabularParameter,
boolean first) {
super();
this.parent = parent;
initDialog();
create(tabularParameter, first);
}
private void create(TabularParameter tabularParameter, boolean first) {
tableDescription = new TextField();
tableDescription.setReadOnly(true);
tableDescription.setVisible(false);
selectButton = new TextButton("Select Data Set");
selectButton.addSelectHandler(new SelectEvent.SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
wselectDialog.show();
}
});
selectButton.setIcon(DataMinerManager.resources.folderExplore());
selectButton.setToolTip("Select Data Set");
selectButton2 = new TextButton("");
selectButton2.addSelectHandler(new SelectEvent.SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
wselectDialog.show();
}
});
selectButton2.setIcon(DataMinerManager.resources.folderExplore());
selectButton2.setToolTip("Select Another Data Set");
selectButton2.setVisible(false);
addBtn = new TextButton("");
addBtn.setIcon(DataMinerManager.resources.add());
addBtn.addSelectHandler(new SelectEvent.SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
parent.addField(TabItem.this);
}
});
removeBtn = new TextButton("");
removeBtn.setIcon(DataMinerManager.resources.cancel());
removeBtn.addSelectHandler(new SelectEvent.SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
selectedTableItem = null;
parent.removeField(TabItem.this);
}
});
removeBtn.setVisible(!first);
setPack(BoxLayoutPack.START);
setEnableOverflow(false);
add(tableDescription, new BoxLayoutData(new Margins()));
add(selectButton, new BoxLayoutData(new Margins()));
add(selectButton2, new BoxLayoutData(new Margins()));
add(addBtn, new BoxLayoutData(new Margins()));
add(removeBtn, new BoxLayoutData(new Margins()));
forceLayout();
}
private void initDialog() {
List<ItemType> selectableTypes = new ArrayList<ItemType>();
selectableTypes.add(ItemType.EXTERNAL_FILE);
List<ItemType> showableTypes = new ArrayList<ItemType>();
showableTypes.addAll(Arrays.asList(ItemType.values()));
/*
* "application/zip", "application/x-zip",
* "application/x-zip-compressed", "application/octet-stream",
* "application/x-compress", "application/x-compressed",
* "multipart/x-zip"
*/
// List<String> allowedMimeTypes =
// Arrays.asList("text/csv","text/plain","text/plain; charset=ISO-8859-1");
/**
* "zip"
*/
/*
* List<String> allowedFileExtensions = Arrays.asList("csv");
*
* FilterCriteria filterCriteria = new FilterCriteria(allowedMimeTypes,
* allowedFileExtensions, new HashMap<String, String>());
*/
wselectDialog = new WorkspaceExplorerSelectDialog("Select CSV", false);
// filterCriteria, selectableTypes);
WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() {
@Override
public void onSelectedItem(Item item) {
if (item.isFolder() || item.isRoot()) {
UtilsGXT3.info("Attention", "Select a valid csv!");
} else {
TabItem.this.retrieveTableInformation(item);
}
}
@Override
public void onFailed(Throwable throwable) {
Log.error("Error in create project: "
+ throwable.getLocalizedMessage());
UtilsGXT3.alert("Error", throwable.getLocalizedMessage());
throwable.printStackTrace();
}
@Override
public void onAborted() {
}
@Override
public void onNotValidSelection() {
UtilsGXT3.info("Attention", "Select a valid csv!");
}
};
wselectDialog.addWorkspaceExplorerSelectNotificationListener(handler);
wselectDialog.setZIndex(XDOM.getTopZIndex());
}
private void retrieveTableInformation(Item item) {
DataMinerPortletServiceAsync.INSTANCE.retrieveTableInformation(item,
new AsyncCallback<TableItemSimple>() {
@Override
public void onFailure(Throwable caught) {
Log.error("Error in retrieveTableInformation "
+ caught.getMessage());
if (caught instanceof ExpiredSessionServiceException) {
UtilsGXT3.alert("Error", "Expired Session");
} else {
UtilsGXT3.alert("Error",
"Error retrieving table information: "
+ caught.getLocalizedMessage());
}
}
@Override
public void onSuccess(TableItemSimple result) {
Log.debug("Retrieved: " + result);
selectedTableItem = result;
showFieldWithSelection();
}
});
}
/**
*
*/
private void showFieldWithSelection() {
try {
String tableName = selectedTableItem.getName();
if (tableName == null || tableName.isEmpty()) {
tableName = "NoName";
}
tableDescription.setValue(tableName);
tableDescription.setVisible(true);
selectButton.setVisible(false);
selectButton2.setVisible(true);
parent.forceLayout();
} catch (Throwable e) {
Log.error(e.getLocalizedMessage());
e.printStackTrace();
}
}
public void showCancelButton() {
removeBtn.setVisible(true);
}
public void hideCancelButton() {
removeBtn.setVisible(false);
}
public String getValue() {
return (selectedTableItem == null) ? null : selectedTableItem.getId();
}
public boolean isValid() {
return (selectedTableItem != null);
}
}

View File

@ -43,22 +43,23 @@ import com.sencha.gxt.widget.core.client.form.TextField;
/** /**
* *
* @author Giancarlo Panichi * @author Giancarlo Panichi email: <a
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a> * href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* *
*/ */
public class TabularFld extends AbstractFld implements HasTabularFldChangeEventHandler { public class TabularFld extends AbstractFld implements
HasTabularFldChangeEventHandler {
private SimpleContainer fieldContainer; private SimpleContainer fieldContainer;
private HBoxLayoutContainer horiz; private HBoxLayoutContainer horiz;
private VerticalLayoutContainer vp; private VerticalLayoutContainer vp;
private WorkspaceExplorerSelectDialog wselectDialog; private WorkspaceExplorerSelectDialog wselectDialog;
private TextButton selectButton, selectButton2, cancelButton; private TextButton selectButton, selectButton2, cancelButton;
private HtmlLayoutContainer templatesList; private HtmlLayoutContainer templatesList;
private TableItemSimple selectedTableItem = null; private TableItemSimple selectedTableItem = null;
private TabularParameter tabularParameter; private TabularParameter tabularParameter;
/** /**
* @param parameter * @param parameter
*/ */
@ -66,17 +67,36 @@ public class TabularFld extends AbstractFld implements HasTabularFldChangeEventH
super(parameter); super(parameter);
Log.debug("TabularField"); Log.debug("TabularField");
tabularParameter = (TabularParameter) parameter; tabularParameter = (TabularParameter) parameter;
SimpleContainer tabContainer=new SimpleContainer(); SimpleContainer tabContainer = new SimpleContainer();
vp=new VerticalLayoutContainer(); vp = new VerticalLayoutContainer();
init(); init();
List<String> templates = tabularParameter.getTemplates();
if (templates == null || templates.isEmpty()) {
templatesList = new HtmlLayoutContainer(
"<p></p>");
templatesList.addStyleName("workflow-parameters-description");
} else {
String list = "";
boolean first = true;
for (String template : templates) {
list += (first ? "" : ", ") + Format.ellipse(template, 50);
first = false;
}
templatesList = new HtmlLayoutContainer(
"<p>Suitable Data Set Templates: <br>" + list + "</p>");
templatesList.addStyleName("workflow-parameters-description");
}
tabContainer.add(vp, new MarginData(new Margins(0))); tabContainer.add(vp, new MarginData(new Margins(0)));
fieldContainer = new SimpleContainer(); fieldContainer = new SimpleContainer();
horiz = new HBoxLayoutContainer(); horiz = new HBoxLayoutContainer();
horiz.setPack(BoxLayoutPack.START); horiz.setPack(BoxLayoutPack.START);
horiz.setEnableOverflow(false); horiz.setEnableOverflow(false);
HtmlLayoutContainer descr; HtmlLayoutContainer descr;
if (tabularParameter.getDescription() == null) { if (tabularParameter.getDescription() == null) {
@ -94,37 +114,37 @@ public class TabularFld extends AbstractFld implements HasTabularFldChangeEventH
fieldContainer.add(horiz); fieldContainer.add(horiz);
showNoSelectionField(); showNoSelectionField();
} }
private void init() { private void init() {
List<String> templates = tabularParameter.getTemplates();
List<ItemType> selectableTypes = new ArrayList<ItemType>(); List<ItemType> selectableTypes = new ArrayList<ItemType>();
selectableTypes.add(ItemType.EXTERNAL_FILE); selectableTypes.add(ItemType.EXTERNAL_FILE);
List<ItemType> showableTypes = new ArrayList<ItemType>(); List<ItemType> showableTypes = new ArrayList<ItemType>();
showableTypes.addAll(Arrays.asList(ItemType.values())); showableTypes.addAll(Arrays.asList(ItemType.values()));
/* /*
"application/zip", "application/x-zip", * "application/zip", "application/x-zip",
"application/x-zip-compressed", "application/octet-stream", * "application/x-zip-compressed", "application/octet-stream",
"application/x-compress", "application/x-compressed", * "application/x-compress", "application/x-compressed",
"multipart/x-zip" * "multipart/x-zip"
*/ */
//List<String> allowedMimeTypes = Arrays.asList("text/csv","text/plain","text/plain; charset=ISO-8859-1"); // List<String> allowedMimeTypes =
// Arrays.asList("text/csv","text/plain","text/plain; charset=ISO-8859-1");
/** /**
* "zip" * "zip"
*/ */
/*List<String> allowedFileExtensions = Arrays.asList("csv");
FilterCriteria filterCriteria = new FilterCriteria(allowedMimeTypes, /*
allowedFileExtensions, new HashMap<String, String>()); * List<String> allowedFileExtensions = Arrays.asList("csv");
*/ *
wselectDialog = new WorkspaceExplorerSelectDialog("Select CSV",false); * FilterCriteria filterCriteria = new FilterCriteria(allowedMimeTypes,
// filterCriteria, selectableTypes); * allowedFileExtensions, new HashMap<String, String>());
*/
wselectDialog = new WorkspaceExplorerSelectDialog("Select CSV", false);
// filterCriteria, selectableTypes);
WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() { WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() {
@ -165,86 +185,72 @@ public class TabularFld extends AbstractFld implements HasTabularFldChangeEventH
selectButton = new TextButton("Select Data Set"); selectButton = new TextButton("Select Data Set");
selectButton.addSelectHandler(new SelectEvent.SelectHandler() { selectButton.addSelectHandler(new SelectEvent.SelectHandler() {
@Override @Override
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
wselectDialog.show(); wselectDialog.show();
} }
}); });
selectButton.setIcon(DataMinerManager.resources.folderExplore()); selectButton.setIcon(DataMinerManager.resources.folderExplore());
selectButton.setToolTip("Select Data Set"); selectButton.setToolTip("Select Data Set");
selectButton2 = new TextButton(""); selectButton2 = new TextButton("");
selectButton2.addSelectHandler(new SelectEvent.SelectHandler() { selectButton2.addSelectHandler(new SelectEvent.SelectHandler() {
@Override @Override
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
wselectDialog.show(); wselectDialog.show();
} }
}); });
selectButton2.setIcon(DataMinerManager.resources.folderExplore()); selectButton2.setIcon(DataMinerManager.resources.folderExplore());
selectButton2.setToolTip("Select Another Data Set"); selectButton2.setToolTip("Select Another Data Set");
cancelButton = new TextButton(""); cancelButton = new TextButton("");
cancelButton.addSelectHandler(new SelectEvent.SelectHandler() { cancelButton.addSelectHandler(new SelectEvent.SelectHandler() {
@Override @Override
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
selectedTableItem = null; selectedTableItem = null;
showNoSelectionField(); showNoSelectionField();
updateListeners(null); updateListeners(null);
} }
}); });
cancelButton.setIcon(DataMinerManager.resources.cancel()); cancelButton.setIcon(DataMinerManager.resources.cancel());
String list = "";
boolean first = true;
for (String template : templates) {
list += (first ? "" : ", ") + Format.ellipse(template,50);
first = false;
}
templatesList = new HtmlLayoutContainer("<p>Suitable Data Set Templates: <br>" + list+"</p>");
templatesList.addStyleName("workflow-parameters-description");
} }
private void retrieveTableInformation(Item item) { private void retrieveTableInformation(Item item) {
DataMinerPortletServiceAsync.INSTANCE.retrieveTableInformation(item, new AsyncCallback<TableItemSimple>() { DataMinerPortletServiceAsync.INSTANCE.retrieveTableInformation(item,
new AsyncCallback<TableItemSimple>() {
@Override @Override
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
Log.error("Error in retrieveTableInformation " + caught.getMessage()); Log.error("Error in retrieveTableInformation "
if (caught instanceof ExpiredSessionServiceException) { + caught.getMessage());
UtilsGXT3.alert("Error", "Expired Session"); if (caught instanceof ExpiredSessionServiceException) {
UtilsGXT3.alert("Error", "Expired Session");
} else {
UtilsGXT3.alert(
"Error",
"Error retrieving table information: "
+ caught.getLocalizedMessage());
}
}
@Override } else {
public void onSuccess(TableItemSimple result) { UtilsGXT3.alert("Error",
Log.debug("Retrieved: "+result); "Error retrieving table information: "
selectedTableItem=result; + caught.getLocalizedMessage());
showFieldWithSelection(); }
updateListeners(selectedTableItem);
} }
});
@Override
public void onSuccess(TableItemSimple result) {
Log.debug("Retrieved: " + result);
selectedTableItem = result;
showFieldWithSelection();
updateListeners(selectedTableItem);
}
});
} }
/** /**
* *
*/ */
@ -262,18 +268,18 @@ public class TabularFld extends AbstractFld implements HasTabularFldChangeEventH
private void showFieldWithSelection() { private void showFieldWithSelection() {
String tableName = selectedTableItem.getName(); String tableName = selectedTableItem.getName();
if(tableName==null|| tableName.isEmpty()){ if (tableName == null || tableName.isEmpty()) {
tableName="NoName"; tableName = "NoName";
} }
TextField tableDescription=new TextField(); TextField tableDescription = new TextField();
tableDescription.setValue(tableName); tableDescription.setValue(tableName);
tableDescription.setReadOnly(true); tableDescription.setReadOnly(true);
HBoxLayoutContainer h=new HBoxLayoutContainer(); HBoxLayoutContainer h = new HBoxLayoutContainer();
h.add(tableDescription,new BoxLayoutData(new Margins())); h.add(tableDescription, new BoxLayoutData(new Margins()));
h.add(selectButton2,new BoxLayoutData(new Margins())); h.add(selectButton2, new BoxLayoutData(new Margins()));
h.add(cancelButton,new BoxLayoutData(new Margins())); h.add(cancelButton, new BoxLayoutData(new Margins()));
vp.clear(); vp.clear();
vp.add(h); vp.add(h);
vp.add(templatesList); vp.add(templatesList);
@ -305,25 +311,21 @@ public class TabularFld extends AbstractFld implements HasTabularFldChangeEventH
return (selectedTableItem != null); return (selectedTableItem != null);
} }
@Override @Override
public HandlerRegistration addTabularFldChangeEventHandler( public HandlerRegistration addTabularFldChangeEventHandler(
TabularFldChangeEventHandler handler) { TabularFldChangeEventHandler handler) {
return fieldContainer.addHandler(handler, TabularFldChangeEvent.getType()); return fieldContainer.addHandler(handler,
TabularFldChangeEvent.getType());
} }
private void updateListeners(TableItemSimple tableItemSimple) { private void updateListeners(TableItemSimple tableItemSimple) {
TabularFldChangeEvent event=new TabularFldChangeEvent(tableItemSimple); TabularFldChangeEvent event = new TabularFldChangeEvent(tableItemSimple);
fireEvent(event); fireEvent(event);
} }
@Override @Override
public void fireEvent(GwtEvent<?> event) { public void fireEvent(GwtEvent<?> event) {
fieldContainer.fireEvent(event); fieldContainer.fireEvent(event);
} }
} }

View File

@ -4,29 +4,15 @@
package org.gcube.portlets.user.dataminermanager.client.parametersfield; package org.gcube.portlets.user.dataminermanager.client.parametersfield;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import org.apache.commons.digester.SetRootRule;
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter; import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.TabularListParameter; import org.gcube.portlets.user.dataminermanager.client.bean.parameters.TabularListParameter;
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.TabularParameter; import org.gcube.portlets.user.dataminermanager.client.bean.parameters.TabularParameter;
import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync;
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
import org.gcube.portlets.user.dataminermanager.shared.data.TableItemSimple;
import org.gcube.portlets.user.dataminermanager.shared.exception.ExpiredSessionServiceException;
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
import org.gcube.portlets.widgets.wsexplorer.client.select.WorkspaceExplorerSelectDialog;
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
import org.gcube.portlets.widgets.wsexplorer.shared.ItemType;
import com.allen_sauer.gwt.log.client.Log; import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Widget; import com.google.gwt.user.client.ui.Widget;
import com.sencha.gxt.core.client.dom.XDOM;
import com.sencha.gxt.core.client.util.Margins; import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData; import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutPack; import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutPack;
import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer; import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer;
@ -34,9 +20,6 @@ import com.sencha.gxt.widget.core.client.container.HtmlLayoutContainer;
import com.sencha.gxt.widget.core.client.container.MarginData; import com.sencha.gxt.widget.core.client.container.MarginData;
import com.sencha.gxt.widget.core.client.container.SimpleContainer; import com.sencha.gxt.widget.core.client.container.SimpleContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.form.TextField;
/** /**
* *
@ -52,7 +35,6 @@ public class TabularListFld extends AbstractFld {
private List<TabItem> items; private List<TabItem> items;
private VerticalLayoutContainer vp; private VerticalLayoutContainer vp;
private TabularListParameter tabularListParameter; private TabularListParameter tabularListParameter;
private WorkspaceExplorerSelectDialog wselectDialog;
/** /**
* @param parameter * @param parameter
@ -102,41 +84,43 @@ public class TabularListFld extends AbstractFld {
horiz.add(descr, new BoxLayoutData(new Margins(0))); horiz.add(descr, new BoxLayoutData(new Margins(0)));
fieldContainer.add(horiz, new MarginData(new Margins(0))); fieldContainer.add(horiz, new MarginData(new Margins(0)));
addField(null);
fieldContainer.forceLayout(); fieldContainer.forceLayout();
addField(null);
} }
private void addField(TabItem upperItem) { protected void addField(TabItem upperItem) {
try { try {
TabularParameter tabPar = new TabularParameter( TabularParameter tabPar = new TabularParameter(
tabularListParameter.getName(), tabularListParameter.getName(),
tabularListParameter.getDescription(), null, tabularListParameter.getDescription(), null,
tabularListParameter.getTemplates()); tabularListParameter.getTemplates(),
tabularListParameter.getDefaultMimeType(),
tabularListParameter.getSupportedMimeTypes());
if (upperItem == null) { if (upperItem == null) {
TabItem item = new TabItem(tabPar, true); TabItem item = new TabItem(this, tabPar, true);
items.add(item); items.add(item);
vp.add(item, new VerticalLayoutData(1, -1, new Margins(0))); vp.add(item);//don't use new VerticalLayoutData(1, -1, new Margins(0))
} else { } else {
// search the position of the upper item // search the position of the upper item
int pos = items.indexOf(upperItem); int pos = items.indexOf(upperItem);
if (pos > -1) { if (pos > -1) {
upperItem.showCancelButton(); upperItem.showCancelButton();
TabItem item = new TabItem(tabPar, false); upperItem.forceLayout();
TabItem item = new TabItem(this, tabPar, false);
items.add(pos + 1, item); items.add(pos + 1, item);
vp.insert(item, pos + 1, new VerticalLayoutData(1, -1, vp.insert(item, pos + 1);//don't use new VerticalLayoutData(-1, -1,new Margins(0))
new Margins(0)));
} else { } else {
TabItem item = new TabItem(tabPar, true); upperItem.forceLayout();
TabItem item = new TabItem(this, tabPar, true);
items.add(item); items.add(item);
vp.add(item, new VerticalLayoutData(1, -1, new Margins(0))); vp.add(item);//don't use new VerticalLayoutData(-1, -1, new Margins(0))
} }
} }
forceLayout();
} catch (Throwable e) { } catch (Throwable e) {
Log.error(e.getLocalizedMessage()); Log.error(e.getLocalizedMessage());
e.printStackTrace(); e.printStackTrace();
@ -144,17 +128,29 @@ public class TabularListFld extends AbstractFld {
} }
/** /**
*
* @param item * @param item
*/ */
private void removeField(TabItem item) { protected void removeField(TabItem item) {
items.remove(item); items.remove(item);
vp.remove(item);
if (items.size() == 1) { if (items.size() == 1) {
items.get(0).hideCancelButton(); items.get(0).hideCancelButton();
items.get(0).forceLayout();
} }
vp.remove(item);
forceLayout();
}
/**
*
*/
protected void forceLayout() {
vp.forceLayout();
listContainer.forceLayout();
horiz.forceLayout();
fieldContainer.forceLayout();
} }
/** /**
@ -163,6 +159,7 @@ public class TabularListFld extends AbstractFld {
@Override @Override
public String getValue() { public String getValue() {
String separator = tabularListParameter.getSeparator(); String separator = tabularListParameter.getSeparator();
//String separator="";
String value = ""; String value = "";
boolean first = true; boolean first = true;
for (TabItem item : items) { for (TabItem item : items) {
@ -194,237 +191,4 @@ public class TabularListFld extends AbstractFld {
return valid; return valid;
} }
private class TabItem extends HBoxLayoutContainer {
private TextButton selectButton, selectButton2;
private TableItemSimple selectedTableItem = null;
private TextButton addBtn;
private TextButton removeBtn;
private TextField tableDescription;
/**
* @param objPar
*/
public TabItem(TabularParameter tabularParameter, boolean first) {
super();
create(tabularParameter, first);
initDialog();
}
private void create(TabularParameter tabularParameter, boolean first) {
tableDescription = new TextField();
tableDescription.setReadOnly(true);
//tableDescription.setVisible(false);
selectButton = new TextButton("Select Data Set");
selectButton.addSelectHandler(new SelectEvent.SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
wselectDialog.show();
}
});
selectButton.setIcon(DataMinerManager.resources.folderExplore());
selectButton.setToolTip("Select Data Set");
selectButton2 = new TextButton("");
selectButton2.addSelectHandler(new SelectEvent.SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
wselectDialog.show();
}
});
selectButton2.setIcon(DataMinerManager.resources.folderExplore());
selectButton2.setToolTip("Select Another Data Set");
selectButton2.setVisible(false);
addBtn = new TextButton("");
addBtn.setIcon(DataMinerManager.resources.add());
addBtn.addSelectHandler(new SelectEvent.SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
addField(TabItem.this);
fieldContainer.forceLayout();
}
});
removeBtn = new TextButton("");
removeBtn.setIcon(DataMinerManager.resources.cancel());
removeBtn.addSelectHandler(new SelectEvent.SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
selectedTableItem = null;
removeField(TabItem.this);
fieldContainer.forceLayout();
}
});
removeBtn.setVisible(!first);
setPack(BoxLayoutPack.START);
setEnableOverflow(false);
add(tableDescription, new BoxLayoutData(new Margins(0)));
add(selectButton, new BoxLayoutData(new Margins(0)));
add(selectButton2, new BoxLayoutData(new Margins(0)));
add(addBtn, new BoxLayoutData(new Margins(0)));
add(removeBtn, new BoxLayoutData(new Margins(0)));
}
private void initDialog() {
List<ItemType> selectableTypes = new ArrayList<ItemType>();
selectableTypes.add(ItemType.EXTERNAL_FILE);
List<ItemType> showableTypes = new ArrayList<ItemType>();
showableTypes.addAll(Arrays.asList(ItemType.values()));
/*
* "application/zip", "application/x-zip",
* "application/x-zip-compressed", "application/octet-stream",
* "application/x-compress", "application/x-compressed",
* "multipart/x-zip"
*/
// List<String> allowedMimeTypes =
// Arrays.asList("text/csv","text/plain","text/plain; charset=ISO-8859-1");
/**
* "zip"
*/
/*
* List<String> allowedFileExtensions = Arrays.asList("csv");
*
* FilterCriteria filterCriteria = new
* FilterCriteria(allowedMimeTypes, allowedFileExtensions, new
* HashMap<String, String>());
*/
wselectDialog = new WorkspaceExplorerSelectDialog("Select CSV",
false);
// filterCriteria, selectableTypes);
WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() {
@Override
public void onSelectedItem(Item item) {
if (item.isFolder() || item.isRoot()) {
UtilsGXT3.info("Attention", "Select a valid csv!");
} else {
TabItem.this.retrieveTableInformation(item);
}
}
@Override
public void onFailed(Throwable throwable) {
Log.error("Error in create project: "
+ throwable.getLocalizedMessage());
UtilsGXT3.alert("Error", throwable.getLocalizedMessage());
throwable.printStackTrace();
}
@Override
public void onAborted() {
}
@Override
public void onNotValidSelection() {
UtilsGXT3.info("Attention", "Select a valid csv!");
}
};
wselectDialog
.addWorkspaceExplorerSelectNotificationListener(handler);
wselectDialog.setZIndex(XDOM.getTopZIndex());
}
private void retrieveTableInformation(Item item) {
DataMinerPortletServiceAsync.INSTANCE.retrieveTableInformation(
item, new AsyncCallback<TableItemSimple>() {
@Override
public void onFailure(Throwable caught) {
Log.error("Error in retrieveTableInformation "
+ caught.getMessage());
if (caught instanceof ExpiredSessionServiceException) {
UtilsGXT3.alert("Error", "Expired Session");
} else {
UtilsGXT3.alert("Error",
"Error retrieving table information: "
+ caught.getLocalizedMessage());
}
}
@Override
public void onSuccess(TableItemSimple result) {
Log.debug("Retrieved: " + result);
selectedTableItem = result;
showFieldWithSelection();
}
});
}
/**
*
*/
private void showFieldWithSelection() {
try {
String tableName = selectedTableItem.getName();
if (tableName == null || tableName.isEmpty()) {
tableName = "NoName";
}
tableDescription.setValue(tableName);
selectButton.setVisible(false);
selectButton2.setVisible(true);
} catch (Throwable e) {
Log.error(e.getLocalizedMessage());
e.printStackTrace();
}
}
public void showCancelButton() {
removeBtn.setVisible(true);
}
public void hideCancelButton() {
removeBtn.setVisible(false);
}
public String getValue() {
return (selectedTableItem == null) ? null : selectedTableItem
.getId();
}
public boolean isValid() {
return (selectedTableItem != null);
}
}
} }

View File

@ -352,7 +352,6 @@ public class SClient4WPS extends SClient {
} }
private String executeProcessAsync(ExecuteRequestBuilder executeBuilder, private String executeProcessAsync(ExecuteRequestBuilder executeBuilder,
ProcessDescriptionType processDescription) throws Exception { ProcessDescriptionType processDescription) throws Exception {
try { try {
@ -634,11 +633,10 @@ public class SClient4WPS extends SClient {
throws Exception { throws Exception {
try { try {
logger.info("Parameters of algorithm " + operator.getId()); logger.info("Parameters of algorithm " + operator.getId());
ProcessInformations processInformations; ProcessInformations processInformations;
try { try {
processInformations = describeProcess(operator processInformations = describeProcess(operator.getId());
.getId());
} catch (Throwable e) { } catch (Throwable e) {
logger.error("GetParameters: " + e.getLocalizedMessage()); logger.error("GetParameters: " + e.getLocalizedMessage());
e.printStackTrace(); e.printStackTrace();
@ -648,7 +646,8 @@ public class SClient4WPS extends SClient {
List<Parameter> parameters = new ArrayList<>(); List<Parameter> parameters = new ArrayList<>();
Parameter inputParameter; Parameter inputParameter;
for (InputDescriptionType inputDesc : processInformations.getInputs()) { for (InputDescriptionType inputDesc : processInformations
.getInputs()) {
inputParameter = WPS2SM.convert2SMType(inputDesc); inputParameter = WPS2SM.convert2SMType(inputDesc);
logger.debug("InputParameter: " + inputParameter); logger.debug("InputParameter: " + inputParameter);
parameters.add(inputParameter); parameters.add(inputParameter);
@ -667,12 +666,10 @@ public class SClient4WPS extends SClient {
} }
@Override @Override
public ComputationId startComputation(Operator operator) public ComputationId startComputation(Operator operator) throws Exception {
throws Exception {
ProcessInformations processInformations; ProcessInformations processInformations;
try { try {
processInformations = describeProcess(operator processInformations = describeProcess(operator.getId());
.getId());
} catch (Throwable e) { } catch (Throwable e) {
logger.error("GetParameters: " + e.getLocalizedMessage()); logger.error("GetParameters: " + e.getLocalizedMessage());
e.printStackTrace(); e.printStackTrace();
@ -696,7 +693,8 @@ public class SClient4WPS extends SClient {
+ parm.getValue()); + parm.getValue());
} }
String processUrl = compute(processInformations, userInputs, inputParameters); String processUrl = compute(processInformations, userInputs,
inputParameters);
logger.debug("Stated Computation ProcessLocation:" + processUrl); logger.debug("Stated Computation ProcessLocation:" + processUrl);
int idIndex = processUrl.lastIndexOf("?id="); int idIndex = processUrl.lastIndexOf("?id=");
@ -709,13 +707,14 @@ public class SClient4WPS extends SClient {
} }
ComputationId computationId = new ComputationId(id, processUrl); ComputationId computationId = new ComputationId(id, processUrl);
logger.debug("ComputationId: " + computationId); logger.debug("ComputationId: " + computationId);
runningProcess.put(computationId, processInformations); runningProcess.put(computationId, processInformations);
return computationId; return computationId;
} }
private String compute(ProcessInformations processInformations, Map<String, String> userInputs, private String compute(ProcessInformations processInformations,
Map<String, String> userInputs,
Map<String, Parameter> inputParameters) throws Exception { Map<String, Parameter> inputParameters) throws Exception {
try { try {
// setup the inputs // setup the inputs
@ -930,16 +929,23 @@ public class SClient4WPS extends SClient {
throws Exception { throws Exception {
Map<String, Resource> outputResource = new LinkedHashMap<>(); Map<String, Resource> outputResource = new LinkedHashMap<>();
Map<String, Parameter> outputParameters = new LinkedHashMap<>(); Map<String, Parameter> outputParameters = new LinkedHashMap<>();
ProcessInformations processInformations=runningProcess.get(computationId); ProcessInformations processInformations = runningProcess
.get(computationId);
Parameter outputParameter; Parameter outputParameter;
for (OutputDescriptionType outputDesc : processInformations.getOutputs()) { if (processInformations != null
outputParameter = WPS2SM.convert2SMType(outputDesc); && processInformations.getOutputs() != null) {
logger.debug("OutputParameter: " + outputParameter); for (OutputDescriptionType outputDesc : processInformations
outputParameters.put(outputParameter.getName(), outputParameter); .getOutputs()) {
outputParameter = WPS2SM.convert2SMType(outputDesc);
logger.debug("OutputParameter: " + outputParameter);
outputParameters
.put(outputParameter.getName(), outputParameter);
}
} }
retrieveProcessOutput(computationId.getUrlId(), outputParameters, outputResource); retrieveProcessOutput(computationId.getUrlId(), outputParameters,
outputResource);
return outputResource; return outputResource;

View File

@ -162,6 +162,7 @@ public class WPS2SM {
converted = new ObjectParameter(id, title, converted = new ObjectParameter(id, title,
guessPrimitiveType(guessedType), guessPrimitiveType(guessedType),
defaultValue); defaultValue);
} }
} }
} }
@ -185,25 +186,31 @@ public class WPS2SM {
* @param maxOcc * @param maxOcc
* @param rangeOccs * @param rangeOccs
* @param id * @param id
* @param type * @param defaultType
* @return * @return
*/ */
public static Parameter manageComplexData(String maxMegaBytes, public static Parameter manageComplexData(String maxMegaBytes,
String title, int minOcc, int maxOcc, int rangeOccs, String id, String title, int minOcc, int maxOcc, int rangeOccs, String id,
ComplexDataDescriptionType type) { ComplexDataDescriptionType defaultType,
ComplexDataDescriptionType[] supportedTypes) {
Parameter converted = null; Parameter converted = null;
String mimeType = null; String mimeType = null;
String schema = null; String schema = null;
String encoding = null; String encoding = null;
ArrayList<String> supportedMimeTypes = new ArrayList<String>();
// GenericFileDataConstants.MIME_TYPE_TEXT_XML // GenericFileDataConstants.MIME_TYPE_TEXT_XML
mimeType = type.getMimeType(); mimeType = defaultType.getMimeType();
schema = type.getSchema(); schema = defaultType.getSchema();
encoding = type.getEncoding(); encoding = defaultType.getEncoding();
logger.debug("MimeType: " + mimeType); logger.debug("Default MimeType: " + mimeType);
logger.debug("Schema: " + schema); logger.debug("Default Schema: " + schema);
logger.debug("Encoding: " + encoding); logger.debug("Default Encoding: " + encoding);
for (ComplexDataDescriptionType supported : supportedTypes) {
supportedMimeTypes.add(supported.getMimeType());
}
// rebuild title // rebuild title
title = buildParameterDescription(title, maxMegaBytes, null, minOcc, title = buildParameterDescription(title, maxMegaBytes, null, minOcc,
maxOcc, null); maxOcc, null);
@ -211,10 +218,12 @@ public class WPS2SM {
if (title != null && !title.isEmpty()) { if (title != null && !title.isEmpty()) {
if (title.contains("[a http link to a table")) { if (title.contains("[a http link to a table")) {
converted = new TabularParameter(id, title, " ", converted = new TabularParameter(id, title, " ",
new ArrayList<String>()); new ArrayList<String>(), mimeType,
supportedMimeTypes);
} else { } else {
if (title.contains("[a http link to a file")) { if (title.contains("[a http link to a file")) {
converted = new FileParameter(id, title, mimeType); converted = new FileParameter(id, title, mimeType,
supportedMimeTypes);
} else { } else {
if (title.contains("[a sequence of http links")) { if (title.contains("[a sequence of http links")) {
Pattern pattern = Pattern Pattern pattern = Pattern
@ -235,20 +244,24 @@ public class WPS2SM {
String separator = matcher.group(1); String separator = matcher.group(1);
logger.debug("Matcher separator: " + separator); logger.debug("Matcher separator: " + separator);
converted = new TabularListParameter(id, title, converted = new TabularListParameter(id, title,
separator); separator, mimeType, supportedMimeTypes);
} else { } else {
converted = new FileParameter(id, title, mimeType); converted = new FileParameter(id, title,
mimeType, supportedMimeTypes);
} }
} else { } else {
converted = new FileParameter(id, title, mimeType); converted = new FileParameter(id, title, mimeType,
supportedMimeTypes);
} }
} }
} }
} else { } else {
converted = new FileParameter(id, title, mimeType); converted = new FileParameter(id, title, mimeType,
supportedMimeTypes);
} }
} else { } else {
converted = new FileParameter(id, title, mimeType); converted = new FileParameter(id, title, mimeType,
supportedMimeTypes);
} }
return converted; return converted;
} }
@ -317,7 +330,10 @@ public class WPS2SM {
.getMaximumMegabytes().toString() : "1"; .getMaximumMegabytes().toString() : "1";
logger.debug("Max Megabytes: " + maxMegaBytes); logger.debug("Max Megabytes: " + maxMegaBytes);
converted = manageComplexData(maxMegaBytes, title, minOcc, converted = manageComplexData(maxMegaBytes, title, minOcc,
maxOcc, rangeOccs, id, complex.getDefault().getFormat()); maxOcc, rangeOccs, id,
complex.getDefault().getFormat(), complex
.getSupported().getFormatArray());
} }
logger.debug("Conversion to SM Type->Title:" + title); logger.debug("Conversion to SM Type->Title:" + title);
@ -364,7 +380,8 @@ public class WPS2SM {
logger.debug("Complex Output"); logger.debug("Complex Output");
SupportedComplexDataType complex = wpsType.getComplexOutput(); SupportedComplexDataType complex = wpsType.getComplexOutput();
converted = manageComplexData("", title, -1, -1, -1, id, complex converted = manageComplexData("", title, -1, -1, -1, id, complex
.getDefault().getFormat()); .getDefault().getFormat(), complex.getSupported()
.getFormatArray());
} }
return converted; return converted;

414795
test.log.1

File diff suppressed because one or more lines are too long

486585
test.log.2 Normal file

File diff suppressed because one or more lines are too long