Updated Map Creation

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@100628 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-10-13 09:58:16 +00:00
parent 3c501731c7
commit 0049bd8821
5 changed files with 156 additions and 70 deletions

32
pom.xml
View File

@ -116,14 +116,14 @@
<artifactId>gxt</artifactId> <artifactId>gxt</artifactId>
<version>3.0.1</version> <version>3.0.1</version>
</dependency> </dependency>
<!-- Portlet --> <!-- Portlet -->
<dependency> <dependency>
<groupId>javax.portlet</groupId> <groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId> <artifactId>portlet-api</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.gcube.applicationsupportlayer</groupId> <groupId>org.gcube.applicationsupportlayer</groupId>
@ -137,12 +137,12 @@
<version>[1.0.2-SNAPSHOT,2.0.0-SNAPSHOT)</version> <version>[1.0.2-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.gcube.portal</groupId> <groupId>org.gcube.portal</groupId>
<artifactId>custom-portal-handler</artifactId> <artifactId>custom-portal-handler</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.gcube.applicationsupportlayer</groupId> <groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslcore</artifactId> <artifactId>aslcore</artifactId>
@ -173,15 +173,15 @@
<!-- <version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version> --> <!-- <version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version> -->
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- service-client-impl --> <!-- service-client-impl -->
<dependency> <dependency>
<groupId>org.gcube.data.analysis.tabulardata</groupId> <groupId>org.gcube.data.analysis.tabulardata</groupId>
<artifactId>service-client-impl</artifactId> <artifactId>service-client-impl</artifactId>
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version> <version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<!-- Apache Common Library --> <!-- Apache Common Library -->
<dependency> <dependency>
@ -213,7 +213,7 @@
<version>[0.2.0-SNAPSHOT,1.0.0-SNAPSHOT)</version> <version>[0.2.0-SNAPSHOT,1.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<!-- tabular-data-widget-common-event --> <!-- tabular-data-widget-common-event -->
<dependency> <dependency>
<groupId>org.gcube.portlets.user</groupId> <groupId>org.gcube.portlets.user</groupId>
@ -241,7 +241,7 @@
<artifactId>tabular-data-wizard-widget</artifactId> <artifactId>tabular-data-wizard-widget</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version> <version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<!-- TD Expression --> <!-- TD Expression -->
<dependency> <dependency>
<groupId>org.gcube.portlets.user</groupId> <groupId>org.gcube.portlets.user</groupId>
@ -270,7 +270,7 @@
<artifactId>tabular-data-share-widget</artifactId> <artifactId>tabular-data-share-widget</artifactId>
<version>[0.0.1-SNAPSHOT,2.0.0-SNAPSHOT)</version> <version>[0.0.1-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<!-- tabular-data-csv-import-widget --> <!-- tabular-data-csv-import-widget -->
<dependency> <dependency>
<groupId>org.gcube.portlets.user</groupId> <groupId>org.gcube.portlets.user</groupId>
@ -284,7 +284,7 @@
<artifactId>tabular-data-sdmx-import-widget</artifactId> <artifactId>tabular-data-sdmx-import-widget</artifactId>
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version> <version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<!-- tabular-data-open-widget --> <!-- tabular-data-open-widget -->
<dependency> <dependency>
<groupId>org.gcube.portlets.user</groupId> <groupId>org.gcube.portlets.user</groupId>
@ -305,14 +305,14 @@
<artifactId>tabular-data-sdmx-export-widget</artifactId> <artifactId>tabular-data-sdmx-export-widget</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version> <version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<!-- tabular-data-json-export-widget --> <!-- tabular-data-json-export-widget -->
<dependency> <dependency>
<groupId>org.gcube.portlets.user</groupId> <groupId>org.gcube.portlets.user</groupId>
<artifactId>tabular-data-json-export-widget</artifactId> <artifactId>tabular-data-json-export-widget</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version> <version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<!-- tabular-data-codelistmapping-import-widget --> <!-- tabular-data-codelistmapping-import-widget -->
<dependency> <dependency>
<groupId>org.gcube.portlets.user</groupId> <groupId>org.gcube.portlets.user</groupId>
@ -362,6 +362,12 @@
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version> <version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<!-- tabular-data-map-widget -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>tabular-data-map-widget</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency>
<!--tabular-data-tasks-widget --> <!--tabular-data-tasks-widget -->
<dependency> <dependency>

View File

@ -21,6 +21,7 @@ import org.gcube.portlets.user.td.extractcodelistwidget.client.ExtractCodelistWi
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException; import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.jsonexportwidget.client.JSONExportWidgetTD; import org.gcube.portlets.user.td.jsonexportwidget.client.JSONExportWidgetTD;
import org.gcube.portlets.user.td.mapwidget.client.MapWidgetTD;
import org.gcube.portlets.user.td.openwidget.client.TDOpen; import org.gcube.portlets.user.td.openwidget.client.TDOpen;
import org.gcube.portlets.user.td.sdmxexportwidget.client.SDMXExportWizardTD; import org.gcube.portlets.user.td.sdmxexportwidget.client.SDMXExportWizardTD;
import org.gcube.portlets.user.td.sdmximportwidget.client.SDMXImportWizardTD; import org.gcube.portlets.user.td.sdmximportwidget.client.SDMXImportWizardTD;
@ -95,10 +96,17 @@ public class TabularDataController {
protected ContentPanel toolBoxPanel; protected ContentPanel toolBoxPanel;
protected BorderLayoutData westData; protected BorderLayoutData westData;
/**
* Current user
*/
protected String userName;
/** /**
* Tabular Resource Id * Tabular Resource Id
*/ */
protected TRId trId; protected TRId trId;
/** /**
* Grid TableId * Grid TableId
@ -151,6 +159,8 @@ public class TabularDataController {
protected void callHello() { protected void callHello() {
TDGWTServiceAsync.INSTANCE.hello(new AsyncCallback<String>() { TDGWTServiceAsync.INSTANCE.hello(new AsyncCallback<String>() {
@Override @Override
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
Log.info("No valid user found: " + caught.getMessage()); Log.info("No valid user found: " + caught.getMessage());
@ -164,6 +174,7 @@ public class TabularDataController {
@Override @Override
public void onSuccess(String result) { public void onSuccess(String result) {
userName=result;
Log.info("Hello: " + result); Log.info("Hello: " + result);
} }
@ -660,7 +671,8 @@ public class TabularDataController {
break; break;
case SPREAD: case SPREAD:
break; break;
case GIS: case CREATEGISMAP:
openCreateMapWizard();
break; break;
default: default:
break; break;
@ -1000,6 +1012,8 @@ public class TabularDataController {
}); });
} }
protected void openTableUnionWizard() { protected void openTableUnionWizard() {
GWT.runAsync(new RunAsyncCallback() { GWT.runAsync(new RunAsyncCallback() {
@ -1041,6 +1055,49 @@ public class TabularDataController {
} }
protected void openCreateMapWizard() {
GWT.runAsync(new RunAsyncCallback() {
public void onSuccess() {
openWizard();
MapWidgetTD mapWizard = new MapWidgetTD(trId, userName, "Map Creation",
eventBus);
mapWizard.addListener(new WizardListener() {
public void failed(String title, String message,
Throwable throwable) {
UtilsGXT3.alert(title, message);
resumeUIState();
}
public void completed(TRId id) {
openTable(id);
}
@Override
public void putInBackground() {
Log.debug("PutInBakground");
}
public void aborted() {
resumeUIState();
}
});
}
public void onFailure(Throwable reason) {
asyncCodeLoadingFailed(reason);
}
});
}
/** /**
* @param switchState * @param switchState
* *

View File

@ -4,7 +4,12 @@
package org.gcube.portlets.user.td.client.ribbon; package org.gcube.portlets.user.td.client.ribbon;
import org.gcube.portlets.user.td.client.resource.TabularDataResources; import org.gcube.portlets.user.td.client.resource.TabularDataResources;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.RibbonEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.UIStateEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.RibbonType;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.UIStateType;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NodeList; import com.google.gwt.dom.client.NodeList;
import com.google.gwt.user.client.ui.FlexTable; import com.google.gwt.user.client.ui.FlexTable;
@ -44,7 +49,7 @@ public class AnalyseToolBar {
protected TextButton addRowButton; protected TextButton addRowButton;
protected TextButton deleteRowButton; protected TextButton deleteRowButton;
protected TextButton deleteDuplicateButton; protected TextButton deleteDuplicateButton;
//protected TextButton annotationButton; // protected TextButton annotationButton;
protected TextButton filterColumnButton; protected TextButton filterColumnButton;
protected TextButton replaceValueBatchButton; protected TextButton replaceValueBatchButton;
@ -83,7 +88,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new // eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON)); // RibbonEvent(RibbonType.TABLEAGGREAGETE));
} }
}); });
@ -100,7 +105,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new // eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON)); // RibbonEvent(RibbonType.TABLEAGGREAGETE));
} }
}); });
@ -117,7 +122,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new // eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON)); // RibbonEvent(RibbonType.TABLEAGGREAGETE));
} }
}); });
@ -134,7 +139,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new // eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON)); // RibbonEvent(RibbonType.TABLEAGGREAGETE));
} }
}); });
@ -151,7 +156,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new // eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON)); // RibbonEvent(RibbonType.TABLEAGGREAGETE));
} }
}); });
@ -168,7 +173,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new // eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON)); // RibbonEvent(RibbonType.TABLEAGGREAGETE));
} }
}); });
@ -185,31 +190,12 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new // eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON)); // RibbonEvent(RibbonType.TABLEAGGREAGETE));
} }
}); });
tableLayout.setWidget(0, 6, deleteDuplicateButton); tableLayout.setWidget(0, 6, deleteDuplicateButton);
tableLayout.getFlexCellFormatter().setRowSpan(0, 6, 2); tableLayout.getFlexCellFormatter().setRowSpan(0, 6, 2);
/*
annotationButton = new TextButton("Annotation",
TabularDataResources.INSTANCE.annotationAdd32());
annotationButton.setScale(ButtonScale.LARGE);
annotationButton.setIconAlign(IconAlign.TOP);
annotationButton.setToolTip("Add annotation column");
annotationButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
annotationButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON));
}
});
tableLayout.setWidget(0, 7, annotationButton);
tableLayout.getFlexCellFormatter().setRowSpan(0, 7, 2);
*/
cleanCells(tableLayout.getElement()); cleanCells(tableLayout.getElement());
// Column Group // Column Group
@ -234,7 +220,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new // eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON)); // RibbonEvent(RibbonType.TABLEAGGREAGETE));
} }
}); });
@ -245,14 +231,13 @@ public class AnalyseToolBar {
TabularDataResources.INSTANCE.columnReplaceBatch32()); TabularDataResources.INSTANCE.columnReplaceBatch32());
replaceValueBatchButton.setScale(ButtonScale.LARGE); replaceValueBatchButton.setScale(ButtonScale.LARGE);
replaceValueBatchButton.setIconAlign(IconAlign.TOP); replaceValueBatchButton.setIconAlign(IconAlign.TOP);
replaceValueBatchButton replaceValueBatchButton.setToolTip("Replace column values in batch");
.setToolTip("Replace column values in batch");
replaceValueBatchButton.setArrowAlign(ButtonArrowAlign.BOTTOM); replaceValueBatchButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
replaceValueBatchButton.addSelectHandler(new SelectHandler() { replaceValueBatchButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new // eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON)); // RibbonEvent(RibbonType.TABLEAGGREAGETE));
} }
}); });
@ -282,7 +267,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new // eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON)); // RibbonEvent(RibbonType.TABLEAGGREAGETE));
} }
}); });
@ -299,7 +284,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new // eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON)); // RibbonEvent(RibbonType.TABLEAGGREAGETE));
} }
}); });
@ -316,7 +301,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new // eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON)); // RibbonEvent(RibbonType.TABLEAGGREAGETE));
} }
}); });
@ -333,7 +318,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new // eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON)); // RibbonEvent(RibbonType.TABLEAGGREAGETE));
} }
}); });
@ -363,7 +348,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new // eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON)); // RibbonEvent(RibbonType.TABLEAGGREAGETE));
} }
}); });
@ -380,7 +365,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new // eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON)); // RibbonEvent(RibbonType.TABLEAGGREAGETE));
} }
}); });
@ -397,7 +382,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new // eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON)); // RibbonEvent(RibbonType.TABLEAGGREAGETE));
} }
}); });
@ -406,33 +391,43 @@ public class AnalyseToolBar {
cleanCells(processLayout.getElement()); cleanCells(processLayout.getElement());
// Project // GIS
ButtonGroup projectGroup = new ButtonGroup(); ButtonGroup gisGroup = new ButtonGroup();
projectGroup.setId("Project"); gisGroup.setId("GIS");
projectGroup.setStyleName("ribbon"); gisGroup.setStyleName("ribbon");
projectGroup.setHeadingText("Project"); gisGroup.setHeadingText("GIS");
projectGroup.disable(); toolBar.add(gisGroup);
toolBar.add(projectGroup);
FlexTable projectLayout = new FlexTable(); FlexTable gisLayout = new FlexTable();
projectGroup.add(projectLayout); gisGroup.add(gisLayout);
gisButton = new TextButton("GIS", TabularDataResources.INSTANCE.gis32()); gisButton = new TextButton("Create Map",
TabularDataResources.INSTANCE.gis32());
gisButton.setScale(ButtonScale.LARGE); gisButton.setScale(ButtonScale.LARGE);
gisButton.setIconAlign(IconAlign.TOP); gisButton.setIconAlign(IconAlign.TOP);
gisButton.setToolTip("GIS"); gisButton.setToolTip("Create Map");
gisButton.disable();
gisButton.setArrowAlign(ButtonArrowAlign.BOTTOM); gisButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
gisButton.addSelectHandler(new SelectHandler() { gisButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new eventBus.fireEvent(new RibbonEvent(RibbonType.CREATEGISMAP));
// ImportTableEvent(ImportTableType.JSON));
} }
}); });
projectLayout.setWidget(0, 0, gisButton); gisLayout.setWidget(0, 0, gisButton);
projectLayout.getFlexCellFormatter().setRowSpan(0, 0, 2); gisLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
cleanCells(projectLayout.getElement()); cleanCells(gisLayout.getElement());
eventBus.addHandler(UIStateEvent.TYPE,
new UIStateEvent.UIStateHandler() {
public void onUIState(UIStateEvent event) {
setUI(event);
}
}
);
} }
@ -447,4 +442,32 @@ public class AnalyseToolBar {
} }
} }
public void setUI(UIStateEvent event) {
UIStateType uiStateType = event.getUIStateType();
try {
switch (uiStateType) {
case START:
gisButton.disable();
break;
case TR_CLOSE:
case TR_READONLY:
gisButton.disable();
break;
case TR_OPEN:
case TABLEUPDATE:
case TABLECURATION:
gisButton.enable();
break;
case WIZARD_OPEN:
gisButton.disable();
break;
default:
break;
}
} catch (Exception e) {
Log.error("setUI Error on Ribbon Curation: "
+ e.getLocalizedMessage());
}
}
} }

View File

@ -45,7 +45,7 @@
<inherits <inherits
name='org.gcube.portlets.user.td.codelistmappingimportwidget.CodelistMappingImportWizardTD' /> name='org.gcube.portlets.user.td.codelistmappingimportwidget.CodelistMappingImportWizardTD' />
<inherits name='org.gcube.portlets.user.td.unionwizardwidget.UnionWizardTD' /> <inherits name='org.gcube.portlets.user.td.unionwizardwidget.UnionWizardTD' />
<inherits name='org.gcube.portlets.user.td.mapwidget.MapWidgetTD' />
<inherits <inherits

View File

@ -44,7 +44,7 @@
<inherits <inherits
name='org.gcube.portlets.user.td.codelistmappingimportwidget.CodelistMappingImportWizardTD' /> name='org.gcube.portlets.user.td.codelistmappingimportwidget.CodelistMappingImportWizardTD' />
<inherits name='org.gcube.portlets.user.td.unionwizardwidget.UnionWizardTD' /> <inherits name='org.gcube.portlets.user.td.unionwizardwidget.UnionWizardTD' />
<inherits name='org.gcube.portlets.user.td.mapwidget.MapWidgetTD' />
<inherits <inherits
name='org.gcube.portlets.widgets.lighttree.WorkspacePortletLightTree' /> name='org.gcube.portlets.widgets.lighttree.WorkspacePortletLightTree' />