From a37a3b83cc635b16f0b6a08c5dbb25d129d22c69 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Thu, 1 Oct 2015 13:40:54 +0000 Subject: [PATCH] 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 --- ...xtractCodelistOperationInProgressCard.java | 18 ++++++------ .../client/grid/ColumnDataGridPanel.java | 29 +++++++++++++++---- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/extractcodelistwidget/client/ExtractCodelistOperationInProgressCard.java b/src/main/java/org/gcube/portlets/user/td/extractcodelistwidget/client/ExtractCodelistOperationInProgressCard.java index b715987..e057d76 100644 --- a/src/main/java/org/gcube/portlets/user/td/extractcodelistwidget/client/ExtractCodelistOperationInProgressCard.java +++ b/src/main/java/org/gcube/portlets/user/td/extractcodelistwidget/client/ExtractCodelistOperationInProgressCard.java @@ -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("
"); + resultField = new HtmlLayoutContainer("
"); 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("
Operation Completed
" - + "
The Codelists is available in the list of yours tabular resources
"); + .appendHtmlConstant("
Operation Completed
" + + "
The Codelists is available in the list of yours tabular resources
"); 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("
Operation Failed
"); + .appendHtmlConstant("
Operation Failed
"); 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("
Problems in the Operation
"); + .appendHtmlConstant("
Problems in the Operation
"); 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("
Operation Aborted
"); + .appendHtmlConstant("
Operation Aborted
"); 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("
Operation in Background
"); + .appendHtmlConstant("
Operation in Background
"); resultField.setHTML(safeHtmlBuilder.toSafeHtml()); resultField.setVisible(true); diff --git a/src/main/java/org/gcube/portlets/user/td/extractcodelistwidget/client/grid/ColumnDataGridPanel.java b/src/main/java/org/gcube/portlets/user/td/extractcodelistwidget/client/grid/ColumnDataGridPanel.java index 6eceeb8..d97cdff 100644 --- a/src/main/java/org/gcube/portlets/user/td/extractcodelistwidget/client/grid/ColumnDataGridPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/extractcodelistwidget/client/grid/ColumnDataGridPanel.java @@ -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: g.panichi@isti.cnr.it + * @author giancarlo email: g.panichi@isti.cnr.it * */ 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 result) { Log.trace("loaded " + result.size() + " columns"); + ArrayList availableColumn = new ArrayList(); + 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( - result)); + availableColumn)); sm.selectAll(); forceLayout(); }