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>
<version>3.0.1</version>
</dependency>
<!-- Portlet -->
<dependency>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.applicationsupportlayer</groupId>
@ -137,12 +137,12 @@
<version>[1.0.2-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>custom-portal-handler</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslcore</artifactId>
@ -173,15 +173,15 @@
<!-- <version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version> -->
<scope>provided</scope>
</dependency>
<!-- service-client-impl -->
<!-- service-client-impl -->
<dependency>
<groupId>org.gcube.data.analysis.tabulardata</groupId>
<artifactId>service-client-impl</artifactId>
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
</dependency>
<!-- Apache Common Library -->
<dependency>
@ -213,7 +213,7 @@
<version>[0.2.0-SNAPSHOT,1.0.0-SNAPSHOT)</version>
</dependency>
<!-- tabular-data-widget-common-event -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
@ -241,7 +241,7 @@
<artifactId>tabular-data-wizard-widget</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency>
<!-- TD Expression -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
@ -270,7 +270,7 @@
<artifactId>tabular-data-share-widget</artifactId>
<version>[0.0.1-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency>
<!-- tabular-data-csv-import-widget -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
@ -284,7 +284,7 @@
<artifactId>tabular-data-sdmx-import-widget</artifactId>
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
</dependency>
<!-- tabular-data-open-widget -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
@ -305,14 +305,14 @@
<artifactId>tabular-data-sdmx-export-widget</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency>
<!-- tabular-data-json-export-widget -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>tabular-data-json-export-widget</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency>
<!-- tabular-data-codelistmapping-import-widget -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
@ -362,6 +362,12 @@
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</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 -->
<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.shared.exception.TDGWTSessionExpiredException;
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.sdmxexportwidget.client.SDMXExportWizardTD;
import org.gcube.portlets.user.td.sdmximportwidget.client.SDMXImportWizardTD;
@ -95,10 +96,17 @@ public class TabularDataController {
protected ContentPanel toolBoxPanel;
protected BorderLayoutData westData;
/**
* Current user
*/
protected String userName;
/**
* Tabular Resource Id
*/
protected TRId trId;
/**
* Grid TableId
@ -151,6 +159,8 @@ public class TabularDataController {
protected void callHello() {
TDGWTServiceAsync.INSTANCE.hello(new AsyncCallback<String>() {
@Override
public void onFailure(Throwable caught) {
Log.info("No valid user found: " + caught.getMessage());
@ -164,6 +174,7 @@ public class TabularDataController {
@Override
public void onSuccess(String result) {
userName=result;
Log.info("Hello: " + result);
}
@ -660,7 +671,8 @@ public class TabularDataController {
break;
case SPREAD:
break;
case GIS:
case CREATEGISMAP:
openCreateMapWizard();
break;
default:
break;
@ -1000,6 +1012,8 @@ public class TabularDataController {
});
}
protected void openTableUnionWizard() {
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
*

View File

@ -4,7 +4,12 @@
package org.gcube.portlets.user.td.client.ribbon;
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.NodeList;
import com.google.gwt.user.client.ui.FlexTable;
@ -44,7 +49,7 @@ public class AnalyseToolBar {
protected TextButton addRowButton;
protected TextButton deleteRowButton;
protected TextButton deleteDuplicateButton;
//protected TextButton annotationButton;
// protected TextButton annotationButton;
protected TextButton filterColumnButton;
protected TextButton replaceValueBatchButton;
@ -83,7 +88,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON));
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
@ -100,7 +105,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON));
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
@ -117,7 +122,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON));
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
@ -134,7 +139,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON));
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
@ -151,7 +156,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON));
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
@ -168,7 +173,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON));
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
@ -185,31 +190,12 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON));
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
tableLayout.setWidget(0, 6, deleteDuplicateButton);
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());
// Column Group
@ -234,7 +220,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON));
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
@ -245,14 +231,13 @@ public class AnalyseToolBar {
TabularDataResources.INSTANCE.columnReplaceBatch32());
replaceValueBatchButton.setScale(ButtonScale.LARGE);
replaceValueBatchButton.setIconAlign(IconAlign.TOP);
replaceValueBatchButton
.setToolTip("Replace column values in batch");
replaceValueBatchButton.setToolTip("Replace column values in batch");
replaceValueBatchButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
replaceValueBatchButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON));
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
@ -282,7 +267,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON));
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
@ -299,7 +284,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON));
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
@ -316,7 +301,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON));
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
@ -333,7 +318,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON));
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
@ -363,7 +348,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON));
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
@ -380,7 +365,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON));
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
@ -397,7 +382,7 @@ public class AnalyseToolBar {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON));
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
@ -406,33 +391,43 @@ public class AnalyseToolBar {
cleanCells(processLayout.getElement());
// Project
ButtonGroup projectGroup = new ButtonGroup();
projectGroup.setId("Project");
projectGroup.setStyleName("ribbon");
projectGroup.setHeadingText("Project");
projectGroup.disable();
toolBar.add(projectGroup);
// GIS
ButtonGroup gisGroup = new ButtonGroup();
gisGroup.setId("GIS");
gisGroup.setStyleName("ribbon");
gisGroup.setHeadingText("GIS");
toolBar.add(gisGroup);
FlexTable projectLayout = new FlexTable();
projectGroup.add(projectLayout);
FlexTable gisLayout = new FlexTable();
gisGroup.add(gisLayout);
gisButton = new TextButton("GIS", TabularDataResources.INSTANCE.gis32());
gisButton = new TextButton("Create Map",
TabularDataResources.INSTANCE.gis32());
gisButton.setScale(ButtonScale.LARGE);
gisButton.setIconAlign(IconAlign.TOP);
gisButton.setToolTip("GIS");
gisButton.setToolTip("Create Map");
gisButton.disable();
gisButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
gisButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON));
eventBus.fireEvent(new RibbonEvent(RibbonType.CREATEGISMAP));
}
});
projectLayout.setWidget(0, 0, gisButton);
projectLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
cleanCells(projectLayout.getElement());
gisLayout.setWidget(0, 0, gisButton);
gisLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
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
name='org.gcube.portlets.user.td.codelistmappingimportwidget.CodelistMappingImportWizardTD' />
<inherits name='org.gcube.portlets.user.td.unionwizardwidget.UnionWizardTD' />
<inherits name='org.gcube.portlets.user.td.mapwidget.MapWidgetTD' />
<inherits

View File

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