refs 4823: DataMiner - Preserve the order of the output (Example Bionym Local)

Task-Url: https://support.d4science.org/issues/4823

In the case of Check The Computation, now the interaface shows the input parameters in the order requested by the algorithm and the output parameters sorted by name

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/data-miner-manager@130969 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2016-08-04 13:34:52 +00:00
parent 0c14d3966e
commit e310813cde
11 changed files with 417 additions and 247 deletions

View File

@ -32,6 +32,7 @@ public class ComputationsPanel extends SimpleContainer {
public ComputationsPanel() {
super();
Log.debug("ComputationsPanel");
init();
create();
bind();

View File

@ -37,8 +37,9 @@ public class ComputationsViewerPanel extends FramedPanel {
public ComputationsViewerPanel(ComputationData computationData) {
super();
Log.debug("ComputationsPanel");
this.computationData=computationData;
Log.debug("ComputationsViewerPanel");
this.computationData = computationData;
Log.debug("ComputationData: " + computationData);
init();
create();
@ -54,19 +55,25 @@ public class ComputationsViewerPanel extends FramedPanel {
setResize(true);
setHeadingText("Computations Viewer");
setBodyStyle("backgroundColor:white;");
}
private void create() {
v = new VerticalLayoutContainer();
v.setScrollMode(ScrollMode.AUTO);
add(v);
createView();
forceLayout();
try {
v = new VerticalLayoutContainer();
v.setScrollMode(ScrollMode.AUTO);
add(v);
createView();
forceLayout();
} catch (Throwable e) {
Log.error("Error creating ComputationsViewerPanel: "
+ e.getLocalizedMessage());
e.printStackTrace();
}
}
private void createView() {
if (computationData == null) {
Log.error("ComputationData is null!");
UtilsGXT3.alert("Error",
@ -74,6 +81,15 @@ public class ComputationsViewerPanel extends FramedPanel {
return;
}
if (computationData.getComputationId() == null
|| computationData.getComputationId().getId() == null
|| computationData.getComputationId().getId().isEmpty()) {
Log.error("Error in computationId: " + computationData);
UtilsGXT3.alert("Error",
"No information on computation id is retrieved!");
return;
}
SimpleContainer sectionTitle = new SimpleContainer();
// title
HtmlLayoutContainer title = new HtmlLayoutContainer(
@ -82,7 +98,8 @@ public class ComputationsViewerPanel extends FramedPanel {
+ "</b></center>");
sectionTitle.add(title, new MarginData());
sectionTitle.getElement().getStyle().setMarginRight(20, Unit.PX);
// v.add(sectionTitle, new VerticalLayoutData(1, -1, new Margins(0)));
// v.add(sectionTitle, new VerticalLayoutData(1, -1, new
// Margins(0)));
v.add(sectionTitle, new VerticalLayoutData(-1, -1, new Margins(10)));
if (computationData.getOutputParameters() != null
@ -105,195 +122,258 @@ public class ComputationsViewerPanel extends FramedPanel {
FieldSet operatorFieldSet = operatorView();
v.add(operatorFieldSet, new VerticalLayoutData(-1, -1, new Margins(10)));
}
private FieldSet operatorView() {
VerticalLayoutContainer operatorVBox = new VerticalLayoutContainer();
TextField operatorNameField = new TextField();
operatorNameField.setValue(computationData.getComputationId()
.getOperatorName());
operatorNameField.setReadOnly(true);
FieldLabel operatorNameLabel = new FieldLabel(operatorNameField,
"Operator Name");
operatorNameLabel.setLabelWidth(200);
operatorNameLabel.setLabelWordWrap(true);
operatorVBox.add(operatorNameLabel, new VerticalLayoutData(1, -1,
new Margins(0,4,0,4)));
try {
TextArea operatorDescriptionField = new TextArea();
operatorDescriptionField.setHeight(40);
operatorDescriptionField.setValue(computationData
.getOperatorDescription());
operatorDescriptionField.setReadOnly(true);
FieldLabel operatorDescriptionLabel = new FieldLabel(
operatorDescriptionField, "Operator Description");
operatorDescriptionLabel.setLabelWidth(200);
operatorDescriptionLabel.setLabelWordWrap(true);
operatorDescriptionLabel.setHeight(65);
operatorVBox.add(operatorDescriptionLabel, new VerticalLayoutData(1,
-1, new Margins(0,5,0,5)));
VerticalLayoutContainer operatorVBox = new VerticalLayoutContainer();
TextField operatorNameField = new TextField();
operatorNameField.setValue(computationData.getComputationId()
.getOperatorName());
operatorNameField.setReadOnly(true);
FieldLabel operatorNameLabel = new FieldLabel(operatorNameField,
"Operator Name");
operatorNameLabel.setLabelWidth(200);
operatorNameLabel.setLabelWordWrap(true);
operatorVBox.add(operatorNameLabel, new VerticalLayoutData(1, -1,
new Margins(0, 4, 0, 4)));
FieldSet operatorFieldSet = new FieldSet();
operatorFieldSet.setHeadingText("Operator Details");
operatorFieldSet.setCollapsible(true);
operatorFieldSet.setHeight(130);
operatorFieldSet.add(operatorVBox);
operatorFieldSet.getElement().getStyle().setMarginBottom(120, Unit.PX);
operatorFieldSet.getElement().getStyle().setMarginRight(20, Unit.PX);
return operatorFieldSet;
TextArea operatorDescriptionField = new TextArea();
operatorDescriptionField.setHeight(40);
operatorDescriptionField.setValue(computationData
.getOperatorDescription());
operatorDescriptionField.setReadOnly(true);
FieldLabel operatorDescriptionLabel = new FieldLabel(
operatorDescriptionField, "Operator Description");
operatorDescriptionLabel.setLabelWidth(200);
operatorDescriptionLabel.setLabelWordWrap(true);
operatorDescriptionLabel.setHeight(65);
operatorVBox.add(operatorDescriptionLabel, new VerticalLayoutData(
1, -1, new Margins(0, 5, 0, 5)));
FieldSet operatorFieldSet = new FieldSet();
operatorFieldSet.setHeadingText("Operator Details");
operatorFieldSet.setCollapsible(true);
operatorFieldSet.setHeight(130);
operatorFieldSet.add(operatorVBox);
operatorFieldSet.getElement().getStyle()
.setMarginBottom(120, Unit.PX);
operatorFieldSet.getElement().getStyle()
.setMarginRight(20, Unit.PX);
return operatorFieldSet;
} catch (Throwable e) {
Log.error("Error in ComputationsViewerPanel in operator: "
+ e.getLocalizedMessage());
e.printStackTrace();
throw e;
}
}
private FieldSet detailsView() {
VerticalLayoutContainer detailsVBox = new VerticalLayoutContainer();
TextField startDateField = new TextField();
startDateField.setValue(computationData.getStartDate());
startDateField.setReadOnly(true);
FieldLabel startDateLabel = new FieldLabel(startDateField, "Start Date");
startDateLabel.setLabelWidth(200);
startDateLabel.setLabelWordWrap(true);
detailsVBox.add(startDateLabel, new VerticalLayoutData(1, -1,
new Margins(0,4,0,4)));
try {
VerticalLayoutContainer detailsVBox = new VerticalLayoutContainer();
TextField startDateField = new TextField();
startDateField.setValue(computationData.getStartDate());
startDateField.setReadOnly(true);
FieldLabel startDateLabel = new FieldLabel(startDateField,
"Start Date");
startDateLabel.setLabelWidth(200);
startDateLabel.setLabelWordWrap(true);
detailsVBox.add(startDateLabel, new VerticalLayoutData(1, -1,
new Margins(0, 4, 0, 4)));
TextField endDateField = new TextField();
endDateField.setValue(computationData.getEndDate());
endDateField.setReadOnly(true);
FieldLabel endDateLabel = new FieldLabel(endDateField, "End Date");
endDateLabel.setLabelWidth(200);
endDateLabel.setLabelWordWrap(true);
detailsVBox.add(endDateLabel, new VerticalLayoutData(1, -1,
new Margins(0,4,0,4)));
TextField endDateField = new TextField();
endDateField.setValue(computationData.getEndDate());
endDateField.setReadOnly(true);
FieldLabel endDateLabel = new FieldLabel(endDateField, "End Date");
endDateLabel.setLabelWidth(200);
endDateLabel.setLabelWordWrap(true);
detailsVBox.add(endDateLabel, new VerticalLayoutData(1, -1,
new Margins(0, 4, 0, 4)));
TextField statusField = new TextField();
statusField.setValue(computationData.getStatus());
statusField.setReadOnly(true);
FieldLabel statusLabel = new FieldLabel(statusField, "Status");
statusLabel.setLabelWidth(200);
statusLabel.setLabelWordWrap(true);
detailsVBox.add(statusLabel, new VerticalLayoutData(1, -1, new Margins(
0,4,0,4)));
TextField statusField = new TextField();
statusField.setValue(computationData.getStatus());
statusField.setReadOnly(true);
FieldLabel statusLabel = new FieldLabel(statusField, "Status");
statusLabel.setLabelWidth(200);
statusLabel.setLabelWordWrap(true);
detailsVBox.add(statusLabel, new VerticalLayoutData(1, -1,
new Margins(0, 4, 0, 4)));
TextField vreField = new TextField();
vreField.setValue(computationData.getVre());
vreField.setReadOnly(true);
FieldLabel vreLabel = new FieldLabel(vreField, "VRE");
vreLabel.setLabelWidth(200);
vreLabel.setLabelWordWrap(true);
detailsVBox
.add(vreLabel, new VerticalLayoutData(1, -1, new Margins(0,4,0,4)));
TextField vreField = new TextField();
vreField.setValue(computationData.getVre());
vreField.setReadOnly(true);
FieldLabel vreLabel = new FieldLabel(vreField, "VRE");
vreLabel.setLabelWidth(200);
vreLabel.setLabelWordWrap(true);
detailsVBox.add(vreLabel, new VerticalLayoutData(1, -1,
new Margins(0, 4, 0, 4)));
FieldSet detailsFieldSet = new FieldSet();
detailsFieldSet.setHeadingText("Computation Details");
detailsFieldSet.setCollapsible(true);
detailsFieldSet.add(detailsVBox);
detailsFieldSet.getElement().getStyle().setMarginRight(20, Unit.PX);
return detailsFieldSet;
FieldSet detailsFieldSet = new FieldSet();
detailsFieldSet.setHeadingText("Computation Details");
detailsFieldSet.setCollapsible(true);
detailsFieldSet.add(detailsVBox);
detailsFieldSet.getElement().getStyle().setMarginRight(20, Unit.PX);
return detailsFieldSet;
} catch (Throwable e) {
Log.error("Error in ComputationsViewerPanel in details: "
+ e.getLocalizedMessage());
e.printStackTrace();
throw e;
}
}
private FieldSet inputView() {
VerticalLayoutContainer inputVBox = new VerticalLayoutContainer();
LinkedHashMap<String, ComputationValue> input = computationData
.getInputParameters();
for (String key : input.keySet()) {
ComputationValue computationValue = input.get(key);
FieldLabel fieldLabel = null;
SimpleContainer simpleContainer;
switch (computationValue.getType()) {
case File:
ComputationValueFile computationValueFile=(ComputationValueFile) computationValue;
simpleContainer=new ComputationValueFilePanel(computationValueFile);
fieldLabel = new FieldLabel(simpleContainer, key);
fieldLabel.setLabelWidth(200);
fieldLabel.setLabelWordWrap(true);
break;
case Image:
ComputationValueImage computationValueImage=(ComputationValueImage) computationValue;
simpleContainer=new ComputationValueImagePanel(computationValueImage);
fieldLabel = new FieldLabel(simpleContainer, key);
fieldLabel.setLabelWidth(200);
fieldLabel.setLabelWordWrap(true);
break;
case FileList:
ComputationValueFileList computationValueFileList=(ComputationValueFileList) computationValue;
simpleContainer=new ComputationValueFileListPanel(computationValueFileList);
fieldLabel = new FieldLabel(simpleContainer, key);
fieldLabel.setLabelWidth(200);
fieldLabel.setLabelWordWrap(true);
break;
case String:
default:
TextField textField = new TextField();
textField.setValue(computationValue.getValue());
textField.setReadOnly(true);
fieldLabel = new FieldLabel(textField, key);
fieldLabel.setLabelWidth(200);
fieldLabel.setLabelWordWrap(true);
break;
try {
VerticalLayoutContainer inputVBox = new VerticalLayoutContainer();
LinkedHashMap<String, ComputationValue> input = computationData
.getInputParameters();
for (String key : input.keySet()) {
ComputationValue computationValue = input.get(key);
Log.debug("Input: [key=" + key + ", ComputationValue="
+ computationValue + "]");
FieldLabel fieldLabel = null;
SimpleContainer simpleContainer;
if(computationValue==null){
TextField textField = new TextField();
textField.setReadOnly(true);
fieldLabel = new FieldLabel(textField, key);
fieldLabel.setLabelWidth(200);
fieldLabel.setLabelWordWrap(true);
inputVBox.add(fieldLabel, new VerticalLayoutData(1, -1,
new Margins(0, 4, 0, 4)));
continue;
}
switch (computationValue.getType()) {
case File:
ComputationValueFile computationValueFile = (ComputationValueFile) computationValue;
simpleContainer = new ComputationValueFilePanel(
computationValueFile);
fieldLabel = new FieldLabel(simpleContainer, key);
fieldLabel.setLabelWidth(200);
fieldLabel.setLabelWordWrap(true);
break;
case Image:
ComputationValueImage computationValueImage = (ComputationValueImage) computationValue;
simpleContainer = new ComputationValueImagePanel(
computationValueImage);
fieldLabel = new FieldLabel(simpleContainer, key);
fieldLabel.setLabelWidth(200);
fieldLabel.setLabelWordWrap(true);
break;
case FileList:
ComputationValueFileList computationValueFileList = (ComputationValueFileList) computationValue;
simpleContainer = new ComputationValueFileListPanel(
computationValueFileList);
fieldLabel = new FieldLabel(simpleContainer, key);
fieldLabel.setLabelWidth(200);
fieldLabel.setLabelWordWrap(true);
break;
case String:
default:
TextField textField = new TextField();
textField.setValue(computationValue.getValue());
textField.setReadOnly(true);
fieldLabel = new FieldLabel(textField, key);
fieldLabel.setLabelWidth(200);
fieldLabel.setLabelWordWrap(true);
break;
}
inputVBox.add(fieldLabel, new VerticalLayoutData(1, -1,
new Margins(0, 4, 0, 4)));
}
inputVBox.add(fieldLabel, new VerticalLayoutData(1, -1,
new Margins(0,4,0,4)));
}
FieldSet inputFieldSet = new FieldSet();
inputFieldSet.setHeadingText("Input Parameters");
inputFieldSet.setCollapsible(true);
inputFieldSet.add(inputVBox);
inputFieldSet.getElement().getStyle().setMarginRight(20, Unit.PX);
return inputFieldSet;
FieldSet inputFieldSet = new FieldSet();
inputFieldSet.setHeadingText("Input Parameters");
inputFieldSet.setCollapsible(true);
inputFieldSet.add(inputVBox);
inputFieldSet.getElement().getStyle().setMarginRight(20, Unit.PX);
return inputFieldSet;
} catch (Throwable e) {
Log.error("Error in ComputationsViewerPanel creating input view: "
+ e.getLocalizedMessage());
e.printStackTrace();
throw e;
}
}
private FieldSet outputView() {
VerticalLayoutContainer outputVBox = new VerticalLayoutContainer();
LinkedHashMap<String, ComputationValue> output = computationData
.getOutputParameters();
for (String key : output.keySet()) {
ComputationValue computationValue = output.get(key);
FieldLabel fieldLabel = null;
SimpleContainer simpleContainer;
switch (computationValue.getType()) {
case File:
ComputationValueFile computationValueFile=(ComputationValueFile) computationValue;
simpleContainer=new ComputationValueFilePanel(computationValueFile);
fieldLabel = new FieldLabel(simpleContainer, key);
fieldLabel.setLabelWidth(200);
fieldLabel.setLabelWordWrap(true);
break;
case Image:
ComputationValueImage computationValueImage=(ComputationValueImage) computationValue;
simpleContainer=new ComputationValueImagePanel(computationValueImage);
fieldLabel = new FieldLabel(simpleContainer, key);
fieldLabel.setLabelWidth(200);
fieldLabel.setLabelWordWrap(true);
break;
case FileList:
ComputationValueFileList computationValueFileList=(ComputationValueFileList) computationValue;
simpleContainer=new ComputationValueFileListPanel(computationValueFileList);
fieldLabel = new FieldLabel(simpleContainer, key);
fieldLabel.setLabelWidth(200);
fieldLabel.setLabelWordWrap(true);
case String:
default:
TextField textField = new TextField();
textField.setValue(computationValue.getValue());
textField.setReadOnly(true);
fieldLabel = new FieldLabel(textField, key);
fieldLabel.setLabelWidth(200);
fieldLabel.setLabelWordWrap(true);
break;
try {
VerticalLayoutContainer outputVBox = new VerticalLayoutContainer();
LinkedHashMap<String, ComputationValue> output = computationData
.getOutputParameters();
for (String key : output.keySet()) {
ComputationValue computationValue = output.get(key);
Log.debug("Output: [key=" + key + ", ComputationValue="
+ computationValue + "]");
FieldLabel fieldLabel = null;
SimpleContainer simpleContainer;
if(computationValue==null){
TextField textField = new TextField();
textField.setReadOnly(true);
fieldLabel = new FieldLabel(textField, key);
fieldLabel.setLabelWidth(200);
fieldLabel.setLabelWordWrap(true);
outputVBox.add(fieldLabel, new VerticalLayoutData(1, -1,
new Margins(0, 4, 0, 4)));
continue;
}
switch (computationValue.getType()) {
case File:
ComputationValueFile computationValueFile = (ComputationValueFile) computationValue;
simpleContainer = new ComputationValueFilePanel(
computationValueFile);
fieldLabel = new FieldLabel(simpleContainer, key);
fieldLabel.setLabelWidth(200);
fieldLabel.setLabelWordWrap(true);
break;
case Image:
ComputationValueImage computationValueImage = (ComputationValueImage) computationValue;
simpleContainer = new ComputationValueImagePanel(
computationValueImage);
fieldLabel = new FieldLabel(simpleContainer, key);
fieldLabel.setLabelWidth(200);
fieldLabel.setLabelWordWrap(true);
break;
case FileList:
ComputationValueFileList computationValueFileList = (ComputationValueFileList) computationValue;
simpleContainer = new ComputationValueFileListPanel(
computationValueFileList);
fieldLabel = new FieldLabel(simpleContainer, key);
fieldLabel.setLabelWidth(200);
fieldLabel.setLabelWordWrap(true);
case String:
default:
TextField textField = new TextField();
textField.setValue(computationValue.getValue());
textField.setReadOnly(true);
fieldLabel = new FieldLabel(textField, key);
fieldLabel.setLabelWidth(200);
fieldLabel.setLabelWordWrap(true);
break;
}
outputVBox.add(fieldLabel, new VerticalLayoutData(1, -1,
new Margins(0, 4, 0, 4)));
}
outputVBox.add(fieldLabel, new VerticalLayoutData(1, -1,
new Margins(0,4,0,4)));
}
FieldSet outputFieldSet = new FieldSet();
outputFieldSet.setHeadingText("Output Result");
outputFieldSet.setCollapsible(true);
outputFieldSet.add(outputVBox);
outputFieldSet.getElement().getStyle().setMarginRight(20, Unit.PX);
return outputFieldSet;
FieldSet outputFieldSet = new FieldSet();
outputFieldSet.setHeadingText("Output Result");
outputFieldSet.setCollapsible(true);
outputFieldSet.add(outputVBox);
outputFieldSet.getElement().getStyle().setMarginRight(20, Unit.PX);
return outputFieldSet;
} catch (Throwable e) {
Log.error("Error in ComputationsViewerPanel creating output view: "
+ e.getLocalizedMessage());
e.printStackTrace();
throw e;
}
}
}

View File

@ -1,5 +1,6 @@
package org.gcube.portlets.user.dataminermanager.server;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@ -343,6 +344,8 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
logger.debug("OutputDataByComputationItemt(): " + itemDescription);
Map<String, String> properties = StorageUtil.getProperties(
aslSession.getUsername(), itemDescription.getId());
logger.debug("Properties: " + properties);
SClient smClient = SessionUtil.getSClient(aslSession, session);
ComputationData computationData = smClient

View File

@ -261,7 +261,7 @@ public class SClient4WPS extends SClient {
operatorsClass.add(op);
//logger.debug("OperatorClass: " + operatorsClass);
// logger.debug("OperatorClass: " + operatorsClass);
return operatorsClass;
}
@ -356,7 +356,7 @@ public class SClient4WPS extends SClient {
return;
} catch (Throwable e) {
logger.error("RequestCapability(): "+e.getLocalizedMessage());
logger.error("RequestCapability(): " + e.getLocalizedMessage());
e.printStackTrace();
throw new Exception(e.getLocalizedMessage(), e);
} finally {
@ -989,7 +989,7 @@ public class SClient4WPS extends SClient {
@Override
public OutputData getOutputDataByComputationId(ComputationId computationId)
throws Exception {
Map<String, Resource> resources = retrieveOutput(computationId);
LinkedHashMap<String, Resource> resources = retrieveOutput(computationId);
MapResource mapResource = new MapResource("mapResource", "Resources",
"Resources", resources);
OutputData outputData = new OutputData(computationId, mapResource);
@ -997,10 +997,10 @@ public class SClient4WPS extends SClient {
return outputData;
}
private Map<String, Resource> retrieveOutput(ComputationId computationId)
throws Exception {
Map<String, Resource> outputResource = new LinkedHashMap<>();
Map<String, Parameter> outputParameters = new LinkedHashMap<>();
private LinkedHashMap<String, Resource> retrieveOutput(
ComputationId computationId) throws Exception {
LinkedHashMap<String, Resource> outputResource = new LinkedHashMap<>();
LinkedHashMap<String, Parameter> outputParameters = new LinkedHashMap<>();
ProcessInformations processInformations = runningProcess
.get(computationId);
@ -1289,73 +1289,159 @@ public class SClient4WPS extends SClient {
@Override
public ComputationData getComputationDataByComputationProperties(
Map<String, String> computationProperties) throws Exception {
if (computationProperties == null || computationProperties.isEmpty()) {
throw new Exception("Invalid computation properties: "
+ computationProperties);
}
try {
if (computationProperties == null
|| computationProperties.isEmpty()) {
throw new Exception("Invalid computation properties: "
+ computationProperties);
}
String compId = computationProperties.get("computation_id");
String compId = computationProperties.get("computation_id");
String operatorId = computationProperties.get("operator_id");
String operatorName = computationProperties.get("operator_name");
String operatorDescritpion = computationProperties
.get("operator_description");
String vre = computationProperties.get("VRE");
String startDate = computationProperties.get("start_date");
String endDate = computationProperties.get("end_date");
String status = computationProperties.get("status");
String executionType = computationProperties.get("execution_type");
String operatorId = computationProperties.get("operator_id");
String operatorName = computationProperties.get("operator_name");
String operatorDescritpion = computationProperties
.get("operator_description");
String vre = computationProperties.get("VRE");
String startDate = computationProperties.get("start_date");
String endDate = computationProperties.get("end_date");
String status = computationProperties.get("status");
String executionType = computationProperties.get("execution_type");
ComputationId computationId = new ComputationId();
computationId.setId(compId);
computationId.setOperatorId(operatorId);
computationId.setOperatorName(operatorName);
ComputationId computationId = new ComputationId();
computationId.setId(compId);
computationId.setOperatorId(operatorId);
computationId.setOperatorName(operatorName);
LinkedHashMap<String, String> inputValueParameters = new LinkedHashMap<>();
LinkedHashMap<String, String> outputValueParameters = new LinkedHashMap<>();
LinkedHashMap<String, String> inputValueParameters = new LinkedHashMap<>();
LinkedHashMap<String, String> outputValueParameters = new LinkedHashMap<>();
for (String key : computationProperties.keySet()) {
if (key != null) {
if (key.startsWith("input")) {
int inputSeparatorIndex = key.indexOf("_");
String inputKey = key.substring(inputSeparatorIndex + 1);
if (inputKey.compareToIgnoreCase("user.name") != 0
&& inputKey.compareToIgnoreCase("scope") != 0) {
inputValueParameters.put(inputKey,
computationProperties.get(key));
for (String key : computationProperties.keySet()) {
if (key != null) {
if (key.startsWith("input")) {
int inputSeparatorIndex = key.indexOf("_");
String inputKey = key
.substring(inputSeparatorIndex + 1);
if (inputKey.compareToIgnoreCase("user.name") != 0
&& inputKey.compareToIgnoreCase("scope") != 0) {
inputValueParameters.put(inputKey,
computationProperties.get(key));
}
}
} else {
if (key.startsWith("output")) {
int outputSeparatorIndex = key.indexOf("_");
String outputKey = key
.substring(outputSeparatorIndex + 1);
outputValueParameters.put(outputKey,
computationProperties.get(key));
} else {
if (key.startsWith("output")) {
int outputSeparatorIndex = key.indexOf("_");
String outputKey = key
.substring(outputSeparatorIndex + 1);
outputValueParameters.put(outputKey,
computationProperties.get(key));
}
}
}
}
ComputationValueBuilder computationValueBuilder = new ComputationValueBuilder(
inputValueParameters);
LinkedHashMap<String, ComputationValue> inputParameters = computationValueBuilder
.create();
computationValueBuilder = new ComputationValueBuilder(
outputValueParameters);
LinkedHashMap<String, ComputationValue> outputParameters = computationValueBuilder
.create();
logger.debug("inputParameters: " + inputParameters);
logger.debug("outputParameters: " + outputParameters);
LinkedHashMap<String, ComputationValue> inputParametersSorted = new LinkedHashMap<>();
LinkedHashMap<String, ComputationValue> outputParametersSorted = new LinkedHashMap<>();
ProcessInformations processInfos = describeProcess(operatorId);
if (processInfos != null) {
for (InputDescriptionType inputDesc : processInfos.getInputs()) {
if (inputDesc != null
&& inputDesc.getIdentifier() != null
&& inputDesc.getIdentifier().getStringValue() != null) {
logger.debug("InputParametr Match: "
+ inputDesc.getIdentifier().getStringValue());
ComputationValue inputComputationValue = inputParameters
.get(inputDesc.getIdentifier().getStringValue());
inputParametersSorted.put(inputDesc.getIdentifier()
.getStringValue(), inputComputationValue);
}
}
} else {
inputParametersSorted.putAll(inputParameters);
}
ArrayList<String> keys=new ArrayList<>(outputParameters.keySet());
Comparator<String> comparator = new Comparator<String>() {
public int compare(String c1, String c2) {
Integer c1Int=null;
try {
c1Int=Integer.valueOf(c1);
} catch(NumberFormatException e){
}
Integer c2Int=null;
try {
c2Int=Integer.valueOf(c2);
} catch(NumberFormatException e){
}
if(c1Int!=null && c2Int!=null){
return c1Int.compareTo(c2Int);
} else {
if(c1Int==null && c2Int==null){
return c1.compareTo(c2);
} else {
if(c1Int==null){
return -1;
} else {
return 1;
}
}
}
}
};
Collections.sort(keys, comparator);
for(String key:keys){
ComputationValue outputComputationValue = outputParameters
.get(key);
outputParametersSorted.put(key, outputComputationValue);
}
ComputationData computationData = new ComputationData(
computationId, inputParametersSorted,
outputParametersSorted, operatorDescritpion, startDate,
endDate, status, executionType, vre);
logger.debug("ComputationData: " + computationData);
return computationData;
} catch (DataMinerServiceException e) {
logger.error("Error in getComutationDataByComputationProperties: "
+ e.getLocalizedMessage());
e.printStackTrace();
throw e;
} catch (Throwable e) {
logger.error("Error in getComutationDataByComputationProperties: "
+ e.getLocalizedMessage());
e.printStackTrace();
throw new Exception(e.getLocalizedMessage(), e);
}
ComputationValueBuilder computationValueBuilder = new ComputationValueBuilder(
inputValueParameters);
LinkedHashMap<String, ComputationValue> inputParameters = computationValueBuilder
.create();
computationValueBuilder = new ComputationValueBuilder(
outputValueParameters);
LinkedHashMap<String, ComputationValue> outputParameters = computationValueBuilder
.create();
ComputationData computationData = new ComputationData(computationId,
inputParameters, outputParameters, operatorDescritpion,
startDate, endDate, status, executionType, vre);
logger.debug("ComputationData: " + computationData);
return computationData;
}
}

View File

@ -19,9 +19,9 @@ public class Constants {
public static final String DEFAULT_USER = "giancarlo.panichi";
public static final String DEFAULT_ROLE = "OrganizationMember";
//public static final String DEFAULT_SCOPE = "/gcube/devsec/devVRE";
public static final String DEFAULT_SCOPE = "/gcube/devsec/devVRE";
// public final static String DEFAULT_SCOPE = "/gcube/devNext";
public final static String DEFAULT_SCOPE = "/gcube/devNext/NextNext";
//public final static String DEFAULT_SCOPE = "/gcube/devNext/NextNext";

View File

@ -16,6 +16,7 @@ public class ComputationValue implements Serializable {
public ComputationValue() {
super();
this.type = ComputationValueType.String;
}
public ComputationValue(ComputationValueType type) {

View File

@ -13,7 +13,7 @@ public class ComputationValueFile extends ComputationValue {
private String mimeType;
public ComputationValueFile() {
super();
super(ComputationValueType.File);
}
public ComputationValueFile(String url, String fileName, String mimeType) {

View File

@ -15,7 +15,7 @@ public class ComputationValueFileList extends ComputationValue {
private String separator;
public ComputationValueFileList() {
super();
super(ComputationValueType.FileList);
}
public ComputationValueFileList(ArrayList<ComputationValue> fileList,

View File

@ -13,7 +13,7 @@ public class ComputationValueImage extends ComputationValue {
private String mimeType;
public ComputationValueImage(){
super();
super(ComputationValueType.Image);
}
public ComputationValueImage(String url, String fileName, String mimeType) {

View File

@ -4,6 +4,7 @@
package org.gcube.portlets.user.dataminermanager.shared.data.output;
import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.Map;
/**
@ -18,7 +19,7 @@ public class MapResource extends Resource implements Serializable {
*
*/
private static final long serialVersionUID = 8772836076910728324L;
private Map<String, Resource> map;
private LinkedHashMap<String, Resource> map;
/**
*
@ -29,7 +30,7 @@ public class MapResource extends Resource implements Serializable {
}
public MapResource(String resourceId, String name, String description,
Map<String, Resource> map) {
LinkedHashMap<String, Resource> map) {
super(resourceId, name, description, ResourceType.MAP);
this.map = map;
}
@ -38,7 +39,7 @@ public class MapResource extends Resource implements Serializable {
return map;
}
public void setMap(Map<String, Resource> map) {
public void setMap(LinkedHashMap<String, Resource> map) {
this.map = map;
}

View File

@ -10,7 +10,7 @@
<!-- <inherits name="com.google.gwt.logging.Logging" /> -->
<inherits name="com.allen_sauer.gwt.log.gwt-log-TRACE" />
<!-- Debug CSS style -->
<!-- Debug CSS style -->
<set-configuration-property name="CssResource.style"
value="pretty" />
@ -36,14 +36,12 @@
value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED"
/> -->
<set-property name="log_ConsoleLogger" value="DISABLED" />
<set-property name="log_DivLogger" value="DISABLED" />
<set-property name="log_GWTLogger" value="DISABLED" />
<set-property name="log_SystemLogger" value="DISABLED" />
<source path='client' />
<source path='shared' />