Giancarlo Panichi 6 years ago
parent 17e77cc83a
commit 71265d74ce

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/tabular-data-excel-export-widget-1.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/tabular-data-excel-export-widget-1.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.6.1/gwt-user.jar">
<attributes>
<attribute name="javadoc_location" value="file:/home/giancarlo/gwt/gwt-2.6.1/doc/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.6.1/gwt-dev.jar">
<attributes>
<attribute name="javadoc_location" value="file:/home/giancarlo/gwt/gwt-2.6.1/doc/javadoc/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.6.1/validation-api-1.0.0.GA.jar" sourcepath="/home/giancarlo/gwt/gwt-2.6.1/validation-api-1.0.0.GA-sources.jar"/>
<classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.6.1/validation-api-1.0.0.GA-sources.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/tabular-data-excel-export-widget-1.0.0-SNAPSHOT/WEB-INF/classes"/>
</classpath>

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tabular-data-excel-export-widget</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>

@ -0,0 +1,4 @@
eclipse.preferences.version=1
filesCopiedToWebInfLib=
googleCloudSqlEnabled=false
localDevMySqlEnabled=true

@ -0,0 +1,4 @@
eclipse.preferences.version=1
jarsExcludedFromWebInfLib=
warSrcDir=
warSrcDirIsOutput=true

@ -0,0 +1,3 @@
eclipse.preferences.version=1
entryPointModules=
filesCopiedToWebInfLib=

@ -0,0 +1,6 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8

@ -0,0 +1,13 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.7

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="tabular-data-excel-export-widget">
<wb-resource deploy-path="/" source-path="/src/main/java"/>
<wb-resource deploy-path="/" source-path="/src/main/resources"/>
</wb-module>
</project-modules>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="jst.utility" version="1.0"/>
<installed facet="java" version="1.7"/>
</faceted-project>

@ -0,0 +1,2 @@
disabled=06target
eclipse.preferences.version=1

@ -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="/SDMXImportWizardTD/src/test/java/org/gcube/portlets/user/excelexprotwidget/client/GwtTestExcelExportWizardTD.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.excelexportwidget.client.GwtTestExcelExportWizardTD"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="ExcelExportWizardTD"/>
</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="false"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/ExcelExportWizardTD/src/test/java/org/gcube/portlets/user/excelexportwidget/client/GwtTestExcelExportWizardTD.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.excelexportwidget.client.GwtTestExcelExportWizardTD"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="ExcelExportWizardTD"/>
</launchConfiguration>

@ -0,0 +1 @@
${gcube.license}

@ -0,0 +1,68 @@
The gCube System - ${name}
--------------------------------------------------
${description}
${gcube.description}
${gcube.funding}
Version
--------------------------------------------------
${version} (${buildDate})
Please see the file named "changelog.xml" in this directory for the release notes.
Authors
--------------------------------------------------
* Giancarlo Panichi (giancarlo.panichi-AT-isti.cnr.it),
Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" CNR, Pisa IT
Maintainers
-----------
* Giancarlo Panichi (giancarlo.panichi-AT-isti.cnr.it),
Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" CNR, Pisa IT
Download information
--------------------------------------------------
Source code is available from SVN:
${scm.url}
Binaries can be downloaded from the gCube website:
${gcube.website}
Installation
--------------------------------------------------
Installation documentation is available on-line in the gCube Wiki:
${gcube.wikiRoot}/Tabular_Data_Manager
Documentation
--------------------------------------------------
Documentation is available on-line in the gCube Wiki:
${gcube.wikiRoot}/Tabular_Data_Manager
Support
--------------------------------------------------
Bugs and support requests can be reported in the gCube issue tracking tool:
${gcube.issueTracking}
Licensing
--------------------------------------------------
This software is licensed under the terms you may find in the file named "LICENSE" in this directory.

@ -0,0 +1,5 @@
<ReleaseNotes>
<Changeset component="${groupId}.${artifactId}.1-0-0" date="2018-01-12">
<Change>First Release</Change>
</Changeset>
</ReleaseNotes>

@ -0,0 +1,32 @@
<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>changelog.xml</include>
<include>profile.xml</include>
</includes>
<fileMode>755</fileMode>
<filtered>true</filtered>
</fileSet>
</fileSets>
<files>
<file>
<source>target/${build.finalName}.${project.packaging}</source>
<outputDirectory>/${artifactId}</outputDirectory>
</file>
</files>
</assembly>

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<Resource>
<ID></ID>
<Type>Library</Type>
<Profile>
<Description>${project.description}</Description>
<Class>PortletsUser</Class>
<Name>${project.name}</Name>
<Version>${version}</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,228 @@
<?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-excel-export-widget</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>tabular-data-excel-export-widget</name>
<description>tabular-data-excel-export-widget allows excel export of codelists and dataset</description>
<scm>
<url>https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-excel-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>
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<distroDirectory>distro</distroDirectory>
<configDirectory>config</configDirectory>
<!-- Next -->
<gwtVersion>2.6.1</gwtVersion>
<gwtLogVersion>3.3.2</gwtLogVersion>
<gxtVersion>3.1.1</gxtVersion>
<KEYS>${env.KEYS}</KEYS>
<!-- 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>
<version>${gwtVersion}</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwtVersion}</version>
</dependency>
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt</artifactId>
<version>${gxtVersion}</version>
</dependency>
<!-- tabular-data-gwt-service -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>tabular-data-gwt-service</artifactId>
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<!-- tabular-data-widget-common-event -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>tabular-data-widget-common-event</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<!-- tabular-data-monitor-widget -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>tabular-data-monitor-widget</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<!-- tabular-data-wizard-widget -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>tabular-data-wizard-widget</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<!-- LOGGING -->
<dependency>
<groupId>com.allen-sauer.gwt.log</groupId>
<artifactId>gwt-log</artifactId>
<version>${gwtLogVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<!-- JUnit TEST -->
<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>ExcelExportWizardTD.html</runTarget>
<hostedWebapp>${webappDirectory}</hostedWebapp>
<module>org.gcube.portlets.user.td.excelexportwidget.ExcelExportWizardTD</module>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>${distroDirectory}/descriptor.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>servicearchive</id>
<phase>install</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,43 @@
package org.gcube.portlets.user.td.excelexportwidget.client;
import org.gcube.portlets.user.td.gwtservice.shared.excel.ExcelExportSession;
import org.gcube.portlets.user.td.wizardwidget.client.WizardWindow;
import com.google.web.bindery.event.shared.EventBus;
/**
*
* @author Giancarlo Panichi
*
*
*
*/
public class ExcelExportWizardTD extends WizardWindow {
protected ExcelExportSession exportSession;
/**
*
*
* @param title
* Title
* @param eventBus
* Event bus
*/
public ExcelExportWizardTD(String title, final EventBus eventBus) {
super(title, eventBus);
setWidth(550);
setHeight(520);
exportSession = new ExcelExportSession();
MeasureColumnSelectionCard sdmxRegistrySelectionCard = new MeasureColumnSelectionCard(exportSession);
addCard(sdmxRegistrySelectionCard);
sdmxRegistrySelectionCard.setup();
}
}

@ -0,0 +1,23 @@
package org.gcube.portlets.user.td.excelexportwidget.client;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.EntryPoint;
import com.google.web.bindery.event.shared.SimpleEventBus;
/**
*
* @author Giancarlo Panichi
*
*
*/
public class ExcelExportWizardTDEntry implements EntryPoint {
public void onModuleLoad() {
SimpleEventBus eventBus=new SimpleEventBus();
ExcelExportWizardTD exportWizard= new ExcelExportWizardTD("ExcelExport",eventBus);
Log.info(exportWizard.getId());
}
}

@ -0,0 +1,284 @@
/**
*
*/
package org.gcube.portlets.user.td.excelexportwidget.client;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.excel.ExcelExportSession;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.OperationResult;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.FlexTable;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.widget.core.client.FramedPanel;
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
import com.sencha.gxt.widget.core.client.container.HtmlLayoutContainer;
import com.sencha.gxt.widget.core.client.container.MarginData;
import com.sencha.gxt.widget.core.client.container.VBoxLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VBoxLayoutContainer.VBoxLayoutAlign;
/**
*
* @author Giancarlo Panichi
*
*
*/
public class ExcelOperationInProgressCard extends WizardCard implements
MonitorDialogListener {
protected ExcelOperationInProgressCard thisCard;
protected ExcelExportSession exportSession;
protected TRId newTrId;
protected HtmlLayoutContainer resultField;
public ExcelOperationInProgressCard(final ExcelExportSession exportSession) {
super("Operation In Progress", "");
this.exportSession = exportSession;
thisCard = this;
VBoxLayoutContainer operationInProgressPanel = new VBoxLayoutContainer();
operationInProgressPanel.setVBoxLayoutAlign(VBoxLayoutAlign.CENTER);
final FlexTable description = new FlexTable();
// FlexCellFormatter cellFormatter = description.getFlexCellFormatter();
description.setCellSpacing(10);
description.setCellPadding(4);
description.setBorderWidth(0);
// display:block;vertical-align:text-top;
description.setHTML(0, 0,
"<span style=\"font-weight:bold;\";>Destination: </span>");
description.setText(0, 1, exportSession.getSource().getName());
description.setHTML(1, 0,
"<span style=\"font-weight:bold;\";>Id: </span>");
description.setText(1, 1, exportSession.getId());
description.setHTML(2, 0,
"<span style=\"font-weight:bold;\";>Agency Id: </span>");
description.setText(2, 1, exportSession.getAgencyId());
description.setHTML(3, 0,
"<span style=\"font-weight:bold;\";>Version: </span>");
description.setText(3, 1, exportSession.getVersion());
FramedPanel summary = new FramedPanel();
summary.setHeadingText("Export Summary");
summary.setWidth(400);
summary.add(description);
operationInProgressPanel.add(summary, new BoxLayoutData(new Margins(20,
5, 10, 5)));
resultField = new HtmlLayoutContainer("<div></div>");
operationInProgressPanel.add(resultField, new BoxLayoutData(
new Margins(10, 5, 10, 5)));
setCenterWidget(operationInProgressPanel, new MarginData(0));
resultField.setVisible(false);
}
// columnToImportMask
public void exportSDMX() {
TDGWTServiceAsync.INSTANCE.startExcelExport(exportSession,
new AsyncCallback<String>() {
public void onSuccess(String taskId) {
openMonitorDialog(taskId);
}
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
getEventBus()
.fireEvent(
new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
showErrorAndHide("Error Locked",
caught.getLocalizedMessage(), "",
caught);
} else {
showErrorAndHide("Error in exportSDMX",
"An error occured in exportSDMX.",
caught.getLocalizedMessage(), caught);
}
}
}
});
}
@Override
public void setup() {
getWizardWindow().setEnableBackButton(false);
setBackButtonVisible(false);
getWizardWindow().setEnableNextButton(false);
getWizardWindow().setNextButtonToFinish();
exportSDMX();
}
//
protected void openMonitorDialog(String taskId) {
MonitorDialog monitorDialog = new MonitorDialog(taskId, getEventBus());
monitorDialog.addProgressDialogListener(this);
monitorDialog.show();
}
@Override
public void operationComplete(OperationResult operationResult) {
newTrId = operationResult.getTrId();
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
.appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold; color:#009900;'>Operation Completed<br>Check The Resources</div>");
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true);
Command sayComplete = new Command() {
public void execute() {
try {
getWizardWindow().close(false);
Log.info("fire Complete: " + newTrId);
getWizardWindow().fireCompleted(newTrId);
} catch (Exception e) {
Log.error("fire Complete :" + e.getLocalizedMessage());
}
}
};
getWizardWindow().setNextButtonCommand(sayComplete);
setNextButtonVisible(true);
getWizardWindow().setEnableNextButton(true);
forceLayout();
}
@Override
public void operationFailed(Throwable caught, String reason, String details) {
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
.appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold;color:red;'>Operation Failed</div>");
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true);
if (caught instanceof TDGWTSessionExpiredException) {
getEventBus()
.fireEvent(
new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
showErrorAndHide("Error in SDMX Export", reason, details, caught);
}
forceLayout();
}
@Override
public void operationStopped(OperationResult operationResult, String reason, String details) {
newTrId = operationResult.getTrId();
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
.appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold;color: #FF9900;'>Problems in the Operation</div>");
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true);
Command sayComplete = new Command() {
public void execute() {
try {
getWizardWindow().close(false);
Log.info("fire Complete: tabular resource "
+ newTrId.getId());
Log.info("fire Complete: tableId " + newTrId.getTableId());
getWizardWindow().fireCompleted(newTrId);
} catch (Exception e) {
Log.error("fire Complete :" + e.getLocalizedMessage());
}
}
};
getWizardWindow().setNextButtonCommand(sayComplete);
setNextButtonVisible(true);
getWizardWindow().setEnableNextButton(true);
forceLayout();
}
@Override
public void operationAborted() {
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
.appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold;color: #AA00AA;'>Operation Aborted</div>");
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true);
Command sayComplete = new Command() {
public void execute() {
try {
getWizardWindow().close(false);
Log.info("fire Aborted");
getWizardWindow().fireAborted();
} catch (Exception e) {
Log.error("fire Aborted :" + e.getLocalizedMessage());
}
}
};
getWizardWindow().setNextButtonCommand(sayComplete);
setNextButtonVisible(true);
getWizardWindow().setEnableNextButton(true);
forceLayout();
}
@Override
public void operationPutInBackground() {
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
.appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold;color: #00AAAA;'>Operation in Background</div>");
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true);
Command sayComplete = new Command() {
public void execute() {
try {
getWizardWindow().close(false);
Log.info("fire Operation In Background");
getWizardWindow().firePutInBackground();
} catch (Exception e) {
Log.error("fire Operation In Background :"
+ e.getLocalizedMessage());
}
}
};
getWizardWindow().setNextButtonCommand(sayComplete);
setNextButtonVisible(true);
getWizardWindow().setEnableNextButton(true);
forceLayout();
}
}

@ -0,0 +1,198 @@
/**
*
*/
package org.gcube.portlets.user.td.excelexportwidget.client;
import org.gcube.portlets.user.td.gwtservice.shared.Constants;
import org.gcube.portlets.user.td.gwtservice.shared.excel.ExcelExportSession;
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.sencha.gxt.widget.core.client.FramedPanel;
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
import com.sencha.gxt.widget.core.client.event.HideEvent;
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
import com.sencha.gxt.widget.core.client.form.FieldLabel;
import com.sencha.gxt.widget.core.client.form.FieldSet;
import com.sencha.gxt.widget.core.client.form.TextField;
/**
*
* @author Giancarlo Panichi
*
*
*/
public class ExcelTableDetailCard extends WizardCard {
private final String TABLEDETAILPANELWIDTH = "100%";
private final String TABLEDETAILPANELHEIGHT = "100%";
private final String FORMWIDTH = "538px";
private ExcelExportSession exportSession;
private ExcelTableDetailCard thisCard;
private VerticalLayoutContainer p = new VerticalLayoutContainer();
private VerticalPanel tableDetailPanel;
private TextField id;
private TextField agencyId;
private TextField version;
private TextField measureColumn;
public ExcelTableDetailCard(final ExcelExportSession exportSession) {
super("Excel Table Detail", "");
this.exportSession = exportSession;
thisCard = this;
tableDetailPanel = new VerticalPanel();
tableDetailPanel.setSpacing(4);
tableDetailPanel.setWidth(TABLEDETAILPANELWIDTH);
tableDetailPanel.setHeight(TABLEDETAILPANELHEIGHT);
FramedPanel form = new FramedPanel();
form.setHeadingText("Details");
form.setWidth(FORMWIDTH);
FieldSet fieldSet = new FieldSet();
fieldSet.setHeadingText("Information");
fieldSet.setCollapsible(false);
form.add(fieldSet);
switch (exportSession.getExportType()) {
case DATASET:
datasetViewConfig();
break;
case CODELIST:
case GENERIC:
default:
break;
}
fieldSet.add(p);
tableDetailPanel.add(form);
setContent(tableDetailPanel);
}
private void datasetViewConfig() {
id = new TextField();
id.setAllowBlank(false);
id.setEmptyText("Enter Id...");
id.setValue(Constants.EXCEL_DATASET_EXPORT_DEFAULT_ID);
p.add(new FieldLabel(id, "Id"), new VerticalLayoutData(1, -1));
agencyId = new TextField();
agencyId.setVisible(true);
agencyId.setEmptyText("Enter Agency Id...");
if (exportSession.getAgencyId() == null || exportSession.getAgencyId().isEmpty()) {
agencyId.setValue(Constants.EXCEL_DATASET_EXPORT_DEFAULT_AGENCY_ID);
} else {
agencyId.setValue(exportSession.getAgencyId());
}
FieldLabel agencyNameLabel = new FieldLabel(agencyId, "Agency Id");
p.add(agencyNameLabel, new VerticalLayoutData(1, -1));
version = new TextField();
version.setAllowBlank(false);
version.setEmptyText("Enter Version...");
version.setValue(Constants.EXCEL_DATASET_EXPORT_DEFAULT_VERSION);
p.add(new FieldLabel(version, "Version"), new VerticalLayoutData(1, -1));
measureColumn = new TextField();
measureColumn.setValue(exportSession.getObsValueColumn().getLabel());
measureColumn.setReadOnly(true);
p.add(new FieldLabel(measureColumn, "Measure Column"), new VerticalLayoutData(1, -1));
}
@Override
public void setup() {
Command sayNextCard = new Command() {
public void execute() {
checkData();
}
};
getWizardWindow().setNextButtonCommand(sayNextCard);
Command sayPreviousCard = new Command() {
public void execute() {
try {
getWizardWindow().previousCard();
getWizardWindow().removeCard(thisCard);
Log.info("Remove ExcelTableDetailCard");
} catch (Exception e) {
Log.error("sayPreviousCard :" + e.getLocalizedMessage());
}
}
};
getWizardWindow().setPreviousButtonCommand(sayPreviousCard);
getWizardWindow().setEnableNextButton(true);
}
protected void checkData() {
getWizardWindow().setEnableNextButton(false);
getWizardWindow().setEnableBackButton(false);
AlertMessageBox d;
HideHandler hideHandler = new HideHandler() {
public void onHide(HideEvent event) {
getWizardWindow().setEnableNextButton(true);
getWizardWindow().setEnableBackButton(false);
}
};
if (id.getValue() == null || id.getValue().isEmpty() || !id.isValid() || version.getValue() == null
|| version.getValue().isEmpty() || !version.isValid() || agencyId.getValue() == null
|| agencyId.getValue().isEmpty() || !agencyId.isValid()) {
d = new AlertMessageBox("Attention!", "Fill in all fields");
d.addHideHandler(hideHandler);
d.show();
} else {
if (!version.getValue().matches("[0-9]+\\.[0-9]+")) {
d = new AlertMessageBox("Attention!", "Version must match the regular expression [0-9]+\\.[0-9]+");
d.addHideHandler(hideHandler);
d.show();
} else {
id.setReadOnly(true);
version.setReadOnly(true);
agencyId.setReadOnly(true);
goNext();
}
}
}
protected void goNext() {
try {
exportSession.setId(id.getCurrentValue());
exportSession.setAgencyId(agencyId.getCurrentValue());
exportSession.setVersion(version.getCurrentValue());
ExcelOperationInProgressCard excelOperationInProgressCard = new ExcelOperationInProgressCard(exportSession);
getWizardWindow().addCard(excelOperationInProgressCard);
Log.info("NextCard ExcelOperationInProgressCard");
getWizardWindow().nextCard();
} catch (Exception e) {
Log.error("sayNextCard :" + e.getLocalizedMessage());
}
}
}

@ -0,0 +1,152 @@
/**
*
*/
package org.gcube.portlets.user.td.excelexportwidget.client;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.excel.ExcelExportSession;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.TableType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData;
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.event.logical.shared.SelectionEvent;
import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.sencha.gxt.widget.core.client.box.AutoProgressMessageBox;
/**
*
* @author Giancarlo Panichi
*
*
*/
public class MeasureColumnSelectionCard extends WizardCard {
private MeasureColumnSelectionCard thisCard;
private ExcelExportSession exportSession;
private MeasureColumnSelectionPanel measureColumnSelectionPanel;
// private Agencies agency;
public MeasureColumnSelectionCard(final ExcelExportSession exportSession) {
super("Measure column selection", "");
this.exportSession = exportSession;
thisCard = this;
final AutoProgressMessageBox box = new AutoProgressMessageBox("Wait", "Retrieving Information, please wait...");
box.setProgressText("Retrieving...");
box.auto();
box.show();
retrieveTabularDataInfo(box);
}
public void init(){
this.measureColumnSelectionPanel = new MeasureColumnSelectionPanel(
thisCard, res, exportSession);
measureColumnSelectionPanel
.addSelectionHandler(new SelectionHandler<ColumnData>() {
public void onSelection(SelectionEvent<ColumnData> event) {
exportSession
.setObsValueColumn(measureColumnSelectionPanel
.getSelectedItem());
getWizardWindow().setEnableNextButton(true);
}
});
setContent(measureColumnSelectionPanel);
}
private void retrieveTabularDataInfo(final AutoProgressMessageBox box) {
TDGWTServiceAsync.INSTANCE.getTabResourceInformation(new AsyncCallback<TabResource>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
getEventBus().fireEvent(new SessionExpiredEvent(SessionExpiredType.EXPIREDONSERVER));
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
showErrorAndHide("Error Locked", caught.getLocalizedMessage(), "", caught);
} else {
Log.error(
"No Tabular Resource Information retrived from server " + caught.getLocalizedMessage());
box.hide();
showErrorAndHide("Error", "Error retrieving tabular resource information: ",
caught.getLocalizedMessage(), caught);
}
}
}
public void onSuccess(TabResource result) {
Log.debug("Tabular Resource Information retrieved");
exportSession.setTabResource(result);
exportSession.setExportType(TableType.getColumnDataTypeFromId(result.getTableTypeName()));
exportSession.setAgencyId(result.getAgency());
box.hide();
init();
}
});
}
@Override
public void setup() {
Command sayNextCard = new Command() {
public void execute() {
ExcelTableDetailCard sdmxTableDetailCard = new ExcelTableDetailCard(
exportSession);
getWizardWindow().addCard(sdmxTableDetailCard);
Log.info("NextCard ExcelTableDetailCard");
getWizardWindow().nextCard();
}
};
getWizardWindow().setNextButtonCommand(sayNextCard);
Command sayPreviousCard = new Command() {
public void execute() {
try {
getWizardWindow().previousCard();
getWizardWindow().removeCard(thisCard);
Log.info("Remove measureColumnSelectionCard");
} catch (Exception e) {
Log.error("sayPreviousCard :" + e.getLocalizedMessage());
}
}
};
getWizardWindow().setPreviousButtonCommand(sayPreviousCard);
// getWizardWindow().setEnableNextButton(false);
setBackButtonVisible(false);
setEnableBackButton(false);
if (measureColumnSelectionPanel == null
|| measureColumnSelectionPanel.getSelectedItem() == null) {
setEnableNextButton(false);
} else {
setEnableNextButton(true);
}
}
}

@ -0,0 +1,259 @@
/**
*
*/
package org.gcube.portlets.user.td.excelexportwidget.client;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.gcube.portlets.user.td.excelexportwidget.client.properties.ColumnDataProperties;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.excel.ExcelExportSession;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeCode;
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
import org.gcube.portlets.user.td.wizardwidget.client.dataresource.ResourceBundle;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.dom.client.KeyUpHandler;
import com.google.gwt.event.logical.shared.HasSelectionHandlers;
import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.sencha.gxt.core.client.IdentityValueProvider;
import com.sencha.gxt.core.client.Style.SelectionMode;
import com.sencha.gxt.data.client.loader.RpcProxy;
import com.sencha.gxt.data.shared.ListStore;
import com.sencha.gxt.data.shared.ModelKeyProvider;
import com.sencha.gxt.data.shared.Store;
import com.sencha.gxt.data.shared.Store.StoreFilter;
import com.sencha.gxt.data.shared.loader.ListLoadConfig;
import com.sencha.gxt.data.shared.loader.ListLoadResult;
import com.sencha.gxt.data.shared.loader.ListLoadResultBean;
import com.sencha.gxt.data.shared.loader.ListLoader;
import com.sencha.gxt.data.shared.loader.LoadResultListStoreBinding;
import com.sencha.gxt.widget.core.client.ContentPanel;
import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
import com.sencha.gxt.widget.core.client.form.TextField;
import com.sencha.gxt.widget.core.client.grid.CheckBoxSelectionModel;
import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
import com.sencha.gxt.widget.core.client.grid.ColumnModel;
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 Panichi
*
*
*/
public class MeasureColumnSelectionPanel extends ContentPanel implements
HasSelectionHandlers<ColumnData> {
private static final ColumnDataProperties properties = GWT
.create(ColumnDataProperties.class);
private static final ColumnConfig<ColumnData, String> nameColumn = new ColumnConfig<ColumnData, String>(
properties.label(), 50, "Name");
private Grid<ColumnData> grid;
private WizardCard parent;
private ResourceBundle res;
private ExcelExportSession excelExportSession;
public MeasureColumnSelectionPanel(WizardCard parent, ResourceBundle res,
ExcelExportSession excelExportSession) {
this.parent = parent;
this.res = res;
this.excelExportSession = excelExportSession;
setHeaderVisible(false);
buildPanel(properties.id(),
Arrays.<ColumnConfig<ColumnData, ?>> asList(nameColumn),
nameColumn);
}
private void buildPanel(ModelKeyProvider<ColumnData> keyProvider,
List<ColumnConfig<ColumnData, ?>> columns,
ColumnConfig<ColumnData, ?> autoexpandColumn) {
ToolBar toolBar = new ToolBar();
toolBar.add(new LabelToolItem("Search: "));
final TextField searchField = new TextField();
toolBar.add(searchField);
TextButton btnReload = new TextButton();
// btnReload.setText("Reload");
btnReload.setIcon(res.refresh16());
btnReload.setToolTip("Reload");
toolBar.add(btnReload);
IdentityValueProvider<ColumnData> identity = new IdentityValueProvider<ColumnData>();
final CheckBoxSelectionModel<ColumnData> sm = new CheckBoxSelectionModel<ColumnData>(
identity);
ColumnModel<ColumnData> cm = new ColumnModel<ColumnData>(columns);
final ExtendedListStore<ColumnData> store = new ExtendedListStore<ColumnData>(
keyProvider);
searchField.addKeyUpHandler(new KeyUpHandler() {
public void onKeyUp(KeyUpEvent event) {
Log.trace("searchTerm: " + searchField.getCurrentValue());
store.applyFilters();
}
});
store.addFilter(new StoreFilter<ColumnData>() {
public boolean select(Store<ColumnData> store, ColumnData parent,
ColumnData item) {
String searchTerm = searchField.getCurrentValue();
if (searchTerm == null)
return true;
return MeasureColumnSelectionPanel.this
.select(item, searchTerm);
}
});
store.setEnableFilters(true);
RpcProxy<ListLoadConfig, ListLoadResult<ColumnData>> proxy = new RpcProxy<ListLoadConfig, ListLoadResult<ColumnData>>() {
public void load(ListLoadConfig loadConfig,
final AsyncCallback<ListLoadResult<ColumnData>> callback) {
loadData(loadConfig, callback);
}
};
final ListLoader<ListLoadConfig, ListLoadResult<ColumnData>> loader = new ListLoader<ListLoadConfig, ListLoadResult<ColumnData>>(
proxy);
loader.setRemoteSort(false);
loader.addLoadHandler(new LoadResultListStoreBinding<ListLoadConfig, ColumnData, ListLoadResult<ColumnData>>(
store));
grid = new Grid<ColumnData>(store, cm) {
@Override
protected void onAfterFirstAttach() {
super.onAfterFirstAttach();
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
public void execute() {
loader.load();
}
});
}
};
sm.setSelectionMode(SelectionMode.SINGLE);
grid.setLoader(loader);
grid.setSelectionModel(sm);
grid.getView().setAutoExpandColumn(autoexpandColumn);
grid.getView().setStripeRows(true);
grid.getView().setColumnLines(true);
grid.getView().setAutoFill(true);
grid.setBorders(false);
grid.setLoadMask(true);
grid.setColumnReordering(true);
SelectHandler sh = new SelectHandler() {
public void onSelect(SelectEvent event) {
loader.load();
}
};
btnReload.addSelectHandler(sh);
VerticalLayoutContainer con = new VerticalLayoutContainer();
con.add(toolBar, new VerticalLayoutData(1, -1));
con.add(grid, new VerticalLayoutData(1, 1));
setWidget(con);
}
protected boolean select(ColumnData item, String searchTerm) {
if (item.getLabel() != null
&& item.getLabel().toLowerCase()
.contains(searchTerm.toLowerCase()))
return true;
return false;
}
protected void loadData(ListLoadConfig loadConfig,
final AsyncCallback<ListLoadResult<ColumnData>> callback) {
TDGWTServiceAsync.INSTANCE.getColumns(excelExportSession
.getTabResource().getTrId(),
new AsyncCallback<ArrayList<ColumnData>>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
parent.getEventBus()
.fireEvent(
new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("No ColumnData retrieved");
}
callback.onFailure(caught);
}
public void onSuccess(ArrayList<ColumnData> result) {
Log.trace("loaded " + result.size() + " ColumnData");
List<ColumnData> measureColumn = new ArrayList<>();
for (ColumnData column : result) {
if (column != null
&& column.getTypeCode() != null
&& column.getTypeCode().compareTo(
ColumnTypeCode.MEASURE.toString()) == 0) {
measureColumn.add(column);
}
}
callback.onSuccess(new ListLoadResultBean<ColumnData>(
measureColumn));
}
});
}
public HandlerRegistration addSelectionHandler(
SelectionHandler<ColumnData> handler) {
return grid.getSelectionModel().addSelectionHandler(handler);
}
/*
* public List<ColumnData> getSelectedItems() { return
* grid.getSelectionModel().getSelectedItems(); }
*/
public ColumnData getSelectedItem() {
return grid.getSelectionModel().getSelectedItem();
}
protected class ExtendedListStore<M> extends ListStore<M> {
public ExtendedListStore(ModelKeyProvider<? super M> keyProvider) {
super(keyProvider);
}
public void applyFilters() {
super.applyFilters();
}
}
}

@ -0,0 +1,34 @@
/**
*
*/
package org.gcube.portlets.user.td.excelexportwidget.client.properties;
import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Agencies;
import com.google.gwt.editor.client.Editor.Path;
import com.sencha.gxt.core.client.ValueProvider;
import com.sencha.gxt.data.shared.LabelProvider;
import com.sencha.gxt.data.shared.ModelKeyProvider;
import com.sencha.gxt.data.shared.PropertyAccess;
/**
*
* @author Giancarlo Panichi
*
*
*/
public interface AgenciesProperties extends PropertyAccess<Agencies> {
@Path("id")
ModelKeyProvider<Agencies> key();
LabelProvider<Agencies> nameLabel();
ValueProvider<Agencies, String> id();
ValueProvider<Agencies, String> name();
ValueProvider<Agencies, String> description();
}

@ -0,0 +1,31 @@
/**
*
*/
package org.gcube.portlets.user.td.excelexportwidget.client.properties;
import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Codelist;
import com.google.gwt.editor.client.Editor.Path;
import com.sencha.gxt.core.client.ValueProvider;
import com.sencha.gxt.data.shared.ModelKeyProvider;
import com.sencha.gxt.data.shared.PropertyAccess;
/**
*
* @author Giancarlo Panichi
*
*
*/
public interface CodelistProperties extends PropertyAccess<Codelist> {
@Path("id")
ModelKeyProvider<Codelist> key();
ValueProvider<Codelist, String> name();
ValueProvider<Codelist, String> agencyId();
ValueProvider<Codelist, String> version();
ValueProvider<Codelist, String> description();
}

