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:
Giancarlo Panichi 2015-10-01 13:40:54 +00:00
parent 76f8feb38b
commit a37a3b83cc
2 changed files with 32 additions and 15 deletions

View File

@ -59,12 +59,12 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
automaticallyAttached = false;
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(
new Margins(10, 5, 10, 5)));
new Margins(10, 5, 10, 25)));
setCenterWidget(operationInProgressPanel, new MarginData(0));
resultField.setVisible(false);
@ -300,8 +300,8 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
protected void updateOnComplete() {
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
.appendHtmlConstant("<div style='display:block;margin:auto;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>");
.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;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.setVisible(true);
Command sayComplete = new Command() {
@ -329,7 +329,7 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
public void operationFailed(Throwable caught, String reason, String details) {
SafeHtmlBuilder safeHtmlBuilder = new 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.setVisible(true);
if (caught instanceof TDGWTSessionExpiredException) {
@ -351,7 +351,7 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
newTrId = operationResult.getTrId();
SafeHtmlBuilder safeHtmlBuilder = new 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.setVisible(true);
@ -382,7 +382,7 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
public void operationAborted() {
SafeHtmlBuilder safeHtmlBuilder = new 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.setVisible(true);
@ -412,7 +412,7 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
public void operationPutInBackground() {
SafeHtmlBuilder safeHtmlBuilder = new 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.setVisible(true);

View File

@ -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.type.SessionExpiredType;
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.util.UtilsGXT3;
@ -41,8 +42,8 @@ import com.sencha.gxt.widget.core.client.grid.Grid;
/**
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ColumnDataGridPanel extends ContentPanel implements
@ -119,7 +120,7 @@ public class ColumnDataGridPanel extends ContentPanel implements
VerticalLayoutContainer con = new VerticalLayoutContainer();
con.setScrollMode(ScrollMode.AUTO);
con.add(grid, new VerticalLayoutData(1, -1, new Margins(0)));
setWidget(con);
@ -148,8 +149,8 @@ public class ColumnDataGridPanel extends ContentPanel implements
} else {
Log.error("No columns loaded: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"No columns loaded: "+caught.getLocalizedMessage());
UtilsGXT3.alert("Error", "No columns loaded: "
+ caught.getLocalizedMessage());
}
}
@ -158,8 +159,24 @@ public class ColumnDataGridPanel extends ContentPanel implements
public void onSuccess(ArrayList<ColumnData> result) {
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>(
result));
availableColumn));
sm.selectAll();
forceLayout();
}