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 2d6179e..5741a5c 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 @@ -315,10 +315,10 @@ public class TabularDataController { // public void restoreUISession() { - TDGWTServiceAsync.INSTANCE.getCurrentTRId(new AsyncCallback() { + TDGWTServiceAsync.INSTANCE.restoreUISession(new AsyncCallback() { public void onFailure(Throwable caught) { - + } public void onSuccess(TRId trId) { diff --git a/src/main/java/org/gcube/portlets/user/td/client/resource/TabularDataResources.java b/src/main/java/org/gcube/portlets/user/td/client/resource/TabularDataResources.java index 23b04b4..0b6bb49 100644 --- a/src/main/java/org/gcube/portlets/user/td/client/resource/TabularDataResources.java +++ b/src/main/java/org/gcube/portlets/user/td/client/resource/TabularDataResources.java @@ -9,72 +9,69 @@ import com.google.gwt.resources.client.ImageResource; /** * - * @author "Giancarlo Panichi" - * g.panichi@isti.cnr.it + * @author "Giancarlo Panichi" g.panichi@isti.cnr.it * */ public interface TabularDataResources extends ClientBundle { - - public static final TabularDataResources INSTANCE = GWT.create(TabularDataResources.class); - + + public static final TabularDataResources INSTANCE = GWT + .create(TabularDataResources.class); + @Source("arrow-refresh_32.png") ImageResource refresh32(); - + @Source("arrow-refresh.png") ImageResource refresh(); - - + @Source("page-white-add_32.png") ImageResource open32(); - + @Source("page-white-close_32.png") ImageResource close32(); - + @Source("page-white-close.png") ImageResource close(); - + @Source("page-white-share_32.png") ImageResource share32(); - + @Source("page-white-share.png") ImageResource share(); - + @Source("disk.png") ImageResource save(); - + @Source("disk_32.png") ImageResource save32(); - + @Source("properties.png") ImageResource properties(); - - + @Source("sdmx.png") ImageResource sdmx(); - + @Source("sdmx_32.png") ImageResource sdmx32(); - + @Source("gis.png") ImageResource gis(); - + @Source("gis_32.png") ImageResource gis32(); - - + @Source("csv.png") ImageResource csv(); - + @Source("json.png") ImageResource json(); - - + @Source("chart-bar.png") ImageResource chart(); - + @Source("chart-bar_32.png") ImageResource chartBar32(); - + @Source("chart-bulls.png") ImageResource chartBulls(); @@ -83,333 +80,326 @@ public interface TabularDataResources extends ClientBundle { @Source("chart-curve.png") ImageResource chartCurve(); - + @Source("chart-curve_32.png") ImageResource chartCurve32(); - - + @Source("chart-pie.png") ImageResource chartPie(); - + @Source("chart-pie_32.png") ImageResource chartPie32(); - - + @Source("RStudio.png") ImageResource rstudio(); - + @Source("RStudio_32.png") ImageResource rstudio32(); - + @Source("statistical.png") ImageResource statistical(); - + @Source("statistical_32.png") ImageResource statistical32(); - + @Source("table-validate_32.png") ImageResource validation32(); - @Source("table-validate.png") ImageResource validation(); - - + @Source("rules.png") ImageResource rules(); - + @Source("rules_32.png") ImageResource rules32(); - - + @Source("table-filter_32.png") ImageResource filter32(); - + @Source("table-union_32.png") ImageResource union32(); - - - + @Source("table-denormalize_32.png") ImageResource tableDenormalize32(); - + @Source("table-denormalize.png") ImageResource tableDenormalize(); - + @Source("table-normalize_32.png") ImageResource tableNormalize32(); - + @Source("table-normalize.png") ImageResource tableNormalize(); - + @Source("table-expand_32.png") ImageResource tableExpand32(); - + @Source("table-expand.png") ImageResource tableExpand(); - - + @Source("table-group_32.png") ImageResource group32(); - + @Source("table-aggregate.png") ImageResource aggregate(); - + @Source("table-aggregate_32.png") ImageResource aggregate32(); - - - @Source("history_32.png") + + @Source("history_32.png") ImageResource history32(); - + @Source("arrow-undo_32.png") ImageResource discard32(); - + @Source("arrow-undo.png") ImageResource discard(); - + @Source("arrow-undo-all_32.png") ImageResource discardAll32(); - + @Source("arrow-undo-all.png") ImageResource discardAll(); - + @Source("column-type_32.png") ImageResource columnType32(); - + @Source("column-type.png") ImageResource columnType(); - + @Source("column-label_32.png") ImageResource columnLabel32(); - + @Source("column-label.png") ImageResource columnLabel(); - + @Source("column-filter_32.png") ImageResource columnFilter32(); - + @Source("column-filter.png") ImageResource columnFilter(); - - + @Source("column-edit_32.png") ImageResource columnEdit32(); - + @Source("column-edit.png") ImageResource columnEdit(); - + @Source("column-delete_32.png") ImageResource columnDelete32(); - + @Source("column-delete.png") ImageResource columnDelete(); @Source("column-add_32.png") ImageResource columnAdd32(); - + @Source("column-add.png") ImageResource columnAdd(); - + @Source("column-values_32.png") ImageResource columnValues32(); - + @Source("column-values.png") ImageResource columnValues(); - + @Source("column-replace.png") ImageResource columnReplace(); - + @Source("column-replace_32.png") ImageResource columnReplace32(); - + @Source("column-replace-batch.png") ImageResource columnReplaceBatch(); - + @Source("column-replace-batch_32.png") ImageResource columnReplaceBatch32(); - - + @Source("column_32.png") ImageResource column32(); - + @Source("column.png") ImageResource column(); - + @Source("cog_32.png") ImageResource cog32(); - + @Source("cog.png") ImageResource cog(); - + @Source("delete_32.png") ImageResource delete32(); - + @Source("delete.png") ImageResource delete(); - + @Source("rule-add_32.png") ImageResource ruleAdd32(); - + @Source("rule-add.png") ImageResource ruleAdd(); - + @Source("validate-add_32.png") ImageResource validateAdd32(); - + @Source("validate-add.png") ImageResource validateAdd(); - - + @Source("pencil_32.png") ImageResource rowEdit32(); - + @Source("pencil.png") ImageResource rowEdit(); - + @Source("table-row-insert_32.png") ImageResource rowInsert32(); - + @Source("table-row-insert.png") ImageResource rowInsert(); - + @Source("table-row-delete_32.png") ImageResource rowRemove32(); - + @Source("table-row-delete.png") ImageResource rowRemove(); - + @Source("help_32.png") ImageResource help32(); - + @Source("help.png") ImageResource help(); - + @Source("logs_32.png") ImageResource logs32(); - + @Source("logs.png") ImageResource logs(); - + @Source("template-add_32.png") ImageResource templateAdd32(); - + @Source("template-add.png") ImageResource templateAdd(); - + @Source("template-edit_32.png") ImageResource templateEdit32(); - + @Source("template-edit.png") ImageResource templateEdit(); - + @Source("template-delete.png") ImageResource templateDelete(); - + @Source("template-delete_32.png") ImageResource templateDelete32(); - + @Source("template-apply.png") ImageResource templateApply(); - + @Source("template-apply_32.png") ImageResource templateApply32(); - + + @Source("template-share.png") + ImageResource templateShare(); + + @Source("template-share_32.png") + ImageResource templateShare32(); + @Source("timeline_32.png") ImageResource timeline32(); - + @Source("timeline.png") ImageResource timeline(); - + @Source("wrench-manage_32.png") ImageResource wrenchManage32(); - + @Source("wrench-manage.png") ImageResource wrenchManage(); - + @Source("table-duplicate-rows_32.png") ImageResource tableDuplicateRows32(); - + @Source("table-duplicate-rows.png") ImageResource tableDuplicateRows(); - + @Source("table-duplicate-rows-remove_32.png") ImageResource tableDuplicateRowsRemove32(); - + @Source("table-duplicate-rows-remove.png") ImageResource tableDuplicateRowsRemove(); - + @Source("table-type_32.png") ImageResource tableType32(); - + @Source("table-type.png") ImageResource tableType(); - + @Source("codelist_32.png") ImageResource codelist32(); - + @Source("codelist.png") ImageResource codelist(); - + @Source("summary_32.png") ImageResource summary32(); - + @Source("summary.png") ImageResource summary(); - + @Source("tag-blue-add_32.png") ImageResource annotationAdd32(); - + @Source("tag-blue-add.png") ImageResource annotationAdd(); - + @Source("tag-blue-delete_32.png") ImageResource annotationDelete32(); - + @Source("tag-blue-delete.png") ImageResource annotationDelete(); - + @Source("table-clone_32.png") ImageResource tableClone32(); - + @Source("table-clone.png") ImageResource tableClone(); - + @Source("tabular-resource-clone_32.png") ImageResource clone32(); - + @Source("tabular-resource-clone.png") ImageResource clone(); - - + @Source("codelistmapping_32.png") ImageResource codelistMapping32(); - + @Source("codelistmapping.png") ImageResource codelistMapping(); - + @Source("column-split_32.png") ImageResource columnSplit32(); - + @Source("column-split.png") ImageResource columnSplit(); - + @Source("column-merge_32.png") ImageResource columnMerge32(); - + @Source("column-merge.png") ImageResource columnMerge(); - + @Source("basket-background_32.png") ImageResource basketBackground32(); - + @Source("basket-background.png") ImageResource basketBackground(); - + @Source("column-replace-by-expression_32.png") ImageResource columnReplaceByExpression32(); - + @Source("column-replace-by-expression.png") ImageResource columnReplaceByExpression(); - + } diff --git a/src/main/java/org/gcube/portlets/user/td/client/resource/template-share.png b/src/main/java/org/gcube/portlets/user/td/client/resource/template-share.png new file mode 100644 index 0000000..a82add2 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/client/resource/template-share.png differ diff --git a/src/main/java/org/gcube/portlets/user/td/client/resource/template-share_32.png b/src/main/java/org/gcube/portlets/user/td/client/resource/template-share_32.png new file mode 100644 index 0000000..d38ccec Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/client/resource/template-share_32.png differ diff --git a/src/main/java/org/gcube/portlets/user/td/client/template/TemplateApplyDialog.java b/src/main/java/org/gcube/portlets/user/td/client/template/TemplateApplyDialog.java index ff86bc5..89e61fc 100644 --- a/src/main/java/org/gcube/portlets/user/td/client/template/TemplateApplyDialog.java +++ b/src/main/java/org/gcube/portlets/user/td/client/template/TemplateApplyDialog.java @@ -26,7 +26,7 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler; * */ public class TemplateApplyDialog extends Window implements MonitorDialogListener{ - protected String WIDTH = "650px"; + protected String WIDTH = "720px"; protected String HEIGHT = "530px"; protected TemplateApplySession templateApplySession; protected TRId trId; diff --git a/src/main/java/org/gcube/portlets/user/td/client/template/TemplateApplyPanel.java b/src/main/java/org/gcube/portlets/user/td/client/template/TemplateApplyPanel.java index ab08a8a..240578c 100644 --- a/src/main/java/org/gcube/portlets/user/td/client/template/TemplateApplyPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/client/template/TemplateApplyPanel.java @@ -51,8 +51,14 @@ import com.sencha.gxt.widget.core.client.grid.Grid; import com.sencha.gxt.widget.core.client.toolbar.LabelToolItem; import com.sencha.gxt.widget.core.client.toolbar.ToolBar; +/** + * + * @author giancarlo + * email: g.panichi@isti.cnr.it + * + */ public class TemplateApplyPanel extends FramedPanel { - protected String WIDTH = "560px"; + protected String WIDTH = "630px"; protected String HEIGHT = "520px"; protected EventBus eventBus; protected TemplateApplyDialog parent; @@ -105,6 +111,9 @@ public class TemplateApplyPanel extends FramedPanel { ColumnConfig categoryCol = new ColumnConfig( props.category(), 60, "Category"); + ColumnConfig ownerCol = new ColumnConfig( + props.ownerLogin(), 70, "Owner"); + ColumnConfig agencyCol = new ColumnConfig( props.agency(), 100, "Agency"); @@ -114,6 +123,7 @@ public class TemplateApplyPanel extends FramedPanel { List> l = new ArrayList>(); l.add(nameCol); l.add(categoryCol); + l.add(ownerCol); l.add(agencyCol); l.add(descriptionCol); diff --git a/src/main/java/org/gcube/portlets/user/td/client/template/TemplateDataProperties.java b/src/main/java/org/gcube/portlets/user/td/client/template/TemplateDataProperties.java index 92e809b..acc04b5 100644 --- a/src/main/java/org/gcube/portlets/user/td/client/template/TemplateDataProperties.java +++ b/src/main/java/org/gcube/portlets/user/td/client/template/TemplateDataProperties.java @@ -9,15 +9,23 @@ import com.sencha.gxt.core.client.ValueProvider; import com.sencha.gxt.data.shared.ModelKeyProvider; import com.sencha.gxt.data.shared.PropertyAccess; +/** + * + * @author giancarlo + * email: g.panichi@isti.cnr.it + * + */ public interface TemplateDataProperties extends PropertyAccess { @Path("id") ModelKeyProvider id(); ValueProvider name(); + ValueProvider category(); + ValueProvider ownerLogin(); ValueProvider agency(); ValueProvider description(); - ValueProvider category(); + } diff --git a/src/main/java/org/gcube/portlets/user/td/client/template/TemplateDeleteDialog.java b/src/main/java/org/gcube/portlets/user/td/client/template/TemplateDeleteDialog.java index 9583789..662b59b 100644 --- a/src/main/java/org/gcube/portlets/user/td/client/template/TemplateDeleteDialog.java +++ b/src/main/java/org/gcube/portlets/user/td/client/template/TemplateDeleteDialog.java @@ -21,7 +21,7 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler; * */ public class TemplateDeleteDialog extends Window { - protected String WIDTH = "650px"; + protected String WIDTH = "720px"; protected String HEIGHT = "530px"; protected TemplateDeleteSession templateDeleteSession; protected EventBus eventBus; diff --git a/src/main/java/org/gcube/portlets/user/td/client/template/TemplateDeletePanel.java b/src/main/java/org/gcube/portlets/user/td/client/template/TemplateDeletePanel.java index 4c6a4f0..6a5b61f 100644 --- a/src/main/java/org/gcube/portlets/user/td/client/template/TemplateDeletePanel.java +++ b/src/main/java/org/gcube/portlets/user/td/client/template/TemplateDeletePanel.java @@ -7,7 +7,6 @@ import org.gcube.portlets.user.td.client.resource.TabularDataResources; import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; import org.gcube.portlets.user.td.gwtservice.shared.template.TemplateData; import org.gcube.portlets.user.td.gwtservice.shared.template.TemplateDeleteSession; - import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3; import com.allen_sauer.gwt.log.client.Log; @@ -52,7 +51,7 @@ import com.sencha.gxt.widget.core.client.toolbar.LabelToolItem; import com.sencha.gxt.widget.core.client.toolbar.ToolBar; public class TemplateDeletePanel extends FramedPanel { - protected String WIDTH = "560px"; + protected String WIDTH = "630px"; protected String HEIGHT = "520px"; protected EventBus eventBus; protected TemplateDeleteDialog parent; @@ -104,6 +103,8 @@ public class TemplateDeletePanel extends FramedPanel { ColumnConfig categoryCol = new ColumnConfig( props.category(), 60, "Category"); + ColumnConfig ownerCol = new ColumnConfig( + props.ownerLogin(), 70, "Owner"); ColumnConfig agencyCol = new ColumnConfig( props.agency(), 100, "Agency"); @@ -114,6 +115,7 @@ public class TemplateDeletePanel extends FramedPanel { List> l = new ArrayList>(); l.add(nameCol); l.add(categoryCol); + l.add(ownerCol); l.add(agencyCol); l.add(descriptionCol); diff --git a/src/main/java/org/gcube/portlets/user/td/client/template/TemplateOpenDialog.java b/src/main/java/org/gcube/portlets/user/td/client/template/TemplateOpenDialog.java index 43855c3..0f33fd6 100644 --- a/src/main/java/org/gcube/portlets/user/td/client/template/TemplateOpenDialog.java +++ b/src/main/java/org/gcube/portlets/user/td/client/template/TemplateOpenDialog.java @@ -3,35 +3,37 @@ package org.gcube.portlets.user.td.client.template; import org.gcube.portlets.user.td.client.resource.TabularDataResources; import org.gcube.portlets.user.td.gwtservice.shared.template.TemplateData; import org.gcube.portlets.user.td.gwtservice.shared.template.TemplateDeleteSession; +import org.gcube.portlets.user.td.sharewidget.client.TemplateShare; import org.gcube.portlets.user.tdtemplate.client.TdTemplateController; import org.gcube.portlets.user.tdtemplate.client.TdTemplateControllerUpdater; +import com.allen_sauer.gwt.log.client.Log; import com.google.web.bindery.event.shared.EventBus; import com.sencha.gxt.widget.core.client.Window; import com.sencha.gxt.widget.core.client.event.SelectEvent; import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler; - /** * - * @author "Giancarlo Panichi" - * g.panichi@isti.cnr.it + * @author "Giancarlo Panichi" g.panichi@isti.cnr.it * */ -public class TemplateOpenDialog extends Window { - protected String WIDTH = "650px"; +public class TemplateOpenDialog extends Window { + protected String WIDTH = "720px"; protected String HEIGHT = "530px"; protected TemplateDeleteSession templateDeleteSession; protected EventBus eventBus; - + public TemplateOpenDialog(EventBus eventBus) { - this.eventBus=eventBus; + this.eventBus = eventBus; initWindow(); - - TemplateOpenPanel templateDeletePanel= new TemplateOpenPanel(this, eventBus); - add(templateDeletePanel); + + TemplateOpenPanel templateDeletePanel = new TemplateOpenPanel(this, + eventBus); + add(templateDeletePanel); } - + protected void initWindow() { setWidth(WIDTH); setHeight(HEIGHT); @@ -44,7 +46,7 @@ public class TemplateOpenDialog extends Window { getHeader().setIcon(TabularDataResources.INSTANCE.templateAdd()); } - + /** * {@inheritDoc} */ @@ -54,26 +56,32 @@ public class TemplateOpenDialog extends Window { closeBtn.addSelectHandler(new SelectHandler() { - public void onSelect(SelectEvent event) { close(); } }); } - - protected void close (){ + + protected void close() { hide(); } - - - public void templatesOpen(TemplateData template){ - TdTemplateControllerUpdater controller = new TdTemplateControllerUpdater(template.getId()); + + public void templateOpen(TemplateData template) { + TdTemplateControllerUpdater controller = new TdTemplateControllerUpdater( + template.getId()); TdTemplateController.bindCommonBus(eventBus); controller.getWindowTemplatePanel().show(); close(); - + } - - + + public void templateShare(TemplateData templateData) { + Log.debug("Open Share Window"); + @SuppressWarnings("unused") + TemplateShare templateShare = new TemplateShare(templateData, eventBus); + close(); + + } + } diff --git a/src/main/java/org/gcube/portlets/user/td/client/template/TemplateOpenPanel.java b/src/main/java/org/gcube/portlets/user/td/client/template/TemplateOpenPanel.java index fda75ed..7e6dc97 100644 --- a/src/main/java/org/gcube/portlets/user/td/client/template/TemplateOpenPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/client/template/TemplateOpenPanel.java @@ -49,8 +49,14 @@ import com.sencha.gxt.widget.core.client.grid.Grid; import com.sencha.gxt.widget.core.client.toolbar.LabelToolItem; import com.sencha.gxt.widget.core.client.toolbar.ToolBar; +/** + * + * @author giancarlo + * email: g.panichi@isti.cnr.it + * + */ public class TemplateOpenPanel extends FramedPanel { - protected String WIDTH = "560px"; + protected String WIDTH = "630px"; protected String HEIGHT = "520px"; protected EventBus eventBus; protected TemplateOpenDialog parent; @@ -58,7 +64,8 @@ public class TemplateOpenPanel extends FramedPanel { private TextButton btnOpen; private TextButton btnClose; - + private TextButton btnShare; + protected ListLoader> loader; protected Grid grid; protected ExtendedListStore store; @@ -102,6 +109,8 @@ public class TemplateOpenPanel extends FramedPanel { ColumnConfig categoryCol = new ColumnConfig( props.category(), 60, "Category"); + ColumnConfig ownerCol = new ColumnConfig( + props.ownerLogin(), 70, "Owner"); ColumnConfig agencyCol = new ColumnConfig( props.agency(), 100, "Agency"); @@ -112,6 +121,7 @@ public class TemplateOpenPanel extends FramedPanel { List> l = new ArrayList>(); l.add(nameCol); l.add(categoryCol); + l.add(ownerCol); l.add(agencyCol); l.add(descriptionCol); @@ -219,13 +229,26 @@ public class TemplateOpenPanel extends FramedPanel { close(); } }); + + btnShare = new TextButton("Share"); + btnShare.setIcon(TabularDataResources.INSTANCE.share()); + btnShare.setIconAlign(IconAlign.RIGHT); + btnShare.setTitle("Share"); + btnShare.addSelectHandler(new SelectHandler() { + + public void onSelect(SelectEvent event) { + Log.debug("Pressed Share"); + share(); + } + }); HBoxLayoutContainer flowButton = new HBoxLayoutContainer(); flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE); flowButton.setPack(BoxLayoutPack.CENTER); flowButton.add(btnOpen, new BoxLayoutData(new Margins(2, 4, 2, 4))); - flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4))); + flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4))); + flowButton.add(btnShare, new BoxLayoutData(new Margins(2, 4, 2, 4))); VerticalLayoutContainer v = new VerticalLayoutContainer(); v.add(toolBarHead, new VerticalLayoutData(1, -1, new Margins(0))); @@ -302,11 +325,28 @@ public class TemplateOpenPanel extends FramedPanel { } else { TemplateData template=templates.get(0); Log.debug("templateOpenSession: " + template); - parent.templatesOpen(template); + parent.templateOpen(template); } } + + protected void share() { + + ArrayList templates=getSelectedItem(); + if(templates==null|| templates.size()==0){ + UtilsGXT3.info("Attention", + "Select the template"); + } else { + TemplateData template=templates.get(0); + Log.debug("templateShare: " + template); + parent.templateShare(template); + + } + + } + + protected void close() { parent.close(); diff --git a/src/main/resources/org/gcube/portlets/user/td/client/resource/template-share.png b/src/main/resources/org/gcube/portlets/user/td/client/resource/template-share.png new file mode 100644 index 0000000..a82add2 Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/client/resource/template-share.png differ diff --git a/src/main/resources/org/gcube/portlets/user/td/client/resource/template-share_32.png b/src/main/resources/org/gcube/portlets/user/td/client/resource/template-share_32.png new file mode 100644 index 0000000..d38ccec Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/client/resource/template-share_32.png differ diff --git a/src/main/resources/org/gcube/portlets/user/td/tabulardataportlet.gwt.xml b/src/main/resources/org/gcube/portlets/user/td/tabulardataportlet.gwt.xml index b391b3a..feba730 100644 --- a/src/main/resources/org/gcube/portlets/user/td/tabulardataportlet.gwt.xml +++ b/src/main/resources/org/gcube/portlets/user/td/tabulardataportlet.gwt.xml @@ -60,13 +60,13 @@ - - +