2521: Explore the possibility to port the StatMan interface onto Dataminer
https://support.d4science.org/issues/2521 Added Properties visualization git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/data-miner-manager@128483 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
5f5f81841b
commit
08931aed39
|
@ -1,5 +1,10 @@
|
||||||
package org.gcube.portlets.user.dataminermanager.client.computations;
|
package org.gcube.portlets.user.dataminermanager.client.computations;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
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.events.DataMinerWorkAreaEvent;
|
import org.gcube.portlets.user.dataminermanager.client.events.DataMinerWorkAreaEvent;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.events.DeleteItemRequestEvent;
|
import org.gcube.portlets.user.dataminermanager.client.events.DeleteItemRequestEvent;
|
||||||
|
@ -16,6 +21,7 @@ import org.gcube.portlets.widgets.workspaceuploader.client.uploader.DialogUpload
|
||||||
import org.gcube.portlets.widgets.workspaceuploader.client.uploader.dragdrop.MultipleDNDUpload;
|
import org.gcube.portlets.widgets.workspaceuploader.client.uploader.dragdrop.MultipleDNDUpload;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.client.explore.WorkspaceResourcesExplorerPanel;
|
import org.gcube.portlets.widgets.wsexplorer.client.explore.WorkspaceResourcesExplorerPanel;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
|
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
|
||||||
|
import org.gcube.portlets.widgets.wsexplorer.shared.FilterCriteria;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
@ -178,10 +184,24 @@ public class ComputationsPanel extends FramedPanel {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<String> showProperties = new ArrayList<String>();
|
||||||
|
showProperties.add(ComputationsProperties.COMPUTATION_ID.getLabel());
|
||||||
|
showProperties.add(ComputationsProperties.OPERATOR_NAME.getLabel());
|
||||||
|
//showProperties.add(ComputationsProperties.OPERATOR_DESCRIPTION.getLabel());
|
||||||
|
showProperties.add(ComputationsProperties.START_DATE.getLabel());
|
||||||
|
showProperties.add(ComputationsProperties.END_DATE.getLabel());
|
||||||
|
showProperties.add(ComputationsProperties.STATUS.getLabel());
|
||||||
|
showProperties.add(ComputationsProperties.VRE.getLabel());
|
||||||
|
//showProperties.add(ComputationsProperties.EXECUTION_TYPE.getLabel());
|
||||||
|
|
||||||
|
FilterCriteria filterCriteria = new FilterCriteria();
|
||||||
|
Map<String, String> map = new HashMap<String, String>();
|
||||||
|
filterCriteria.setRequiredProperties(map);
|
||||||
|
|
||||||
wsResourcesExplorerPanel = new WorkspaceResourcesExplorerPanel(
|
wsResourcesExplorerPanel = new WorkspaceResourcesExplorerPanel(
|
||||||
event.getDataMinerWorkArea().getComputations().getFolder()
|
event.getDataMinerWorkArea().getComputations().getFolder()
|
||||||
.getId(), false);
|
.getId(), false, showProperties, filterCriteria);
|
||||||
WorskpaceExplorerSelectNotificationListener wsResourceExplorerListener = new WorskpaceExplorerSelectNotificationListener() {
|
WorskpaceExplorerSelectNotificationListener wsResourceExplorerListener = new WorskpaceExplorerSelectNotificationListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onSelectedItem(Item item) {
|
public void onSelectedItem(Item item) {
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
package org.gcube.portlets.user.dataminermanager.client.computations;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Giancarlo Panichi
|
||||||
|
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public enum ComputationsProperties {
|
||||||
|
OPERATOR_DESCRIPTION("operator_description"), OPERATOR_NAME(
|
||||||
|
"operator_name:"), END_DATE("end_date"), ERROR("error"), COMPUTATION_ID(
|
||||||
|
"computation_id"), STATUS("status"), VRE("VRE"), EXECUTION_TYPE(
|
||||||
|
"execution_type"), START_DATE("start_date");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param text
|
||||||
|
*/
|
||||||
|
private ComputationsProperties(final String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
private final String id;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ComputationsProperties getFromId(String id) {
|
||||||
|
for (ComputationsProperties prop : values()) {
|
||||||
|
if (prop.id.compareToIgnoreCase(id) == 0) {
|
||||||
|
return prop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -3,12 +3,14 @@
|
||||||
*/
|
*/
|
||||||
.progressWrapGreen {
|
.progressWrapGreen {
|
||||||
border: 1px solid #65cf81;
|
border: 1px solid #65cf81;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
@sprite .progressInnerGreen {
|
@sprite .progressInnerGreen {
|
||||||
background-color: #e0f3e5;
|
background-color: #e0f3e5;
|
||||||
gwt-image: 'innerBarGreen';
|
gwt-image: 'innerBarGreen';
|
||||||
height: auto;
|
height: auto;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
@sprite .progressBarGreen {
|
@sprite .progressBarGreen {
|
||||||
|
@ -37,4 +39,12 @@
|
||||||
.progressTextBackGreen {
|
.progressTextBackGreen {
|
||||||
color: #399544 !important;
|
color: #399544 !important;
|
||||||
z-index: 9 !important;
|
z-index: 9 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
@if user.agent ie6 ie8 ie9 {
|
||||||
|
.progressTextBackGreen {
|
||||||
|
line-height: 15px;
|
||||||
|
color: #953941 !important;
|
||||||
|
z-index: 9 !important;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -3,12 +3,14 @@
|
||||||
*/
|
*/
|
||||||
.progressWrapRed {
|
.progressWrapRed {
|
||||||
border: 1px solid #cf656f;
|
border: 1px solid #cf656f;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
@sprite .progressInnerRed {
|
@sprite .progressInnerRed {
|
||||||
background-color: #f3e0e2;
|
background-color: #f3e0e2;
|
||||||
gwt-image: 'innerBarRed';
|
gwt-image: 'innerBarRed';
|
||||||
height: auto;
|
height: auto;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
@sprite .progressBarRed {
|
@sprite .progressBarRed {
|
||||||
|
@ -37,4 +39,12 @@
|
||||||
.progressTextBackRed {
|
.progressTextBackRed {
|
||||||
color: #953941 !important;
|
color: #953941 !important;
|
||||||
z-index: 9 !important;
|
z-index: 9 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
@if user.agent ie6 ie8 ie9 {
|
||||||
|
.progressTextBackRed {
|
||||||
|
line-height: 15px;
|
||||||
|
color: #953941 !important;
|
||||||
|
z-index: 9 !important;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
package org.gcube.portlets.user.dataminermanager.client.dataspace;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Giancarlo Panichi email: <a
|
||||||
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public enum DataSpaceProperties {
|
||||||
|
COMPUTATION_ID("computation_id"), DATA_ID("data_id"), DATA_TYPE("data_type"), OPERATOR_NAME(
|
||||||
|
"operator_name"), VRE("VRE");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param text
|
||||||
|
*/
|
||||||
|
private DataSpaceProperties(final String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
private final String id;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DataSpaceProperties getFromId(String id) {
|
||||||
|
for (DataSpaceProperties prop : values()) {
|
||||||
|
if (prop.id.compareToIgnoreCase(id) == 0) {
|
||||||
|
return prop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,5 +1,10 @@
|
||||||
package org.gcube.portlets.user.dataminermanager.client.dataspace;
|
package org.gcube.portlets.user.dataminermanager.client.dataspace;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
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.events.DataMinerWorkAreaEvent;
|
import org.gcube.portlets.user.dataminermanager.client.events.DataMinerWorkAreaEvent;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.events.DeleteItemRequestEvent;
|
import org.gcube.portlets.user.dataminermanager.client.events.DeleteItemRequestEvent;
|
||||||
|
@ -16,6 +21,7 @@ import org.gcube.portlets.widgets.workspaceuploader.client.uploader.DialogUpload
|
||||||
import org.gcube.portlets.widgets.workspaceuploader.client.uploader.dragdrop.MultipleDNDUpload;
|
import org.gcube.portlets.widgets.workspaceuploader.client.uploader.dragdrop.MultipleDNDUpload;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.client.explore.WorkspaceResourcesExplorerPanel;
|
import org.gcube.portlets.widgets.wsexplorer.client.explore.WorkspaceResourcesExplorerPanel;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
|
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
|
||||||
|
import org.gcube.portlets.widgets.wsexplorer.shared.FilterCriteria;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
@ -49,6 +55,7 @@ public class InputDataSetsPanel extends ContentPanel {
|
||||||
private TextButton btnDelete;
|
private TextButton btnDelete;
|
||||||
private TextButton btnRefresh;
|
private TextButton btnRefresh;
|
||||||
private VerticalLayoutContainer v;
|
private VerticalLayoutContainer v;
|
||||||
|
|
||||||
|
|
||||||
public InputDataSetsPanel() {
|
public InputDataSetsPanel() {
|
||||||
super();
|
super();
|
||||||
|
@ -177,9 +184,19 @@ public class InputDataSetsPanel extends ContentPanel {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<String> showProperties = new ArrayList<String>();
|
||||||
|
showProperties.add(DataSpaceProperties.COMPUTATION_ID.getLabel());
|
||||||
|
showProperties.add(DataSpaceProperties.DATA_ID.getLabel());
|
||||||
|
showProperties.add(DataSpaceProperties.DATA_TYPE.getLabel());
|
||||||
|
showProperties.add(DataSpaceProperties.OPERATOR_NAME.getLabel());
|
||||||
|
showProperties.add(DataSpaceProperties.VRE.getLabel());
|
||||||
|
FilterCriteria filterCriteria = new FilterCriteria();
|
||||||
|
Map<String, String> map = new HashMap<String, String>();
|
||||||
|
filterCriteria.setRequiredProperties(map);
|
||||||
|
|
||||||
wsResourcesExplorerPanel = new WorkspaceResourcesExplorerPanel(
|
wsResourcesExplorerPanel = new WorkspaceResourcesExplorerPanel(
|
||||||
event.getDataMinerWorkArea().getInputDataSets().getFolder()
|
event.getDataMinerWorkArea().getInputDataSets().getFolder()
|
||||||
.getId(), false);
|
.getId(), false, showProperties, filterCriteria);
|
||||||
WorskpaceExplorerSelectNotificationListener wsResourceExplorerListener = new WorskpaceExplorerSelectNotificationListener() {
|
WorskpaceExplorerSelectNotificationListener wsResourceExplorerListener = new WorskpaceExplorerSelectNotificationListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onSelectedItem(Item item) {
|
public void onSelectedItem(Item item) {
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
package org.gcube.portlets.user.dataminermanager.client.dataspace;
|
package org.gcube.portlets.user.dataminermanager.client.dataspace;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
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.events.DataMinerWorkAreaEvent;
|
import org.gcube.portlets.user.dataminermanager.client.events.DataMinerWorkAreaEvent;
|
||||||
import org.gcube.portlets.user.dataminermanager.client.events.DeleteItemRequestEvent;
|
import org.gcube.portlets.user.dataminermanager.client.events.DeleteItemRequestEvent;
|
||||||
|
@ -16,6 +21,7 @@ import org.gcube.portlets.widgets.workspaceuploader.client.uploader.DialogUpload
|
||||||
import org.gcube.portlets.widgets.workspaceuploader.client.uploader.dragdrop.MultipleDNDUpload;
|
import org.gcube.portlets.widgets.workspaceuploader.client.uploader.dragdrop.MultipleDNDUpload;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.client.explore.WorkspaceResourcesExplorerPanel;
|
import org.gcube.portlets.widgets.wsexplorer.client.explore.WorkspaceResourcesExplorerPanel;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
|
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
|
||||||
|
import org.gcube.portlets.widgets.wsexplorer.shared.FilterCriteria;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
@ -94,21 +100,20 @@ public class OutputDataSetsPanel extends ContentPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
EventBusProvider.INSTANCE
|
EventBusProvider.INSTANCE
|
||||||
.addHandler(
|
.addHandler(
|
||||||
RefreshDataMinerWorkAreaEvent.TYPE,
|
RefreshDataMinerWorkAreaEvent.TYPE,
|
||||||
new RefreshDataMinerWorkAreaEvent.RefreshDataMinerWorkAreaEventHandler() {
|
new RefreshDataMinerWorkAreaEvent.RefreshDataMinerWorkAreaEventHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRefresh(
|
public void onRefresh(
|
||||||
RefreshDataMinerWorkAreaEvent event) {
|
RefreshDataMinerWorkAreaEvent event) {
|
||||||
manageRefreshDataMinerWorkAreaEvents(event);
|
manageRefreshDataMinerWorkAreaEvents(event);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,7 +146,7 @@ public class OutputDataSetsPanel extends ContentPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void manageRefreshDataMinerWorkAreaEvents(
|
private void manageRefreshDataMinerWorkAreaEvents(
|
||||||
RefreshDataMinerWorkAreaEvent event) {
|
RefreshDataMinerWorkAreaEvent event) {
|
||||||
switch (event.getDataMinerWorkAreaElementType()) {
|
switch (event.getDataMinerWorkAreaElementType()) {
|
||||||
|
@ -157,8 +162,7 @@ public class OutputDataSetsPanel extends ContentPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void create(DataMinerWorkAreaEvent event) {
|
private void create(DataMinerWorkAreaEvent event) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
@ -179,9 +183,20 @@ public class OutputDataSetsPanel extends ContentPanel {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<String> showProperties = new ArrayList<String>();
|
||||||
|
showProperties.add(DataSpaceProperties.COMPUTATION_ID.getLabel());
|
||||||
|
showProperties.add(DataSpaceProperties.DATA_ID.getLabel());
|
||||||
|
showProperties.add(DataSpaceProperties.DATA_TYPE.getLabel());
|
||||||
|
showProperties.add(DataSpaceProperties.OPERATOR_NAME.getLabel());
|
||||||
|
showProperties.add(DataSpaceProperties.VRE.getLabel());
|
||||||
|
FilterCriteria filterCriteria = new FilterCriteria();
|
||||||
|
Map<String, String> map = new HashMap<String, String>();
|
||||||
|
filterCriteria.setRequiredProperties(map);
|
||||||
|
|
||||||
wsResourcesExplorerPanel = new WorkspaceResourcesExplorerPanel(
|
wsResourcesExplorerPanel = new WorkspaceResourcesExplorerPanel(
|
||||||
event.getDataMinerWorkArea().getOutputDataSets()
|
event.getDataMinerWorkArea().getOutputDataSets()
|
||||||
.getFolder().getId(), false);
|
.getFolder().getId(), false, showProperties,
|
||||||
|
filterCriteria);
|
||||||
|
|
||||||
WorskpaceExplorerSelectNotificationListener wsResourceExplorerListener = new WorskpaceExplorerSelectNotificationListener() {
|
WorskpaceExplorerSelectNotificationListener wsResourceExplorerListener = new WorskpaceExplorerSelectNotificationListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -13,7 +13,6 @@ import org.gcube.portlets.user.dataminermanager.client.bean.parameters.TabularPa
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
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.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;
|
||||||
import com.sencha.gxt.widget.core.client.container.HtmlLayoutContainer;
|
import com.sencha.gxt.widget.core.client.container.HtmlLayoutContainer;
|
||||||
|
@ -80,8 +79,8 @@ public class TabularListFld extends AbstractFld {
|
||||||
descr.addStyleName("workflow-fieldDescription");
|
descr.addStyleName("workflow-fieldDescription");
|
||||||
}
|
}
|
||||||
|
|
||||||
horiz.add(listContainer, new BoxLayoutData(new Margins(0)));
|
horiz.add(listContainer);
|
||||||
horiz.add(descr, new BoxLayoutData(new Margins(0)));
|
horiz.add(descr);
|
||||||
|
|
||||||
fieldContainer.add(horiz, new MarginData(new Margins(0)));
|
fieldContainer.add(horiz, new MarginData(new Margins(0)));
|
||||||
fieldContainer.forceLayout();
|
fieldContainer.forceLayout();
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package org.gcube.portlets.user.dataminermanager.server.smservice;
|
package org.gcube.portlets.user.dataminermanager.server.smservice;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.InputStream;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -39,11 +41,13 @@ import org.gcube.portlets.user.dataminermanager.client.bean.output.ObjectResourc
|
||||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource;
|
import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource;
|
||||||
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.client.bean.parameters.TabularListParameter;
|
||||||
import org.gcube.portlets.user.dataminermanager.server.is.InformationSystemUtils;
|
import org.gcube.portlets.user.dataminermanager.server.is.InformationSystemUtils;
|
||||||
import org.gcube.portlets.user.dataminermanager.server.smservice.wps.ProcessInformations;
|
import org.gcube.portlets.user.dataminermanager.server.smservice.wps.ProcessInformations;
|
||||||
import org.gcube.portlets.user.dataminermanager.server.smservice.wps.ResponseWPS;
|
import org.gcube.portlets.user.dataminermanager.server.smservice.wps.ResponseWPS;
|
||||||
import org.gcube.portlets.user.dataminermanager.server.smservice.wps.StatWPSClientSession;
|
import org.gcube.portlets.user.dataminermanager.server.smservice.wps.StatWPSClientSession;
|
||||||
import org.gcube.portlets.user.dataminermanager.server.smservice.wps.WPS2SM;
|
import org.gcube.portlets.user.dataminermanager.server.smservice.wps.WPS2SM;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.server.storage.StorageUtil;
|
||||||
import org.gcube.portlets.user.dataminermanager.server.util.ServiceCredential;
|
import org.gcube.portlets.user.dataminermanager.server.util.ServiceCredential;
|
||||||
import org.gcube.portlets.user.dataminermanager.shared.Constants;
|
import org.gcube.portlets.user.dataminermanager.shared.Constants;
|
||||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
|
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
|
||||||
|
@ -315,7 +319,7 @@ public class SClient4WPS extends SClient {
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
logger.error(e.getLocalizedMessage());
|
logger.error(e.getLocalizedMessage());
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new Exception(e.getLocalizedMessage(),e);
|
throw new Exception(e.getLocalizedMessage(), e);
|
||||||
} finally {
|
} finally {
|
||||||
wpsClient.disconnect(wpsProcessingServlet);
|
wpsClient.disconnect(wpsProcessingServlet);
|
||||||
}
|
}
|
||||||
|
@ -343,7 +347,7 @@ public class SClient4WPS extends SClient {
|
||||||
|
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new Exception(e.getLocalizedMessage(),e);
|
throw new Exception(e.getLocalizedMessage(), e);
|
||||||
} finally {
|
} finally {
|
||||||
if (wpsClient != null) {
|
if (wpsClient != null) {
|
||||||
wpsClient.disconnect(wpsProcessingServlet);
|
wpsClient.disconnect(wpsProcessingServlet);
|
||||||
|
@ -401,7 +405,7 @@ public class SClient4WPS extends SClient {
|
||||||
} else {
|
} else {
|
||||||
throw new Exception(
|
throw new Exception(
|
||||||
"Invalid response from service, "
|
"Invalid response from service, "
|
||||||
+ "response isn't instance of ExecuteResponseDocumentImpl, class is "
|
+ "response isn't instance of ExecuteResponseDocumentImpl, class is "
|
||||||
+ responseObject.getClass());
|
+ responseObject.getClass());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -420,7 +424,8 @@ public class SClient4WPS extends SClient {
|
||||||
if (wpsClient != null)
|
if (wpsClient != null)
|
||||||
wpsClient.disconnect(wpsProcessingServlet);
|
wpsClient.disconnect(wpsProcessingServlet);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.debug("Problems in wps disconnect! "+e.getLocalizedMessage());
|
logger.debug("Problems in wps disconnect! "
|
||||||
|
+ e.getLocalizedMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -512,34 +517,21 @@ public class SClient4WPS extends SClient {
|
||||||
}
|
}
|
||||||
return urls;
|
return urls;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
private static String getExceptionText(String exceptionText) {
|
* private static String getExceptionText(String exceptionText) { try {
|
||||||
try {
|
* String excText = "ExceptionText>"; int idx =
|
||||||
String excText = "ExceptionText>";
|
* exceptionText.indexOf(excText); if (idx >= 0) { String exception =
|
||||||
int idx = exceptionText.indexOf(excText);
|
* exceptionText.substring(idx + excText.length()); exception =
|
||||||
if (idx >= 0) {
|
* exception.substring(0, exception.indexOf("</")); exception = exception
|
||||||
String exception = exceptionText.substring(idx
|
* .replace("<", "") .replace(">", "") .replace("/", " ") .replace("\\",
|
||||||
+ excText.length());
|
* " ") .replaceAll( "[\\]\\[!\"#$%&'\\(\\)*+/:;<=>?@\\^_`{\\|}~-]",
|
||||||
exception = exception.substring(0, exception.indexOf("</"));
|
* "_").trim(); exception = exception.replaceAll("[ ]+", " "); if
|
||||||
exception = exception
|
* (exception.length() > 200) exception = exception.substring(0, 200) +
|
||||||
.replace("<", "")
|
* "..."; return exception; } else return "Process error in WPS Execution";
|
||||||
.replace(">", "")
|
* } catch (Exception e) { e.printStackTrace(); return
|
||||||
.replace("/", " ")
|
* "Backend error in WPS Execution"; } }
|
||||||
.replace("\\", " ")
|
*/
|
||||||
.replaceAll(
|
|
||||||
"[\\]\\[!\"#$%&'\\(\\)*+/:;<=>?@\\^_`{\\|}~-]",
|
|
||||||
"_").trim();
|
|
||||||
exception = exception.replaceAll("[ ]+", " ");
|
|
||||||
if (exception.length() > 200)
|
|
||||||
exception = exception.substring(0, 200) + "...";
|
|
||||||
return exception;
|
|
||||||
} else
|
|
||||||
return "Process error in WPS Execution";
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return "Backend error in WPS Execution";
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
private static void getURLFromXML(org.w3c.dom.Node node,
|
private static void getURLFromXML(org.w3c.dom.Node node,
|
||||||
ResponseWPS responseWPS) {
|
ResponseWPS responseWPS) {
|
||||||
|
@ -680,7 +672,7 @@ public class SClient4WPS extends SClient {
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
logger.error("GetParameters: " + e.getLocalizedMessage());
|
logger.error("GetParameters: " + e.getLocalizedMessage());
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new Exception(e.getLocalizedMessage(),e);
|
throw new Exception(e.getLocalizedMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
LinkedHashMap<String, Parameter> inputParameters = new LinkedHashMap<>();
|
LinkedHashMap<String, Parameter> inputParameters = new LinkedHashMap<>();
|
||||||
|
@ -696,8 +688,8 @@ public class SClient4WPS extends SClient {
|
||||||
Map<String, String> userInputs = new LinkedHashMap<>();
|
Map<String, String> userInputs = new LinkedHashMap<>();
|
||||||
for (Parameter parm : params) {
|
for (Parameter parm : params) {
|
||||||
userInputs.put(parm.getName(), parm.getValue());
|
userInputs.put(parm.getName(), parm.getValue());
|
||||||
logger.debug("UserInputs= key:" + parm.getName() + ", value="
|
logger.debug("UserInputs[key=" + parm.getName() + ", value="
|
||||||
+ parm.getValue());
|
+ parm.getValue() + "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
String processUrl = compute(processInformations, userInputs,
|
String processUrl = compute(processInformations, userInputs,
|
||||||
|
@ -727,48 +719,63 @@ public class SClient4WPS extends SClient {
|
||||||
// setup the inputs
|
// setup the inputs
|
||||||
org.n52.wps.client.ExecuteRequestBuilder executeBuilder = new org.n52.wps.client.ExecuteRequestBuilder(
|
org.n52.wps.client.ExecuteRequestBuilder executeBuilder = new org.n52.wps.client.ExecuteRequestBuilder(
|
||||||
processInformations.getProcessDescription());
|
processInformations.getProcessDescription());
|
||||||
// for each input
|
|
||||||
for (InputDescriptionType input : processInformations.getInputs()) {
|
for (InputDescriptionType input : processInformations.getInputs()) {
|
||||||
// retrieve the input from the sm config
|
|
||||||
String value = userInputs.get(input.getIdentifier()
|
String value = userInputs.get(input.getIdentifier()
|
||||||
.getStringValue());
|
.getStringValue());
|
||||||
|
|
||||||
if (value != null && value.trim().length() > 0) {
|
if (value != null && value.trim().length() > 0) {
|
||||||
/*
|
|
||||||
* String[] values = value.split("\\|"); if (values.length
|
|
||||||
* == 0) { values = new String[1]; values[0] = value; }
|
|
||||||
*/
|
|
||||||
// fulfill an input obj for the execution
|
|
||||||
if (input.isSetLiteralData()) {
|
if (input.isSetLiteralData()) {
|
||||||
logger.debug("Configuring Literal: "
|
logger.debug("Configuring Literal: "
|
||||||
+ input.getIdentifier().getStringValue()
|
+ input.getIdentifier().getStringValue()
|
||||||
+ " to: " + value);
|
+ " to: " + value);
|
||||||
/* for (String v : values) { */
|
|
||||||
executeBuilder.addLiteralData(input.getIdentifier()
|
executeBuilder.addLiteralData(input.getIdentifier()
|
||||||
.getStringValue(), value);
|
.getStringValue(), value);
|
||||||
/* } */
|
|
||||||
} else if (input.isSetBoundingBoxData()) {
|
} else if (input.isSetBoundingBoxData()) {
|
||||||
logger.debug("Configuring Bounding Box: "
|
logger.debug("Configuring Bounding Box: "
|
||||||
+ input.getIdentifier().getStringValue()
|
+ input.getIdentifier().getStringValue()
|
||||||
+ " to: " + value);
|
+ " to: " + value);
|
||||||
|
|
||||||
/* for (String v : values) { */
|
|
||||||
addBoundingBoxInput(executeBuilder, input
|
addBoundingBoxInput(executeBuilder, input
|
||||||
.getIdentifier().getStringValue(), value);
|
.getIdentifier().getStringValue(), value);
|
||||||
/* } */
|
|
||||||
} else {
|
} else {
|
||||||
logger.debug("Configuring Complex: "
|
if (input.isSetComplexData()) {
|
||||||
+ input.getIdentifier().getStringValue()
|
logger.debug("Configuring Complex: "
|
||||||
+ " to: " + value);
|
+ input.getIdentifier().getStringValue()
|
||||||
SupportedComplexDataInputType complex = input
|
+ " to: " + value);
|
||||||
.getComplexData();
|
SupportedComplexDataInputType complex = input
|
||||||
/* for (String v : values) { */
|
.getComplexData();
|
||||||
executeBuilder.addComplexDataReference(input
|
Parameter par = inputParameters.get(input
|
||||||
.getIdentifier().getStringValue(), value,
|
.getIdentifier().getStringValue());
|
||||||
complex.getDefault().getFormat().getSchema(),
|
|
||||||
complex.getDefault().getFormat().getEncoding(),
|
String publicLink;
|
||||||
complex.getDefault().getFormat().getMimeType());
|
if (par instanceof TabularListParameter) {
|
||||||
/* } */
|
// TabularListParameter tabularListParameter =
|
||||||
|
// ((TabularListParameter) par);
|
||||||
|
InputStream tablesStream = new ByteArrayInputStream(
|
||||||
|
value.getBytes());
|
||||||
|
publicLink = StorageUtil
|
||||||
|
.saveOnStorageInTemporalFile(tablesStream);
|
||||||
|
} else {
|
||||||
|
publicLink = value;
|
||||||
|
}
|
||||||
|
executeBuilder.addComplexDataReference(input
|
||||||
|
.getIdentifier().getStringValue(),
|
||||||
|
publicLink, complex.getDefault()
|
||||||
|
.getFormat().getSchema(), complex
|
||||||
|
.getDefault().getFormat()
|
||||||
|
.getEncoding(), complex
|
||||||
|
.getDefault().getFormat()
|
||||||
|
.getMimeType());
|
||||||
|
|
||||||
|
} else {
|
||||||
|
logger.error("This input parameter type is not supported by client library: "
|
||||||
|
+ input);
|
||||||
|
throw new Exception(
|
||||||
|
"This input parameter is not supported by client library: "
|
||||||
|
+ input);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1126,7 +1133,7 @@ public class SClient4WPS extends SClient {
|
||||||
|
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new Exception(e.getLocalizedMessage(),e);
|
throw new Exception(e.getLocalizedMessage(), e);
|
||||||
} finally {
|
} finally {
|
||||||
if (wpsClient != null) {
|
if (wpsClient != null) {
|
||||||
wpsClient.disconnect(wpsProcessingServlet);
|
wpsClient.disconnect(wpsProcessingServlet);
|
||||||
|
|
|
@ -7,6 +7,12 @@ import net.opengis.wps.x100.InputDescriptionType;
|
||||||
import net.opengis.wps.x100.OutputDescriptionType;
|
import net.opengis.wps.x100.OutputDescriptionType;
|
||||||
import net.opengis.wps.x100.ProcessDescriptionType;
|
import net.opengis.wps.x100.ProcessDescriptionType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Giancarlo Panichi
|
||||||
|
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class ProcessInformations implements Serializable {
|
public class ProcessInformations implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4729933672312944832L;
|
private static final long serialVersionUID = 4729933672312944832L;
|
||||||
|
|
|
@ -5,9 +5,12 @@ import java.io.InputStream;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
import java.net.URLStreamHandler;
|
import java.net.URLStreamHandler;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.gcube.common.homelibrary.home.Home;
|
import org.gcube.common.homelibrary.home.Home;
|
||||||
|
@ -22,7 +25,11 @@ import org.gcube.common.homelibrary.home.workspace.exceptions.ItemNotFoundExcept
|
||||||
import org.gcube.common.homelibrary.home.workspace.exceptions.WorkspaceFolderNotFoundException;
|
import org.gcube.common.homelibrary.home.workspace.exceptions.WorkspaceFolderNotFoundException;
|
||||||
import org.gcube.common.homelibrary.home.workspace.exceptions.WrongItemTypeException;
|
import org.gcube.common.homelibrary.home.workspace.exceptions.WrongItemTypeException;
|
||||||
import org.gcube.common.homelibrary.home.workspace.folder.items.ExternalImage;
|
import org.gcube.common.homelibrary.home.workspace.folder.items.ExternalImage;
|
||||||
|
import org.gcube.contentmanagement.blobstorage.service.IClient;
|
||||||
import org.gcube.contentmanager.storageclient.model.protocol.smp.SMPURLConnection;
|
import org.gcube.contentmanager.storageclient.model.protocol.smp.SMPURLConnection;
|
||||||
|
import org.gcube.contentmanager.storageclient.wrapper.AccessType;
|
||||||
|
import org.gcube.contentmanager.storageclient.wrapper.MemoryType;
|
||||||
|
import org.gcube.contentmanager.storageclient.wrapper.StorageClient;
|
||||||
import org.gcube.portlets.user.dataminermanager.shared.exception.ServiceException;
|
import org.gcube.portlets.user.dataminermanager.shared.exception.ServiceException;
|
||||||
|
|
||||||
public class StorageUtil {
|
public class StorageUtil {
|
||||||
|
@ -250,9 +257,7 @@ public class StorageUtil {
|
||||||
throw new ServiceException(e.getLocalizedMessage());
|
throw new ServiceException(e.getLocalizedMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param user
|
* @param user
|
||||||
|
@ -263,7 +268,7 @@ public class StorageUtil {
|
||||||
throws ServiceException {
|
throws ServiceException {
|
||||||
Workspace ws;
|
Workspace ws;
|
||||||
try {
|
try {
|
||||||
logger.debug("User: "+user+", ItemId:"+itemId);
|
logger.debug("User: " + user + ", ItemId:" + itemId);
|
||||||
ws = HomeLibrary.getUserWorkspace(user);
|
ws = HomeLibrary.getUserWorkspace(user);
|
||||||
|
|
||||||
ws.removeItems(itemId);
|
ws.removeItems(itemId);
|
||||||
|
@ -278,5 +283,30 @@ public class StorageUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String saveOnStorageInTemporalFile(InputStream is)
|
||||||
|
throws ServiceException {
|
||||||
|
try {
|
||||||
|
logger.debug("SaveOnStorageInTemporalFile()");
|
||||||
|
SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMdd_HHmmss");
|
||||||
|
Double v=Math.random()*10000;
|
||||||
|
String tempFile = "P_"+sdf.format(new Date())+"_"+ v.intValue()+".xml";
|
||||||
|
String remotePath = "/DataMiner/AlgoritmsParameters/" + tempFile;
|
||||||
|
IClient client = new StorageClient("DataAnalysis", "DataMiner",
|
||||||
|
"DataMiner", AccessType.PUBLIC, MemoryType.VOLATILE)
|
||||||
|
.getClient();
|
||||||
|
String storageId=client.put(true).LFile(is).RFile(remotePath);
|
||||||
|
logger.debug("Storage id: "+storageId);
|
||||||
|
String publicLink = client.getHttpUrl().RFile(remotePath);
|
||||||
|
logger.debug("Storage public link: "+publicLink);
|
||||||
|
return publicLink;
|
||||||
|
|
||||||
|
} catch (Throwable e) {
|
||||||
|
logger.error(e.getLocalizedMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue