Initial import.

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-charts-widget@101555 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-11-10 17:58:37 +00:00
parent 2f40e0850d
commit dffe3feb7a
37 changed files with 1892 additions and 0 deletions

36
.classpath Normal file
View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/tabular-data-charts-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-charts-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="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"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/tabular-data-charts-widget-1.0.0-SNAPSHOT/WEB-INF/classes"/>
</classpath>

53
.project Normal file
View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tabular-data-charts-widget</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<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>com.google.gdt.eclipse.core.webAppProjectValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.google.gwt.eclipse.core.gwtProjectValidator</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>
<nature>com.google.gwt.eclipse.core.gwtNature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>

16
ChartsWidgetTD.launch Normal file
View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="com.google.gdt.eclipse.suite.webapp">
<stringAttribute key="com.google.gdt.eclipse.suiteMainTypeProcessor.PREVIOUSLY_SET_MAIN_TYPE_NAME" value="com.google.gwt.dev.DevMode"/>
<stringAttribute key="com.google.gwt.eclipse.core.URL" value="ChartsWidgetTD.html"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/tabular-data-charts-widget"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gdt.eclipse.maven.mavenClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-remoteUI &quot;${gwt_remote_ui_server_port}:${unique_id}&quot; -startupUrl ChartsWidgetTD.html -logLevel INFO -codeServerPort 9997 -port 8888"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="tabular-data-charts-widget"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx512m -Dgwt.nowarn.legacy.tools"/>
</launchConfiguration>

353
pom.xml Normal file
View File

@ -0,0 +1,353 @@
<?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-charts-widget</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>tabular-data-charts-widget</name>
<description>tabular-data-charts-widget allows the creation of charts</description>
<scm>
<url>https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-map-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>2014-10-31</release.date>
<wikiurl>https://gcube.wiki.gcube-system.org/gcube/index.php</wikiurl>
<templatesDirectory>templates</templatesDirectory>
<distroDirectory>distro</distroDirectory>
<configDirectory>config</configDirectory>
<!-- Convenience property to set the GWT version -->
<gwtVersion>2.5.1</gwtVersion>
<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>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library</artifactId>
</dependency>
<!-- Portal -->
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-scope-maps</artifactId>
<version>[1.0.2-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>custom-portal-handler</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslcore</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>accesslogger</artifactId>
<scope>provided</scope>
</dependency>
<!-- Service Client -->
<dependency>
<groupId>org.gcube.data.analysis.tabulardata</groupId>
<artifactId>service-client-impl</artifactId>
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
<scope>provided</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-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-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-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>3.2.1</version>
<scope>provided</scope>
</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>ChartsWidgetTD.html</runTarget>
<hostedWebapp>${webappDirectory}</hostedWebapp>
<module>org.gcube.portlets.user.td.chartswidget.ChartsWidgetTD</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>

View File

@ -0,0 +1,228 @@
package org.gcube.portlets.user.td.chartswidget.client;
import org.gcube.portlets.user.td.chartswidget.client.properties.ChartTypePropertiesCombo;
import org.gcube.portlets.user.td.chartswidget.client.store.ChartTypeElement;
import org.gcube.portlets.user.td.chartswidget.client.store.ChartTypeStore;
import org.gcube.portlets.user.td.chartswidget.client.toprating.TopRatingColumnSelectionCard;
import org.gcube.portlets.user.td.gwtservice.shared.chart.ChartSession;
import org.gcube.portlets.user.td.gwtservice.shared.chart.ChartTopRatingSession;
import org.gcube.portlets.user.td.widgetcommonevent.shared.charts.ChartType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.TableType;
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
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.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.core.client.util.Padding;
import com.sencha.gxt.data.shared.LabelProvider;
import com.sencha.gxt.data.shared.ListStore;
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.ComboBox;
import com.sencha.gxt.widget.core.client.form.FieldLabel;
import com.sencha.gxt.widget.core.client.form.FormPanel;
import com.sencha.gxt.widget.core.client.info.Info;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ChartSelectionCard extends WizardCard {
private ChartSelectionCard thisCard;
private ChartSession chartSession;
private ChartType chartTypeSelected;
private ComboBox<ChartTypeElement> comboChartType;
private FieldLabel comboChartTypeLabel;
public ChartSelectionCard(final ChartSession chartSession) {
super("Column Selection", "");
this.thisCard = this;
if (chartSession == null) {
Log.error("ChartSession is null");
}
this.chartSession = chartSession;
this.chartTypeSelected = null;
FormPanel panel = createPanel();
setContent(panel);
}
protected FormPanel createPanel() {
FormPanel panel = new FormPanel();
panel.setLabelWidth(90);
panel.getElement().setPadding(new Padding(5));
VerticalLayoutContainer content = new VerticalLayoutContainer();
panel.add(content);
// comboChartType
ChartTypePropertiesCombo propsChartType = GWT
.create(ChartTypePropertiesCombo.class);
ListStore<ChartTypeElement> storeComboChartType = new ListStore<ChartTypeElement>(
propsChartType.id());
storeComboChartType.addAll(ChartTypeStore.getChartsType());
comboChartType = new ComboBox<ChartTypeElement>(storeComboChartType,
propsChartType.label());
Log.trace("ComboMeasureType created");
addHandlersForComboChartType(propsChartType.label());
comboChartType.setEmptyText("Select a chart type...");
comboChartType.setWidth(191);
comboChartType.setTypeAhead(true);
comboChartType.setTriggerAction(TriggerAction.ALL);
comboChartTypeLabel = new FieldLabel(comboChartType, "Chart Type");
content.add(comboChartTypeLabel, new VerticalLayoutData(1, -1,
new Margins(0)));
return panel;
}
private void addHandlersForComboChartType(
final LabelProvider<ChartTypeElement> labelProvider) {
comboChartType
.addSelectionHandler(new SelectionHandler<ChartTypeElement>() {
public void onSelection(
SelectionEvent<ChartTypeElement> event) {
Info.display(
"Chart Selected",
"You selected "
+ (event.getSelectedItem() == null ? "nothing"
: labelProvider.getLabel(event
.getSelectedItem())
+ "!"));
Log.debug("ComboChartType selected: "
+ event.getSelectedItem());
ChartTypeElement measureType = event.getSelectedItem();
updateChartType(measureType.getType());
}
});
}
private void updateChartType(ChartType type) {
chartTypeSelected = type;
}
@Override
public void setup() {
Log.debug("ChartSelectionCard Setup");
Command sayNextCard = new Command() {
public void execute() {
Log.debug("ChartSelectionCard Call sayNextCard");
checkData();
}
};
Command sayPreviousCard = new Command() {
public void execute() {
try {
getWizardWindow().previousCard();
getWizardWindow().removeCard(thisCard);
Log.info("Remove ChartSelectionCard");
} catch (Exception e) {
Log.error("sayPreviousCard :" + e.getLocalizedMessage());
}
}
};
getWizardWindow().setPreviousButtonCommand(sayPreviousCard);
getWizardWindow().setNextButtonCommand(sayNextCard);
setEnableBackButton(false);
setEnableNextButton(true);
}
protected void checkData() {
getWizardWindow().setEnableNextButton(false);
getWizardWindow().setEnableBackButton(false);
HideHandler hideHandler = new HideHandler() {
public void onHide(HideEvent event) {
getWizardWindow().setEnableNextButton(true);
getWizardWindow().setEnableBackButton(false);
}
};
if(chartTypeSelected==null){
AlertMessageBox d = new AlertMessageBox("Attention",
"No chart selected");
d.addHideHandler(hideHandler);
d.setModal(false);
d.show();
return;
}
switch (chartTypeSelected) {
case TopRating:
checkTopRating();
break;
default:
AlertMessageBox d = new AlertMessageBox("Attention",
"No chart selected");
d.addHideHandler(hideHandler);
d.setModal(false);
d.show();
break;
}
}
protected void checkTopRating() {
String tableTypeName = chartSession.getTrId().getTableTypeName();
if (tableTypeName.compareTo(TableType.DATASET.toString()) == 0) {
try {
ChartTopRatingSession chartTopRatingSession = new ChartTopRatingSession();
chartTopRatingSession.setTrId(chartSession.getTrId());
TopRatingColumnSelectionCard topRatingColumnSelectionCard = new TopRatingColumnSelectionCard(
chartSession, chartTopRatingSession);
getWizardWindow().addCard(topRatingColumnSelectionCard);
getWizardWindow().nextCard();
} catch (Exception e) {
Log.error("sayNextCard :" + e.getLocalizedMessage());
}
} else {
AlertMessageBox d = new AlertMessageBox("Attention",
"Chart not applicable, table is not a Dataset!");
d.addHideHandler(new HideHandler() {
public void onHide(HideEvent event) {
getWizardWindow().setEnableNextButton(true);
getWizardWindow().setEnableBackButton(false);
}
});
d.setModal(false);
d.show();
}
}
@Override
public void dispose() {
}
}

View File

@ -0,0 +1,91 @@
package org.gcube.portlets.user.td.chartswidget.client;
import java.util.ArrayList;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.chart.ChartSession;
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.ColumnData;
import org.gcube.portlets.user.td.gwtservice.shared.user.UserInfo;
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.TRId;
import org.gcube.portlets.user.td.wizardwidget.client.WizardWindow;
import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.web.bindery.event.shared.EventBus;
/**
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ChartsWidgetTD extends WizardWindow {
protected ChartSession chartSession;
/**
*
* @param title
* @param eventBus
*/
public ChartsWidgetTD(TRId trId, UserInfo userInfo, String title, EventBus eventBus) {
super(title,eventBus);
Log.debug("ChartWidgetTD");
chartSession= new ChartSession();
chartSession.setTrId(trId);
chartSession.setUserInfo(userInfo);
retrieveColumns();
}
private void startChartsCreation() {
ChartSelectionCard chartSelectionCard=new ChartSelectionCard(chartSession);
addCard(chartSelectionCard);
chartSelectionCard.setup();
show();
}
protected void retrieveColumns(){
TDGWTServiceAsync.INSTANCE
.getColumns(new AsyncCallback<ArrayList<ColumnData>>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus
.fireEvent(
new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
showErrorAndHide("Error Locked",
caught.getLocalizedMessage(), caught);
} else {
Log.error("Error Retrieving columns: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error Retrieving columns", caught.getLocalizedMessage());
}
}
}
public void onSuccess(ArrayList<ColumnData> result) {
Log.trace("loaded " + result.size() + " columns");
chartSession.setColumns(result);
startChartsCreation();
}
});
}
}

