From 8630f1b1231a85cd5a297e7b2af86266225c304f Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Fri, 24 Oct 2014 15:52:09 +0000 Subject: [PATCH] Updated Flows git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-open-widget@100979 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../user/td/openwidget/client/TDOpen.java | 2 +- .../client/TabResourcesSelectionCard.java | 50 +++++++++++++------ .../client/TabResourcesSelectionPanel.java | 6 +-- 3 files changed, 38 insertions(+), 20 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/openwidget/client/TDOpen.java b/src/main/java/org/gcube/portlets/user/td/openwidget/client/TDOpen.java index bc30e12..10c3dc7 100644 --- a/src/main/java/org/gcube/portlets/user/td/openwidget/client/TDOpen.java +++ b/src/main/java/org/gcube/portlets/user/td/openwidget/client/TDOpen.java @@ -16,7 +16,7 @@ import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign; * */ public class TDOpen extends WizardWindow { - protected static final int WITHWIZARD=750; + protected static final int WITHWIZARD=800; protected static final int HEIGHTWIZARD=520; protected TDOpenSession tdOpenSession; diff --git a/src/main/java/org/gcube/portlets/user/td/openwidget/client/TabResourcesSelectionCard.java b/src/main/java/org/gcube/portlets/user/td/openwidget/client/TabResourcesSelectionCard.java index 1157bcd..d1f7d78 100644 --- a/src/main/java/org/gcube/portlets/user/td/openwidget/client/TabResourcesSelectionCard.java +++ b/src/main/java/org/gcube/portlets/user/td/openwidget/client/TabResourcesSelectionCard.java @@ -14,6 +14,7 @@ import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredE import org.gcube.portlets.user.td.widgetcommonevent.client.type.RibbonType; import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType; import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; +import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.TabResourceType; import org.gcube.portlets.user.td.wizardwidget.client.WizardCard; import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3; @@ -85,8 +86,9 @@ public class TabResourcesSelectionCard extends WizardCard { } protected void retrieveLastTable() { - TDGWTServiceAsync.INSTANCE.getLastTable(tdOpenSession - .getSelectedTabResource().getTrId(), + final TRId selectedTRId = tdOpenSession.getSelectedTabResource() + .getTrId(); + TDGWTServiceAsync.INSTANCE.getLastTable(selectedTRId, new AsyncCallback() { @Override @@ -97,19 +99,7 @@ public class TabResourcesSelectionCard extends WizardCard { new SessionExpiredEvent( SessionExpiredType.EXPIREDONSERVER)); } else { - Log.debug("Attention", - "This tabular resource does not have a valid table"); - AlertMessageBox d = new AlertMessageBox( - "Attention", - "This tabular resource does not have a valid table"); - d.addHideHandler(new HideHandler() { - - public void onHide(HideEvent event) { - deleteTRWithLastTableNull(); - - } - }); - d.show(); + retrievedLastTableNull(selectedTRId); } } @@ -123,6 +113,36 @@ public class TabResourcesSelectionCard extends WizardCard { } + protected void retrievedLastTableNull(TRId trId) { + if (trId.getTabResourceType().compareTo(TabResourceType.FLOW) == 0) { + Log.debug("Attention", + "This tabular resource has type flow and it does not have a valid table, no data entered in the flow"); + AlertMessageBox d = new AlertMessageBox("Attention", + "No data entered in the flow"); + d.addHideHandler(new HideHandler() { + + public void onHide(HideEvent event) { + + + } + }); + d.show(); + } else { + Log.debug("Attention", + "This tabular resource does not have a valid table"); + AlertMessageBox d = new AlertMessageBox("Attention", + "This tabular resource does not have a valid table"); + d.addHideHandler(new HideHandler() { + + public void onHide(HideEvent event) { + deleteTRWithLastTableNull(); + + } + }); + d.show(); + } + } + protected void deleteTRWithLastTableNull() { final ConfirmMessageBox mb = new ConfirmMessageBox("Delete", "Would you like to delete this tabular resource without table?"); diff --git a/src/main/java/org/gcube/portlets/user/td/openwidget/client/TabResourcesSelectionPanel.java b/src/main/java/org/gcube/portlets/user/td/openwidget/client/TabResourcesSelectionPanel.java index 3cc821d..0294113 100644 --- a/src/main/java/org/gcube/portlets/user/td/openwidget/client/TabResourcesSelectionPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/openwidget/client/TabResourcesSelectionPanel.java @@ -77,10 +77,8 @@ public class TabResourcesSelectionPanel extends ContentPanel implements protected static final ColumnConfig nameColumn = new ColumnConfig( properties.name(), 90, "Name"); - protected static final ColumnConfig typeColumn = new ColumnConfig( properties.tabResourceType(), 30, "Type"); - protected static final ColumnConfig tableTypeNameColumn = new ColumnConfig( properties.tableTypeName(), 30, "Table Type"); protected static final ColumnConfig agencyColumn = new ColumnConfig( @@ -88,7 +86,7 @@ public class TabResourcesSelectionPanel extends ContentPanel implements protected static final ColumnConfig ownerColumn = new ColumnConfig( properties.ownerLogin(), 70, "Owner"); protected static final ColumnConfig dateColumn = new ColumnConfig( - properties.date(), 40, "Date"); + properties.date(), 50, "Date"); protected Grid grid; protected ResourceBundle res; @@ -112,7 +110,7 @@ public class TabResourcesSelectionPanel extends ContentPanel implements } try { buildPanel(properties.id(), - Arrays.> asList(nameColumn, + Arrays.> asList(nameColumn,typeColumn, tableTypeNameColumn, ownerColumn, agencyColumn, dateColumn), nameColumn);