Fixed block on error
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-extractcodelist-widget@119306 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
76f8feb38b
commit
a37a3b83cc
|
@ -59,12 +59,12 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
|
||||||
automaticallyAttached = false;
|
automaticallyAttached = false;
|
||||||
|
|
||||||
VBoxLayoutContainer operationInProgressPanel = new VBoxLayoutContainer();
|
VBoxLayoutContainer operationInProgressPanel = new VBoxLayoutContainer();
|
||||||
operationInProgressPanel.setVBoxLayoutAlign(VBoxLayoutAlign.CENTER);
|
operationInProgressPanel.setVBoxLayoutAlign(VBoxLayoutAlign.LEFT);
|
||||||
|
|
||||||
resultField = new HtmlLayoutContainer("<div></div>");
|
resultField = new HtmlLayoutContainer("<div style='left:0;'></div>");
|
||||||
|
|
||||||
operationInProgressPanel.add(resultField, new BoxLayoutData(
|
operationInProgressPanel.add(resultField, new BoxLayoutData(
|
||||||
new Margins(10, 5, 10, 5)));
|
new Margins(10, 5, 10, 25)));
|
||||||
|
|
||||||
setCenterWidget(operationInProgressPanel, new MarginData(0));
|
setCenterWidget(operationInProgressPanel, new MarginData(0));
|
||||||
resultField.setVisible(false);
|
resultField.setVisible(false);
|
||||||
|
@ -300,8 +300,8 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
|
||||||
protected void updateOnComplete() {
|
protected void updateOnComplete() {
|
||||||
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
|
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
|
||||||
safeHtmlBuilder
|
safeHtmlBuilder
|
||||||
.appendHtmlConstant("<div style='display:block;margin:auto;text-align:center;font-size:large;font-weight:bold; color:#009900;'>Operation Completed</div>"
|
.appendHtmlConstant("<div style='display:block;margin:auto;left:0;text-align:center;font-size:large;font-weight:bold; color:#009900;'>Operation Completed</div>"
|
||||||
+ "<div style='display:block;margin:auto; margin-top:30px;text-align:center;font-size:medium;font-weight:bold; color:black;'>The Codelists is available in the list of yours tabular resources</div>");
|
+ "<div style='display:block;margin:auto; margin-top:30px;left:0;text-align:center;font-size:medium;font-weight:bold; color:black;'>The Codelists is available in the list of yours tabular resources</div>");
|
||||||
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
|
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
|
||||||
resultField.setVisible(true);
|
resultField.setVisible(true);
|
||||||
Command sayComplete = new Command() {
|
Command sayComplete = new Command() {
|
||||||
|
@ -329,7 +329,7 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
|
||||||
public void operationFailed(Throwable caught, String reason, String details) {
|
public void operationFailed(Throwable caught, String reason, String details) {
|
||||||
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
|
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
|
||||||
safeHtmlBuilder
|
safeHtmlBuilder
|
||||||
.appendHtmlConstant("<div style='display:block;margin:auto;text-align:center;font-size:large;font-weight:bold;color:red;'>Operation Failed</div>");
|
.appendHtmlConstant("<div style='display:block;margin:auto;left:0;text-align:center;font-size:large;font-weight:bold;color:red;'>Operation Failed</div>");
|
||||||
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
|
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
|
||||||
resultField.setVisible(true);
|
resultField.setVisible(true);
|
||||||
if (caught instanceof TDGWTSessionExpiredException) {
|
if (caught instanceof TDGWTSessionExpiredException) {
|
||||||
|
@ -351,7 +351,7 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
|
||||||
newTrId = operationResult.getTrId();
|
newTrId = operationResult.getTrId();
|
||||||
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
|
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
|
||||||
safeHtmlBuilder
|
safeHtmlBuilder
|
||||||
.appendHtmlConstant("<div style='display:block;margin:auto;text-align:center;font-size:large;font-weight:bold;color: #FF9900;'>Problems in the Operation</div>");
|
.appendHtmlConstant("<div style='display:block;margin:auto;left:0;text-align:center;font-size:large;font-weight:bold;color: #FF9900;'>Problems in the Operation</div>");
|
||||||
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
|
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
|
||||||
resultField.setVisible(true);
|
resultField.setVisible(true);
|
||||||
|
|
||||||
|
@ -382,7 +382,7 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
|
||||||
public void operationAborted() {
|
public void operationAborted() {
|
||||||
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
|
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
|
||||||
safeHtmlBuilder
|
safeHtmlBuilder
|
||||||
.appendHtmlConstant("<div style='diplay:block;margin:auto;text-align:center;font-size:large;font-weight:bold;color: #AA00AA;'>Operation Aborted</div>");
|
.appendHtmlConstant("<div style='diplay:block;margin:auto;left:0;text-align:center;font-size:large;font-weight:bold;color: #AA00AA;'>Operation Aborted</div>");
|
||||||
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
|
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
|
||||||
resultField.setVisible(true);
|
resultField.setVisible(true);
|
||||||
|
|
||||||
|
@ -412,7 +412,7 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
|
||||||
public void operationPutInBackground() {
|
public void operationPutInBackground() {
|
||||||
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
|
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
|
||||||
safeHtmlBuilder
|
safeHtmlBuilder
|
||||||
.appendHtmlConstant("<div style='display:block;margin:auto;text-align:center;font-size:large;font-weight:bold;color: #00AAAA;'>Operation in Background</div>");
|
.appendHtmlConstant("<div style='display:block;margin:auto;left:0;text-align:center;font-size:large;font-weight:bold;color: #00AAAA;'>Operation in Background</div>");
|
||||||
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
|
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
|
||||||
resultField.setVisible(true);
|
resultField.setVisible(true);
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpire
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData;
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeCode;
|
||||||
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
||||||
import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3;
|
import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3;
|
||||||
|
|
||||||
|
@ -41,8 +42,8 @@ import com.sencha.gxt.widget.core.client.grid.Grid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author giancarlo
|
* @author giancarlo email: <a
|
||||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ColumnDataGridPanel extends ContentPanel implements
|
public class ColumnDataGridPanel extends ContentPanel implements
|
||||||
|
@ -148,8 +149,8 @@ public class ColumnDataGridPanel extends ContentPanel implements
|
||||||
} else {
|
} else {
|
||||||
Log.error("No columns loaded: "
|
Log.error("No columns loaded: "
|
||||||
+ caught.getLocalizedMessage());
|
+ caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error",
|
UtilsGXT3.alert("Error", "No columns loaded: "
|
||||||
"No columns loaded: "+caught.getLocalizedMessage());
|
+ caught.getLocalizedMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -158,8 +159,24 @@ public class ColumnDataGridPanel extends ContentPanel implements
|
||||||
|
|
||||||
public void onSuccess(ArrayList<ColumnData> result) {
|
public void onSuccess(ArrayList<ColumnData> result) {
|
||||||
Log.trace("loaded " + result.size() + " columns");
|
Log.trace("loaded " + result.size() + " columns");
|
||||||
|
ArrayList<ColumnData> availableColumn = new ArrayList<ColumnData>();
|
||||||
|
for (ColumnData col : result) {
|
||||||
|
if (col == null
|
||||||
|
|| col.isViewColumn()
|
||||||
|
|| ColumnTypeCode.getColumnTypeCodeFromId(
|
||||||
|
col.getTypeCode()).compareTo(
|
||||||
|
ColumnTypeCode.DIMENSION) == 0
|
||||||
|
|| ColumnTypeCode.getColumnTypeCodeFromId(
|
||||||
|
col.getTypeCode()).compareTo(
|
||||||
|
ColumnTypeCode.TIMEDIMENSION) == 0) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
availableColumn.add(col);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
callback.onSuccess(new ListLoadResultBean<ColumnData>(
|
callback.onSuccess(new ListLoadResultBean<ColumnData>(
|
||||||
result));
|
availableColumn));
|
||||||
sm.selectAll();
|
sm.selectAll();
|
||||||
forceLayout();
|
forceLayout();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue