From c5c7ddcad01f4631ed8f4fc29e1b949fc40b26f0 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Fri, 25 Jul 2014 14:29:03 +0000 Subject: [PATCH] Initial import. git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-monitor-widget@98996 82a268e6-3cf1-43bd-a215-b396298e98cf --- pom.xml | 292 ++++++++++++++++++ .../monitorwidget/client/MonitorWidget.java | 14 + .../client/MonitorWidgetEntry.java | 23 ++ .../client/resources/MonitorCSS.java | 19 ++ .../client/resources/ResourceBundle.java | 19 ++ .../client/utils/InfoMessageBox.java | 28 ++ .../monitorwidget/client/utils/UtilsGXT3.java | 51 +++ .../td/monitorwidget/MonitorWidgetTD.gwt.xml | 31 ++ .../monitorwidget/client/Messages.properties | 2 + .../client/Messages_fr.properties | 2 + .../client/resources/MonitorWidgetTD.css | 3 + src/main/webapp/MonitorWidgetTD.css | 34 ++ src/main/webapp/MonitorWidgetTD.html | 50 +++ src/main/webapp/WEB-INF/web.xml | 40 +++ .../client/GwtTestMonitorWidgetTD.java | 82 +++++ .../MonitorWidgetTDJUnit.gwt.xml | 13 + templates/INSTALL | 0 templates/LICENSE | 6 + templates/MAINTAINERS | 1 + templates/README | 40 +++ templates/changelog.xml | 6 + templates/descriptor.xml | 39 +++ templates/profile.xml | 29 ++ templates/svnpath.txt | 1 + 24 files changed, 825 insertions(+) create mode 100644 pom.xml create mode 100644 src/main/java/org/gcube/portlets/user/td/monitorwidget/client/MonitorWidget.java create mode 100644 src/main/java/org/gcube/portlets/user/td/monitorwidget/client/MonitorWidgetEntry.java create mode 100644 src/main/java/org/gcube/portlets/user/td/monitorwidget/client/resources/MonitorCSS.java create mode 100644 src/main/java/org/gcube/portlets/user/td/monitorwidget/client/resources/ResourceBundle.java create mode 100644 src/main/java/org/gcube/portlets/user/td/monitorwidget/client/utils/InfoMessageBox.java create mode 100644 src/main/java/org/gcube/portlets/user/td/monitorwidget/client/utils/UtilsGXT3.java create mode 100644 src/main/resources/org/gcube/portlets/user/td/monitorwidget/MonitorWidgetTD.gwt.xml create mode 100644 src/main/resources/org/gcube/portlets/user/td/monitorwidget/client/Messages.properties create mode 100644 src/main/resources/org/gcube/portlets/user/td/monitorwidget/client/Messages_fr.properties create mode 100644 src/main/resources/org/gcube/portlets/user/td/monitorwidget/client/resources/MonitorWidgetTD.css create mode 100644 src/main/webapp/MonitorWidgetTD.css create mode 100644 src/main/webapp/MonitorWidgetTD.html create mode 100644 src/main/webapp/WEB-INF/web.xml create mode 100644 src/test/java/org/gcube/portlets/user/td/monitorwidget/client/GwtTestMonitorWidgetTD.java create mode 100644 src/test/resources/org/gcube/portlets/user/td/monitorwidget/MonitorWidgetTDJUnit.gwt.xml create mode 100644 templates/INSTALL create mode 100644 templates/LICENSE create mode 100644 templates/MAINTAINERS create mode 100644 templates/README create mode 100644 templates/changelog.xml create mode 100644 templates/descriptor.xml create mode 100644 templates/profile.xml create mode 100644 templates/svnpath.txt diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..423b6fe --- /dev/null +++ b/pom.xml @@ -0,0 +1,292 @@ + + + + + maven-parent + org.gcube.tools + 1.0.0 + + + + + 4.0.0 + org.gcube.portlets.user + tabular-data-monitor-widget + 1.0.0-SNAPSHOT + + tabular-data-monitor-widget + tabular-data-monitor-widget allows monitoring of tasks + + + https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-monitor-widget + + + + + Giancarlo Panichi + g.panichi@isti.cnr.it + CNR Pisa, Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" + + architect + developer + + + + + + ${project.basedir}/distro + ${project.build.directory}/${project.build.finalName} + 2014-07-04 + templates + distro + config + + + 2.5.1 + + ${env.KEYS} + + UTF-8 + UTF-8 + + + + + localRun + + + org.slf4j + slf4j-api + compile + + + ch.qos.logback + logback-classic + 1.0.1 + runtime + + + + + + + + + com.google.gwt + gwt-servlet + + + com.google.gwt + gwt-user + + + + junit + junit + 4.8.1 + test + + + javax.validation + validation-api + 1.0.0.GA + test + + + javax.validation + validation-api + 1.0.0.GA + sources + test + + + + com.sencha.gxt + gxt + 3.0.1 + + + + + + + org.gcube.portlets.user + tabular-data-gwt-service + [2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT) + provided + + + + + org.gcube.portlets.user + tabular-data-widget-common-event + [1.0.0-SNAPSHOT,2.0.0-SNAPSHOT) + provided + + + + + + + com.allen-sauer.gwt.log + gwt-log + 3.2.1 + provided + + + + org.slf4j + slf4j-api + + + + + + + + + + ${webappDirectory}/WEB-INF/classes + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.16 + + true + + + + + org.apache.maven.surefire + surefire-junit47 + 2.16 + + + + + + + org.codehaus.mojo + gwt-maven-plugin + ${gwtVersion} + + + + resources + + + + + UnionWizardTD.html + ${webappDirectory} + org.gcube.portlets.user.td.unionwizardwidget.UnionWizardTD + + + + + + maven-resources-plugin + 2.6 + + + copy-profile + process-resources + + copy-resources + + + ${configDirectory} + + + ${templatesDirectory} + + profile.xml + + true + + + + + + copy-distro-resources + process-resources + + copy-resources + + + ${distroDirectory} + + + ${templatesDirectory} + + profile.xml + descriptor.xml + + true + + + + + + + + maven-clean-plugin + 2.5 + + + + ${distroDirectory} + + ** + + false + + + ${configDirectory} + + ** + + false + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.2 + + + ${templatesDirectory}/descriptor.xml + + + + + servicearchive + package + + single + + + + + + + + + + + + + org.gcube.distribution + maven-portal-bom + LATEST + pom + import + + + + diff --git a/src/main/java/org/gcube/portlets/user/td/monitorwidget/client/MonitorWidget.java b/src/main/java/org/gcube/portlets/user/td/monitorwidget/client/MonitorWidget.java new file mode 100644 index 0000000..8856eb2 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/monitorwidget/client/MonitorWidget.java @@ -0,0 +1,14 @@ +package org.gcube.portlets.user.td.monitorwidget.client; + + +/** + * + * @author "Giancarlo Panichi" email: g.panichi@isti.cnr.it + * + */ +public class MonitorWidget { + public MonitorWidget(){ + + } +} \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/td/monitorwidget/client/MonitorWidgetEntry.java b/src/main/java/org/gcube/portlets/user/td/monitorwidget/client/MonitorWidgetEntry.java new file mode 100644 index 0000000..2489afc --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/monitorwidget/client/MonitorWidgetEntry.java @@ -0,0 +1,23 @@ +package org.gcube.portlets.user.td.monitorwidget.client; + +import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; + +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" + * email: g.panichi@isti.cnr.it + * + */ +public class MonitorWidgetEntry implements EntryPoint { + + public void onModuleLoad() { + TRId trId=new TRId(); + SimpleEventBus eventBus=new SimpleEventBus(); + MonitorWidget monitorWidget= new MonitorWidget(); + + } +} diff --git a/src/main/java/org/gcube/portlets/user/td/monitorwidget/client/resources/MonitorCSS.java b/src/main/java/org/gcube/portlets/user/td/monitorwidget/client/resources/MonitorCSS.java new file mode 100644 index 0000000..3117a68 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/monitorwidget/client/resources/MonitorCSS.java @@ -0,0 +1,19 @@ +/** + * + */ +package org.gcube.portlets.user.td.monitorwidget.client.resources; + +import com.google.gwt.resources.client.CssResource; + +/** + * + * @author "Giancarlo Panichi" + * g.panichi@isti.cnr.it + * + */ +public interface MonitorCSS extends CssResource { + + + + +} diff --git a/src/main/java/org/gcube/portlets/user/td/monitorwidget/client/resources/ResourceBundle.java b/src/main/java/org/gcube/portlets/user/td/monitorwidget/client/resources/ResourceBundle.java new file mode 100644 index 0000000..3103403 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/monitorwidget/client/resources/ResourceBundle.java @@ -0,0 +1,19 @@ +package org.gcube.portlets.user.td.monitorwidget.client.resources; + + + +import com.google.gwt.core.client.GWT; +import com.google.gwt.resources.client.ClientBundle; + + +public interface ResourceBundle extends ClientBundle { + + public static final ResourceBundle INSTANCE=GWT.create(ResourceBundle.class); + + @Source("MonitorWidgetTD.css") + MonitorCSS monitorCss(); + + + +} + \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/td/monitorwidget/client/utils/InfoMessageBox.java b/src/main/java/org/gcube/portlets/user/td/monitorwidget/client/utils/InfoMessageBox.java new file mode 100644 index 0000000..36cf485 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/monitorwidget/client/utils/InfoMessageBox.java @@ -0,0 +1,28 @@ +package org.gcube.portlets.user.td.monitorwidget.client.utils; + +import com.sencha.gxt.widget.core.client.box.MessageBox; + +/** + * + * @author "Giancarlo Panichi" + * g.panichi@isti.cnr.it + * + */ +public class InfoMessageBox extends MessageBox { + + /** + * Creates a message box with an info icon and the specified title and + * message. + * + * @param title + * the message box title + * @param message + * the message displayed in the message box + */ + public InfoMessageBox(String title, String message) { + super(title, message); + + setIcon(ICONS.info()); + } + +} \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/td/monitorwidget/client/utils/UtilsGXT3.java b/src/main/java/org/gcube/portlets/user/td/monitorwidget/client/utils/UtilsGXT3.java new file mode 100644 index 0000000..eadf04f --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/monitorwidget/client/utils/UtilsGXT3.java @@ -0,0 +1,51 @@ +package org.gcube.portlets.user.td.monitorwidget.client.utils; + + +import com.google.gwt.user.client.Element; +import com.sencha.gxt.core.client.dom.XElement; +import com.sencha.gxt.widget.core.client.box.AlertMessageBox; +import com.sencha.gxt.widget.core.client.event.HideEvent; +import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler; + +/** + * + * @author "Giancarlo Panichi" + * g.panichi@isti.cnr.it + * + */ +public class UtilsGXT3 { + public static void mask(Element element) { + XElement el = element. cast(); + el.mask("Loading..."); + } + + public static void umask(Element element) { + element. cast().unmask(); + } + + + public static void alert(String title, String message) { + final AlertMessageBox d = new AlertMessageBox(title, message); + d.addHideHandler(new HideHandler() { + + public void onHide(HideEvent event) { + + } + }); + d.show(); + + } + + public static void info(String title, String message) { + final InfoMessageBox d = new InfoMessageBox(title, message); + d.addHideHandler(new HideHandler() { + + public void onHide(HideEvent event) { + + } + }); + d.show(); + + } + +} diff --git a/src/main/resources/org/gcube/portlets/user/td/monitorwidget/MonitorWidgetTD.gwt.xml b/src/main/resources/org/gcube/portlets/user/td/monitorwidget/MonitorWidgetTD.gwt.xml new file mode 100644 index 0000000..a3ee09e --- /dev/null +++ b/src/main/resources/org/gcube/portlets/user/td/monitorwidget/MonitorWidgetTD.gwt.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/org/gcube/portlets/user/td/monitorwidget/client/Messages.properties b/src/main/resources/org/gcube/portlets/user/td/monitorwidget/client/Messages.properties new file mode 100644 index 0000000..c222555 --- /dev/null +++ b/src/main/resources/org/gcube/portlets/user/td/monitorwidget/client/Messages.properties @@ -0,0 +1,2 @@ +sendButton = Send +nameField = Enter your name \ No newline at end of file diff --git a/src/main/resources/org/gcube/portlets/user/td/monitorwidget/client/Messages_fr.properties b/src/main/resources/org/gcube/portlets/user/td/monitorwidget/client/Messages_fr.properties new file mode 100644 index 0000000..b4a7627 --- /dev/null +++ b/src/main/resources/org/gcube/portlets/user/td/monitorwidget/client/Messages_fr.properties @@ -0,0 +1,2 @@ +sendButton = Envoyer +nameField = Entrez votre nom \ No newline at end of file diff --git a/src/main/resources/org/gcube/portlets/user/td/monitorwidget/client/resources/MonitorWidgetTD.css b/src/main/resources/org/gcube/portlets/user/td/monitorwidget/client/resources/MonitorWidgetTD.css new file mode 100644 index 0000000..d44d232 --- /dev/null +++ b/src/main/resources/org/gcube/portlets/user/td/monitorwidget/client/resources/MonitorWidgetTD.css @@ -0,0 +1,3 @@ +@CHARSET "UTF-8"; + + diff --git a/src/main/webapp/MonitorWidgetTD.css b/src/main/webapp/MonitorWidgetTD.css new file mode 100644 index 0000000..7aca7ac --- /dev/null +++ b/src/main/webapp/MonitorWidgetTD.css @@ -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; +} diff --git a/src/main/webapp/MonitorWidgetTD.html b/src/main/webapp/MonitorWidgetTD.html new file mode 100644 index 0000000..7fee469 --- /dev/null +++ b/src/main/webapp/MonitorWidgetTD.html @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + Web Application Starter Project + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..9aa6ade --- /dev/null +++ b/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,40 @@ + + + + + + + + TDGWTService + org.gcube.portlets.user.td.gwtservice.server.TDGWTServiceImpl + + + + jUnitHostImpl + com.google.gwt.junit.server.JUnitHostImpl + + + + + + + + TDGWTService + tdgwtservice/TDGWTService + + + jUnitHostImpl + UnionWizardWidgets/junithost/* + + + + + + + + MonitorWidgetTD.html + + + diff --git a/src/test/java/org/gcube/portlets/user/td/monitorwidget/client/GwtTestMonitorWidgetTD.java b/src/test/java/org/gcube/portlets/user/td/monitorwidget/client/GwtTestMonitorWidgetTD.java new file mode 100644 index 0000000..1fb4acd --- /dev/null +++ b/src/test/java/org/gcube/portlets/user/td/monitorwidget/client/GwtTestMonitorWidgetTD.java @@ -0,0 +1,82 @@ +package org.gcube.portlets.user.td.monitorwidget.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 integration tests must extend GWTTestCase. + * Using "GwtTest*" 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 GwtTestMonitorWidgetTD extends GWTTestCase { + + /** + * Must refer to a valid module that sources this class. + */ + public String getModuleName() { + return "org.gcube.portlets.user.monitorwidget.MonitorWidgetTDJUnit"; + } + + /** + * 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>() { + + + public void onFailure(Throwable caught) { + // The request resulted in an unexpected error. + fail("Request failure: " + caught.getMessage()); + + } + + public void onSuccess(ArrayList 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(); + + } + }); + + } + + +} diff --git a/src/test/resources/org/gcube/portlets/user/td/monitorwidget/MonitorWidgetTDJUnit.gwt.xml b/src/test/resources/org/gcube/portlets/user/td/monitorwidget/MonitorWidgetTDJUnit.gwt.xml new file mode 100644 index 0000000..149ee3f --- /dev/null +++ b/src/test/resources/org/gcube/portlets/user/td/monitorwidget/MonitorWidgetTDJUnit.gwt.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + diff --git a/templates/INSTALL b/templates/INSTALL new file mode 100644 index 0000000..e69de29 diff --git a/templates/LICENSE b/templates/LICENSE new file mode 100644 index 0000000..cc51139 --- /dev/null +++ b/templates/LICENSE @@ -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. \ No newline at end of file diff --git a/templates/MAINTAINERS b/templates/MAINTAINERS new file mode 100644 index 0000000..0bc9be3 --- /dev/null +++ b/templates/MAINTAINERS @@ -0,0 +1 @@ +Giancarlo Panichi (giancarlo.panichi@isti.cnr.it), CNR Pisa, Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" diff --git a/templates/README b/templates/README new file mode 100644 index 0000000..e81341a --- /dev/null +++ b/templates/README @@ -0,0 +1,40 @@ +The gCube System - ${name} +------------------------------------------------------------ + +This work has been supported by the following European projects: iMarine (FP7-INFRASTRUCTURES-2011-2) + +Authors +------- + +Giancarlo Panichi (giancarlo.panichi@isti.cnr.it), CNR Pisa, +Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" + + +Version and Release Date +------------------------ + +v. ${version} (${release.date}) + +Description +----------- + +${project.description} + +Download information +-------------------- +Source code URL: ${scm.url} + + +Documentation +------------- + +${project.description} + + +Licensing +--------- + +This software is licensed under the terms you may find in the file named "LICENSE" in this directory. + + + diff --git a/templates/changelog.xml b/templates/changelog.xml new file mode 100644 index 0000000..f9f8997 --- /dev/null +++ b/templates/changelog.xml @@ -0,0 +1,6 @@ + + + First Release + + \ No newline at end of file diff --git a/templates/descriptor.xml b/templates/descriptor.xml new file mode 100644 index 0000000..b978636 --- /dev/null +++ b/templates/descriptor.xml @@ -0,0 +1,39 @@ + + servicearchive + + tar.gz + + / + + + ${distroDirectory} + / + true + + README + LICENSE + INSTALL + MAINTAINERS + changelog.xml + + 755 + + + + + ${distroDirectory}/svnpath.txt + /${artifactId} + + + ${configDirectory}/profile.xml + / + + + target/${build.finalName}.${packaging} + /${artifactId} + + + \ No newline at end of file diff --git a/templates/profile.xml b/templates/profile.xml new file mode 100644 index 0000000..19ed5bc --- /dev/null +++ b/templates/profile.xml @@ -0,0 +1,29 @@ + + + + Service + + ${project.description} + PortletsUser + ${project.name} + ${version} + + + ${project.description} + ${project.name} + ${version} + + ${project.groupId} + ${project.artifactId} + ${project.version} + + library + + ${project.build.finalName}.${project.packaging} + + + + + + + diff --git a/templates/svnpath.txt b/templates/svnpath.txt new file mode 100644 index 0000000..dcd0d22 --- /dev/null +++ b/templates/svnpath.txt @@ -0,0 +1 @@ +${scm.url} \ No newline at end of file