2521: Explore the possibility to port the StatMan interface onto Dataminer
https://support.d4science.org/issues/2521 Fixed Progress Status git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/data-miner-manager@128468 82a268e6-3cf1-43bd-a215-b396298e98cf
2
pom.xml
|
@ -471,7 +471,7 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.distribution</groupId>
|
||||
<artifactId>maven-portal-bom</artifactId>
|
||||
<version>LATEST</version>
|
||||
<version>2.6.0-SNAPSHOT</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
|
|
@ -252,7 +252,7 @@ public class DataMinerManagerController {
|
|||
UtilsGXT3.alert("Error",
|
||||
"Failed to start computation "
|
||||
+ event.getOp().getName()
|
||||
+ ", the computation id is null");
|
||||
+ ", the computation id is null!");
|
||||
else {
|
||||
startComputation(computationId,
|
||||
event.getComputationStatusPanelIndex());
|
||||
|
@ -263,9 +263,8 @@ public class DataMinerManagerController {
|
|||
public void onFailure(Throwable caught) {
|
||||
UtilsGXT3.alert("Error",
|
||||
"Failed to start computation "
|
||||
+ event.getOp().getName()
|
||||
+ "<br/>Cause:" + caught.getCause()
|
||||
+ "<br/>Message:" + caught.getMessage());
|
||||
+ event.getOp().getName() + "! "
|
||||
+ caught.getLocalizedMessage());
|
||||
caught.printStackTrace();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
.progressWrap {
|
||||
border:1px solid;
|
||||
overflow:hidden;
|
||||
border-color:#65cf6d;
|
||||
}
|
||||
|
||||
.progressInner {
|
||||
height:18px;
|
||||
background:repeat-x;
|
||||
position:relative;
|
||||
}
|
||||
|
||||
.progressBar {
|
||||
height:18px;
|
||||
width:0;
|
||||
border-top:1px solid;
|
||||
border-bottom:1px solid;
|
||||
border-right:1px solid;
|
||||
}
|
||||
|
||||
.progressText {
|
||||
padding:1px 5px;
|
||||
overflow:hidden;
|
||||
position:absolute;
|
||||
left:0;
|
||||
text-align:center;
|
||||
font-size:11px;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.progressBar .progressText {
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.progressTextBack {
|
||||
z-index: 9 !important;
|
||||
}
|
||||
|
||||
@if user.agent ie6 ie8 ie9 {
|
||||
.progressTextBack {
|
||||
line-height:15px;
|
||||
}
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.custom;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.resources.client.ClientBundle;
|
||||
import com.google.gwt.resources.client.ImageResource;
|
||||
import com.google.gwt.resources.client.ImageResource.ImageOptions;
|
||||
import com.google.gwt.resources.client.ImageResource.RepeatStyle;
|
||||
import com.sencha.gxt.theme.base.client.progress.ProgressBarDefaultAppearance;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class GreenProgressBarAppaearance extends ProgressBarDefaultAppearance {
|
||||
|
||||
public interface GreenProgressBarResources extends ProgressBarResources,
|
||||
ClientBundle {
|
||||
|
||||
@Source({ "GreenProgressBar.css" })
|
||||
@Override
|
||||
ProgressBarStyle style();
|
||||
|
||||
@Source("green-progress-bg.gif")
|
||||
@Override
|
||||
@ImageOptions(repeatStyle = RepeatStyle.Horizontal)
|
||||
ImageResource bar();
|
||||
|
||||
@Source("green-bg.gif")
|
||||
@ImageOptions(repeatStyle = RepeatStyle.Horizontal)
|
||||
ImageResource innerBar();
|
||||
}
|
||||
|
||||
public GreenProgressBarAppaearance() {
|
||||
super(
|
||||
GWT.<ProgressBarResources> create(GreenProgressBarResources.class),
|
||||
GWT.<ProgressBarTemplate> create(ProgressBarTemplate.class));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
.progressWrap {
|
||||
border:1px solid;
|
||||
overflow:hidden;
|
||||
border-color:#cf6572;
|
||||
}
|
||||
|
||||
.progressInner {
|
||||
height:18px;
|
||||
background:repeat-x;
|
||||
position:relative;
|
||||
}
|
||||
|
||||
.progressBar {
|
||||
height:18px;
|
||||
width:0;
|
||||
border-top:1px solid;
|
||||
border-bottom:1px solid;
|
||||
border-right:1px solid;
|
||||
}
|
||||
|
||||
.progressText {
|
||||
padding:1px 5px;
|
||||
overflow:hidden;
|
||||
position:absolute;
|
||||
left:0;
|
||||
text-align:center;
|
||||
font-size:11px;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.progressBar .progressText {
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.progressTextBack {
|
||||
z-index: 9 !important;
|
||||
}
|
||||
|
||||
@if user.agent ie6 ie8 ie9 {
|
||||
.progressTextBack {
|
||||
line-height:15px;
|
||||
}
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.custom;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.resources.client.ClientBundle;
|
||||
import com.google.gwt.resources.client.ImageResource;
|
||||
import com.google.gwt.resources.client.ImageResource.ImageOptions;
|
||||
import com.google.gwt.resources.client.ImageResource.RepeatStyle;
|
||||
import com.sencha.gxt.theme.base.client.progress.ProgressBarDefaultAppearance;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class RedProgressBarAppaearance extends ProgressBarDefaultAppearance {
|
||||
|
||||
public interface RedProgressBarResources extends ProgressBarResources,
|
||||
ClientBundle {
|
||||
|
||||
@Source({"RedProgressBar.css" })
|
||||
@Override
|
||||
ProgressBarStyle style();
|
||||
|
||||
@Source("red-progress-bg.gif")
|
||||
@Override
|
||||
@ImageOptions(repeatStyle = RepeatStyle.Horizontal)
|
||||
ImageResource bar();
|
||||
|
||||
@Source("red-bg.gif")
|
||||
@ImageOptions(repeatStyle = RepeatStyle.Horizontal)
|
||||
ImageResource innerBar();
|
||||
}
|
||||
|
||||
public RedProgressBarAppaearance() {
|
||||
super(
|
||||
GWT.<RedProgressBarResources> create(RedProgressBarResources.class),
|
||||
GWT.<ProgressBarTemplate> create(ProgressBarTemplate.class));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
.progressWrapGreen {
|
||||
border: 1px solid #65cf81;
|
||||
}
|
||||
|
||||
@sprite .progressInnerGreen {
|
||||
background-color: #e0f3e5;
|
||||
gwt-image: 'innerBarGreen';
|
||||
height: auto;
|
||||
}
|
||||
|
||||
@sprite .progressBarGreen {
|
||||
background-color: #9ceeb0;
|
||||
gwt-image: 'barGreen';
|
||||
background-repeat: repeat-x;
|
||||
background-position: left center;
|
||||
height: 18px;
|
||||
border-top-color: #d1fdd9;
|
||||
border-bottom-color: #7fe498;
|
||||
border-right-color: #7fe498;
|
||||
}
|
||||
|
||||
.progressTextGreen {
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
font-weight: bold;
|
||||
font-family: sans-serif;
|
||||
padding: 1px 5px;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.progressTextBackGreen {
|
||||
color: #399544 !important;
|
||||
z-index: 9 !important;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
<div class="{style.progressWrapGreen}" style="{wrapStyles}">
|
||||
<div class="{style.progressInnerGreen}">
|
||||
<div class="{style.progressBarGreen}" style="{progressBarStyles}">
|
||||
<div class="{style.progressTextGreen}" style="{progressTextStyles}">
|
||||
<div style="{widthStyles}">{text}</div>
|
||||
</div>
|
||||
<div class="{style.progressTextGreen} {style.progressTextBackGreen}">
|
||||
<div style="{widthStyles}">{text}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,4 +1,4 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.custom;
|
||||
package org.gcube.portlets.user.dataminermanager.client.custom.progress;
|
||||
|
||||
import com.sencha.gxt.cell.core.client.ProgressBarCell;
|
||||
import com.sencha.gxt.widget.core.client.ProgressBar;
|
||||
|
@ -12,7 +12,7 @@ import com.sencha.gxt.widget.core.client.ProgressBar;
|
|||
public class GreenProgressBar extends ProgressBar {
|
||||
|
||||
public GreenProgressBar() {
|
||||
super(new ProgressBarCell(new GreenProgressBarAppaearance()));
|
||||
super(new ProgressBarCell(new GreenProgressBarAppearance()));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,132 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.custom.progress;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.resources.client.ClientBundle;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
import com.google.gwt.resources.client.ImageResource;
|
||||
import com.google.gwt.resources.client.ImageResource.ImageOptions;
|
||||
import com.google.gwt.resources.client.ImageResource.RepeatStyle;
|
||||
import com.google.gwt.safecss.shared.SafeStyles;
|
||||
import com.google.gwt.safecss.shared.SafeStylesUtils;
|
||||
import com.google.gwt.safehtml.shared.SafeHtml;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
|
||||
import com.sencha.gxt.cell.core.client.ProgressBarCell.ProgressBarAppearance;
|
||||
import com.sencha.gxt.cell.core.client.ProgressBarCell.ProgressBarAppearanceOptions;
|
||||
import com.sencha.gxt.core.client.GXT;
|
||||
import com.sencha.gxt.core.client.XTemplates;
|
||||
import com.sencha.gxt.core.client.util.Format;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class GreenProgressBarAppearance implements ProgressBarAppearance {
|
||||
|
||||
public interface GreenProgressBarResources {
|
||||
|
||||
ImageResource barGreen();
|
||||
|
||||
ImageResource innerBarGreen();
|
||||
|
||||
GreenProgressBarStyle style();
|
||||
|
||||
}
|
||||
|
||||
public interface GreenProgressBarStyle extends CssResource {
|
||||
|
||||
String progressBarGreen();
|
||||
|
||||
String progressInnerGreen();
|
||||
|
||||
String progressTextGreen();
|
||||
|
||||
String progressTextBackGreen();
|
||||
|
||||
String progressWrapGreen();
|
||||
|
||||
}
|
||||
|
||||
public interface GreenProgressBarTemplate extends XTemplates {
|
||||
|
||||
@XTemplate(source = "GreenProgressBar.html")
|
||||
SafeHtml render(SafeHtml text, GreenProgressBarStyle style,
|
||||
SafeStyles wrapStyles, SafeStyles progressBarStyles,
|
||||
SafeStyles progressTextStyles, SafeStyles widthStyles);
|
||||
|
||||
}
|
||||
|
||||
public interface GreenProgressBarDefaultResources extends
|
||||
GreenProgressBarResources, ClientBundle {
|
||||
|
||||
@Source({ "GreenProgressBar.css" })
|
||||
@Override
|
||||
GreenProgressBarStyle style();
|
||||
|
||||
@Source("green-progress-bg.gif")
|
||||
@ImageOptions(repeatStyle = RepeatStyle.Horizontal)
|
||||
@Override
|
||||
ImageResource barGreen();
|
||||
|
||||
@Source("green-bg.gif")
|
||||
@ImageOptions(repeatStyle = RepeatStyle.Horizontal)
|
||||
@Override
|
||||
ImageResource innerBarGreen();
|
||||
}
|
||||
|
||||
private final GreenProgressBarStyle style;
|
||||
private GreenProgressBarTemplate template;
|
||||
|
||||
|
||||
public GreenProgressBarAppearance() {
|
||||
this(
|
||||
GWT.<GreenProgressBarDefaultResources> create(GreenProgressBarDefaultResources.class),
|
||||
GWT.<GreenProgressBarTemplate> create(GreenProgressBarTemplate.class));
|
||||
}
|
||||
|
||||
public GreenProgressBarAppearance(GreenProgressBarResources resources,
|
||||
GreenProgressBarTemplate template) {
|
||||
this.style = resources.style();
|
||||
this.style.ensureInjected();
|
||||
this.template = template;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(SafeHtmlBuilder sb, Double value,
|
||||
ProgressBarAppearanceOptions options) {
|
||||
value = value == null ? 0 : value;
|
||||
double valueWidth = value * options.getWidth();
|
||||
|
||||
int vw = new Double(valueWidth).intValue();
|
||||
|
||||
String text = options.getProgressText();
|
||||
|
||||
if (text != null) {
|
||||
int v = (int) Math.round(value * 100);
|
||||
text = Format.substitute(text, v);
|
||||
}
|
||||
|
||||
SafeHtml txt;
|
||||
if (text == null) {
|
||||
txt = SafeHtmlUtils.fromSafeConstant(" ");
|
||||
} else {
|
||||
txt = SafeHtmlUtils.fromString(text);
|
||||
}
|
||||
|
||||
int adj = GXT.isIE() ? 4 : 2;
|
||||
|
||||
SafeStyles wrapStyles = SafeStylesUtils.fromTrustedString("width:"
|
||||
+ (options.getWidth() - adj) + "px;");
|
||||
SafeStyles progressBarStyles = SafeStylesUtils
|
||||
.fromTrustedString("width:" + vw + "px;");
|
||||
SafeStyles progressTextStyles = SafeStylesUtils
|
||||
.fromTrustedString("width:" + Math.max(vw - 8, 0) + "px;");
|
||||
SafeStyles widthStyles = SafeStylesUtils.fromTrustedString("width:"
|
||||
+ (Math.max(0, options.getWidth() - adj)) + "px;");
|
||||
sb.append(template.render(txt, style, wrapStyles, progressBarStyles,
|
||||
progressTextStyles, widthStyles));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
.progressWrapRed {
|
||||
border: 1px solid #cf656f;
|
||||
}
|
||||
|
||||
@sprite .progressInnerRed {
|
||||
background-color: #f3e0e2;
|
||||
gwt-image: 'innerBarRed';
|
||||
height: auto;
|
||||
}
|
||||
|
||||
@sprite .progressBarRed {
|
||||
background-color: #ee9ca4;
|
||||
gwt-image: 'barRed';
|
||||
background-repeat: repeat-x;
|
||||
background-position: left center;
|
||||
height: 18px;
|
||||
border-top-color: #fdd1d5;
|
||||
border-bottom-color: #e47f88;
|
||||
border-right-color: #e47f88;
|
||||
}
|
||||
|
||||
.progressTextRed {
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
font-weight: bold;
|
||||
font-family: sans-serif;
|
||||
padding: 1px 5px;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.progressTextBackRed {
|
||||
color: #953941 !important;
|
||||
z-index: 9 !important;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
<div class="{style.progressWrapRed}" style="{wrapStyles}">
|
||||
<div class="{style.progressInnerRed}">
|
||||
<div class="{style.progressBarRed}" style="{progressBarStyles}">
|
||||
<div class="{style.progressTextRed}" style="{progressTextStyles}">
|
||||
<div style="{widthStyles}">{text}</div>
|
||||
</div>
|
||||
<div class="{style.progressTextRed} {style.progressTextBackRed}">
|
||||
<div style="{widthStyles}">{text}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,4 +1,4 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.custom;
|
||||
package org.gcube.portlets.user.dataminermanager.client.custom.progress;
|
||||
|
||||
import com.sencha.gxt.cell.core.client.ProgressBarCell;
|
||||
import com.sencha.gxt.widget.core.client.ProgressBar;
|
||||
|
@ -12,7 +12,7 @@ import com.sencha.gxt.widget.core.client.ProgressBar;
|
|||
public class RedProgressBar extends ProgressBar {
|
||||
|
||||
public RedProgressBar() {
|
||||
super(new ProgressBarCell(new RedProgressBarAppaearance()));
|
||||
super(new ProgressBarCell(new RedProgressBarAppearance()));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,132 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.custom.progress;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.resources.client.ClientBundle;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
import com.google.gwt.resources.client.ImageResource;
|
||||
import com.google.gwt.resources.client.ImageResource.ImageOptions;
|
||||
import com.google.gwt.resources.client.ImageResource.RepeatStyle;
|
||||
import com.google.gwt.safecss.shared.SafeStyles;
|
||||
import com.google.gwt.safecss.shared.SafeStylesUtils;
|
||||
import com.google.gwt.safehtml.shared.SafeHtml;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
|
||||
import com.sencha.gxt.cell.core.client.ProgressBarCell.ProgressBarAppearance;
|
||||
import com.sencha.gxt.cell.core.client.ProgressBarCell.ProgressBarAppearanceOptions;
|
||||
import com.sencha.gxt.core.client.GXT;
|
||||
import com.sencha.gxt.core.client.XTemplates;
|
||||
import com.sencha.gxt.core.client.util.Format;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class RedProgressBarAppearance implements ProgressBarAppearance {
|
||||
|
||||
public interface RedProgressBarResources {
|
||||
|
||||
ImageResource barRed();
|
||||
|
||||
ImageResource innerBarRed();
|
||||
|
||||
RedProgressBarStyle style();
|
||||
|
||||
}
|
||||
|
||||
public interface RedProgressBarStyle extends CssResource {
|
||||
|
||||
String progressBarRed();
|
||||
|
||||
String progressInnerRed();
|
||||
|
||||
String progressTextRed();
|
||||
|
||||
String progressTextBackRed();
|
||||
|
||||
String progressWrapRed();
|
||||
|
||||
}
|
||||
|
||||
public interface RedProgressBarTemplate extends XTemplates {
|
||||
|
||||
@XTemplate(source = "RedProgressBar.html")
|
||||
SafeHtml render(SafeHtml text, RedProgressBarStyle style,
|
||||
SafeStyles wrapStyles, SafeStyles progressBarStyles,
|
||||
SafeStyles progressTextStyles, SafeStyles widthStyles);
|
||||
|
||||
}
|
||||
|
||||
public interface RedProgressBarDefaultResources extends
|
||||
RedProgressBarResources, ClientBundle {
|
||||
|
||||
@Source({ "RedProgressBar.css" })
|
||||
@Override
|
||||
RedProgressBarStyle style();
|
||||
|
||||
@Source("red-progress-bg.gif")
|
||||
@ImageOptions(repeatStyle = RepeatStyle.Horizontal)
|
||||
@Override
|
||||
ImageResource barRed();
|
||||
|
||||
@Source("red-bg.gif")
|
||||
@ImageOptions(repeatStyle = RepeatStyle.Horizontal)
|
||||
@Override
|
||||
ImageResource innerBarRed();
|
||||
}
|
||||
|
||||
private final RedProgressBarStyle style;
|
||||
private RedProgressBarTemplate template;
|
||||
|
||||
|
||||
public RedProgressBarAppearance() {
|
||||
this(
|
||||
GWT.<RedProgressBarDefaultResources> create(RedProgressBarDefaultResources.class),
|
||||
GWT.<RedProgressBarTemplate> create(RedProgressBarTemplate.class));
|
||||
}
|
||||
|
||||
public RedProgressBarAppearance(RedProgressBarResources resources,
|
||||
RedProgressBarTemplate template) {
|
||||
this.style = resources.style();
|
||||
this.style.ensureInjected();
|
||||
this.template = template;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(SafeHtmlBuilder sb, Double value,
|
||||
ProgressBarAppearanceOptions options) {
|
||||
value = value == null ? 0 : value;
|
||||
double valueWidth = value * options.getWidth();
|
||||
|
||||
int vw = new Double(valueWidth).intValue();
|
||||
|
||||
String text = options.getProgressText();
|
||||
|
||||
if (text != null) {
|
||||
int v = (int) Math.round(value * 100);
|
||||
text = Format.substitute(text, v);
|
||||
}
|
||||
|
||||
SafeHtml txt;
|
||||
if (text == null) {
|
||||
txt = SafeHtmlUtils.fromSafeConstant(" ");
|
||||
} else {
|
||||
txt = SafeHtmlUtils.fromString(text);
|
||||
}
|
||||
|
||||
int adj = GXT.isIE() ? 4 : 2;
|
||||
|
||||
SafeStyles wrapStyles = SafeStylesUtils.fromTrustedString("width:"
|
||||
+ (options.getWidth() - adj) + "px;");
|
||||
SafeStyles progressBarStyles = SafeStylesUtils
|
||||
.fromTrustedString("width:" + vw + "px;");
|
||||
SafeStyles progressTextStyles = SafeStylesUtils
|
||||
.fromTrustedString("width:" + Math.max(vw - 8, 0) + "px;");
|
||||
SafeStyles widthStyles = SafeStylesUtils.fromTrustedString("width:"
|
||||
+ (Math.max(0, options.getWidth() - adj)) + "px;");
|
||||
sb.append(template.render(txt, style, wrapStyles, progressBarStyles,
|
||||
progressTextStyles, widthStyles));
|
||||
}
|
||||
|
||||
}
|
Before Width: | Height: | Size: 496 B After Width: | Height: | Size: 496 B |
Before Width: | Height: | Size: 99 B After Width: | Height: | Size: 99 B |
Before Width: | Height: | Size: 492 B After Width: | Height: | Size: 492 B |
Before Width: | Height: | Size: 120 B After Width: | Height: | Size: 120 B |
|
@ -56,12 +56,11 @@ public class ComputationOutputPanel extends SimpleContainer {
|
|||
v = new VerticalLayoutContainer();
|
||||
add(v);
|
||||
|
||||
// request for a jobItem linked with the computationId (or jobId)
|
||||
// request resource by ComputationId
|
||||
DataMinerPortletServiceAsync.INSTANCE.getResourceByComputationId(computationId,
|
||||
new AsyncCallback<Resource>() {
|
||||
@Override
|
||||
public void onSuccess(Resource result) {
|
||||
// unmask();
|
||||
showOutputInfo(result);
|
||||
}
|
||||
|
||||
|
@ -76,12 +75,11 @@ public class ComputationOutputPanel extends SimpleContainer {
|
|||
|
||||
}
|
||||
});
|
||||
|
||||
// this.mask("Loading Result Info...");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jobOutput
|
||||
*
|
||||
* @param resource
|
||||
*/
|
||||
private void showOutputInfo(Resource resource) {
|
||||
try {
|
||||
|
|
|
@ -260,7 +260,7 @@ public class ComputationParametersPanel extends SimpleContainer {
|
|||
"Column parameter \""
|
||||
+ p.getName()
|
||||
+ " refers to a tabular parameter that doesn't exists ("
|
||||
+ tabParamName + ")\"", null);
|
||||
+ tabParamName + ")\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.Operator;
|
||||
import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider;
|
||||
import org.gcube.portlets.user.dataminermanager.client.custom.GreenProgressBar;
|
||||
import org.gcube.portlets.user.dataminermanager.client.custom.RedProgressBar;
|
||||
import org.gcube.portlets.user.dataminermanager.client.custom.progress.GreenProgressBar;
|
||||
import org.gcube.portlets.user.dataminermanager.client.custom.progress.RedProgressBar;
|
||||
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.util.UtilsGXT3;
|
||||
|
@ -135,7 +135,6 @@ public class ComputationStatusPanel extends SimpleContainer {
|
|||
//TODO
|
||||
progressBar =new GreenProgressBar();
|
||||
progressBar.updateProgress(1, "Computation Complete");
|
||||
progressBar.addStyleName("progressBar-complete");
|
||||
vert.insert(progressBar, index, new VerticalLayoutData(1, -1, new Margins(20)));
|
||||
showOutput();
|
||||
|
||||
|
@ -156,7 +155,6 @@ public class ComputationStatusPanel extends SimpleContainer {
|
|||
progressBar =new RedProgressBar();
|
||||
progressBar.updateProgress(1, "Computation Fail");
|
||||
progressBar.getElement().getStyle().setMarginBottom(36, Unit.PX);
|
||||
progressBar.addStyleName("progressBar-failed");
|
||||
vert.insert(progressBar, index, new VerticalLayoutData(1, -1, new Margins(20)));
|
||||
}
|
||||
|
||||
|
@ -207,7 +205,6 @@ public class ComputationStatusPanel extends SimpleContainer {
|
|||
progressBar =new RedProgressBar();
|
||||
progressBar.updateProgress(1, "Failed to get the status");
|
||||
progressBar.getElement().getStyle().setMarginBottom(36, Unit.PX);
|
||||
progressBar.addStyleName("progressBar-failed");
|
||||
vert.insert(progressBar, index, new VerticalLayoutData(1, -1, new Margins(20)));
|
||||
|
||||
}
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.rpc;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.OperatorsClassification;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.ImagesResource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.MapResource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
|
||||
|
@ -27,44 +24,17 @@ import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
|
|||
@RemoteServiceRelativePath("dataminerman")
|
||||
public interface DataMinerPortletService extends RemoteService {
|
||||
|
||||
/*
|
||||
// get tables info belongs to a given templates set (for relative user)
|
||||
public List<TableItemSimple> getTableItems(List<String> templates)
|
||||
throws Exception;
|
||||
*/
|
||||
public List<TableItemSimple> getFileItems(List<String> templates)
|
||||
throws Exception;
|
||||
|
||||
public Resource getResourceByComputationId(ComputationId computationId);
|
||||
|
||||
public Map<String, String> getParametersMapByComputationId(ComputationId computationId) throws ServiceException;
|
||||
|
||||
|
||||
public Map<String, Resource> getMapFromMapResource(MapResource mapResource)
|
||||
throws Exception;
|
||||
|
||||
// Map<String, String> getImagesInfoFromImagesResource(ImagesResource
|
||||
// imgsRes) throws Exception;
|
||||
|
||||
public String saveImage(ComputationId computationId, ImagesResource imageResource)
|
||||
throws Exception;
|
||||
|
||||
|
||||
/**
|
||||
* Dataminer
|
||||
*
|
||||
*/
|
||||
public UserInfo hello() throws ServiceException;
|
||||
|
||||
public List<OperatorsClassification> getOperatorsClassifications()
|
||||
throws Exception;
|
||||
throws ServiceException;
|
||||
|
||||
public List<Parameter> getParameters(Operator operator) throws Exception;
|
||||
public List<Parameter> getParameters(Operator operator) throws ServiceException;
|
||||
|
||||
public ComputationId startComputation(Operator op) throws Exception;
|
||||
public ComputationId startComputation(Operator op) throws ServiceException;
|
||||
|
||||
public ComputationStatus getComputationStatus(ComputationId computationId)
|
||||
throws Exception;
|
||||
throws ServiceException;
|
||||
|
||||
|
||||
public ComputationId resubmit(ComputationId computationId) throws ServiceException;
|
||||
|
@ -83,4 +53,6 @@ public interface DataMinerPortletService extends RemoteService {
|
|||
public void deleteItem(ItemDescription itemDescription)
|
||||
throws ServiceException;
|
||||
|
||||
public Resource getResourceByComputationId(ComputationId computationId) throws ServiceException;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.rpc;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.OperatorsClassification;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.ImagesResource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.MapResource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
|
||||
|
@ -22,59 +19,34 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
|
|||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public interface DataMinerPortletServiceAsync {
|
||||
|
||||
|
||||
public static DataMinerPortletServiceAsync INSTANCE = (DataMinerPortletServiceAsync) GWT
|
||||
.create(DataMinerPortletService.class);
|
||||
|
||||
/*
|
||||
void getTableItems(List<String> templates,
|
||||
AsyncCallback<List<TableItemSimple>> callback);
|
||||
*/
|
||||
void getFileItems(List<String> templates,
|
||||
AsyncCallback<List<TableItemSimple>> callback);
|
||||
|
||||
|
||||
void getResourceByComputationId(ComputationId computationId,
|
||||
AsyncCallback<Resource> callback);
|
||||
|
||||
void getMapFromMapResource(MapResource mapResource,
|
||||
AsyncCallback<Map<String, Resource>> callback);
|
||||
|
||||
void getParametersMapByComputationId(ComputationId computationId,
|
||||
AsyncCallback<Map<String, String>> callback);
|
||||
|
||||
void saveImage(ComputationId computationId, ImagesResource imageResource,
|
||||
AsyncCallback<String> callback);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* DataMiner
|
||||
*
|
||||
*/
|
||||
void hello(AsyncCallback<UserInfo> callback);
|
||||
|
||||
void getOperatorsClassifications(
|
||||
AsyncCallback<List<OperatorsClassification>> callback);
|
||||
|
||||
void getParameters(Operator operator,
|
||||
AsyncCallback<List<Parameter>> callback);
|
||||
|
||||
void startComputation(Operator op, AsyncCallback<ComputationId> asyncCallback);
|
||||
AsyncCallback<List<Parameter>> callback);
|
||||
|
||||
void startComputation(Operator op,
|
||||
AsyncCallback<ComputationId> asyncCallback);
|
||||
|
||||
void getComputationStatus(ComputationId computationId,
|
||||
AsyncCallback<ComputationStatus> asyncCallback);
|
||||
|
||||
void resubmit(ComputationId computationId, AsyncCallback<ComputationId> callback);
|
||||
|
||||
void retrieveTableInformation(Item item, AsyncCallback<TableItemSimple> callback);
|
||||
void resubmit(ComputationId computationId,
|
||||
AsyncCallback<ComputationId> callback);
|
||||
|
||||
void retrieveTableInformation(Item item,
|
||||
AsyncCallback<TableItemSimple> callback);
|
||||
|
||||
void getDataMinerWorkArea(AsyncCallback<DataMinerWorkArea> asyncCallback);
|
||||
|
||||
|
@ -84,9 +56,10 @@ public interface DataMinerPortletServiceAsync {
|
|||
void cancelComputation(ComputationId computationId,
|
||||
AsyncCallback<String> asyncCallback);
|
||||
|
||||
|
||||
void deleteItem(ItemDescription itemDescription,
|
||||
AsyncCallback<Void> callback);
|
||||
|
||||
|
||||
void getResourceByComputationId(ComputationId computationId,
|
||||
AsyncCallback<Resource> callback);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.util;
|
||||
|
||||
|
||||
import com.google.gwt.core.client.Callback;
|
||||
import com.google.gwt.dom.client.Element;
|
||||
import com.sencha.gxt.core.client.dom.XElement;
|
||||
|
@ -11,8 +10,8 @@ import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
|
|||
|
||||
/**
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class UtilsGXT3 {
|
||||
|
@ -24,8 +23,7 @@ public class UtilsGXT3 {
|
|||
public static void umask(Element element) {
|
||||
element.<XElement> cast().unmask();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void alert(String title, String message) {
|
||||
final AlertMessageBox d = new AlertMessageBox(title, message);
|
||||
d.addHideHandler(new HideHandler() {
|
||||
|
@ -37,20 +35,20 @@ public class UtilsGXT3 {
|
|||
d.show();
|
||||
|
||||
}
|
||||
|
||||
public static void alert(String title, String message, final Callback<Component, Void> callback) {
|
||||
|
||||
public static void alert(String title, String message,
|
||||
final Callback<Component, Void> callback) {
|
||||
final AlertMessageBox d = new AlertMessageBox(title, message);
|
||||
d.addHideHandler(new HideHandler() {
|
||||
|
||||
public void onHide(HideEvent event) {
|
||||
Component comp=event.getSource();
|
||||
public void onHide(HideEvent event) {
|
||||
Component comp = event.getSource();
|
||||
callback.onSuccess(comp);
|
||||
}
|
||||
});
|
||||
d.show();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void info(String title, String message) {
|
||||
final InfoMessageBox d = new InfoMessageBox(title, message);
|
||||
d.addHideHandler(new HideHandler() {
|
||||
|
@ -62,18 +60,19 @@ public class UtilsGXT3 {
|
|||
d.show();
|
||||
|
||||
}
|
||||
|
||||
public static void info(String title, String message, final Callback<Component, Void> callback) {
|
||||
|
||||
public static void info(String title, String message,
|
||||
final Callback<Component, Void> callback) {
|
||||
final InfoMessageBox d = new InfoMessageBox(title, message);
|
||||
d.addHideHandler(new HideHandler() {
|
||||
|
||||
public void onHide(HideEvent event) {
|
||||
Component comp=event.getSource();
|
||||
Component comp = event.getSource();
|
||||
callback.onSuccess(comp);
|
||||
}
|
||||
});
|
||||
d.show();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,28 +1,15 @@
|
|||
package org.gcube.portlets.user.dataminermanager.server;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.gcube.application.framework.accesslogger.library.impl.AccessLogger;
|
||||
import org.gcube.application.framework.core.session.ASLSession;
|
||||
import org.gcube.common.homelibrary.home.HomeLibrary;
|
||||
import org.gcube.common.homelibrary.home.workspace.Workspace;
|
||||
import org.gcube.common.homelibrary.home.workspace.WorkspaceFolder;
|
||||
import org.gcube.common.homelibrary.home.workspace.WorkspaceItem;
|
||||
import org.gcube.common.homelibrary.home.workspace.exceptions.ItemAlreadyExistException;
|
||||
import org.gcube.common.homelibrary.util.WorkspaceUtil;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.ComputationStatus;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.Operator;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.OperatorsClassification;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.ImagesResource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.MapResource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.output.Resource;
|
||||
import org.gcube.portlets.user.dataminermanager.client.bean.parameters.Parameter;
|
||||
import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletService;
|
||||
|
@ -54,11 +41,6 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
DataMinerPortletService {
|
||||
public static AccessLogger accountinglog = AccessLogger.getAccessLogger();
|
||||
|
||||
// private static final long CACHE_REFRESH_TIME = 30 * 60 * 1000; // 30
|
||||
// minutes
|
||||
|
||||
// private final static String SEPARATOR = AlgorithmConfiguration
|
||||
// .getListSeparator();
|
||||
private static Logger logger = LoggerFactory
|
||||
.getLogger(DataMinerManagerServiceImpl.class);
|
||||
|
||||
|
@ -95,35 +77,36 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
logger.error("Hello(): " + e.getLocalizedMessage(), e);
|
||||
throw new ServiceException(e.getLocalizedMessage());
|
||||
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OperatorsClassification> getOperatorsClassifications()
|
||||
throws Exception {
|
||||
throws ServiceException {
|
||||
|
||||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
ASLSession aslSession = SessionUtil.getASLSession(session);
|
||||
SClient smClient = SessionUtil.getSClient(session, aslSession);
|
||||
return smClient.getOperatorsClassifications();
|
||||
|
||||
} catch (ServiceException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
throw e;
|
||||
} catch (Throwable e) {
|
||||
logger.error(
|
||||
"An error occurred getting the OperatorsClassifications list",
|
||||
e);
|
||||
System.out
|
||||
.println("An error occurred getting the OperatorsClassifications list");
|
||||
"An error occurred getting the OperatorsClassifications list: "
|
||||
+ e.getLocalizedMessage(), e);
|
||||
e.printStackTrace();
|
||||
// return null;
|
||||
throw new Exception(e.getLocalizedMessage());
|
||||
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Parameter> getParameters(Operator operator) throws Exception {
|
||||
public List<Parameter> getParameters(Operator operator)
|
||||
throws ServiceException {
|
||||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
ASLSession aslSession = SessionUtil.getASLSession(session);
|
||||
|
@ -131,29 +114,34 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
SClient smClient = SessionUtil.getSClient(session, aslSession);
|
||||
return smClient.getInputParameters(operator);
|
||||
|
||||
} catch (ServiceException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
throw e;
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error retrieving parameters: "
|
||||
+ e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new Exception(e.getLocalizedMessage());
|
||||
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComputationId startComputation(Operator operator)
|
||||
throws Exception {
|
||||
throws ServiceException {
|
||||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
ASLSession aslSession = SessionUtil.getASLSession(session);
|
||||
logger.debug("StartComputation(): [ operator=" + operator + "]");
|
||||
SClient smClient = SessionUtil.getSClient(session, aslSession);
|
||||
return smClient.startComputation(operator);
|
||||
|
||||
} catch (ServiceException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
throw e;
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in start computation: "
|
||||
+ e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new Exception(e.getLocalizedMessage());
|
||||
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -167,6 +155,9 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
SClient smClient = SessionUtil.getSClient(session, aslSession);
|
||||
return smClient.resubmitComputation(computationId);
|
||||
} catch (ServiceException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
throw e;
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in resubmit computation: "
|
||||
+ e.getLocalizedMessage());
|
||||
|
@ -177,7 +168,7 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
@Override
|
||||
public ComputationStatus getComputationStatus(ComputationId computationId)
|
||||
throws Exception {
|
||||
throws ServiceException {
|
||||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
ASLSession aslSession = SessionUtil.getASLSession(session);
|
||||
|
@ -185,48 +176,20 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
SClient smClient = SessionUtil.getSClient(session, aslSession);
|
||||
return smClient.getComputationStatus(computationId);
|
||||
|
||||
} catch (ServiceException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
throw e;
|
||||
} catch (Throwable e) {
|
||||
// logger.error("Error in getComputationStatus: "
|
||||
// + e.getLocalizedMessage());
|
||||
// e.printStackTrace();
|
||||
throw new Exception(e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* @Override public List<TableItemSimple> getTableItems(List<String>
|
||||
* templates) throws Exception { try { HttpSession session =
|
||||
* this.getThreadLocalRequest().getSession(); ASLSession aslSession =
|
||||
* SessionUtil.getASLSession(session);
|
||||
*
|
||||
* List<TableItemSimple> list = new ArrayList<TableItemSimple>();
|
||||
*
|
||||
* return list; } catch (Throwable e) {
|
||||
* logger.error("Error in getTableItems:" + e.getLocalizedMessage());
|
||||
* e.printStackTrace(); throw new Exception(e.getLocalizedMessage()); }
|
||||
*
|
||||
* }
|
||||
*/
|
||||
|
||||
@Override
|
||||
public List<TableItemSimple> getFileItems(List<String> templates)
|
||||
throws Exception {
|
||||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
ASLSession aslSession = SessionUtil.getASLSession(session);
|
||||
|
||||
List<TableItemSimple> list = new ArrayList<TableItemSimple>();
|
||||
|
||||
return list;
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in getFileItems:" + e.getLocalizedMessage());
|
||||
logger.error("Error in getComputationStatus: "
|
||||
+ e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new Exception(e.getLocalizedMessage());
|
||||
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Resource getResourceByComputationId(ComputationId computationId) {
|
||||
public Resource getResourceByComputationId(ComputationId computationId)
|
||||
throws ServiceException {
|
||||
try {
|
||||
Log.debug("getResourceByComputationId: " + computationId);
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
|
@ -237,122 +200,31 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
.getResourceByComputationId(computationId);
|
||||
Log.debug("Resoure: " + resource);
|
||||
return resource;
|
||||
|
||||
} catch (Exception e) {
|
||||
} catch (ServiceException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
throw e;
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in getResourceByComputationId: "
|
||||
+ e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getParametersMapByComputationId(
|
||||
ComputationId jobId) throws ServiceException {
|
||||
|
||||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
ASLSession aslSession = SessionUtil.getASLSession(session);
|
||||
|
||||
SClient smClient = SessionUtil.getSClient(session, aslSession);
|
||||
|
||||
// SMComputation computation = wpsClient.getComputation(jobId);
|
||||
|
||||
Map<String, String> parametersMap = new LinkedHashMap<String, String>();
|
||||
|
||||
// for (SMEntry entry : computation.parameters()) {
|
||||
// String value = entry.value();
|
||||
// if (value != null)
|
||||
// value = value.replaceAll("#", ", ");
|
||||
// parametersMap.put(entry.key(), value);
|
||||
// }
|
||||
|
||||
return parametersMap;
|
||||
|
||||
} catch (Throwable e) {
|
||||
logger.error(e.getLocalizedMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Resource> getMapFromMapResource(MapResource mapRes)
|
||||
throws Exception {
|
||||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
ASLSession aslSession = SessionUtil.getASLSession(session);
|
||||
|
||||
return mapRes.getMap();
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getLocalizedMessage(), e);
|
||||
// e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String saveImage(ComputationId computationId,
|
||||
ImagesResource imagesResource) throws Exception {
|
||||
|
||||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
ASLSession aslSession = SessionUtil.getASLSession(session);
|
||||
// SClient smClient = SessionUtil.getSClient(session, aslSession);
|
||||
// SMComputation computation =
|
||||
// factory.gegetComputation(computationId);
|
||||
// String computationName = computation.title() == null ?
|
||||
// computationId
|
||||
// : computation.title();
|
||||
// computationName =
|
||||
// FileSystemNameUtil.cleanFileName(computationName);
|
||||
|
||||
Workspace workspace = HomeLibrary.getUserWorkspace(aslSession
|
||||
.getUsername());
|
||||
WorkspaceFolder rootFolder = workspace.getRoot();
|
||||
// computationName = WorkspaceUtil.getUniqueName(computationName,
|
||||
// rootFolder);
|
||||
|
||||
// create the folder
|
||||
|
||||
WorkspaceFolder folder;
|
||||
try {
|
||||
folder = rootFolder
|
||||
.createFolder(computationId.getId(),
|
||||
"This folder contains images obtained from Data Miner Manager");
|
||||
|
||||
} catch (ItemAlreadyExistException e) {
|
||||
folder = (WorkspaceFolder) rootFolder.find(computationId
|
||||
.getId());
|
||||
}
|
||||
InputStream inputStream = new URL(imagesResource.getLink())
|
||||
.openStream();
|
||||
|
||||
WorkspaceItem wi = WorkspaceUtil.createExternalFile(folder,
|
||||
imagesResource.getResourceId(),
|
||||
imagesResource.getDescription(),
|
||||
imagesResource.getMimeType(), inputStream);
|
||||
|
||||
return wi.getId();
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in save images: " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw (e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteItem(ItemDescription itemDescription)
|
||||
throws ServiceException {
|
||||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
ASLSession aslSession = SessionUtil.getASLSession(session);
|
||||
logger.debug("DeleteItem(): "+itemDescription);
|
||||
logger.debug("DeleteItem(): " + itemDescription);
|
||||
StorageUtil.deleteItem(aslSession.getUsername(),
|
||||
itemDescription.getId());
|
||||
return;
|
||||
} catch (ServiceException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
throw e;
|
||||
} catch (Throwable e) {
|
||||
logger.error(e.getLocalizedMessage(), e);
|
||||
e.printStackTrace();
|
||||
|
@ -371,11 +243,12 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
TableItemSimple tableItemSimple = tableReader.getTableItemSimple();
|
||||
return tableItemSimple;
|
||||
} catch (ServiceException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
throw e;
|
||||
} catch (Throwable e) {
|
||||
logger.error(e.getLocalizedMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(e.getLocalizedMessage());
|
||||
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -390,11 +263,12 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
return dataMinerWorkAreaManager.getDataMinerWorkArea();
|
||||
|
||||
} catch (ServiceException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
throw e;
|
||||
} catch (Throwable e) {
|
||||
logger.error(e.getLocalizedMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(e.getLocalizedMessage());
|
||||
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -410,11 +284,12 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
return link;
|
||||
} catch (ServiceException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
throw e;
|
||||
} catch (Throwable e) {
|
||||
logger.error(e.getLocalizedMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(e.getLocalizedMessage());
|
||||
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -430,11 +305,12 @@ public class DataMinerManagerServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
return result;
|
||||
} catch (ServiceException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
throw e;
|
||||
} catch (Throwable e) {
|
||||
logger.error(e.getLocalizedMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(e.getLocalizedMessage());
|
||||
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,6 @@ import org.gcube.portlets.user.dataminermanager.server.smservice.wps.WPS2SM;
|
|||
import org.gcube.portlets.user.dataminermanager.server.util.ServiceCredential;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.Constants;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.ComputationId;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.exception.ServiceException;
|
||||
import org.n52.wps.client.ExecuteRequestBuilder;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -161,7 +160,7 @@ public class SClient4WPS extends SClient {
|
|||
|
||||
requestCapability();
|
||||
if (processesBriefs == null || processesDescriptionType == null) {
|
||||
throw new ServiceException("Algorithms WPS not available!");
|
||||
throw new Exception("Algorithms WPS not available!");
|
||||
}
|
||||
|
||||
for (ProcessBriefType processBrief : processesBriefs) {
|
||||
|
@ -313,15 +312,16 @@ public class SClient4WPS extends SClient {
|
|||
process.put(processId, processInformations);
|
||||
|
||||
return processInformations;
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
throw new Exception(e.getLocalizedMessage(),e);
|
||||
} finally {
|
||||
wpsClient.disconnect(wpsProcessingServlet);
|
||||
}
|
||||
}
|
||||
|
||||
private void requestCapability() throws ServiceException {
|
||||
private void requestCapability() throws Exception {
|
||||
StatWPSClientSession wpsClient = null;
|
||||
processesDescriptionType = null;
|
||||
processesBriefs = null;
|
||||
|
@ -343,7 +343,7 @@ public class SClient4WPS extends SClient {
|
|||
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(e.getLocalizedMessage());
|
||||
throw new Exception(e.getLocalizedMessage(),e);
|
||||
} finally {
|
||||
if (wpsClient != null) {
|
||||
wpsClient.disconnect(wpsProcessingServlet);
|
||||
|
@ -395,24 +395,32 @@ public class SClient4WPS extends SClient {
|
|||
execute);
|
||||
String processLocation = null;
|
||||
if (responseObject != null) {
|
||||
processLocation = ((ExecuteResponseDocumentImpl) responseObject)
|
||||
.getExecuteResponse().getStatusLocation();
|
||||
} else
|
||||
throw new Exception("Invalid Response from service: "
|
||||
if (responseObject instanceof ExecuteResponseDocumentImpl) {
|
||||
processLocation = ((ExecuteResponseDocumentImpl) responseObject)
|
||||
.getExecuteResponse().getStatusLocation();
|
||||
} else {
|
||||
throw new Exception(
|
||||
"Invalid response from service, "
|
||||
+ "response isn't instance of ExecuteResponseDocumentImpl, class is "
|
||||
+ responseObject.getClass());
|
||||
}
|
||||
} else {
|
||||
throw new Exception("Invalid Response from service, "
|
||||
+ responseObject);
|
||||
}
|
||||
logger.debug("Retrieved ProcessLocation: " + processLocation);
|
||||
return processLocation;
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.debug("ExecuteProcessAsync: " + e.getLocalizedMessage());
|
||||
} catch (Throwable e) {
|
||||
logger.error("ExecuteProcessAsync: " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
throw new Exception(e.getLocalizedMessage(), e);
|
||||
} finally {
|
||||
try {
|
||||
if (wpsClient != null)
|
||||
wpsClient.disconnect(wpsProcessingServlet);
|
||||
} catch (Exception e) {
|
||||
|
||||
logger.debug("Problems in wps disconnect! "+e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -435,10 +443,10 @@ public class SClient4WPS extends SClient {
|
|||
return ((ExecuteResponseDocument) responseObject)
|
||||
.getExecuteResponse().getProcessOutputs();
|
||||
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
logger.debug("RetrieveProcessResult: " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
throw new Exception(e.getLocalizedMessage(), e);
|
||||
} finally {
|
||||
wpsClient.disconnect(wpsProcessingServlet);
|
||||
}
|
||||
|
@ -504,7 +512,7 @@ public class SClient4WPS extends SClient {
|
|||
}
|
||||
return urls;
|
||||
}
|
||||
|
||||
/*
|
||||
private static String getExceptionText(String exceptionText) {
|
||||
try {
|
||||
String excText = "ExceptionText>";
|
||||
|
@ -531,7 +539,7 @@ public class SClient4WPS extends SClient {
|
|||
e.printStackTrace();
|
||||
return "Backend error in WPS Execution";
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
private static void getURLFromXML(org.w3c.dom.Node node,
|
||||
ResponseWPS responseWPS) {
|
||||
|
@ -640,7 +648,7 @@ public class SClient4WPS extends SClient {
|
|||
} catch (Throwable e) {
|
||||
logger.error("GetParameters: " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(e.getLocalizedMessage());
|
||||
throw new Exception(e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
|
@ -657,10 +665,9 @@ public class SClient4WPS extends SClient {
|
|||
return parameters;
|
||||
|
||||
} catch (Throwable e) {
|
||||
|
||||
logger.error(e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(e.getLocalizedMessage());
|
||||
throw new Exception(e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -673,7 +680,7 @@ public class SClient4WPS extends SClient {
|
|||
} catch (Throwable e) {
|
||||
logger.error("GetParameters: " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(e.getLocalizedMessage());
|
||||
throw new Exception(e.getLocalizedMessage(),e);
|
||||
}
|
||||
|
||||
LinkedHashMap<String, Parameter> inputParameters = new LinkedHashMap<>();
|
||||
|
@ -703,7 +710,7 @@ public class SClient4WPS extends SClient {
|
|||
id = processUrl.substring(idIndex + 4, processUrl.length());
|
||||
} else {
|
||||
logger.error("Invalid processLocation: " + processUrl);
|
||||
throw new ServiceException("Invalid processLocation: " + processUrl);
|
||||
throw new Exception("Invalid processLocation: " + processUrl);
|
||||
}
|
||||
ComputationId computationId = new ComputationId(id, processUrl);
|
||||
logger.debug("ComputationId: " + computationId);
|
||||
|
@ -773,12 +780,10 @@ public class SClient4WPS extends SClient {
|
|||
logger.debug("Starting Process: " + statusLocation);
|
||||
return statusLocation;
|
||||
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
String exceptiontext = getExceptionText(e.getLocalizedMessage());
|
||||
logger.debug("WPSProcess->Returning Exception to the SM:"
|
||||
+ exceptiontext);
|
||||
throw new Exception(exceptiontext);
|
||||
throw new Exception(e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -905,10 +910,10 @@ public class SClient4WPS extends SClient {
|
|||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
logger.error("MonitorProcess: " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
throw new Exception(e.getLocalizedMessage(), e);
|
||||
} finally {
|
||||
wpsClient.disconnect(wpsProcessingServlet);
|
||||
}
|
||||
|
@ -1121,7 +1126,7 @@ public class SClient4WPS extends SClient {
|
|||
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(e.getLocalizedMessage());
|
||||
throw new Exception(e.getLocalizedMessage(),e);
|
||||
} finally {
|
||||
if (wpsClient != null) {
|
||||
wpsClient.disconnect(wpsProcessingServlet);
|
||||
|
|
|
@ -372,59 +372,7 @@
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* ProgressBar
|
||||
*/
|
||||
.progressBar-pending {
|
||||
border: 1px solid #AAAAAA;
|
||||
}
|
||||
|
||||
.progressBar-pending .x-progress-bar {
|
||||
border: medium none;
|
||||
background-image: url("images/progress-gray.gif");
|
||||
}
|
||||
|
||||
.progressBar-failed {
|
||||
border: 1px solid #AA0000;
|
||||
}
|
||||
|
||||
.progressBar-failed .x-progress-bar {
|
||||
border: medium none;
|
||||
background-image: url("images/progress-red.gif");
|
||||
}
|
||||
|
||||
.progressBar-complete .progressWrap {
|
||||
border-color: #00AA00;
|
||||
}
|
||||
|
||||
.progressBar-complete .progressInner {
|
||||
background-color: #bdefbd;
|
||||
background-image: url("images/bg-progress.gif");
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.progressBar-complete .progressBar {
|
||||
background-color: #4ec14e;
|
||||
background-image: url("images/green-progress.gif");
|
||||
background-repeat: repeat-x;
|
||||
background-position: left center;
|
||||
height: 18px;
|
||||
border-top-color: #d1fdda;
|
||||
border-bottom-color: #7fe48a;
|
||||
border-right-color: #7fe48a;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*.progressBar-complete {
|
||||
* border: 1px solid #00AA00;
|
||||
*}
|
||||
*
|
||||
*.progressBar-complete .x-progress-bar {
|
||||
* border: medium none;
|
||||
* background-image: url("images/progress-green.gif");
|
||||
*}
|
||||
*/
|
||||
/**
|
||||
* Computation Output
|
||||
*/
|
||||
|
|
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 834 B |
Before Width: | Height: | Size: 99 B |
Before Width: | Height: | Size: 157 B |
Before Width: | Height: | Size: 493 B |
Before Width: | Height: | Size: 494 B |
Before Width: | Height: | Size: 120 B |