From eb52451ed613367c0ff688c3afe475de6a2568bf Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Mon, 13 Apr 2015 17:03:18 +0000 Subject: [PATCH] Minor Update git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@113990 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../user/td/client/TabularDataController.java | 60 ++++++++++++++++++- .../td/client/ribbon/TabularDataRibbon.java | 4 +- 2 files changed, 59 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/client/TabularDataController.java b/src/main/java/org/gcube/portlets/user/td/client/TabularDataController.java index b5c4dcd..5c2c059 100644 --- a/src/main/java/org/gcube/portlets/user/td/client/TabularDataController.java +++ b/src/main/java/org/gcube/portlets/user/td/client/TabularDataController.java @@ -10,6 +10,10 @@ import java.util.HashMap; import org.gcube.portlets.user.td.chartswidget.client.ChartsWidgetTD; import org.gcube.portlets.user.td.client.logs.TDMLogs; import org.gcube.portlets.user.td.client.rstudio.RStudio; +import org.gcube.portlets.user.td.client.rule.RuleApplyDialog; +import org.gcube.portlets.user.td.client.rule.RuleDeleteDialog; +import org.gcube.portlets.user.td.client.rule.RuleOpenDialog; +import org.gcube.portlets.user.td.client.rule.RuleShareDialog; import org.gcube.portlets.user.td.client.template.TemplateApplyDialog; import org.gcube.portlets.user.td.client.template.TemplateDeleteDialog; import org.gcube.portlets.user.td.client.template.TemplateOpenDialog; @@ -21,6 +25,7 @@ import org.gcube.portlets.user.td.expressionwidget.client.ColumnFilterDialog; import org.gcube.portlets.user.td.expressionwidget.client.MultiColumnFilterDialog; import org.gcube.portlets.user.td.expressionwidget.client.ReplaceColumnByExpressionDialog; import org.gcube.portlets.user.td.expressionwidget.client.RowsDeleteByExpressionDialog; +import org.gcube.portlets.user.td.expressionwidget.client.RuleDialog; import org.gcube.portlets.user.td.extractcodelistwidget.client.ExtractCodelistWizardTD; import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException; @@ -352,7 +357,7 @@ public class TabularDataController { String currentLocaleCookie = Cookies.getCookie(LocaleInfo .getLocaleCookieName()); - Log.debug(TD_LANG_COOKIE+":" + currentLocaleCookie); + Log.debug(TD_LANG_COOKIE + ":" + currentLocaleCookie); LocaleInfo currentLocaleInfo = LocaleInfo.getCurrentLocale(); Log.debug("Current Locale:" + currentLocaleInfo.getLocaleName()); @@ -364,8 +369,8 @@ public class TabularDataController { long nowLong = now.getTime(); nowLong = nowLong + (1000 * 60 * 60 * 24 * 21); now.setTime(nowLong); - String cookieLang=Cookies.getCookie(TD_LANG_COOKIE); - if(cookieLang!=null){ + String cookieLang = Cookies.getCookie(TD_LANG_COOKIE); + if (cookieLang != null) { Cookies.removeCookie(TD_LANG_COOKIE); } Cookies.setCookie(TD_LANG_COOKIE, localeName, now); @@ -892,14 +897,19 @@ public class TabularDataController { case COLUMN_BATCH_REPLACE: break; case RULE_NEW: + openNewRule(); break; case RULE_MODIFY: + openModifyRule(); break; case RULE_DELETE: + openDeleteRule(); break; case RULE_APPLY: + openApplyRule(); break; case RULE_SHARE: + openShareRule(); break; case TEMPLATE_OPEN: openTemplateOpen(); @@ -1701,6 +1711,50 @@ public class TabularDataController { }); } + private void openNewRule() { + Log.debug("Request Open New Rule Dialog"); + RuleDialog cfDialog = new RuleDialog(eventBus); + cfDialog.show(); + + } + + private void openModifyRule() { + Log.debug("Request Open Modify Rule Dialog"); + RuleOpenDialog cfDialog = new RuleOpenDialog(eventBus); + cfDialog.show(); + + } + + private void openDeleteRule() { + Log.debug("Request Open Delete Rule Dialog"); + RuleDeleteDialog cfDialog = new RuleDeleteDialog(eventBus); + cfDialog.show(); + + } + + private void openApplyRule() { + Log.debug("Request Open Apply Rule Dialog"); + if (trId != null) { + RuleApplyDialog raDialog = new RuleApplyDialog( + trId, eventBus); + raDialog.show(); + } else { + Log.error("TRId is null"); + UtilsGXT3.alert("Error", + "No current tabular resource present"); + } + + + } + + private void openShareRule() { + Log.debug("Request Open Share Rule Dialog"); + RuleShareDialog cfDialog = new RuleShareDialog(eventBus); + cfDialog.show(); + + } + + private void callDiscard() { HistoryDiscard historyDiscard = new HistoryDiscard(eventBus); historyDiscard.discard(); diff --git a/src/main/java/org/gcube/portlets/user/td/client/ribbon/TabularDataRibbon.java b/src/main/java/org/gcube/portlets/user/td/client/ribbon/TabularDataRibbon.java index a84beea..d92c616 100644 --- a/src/main/java/org/gcube/portlets/user/td/client/ribbon/TabularDataRibbon.java +++ b/src/main/java/org/gcube/portlets/user/td/client/ribbon/TabularDataRibbon.java @@ -57,12 +57,12 @@ public class TabularDataRibbon { con = new VerticalLayoutContainer(); con.add(modifyToolBar.getToolBar(), vldata); ribbon.add(con, msgs.modify()); - /* + ruleToolBar = new RuleToolBar(eventBus); con = new VerticalLayoutContainer(); con.add(ruleToolBar.getToolBar(), vldata); ribbon.add(con, msgs.rule()); - */ + templateToolBar = new TemplateToolBar(eventBus); con = new VerticalLayoutContainer(); con.add(templateToolBar.getToolBar(), vldata);