@ -0,0 +1,25 @@
package org.gcube.portlets.user.td.excelexportwidget.client.properties;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData;
import com.google.gwt.editor.client.Editor.Path;
import com.sencha.gxt.core.client.ValueProvider;
import com.sencha.gxt.data.shared.ModelKeyProvider;
import com.sencha.gxt.data.shared.PropertyAccess;
/**
*
* @author Giancarlo Panichi
*
*
*/
public interface ColumnDataProperties extends
PropertyAccess<ColumnData> {
@Path("id")
ModelKeyProvider<ColumnData> id();
ValueProvider<ColumnData,String> label();
}

@ -0,0 +1,30 @@
/**
*
*/
package org.gcube.portlets.user.td.excelexportwidget.client.properties;
import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Dataset;
import com.google.gwt.editor.client.Editor.Path;
import com.sencha.gxt.core.client.ValueProvider;
import com.sencha.gxt.data.shared.ModelKeyProvider;
import com.sencha.gxt.data.shared.PropertyAccess;
/**
*
* @author Giancarlo Panichi
*
*
*/
public interface DatasetProperties extends PropertyAccess<Dataset> {
@Path("id")
ModelKeyProvider<Dataset> key();
ValueProvider<Dataset, String> name();
ValueProvider<Dataset, String> agencyId();
ValueProvider<Dataset, String> version();
ValueProvider<Dataset, String> description();
}

