Integrated SDMX import wizard

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@74934 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Federico De Faveri 2013-05-14 13:41:50 +00:00
parent 28c8afc2a1
commit b425f33161
5 changed files with 74 additions and 0 deletions

View File

@ -8,6 +8,9 @@
<dependent-module archiveName="tabular-data-widget-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/tabular-data-widget/tabular-data-widget"> <dependent-module archiveName="tabular-data-widget-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/tabular-data-widget/tabular-data-widget">
<dependency-type>uses</dependency-type> <dependency-type>uses</dependency-type>
</dependent-module> </dependent-module>
<dependent-module archiveName="sdmx-import-wizard-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/sdmx-import-wizard/sdmx-import-wizard">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/> <property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
<property name="context-root" value="tabular-data-portlet"/> <property name="context-root" value="tabular-data-portlet"/>
</wb-module> </wb-module>

View File

@ -84,6 +84,13 @@
<version>[1.1.0-SNAPSHOT,2.0.0-SNAPSHOT)</version> <version>[1.1.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<!-- SDMX IMPORT WIZARD -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>sdmx-import-wizard</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -3,10 +3,18 @@
*/ */
package org.gcube.portlets.user.td.client; package org.gcube.portlets.user.td.client;
import java.util.List;
import org.gcube.portlets.user.sdmximportwizard.client.SDMXImportWizardWindow;
import org.gcube.portlets.user.sdmximportwizard.client.SDMXWizardSelectionEvent;
import org.gcube.portlets.user.sdmximportwizard.client.SDMXWizardSelectionEvent.WizardSelectionHandler;
import org.gcube.portlets.user.sdmximportwizard.shared.Dataset;
import org.gcube.portlets.user.td.client.event.ImportTableEvent; import org.gcube.portlets.user.td.client.event.ImportTableEvent;
import org.gcube.portlets.user.td.client.event.ImportTableType; import org.gcube.portlets.user.td.client.event.ImportTableType;
import com.allen_sauer.gwt.log.client.Log; import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.RunAsyncCallback;
import com.google.web.bindery.event.shared.EventBus; import com.google.web.bindery.event.shared.EventBus;
import com.google.web.bindery.event.shared.SimpleEventBus; import com.google.web.bindery.event.shared.SimpleEventBus;
import com.sencha.gxt.widget.core.client.info.Info; import com.sencha.gxt.widget.core.client.info.Info;
@ -47,6 +55,49 @@ public class TabularDataController {
{ {
Log.trace("doImportTable importType: "+importType); Log.trace("doImportTable importType: "+importType);
Info.display("ImportTableEvent", "importType: "+importType); Info.display("ImportTableEvent", "importType: "+importType);
switch (importType) {
case SDMX: doSDMXDatasetImport(); break;
default:
break;
}
}
protected void doSDMXDatasetImport()
{
GWT.runAsync(new RunAsyncCallback() {
@Override
public void onSuccess() {
SDMXImportWizardWindow<Dataset> importWizard = SDMXImportWizardWindow.getDatasetWizard();
importWizard.addWizardSelectionHandler(new WizardSelectionHandler<Dataset>() {
@Override
public void onSelected(SDMXWizardSelectionEvent<Dataset> event) {
doDataseImport(event.getSelected());
}
@Override
public void onClosed(SDMXWizardSelectionEvent<Dataset> event) {
}
});
importWizard.show();
}
@Override
public void onFailure(Throwable reason) {
// TODO Auto-generated method stub
}
});
}
protected void doDataseImport(List<Dataset> datasets)
{
} }
} }

View File

@ -8,6 +8,7 @@
<inherits name="com.allen_sauer.gwt.log.gwt-log-TRACE" /> <inherits name="com.allen_sauer.gwt.log.gwt-log-TRACE" />
<!-- <inherits name='org.gcube.portlets.user.workspace.WorkspaceTree' /> --> <!-- <inherits name='org.gcube.portlets.user.workspace.WorkspaceTree' /> -->
<inherits name="org.gcube.portlets.user.tdw.TabularDataWidget" /> <inherits name="org.gcube.portlets.user.tdw.TabularDataWidget" />
<inherits name='org.gcube.portlets.user.sdmximportwizard.sdmximportwizard' />
<!-- Specify the app entry point class. --> <!-- Specify the app entry point class. -->
<entry-point class='org.gcube.portlets.user.td.client.TabularDataPortlet' /> <entry-point class='org.gcube.portlets.user.td.client.TabularDataPortlet' />

View File

@ -49,6 +49,18 @@
<url-pattern>/tabulardataportlet/tdwdata</url-pattern> <url-pattern>/tabulardataportlet/tdwdata</url-pattern>
</servlet-mapping> </servlet-mapping>
<!-- SDMX IMPORT WIZARD -->
<servlet>
<servlet-name>SDMXImportWizardServlet</servlet-name>
<servlet-class>org.gcube.portlets.user.sdmximportwizard.server.SDMXImportWizardServiceImpl</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>SDMXImportWizardServlet</servlet-name>
<url-pattern>/tabulardataportlet/SDMXImportWizardService</url-pattern>
</servlet-mapping>
<!-- Default page to serve --> <!-- Default page to serve -->
<welcome-file-list> <welcome-file-list>
<welcome-file>TabularDataPortlet.html</welcome-file> <welcome-file>TabularDataPortlet.html</welcome-file>