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:
parent
d58c03ff1c
commit
393c1139c0
|
@ -315,7 +315,7 @@ public class TabularDataController {
|
|||
|
||||
//
|
||||
public void restoreUISession() {
|
||||
TDGWTServiceAsync.INSTANCE.getCurrentTRId(new AsyncCallback<TRId>() {
|
||||
TDGWTServiceAsync.INSTANCE.restoreUISession(new AsyncCallback<TRId>() {
|
||||
|
||||
public void onFailure(Throwable caught) {
|
||||
|
||||
|
|
|
@ -9,13 +9,14 @@ 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();
|
||||
|
@ -23,7 +24,6 @@ public interface TabularDataResources extends ClientBundle {
|
|||
@Source("arrow-refresh.png")
|
||||
ImageResource refresh();
|
||||
|
||||
|
||||
@Source("page-white-add_32.png")
|
||||
ImageResource open32();
|
||||
|
||||
|
@ -48,7 +48,6 @@ public interface TabularDataResources extends ClientBundle {
|
|||
@Source("properties.png")
|
||||
ImageResource properties();
|
||||
|
||||
|
||||
@Source("sdmx.png")
|
||||
ImageResource sdmx();
|
||||
|
||||
|
@ -61,14 +60,12 @@ public interface TabularDataResources extends ClientBundle {
|
|||
@Source("gis_32.png")
|
||||
ImageResource gis32();
|
||||
|
||||
|
||||
@Source("csv.png")
|
||||
ImageResource csv();
|
||||
|
||||
@Source("json.png")
|
||||
ImageResource json();
|
||||
|
||||
|
||||
@Source("chart-bar.png")
|
||||
ImageResource chart();
|
||||
|
||||
|
@ -87,14 +84,12 @@ public interface TabularDataResources extends ClientBundle {
|
|||
@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();
|
||||
|
||||
|
@ -110,26 +105,21 @@ public interface TabularDataResources extends ClientBundle {
|
|||
@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();
|
||||
|
||||
|
@ -148,7 +138,6 @@ public interface TabularDataResources extends ClientBundle {
|
|||
@Source("table-expand.png")
|
||||
ImageResource tableExpand();
|
||||
|
||||
|
||||
@Source("table-group_32.png")
|
||||
ImageResource group32();
|
||||
|
||||
|
@ -158,7 +147,6 @@ public interface TabularDataResources extends ClientBundle {
|
|||
@Source("table-aggregate_32.png")
|
||||
ImageResource aggregate32();
|
||||
|
||||
|
||||
@Source("history_32.png")
|
||||
ImageResource history32();
|
||||
|
||||
|
@ -192,7 +180,6 @@ public interface TabularDataResources extends ClientBundle {
|
|||
@Source("column-filter.png")
|
||||
ImageResource columnFilter();
|
||||
|
||||
|
||||
@Source("column-edit_32.png")
|
||||
ImageResource columnEdit32();
|
||||
|
||||
|
@ -229,7 +216,6 @@ public interface TabularDataResources extends ClientBundle {
|
|||
@Source("column-replace-batch_32.png")
|
||||
ImageResource columnReplaceBatch32();
|
||||
|
||||
|
||||
@Source("column_32.png")
|
||||
ImageResource column32();
|
||||
|
||||
|
@ -260,7 +246,6 @@ public interface TabularDataResources extends ClientBundle {
|
|||
@Source("validate-add.png")
|
||||
ImageResource validateAdd();
|
||||
|
||||
|
||||
@Source("pencil_32.png")
|
||||
ImageResource rowEdit32();
|
||||
|
||||
|
@ -315,6 +300,12 @@ public interface TabularDataResources extends ClientBundle {
|
|||
@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();
|
||||
|
||||
|
@ -381,7 +372,6 @@ public interface TabularDataResources extends ClientBundle {
|
|||
@Source("tabular-resource-clone.png")
|
||||
ImageResource clone();
|
||||
|
||||
|
||||
@Source("codelistmapping_32.png")
|
||||
ImageResource codelistMapping32();
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 927 B |
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -3,32 +3,34 @@ 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);
|
||||
TemplateOpenPanel templateDeletePanel = new TemplateOpenPanel(this,
|
||||
eventBus);
|
||||
add(templateDeletePanel);
|
||||
}
|
||||
|
||||
|
@ -54,7 +56,6 @@ public class TemplateOpenDialog extends Window {
|
|||
|
||||
closeBtn.addSelectHandler(new SelectHandler() {
|
||||
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
close();
|
||||
}
|
||||
|
@ -62,18 +63,25 @@ public class TemplateOpenDialog extends Window {
|
|||
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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,6 +64,7 @@ public class TemplateOpenPanel extends FramedPanel {
|
|||
|
||||
private TextButton btnOpen;
|
||||
private TextButton btnClose;
|
||||
private TextButton btnShare;
|
||||
|
||||
protected ListLoader<ListLoadConfig, ListLoadResult<TemplateData>> loader;
|
||||
protected Grid<TemplateData> grid;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -220,12 +230,25 @@ public class TemplateOpenPanel extends FramedPanel {
|
|||
}
|
||||
});
|
||||
|
||||
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(btnShare, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||
|
||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||
v.add(toolBarHead, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
|
@ -302,12 +325,29 @@ 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 |
Loading…
Reference in New Issue