View File

@ -0,0 +1,31 @@
package org.gcube.portlets.user.td.chartswidget.client;
import org.gcube.portlets.user.td.gwtservice.shared.user.UserInfo;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.TabResourceType;
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
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ChartsWidgetTDEntry implements EntryPoint {
public void onModuleLoad() {
TRId trId=new TRId("58",TabResourceType.STANDARD, "1286");
UserInfo userInfo=new UserInfo();
userInfo.setUsername("test.user");
SimpleEventBus eventBus=new SimpleEventBus();
ChartsWidgetTD chartCreationWizard= new ChartsWidgetTD(trId, userInfo,"Chart Creation",eventBus);
Log.info(chartCreationWizard.getId());
}
}

View File

@ -0,0 +1,25 @@
package org.gcube.portlets.user.td.chartswidget.client.grid;
import org.gcube.portlets.user.td.gwtservice.shared.tr.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
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface ColumnDataProperties extends
PropertyAccess<ColumnData> {
@Path("id")
ModelKeyProvider<ColumnData> id();
ValueProvider<ColumnData, String> label();
}

View File

@ -0,0 +1,23 @@
package org.gcube.portlets.user.td.chartswidget.client.properties;
import org.gcube.portlets.user.td.chartswidget.client.store.ChartTypeElement;
import com.google.gwt.editor.client.Editor.Path;
import com.sencha.gxt.data.shared.LabelProvider;
import com.sencha.gxt.data.shared.ModelKeyProvider;
import com.sencha.gxt.data.shared.PropertyAccess;
/**
*
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface ChartTypePropertiesCombo extends PropertyAccess<ChartTypeElement> {
@Path("id")
ModelKeyProvider<ChartTypeElement> id();
LabelProvider<ChartTypeElement> label();
}

View File

@ -0,0 +1,51 @@
package org.gcube.portlets.user.td.chartswidget.client.store;
import org.gcube.portlets.user.td.widgetcommonevent.shared.charts.ChartType;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ChartTypeElement {
protected int id; // For insert in table only
protected ChartType type;
public ChartTypeElement(int id, ChartType type){
this.id=id;
this.type=type;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public ChartType getType() {
return type;
}
public void setType(ChartType type) {
this.type = type;
}
public String getLabel() {
return type.toString();
}
@Override
public String toString() {
return "ChartTypeElement [id=" + id + ", type=" + type + "]";
}
}

View File

@ -0,0 +1,60 @@
package org.gcube.portlets.user.td.chartswidget.client.store;
import java.io.Serializable;
import java.util.ArrayList;
import org.gcube.portlets.user.td.widgetcommonevent.shared.charts.ChartType;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ChartTypeStore implements Serializable {
private static final long serialVersionUID = -1908324094430432681L;
protected static ArrayList<ChartTypeElement> store;
protected static ChartTypeElement topRatingElement=new ChartTypeElement(1,ChartType.TopRating);
public static ArrayList<ChartTypeElement> getChartsType(){
store=new ArrayList<ChartTypeElement>();
store.add(topRatingElement);
return store;
}
public static int selectedChartPosition(String selected){
int position=0;
if(selected.compareTo(ChartType.TopRating.toString())==0){
position=1;
} else {
}
return position;
}
public static ChartType selectedChart(String selected){
if(selected.compareTo(ChartType.TopRating.toString())==0){
return ChartType.TopRating;
} else {
return null;
}
}
public static ChartTypeElement selectedChartElement(String selected){
if(selected.compareTo(ChartType.TopRating.toString())==0){
return topRatingElement;
} else {
return null;
}
}
}

View File

@ -0,0 +1,146 @@
package org.gcube.portlets.user.td.chartswidget.client.toprating;
import org.gcube.portlets.user.td.gwtservice.shared.chart.ChartSession;
import org.gcube.portlets.user.td.gwtservice.shared.chart.ChartTopRatingSession;
import org.gcube.portlets.user.td.gwtservice.shared.tr.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.sencha.gxt.core.client.util.Padding;
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.event.HideEvent;
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
import com.sencha.gxt.widget.core.client.form.FormPanel;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class TopRatingColumnSelectionCard extends WizardCard {
private ChartTopRatingSession chartTopRatingSession;
private TopRatingColumnSelectionCard thisCard;
private TopRatingColumnSelectionGridPanel topRatingColumnSelectionGridPanel;
private ChartSession chartSession;
public TopRatingColumnSelectionCard(final ChartSession chartSession,
final ChartTopRatingSession chartTopRatingSession) {
super("Column Selection", "");
this.thisCard=this;
if (chartTopRatingSession == null) {
Log.error("ChartTopRatingSession is null");
}
this.chartSession=chartSession;
this.chartTopRatingSession = chartTopRatingSession;
FormPanel panel = createPanel();
setContent(panel);
}
protected FormPanel createPanel() {
FormPanel panel = new FormPanel();
panel.setLabelWidth(90);
panel.getElement().setPadding(new Padding(5));
VerticalLayoutContainer content = new VerticalLayoutContainer();
panel.add(content);
// Column Selection Grid
topRatingColumnSelectionGridPanel = new TopRatingColumnSelectionGridPanel(this, chartSession);
topRatingColumnSelectionGridPanel
.addSelectionHandler(new SelectionHandler<ColumnData>() {
public void onSelection(SelectionEvent<ColumnData> event) {
}
});
content.add(topRatingColumnSelectionGridPanel);
return panel;
}
@Override
public void setup() {
Log.debug("TopRatingColumnSelectionCard Setup");
Command sayNextCard = new Command() {
public void execute() {
Log.debug("TopRatingColumnSelectionCard Call sayNextCard");
checkData();
}
};
Command sayPreviousCard = new Command() {
public void execute() {
try {
getWizardWindow().previousCard();
getWizardWindow().removeCard(thisCard);
Log.info("Remove TopRatingColumnSelectionCard");
} catch (Exception e) {
Log.error("sayPreviousCard :" + e.getLocalizedMessage());
}
}
};
getWizardWindow().setPreviousButtonCommand(sayPreviousCard);
getWizardWindow().setNextButtonCommand(sayNextCard);
setEnableBackButton(true);
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(true);
}
};
ColumnData columnSelected = topRatingColumnSelectionGridPanel.getSelectedItem();
if (columnSelected == null) {
d = new AlertMessageBox("Attention", "No columns selected");
d.addHideHandler(hideHandler);
d.setModal(false);
d.show();
} else {
chartTopRatingSession.setColumn(columnSelected);
goNext();
}
}
protected void goNext() {
try {
/*MapWidgetDetailCard mapWidgetDetailCard = new MapWidgetDetailCard(
chartTopRatingSession);
getWizardWindow().addCard(mapWidgetDetailCard);
getWizardWindow().nextCard();*/
} catch (Exception e) {
Log.error("sayNextCard :" + e.getLocalizedMessage());
}
}
@Override
public void dispose() {
}
}