@ -0,0 +1,25 @@
package org.gcube.portlets.user.td.excelexportwidget.client.properties;
import org.gcube.portlets.user.td.gwtservice.shared.template.TemplateColumnData;
import com.google.gwt.editor.client.Editor.Path;
import com.sencha.gxt.core.client.ValueProvider;
import com.sencha.gxt.data.shared.ModelKeyProvider;
import com.sencha.gxt.data.shared.PropertyAccess;
/**
*
* @author Giancarlo Panichi
*
*
*/
public interface TemplateColumnDataProperties extends
PropertyAccess<TemplateColumnData> {
@Path("id")
ModelKeyProvider<TemplateColumnData> id();
ValueProvider<TemplateColumnData,String> label();
}

@ -0,0 +1,35 @@
package org.gcube.portlets.user.td.excelexportwidget.client.properties;
import java.util.Date;
import org.gcube.portlets.user.td.gwtservice.shared.template.TemplateData;
import com.google.gwt.editor.client.Editor.Path;
import com.sencha.gxt.core.client.ValueProvider;
import com.sencha.gxt.data.shared.ModelKeyProvider;
import com.sencha.gxt.data.shared.PropertyAccess;
/**
*
* @author Giancarlo Panichi
*
*
*/
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, Date> creationDate();
}

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='ExcelExportWizardTD'>
<!-- 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' />
<inherits name='org.gcube.portlets.user.td.wizardwidget.Wizard' />
<inherits name='org.gcube.portlets.user.td.monitorwidget.MonitorWidgetTD' />
<!-- Specify the app entry point class. -->
<!-- Specify the paths for translatable code -->
<source path='client' />
<source path='shared' />
</module>

@ -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="ExcelImportWizardTD.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="ExcelExportWizardTD/ExcelExportWizardTD.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,25 @@
<?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>jUnitHostImpl</servlet-name>
<servlet-class>com.google.gwt.junit.server.JUnitHostImpl</servlet-class>
</servlet>
<!-- Servlets Mapping -->
<servlet-mapping>
<servlet-name>jUnitHostImpl</servlet-name>
<url-pattern>ExcelExportWizardTD/junithost/*</url-pattern>
</servlet-mapping>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>ExcelExportWizardTD.html</welcome-file>
</welcome-file-list>
</web-app>

@ -0,0 +1,63 @@
package org.gcube.portlets.user.td.excelexportwidget.client;
import com.google.gwt.junit.client.GWTTestCase;
/**
* 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 GwtTestExcelExportWizardTD extends GWTTestCase {
/**
* Must refer to a valid module that sources this class.
*/
public String getModuleName() {
return "org.gcube.portlets.user.td.excelexportwidget.ExcelExportWizardTDJUnit";
}
/**
* This test will send a request to the server using the greetServer method in
* GreetingService and verify the response.
*/
public void testGreetingService() {
// Create the service that we will test.
//GreetingServiceAsync greetingService = GWT.create(GreetingService.class);
//ServiceDefTarget target = (ServiceDefTarget) greetingService;
//target.setServiceEntryPoint(GWT.getModuleBaseURL() + "SDMXImportWizardTD/greet");
// 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 10 seconds before timing out.
//delayTestFinish(10000);
// Send a request to the server.
/* greetingService.greetServer("GWT User", new AsyncCallback<String>() {
public void onFailure(Throwable caught) {
// The request resulted in an unexpected error.
fail("Request failure: " + caught.getMessage());
}
public void onSuccess(String result) {
// Verify that the response is correct.
assertTrue(result.startsWith("Hello, GWT User!"));
// 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="ExcelExportWizardTDJUnit">
<!-- 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>
Loading…
Cancel
Save