git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-csv-export-widget@85578 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
f27519664b
commit
31dbc7fab3
|
@ -0,0 +1,22 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<launchConfiguration type="com.google.gwt.eclipse.core.launch.gwtJUnit">
|
||||||
|
<stringAttribute key="com.google.gwt.eclipse.core.LOG_LEVEL" value="INFO"/>
|
||||||
|
<booleanAttribute key="com.google.gwt.eclipse.core.NOT_HEADLESS" value="false"/>
|
||||||
|
<stringAttribute key="com.google.gwt.eclipse.core.OUT_DIR" value="www-test"/>
|
||||||
|
<booleanAttribute key="com.google.gwt.eclipse.core.STANDARDS_MODE" value="false"/>
|
||||||
|
<stringAttribute key="com.google.gwt.eclipse.core.STYLE" value="OBFUSCATED"/>
|
||||||
|
<stringAttribute key="com.google.gwt.eclipse.core.WEB_MODE" value="false"/>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||||
|
<listEntry value="/tabular-data-csv-export-widget/src/test/java/org/gcube/portlets/user/td/csvexportwidget/client/GwtTestCSVExportWizardTD.java"/>
|
||||||
|
</listAttribute>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||||
|
<listEntry value="1"/>
|
||||||
|
</listAttribute>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
|
||||||
|
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gdt.eclipse.maven.mavenClasspathProvider"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.gcube.portlets.user.td.csvexportwidget.client.GwtTestCSVExportWizardTD"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="tabular-data-csv-export-widget"/>
|
||||||
|
</launchConfiguration>
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<launchConfiguration type="com.google.gwt.eclipse.core.launch.gwtJUnit">
|
||||||
|
<stringAttribute key="com.google.gwt.eclipse.core.LOG_LEVEL" value="INFO"/>
|
||||||
|
<booleanAttribute key="com.google.gwt.eclipse.core.NOT_HEADLESS" value="false"/>
|
||||||
|
<stringAttribute key="com.google.gwt.eclipse.core.OUT_DIR" value="www-test"/>
|
||||||
|
<booleanAttribute key="com.google.gwt.eclipse.core.STANDARDS_MODE" value="false"/>
|
||||||
|
<stringAttribute key="com.google.gwt.eclipse.core.STYLE" value="OBFUSCATED"/>
|
||||||
|
<stringAttribute key="com.google.gwt.eclipse.core.WEB_MODE" value="true"/>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||||
|
<listEntry value="/tabular-data-csv-export-widget/src/test/java/org/gcube/portlets/user/td/csvexportwidget/client/GwtTestCSVExportWizardTD.java"/>
|
||||||
|
</listAttribute>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||||
|
<listEntry value="1"/>
|
||||||
|
</listAttribute>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
|
||||||
|
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gdt.eclipse.maven.mavenClasspathProvider"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.gcube.portlets.user.td.csvexportwidget.client.GwtTestCSVExportWizardTD"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="tabular-data-csv-export-widget"/>
|
||||||
|
</launchConfiguration>
|
|
@ -0,0 +1,292 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<artifactId>maven-parent</artifactId>
|
||||||
|
<groupId>org.gcube.tools</groupId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<relativePath />
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<!-- POM file generated with GWT webAppCreator -->
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
|
<artifactId>tabular-data-csv-export-widget</artifactId>
|
||||||
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
|
||||||
|
<name>tabular-data-csv-export-widget</name>
|
||||||
|
<description>tabular-data-csv-export-widget allows csv export inside file and workspace</description>
|
||||||
|
|
||||||
|
<scm>
|
||||||
|
<url>https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-csv-export-widget</url>
|
||||||
|
</scm>
|
||||||
|
|
||||||
|
<developers>
|
||||||
|
<developer>
|
||||||
|
<name>Giancarlo Panichi</name>
|
||||||
|
<email>g.panichi@isti.cnr.it</email>
|
||||||
|
<organization>CNR Pisa, Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo"</organization>
|
||||||
|
<roles>
|
||||||
|
<role>architect</role>
|
||||||
|
<role>developer</role>
|
||||||
|
</roles>
|
||||||
|
</developer>
|
||||||
|
</developers>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<distroDirectory>${project.basedir}/distro</distroDirectory>
|
||||||
|
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
|
||||||
|
<release.date>2013-10-18</release.date>
|
||||||
|
<templatesDirectory>templates</templatesDirectory>
|
||||||
|
<distroDirectory>distro</distroDirectory>
|
||||||
|
<configDirectory>config</configDirectory>
|
||||||
|
|
||||||
|
<!-- Convenience property to set the GWT version -->
|
||||||
|
<gwtVersion>2.5.1</gwtVersion>
|
||||||
|
<!-- To make this work on gwt-run you need to set up global env vars. on
|
||||||
|
MacOSX edit this file /etc/launchd.conf and put "setenv GLOBUS_LOCATION /Users/massi/portal/Portal-Bundle/gCore"
|
||||||
|
on Linux? -->
|
||||||
|
<GLOBUS_LOCATION>${env.GLOBUS_LOCATION}</GLOBUS_LOCATION>
|
||||||
|
<!-- GWT needs at least java 1.5 -->
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>localRun</id>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>ch.qos.logback</groupId>
|
||||||
|
<artifactId>logback-classic</artifactId>
|
||||||
|
<version>1.0.1</version>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.gwt</groupId>
|
||||||
|
<artifactId>gwt-servlet</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.gwt</groupId>
|
||||||
|
<artifactId>gwt-user</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.validation</groupId>
|
||||||
|
<artifactId>validation-api</artifactId>
|
||||||
|
<version>1.0.0.GA</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.validation</groupId>
|
||||||
|
<artifactId>validation-api</artifactId>
|
||||||
|
<version>1.0.0.GA</version>
|
||||||
|
<classifier>sources</classifier>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.sencha.gxt</groupId>
|
||||||
|
<artifactId>gxt</artifactId>
|
||||||
|
<version>3.0.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- tabular-data-gwt-service -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
|
<artifactId>tabular-data-gwt-service</artifactId>
|
||||||
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- tabular-data-wizard-widget -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
|
<artifactId>tabular-data-wizard-widget</artifactId>
|
||||||
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- LOGGING -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.allen-sauer.gwt.log</groupId>
|
||||||
|
<artifactId>gwt-log</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- JUnit -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<version>4.8.1</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<!-- Generate compiled stuff in the folder used for developing mode -->
|
||||||
|
<outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>
|
||||||
|
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.16</version>
|
||||||
|
<configuration>
|
||||||
|
<skipTests>true</skipTests>
|
||||||
|
</configuration>
|
||||||
|
<!-- TODO check if needed -->
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.maven.surefire</groupId>
|
||||||
|
<artifactId>surefire-junit47</artifactId>
|
||||||
|
<version>2.16</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<!-- GWT Maven Plugin -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>gwt-maven-plugin</artifactId>
|
||||||
|
<version>${gwtVersion}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>resources</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<runTarget>CSVExportWizardTD.html</runTarget>
|
||||||
|
<hostedWebapp>${webappDirectory}</hostedWebapp>
|
||||||
|
<module>org.gcube.portlets.user.td.csvexportwidget.CSVExportWizardTD</module>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<!-- Maven -->
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<version>2.6</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>copy-profile</id>
|
||||||
|
<phase>process-resources</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-resources</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${configDirectory}</outputDirectory>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>${templatesDirectory}</directory>
|
||||||
|
<includes>
|
||||||
|
<include>profile.xml</include>
|
||||||
|
</includes>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>copy-distro-resources</id>
|
||||||
|
<phase>process-resources</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-resources</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${distroDirectory}</outputDirectory>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>${templatesDirectory}</directory>
|
||||||
|
<excludes>
|
||||||
|
<exclude>profile.xml</exclude>
|
||||||
|
<exclude>descriptor.xml</exclude>
|
||||||
|
</excludes>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-clean-plugin</artifactId>
|
||||||
|
<version>2.5</version>
|
||||||
|
<configuration>
|
||||||
|
<filesets>
|
||||||
|
<fileset>
|
||||||
|
<directory>${distroDirectory}</directory>
|
||||||
|
<includes>
|
||||||
|
<include>**</include>
|
||||||
|
</includes>
|
||||||
|
<followSymlinks>false</followSymlinks>
|
||||||
|
</fileset>
|
||||||
|
<fileset>
|
||||||
|
<directory>${configDirectory}</directory>
|
||||||
|
<includes>
|
||||||
|
<include>**</include>
|
||||||
|
</includes>
|
||||||
|
<followSymlinks>false</followSymlinks>
|
||||||
|
</fileset>
|
||||||
|
</filesets>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
|
<version>2.2</version>
|
||||||
|
<configuration>
|
||||||
|
<descriptors>
|
||||||
|
<descriptor>${templatesDirectory}/descriptor.xml</descriptor>
|
||||||
|
</descriptors>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>servicearchive</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>single</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
|
||||||
|
</plugins>
|
||||||
|
|
||||||
|
</build>
|
||||||
|
<dependencyManagement>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.distribution</groupId>
|
||||||
|
<artifactId>maven-portal-bom</artifactId>
|
||||||
|
<version>LATEST</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</dependencyManagement>
|
||||||
|
</project>
|
|
@ -0,0 +1,39 @@
|
||||||
|
package org.gcube.portlets.user.td.csvexportwidget.client;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportSession;
|
||||||
|
import org.gcube.portlets.user.td.wizardwidget.client.WizardWindow;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class CSVExportWizardTD extends WizardWindow {
|
||||||
|
|
||||||
|
protected CSVImportSession importSession;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The id of the {@link CSVTarget} to use.
|
||||||
|
* @param targetId
|
||||||
|
*/
|
||||||
|
|
||||||
|
public CSVExportWizardTD(String title) {
|
||||||
|
super(title);
|
||||||
|
|
||||||
|
importSession= new CSVImportSession();
|
||||||
|
|
||||||
|
|
||||||
|
SourceSelectionCard sourceSelection= new SourceSelectionCard(importSession);
|
||||||
|
addCard(sourceSelection);
|
||||||
|
sourceSelection.setup();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package org.gcube.portlets.user.td.csvexportwidget.client;
|
||||||
|
|
||||||
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
import com.google.gwt.core.client.EntryPoint;
|
||||||
|
|
||||||
|
public class CSVExportWizardTDEntry implements EntryPoint {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onModuleLoad() {
|
||||||
|
CSVExportWizardTD exportWizard= new CSVExportWizardTD("CSVExport");
|
||||||
|
Log.info(exportWizard.getId());
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,138 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package org.gcube.portlets.user.td.csvexportwidget.client;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportSession;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.source.FileSource;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.source.WorkspaceSource;
|
||||||
|
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
||||||
|
|
||||||
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
import com.google.gwt.event.logical.shared.ValueChangeEvent;
|
||||||
|
import com.google.gwt.event.logical.shared.ValueChangeHandler;
|
||||||
|
import com.google.gwt.user.client.Command;
|
||||||
|
import com.google.gwt.user.client.ui.HasValue;
|
||||||
|
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||||
|
import com.sencha.gxt.core.client.util.ToggleGroup;
|
||||||
|
import com.sencha.gxt.widget.core.client.form.Radio;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author "Giancarlo Panichi" <a
|
||||||
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class SourceSelectionCard extends WizardCard {
|
||||||
|
|
||||||
|
protected final CSVImportSession importSession;
|
||||||
|
|
||||||
|
final FileSource fileSource = FileSource.INSTANCE;
|
||||||
|
final WorkspaceSource workspaceSource = WorkspaceSource.INSTANCE;
|
||||||
|
|
||||||
|
public SourceSelectionCard(final CSVImportSession importSession) {
|
||||||
|
super("CSV source selection", "");
|
||||||
|
|
||||||
|
this.importSession = importSession;
|
||||||
|
// Default
|
||||||
|
importSession.setSource(fileSource);
|
||||||
|
|
||||||
|
VerticalPanel sourceSelectionPanel = new VerticalPanel();
|
||||||
|
sourceSelectionPanel.setStylePrimaryName(res.wizardCSS()
|
||||||
|
.getImportSelectionSources());
|
||||||
|
|
||||||
|
Radio radioFileSource = new Radio();
|
||||||
|
radioFileSource.setBoxLabel("<p style='display:inline-table;'><b>"
|
||||||
|
+ fileSource.getName() + "</b><br>"
|
||||||
|
+ fileSource.getDescription() + "</p>");
|
||||||
|
radioFileSource.setName(fileSource.getName());
|
||||||
|
radioFileSource.setStylePrimaryName(res.wizardCSS()
|
||||||
|
.getImportSelectionSource());
|
||||||
|
radioFileSource.setValue(true);
|
||||||
|
|
||||||
|
Radio radioSDMXRegistrySource = new Radio();
|
||||||
|
|
||||||
|
Radio radioWorkspaceSource = new Radio();
|
||||||
|
radioWorkspaceSource.setBoxLabel("<p style='display:inline-table;'><b>"
|
||||||
|
+ workspaceSource.getName() + "</b><br>"
|
||||||
|
+ workspaceSource.getDescription() + "</p>");
|
||||||
|
radioWorkspaceSource.setName(workspaceSource.getName());
|
||||||
|
radioWorkspaceSource.setStylePrimaryName(res.wizardCSS()
|
||||||
|
.getImportSelectionSource());
|
||||||
|
radioWorkspaceSource.disable();
|
||||||
|
|
||||||
|
sourceSelectionPanel.add(radioFileSource);
|
||||||
|
sourceSelectionPanel.add(radioWorkspaceSource);
|
||||||
|
|
||||||
|
// we can set name on radios or use toggle group
|
||||||
|
ToggleGroup toggle = new ToggleGroup();
|
||||||
|
toggle.add(radioSDMXRegistrySource);
|
||||||
|
toggle.add(radioWorkspaceSource);
|
||||||
|
toggle.add(radioFileSource);
|
||||||
|
|
||||||
|
toggle.addValueChangeHandler(new ValueChangeHandler<HasValue<Boolean>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onValueChange(ValueChangeEvent<HasValue<Boolean>> event) {
|
||||||
|
try {
|
||||||
|
ToggleGroup group = (ToggleGroup) event.getSource();
|
||||||
|
Radio radio = (Radio) group.getValue();
|
||||||
|
Log.info("Source Selected:" + radio.getName());
|
||||||
|
if (radio.getName().compareTo(workspaceSource.getName()) == 0) {
|
||||||
|
importSession.setSource(workspaceSource);
|
||||||
|
} else {
|
||||||
|
if (radio.getName().compareTo(fileSource.getName()) == 0) {
|
||||||
|
importSession.setSource(fileSource);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.error("ToggleGroup: onValueChange "
|
||||||
|
+ e.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
setContent(sourceSelectionPanel);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setup() {
|
||||||
|
Command sayNextCard = new Command() {
|
||||||
|
public void execute() {
|
||||||
|
try {
|
||||||
|
String sourceId = importSession.getSource().getId();
|
||||||
|
if (sourceId == null || sourceId.isEmpty()) {
|
||||||
|
Log.error("CSV Import Source Id: " + sourceId);
|
||||||
|
} else {
|
||||||
|
if (sourceId.compareTo("File") == 0) {
|
||||||
|
/* CSVUploadFileCard csvUploadFileCard = new CSVUploadFileCard( importSession);
|
||||||
|
getWizardWindow().addCard(csvUploadFileCard);
|
||||||
|
Log.info("NextCard CSVUploadFileCard");
|
||||||
|
getWizardWindow().nextCard();*/
|
||||||
|
} else {
|
||||||
|
if (sourceId.compareTo("Workspace") == 0) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.error("sayNextCard :" + e.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
getWizardWindow().setNextButtonCommand(sayNextCard);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,73 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package org.gcube.portlets.user.td.csvexportwidget.client.progress;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.TRId;
|
||||||
|
|
||||||
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
import com.sencha.gxt.widget.core.client.ProgressBar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates a {@link ProgressBar} progress and text based on {@link CSVExportProgressListener} events.
|
||||||
|
*
|
||||||
|
* @author "Giancarlo Panichi"
|
||||||
|
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class CSVExportProgressBarUpdater implements CSVExportProgressListener {
|
||||||
|
|
||||||
|
protected ProgressBar progressBar;
|
||||||
|
//protected FramedPanel operationResult;
|
||||||
|
//protected WizardWindow wizardWindow;
|
||||||
|
/**
|
||||||
|
* Creates a new {@link ProgressBar} updater.
|
||||||
|
* @param progressBar the {@link ProgressBar} to update.
|
||||||
|
*/
|
||||||
|
public CSVExportProgressBarUpdater(ProgressBar progressBar) {
|
||||||
|
this.progressBar = progressBar;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void operationComplete(TRId trId) {
|
||||||
|
Log.info("Export completed");
|
||||||
|
progressBar.updateProgress(1, "Export completed.");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void operationFailed(Throwable caught, String reason, String failureDetails) {
|
||||||
|
Log.info("Export failed");
|
||||||
|
progressBar.updateText("Export failed.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void operationInitializing() {
|
||||||
|
Log.info("Export Inizializing");
|
||||||
|
progressBar.updateProgress(0, "Initializing...");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void operationUpdate(float elaborated) {
|
||||||
|
Log.info("Export elaborated: "+elaborated);
|
||||||
|
if (elaborated == 0) progressBar.updateProgress(0, "Initializing...");
|
||||||
|
if (elaborated>0 && elaborated<1) {
|
||||||
|
Log.trace("progress "+elaborated);
|
||||||
|
int elab=new Float(elaborated*100).intValue();
|
||||||
|
progressBar.updateProgress(elaborated,elab+"% Exporting...");
|
||||||
|
}
|
||||||
|
if (elaborated == 1) progressBar.updateProgress(1, "Completing...");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package org.gcube.portlets.user.td.csvexportwidget.client.progress;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.TRId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines a listener for operation progress.
|
||||||
|
*
|
||||||
|
* @author "Giancarlo Panichi"
|
||||||
|
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface CSVExportProgressListener {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when the operation is starting.
|
||||||
|
*/
|
||||||
|
public void operationInitializing();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when there is a progress for the operation.
|
||||||
|
* @param elaborated the elaborated part.
|
||||||
|
*/
|
||||||
|
public void operationUpdate(float elaborated);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when the operation is complete.
|
||||||
|
*/
|
||||||
|
public void operationComplete(TRId trId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when the operation is failed.
|
||||||
|
* @param caught the failure exception.
|
||||||
|
* @param reason the failure reason.
|
||||||
|
*/
|
||||||
|
public void operationFailed(Throwable caught, String reason, String failureDetails);
|
||||||
|
}
|
|
@ -0,0 +1,168 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package org.gcube.portlets.user.td.csvexportwidget.client.progress;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.TRId;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportMonitor;
|
||||||
|
|
||||||
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
import com.google.gwt.user.client.Timer;
|
||||||
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
|
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
|
||||||
|
import com.sencha.gxt.widget.core.client.event.HideEvent;
|
||||||
|
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This {@link Timer} retrieves {@link OperationProgress} from the specified
|
||||||
|
* {@link OperationProgressSource} with the scheduled interval. The retrieved
|
||||||
|
* information are spread to the subscribed {@link CSVExportProgressListener}.
|
||||||
|
*
|
||||||
|
* @author "Giancarlo Panichi" <a
|
||||||
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class CSVExportProgressUpdater extends Timer {
|
||||||
|
|
||||||
|
protected ArrayList<CSVExportProgressListener> listeners = new ArrayList<CSVExportProgressListener>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Log.debug("requesting operation progress");
|
||||||
|
TDGWTServiceAsync.INSTANCE
|
||||||
|
.getCSVImportMonitor(new AsyncCallback<CSVImportMonitor>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
cancel();
|
||||||
|
Log.error("Error retrieving the operation state",
|
||||||
|
caught);
|
||||||
|
String message = getStack(caught);
|
||||||
|
fireOperationFailed(caught,
|
||||||
|
"Failed getting operation updates", message);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(CSVImportMonitor result) {
|
||||||
|
Log.info("retrieved CSVImportMonitor: "
|
||||||
|
+ result.getStatus());
|
||||||
|
switch (result.getStatus()) {
|
||||||
|
case INITIALIZING:
|
||||||
|
Log.info("CSV Export Initializing...");
|
||||||
|
fireOperationInitializing();
|
||||||
|
break;
|
||||||
|
case ABORTED:
|
||||||
|
cancel();
|
||||||
|
Log.info("CSV Export Operation Aborted");
|
||||||
|
break;
|
||||||
|
case IN_PROGRESS:
|
||||||
|
fireOperationUpdate(result.getProgress());
|
||||||
|
break;
|
||||||
|
case FAILED:
|
||||||
|
cancel();
|
||||||
|
errorMessage(result);
|
||||||
|
break;
|
||||||
|
case SUCCEDED:
|
||||||
|
cancel();
|
||||||
|
Log.info("Export fisnish TableId :"
|
||||||
|
+ result.getTrId());
|
||||||
|
fireOperationComplete(result.getTrId());
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
Log.info("Unknow State");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void errorMessage(CSVImportMonitor result) {
|
||||||
|
Log.info("CSV Export Failed");
|
||||||
|
Throwable th = null;
|
||||||
|
String failure = null;
|
||||||
|
String details = null;
|
||||||
|
if (result.getError() != null) {
|
||||||
|
th = result.getError();
|
||||||
|
failure = "Failed Client Library Export";
|
||||||
|
details = result.getError().getLocalizedMessage();
|
||||||
|
} else {
|
||||||
|
th = new Throwable("Failed");
|
||||||
|
failure = "Failed Client Library Export";
|
||||||
|
details = "Error in export";
|
||||||
|
}
|
||||||
|
fireOperationFailed(th, failure, details);
|
||||||
|
|
||||||
|
AlertMessageBox d = new AlertMessageBox("Error in CSV Export", details);
|
||||||
|
d.addHideHandler(new HideHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onHide(HideEvent event) {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
d.show();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getStack(Throwable e) {
|
||||||
|
String message = e.getLocalizedMessage() + " -> <br>";
|
||||||
|
Throwable c = e.getCause();
|
||||||
|
if (c != null)
|
||||||
|
message += getStack(c);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void fireOperationInitializing() {
|
||||||
|
for (CSVExportProgressListener listener : listeners)
|
||||||
|
listener.operationInitializing();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void fireOperationUpdate(float elaborated) {
|
||||||
|
for (CSVExportProgressListener listener : listeners)
|
||||||
|
listener.operationUpdate(elaborated);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void fireOperationComplete(TRId trId) {
|
||||||
|
for (CSVExportProgressListener listener : listeners)
|
||||||
|
listener.operationComplete(trId);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void fireOperationFailed(Throwable caught, String failure,
|
||||||
|
String failureDetails) {
|
||||||
|
for (CSVExportProgressListener listener : listeners)
|
||||||
|
listener.operationFailed(caught, failure, failureDetails);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a new {@link CSVExportProgressListener} to this
|
||||||
|
* {@link CSVExportProgressUpdater}.
|
||||||
|
*
|
||||||
|
* @param listener
|
||||||
|
* the listener to add.
|
||||||
|
*/
|
||||||
|
public void addListener(CSVExportProgressListener listener) {
|
||||||
|
listeners.add(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes the specified {@link CSVExportProgressListener} from this
|
||||||
|
* {@link CSVExportProgressUpdater}.
|
||||||
|
*
|
||||||
|
* @param listener
|
||||||
|
* the listener to remove.
|
||||||
|
*/
|
||||||
|
public void removeListener(CSVExportProgressListener listener) {
|
||||||
|
listeners.remove(listener);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module rename-to='CSVExportWizardTD'>
|
||||||
|
<!-- Inherit the core Web Toolkit stuff. -->
|
||||||
|
<inherits name='com.google.gwt.user.User' />
|
||||||
|
|
||||||
|
<!-- We need the JUnit module in the main module, -->
|
||||||
|
<!-- otherwise eclipse complains (Google plugin bug?) -->
|
||||||
|
<inherits name='com.google.gwt.junit.JUnit' />
|
||||||
|
|
||||||
|
<!-- Inherit the default GWT style sheet. You can change -->
|
||||||
|
<!-- the theme of your GWT application by uncommenting -->
|
||||||
|
<!-- any one of the following lines. -->
|
||||||
|
<inherits name='com.google.gwt.user.theme.standard.Standard' />
|
||||||
|
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
|
||||||
|
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
|
||||||
|
|
||||||
|
<!-- Other module inherits -->
|
||||||
|
<inherits name='com.sencha.gxt.ui.GXT' />
|
||||||
|
<inherits name="com.allen_sauer.gwt.log.gwt-log-TRACE" />
|
||||||
|
<inherits name='org.gcube.portlets.user.td.gwtservice.TDGWTService' />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Specify the app entry point class. -->
|
||||||
|
<!-- <entry-point class='org.gcube.portlets.user.SDMXImportWizardTD.client.SDMXImportWizardTDEntry' /> -->
|
||||||
|
|
||||||
|
<!-- Specify the paths for translatable code -->
|
||||||
|
<source path='client' />
|
||||||
|
<source path='shared' />
|
||||||
|
<!-- <source path='org.gcube.data.analysis.tabulardata.operation.worker'/> -->
|
||||||
|
|
||||||
|
</module>
|
|
@ -0,0 +1,2 @@
|
||||||
|
sendButton = Send
|
||||||
|
nameField = Enter your name
|
|
@ -0,0 +1,2 @@
|
||||||
|
sendButton = Envoyer
|
||||||
|
nameField = Entrez votre nom
|
|
@ -0,0 +1,34 @@
|
||||||
|
/** Add css rules here for your application. */
|
||||||
|
|
||||||
|
|
||||||
|
/** Example rules used by the template application (remove for your app) */
|
||||||
|
h1 {
|
||||||
|
font-size: 2em;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #777777;
|
||||||
|
margin: 40px 0px 70px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sendButton {
|
||||||
|
display: block;
|
||||||
|
font-size: 16pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Most GWT widgets already have a style name defined */
|
||||||
|
.gwt-DialogBox {
|
||||||
|
width: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dialogVPanel {
|
||||||
|
margin: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.serverResponseLabelError {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Set ids using widget.getElement().setId("idOfElement") */
|
||||||
|
#closeButton {
|
||||||
|
margin: 15px 6px 6px;
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
<!doctype html>
|
||||||
|
<!-- The DOCTYPE declaration above will set the -->
|
||||||
|
<!-- browser's rendering engine into -->
|
||||||
|
<!-- "Standards Mode". Replacing this declaration -->
|
||||||
|
<!-- with a "Quirks Mode" doctype may lead to some -->
|
||||||
|
<!-- differences in layout. -->
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
|
||||||
|
<!-- -->
|
||||||
|
<!-- Consider inlining CSS to reduce the number of requested files -->
|
||||||
|
<!-- -->
|
||||||
|
<link type="text/css" rel="stylesheet" href="SDMXImportWizardTD.css">
|
||||||
|
|
||||||
|
<!-- -->
|
||||||
|
<!-- Any title is fine -->
|
||||||
|
<!-- -->
|
||||||
|
<title>Web Application Starter Project</title>
|
||||||
|
|
||||||
|
<!-- -->
|
||||||
|
<!-- This script loads your compiled module. -->
|
||||||
|
<!-- If you add any GWT meta tags, they must -->
|
||||||
|
<!-- be added before this line. -->
|
||||||
|
<!-- -->
|
||||||
|
<script type="text/javascript" language="javascript" src="SDMXImportWizardTD/SDMXImportWizardTD.nocache.js"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<!-- -->
|
||||||
|
<!-- The body can have arbitrary html, or -->
|
||||||
|
<!-- you can leave the body empty if you want -->
|
||||||
|
<!-- to create a completely dynamic UI. -->
|
||||||
|
<!-- -->
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<!-- OPTIONAL: include this if you want history support -->
|
||||||
|
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
|
||||||
|
|
||||||
|
<!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
|
||||||
|
<noscript>
|
||||||
|
<div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
|
||||||
|
Your web browser must have JavaScript enabled
|
||||||
|
in order for this application to display correctly.
|
||||||
|
</div>
|
||||||
|
</noscript>
|
||||||
|
|
||||||
|
<h1>Web Application Starter Project</h1>
|
||||||
|
|
||||||
|
<table align="center">
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" style="font-weight:bold;">Please enter your name:</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td id="nameFieldContainer"></td>
|
||||||
|
<td id="sendButtonContainer"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" style="color:red;" id="errorLabelContainer"></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE web-app
|
||||||
|
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
|
||||||
|
"http://java.sun.com/dtd/web-app_2_3.dtd">
|
||||||
|
|
||||||
|
<web-app>
|
||||||
|
|
||||||
|
<!-- Servlets -->
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>TDGWTService</servlet-name>
|
||||||
|
<servlet-class>org.gcube.portlets.user.td.gwtservice.server.TDGWTServiceImpl</servlet-class>
|
||||||
|
</servlet>
|
||||||
|
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>jUnitHostImpl</servlet-name>
|
||||||
|
<servlet-class>com.google.gwt.junit.server.JUnitHostImpl</servlet-class>
|
||||||
|
</servlet>
|
||||||
|
|
||||||
|
<!-- Servlets Mapping -->
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>TDGWTService</servlet-name>
|
||||||
|
<url-pattern>tdgwtservice/TDGWTService</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>jUnitHostImpl</servlet-name>
|
||||||
|
<url-pattern>CSVImportWizardTDManagerWidgets/junithost/*</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
|
||||||
|
<!-- Default page to serve -->
|
||||||
|
<welcome-file-list>
|
||||||
|
<welcome-file>CSVImportWizardTD.html</welcome-file>
|
||||||
|
</welcome-file-list>
|
||||||
|
|
||||||
|
</web-app>
|
|
@ -0,0 +1,83 @@
|
||||||
|
package org.gcube.portlets.user.td.csvexportwidget.client;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTService;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.TabResource;
|
||||||
|
|
||||||
|
import com.google.gwt.core.client.GWT;
|
||||||
|
import com.google.gwt.junit.client.GWTTestCase;
|
||||||
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
|
import com.google.gwt.user.client.rpc.ServiceDefTarget;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GWT JUnit <b>integration</b> tests must extend GWTTestCase.
|
||||||
|
* Using <code>"GwtTest*"</code> naming pattern exclude them from running with
|
||||||
|
* surefire during the test phase.
|
||||||
|
*
|
||||||
|
* If you run the tests using the Maven command line, you will have to
|
||||||
|
* navigate with your browser to a specific url given by Maven.
|
||||||
|
* See http://mojo.codehaus.org/gwt-maven-plugin/user-guide/testing.html
|
||||||
|
* for details.
|
||||||
|
*/
|
||||||
|
public class GwtTestCSVExportWizardTD extends GWTTestCase {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Must refer to a valid module that sources this class.
|
||||||
|
*/
|
||||||
|
public String getModuleName() {
|
||||||
|
return "org.gcube.portlets.user.csvimportWizard.CSVImportWizardTDJUnit";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test will send a request to the server
|
||||||
|
*/
|
||||||
|
public void testResource() {
|
||||||
|
// Create the service that we will test.
|
||||||
|
TDGWTServiceAsync tdGXTService = GWT.create(TDGWTService.class);
|
||||||
|
ServiceDefTarget target = (ServiceDefTarget) tdGXTService;
|
||||||
|
System.out.println(GWT.getModuleBaseURL() + "TDGWTService");
|
||||||
|
target.setServiceEntryPoint(GWT.getModuleBaseURL() + "TDGWTService");
|
||||||
|
|
||||||
|
// Since RPC calls are asynchronous, we will need to wait for a response
|
||||||
|
// after this test method returns. This line tells the test runner to wait
|
||||||
|
// up to 7 seconds before timing out.
|
||||||
|
delayTestFinish(7000);
|
||||||
|
|
||||||
|
// Send a request to the server.
|
||||||
|
tdGXTService.getTabularResources(new AsyncCallback<List<TabResource>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
// The request resulted in an unexpected error.
|
||||||
|
fail("Request failure: " + caught.getMessage());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(List<TabResource> result) {
|
||||||
|
// Shows the first three resources.
|
||||||
|
int i=0;
|
||||||
|
for(TabResource tr:result){
|
||||||
|
i++;
|
||||||
|
System.out.println(tr.toString());
|
||||||
|
if(i>3){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
assertTrue(result.size()>0);
|
||||||
|
|
||||||
|
// Now that we have received a response, we need to tell the test runner
|
||||||
|
// that the test is complete. You must call finishTest() after an
|
||||||
|
// asynchronous test finishes successfully, or the test will time out.
|
||||||
|
finishTest();
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module rename-to="CSVExportWizardTDJUnit">
|
||||||
|
<!-- Inherit our applications main module. -->
|
||||||
|
<inherits name='org.gcube.portlets.user.td.gwtservice.TDGWTService' />
|
||||||
|
|
||||||
|
<!-- Specify the path to any remote services. -->
|
||||||
|
<servlet path="/TDGWTService"
|
||||||
|
class="org.gcube.portlets.user.td.gwtservice.server.TDGWTServiceImpl" />
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Specify the paths for translatable code -->
|
||||||
|
<source path='client' />
|
||||||
|
</module>
|
|
@ -0,0 +1,6 @@
|
||||||
|
gCube System - License
|
||||||
|
------------------------------------------------------------
|
||||||
|
|
||||||
|
The gCube/gCore software is licensed as Free Open Source software conveying to the EUPL (http://ec.europa.eu/idabc/eupl).
|
||||||
|
The software and documentation is provided by its authors/distributors "as is" and no expressed or
|
||||||
|
implied warranty is given for its use, quality or fitness for a particular case.
|
|
@ -0,0 +1 @@
|
||||||
|
Giancarlo Panichi (giancarlo.panichi@isti.cnr.it), CNR Pisa, Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo"
|
|
@ -0,0 +1,40 @@
|
||||||
|
The gCube System - ${name}
|
||||||
|
------------------------------------------------------------
|
||||||
|
|
||||||
|
This work has been supported by the following European projects: iMarine (FP7-INFRASTRUCTURES-2011-2)
|
||||||
|
|
||||||
|
Authors
|
||||||
|
-------
|
||||||
|
|
||||||
|
Giancarlo Panichi (giancarlo.panichi@isti.cnr.it), CNR Pisa,
|
||||||
|
Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo"
|
||||||
|
|
||||||
|
|
||||||
|
Version and Release Date
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
v. ${version} (${release.date})
|
||||||
|
|
||||||
|
Description
|
||||||
|
-----------
|
||||||
|
|
||||||
|
${project.description}
|
||||||
|
|
||||||
|
Download information
|
||||||
|
--------------------
|
||||||
|
Source code URL: ${scm.url}
|
||||||
|
|
||||||
|
|
||||||
|
Documentation
|
||||||
|
-------------
|
||||||
|
|
||||||
|
${project.description}
|
||||||
|
|
||||||
|
|
||||||
|
Licensing
|
||||||
|
---------
|
||||||
|
|
||||||
|
This software is licensed under the terms you may find in the file named "LICENSE" in this directory.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
<ReleaseNotes>
|
||||||
|
<Changeset component="${groupId}.${artifactId}.1-0-0"
|
||||||
|
date="2013-10-18">
|
||||||
|
<Change>First Release</Change>
|
||||||
|
</Changeset>
|
||||||
|
</ReleaseNotes>
|
|
@ -0,0 +1,39 @@
|
||||||
|
<assembly
|
||||||
|
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
|
||||||
|
<id>servicearchive</id>
|
||||||
|
<formats>
|
||||||
|
<format>tar.gz</format>
|
||||||
|
</formats>
|
||||||
|
<baseDirectory>/</baseDirectory>
|
||||||
|
<fileSets>
|
||||||
|
<fileSet>
|
||||||
|
<directory>${distroDirectory}</directory>
|
||||||
|
<outputDirectory>/</outputDirectory>
|
||||||
|
<useDefaultExcludes>true</useDefaultExcludes>
|
||||||
|
<includes>
|
||||||
|
<include>README</include>
|
||||||
|
<include>LICENSE</include>
|
||||||
|
<include>INSTALL</include>
|
||||||
|
<include>MAINTAINERS</include>
|
||||||
|
<include>changelog.xml</include>
|
||||||
|
</includes>
|
||||||
|
<fileMode>755</fileMode>
|
||||||
|
</fileSet>
|
||||||
|
</fileSets>
|
||||||
|
<files>
|
||||||
|
<file>
|
||||||
|
<source>${distroDirectory}/svnpath.txt</source>
|
||||||
|
<outputDirectory>/${artifactId}</outputDirectory>
|
||||||
|
</file>
|
||||||
|
<file>
|
||||||
|
<source>${configDirectory}/profile.xml</source>
|
||||||
|
<outputDirectory>/</outputDirectory>
|
||||||
|
</file>
|
||||||
|
<file>
|
||||||
|
<source>target/${build.finalName}.${packaging}</source>
|
||||||
|
<outputDirectory>/${artifactId}</outputDirectory>
|
||||||
|
</file>
|
||||||
|
</files>
|
||||||
|
</assembly>
|
|
@ -0,0 +1,29 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Resource>
|
||||||
|
<ID></ID>
|
||||||
|
<Type>Service</Type>
|
||||||
|
<Profile>
|
||||||
|
<Description>${project.description}</Description>
|
||||||
|
<Class>PortletsUser</Class>
|
||||||
|
<Name>${project.name}</Name>
|
||||||
|
<Version>1.0.0</Version>
|
||||||
|
<Packages>
|
||||||
|
<Software>
|
||||||
|
<Description>${project.description}</Description>
|
||||||
|
<Name>${project.name}</Name>
|
||||||
|
<Version>${version}</Version>
|
||||||
|
<MavenCoordinates>
|
||||||
|
<groupId>${project.groupId}</groupId>
|
||||||
|
<artifactId>${project.artifactId}</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</MavenCoordinates>
|
||||||
|
<Type>library</Type>
|
||||||
|
<Files>
|
||||||
|
<File>${project.build.finalName}.${project.packaging}</File>
|
||||||
|
</Files>
|
||||||
|
</Software>
|
||||||
|
</Packages>
|
||||||
|
</Profile>
|
||||||
|
</Resource>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
${scm.url}
|
Loading…
Reference in New Issue