View File

@ -0,0 +1,107 @@
package org.gcube.portlets.user.td.chartswidget.client.toprating;
import java.util.ArrayList;
import java.util.List;
import org.gcube.portlets.user.td.chartswidget.client.grid.ColumnDataProperties;
import org.gcube.portlets.user.td.gwtservice.shared.chart.ChartSession;
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
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.sencha.gxt.core.client.IdentityValueProvider;
import com.sencha.gxt.core.client.Style.SelectionMode;
import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.data.shared.ListStore;
import com.sencha.gxt.widget.core.client.ContentPanel;
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.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;
/**
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class TopRatingColumnSelectionGridPanel extends ContentPanel implements
HasSelectionHandlers<ColumnData> {
//private static final String GRID_WIDTH ="524px";
private static final String GRID_HEIGHT = "340px";
private static final ColumnDataProperties props = GWT
.create(ColumnDataProperties.class);
private final CheckBoxSelectionModel<ColumnData> sm;
private final Grid<ColumnData> grid;
@SuppressWarnings("unused")
private TopRatingColumnSelectionCard parent;
/**
*
* @param parent
*/
public TopRatingColumnSelectionGridPanel(TopRatingColumnSelectionCard parent, ChartSession chartSession) {
this.parent=parent;
Log.debug("TopRatingColumnSelectionGridPanel");
setHeadingText("Colums");
ColumnConfig<ColumnData, String> labelCol = new ColumnConfig<ColumnData, String>(
props.label());
IdentityValueProvider<ColumnData> identity = new IdentityValueProvider<ColumnData>();
sm = new CheckBoxSelectionModel<ColumnData>(identity);
List<ColumnConfig<ColumnData, ?>> l = new ArrayList<ColumnConfig<ColumnData, ?>>();
l.add(sm.getColumn());
l.add(labelCol);
ColumnModel<ColumnData> cm = new ColumnModel<ColumnData>(l);
ListStore<ColumnData> store = new ListStore<ColumnData>(props.id());
store.addAll(chartSession.getColumns());
grid = new Grid<ColumnData>(store, cm);
sm.setSelectionMode(SelectionMode.SINGLE);
grid.setSelectionModel(sm);
grid.setHeight(GRID_HEIGHT);
//grid.setWidth(GRID_WIDTH);
// grid.getView().setAutoExpandColumn(labelCol);
grid.getView().setStripeRows(true);
grid.getView().setColumnLines(true);
grid.getView().setAutoFill(true);
grid.setBorders(false);
grid.setLoadMask(true);
grid.setColumnReordering(false);
VerticalLayoutContainer con = new VerticalLayoutContainer();
con.setScrollMode(ScrollMode.AUTO);
con.add(grid, new VerticalLayoutData(-1, -1, new Margins(0)));
setWidget(con);
}
public Grid<ColumnData> getGrid() {
return grid;
}
public ColumnData getSelectedItem() {
return grid.getSelectionModel()
.getSelectedItem();
}
public HandlerRegistration addSelectionHandler(
SelectionHandler<ColumnData> handler) {
return grid.getSelectionModel().addSelectionHandler(handler);
}
}

