Added Share Template

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@100774 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-10-16 16:44:25 +00:00
parent d58c03ff1c
commit 393c1139c0
14 changed files with 239 additions and 181 deletions

View File

@ -315,10 +315,10 @@ public class TabularDataController {
//
public void restoreUISession() {
TDGWTServiceAsync.INSTANCE.getCurrentTRId(new AsyncCallback<TRId>() {
TDGWTServiceAsync.INSTANCE.restoreUISession(new AsyncCallback<TRId>() {
public void onFailure(Throwable caught) {
}
public void onSuccess(TRId trId) {

View File

@ -9,72 +9,69 @@ import com.google.gwt.resources.client.ImageResource;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
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();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 927 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -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;

View File

@ -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: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
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<TemplateData, String> categoryCol = new ColumnConfig<TemplateData, String>(
props.category(), 60, "Category");
ColumnConfig<TemplateData, String> ownerCol = new ColumnConfig<TemplateData, String>(
props.ownerLogin(), 70, "Owner");
ColumnConfig<TemplateData, String> agencyCol = new ColumnConfig<TemplateData, String>(
props.agency(), 100, "Agency");
@ -114,6 +123,7 @@ public class TemplateApplyPanel extends FramedPanel {
List<ColumnConfig<TemplateData, ?>> l = new ArrayList<ColumnConfig<TemplateData, ?>>();
l.add(nameCol);
l.add(categoryCol);
l.add(ownerCol);
l.add(agencyCol);
l.add(descriptionCol);

View File

@ -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: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface TemplateDataProperties extends PropertyAccess<TemplateData> {
@Path("id")
ModelKeyProvider<TemplateData> id();
ValueProvider<TemplateData, String> name();
ValueProvider<TemplateData, String> category();
ValueProvider<TemplateData, String> ownerLogin();
ValueProvider<TemplateData, String> agency();
ValueProvider<TemplateData, String> description();
ValueProvider<TemplateData, String> category();
}

View File

@ -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;

View File

@ -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<TemplateData, String> categoryCol = new ColumnConfig<TemplateData, String>(
props.category(), 60, "Category");
ColumnConfig<TemplateData, String> ownerCol = new ColumnConfig<TemplateData, String>(
props.ownerLogin(), 70, "Owner");
ColumnConfig<TemplateData, String> agencyCol = new ColumnConfig<TemplateData, String>(
props.agency(), 100, "Agency");
@ -114,6 +115,7 @@ public class TemplateDeletePanel extends FramedPanel {
List<ColumnConfig<TemplateData, ?>> l = new ArrayList<ColumnConfig<TemplateData, ?>>();
l.add(nameCol);
l.add(categoryCol);
l.add(ownerCol);
l.add(agencyCol);
l.add(descriptionCol);

View File

@ -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"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
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();
}
}

View File

@ -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: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
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<ListLoadConfig, ListLoadResult<TemplateData>> loader;
protected Grid<TemplateData> grid;
protected ExtendedListStore<TemplateData> store;
@ -102,6 +109,8 @@ public class TemplateOpenPanel extends FramedPanel {
ColumnConfig<TemplateData, String> categoryCol = new ColumnConfig<TemplateData, String>(
props.category(), 60, "Category");
ColumnConfig<TemplateData, String> ownerCol = new ColumnConfig<TemplateData, String>(
props.ownerLogin(), 70, "Owner");
ColumnConfig<TemplateData, String> agencyCol = new ColumnConfig<TemplateData, String>(
props.agency(), 100, "Agency");
@ -112,6 +121,7 @@ public class TemplateOpenPanel extends FramedPanel {
List<ColumnConfig<TemplateData, ?>> l = new ArrayList<ColumnConfig<TemplateData, ?>>();
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<TemplateData> 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();

Binary file not shown.

After

Width:  |  Height:  |  Size: 927 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -60,13 +60,13 @@
<!-- Specify the app entry point class. -->
<entry-point class='org.gcube.portlets.user.td.client.TabularDataPortlet' />
<!--
<!--
<set-property name="log_DivLogger" value="ENABLED" /> <set-property
name="log_ConsoleLogger" value="ENABLED" /> <set-property name="log_FirebugLogger"
value="ENABLED" /> <set-property name="log_GWTLogger" value="ENABLED" />
<set-property name="log_SystemLogger" value="ENABLED" /> -->
<set-property name="log_DivLogger" value="DISABLED" />
<set-property name="log_ConsoleLogger" value="DISABLED" />
<set-property name="log_FirebugLogger" value="DISABLED" />