View File

@ -0,0 +1,283 @@
/**
*
*/
package org.gcube.portlets.user.td.chartswidget.client.toprating;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.chart.ChartTopRatingSession;
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.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.VBoxLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VBoxLayoutContainer.VBoxLayoutAlign;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class TopRatingOperationInProgressCard extends WizardCard implements
MonitorDialogListener {
protected TopRatingOperationInProgressCard thisCard;
protected ChartTopRatingSession chartTopRatingSession;
protected TRId newTrId;
protected HtmlLayoutContainer resultField;
public TopRatingOperationInProgressCard(final ChartTopRatingSession chartTopRatingSession) {
super("Operation In Progress", "");
this.chartTopRatingSession = chartTopRatingSession;
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;\";>Chart: </span>");
description.setText(0, 1, "Top Rating");
description.setHTML(1, 0,
"<span style=\"font-weight:bold;\";>Column: </span>");
description.setText(1, 1, chartTopRatingSession.getColumn().getLabel());
description.setHTML(2, 0,
"<span style=\"font-weight:bold;\";>Value: </span>");
description.setText(2, 1, chartTopRatingSession.getValueOperation());
FramedPanel summary = new FramedPanel();
summary.setHeadingText("Chart Creation");
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)));
setContent(operationInProgressPanel);
resultField.setVisible(false);
}
public void chartCreation() {
TDGWTServiceAsync.INSTANCE.startChartTopRating(chartTopRatingSession,
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",
"An error occured in chart creation: "
+ caught.getLocalizedMessage(),
caught);
}
}
}
});
}
@Override
public void setup() {
getWizardWindow().setEnableBackButton(false);
setBackButtonVisible(false);
setNextButtonVisible(false);
getWizardWindow().setEnableNextButton(false);
getWizardWindow().setNextButtonToFinish();
chartCreation();
}
//
protected void openMonitorDialog(String taskId) {
MonitorDialog monitorDialog = new MonitorDialog(taskId, getEventBus());
monitorDialog.addProgressDialogListener(this);
monitorDialog.setBackgroundBtnEnabled(false);
monitorDialog.show();
}
@Override
public void operationComplete(TRId trId) {
newTrId = trId;
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
.appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold; color:#009900;'>Operation Completed</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 Export",
reason,caught);
}
forceLayout();
}
@Override
public void operationStopped(TRId trId, String reason, String details) {
newTrId = trId;
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();
}
}

View File

@ -0,0 +1 @@
< ャ@Qaj、F÷gク<67>

View File

@ -0,0 +1 @@
< ャ@Qaj、F÷gク<67>

View File

@ -0,0 +1 @@
< ャ@Qaj、F÷gク<67>

View File

@ -0,0 +1 @@
< ャ@Qaj、F÷gク<67>

View File

@ -0,0 +1 @@
< ャ@Qaj、F÷gク<67>

View File

@ -0,0 +1,6 @@
You should put the infrastructure decrypt keys here.
the keys must be in named "<scope name>.gcubekey", e.g. "gcube.gcubekey" or "devsec.gcubekey"
The content of this folder is automatically loaded in the classpath when tomcat starts up.

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='ChartsWidgetTD'>
<!-- 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' />
<!-- 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. -->
<!-- <entry-point class='org.gcube.portlets.user.td.chartswidget.client.ChartsWidgetTDEntry'
/> -->
<!-- Specify the paths for translatable code -->
<source path='client' />
<source path='shared' />
<!-- <source path='org.gcube.data.analysis.tabulardata.operation.worker'/> -->
</module>

View File

@ -0,0 +1,2 @@
sendButton = Send
nameField = Enter your name

View File

@ -0,0 +1,2 @@
sendButton = Envoyer
nameField = Entrez votre nom

View File

@ -0,0 +1 @@
< ャ@Qaj、F÷gク<67>

View File

@ -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;
}

View File

@ -0,0 +1,50 @@
<!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="ChartsWidgetTD.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" src="ChartsWidgetTD/ChartsWidgetTD.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>
<div></div>
</body>
</html>

View File

@ -0,0 +1,35 @@
<?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>/ChartsWidgetTD/TDGWTService</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>jUnitHostImpl</servlet-name>
<url-pattern>/ChartsWidgetTD/junithost/*</url-pattern>
</servlet-mapping>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>ChartsWidgetTD.html</welcome-file>
</welcome-file-list>
</web-app>

View File

@ -0,0 +1,83 @@
package org.gcube.portlets.user.td.chartswidget.client;
import java.util.ArrayList;
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.tr.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 GwtTestChartsWidgetTD extends GWTTestCase {
/**
* Must refer to a valid module that sources this class.
*/
public String getModuleName() {
return "org.gcube.portlets.user.chartswidget.ChartsWidgetTDJUnit";
}
/**
* This test will send a request to the server
*/
public void testResource() {
// Create the service that we will test.
TDGWTServiceAsync tdGWTService = GWT.create(TDGWTService.class);
ServiceDefTarget target = (ServiceDefTarget) tdGWTService;
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.
tdGWTService.getTabularResources(new AsyncCallback<ArrayList<TabResource>>() {
public void onFailure(Throwable caught) {
// The request resulted in an unexpected error.
fail("Request failure: " + caught.getMessage());
}
public void onSuccess(ArrayList<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();
}
});
}
}

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to="MapWidgetTDJUnit">
<!-- 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
templates/INSTALL Normal file
View File

6
templates/LICENSE Normal file
View File

@ -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.

1
templates/MAINTAINERS Normal file
View File

@ -0,0 +1 @@
Giancarlo Panichi (giancarlo.panichi@isti.cnr.it), CNR Pisa, Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo"

48
templates/README Normal file
View File

@ -0,0 +1,48 @@
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 is available from SVN:
${scm.url}
Binaries can be downloaded from:
http://software.d4science.research-infrastructures.eu/
Documentation
-------------
${project.description}
Documentation is available on-line from the Projects Documentation Wiki:
${wikiurl}
Licensing
---------
This software is licensed under the terms you may find in the file named "LICENSE" in this directory.

6
templates/changelog.xml Normal file
View File

@ -0,0 +1,6 @@
<ReleaseNotes>
<Changeset component="${groupId}.${artifactId}.1-0-0"
date="2014-10-31">
<Change>First Release</Change>
</Changeset>
</ReleaseNotes>

39
templates/descriptor.xml Normal file
View File

@ -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>

29
templates/profile.xml Normal file
View File

@ -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>${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>

1
templates/svnpath.txt Normal file
View File

@ -0,0 +1 @@
${scm.url}