First Commit
This commit is contained in:
commit
e3fe1ab787
|
@ -0,0 +1,55 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/data-miner-manager-tester-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/data-miner-manager-tester-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.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.8.1/gwt-user.jar">
|
||||
<attributes>
|
||||
<attribute name="javadoc_location" value="file:/home/giancarlo/gwt/gwt-2.8.1/doc/javadoc/"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.8.1/gwt-codeserver.jar">
|
||||
<attributes>
|
||||
<attribute name="javadoc_location" value="file:/home/giancarlo/gwt/gwt-2.8.1/doc/javadoc/"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.8.1/gwt-dev.jar">
|
||||
<attributes>
|
||||
<attribute name="javadoc_location" value="file:/home/giancarlo/gwt/gwt-2.8.1/doc/javadoc/"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.8.1/validation-api-1.0.0.GA.jar" sourcepath="/home/giancarlo/gwt/gwt-2.8.1/validation-api-1.0.0.GA-sources.jar"/>
|
||||
<classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.8.1/validation-api-1.0.0.GA-sources.jar"/>
|
||||
<classpathentry kind="output" path="target/data-miner-manager-tester-1.0.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
</classpath>
|
|
@ -0,0 +1,2 @@
|
|||
/target/
|
||||
/test.log
|
|
@ -0,0 +1,64 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>data-miner-manager-tester</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.common.project.facet.core.builder</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.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
<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.wst.common.project.facet.core.nature</nature>
|
||||
<nature>com.google.gwt.eclipse.core.gwtNature</nature>
|
||||
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -0,0 +1,3 @@
|
|||
eclipse.preferences.version=1
|
||||
googleCloudSqlEnabled=false
|
||||
localDevMySqlEnabled=true
|
|
@ -0,0 +1,4 @@
|
|||
eclipse.preferences.version=1
|
||||
jarsExcludedFromWebInfLib=
|
||||
warSrcDir=src/main/webapp
|
||||
warSrcDirIsOutput=false
|
|
@ -0,0 +1,2 @@
|
|||
eclipse.preferences.version=1
|
||||
entryPointModules=org.gcube.portlets.user.dataminermanagertester.dataminermanagertester
|
|
@ -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,8 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
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.8
|
|
@ -0,0 +1,4 @@
|
|||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
<wb-module deploy-name="data-miner-manager-tester-1.0.0-SNAPSHOT">
|
||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||
<property name="java-output-path" value="/data-miner-manager/target/data-miner-manager-1.2.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
<property name="context-root" value="data-miner-manager-tester"/>
|
||||
</wb-module>
|
||||
</project-modules>
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faceted-project>
|
||||
<fixed facet="wst.jsdt.web"/>
|
||||
<installed facet="jst.web" version="3.0"/>
|
||||
<installed facet="wst.jsdt.web" version="1.0"/>
|
||||
<installed facet="java" version="1.8"/>
|
||||
</faceted-project>
|
|
@ -0,0 +1,2 @@
|
|||
disabled=06target
|
||||
eclipse.preferences.version=1
|
|
@ -0,0 +1 @@
|
|||
${gcube.license***REMOVED***
|
|
@ -0,0 +1,68 @@
|
|||
The gCube System - ${name***REMOVED***
|
||||
--------------------------------------------------
|
||||
|
||||
${description***REMOVED***
|
||||
|
||||
|
||||
${gcube.description***REMOVED***
|
||||
|
||||
${gcube.funding***REMOVED***
|
||||
|
||||
|
||||
Version
|
||||
--------------------------------------------------
|
||||
|
||||
${version***REMOVED*** (${buildDate***REMOVED***)
|
||||
|
||||
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***REMOVED***
|
||||
|
||||
Binaries can be downloaded from the gCube website:
|
||||
${gcube.website***REMOVED***
|
||||
|
||||
|
||||
Installation
|
||||
--------------------------------------------------
|
||||
|
||||
Installation documentation is available on-line in the gCube Wiki:
|
||||
https://gcube.wiki.gcube-system.org/gcube/Data_Miner_Manager
|
||||
|
||||
|
||||
Documentation
|
||||
--------------------------------------------------
|
||||
|
||||
Documentation is available on-line in the gCube Wiki:
|
||||
https://gcube.wiki.gcube-system.org/gcube/Data_Miner_Manager
|
||||
|
||||
|
||||
Support
|
||||
--------------------------------------------------
|
||||
|
||||
Bugs and support requests can be reported in the gCube issue tracking tool:
|
||||
${gcube.issueTracking***REMOVED***
|
||||
|
||||
|
||||
Licensing
|
||||
--------------------------------------------------
|
||||
|
||||
This software is licensed under the terms you may find in the file named "LICENSE" in this directory.
|
|
@ -0,0 +1,32 @@
|
|||
<ReleaseNotes>
|
||||
<Changeset component="org.gcube.portlets-user.data-miner-manager.1-5-0"
|
||||
date="2016-06-12">
|
||||
<Change>Support Java 8 compatibility [ticket #8471]</Change>
|
||||
</Changeset>
|
||||
<Changeset component="org.gcube.portlets-user.data-miner-manager.1-4-0"
|
||||
date="2016-02-15">
|
||||
<Change>Fixed load balancing [ticket #7576]</Change>
|
||||
</Changeset>
|
||||
<Changeset component="org.gcube.portlets-user.data-miner-manager.1-3-0"
|
||||
date="2016-02-15">
|
||||
<Change>Updated PortalContext [ticket #6278]</Change>
|
||||
<Change>Added encoded parameters in equivalent http request [ticket
|
||||
#7167]
|
||||
</Change>
|
||||
</Changeset>
|
||||
<Changeset component="org.gcube.portlets-user.data-miner-manager.1-2-0"
|
||||
date="2016-12-01">
|
||||
<Change>Updated Output support</Change>
|
||||
<Change>Added PortalContext</Change>
|
||||
</Changeset>
|
||||
<Changeset component="org.gcube.portlets-user.data-miner-manager.1-1-0"
|
||||
date="2016-10-01">
|
||||
<Change>Updated to Auth 2.0</Change>
|
||||
<Change>Added Spatial data support [Ticket #4172]</Change>
|
||||
<Change>Added Temporal data support [Ticket #4172]</Change>
|
||||
</Changeset>
|
||||
<Changeset component="org.gcube.portlets-user.data-miner-manager.1-0-0"
|
||||
date="2016-07-01">
|
||||
<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***REMOVED***</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***REMOVED***.${project.packaging***REMOVED***</source>
|
||||
<outputDirectory>/${artifactId***REMOVED***</outputDirectory>
|
||||
</file>
|
||||
|
||||
</files>
|
||||
</assembly>
|
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Resource>
|
||||
<ID></ID>
|
||||
<Type>Service</Type>
|
||||
<Profile>
|
||||
<Description>${project.description***REMOVED***</Description>
|
||||
<Class>PortletsUser</Class>
|
||||
<Name>${project.artifactId***REMOVED***</Name>
|
||||
<Version>1.0.0</Version>
|
||||
<Packages>
|
||||
<Software>
|
||||
<Description>${project.description***REMOVED***</Description>
|
||||
<Name>${project.artifactId***REMOVED***</Name>
|
||||
<Version>${version***REMOVED***</Version>
|
||||
<MavenCoordinates>
|
||||
<groupId>${project.groupId***REMOVED***</groupId>
|
||||
<artifactId>${project.artifactId***REMOVED***</artifactId>
|
||||
<version>${project.version***REMOVED***</version>
|
||||
</MavenCoordinates>
|
||||
<Type>webapplication</Type>
|
||||
<Files>
|
||||
<File>${project.build.finalName***REMOVED***.${project.packaging***REMOVED***</File>
|
||||
</Files>
|
||||
</Software>
|
||||
</Packages>
|
||||
</Profile>
|
||||
</Resource>
|
||||
|
||||
|
|
@ -0,0 +1,435 @@
|
|||
<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/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
<parent>
|
||||
<artifactId>maven-parent</artifactId>
|
||||
<groupId>org.gcube.tools</groupId>
|
||||
<version>1.0.0</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<groupId>org.gcube.portlets.user</groupId>
|
||||
<artifactId>data-miner-manager-tester</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<name>data-miner-manager-tester</name>
|
||||
<description>data-miner-manager-tester offers test support for dataminer service</description>
|
||||
|
||||
<scm>
|
||||
<url>https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/data-miner-manager-tester</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***REMOVED***/${project.build.finalName***REMOVED***</webappDirectory>
|
||||
<distroDirectory>distro</distroDirectory>
|
||||
<configDirectory>config</configDirectory>
|
||||
|
||||
|
||||
<!-- Java -->
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
|
||||
<!-- GWT configuration -->
|
||||
<gwt.version>2.8.2</gwt.version>
|
||||
<gwtp.version>1.6</gwtp.version>
|
||||
<gin.version>2.1.2</gin.version>
|
||||
<!-- <gwt-material.version>2.0-rc5</gwt-material.version> -->
|
||||
<!-- <gwt-material-table.version>2.0-rc5</gwt-material-table.version> -->
|
||||
<gwt-material.version>2.3.0</gwt-material.version>
|
||||
<gwt-material-table.version>2.3.0</gwt-material-table.version>
|
||||
<gwt.style>OBF</gwt.style>
|
||||
|
||||
<gwt.runTarget>DataMinerManagerTester.html</gwt.runTarget>
|
||||
<gwt.module.name>
|
||||
org.gcube.portlets.user.dataminermanagertester.dataminermanagertester
|
||||
</gwt.module.name>
|
||||
|
||||
<!-- maven -->
|
||||
<maven-war-plugin.version>2.6</maven-war-plugin.version>
|
||||
<maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>
|
||||
|
||||
<KEYS>${env.KEYS***REMOVED***</KEYS>
|
||||
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
</properties>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>localRun</id>
|
||||
<dependencies>
|
||||
<!-- Logger -->
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Authorization -->
|
||||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>common-authorization</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>authorization-client</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- javax.servlet-api -->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- GWT -->
|
||||
<dependency>
|
||||
<groupId>com.google.gwt</groupId>
|
||||
<artifactId>gwt-servlet</artifactId>
|
||||
<version>${gwt.version***REMOVED***</version>
|
||||
<scope>runtime</scope>
|
||||
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.gwt</groupId>
|
||||
<artifactId>gwt-user</artifactId>
|
||||
<version>${gwt.version***REMOVED***</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.gwt</groupId>
|
||||
<artifactId>gwt-dev</artifactId>
|
||||
<version>${gwt.version***REMOVED***</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- JDT -->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- GWTP -->
|
||||
<dependency>
|
||||
<groupId>com.gwtplatform</groupId>
|
||||
<artifactId>gwtp-mvp-client</artifactId>
|
||||
<version>${gwtp.version***REMOVED***</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- GwtMaterial -->
|
||||
<dependency>
|
||||
<groupId>com.github.gwtmaterialdesign</groupId>
|
||||
<artifactId>gwt-material</artifactId>
|
||||
<version>${gwt-material.version***REMOVED***</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.gwtmaterialdesign</groupId>
|
||||
<artifactId>gwt-material-themes</artifactId>
|
||||
<version>${gwt-material.version***REMOVED***</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.gwtmaterialdesign</groupId>
|
||||
<artifactId>gwt-material-addins</artifactId>
|
||||
<version>${gwt-material.version***REMOVED***</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.gwtmaterialdesign</groupId>
|
||||
<artifactId>gwt-material-table</artifactId>
|
||||
<version>${gwt-material-table.version***REMOVED***</version>
|
||||
</dependency>
|
||||
<!-- DI -->
|
||||
<dependency>
|
||||
<groupId>com.google.gwt.inject</groupId>
|
||||
<artifactId>gin</artifactId>
|
||||
<version>${gin.version***REMOVED***</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Portlet -->
|
||||
<dependency>
|
||||
<groupId>javax.portlet</groupId>
|
||||
<artifactId>portlet-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Liferay -->
|
||||
<dependency>
|
||||
<groupId>com.liferay.portal</groupId>
|
||||
<artifactId>portal-service</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- PORTAL -->
|
||||
<dependency>
|
||||
<groupId>org.gcube.core</groupId>
|
||||
<artifactId>common-scope-maps</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.gcube.common.portal</groupId>
|
||||
<artifactId>portal-manager</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.gcube.dvos</groupId>
|
||||
<artifactId>usermanagement-core</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.gcube.portal</groupId>
|
||||
<artifactId>client-context-library</artifactId>
|
||||
<version>[1.0.0-SNAPSHOT,)</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<!-- Authorization -->
|
||||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>common-authorization</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>authorization-client</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Nord52 -->
|
||||
<dependency>
|
||||
<groupId>org.n52.wps</groupId>
|
||||
<artifactId>52n-wps-client-lib</artifactId>
|
||||
<version>[3.3.1,3.3.3)</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>gt-opengis</artifactId>
|
||||
<groupId>org.geotools</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<!-- DataMinerManagerCL -->
|
||||
<dependency>
|
||||
<groupId>org.gcube.data.analysis</groupId>
|
||||
<artifactId>data-miner-manager-cl</artifactId>
|
||||
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||
</dependency>
|
||||
|
||||
<!-- XML Apis -->
|
||||
<dependency>
|
||||
<groupId>xml-apis</groupId>
|
||||
<artifactId>xml-apis</artifactId>
|
||||
<version>1.4.01</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- LOGGING -->
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- JUnit -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>gCubeExternal</id>
|
||||
<name>gcube-externals</name>
|
||||
<url>http://maven.research-infrastructures.eu/nexus/content/repositories/gcube-externals/</url>
|
||||
</repository>
|
||||
|
||||
<repository>
|
||||
<id>n52-releases</id>
|
||||
<name>52n Releases</name>
|
||||
<url>http://52north.org/maven/repo/releases/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
|
||||
<!-- <repository> -->
|
||||
<!-- <id>52north-releases</id> -->
|
||||
<!-- <name>52north-releases</name> -->
|
||||
<!-- <url>http://maven.research-infrastructures.eu/nexus/content/repositories/52north-releases/</url> -->
|
||||
<!-- </repository> -->
|
||||
|
||||
</repositories>
|
||||
|
||||
<build>
|
||||
<!-- Generate compiled stuff in the folder used for developing mode -->
|
||||
<outputDirectory>${webappDirectory***REMOVED***/WEB-INF/classes</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
|
||||
|
||||
<plugins>
|
||||
|
||||
<!-- GWT -->
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>gwt-maven-plugin</artifactId>
|
||||
<version>${gwt.version***REMOVED***</version>
|
||||
<configuration>
|
||||
<strict>true</strict>
|
||||
<testTimeOut>180</testTimeOut>
|
||||
<mode>htmlunit</mode>
|
||||
<includes>**/*GwtTest.java</includes>
|
||||
<logLevel>INFO</logLevel>
|
||||
<runTarget>${gwt.runTarget***REMOVED***</runTarget>
|
||||
<hostedWebapp>${webappDirectory***REMOVED***</hostedWebapp>
|
||||
<module>${gwt.module.name***REMOVED***</module>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
<goal>test</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- Copy static web files before executing gwt:run -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>2.1.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>compile</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<webappDirectory>${webappDirectory***REMOVED***</webappDirectory>
|
||||
<warName>${project.build.finalName***REMOVED***</warName>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- Maven Compiler Plugin -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${maven-compiler-plugin.version***REMOVED***</version>
|
||||
<configuration>
|
||||
<source>${maven.compiler.source***REMOVED***</source>
|
||||
<target>${maven.compiler.target***REMOVED***</target>
|
||||
<encoding>${project.build.sourceEncoding***REMOVED***</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>${distroDirectory***REMOVED***/descriptor.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>servicearchive</id>
|
||||
<phase>install</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,33 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application;
|
||||
|
||||
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.application.diff.OperatorsDiffModule;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.application.help.HelpModule;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.application.home.HomeModule;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.application.menu.MenuModule;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.application.testbatchconfig.TestBatchConfModule;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.application.testconfig.TestConfModule;
|
||||
|
||||
import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class ApplicationModule extends AbstractPresenterModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
install(new MenuModule());
|
||||
install(new HomeModule());
|
||||
install(new HelpModule());
|
||||
install(new TestConfModule());
|
||||
install(new TestBatchConfModule());
|
||||
install(new OperatorsDiffModule());
|
||||
|
||||
bindPresenter(ApplicationPresenter.class, ApplicationPresenter.PresenterView.class, ApplicationView.class,
|
||||
ApplicationPresenter.PresenterProxy.class);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
|
@ -0,0 +1,102 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.application.menu.MenuPresenter;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.rpc.DataMinerTesterServiceAsync;
|
||||
***REMOVED***
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.session.UserInfo;
|
||||
|
||||
import com.google.gwt.core.shared.GWT;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.gwtplatform.mvp.client.Presenter;
|
||||
import com.gwtplatform.mvp.client.View;
|
||||
import com.gwtplatform.mvp.client.annotations.ProxyStandard;
|
||||
import com.gwtplatform.mvp.client.presenter.slots.NestedSlot;
|
||||
import com.gwtplatform.mvp.client.presenter.slots.PermanentSlot;
|
||||
import com.gwtplatform.mvp.client.proxy.NavigationEvent;
|
||||
import com.gwtplatform.mvp.client.proxy.NavigationHandler;
|
||||
import com.gwtplatform.mvp.client.proxy.Proxy;
|
||||
|
||||
import gwt.material.design.client.ui.MaterialLoader;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class ApplicationPresenter
|
||||
extends Presenter<ApplicationPresenter.PresenterView, ApplicationPresenter.PresenterProxy>
|
||||
implements NavigationHandler {
|
||||
interface PresenterView extends View {
|
||||
***REMOVED***
|
||||
|
||||
@ProxyStandard
|
||||
interface PresenterProxy extends Proxy<ApplicationPresenter> {
|
||||
***REMOVED***
|
||||
|
||||
public static final PermanentSlot<MenuPresenter> SLOT_MENU = new PermanentSlot<>();
|
||||
public static final NestedSlot SLOT_MAIN = new NestedSlot();
|
||||
|
||||
private MenuPresenter menuPresenter;
|
||||
private DataMinerTesterServiceAsync service;
|
||||
|
||||
@Inject
|
||||
ApplicationPresenter(EventBus eventBus, PresenterView view, PresenterProxy proxy, MenuPresenter menuPresenter,
|
||||
DataMinerTesterServiceAsync service) {
|
||||
super(eventBus, view, proxy, RevealType.Root);
|
||||
this.menuPresenter = menuPresenter;
|
||||
this.service = service;
|
||||
callHello();
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
protected void onBind() {
|
||||
super.onBind();
|
||||
|
||||
setInSlot(SLOT_MENU, menuPresenter);
|
||||
addRegisteredHandler(NavigationEvent.getType(), this);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
protected void onReveal() {
|
||||
super.onReveal();
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void onNavigation(NavigationEvent navigationEvent) {
|
||||
Window.scrollTo(0, 0);
|
||||
// PlaceRequest placeRequest=navigationEvent.getRequest();
|
||||
// placeManager.revealPlace(placeRequest);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
private void callHello() {
|
||||
/* String groupId= GCubeClientContext.getCurrentContextId(); */
|
||||
|
||||
String token = Window.Location.getParameter(Constants.TOKEN);
|
||||
GWT.log("Token: " + token);
|
||||
|
||||
MaterialLoader.loading(true);
|
||||
service.hello(token,new AsyncCallback<UserInfo>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
MaterialLoader.loading(false);
|
||||
GWT.log("Error in Hello: ", caught);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void onSuccess(UserInfo result) {
|
||||
GWT.log("Hello: " + result.getUsername());
|
||||
MaterialLoader.loading(false);
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,34 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application;
|
||||
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.gwtplatform.mvp.client.ViewImpl;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class ApplicationView extends ViewImpl implements ApplicationPresenter.PresenterView {
|
||||
interface Binder extends UiBinder<Widget, ApplicationView> {
|
||||
***REMOVED***
|
||||
|
||||
@UiField
|
||||
HTMLPanel menu;
|
||||
@UiField
|
||||
HTMLPanel main;
|
||||
|
||||
@Inject
|
||||
ApplicationView(Binder uiBinder) {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
bindSlot(ApplicationPresenter.SLOT_MENU, menu);
|
||||
bindSlot(ApplicationPresenter.SLOT_MAIN, main);
|
||||
***REMOVED***
|
||||
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,17 @@
|
|||
<!-- @Author Giancarlo Panichi -->
|
||||
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
|
||||
xmlns:g='urn:import:com.google.gwt.user.client.ui' xmlns:m="urn:import:gwt.material.design.client.ui"
|
||||
xmlns:ma="urn:import:gwt.material.design.addins.client">
|
||||
|
||||
<ui:with field="res"
|
||||
type="org.gcube.portlets.user.dataminermanagertester.client.resources.AppResources" />
|
||||
|
||||
|
||||
<g:HTMLPanel>
|
||||
<g:HTMLPanel ui:field="menu" />
|
||||
<m:MaterialContainer>
|
||||
<g:HTMLPanel ui:field="main" />
|
||||
</m:MaterialContainer>
|
||||
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
|
@ -0,0 +1,21 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.custom;
|
||||
|
||||
import com.google.gwt.cell.client.AbstractCell;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SelectableTextCell extends AbstractCell<String> {
|
||||
|
||||
@Override
|
||||
public void render(Context context, String value, SafeHtmlBuilder sb) {
|
||||
if (value != null) {
|
||||
sb.appendHtmlConstant("<div unselectable='false' >" + value + "</div>");
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,16 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.diff;
|
||||
|
||||
import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class OperatorsDiffModule extends AbstractPresenterModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bindPresenter(OperatorsDiffPresenter.class, OperatorsDiffPresenter.PresenterView.class,
|
||||
OperatorsDiffView.class, OperatorsDiffPresenter.PresenterProxy.class);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
|
@ -0,0 +1,88 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.diff;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.application.ApplicationPresenter;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.place.NameTokens;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.rpc.DataMinerTesterServiceAsync;
|
||||
***REMOVED***
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.DMDiffConfig;
|
||||
|
||||
import com.google.gwt.core.shared.GWT;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.gwtplatform.mvp.client.HasUiHandlers;
|
||||
import com.gwtplatform.mvp.client.Presenter;
|
||||
import com.gwtplatform.mvp.client.View;
|
||||
import com.gwtplatform.mvp.client.annotations.NameToken;
|
||||
import com.gwtplatform.mvp.client.annotations.NoGatekeeper;
|
||||
import com.gwtplatform.mvp.client.annotations.ProxyStandard;
|
||||
import com.gwtplatform.mvp.client.proxy.ProxyPlace;
|
||||
|
||||
import gwt.material.design.client.ui.MaterialLoader;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class OperatorsDiffPresenter
|
||||
extends Presenter<OperatorsDiffPresenter.PresenterView, OperatorsDiffPresenter.PresenterProxy>
|
||||
implements OperatorsDiffUiHandlers {
|
||||
interface PresenterView extends View, HasUiHandlers<OperatorsDiffUiHandlers> {
|
||||
void setResult(String result, boolean success);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@ProxyStandard
|
||||
@NameToken(NameTokens.DIFF)
|
||||
@NoGatekeeper
|
||||
interface PresenterProxy extends ProxyPlace<OperatorsDiffPresenter> {
|
||||
***REMOVED***
|
||||
|
||||
private DataMinerTesterServiceAsync service;
|
||||
|
||||
@Inject
|
||||
OperatorsDiffPresenter(EventBus eventBus, PresenterView view, PresenterProxy proxy,
|
||||
DataMinerTesterServiceAsync service) {
|
||||
super(eventBus, view, proxy, ApplicationPresenter.SLOT_MAIN);
|
||||
this.service = service;
|
||||
getView().setUiHandlers(this);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void executeDiff(DMDiffConfig operatorsDiffConfig) {
|
||||
callOperatorsDiff(operatorsDiffConfig);
|
||||
***REMOVED***
|
||||
|
||||
private void callOperatorsDiff(DMDiffConfig operatorsDiffConfig) {
|
||||
MaterialLoader.loading(true);
|
||||
service.getOperatorsDiff(getToken(), operatorsDiffConfig, new AsyncCallback<String>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
GWT.log("Error in diff: ", caught);
|
||||
String result = SafeHtmlUtils.htmlEscape(caught.getLocalizedMessage());
|
||||
MaterialLoader.loading(false);
|
||||
getView().setResult(result, false);
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void onSuccess(String result) {
|
||||
MaterialLoader.loading(false);
|
||||
getView().setResult(result, true);
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
private String getToken() {
|
||||
String token = Window.Location.getParameter(Constants.TOKEN);
|
||||
GWT.log("Token: " + token);
|
||||
return token;
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,16 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.diff;
|
||||
|
||||
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.DMDiffConfig;
|
||||
|
||||
import com.gwtplatform.mvp.client.UiHandlers;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
interface OperatorsDiffUiHandlers extends UiHandlers {
|
||||
|
||||
void executeDiff(DMDiffConfig operatorsDiffConfig);
|
||||
***REMOVED***
|
|
@ -0,0 +1,118 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.diff;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.DMDiffConfig;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.ProtocolType;
|
||||
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.uibinder.client.UiHandler;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.gwtplatform.mvp.client.ViewWithUiHandlers;
|
||||
|
||||
import gwt.material.design.client.constants.Color;
|
||||
import gwt.material.design.client.constants.IconType;
|
||||
import gwt.material.design.client.ui.MaterialButton;
|
||||
import gwt.material.design.client.ui.MaterialListBox;
|
||||
import gwt.material.design.client.ui.MaterialTextArea;
|
||||
import gwt.material.design.client.ui.MaterialTextBox;
|
||||
import gwt.material.design.client.ui.animate.MaterialAnimation;
|
||||
import gwt.material.design.client.ui.animate.Transition;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
class OperatorsDiffView extends ViewWithUiHandlers<OperatorsDiffUiHandlers>
|
||||
implements OperatorsDiffPresenter.PresenterView {
|
||||
interface Binder extends UiBinder<Widget, OperatorsDiffView> {
|
||||
***REMOVED***
|
||||
|
||||
@UiField
|
||||
MaterialTextBox dm1;
|
||||
|
||||
@UiField
|
||||
MaterialTextBox token1;
|
||||
|
||||
@UiField
|
||||
MaterialTextBox dm2;
|
||||
|
||||
@UiField
|
||||
MaterialTextBox token2;
|
||||
|
||||
@UiField
|
||||
MaterialListBox protocolType;
|
||||
|
||||
@UiField
|
||||
MaterialTextArea result;
|
||||
|
||||
@UiField
|
||||
MaterialButton resultIcon;
|
||||
|
||||
@UiField
|
||||
MaterialButton run;
|
||||
|
||||
@Inject
|
||||
OperatorsDiffView(Binder uiBinder) {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
protocolType.clear();
|
||||
for (ProtocolType tType : ProtocolType.values()) {
|
||||
protocolType.add(tType.getLabel());
|
||||
***REMOVED***
|
||||
|
||||
dm1.setAllowBlank(false);
|
||||
token1.setAllowBlank(false);
|
||||
dm2.setAllowBlank(false);
|
||||
token2.setAllowBlank(false);
|
||||
***REMOVED***
|
||||
|
||||
@UiHandler("run")
|
||||
void onClick(ClickEvent e) {
|
||||
if (!dm1.validate() || !token1.validate() || !dm2.validate() || !token2.validate()) {
|
||||
return;
|
||||
***REMOVED***
|
||||
|
||||
String dm1Value = dm1.getValue();
|
||||
String token1Value = token1.getValue();
|
||||
String dm2Value = dm2.getValue();
|
||||
String token2Value = token2.getValue();
|
||||
String protocolValue = protocolType.getValue();
|
||||
|
||||
resultIcon.setVisible(false);
|
||||
result.setVisible(false);
|
||||
|
||||
|
||||
DMDiffConfig operatorsDiffConfig = new DMDiffConfig(dm1Value, token1Value, dm2Value,
|
||||
token2Value, protocolValue);
|
||||
getUiHandlers().executeDiff(operatorsDiffConfig);
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void setResult(String resultValue, boolean success) {
|
||||
resultIcon.setVisible(true);
|
||||
result.setVisible(true);
|
||||
if (success) {
|
||||
resultIcon.setIconType(IconType.CHECK_CIRCLE);
|
||||
resultIcon.setBackgroundColor(Color.GREEN);
|
||||
resultIcon.setIconFontSize(4.0, Unit.EM);
|
||||
***REMOVED*** else {
|
||||
resultIcon.setIconType(IconType.ERROR);
|
||||
resultIcon.setBackgroundColor(Color.RED);
|
||||
resultIcon.setIconFontSize(4.0, Unit.EM);
|
||||
***REMOVED***
|
||||
MaterialAnimation animation = new MaterialAnimation();
|
||||
animation.setDelay(0);
|
||||
animation.setDuration(1000);
|
||||
animation.transition(Transition.FLIPINX);
|
||||
animation.animate(resultIcon);
|
||||
|
||||
result.setLength(resultValue.length());
|
||||
result.setValue(resultValue);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,37 @@
|
|||
<!-- @Author Giancarlo Panichi -->
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:m="urn:import:gwt.material.design.client.ui"
|
||||
xmlns:ma="urn:import:gwt.material.design.addins.client" xmlns:m.table="urn:import:gwt.material.design.client.ui.table"
|
||||
xmlns:m.html="urn:import:gwt.material.design.client.ui.html">
|
||||
|
||||
<ui:with field="res"
|
||||
type="org.gcube.portlets.user.dataminermanagertester.client.resources.AppResources" />
|
||||
|
||||
<m:MaterialPanel textAlign="CENTER" paddingTop="60"
|
||||
paddingLeft="20" paddingRight="20">
|
||||
|
||||
<m:MaterialTitle title="Diff" description="Set DataMiner Diff info" />
|
||||
<m:MaterialTextBox ui:field="dm1" title="DataMiner 1"
|
||||
placeholder="dataminer1-d-d4s.d4science.org" label="DataMiner 1"
|
||||
active="true" grid="s12" />
|
||||
<m:MaterialTextBox ui:field="token1" title="Token 1"
|
||||
placeholder="" label="Token 1" active="true" grid="s12" />
|
||||
<m:MaterialTextBox ui:field="dm2" title="DataMiner 2"
|
||||
placeholder="dataminer2-d-d4s.d4science.org" label="DataMiner 2"
|
||||
active="true" grid="s12" />
|
||||
<m:MaterialTextBox ui:field="token2" title="Token 2"
|
||||
placeholder="" label="Token 2" active="true" grid="s12" />
|
||||
<m:MaterialListBox ui:field="protocolType"
|
||||
placeholder="Protocol type">
|
||||
<m.html:Option text="Protocol" />
|
||||
</m:MaterialListBox>
|
||||
<m:MaterialButton ui:field="run" text="Run" waves="LIGHT"
|
||||
textColor="WHITE" iconType="STARS" iconPosition="LEFT" />
|
||||
<m:MaterialTextArea ui:field="result" visible="false"
|
||||
label="Test Result" resizeRule="AUTO" />
|
||||
<m:MaterialButton ui:field="resultIcon" visible="false"
|
||||
width="100px" height="100px" type="FLOATING" size="LARGE" iconType="CHECK_CIRCLE" />
|
||||
</m:MaterialPanel>
|
||||
|
||||
</ui:UiBinder>
|
|
@ -0,0 +1,12 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.help;
|
||||
|
||||
|
||||
import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
|
||||
|
||||
public class HelpModule extends AbstractPresenterModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bindPresenter(HelpPresenter.class, HelpPresenter.PresenterView.class,
|
||||
HelpView.class, HelpPresenter.PresenterProxy.class);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
|
@ -0,0 +1,36 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.help;
|
||||
|
||||
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.application.ApplicationPresenter;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.place.NameTokens;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.gwtplatform.mvp.client.Presenter;
|
||||
import com.gwtplatform.mvp.client.View;
|
||||
import com.gwtplatform.mvp.client.annotations.NameToken;
|
||||
import com.gwtplatform.mvp.client.annotations.ProxyStandard;
|
||||
import com.gwtplatform.mvp.client.proxy.ProxyPlace;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class HelpPresenter extends Presenter<HelpPresenter.PresenterView, HelpPresenter.PresenterProxy> {
|
||||
interface PresenterView extends View {
|
||||
***REMOVED***
|
||||
|
||||
@ProxyStandard
|
||||
@NameToken(NameTokens.HELP)
|
||||
interface PresenterProxy extends ProxyPlace<HelpPresenter> {
|
||||
***REMOVED***
|
||||
|
||||
@Inject
|
||||
HelpPresenter(EventBus eventBus, PresenterView view, PresenterProxy proxy) {
|
||||
super(eventBus, view, proxy, ApplicationPresenter.SLOT_MAIN);
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,24 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.help;
|
||||
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.gwtplatform.mvp.client.ViewImpl;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
class HelpView extends ViewImpl implements HelpPresenter.PresenterView {
|
||||
interface Binder extends UiBinder<Widget, HelpView> {
|
||||
***REMOVED***
|
||||
|
||||
@Inject
|
||||
HelpView(Binder uiBinder) {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,16 @@
|
|||
<!-- @Author Giancarlo Panichi -->
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g='urn:import:com.google.gwt.user.client.ui' xmlns:m="urn:import:gwt.material.design.client.ui"
|
||||
xmlns:ma="urn:import:gwt.material.design.addins.client">
|
||||
|
||||
<ui:with field="res"
|
||||
type="org.gcube.portlets.user.dataminermanagertester.client.resources.AppResources" />
|
||||
|
||||
|
||||
<m:MaterialPanel textAlign="CENTER" paddingTop="80"
|
||||
paddingLeft="20" paddingRight="20">
|
||||
<m:MaterialTitle title="Help DataMiner Manager Tester" />
|
||||
</m:MaterialPanel>
|
||||
|
||||
</ui:UiBinder>
|
|
@ -0,0 +1,16 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.home;
|
||||
|
||||
|
||||
import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class HomeModule extends AbstractPresenterModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bindPresenter(HomePresenter.class, HomePresenter.PresenterView.class, HomeView.class, HomePresenter.PresenterProxy.class);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
|
@ -0,0 +1,42 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.home;
|
||||
|
||||
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.application.ApplicationPresenter;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.place.NameTokens;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.gwtplatform.mvp.client.HasUiHandlers;
|
||||
import com.gwtplatform.mvp.client.Presenter;
|
||||
import com.gwtplatform.mvp.client.View;
|
||||
import com.gwtplatform.mvp.client.annotations.NameToken;
|
||||
import com.gwtplatform.mvp.client.annotations.NoGatekeeper;
|
||||
import com.gwtplatform.mvp.client.annotations.ProxyStandard;
|
||||
import com.gwtplatform.mvp.client.proxy.ProxyPlace;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class HomePresenter extends Presenter<HomePresenter.PresenterView, HomePresenter.PresenterProxy>
|
||||
implements HomeUiHandlers {
|
||||
interface PresenterView extends View, HasUiHandlers<HomePresenter> {
|
||||
***REMOVED***
|
||||
|
||||
@ProxyStandard
|
||||
@NameToken(NameTokens.HOME)
|
||||
@NoGatekeeper
|
||||
interface PresenterProxy extends ProxyPlace<HomePresenter> {
|
||||
***REMOVED***
|
||||
|
||||
@Inject
|
||||
HomePresenter(EventBus eventBus, PresenterView view, PresenterProxy proxy) {
|
||||
super(eventBus, view, proxy, ApplicationPresenter.SLOT_MAIN);
|
||||
|
||||
getView().setUiHandlers(this);
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,13 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.home;
|
||||
|
||||
|
||||
import com.gwtplatform.mvp.client.UiHandlers;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public interface HomeUiHandlers extends UiHandlers{
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,23 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.home;
|
||||
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.gwtplatform.mvp.client.ViewWithUiHandlers;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class HomeView extends ViewWithUiHandlers<HomePresenter> implements HomePresenter.PresenterView {
|
||||
interface Binder extends UiBinder<Widget, HomeView> {
|
||||
***REMOVED***
|
||||
|
||||
@Inject
|
||||
HomeView(Binder uiBinder) {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
***REMOVED***
|
||||
***REMOVED***
|
|
@ -0,0 +1,14 @@
|
|||
<!-- @Author Giancarlo Panichi -->
|
||||
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
|
||||
xmlns:g='urn:import:com.google.gwt.user.client.ui' xmlns:m="urn:import:gwt.material.design.client.ui"
|
||||
xmlns:ma="urn:import:gwt.material.design.addins.client">
|
||||
|
||||
<ui:with field="res"
|
||||
type="org.gcube.portlets.user.dataminermanagertester.client.resources.AppResources" />
|
||||
|
||||
<m:MaterialPanel textAlign="CENTER" paddingTop="80">
|
||||
<m:MaterialTitle title="DataMiner Manager Tester"
|
||||
description="Tester for DataMiner services" />
|
||||
</m:MaterialPanel>
|
||||
|
||||
</ui:UiBinder>
|
|
@ -0,0 +1,16 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.menu;
|
||||
|
||||
|
||||
import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class MenuModule extends AbstractPresenterModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bindSingletonPresenterWidget(MenuPresenter.class, MenuPresenter.PresenterView.class, MenuView.class);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
|
@ -0,0 +1,47 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.menu;
|
||||
|
||||
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.event.ContentPushEvent;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.gwtplatform.mvp.client.HasUiHandlers;
|
||||
import com.gwtplatform.mvp.client.PresenterWidget;
|
||||
import com.gwtplatform.mvp.client.View;
|
||||
import com.gwtplatform.mvp.client.proxy.NavigationEvent;
|
||||
import com.gwtplatform.mvp.client.proxy.NavigationHandler;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class MenuPresenter extends PresenterWidget<MenuPresenter.PresenterView> implements MenuUiHandlers, NavigationHandler {
|
||||
interface PresenterView extends View, HasUiHandlers<MenuUiHandlers> {
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Inject
|
||||
MenuPresenter(EventBus eventBus, PresenterView view) {
|
||||
super(eventBus, view);
|
||||
getView().setUiHandlers(this);
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
protected void onBind() {
|
||||
super.onBind();
|
||||
addRegisteredHandler(NavigationEvent.getType(), this);
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void setContentPush() {
|
||||
ContentPushEvent.fire(this);
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void onNavigation(NavigationEvent navigationEvent) {
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,14 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.menu;
|
||||
|
||||
|
||||
import com.gwtplatform.mvp.client.UiHandlers;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
interface MenuUiHandlers extends UiHandlers {
|
||||
|
||||
void setContentPush();
|
||||
***REMOVED***
|
|
@ -0,0 +1,41 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.menu;
|
||||
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.gwtplatform.mvp.client.ViewWithUiHandlers;
|
||||
|
||||
import gwt.material.design.client.ui.MaterialHeader;
|
||||
import gwt.material.design.client.ui.MaterialNavBar;
|
||||
import gwt.material.design.client.ui.MaterialSideNavPush;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
class MenuView extends ViewWithUiHandlers<MenuUiHandlers> implements MenuPresenter.PresenterView {
|
||||
|
||||
interface Binder extends UiBinder<Widget, MenuView> {
|
||||
***REMOVED***
|
||||
|
||||
@UiField
|
||||
MaterialHeader header;
|
||||
@UiField
|
||||
MaterialNavBar navBar;
|
||||
@UiField
|
||||
MaterialSideNavPush sideNav;
|
||||
|
||||
@Inject
|
||||
MenuView(Binder uiBinder) {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
|
||||
sideNav.addOpenedHandler(event -> getUiHandlers().setContentPush());
|
||||
sideNav.addClosedHandler(event -> getUiHandlers().setContentPush());
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,41 @@
|
|||
<!-- @Author Giancarlo Panichi -->
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:m="urn:import:gwt.material.design.client.ui" xmlns:ma="urn:import:gwt.material.design.addins.client"
|
||||
xmlns:m.html="urn:import:gwt.material.design.client.ui.html">
|
||||
<ui:with field="tokens"
|
||||
type="org.gcube.portlets.user.dataminermanagertester.client.place.NameTokens" />
|
||||
<ui:with field="res"
|
||||
type="org.gcube.portlets.user.dataminermanagertester.client.resources.AppResources" />
|
||||
|
||||
<m:MaterialPanel>
|
||||
<m:MaterialHeader ui:field="header">
|
||||
<m:MaterialNavBar ui:field="navBar" activates="sidenav">
|
||||
<m:MaterialNavBrand paddingLeft="60" text="DataMiner Tester" />
|
||||
<m:MaterialNavSection float="RIGHT">
|
||||
|
||||
</m:MaterialNavSection>
|
||||
</m:MaterialNavBar>
|
||||
</m:MaterialHeader>
|
||||
|
||||
<m:MaterialSideNavPush ui:field="sideNav" m:id="sidenav"
|
||||
width="280" withHeader="true" showOnAttach="true">
|
||||
<!-- <ma:sideprofile.MaterialSideProfile url="{res.sideNavProfileBackground.getSafeUri.asString***REMOVED***">
|
||||
<m:MaterialImage url="{res.panda.getSafeUri.asString***REMOVED***" /> <m:MaterialLabel
|
||||
text="PandA" textColor="WHITE" /> <m:MaterialLink text="panda@isti.cnr.it"
|
||||
activates="dropProfile" textColor="WHITE" /> </ma:sideprofile.MaterialSideProfile> -->
|
||||
<!--
|
||||
<m:MaterialLink text="Home" iconType="LABEL_OUTLINE"
|
||||
targetHistoryToken="{tokens.getHome***REMOVED***" /> -->
|
||||
<m:MaterialLink text="Test" iconType="LABEL_OUTLINE"
|
||||
targetHistoryToken="{tokens.getTest***REMOVED***" />
|
||||
<m:MaterialLink text="Batch" iconType="LABEL_OUTLINE"
|
||||
targetHistoryToken="{tokens.getBatch***REMOVED***" />
|
||||
<m:MaterialLink text="Diff" iconType="LABEL_OUTLINE"
|
||||
targetHistoryToken="{tokens.getDiff***REMOVED***" />
|
||||
<m:MaterialLink text="Help" iconType="LABEL_OUTLINE"
|
||||
targetHistoryToken="{tokens.getHelp***REMOVED***" />
|
||||
</m:MaterialSideNavPush>
|
||||
</m:MaterialPanel>
|
||||
|
||||
</ui:UiBinder>
|
|
@ -0,0 +1,66 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.monitor;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.application.monitor.MonitorRequestEvent.MonitorRequestEventHandler;
|
||||
***REMOVED***
|
||||
|
||||
import com.google.gwt.user.client.Timer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class MonitorRequest {
|
||||
|
||||
private Timer monitor = null;
|
||||
|
||||
private MonitorRequestEventHandler handler;
|
||||
|
||||
public MonitorRequest() {
|
||||
monitor = new Timer() {
|
||||
public void run() {
|
||||
executeCommand();
|
||||
***REMOVED***
|
||||
***REMOVED***;
|
||||
|
||||
***REMOVED***
|
||||
|
||||
private void stopMonitor() {
|
||||
if (monitor.isRunning()) {
|
||||
monitor.cancel();
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
|
||||
private void executeCommand() {
|
||||
MonitorRequestEvent event = new MonitorRequestEvent();
|
||||
handler.onMonitor(event);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
public void addHandler(MonitorRequestEventHandler handler) {
|
||||
this.handler = handler;
|
||||
***REMOVED***
|
||||
|
||||
public void start() {
|
||||
startSchedule();
|
||||
***REMOVED***
|
||||
|
||||
private void startSchedule() {
|
||||
// Execute the timer to expire 2 seconds in the future
|
||||
monitor.schedule(Constants.CLIENT_MONITOR_PERIODMILLIS);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
public void repeat() {
|
||||
monitor.schedule(Constants.CLIENT_MONITOR_PERIODMILLIS);
|
||||
***REMOVED***
|
||||
|
||||
public void stop() {
|
||||
stopMonitor();
|
||||
***REMOVED***
|
||||
|
||||
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,60 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.monitor;
|
||||
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
import com.google.gwt.event.shared.HandlerRegistration;
|
||||
import com.google.gwt.event.shared.HasHandlers;
|
||||
|
||||
/**
|
||||
* Monitor Request Event
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class MonitorRequestEvent extends
|
||||
GwtEvent<MonitorRequestEvent.MonitorRequestEventHandler> {
|
||||
|
||||
public static Type<MonitorRequestEventHandler> TYPE = new Type<MonitorRequestEventHandler>();
|
||||
|
||||
|
||||
public interface MonitorRequestEventHandler extends EventHandler {
|
||||
void onMonitor(MonitorRequestEvent event);
|
||||
***REMOVED***
|
||||
|
||||
public interface HasMonitorRequestEventHandler extends HasHandlers {
|
||||
public HandlerRegistration addMonitorRequestEventHandler(
|
||||
MonitorRequestEventHandler handler);
|
||||
***REMOVED***
|
||||
|
||||
public MonitorRequestEvent() {
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
protected void dispatch(MonitorRequestEventHandler handler) {
|
||||
handler.onMonitor(this);
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public Type<MonitorRequestEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
***REMOVED***
|
||||
|
||||
public static Type<MonitorRequestEventHandler> getType() {
|
||||
return TYPE;
|
||||
***REMOVED***
|
||||
|
||||
public static void fire(HasHandlers source, MonitorRequestEvent event) {
|
||||
source.fireEvent(event);
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MonitorRequestEvent []";
|
||||
***REMOVED***
|
||||
|
||||
|
||||
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,16 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.testbatchconfig;
|
||||
|
||||
import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class TestBatchConfModule extends AbstractPresenterModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bindPresenter(TestBatchConfPresenter.class, TestBatchConfPresenter.PresenterView.class,
|
||||
TestBatchConfView.class, TestBatchConfPresenter.PresenterProxy.class);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
|
@ -0,0 +1,216 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.testbatchconfig;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.process.ComputationStatus.Status;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.application.ApplicationPresenter;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.application.monitor.MonitorRequest;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.application.monitor.MonitorRequestEvent;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.application.monitor.MonitorRequestEvent.MonitorRequestEventHandler;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.place.NameTokens;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.rpc.DataMinerTesterServiceAsync;
|
||||
***REMOVED***
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.DMBatchConfig;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.result.BatchTestResult;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.result.BatchTestRow;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.result.SingleTestResult;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.task.TaskStatus;
|
||||
|
||||
import com.google.gwt.core.shared.GWT;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.gwtplatform.mvp.client.HasUiHandlers;
|
||||
import com.gwtplatform.mvp.client.Presenter;
|
||||
import com.gwtplatform.mvp.client.View;
|
||||
import com.gwtplatform.mvp.client.annotations.NameToken;
|
||||
import com.gwtplatform.mvp.client.annotations.NoGatekeeper;
|
||||
import com.gwtplatform.mvp.client.annotations.ProxyStandard;
|
||||
import com.gwtplatform.mvp.client.proxy.ProxyPlace;
|
||||
|
||||
import gwt.material.design.client.ui.MaterialLoader;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class TestBatchConfPresenter
|
||||
extends Presenter<TestBatchConfPresenter.PresenterView, TestBatchConfPresenter.PresenterProxy>
|
||||
implements TestBatchConfUiHandlers {
|
||||
interface PresenterView extends View, HasUiHandlers<TestBatchConfUiHandlers> {
|
||||
void setResult(String result, boolean success);
|
||||
|
||||
void setupTable();
|
||||
|
||||
void setResultTable(ArrayList<BatchTestRow> batchTestRows);
|
||||
|
||||
void setupOptions();
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@ProxyStandard
|
||||
@NameToken(NameTokens.BATCH)
|
||||
@NoGatekeeper
|
||||
interface PresenterProxy extends ProxyPlace<TestBatchConfPresenter> {
|
||||
***REMOVED***
|
||||
|
||||
private DataMinerTesterServiceAsync service;
|
||||
|
||||
@Inject
|
||||
TestBatchConfPresenter(EventBus eventBus, PresenterView view, PresenterProxy proxy,
|
||||
DataMinerTesterServiceAsync service) {
|
||||
super(eventBus, view, proxy, ApplicationPresenter.SLOT_MAIN);
|
||||
this.service = service;
|
||||
getView().setUiHandlers(this);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
protected void onBind() {
|
||||
super.onBind();
|
||||
getView().setupOptions();
|
||||
getView().setupTable();
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void executeBatchTest(DMBatchConfig dmBatchConfig) {
|
||||
if (dmBatchConfig.getTestType() != null && !dmBatchConfig.getTestType().isEmpty()) {
|
||||
testBatch(dmBatchConfig);
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
|
||||
private void testBatch(DMBatchConfig dmBatchConfig) {
|
||||
MaterialLoader.loading(true);
|
||||
service.startBatchTest(getToken(), dmBatchConfig, new AsyncCallback<String>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
GWT.log("Error starting test: " + caught.getLocalizedMessage(), caught);
|
||||
String result = SafeHtmlUtils.htmlEscape(caught.getLocalizedMessage());
|
||||
StackTraceElement[] trace = caught.getStackTrace();
|
||||
for (int i = 0; i < trace.length; i++) {
|
||||
result += SafeHtmlUtils.htmlEscape(trace[i].toString()) + "\n";
|
||||
***REMOVED***
|
||||
MaterialLoader.loading(false);
|
||||
getView().setResult(result, false);
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void onSuccess(String computationId) {
|
||||
monitorBatchTest(dmBatchConfig, computationId);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
private void monitorBatchTest(DMBatchConfig dmBatchConfig, String computationId) {
|
||||
final MonitorRequest monitorRequest = new MonitorRequest();
|
||||
MonitorRequestEventHandler handler = new MonitorRequestEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onMonitor(MonitorRequestEvent event) {
|
||||
service.monitorBatchTest(getToken(), computationId, new AsyncCallback<TaskStatus>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
monitorRequest.stop();
|
||||
GWT.log("Error in test: " + caught.getLocalizedMessage(), caught);
|
||||
String result = SafeHtmlUtils.htmlEscape(caught.getLocalizedMessage());
|
||||
StackTraceElement[] trace = caught.getStackTrace();
|
||||
for (int i = 0; i < trace.length; i++) {
|
||||
result += SafeHtmlUtils.htmlEscape(trace[i].toString()) + "\n";
|
||||
***REMOVED***
|
||||
MaterialLoader.loading(false);
|
||||
getView().setResult(result, false);
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void onSuccess(TaskStatus taskStatus) {
|
||||
if (taskStatus != null) {
|
||||
switch (taskStatus) {
|
||||
case COMPLETED:
|
||||
retrieveBatchTestOutput(dmBatchConfig, computationId);
|
||||
***REMOVED***
|
||||
case ERROR:
|
||||
monitorRequest.stop();
|
||||
GWT.log("Error test failed");
|
||||
MaterialLoader.loading(false);
|
||||
getView().setResult("Error test failed", false);
|
||||
***REMOVED***
|
||||
case RUNNING:
|
||||
case STARTED:
|
||||
default:
|
||||
monitorRequest.repeat();
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED*** else {
|
||||
monitorRequest.repeat();
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***);
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***;
|
||||
|
||||
monitorRequest.addHandler(handler);
|
||||
monitorRequest.start();
|
||||
|
||||
***REMOVED***
|
||||
|
||||
private void retrieveBatchTestOutput(DMBatchConfig dmBatchConfig, String computationId) {
|
||||
service.retrieveOutputForBatchTest(getToken(), computationId, new AsyncCallback<BatchTestResult>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
||||
GWT.log("Error retrieving test output: " + caught.getLocalizedMessage(), caught);
|
||||
String result = SafeHtmlUtils.htmlEscape(caught.getLocalizedMessage());
|
||||
StackTraceElement[] trace = caught.getStackTrace();
|
||||
for (int i = 0; i < trace.length; i++) {
|
||||
result += SafeHtmlUtils.htmlEscape(trace[i].toString()) + "\n";
|
||||
***REMOVED***
|
||||
MaterialLoader.loading(false);
|
||||
getView().setResult(result, false);
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void onSuccess(BatchTestResult batchTestResult) {
|
||||
MaterialLoader.loading(false);
|
||||
ArrayList<BatchTestRow> batchTestRows = new ArrayList<>();
|
||||
LinkedHashMap<String, SingleTestResult> testResultMap = batchTestResult.getTestResultMap();
|
||||
for (String url : testResultMap.keySet()) {
|
||||
SingleTestResult singleTestResult = testResultMap.get(url);
|
||||
Status status = singleTestResult.getComputationStatus().getStatus();
|
||||
BatchTestRow batchTestRow;
|
||||
if (status.compareTo(Status.COMPLETE) == 0) {
|
||||
batchTestRow = new BatchTestRow(url, status, singleTestResult.getResponse());
|
||||
***REMOVED*** else {
|
||||
Exception e = singleTestResult.getComputationStatus().getError();
|
||||
batchTestRow = new BatchTestRow(url, status, e.getLocalizedMessage());
|
||||
***REMOVED***
|
||||
batchTestRows.add(batchTestRow);
|
||||
|
||||
***REMOVED***
|
||||
getView().setResultTable(batchTestRows);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
private String getToken() {
|
||||
String token = Window.Location.getParameter(Constants.TOKEN);
|
||||
GWT.log("Token: " + token);
|
||||
return token;
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,16 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.testbatchconfig;
|
||||
|
||||
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.DMBatchConfig;
|
||||
|
||||
import com.gwtplatform.mvp.client.UiHandlers;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
interface TestBatchConfUiHandlers extends UiHandlers {
|
||||
|
||||
void executeBatchTest(DMBatchConfig dmBatchConfig);
|
||||
***REMOVED***
|
|
@ -0,0 +1,280 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.testbatchconfig;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.process.ComputationStatus.Status;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.application.custom.SelectableTextCell;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.DMBatchConfig;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.ProtocolType;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.TestType;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.result.BatchTestRow;
|
||||
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.uibinder.client.UiHandler;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.gwtplatform.mvp.client.ViewWithUiHandlers;
|
||||
|
||||
import gwt.material.design.client.base.constants.StyleName;
|
||||
import gwt.material.design.client.base.density.DisplayDensity;
|
||||
import gwt.material.design.client.constants.Color;
|
||||
import gwt.material.design.client.constants.IconType;
|
||||
import gwt.material.design.client.constants.TextAlign;
|
||||
import gwt.material.design.client.data.SelectionType;
|
||||
import gwt.material.design.client.ui.MaterialButton;
|
||||
import gwt.material.design.client.ui.MaterialIcon;
|
||||
import gwt.material.design.client.ui.MaterialListBox;
|
||||
import gwt.material.design.client.ui.MaterialPanel;
|
||||
import gwt.material.design.client.ui.MaterialTextArea;
|
||||
import gwt.material.design.client.ui.MaterialTextBox;
|
||||
import gwt.material.design.client.ui.animate.MaterialAnimation;
|
||||
import gwt.material.design.client.ui.animate.Transition;
|
||||
import gwt.material.design.client.ui.table.MaterialDataTable;
|
||||
import gwt.material.design.client.ui.table.cell.TextColumn;
|
||||
import gwt.material.design.client.ui.table.cell.WidgetColumn;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
class TestBatchConfView extends ViewWithUiHandlers<TestBatchConfUiHandlers>
|
||||
implements TestBatchConfPresenter.PresenterView {
|
||||
interface Binder extends UiBinder<Widget, TestBatchConfView> {
|
||||
***REMOVED***
|
||||
|
||||
@UiField
|
||||
MaterialTextArea dms;
|
||||
|
||||
@UiField
|
||||
MaterialTextBox token;
|
||||
|
||||
@UiField
|
||||
MaterialListBox protocolType;
|
||||
|
||||
@UiField
|
||||
MaterialListBox testType;
|
||||
|
||||
@UiField
|
||||
MaterialTextArea result;
|
||||
|
||||
@UiField
|
||||
MaterialDataTable<BatchTestRow> resultsTable;
|
||||
|
||||
@UiField
|
||||
MaterialButton resultIcon;
|
||||
|
||||
@UiField
|
||||
MaterialButton run;
|
||||
|
||||
@Inject
|
||||
TestBatchConfView(Binder uiBinder) {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
testType.clear();
|
||||
for (TestType tType : TestType.values()) {
|
||||
testType.add(tType.getLabel());
|
||||
***REMOVED***
|
||||
protocolType.clear();
|
||||
for (ProtocolType tType : ProtocolType.values()) {
|
||||
protocolType.add(tType.getLabel());
|
||||
***REMOVED***
|
||||
dms.setAllowBlank(false);
|
||||
token.setAllowBlank(false);
|
||||
***REMOVED***
|
||||
|
||||
@UiHandler("run")
|
||||
void onClick(ClickEvent e) {
|
||||
if (!dms.validate() || !token.validate()) {
|
||||
return;
|
||||
***REMOVED***
|
||||
|
||||
String dmsValue = dms.getValue();
|
||||
String tokenValue = token.getValue();
|
||||
String protocolValue= protocolType.getValue();
|
||||
String testTypeValue = testType.getValue();
|
||||
|
||||
resultIcon.setVisible(false);
|
||||
result.setVisible(false);
|
||||
resultsTable.setVisible(false);
|
||||
|
||||
ArrayList<String> dmList;
|
||||
if (dmsValue.contains(",")) {
|
||||
String[] urlsArray = dmsValue.split(",");
|
||||
dmList = new ArrayList<>(Arrays.asList(urlsArray));
|
||||
dmList.removeAll(Arrays.asList("", null));
|
||||
|
||||
***REMOVED*** else {
|
||||
dmList = new ArrayList<>();
|
||||
dmList.add(dmsValue);
|
||||
***REMOVED***
|
||||
|
||||
DMBatchConfig dmBatchConfig = new DMBatchConfig(dmList, tokenValue, protocolValue, testTypeValue);
|
||||
getUiHandlers().executeBatchTest(dmBatchConfig);
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void setResult(String resultValue, boolean success) {
|
||||
resultIcon.setVisible(true);
|
||||
result.setVisible(true);
|
||||
if (success) {
|
||||
resultIcon.setIconType(IconType.CHECK_CIRCLE);
|
||||
resultIcon.setBackgroundColor(Color.GREEN);
|
||||
resultIcon.setIconFontSize(4.0, Unit.EM);
|
||||
***REMOVED*** else {
|
||||
resultIcon.setIconType(IconType.ERROR);
|
||||
resultIcon.setBackgroundColor(Color.RED);
|
||||
resultIcon.setIconFontSize(4.0, Unit.EM);
|
||||
***REMOVED***
|
||||
MaterialAnimation animation = new MaterialAnimation();
|
||||
animation.setDelay(0);
|
||||
animation.setDuration(1000);
|
||||
animation.transition(Transition.FLIPINX);
|
||||
animation.animate(resultIcon);
|
||||
|
||||
result.setLength(resultValue.length());
|
||||
result.setValue(resultValue);
|
||||
// result.reinitialize();
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void setupTable() {
|
||||
|
||||
TextColumn<BatchTestRow> dataminerColumn = new TextColumn<BatchTestRow>(new SelectableTextCell()) {
|
||||
@Override
|
||||
public String getValue(BatchTestRow batchTestRow) {
|
||||
return batchTestRow.getUrl();
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public boolean sortable() {
|
||||
return true;
|
||||
***REMOVED***
|
||||
***REMOVED***;
|
||||
dataminerColumn.textAlign(TextAlign.LEFT);
|
||||
dataminerColumn.styleProperty(StyleName.WHITE_SPACE, "normal");
|
||||
|
||||
WidgetColumn<BatchTestRow, MaterialPanel> statusColumn = new WidgetColumn<BatchTestRow, MaterialPanel>() {
|
||||
@Override
|
||||
public MaterialPanel getValue(BatchTestRow batchTestRow) {
|
||||
MaterialPanel panel = new MaterialPanel();
|
||||
panel.setStyle("unselectable='false'");
|
||||
MaterialIcon icon = null;
|
||||
Status status = batchTestRow.getStatus();
|
||||
if (status == null) {
|
||||
icon = new MaterialIcon(IconType.ERROR, Color.RED, Color.WHITE);
|
||||
***REMOVED*** else {
|
||||
switch (status) {
|
||||
case COMPLETE:
|
||||
icon = new MaterialIcon(IconType.CHECK_CIRCLE, Color.GREEN, Color.WHITE);
|
||||
|
||||
break;
|
||||
case FAILED:
|
||||
icon = new MaterialIcon(IconType.ERROR, Color.RED, Color.WHITE);
|
||||
break;
|
||||
case ACCEPTED:
|
||||
case CANCELLED:
|
||||
case RUNNING:
|
||||
default:
|
||||
icon = new MaterialIcon(IconType.REPORT_PROBLEM, Color.YELLOW, Color.WHITE);
|
||||
break;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
panel.add(icon);
|
||||
return panel;
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public boolean sortable() {
|
||||
return true;
|
||||
***REMOVED***
|
||||
***REMOVED***;
|
||||
statusColumn.textAlign(TextAlign.CENTER);
|
||||
|
||||
WidgetColumn<BatchTestRow, MaterialPanel> responseColumn = new WidgetColumn<BatchTestRow, MaterialPanel>() {
|
||||
@Override
|
||||
public MaterialPanel getValue(BatchTestRow batchTestRow) {
|
||||
MaterialPanel panel = new MaterialPanel();
|
||||
SafeHtmlBuilder sb = new SafeHtmlBuilder();
|
||||
sb.appendHtmlConstant("<div style='white-space:normal' unselectable='false'>");
|
||||
sb.appendEscaped(batchTestRow.getResponse());
|
||||
sb.appendHtmlConstant("</div>");
|
||||
HTMLPanel hpanel = new HTMLPanel(sb.toSafeHtml());
|
||||
panel.add(hpanel);
|
||||
return panel;
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public boolean sortable() {
|
||||
return true;
|
||||
***REMOVED***
|
||||
***REMOVED***;
|
||||
responseColumn.textAlign(TextAlign.LEFT);
|
||||
|
||||
resultsTable.addColumn("DataMiner", dataminerColumn);
|
||||
resultsTable.addColumn("Status", statusColumn);
|
||||
resultsTable.addColumn("Response", responseColumn);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void setResultTable(ArrayList<BatchTestRow> batchTestRows) {
|
||||
resultIcon.setVisible(true);
|
||||
resultsTable.setVisible(true);
|
||||
boolean success = true;
|
||||
|
||||
for (BatchTestRow batchTestRow : batchTestRows) {
|
||||
if (batchTestRow.getStatus()==null||batchTestRow.getStatus().compareTo(Status.COMPLETE) != 0) {
|
||||
success = false;
|
||||
break;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
if (success) {
|
||||
resultIcon.setIconType(IconType.CHECK_CIRCLE);
|
||||
resultIcon.setBackgroundColor(Color.GREEN);
|
||||
resultIcon.setIconFontSize(4.0, Unit.EM);
|
||||
***REMOVED*** else {
|
||||
resultIcon.setIconType(IconType.ERROR);
|
||||
resultIcon.setBackgroundColor(Color.RED);
|
||||
resultIcon.setIconFontSize(4.0, Unit.EM);
|
||||
***REMOVED***
|
||||
|
||||
MaterialAnimation animation = new MaterialAnimation();
|
||||
animation.setDelay(0);
|
||||
animation.setDuration(1000);
|
||||
animation.transition(Transition.FLIPINX);
|
||||
animation.animate(resultIcon);
|
||||
|
||||
resultsTable.clearRows(true);
|
||||
resultsTable.getTableTitle().setText("Results");
|
||||
resultsTable.setRowData(0, batchTestRows);
|
||||
resultsTable.getView().refresh();
|
||||
|
||||
reload();
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void setupOptions() {
|
||||
|
||||
// Selection Type
|
||||
resultsTable.setSelectionType(SelectionType.NONE);
|
||||
|
||||
// Density
|
||||
resultsTable.setDensity(DisplayDensity.DEFAULT);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
public void reload() {
|
||||
resultsTable.getView().setRedraw(true);
|
||||
resultsTable.getView().refresh();
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,40 @@
|
|||
<!-- @Author Giancarlo Panichi -->
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:m="urn:import:gwt.material.design.client.ui"
|
||||
xmlns:ma="urn:import:gwt.material.design.addins.client" xmlns:m.table="urn:import:gwt.material.design.client.ui.table"
|
||||
xmlns:m.html="urn:import:gwt.material.design.client.ui.html">
|
||||
|
||||
|
||||
<ui:with field="res"
|
||||
type="org.gcube.portlets.user.dataminermanagertester.client.resources.AppResources" />
|
||||
|
||||
<m:MaterialPanel textAlign="CENTER" paddingTop="60"
|
||||
paddingLeft="20" paddingRight="20">
|
||||
|
||||
<m:MaterialTitle title="Batch" description="Set DataMiners info" />
|
||||
<m:MaterialTextArea ui:field="dms" title="DataMiners"
|
||||
placeholder="dataminer1-d-d4s.d4science.org,dataminer2-d-d4s.d4science.org..."
|
||||
label="DataMiners" active="true" grid="s12" />
|
||||
<m:MaterialTextBox ui:field="token" title="Token"
|
||||
placeholder="" label="Token" active="true" grid="s12" />
|
||||
<m:MaterialListBox ui:field="protocolType" placeholder="Protocol type">
|
||||
<m.html:Option text="Protocol" />
|
||||
</m:MaterialListBox>
|
||||
<m:MaterialListBox ui:field="testType" placeholder="Test type">
|
||||
<m.html:Option text="Test" />
|
||||
</m:MaterialListBox>
|
||||
<m:MaterialButton ui:field="run" text="Run" waves="LIGHT"
|
||||
textColor="WHITE" iconType="STARS" iconPosition="LEFT" />
|
||||
<m:MaterialTextArea ui:field="result" visible="false"
|
||||
label="Test Result" resizeRule="AUTO" />
|
||||
<m.table:MaterialDataTable ui:field="resultsTable"
|
||||
visible="false" shadow="1" height="400px"
|
||||
marginBottom="30" marginTop="30" />
|
||||
<m:MaterialButton ui:field="resultIcon" visible="false"
|
||||
width="100px" height="100px" type="FLOATING" size="LARGE" iconType="CHECK_CIRCLE" />
|
||||
|
||||
</m:MaterialPanel>
|
||||
|
||||
|
||||
</ui:UiBinder>
|
|
@ -0,0 +1,16 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.testconfig;
|
||||
|
||||
import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class TestConfModule extends AbstractPresenterModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bindPresenter(TestConfPresenter.class, TestConfPresenter.PresenterView.class,
|
||||
TestConfView.class, TestConfPresenter.PresenterProxy.class);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
|
@ -0,0 +1,230 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.testconfig;
|
||||
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.computations.ComputationId;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.process.ComputationStatus.Status;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.application.ApplicationPresenter;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.application.monitor.MonitorRequest;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.application.monitor.MonitorRequestEvent;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.application.monitor.MonitorRequestEvent.MonitorRequestEventHandler;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.place.NameTokens;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.rpc.DataMinerTesterServiceAsync;
|
||||
***REMOVED***
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.DMConfig;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.TestType;
|
||||
|
||||
import com.google.gwt.core.shared.GWT;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.gwtplatform.mvp.client.HasUiHandlers;
|
||||
import com.gwtplatform.mvp.client.Presenter;
|
||||
import com.gwtplatform.mvp.client.View;
|
||||
import com.gwtplatform.mvp.client.annotations.NameToken;
|
||||
import com.gwtplatform.mvp.client.annotations.NoGatekeeper;
|
||||
import com.gwtplatform.mvp.client.annotations.ProxyStandard;
|
||||
import com.gwtplatform.mvp.client.proxy.ProxyPlace;
|
||||
|
||||
import gwt.material.design.client.ui.MaterialLoader;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class TestConfPresenter extends Presenter<TestConfPresenter.PresenterView, TestConfPresenter.PresenterProxy>
|
||||
implements TestConfUiHandlers {
|
||||
interface PresenterView extends View, HasUiHandlers<TestConfUiHandlers> {
|
||||
void setResult(String result, boolean success);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@ProxyStandard
|
||||
@NameToken(NameTokens.TEST)
|
||||
@NoGatekeeper
|
||||
interface PresenterProxy extends ProxyPlace<TestConfPresenter> {
|
||||
***REMOVED***
|
||||
|
||||
private DataMinerTesterServiceAsync service;
|
||||
|
||||
@Inject
|
||||
TestConfPresenter(EventBus eventBus, PresenterView view, PresenterProxy proxy,
|
||||
DataMinerTesterServiceAsync service) {
|
||||
super(eventBus, view, proxy, ApplicationPresenter.SLOT_MAIN);
|
||||
this.service = service;
|
||||
getView().setUiHandlers(this);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void executeTest(DMConfig dmConfig) {
|
||||
if (dmConfig.getTestType() != null && !dmConfig.getTestType().isEmpty()) {
|
||||
TestType testType = TestType.getTypeFromId(dmConfig.getTestType());
|
||||
switch (testType) {
|
||||
case Capabilities:
|
||||
callGetCapabilities(dmConfig);
|
||||
break;
|
||||
case FeedForwardAnn:
|
||||
case BionymLocal:
|
||||
case CMSY2:
|
||||
case CSquareColumnCreator:
|
||||
case DBScan:
|
||||
case ListDBName:
|
||||
case RasterDataPublisher:
|
||||
case WebAppPublisher:
|
||||
case XYExtractor:
|
||||
case OpenMeshRecostructorGPU:
|
||||
case GenericCharts:
|
||||
case PolygonsToMap:
|
||||
testSimple(dmConfig);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
|
||||
private void callGetCapabilities(DMConfig dmConfig) {
|
||||
MaterialLoader.loading(true);
|
||||
service.getCapabilities(getToken(), dmConfig, new AsyncCallback<String>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
GWT.log("Error get Capabilities: ", caught);
|
||||
String result = SafeHtmlUtils.htmlEscape(caught.getLocalizedMessage());
|
||||
MaterialLoader.loading(false);
|
||||
getView().setResult(result, false);
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void onSuccess(String result) {
|
||||
MaterialLoader.loading(false);
|
||||
getView().setResult(result, true);
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
private void testSimple(DMConfig dmConfig) {
|
||||
MaterialLoader.loading(true);
|
||||
service.startSimpleTest(getToken(), dmConfig, new AsyncCallback<ComputationId>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
GWT.log("Error starting test: " + caught.getLocalizedMessage(), caught);
|
||||
String result = SafeHtmlUtils.htmlEscape(caught.getLocalizedMessage());
|
||||
StackTraceElement[] trace = caught.getStackTrace();
|
||||
for (int i = 0; i < trace.length; i++) {
|
||||
result += SafeHtmlUtils.htmlEscape(trace[i].toString()) + "\n";
|
||||
***REMOVED***
|
||||
MaterialLoader.loading(false);
|
||||
getView().setResult(result, false);
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void onSuccess(ComputationId computationId) {
|
||||
monitorSimpleTest(dmConfig, computationId);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
private void monitorSimpleTest(DMConfig dmConfig, ComputationId computationId) {
|
||||
final MonitorRequest monitorRequest = new MonitorRequest();
|
||||
MonitorRequestEventHandler handler = new MonitorRequestEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onMonitor(MonitorRequestEvent event) {
|
||||
service.monitorSimpleTest(getToken(), dmConfig, computationId, new AsyncCallback<Status>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
monitorRequest.stop();
|
||||
GWT.log("Error in test: " + caught.getLocalizedMessage(), caught);
|
||||
String result = SafeHtmlUtils.htmlEscape(caught.getLocalizedMessage());
|
||||
StackTraceElement[] trace = caught.getStackTrace();
|
||||
for (int i = 0; i < trace.length; i++) {
|
||||
result += SafeHtmlUtils.htmlEscape(trace[i].toString()) + "\n";
|
||||
***REMOVED***
|
||||
MaterialLoader.loading(false);
|
||||
getView().setResult(result, false);
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void onSuccess(Status status) {
|
||||
if (status != null) {
|
||||
switch (status) {
|
||||
case COMPLETE:
|
||||
retrieveSimpleTestOutput(dmConfig, computationId);
|
||||
***REMOVED***
|
||||
case CANCELLED:
|
||||
case FAILED:
|
||||
monitorRequest.stop();
|
||||
GWT.log("Error test failed");
|
||||
MaterialLoader.loading(false);
|
||||
getView().setResult("Error test failed", false);
|
||||
***REMOVED***
|
||||
case RUNNING:
|
||||
case ACCEPTED:
|
||||
default:
|
||||
monitorRequest.repeat();
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED*** else {
|
||||
monitorRequest.repeat();
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***);
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***;
|
||||
|
||||
monitorRequest.addHandler(handler);
|
||||
monitorRequest.start();
|
||||
|
||||
***REMOVED***
|
||||
|
||||
private void retrieveSimpleTestOutput(DMConfig dmConfig, ComputationId computationId) {
|
||||
service.retrieveOutputForSimpleTest(getToken(), dmConfig, computationId, new AsyncCallback<String>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
||||
GWT.log("Error retrieving test output: " + caught.getLocalizedMessage(), caught);
|
||||
String result = SafeHtmlUtils.htmlEscape(caught.getLocalizedMessage());
|
||||
StackTraceElement[] trace = caught.getStackTrace();
|
||||
for (int i = 0; i < trace.length; i++) {
|
||||
result += SafeHtmlUtils.htmlEscape(trace[i].toString()) + "\n";
|
||||
***REMOVED***
|
||||
MaterialLoader.loading(false);
|
||||
getView().setResult(result, false);
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void onSuccess(String result) {
|
||||
MaterialLoader.loading(false);
|
||||
getView().setResult(result, true);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
private String getToken() {
|
||||
String token = Window.Location.getParameter(Constants.TOKEN);
|
||||
GWT.log("Token: " + token);
|
||||
return token;
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,16 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.testconfig;
|
||||
|
||||
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.DMConfig;
|
||||
|
||||
import com.gwtplatform.mvp.client.UiHandlers;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
interface TestConfUiHandlers extends UiHandlers {
|
||||
|
||||
void executeTest(DMConfig dmConfig);
|
||||
***REMOVED***
|
|
@ -0,0 +1,114 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.application.testconfig;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.DMConfig;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.ProtocolType;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.TestType;
|
||||
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.uibinder.client.UiHandler;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.gwtplatform.mvp.client.ViewWithUiHandlers;
|
||||
|
||||
import gwt.material.design.client.constants.Color;
|
||||
import gwt.material.design.client.constants.IconType;
|
||||
import gwt.material.design.client.ui.MaterialButton;
|
||||
import gwt.material.design.client.ui.MaterialListBox;
|
||||
import gwt.material.design.client.ui.MaterialTextArea;
|
||||
import gwt.material.design.client.ui.MaterialTextBox;
|
||||
import gwt.material.design.client.ui.animate.MaterialAnimation;
|
||||
import gwt.material.design.client.ui.animate.Transition;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
class TestConfView extends ViewWithUiHandlers<TestConfUiHandlers> implements TestConfPresenter.PresenterView {
|
||||
interface Binder extends UiBinder<Widget, TestConfView> {
|
||||
***REMOVED***
|
||||
|
||||
@UiField
|
||||
MaterialTextBox dm;
|
||||
|
||||
@UiField
|
||||
MaterialTextBox token;
|
||||
|
||||
@UiField
|
||||
MaterialListBox protocolType;
|
||||
|
||||
@UiField
|
||||
MaterialListBox testType;
|
||||
|
||||
@UiField
|
||||
MaterialTextArea result;
|
||||
|
||||
@UiField
|
||||
MaterialButton resultIcon;
|
||||
|
||||
@UiField
|
||||
MaterialButton run;
|
||||
|
||||
@Inject
|
||||
TestConfView(Binder uiBinder) {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
testType.clear();
|
||||
for (TestType tType : TestType.values()) {
|
||||
testType.add(tType.getLabel());
|
||||
***REMOVED***
|
||||
protocolType.clear();
|
||||
for (ProtocolType tType : ProtocolType.values()) {
|
||||
protocolType.add(tType.getLabel());
|
||||
***REMOVED***
|
||||
dm.setAllowBlank(false);
|
||||
token.setAllowBlank(false);
|
||||
***REMOVED***
|
||||
|
||||
@UiHandler("run")
|
||||
void onClick(ClickEvent e) {
|
||||
if (!dm.validate() || !token.validate()) {
|
||||
return;
|
||||
***REMOVED***
|
||||
|
||||
String dmValue = dm.getValue();
|
||||
String tokenValue = token.getValue();
|
||||
String protocolValue = protocolType.getValue();
|
||||
String testTypeValue = testType.getValue();
|
||||
|
||||
resultIcon.setVisible(false);
|
||||
result.setVisible(false);
|
||||
|
||||
DMConfig dmConfig = new DMConfig(dmValue, tokenValue, protocolValue,testTypeValue);
|
||||
getUiHandlers().executeTest(dmConfig);
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void setResult(String resultValue, boolean success) {
|
||||
resultIcon.setVisible(true);
|
||||
result.setVisible(true);
|
||||
if (success) {
|
||||
resultIcon.setIconType(IconType.CHECK_CIRCLE);
|
||||
resultIcon.setBackgroundColor(Color.GREEN);
|
||||
resultIcon.setIconFontSize(4.0, Unit.EM);
|
||||
***REMOVED*** else {
|
||||
resultIcon.setIconType(IconType.ERROR);
|
||||
resultIcon.setBackgroundColor(Color.RED);
|
||||
resultIcon.setIconFontSize(4.0, Unit.EM);
|
||||
***REMOVED***
|
||||
MaterialAnimation animation = new MaterialAnimation();
|
||||
animation.setDelay(0);
|
||||
animation.setDuration(1000);
|
||||
animation.transition(Transition.FLIPINX);
|
||||
animation.animate(resultIcon);
|
||||
|
||||
result.setLength(resultValue.length());
|
||||
result.setValue(resultValue);
|
||||
// result.reinitialize();
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,36 @@
|
|||
<!-- @Author Giancarlo Panichi -->
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:m="urn:import:gwt.material.design.client.ui"
|
||||
xmlns:ma="urn:import:gwt.material.design.addins.client" xmlns:m.table="urn:import:gwt.material.design.client.ui.table"
|
||||
xmlns:m.html="urn:import:gwt.material.design.client.ui.html">
|
||||
|
||||
<ui:with field="res"
|
||||
type="org.gcube.portlets.user.dataminermanagertester.client.resources.AppResources" />
|
||||
|
||||
<m:MaterialPanel textAlign="CENTER" paddingTop="60"
|
||||
paddingLeft="20" paddingRight="20">
|
||||
|
||||
<m:MaterialTitle title="Test" description="Set DataMiner info" />
|
||||
<m:MaterialTextBox ui:field="dm" title="DataMiner"
|
||||
placeholder="dataminer1-d-d4s.d4science.org" label="DataMiner"
|
||||
active="true" grid="s12" />
|
||||
<m:MaterialTextBox ui:field="token" title="Token"
|
||||
placeholder="" label="Token" active="true" grid="s12" />
|
||||
<m:MaterialListBox ui:field="protocolType" placeholder="Protocol type">
|
||||
<m.html:Option text="Protocol" />
|
||||
</m:MaterialListBox>
|
||||
<m:MaterialListBox ui:field="testType" placeholder="Test type">
|
||||
<m.html:Option text="Test" />
|
||||
</m:MaterialListBox>
|
||||
<m:MaterialButton ui:field="run" text="Run" waves="LIGHT"
|
||||
textColor="WHITE" iconType="STARS" iconPosition="LEFT" />
|
||||
<m:MaterialTextArea ui:field="result" visible="false"
|
||||
label="Test Result" resizeRule="AUTO" />
|
||||
<m:MaterialButton ui:field="resultIcon" visible="false"
|
||||
width="100px" height="100px" type="FLOATING" size="LARGE" iconType="CHECK_CIRCLE" />
|
||||
|
||||
</m:MaterialPanel>
|
||||
|
||||
|
||||
</ui:UiBinder>
|
|
@ -0,0 +1,37 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.event;
|
||||
|
||||
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
import com.google.gwt.event.shared.HasHandlers;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class ContentPushEvent extends GwtEvent<ContentPushEvent.ContentPushHandler> {
|
||||
|
||||
public interface ContentPushHandler extends EventHandler {
|
||||
void onContentPush(ContentPushEvent event);
|
||||
***REMOVED***
|
||||
|
||||
public static final Type<ContentPushHandler> TYPE = new Type<>();
|
||||
|
||||
|
||||
public ContentPushEvent() {***REMOVED***
|
||||
|
||||
public static void fire(HasHandlers source) {
|
||||
source.fireEvent(new ContentPushEvent());
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public Type<ContentPushHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
protected void dispatch(ContentPushHandler handler) {
|
||||
handler.onContentPush(this);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
|
@ -0,0 +1,42 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.gin;
|
||||
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.user.client.ui.IsWidget;
|
||||
import com.google.gwt.user.client.ui.RootPanel;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.gwtplatform.mvp.client.RootPresenter;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class CustomRootPresenter extends RootPresenter {
|
||||
|
||||
private static final String SM_DIV = "contentDiv";
|
||||
|
||||
public static final class CustomRootView extends RootView {
|
||||
@Override
|
||||
public void setInSlot(Object slot, IsWidget widget) {
|
||||
|
||||
RootPanel root = RootPanel.get(SM_DIV);
|
||||
|
||||
if (root != null) {
|
||||
GWT.log("Add Panel in Div " + SM_DIV);
|
||||
root.add(widget);
|
||||
***REMOVED***
|
||||
GWT.log("Add Panel in Root");
|
||||
RootPanel.get().add(widget);
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
@Inject
|
||||
CustomRootPresenter(EventBus eventBus, CustomRootView myRootView) {
|
||||
super( eventBus, myRootView );
|
||||
***REMOVED***
|
||||
***REMOVED***
|
|
@ -0,0 +1,41 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.gin;
|
||||
|
||||
import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
|
||||
import com.gwtplatform.mvp.client.gin.DefaultModule;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.application.ApplicationModule;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.place.NameTokens;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.resources.ResourceLoader;
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.rpc.DataMinerTesterServiceAsync;
|
||||
|
||||
import com.google.inject.Singleton;
|
||||
import com.gwtplatform.mvp.client.RootPresenter;
|
||||
import com.gwtplatform.mvp.client.annotations.DefaultPlace;
|
||||
import com.gwtplatform.mvp.client.annotations.ErrorPlace;
|
||||
import com.gwtplatform.mvp.client.annotations.UnauthorizedPlace;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class DataMinerManagerTesterClientModule extends AbstractPresenterModule {
|
||||
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(ResourceLoader.class).asEagerSingleton();
|
||||
bind(DataMinerTesterServiceAsync.class).in(Singleton.class);
|
||||
bind(RootPresenter.class).to(CustomRootPresenter.class).asEagerSingleton();
|
||||
|
||||
install(new DefaultModule());
|
||||
install(new ApplicationModule());
|
||||
|
||||
|
||||
// DefaultPlaceManager Places
|
||||
bindConstant().annotatedWith(DefaultPlace.class).to(NameTokens.TEST);
|
||||
bindConstant().annotatedWith(ErrorPlace.class).to(NameTokens.TEST);
|
||||
bindConstant().annotatedWith(UnauthorizedPlace.class).to(NameTokens.TEST);
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,36 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.place;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class NameTokens {
|
||||
public static final String HOME = "home";
|
||||
public static final String HELP = "help";
|
||||
public static final String TEST = "test";
|
||||
public static final String BATCH = "batch";
|
||||
public static final String DIFF = "diff";
|
||||
|
||||
public static String getHome() {
|
||||
return HOME;
|
||||
***REMOVED***
|
||||
|
||||
public static String getHelp() {
|
||||
return HELP;
|
||||
***REMOVED***
|
||||
|
||||
public static String getTest() {
|
||||
return TEST;
|
||||
***REMOVED***
|
||||
|
||||
public static String getDiff() {
|
||||
return DIFF;
|
||||
***REMOVED***
|
||||
|
||||
public static String getBatch() {
|
||||
return BATCH;
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,15 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.place;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class TokenParameters {
|
||||
public static final String ID = "id";
|
||||
|
||||
public static String getId() {
|
||||
return ID;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
|
@ -0,0 +1,35 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.resources;
|
||||
|
||||
import com.google.gwt.resources.client.ClientBundle;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public interface AppResources extends ClientBundle {
|
||||
interface Normalize extends CssResource {
|
||||
***REMOVED***
|
||||
|
||||
interface Style extends CssResource {
|
||||
String sideNavPBg();
|
||||
***REMOVED***
|
||||
|
||||
interface PageTable extends CssResource {
|
||||
|
||||
***REMOVED***
|
||||
|
||||
|
||||
|
||||
@Source("css/normalize.gss")
|
||||
Normalize normalize();
|
||||
|
||||
@Source("css/style.gss")
|
||||
Style style();
|
||||
|
||||
@Source("css/pageTable.gss")
|
||||
PageTable pageTable();
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,20 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.resources;
|
||||
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class ResourceLoader {
|
||||
@Inject
|
||||
ResourceLoader(AppResources appResources) {
|
||||
appResources.normalize().ensureInjected();
|
||||
appResources.style().ensureInjected();
|
||||
appResources.pageTable().ensureInjected();
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***
|
|
@ -0,0 +1,409 @@
|
|||
/*! normalize.css v3.0.1 | MIT License | git.io/normalize */
|
||||
|
||||
/**
|
||||
* 1. Set default font family to sans-serif.
|
||||
* 2. Prevent iOS text size adjust after orientation change, without disabling
|
||||
* user zoom.
|
||||
*/
|
||||
|
||||
html {
|
||||
font-family: sans-serif; /* 1 */
|
||||
-ms-text-size-adjust: 100%; /* 2 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* Remove default margin.
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
***REMOVED***
|
||||
|
||||
/* HTML5 display definitions
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Correct `block` display not defined for any HTML5 element in IE 8/9.
|
||||
* Correct `block` display not defined for `details` or `summary` in IE 10/11 and Firefox.
|
||||
* Correct `block` display not defined for `main` in IE 11.
|
||||
*/
|
||||
|
||||
article,
|
||||
aside,
|
||||
details,
|
||||
figcaption,
|
||||
figure,
|
||||
footer,
|
||||
header,
|
||||
hgroup,
|
||||
main,
|
||||
nav,
|
||||
section,
|
||||
summary {
|
||||
display: block;
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* 1. Correct `inline-block` display not defined in IE 8/9.
|
||||
* 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
|
||||
*/
|
||||
|
||||
audio,
|
||||
canvas,
|
||||
progress,
|
||||
video {
|
||||
display: inline-block; /* 1 */
|
||||
vertical-align: baseline; /* 2 */
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* Address `[hidden]` styling not present in IE 8/9/10.
|
||||
* Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22.
|
||||
*/
|
||||
|
||||
[hidden],
|
||||
template {
|
||||
display: none;
|
||||
***REMOVED***
|
||||
|
||||
/* Links
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove the gray background color from active links in IE 10.
|
||||
*/
|
||||
|
||||
a {
|
||||
background: transparent;
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* Improve readability when focused and also mouse hovered in all browsers.
|
||||
*/
|
||||
|
||||
a:active,
|
||||
a:hover,
|
||||
button:active,
|
||||
button:hover {
|
||||
outline: 0;
|
||||
***REMOVED***
|
||||
|
||||
/* Text-level semantics
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Address styling not present in IE 8/9/10/11, Safari, and Chrome.
|
||||
*/
|
||||
|
||||
abbr[title] {
|
||||
border-bottom: 1px dotted;
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bold;
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* Address styling not present in Safari and Chrome.
|
||||
*/
|
||||
|
||||
dfn {
|
||||
font-style: italic;
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* Address variable `h1` font-size and margin within `section` and `article`
|
||||
* contexts in Firefox 4+, Safari, and Chrome.
|
||||
*/
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
margin: 0.67em 0;
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* Address styling not present in IE 8/9.
|
||||
*/
|
||||
|
||||
mark {
|
||||
background: #ff0;
|
||||
color: #000;
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* Address inconsistent and variable font size in all browsers.
|
||||
*/
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
|
||||
*/
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
***REMOVED***
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
***REMOVED***
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
***REMOVED***
|
||||
|
||||
/* Embedded content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove border when inside `a` element in IE 8/9/10.
|
||||
*/
|
||||
|
||||
img {
|
||||
border: 0;
|
||||
***REMOVED***
|
||||
|
||||
/* Grouping content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Address margin not present in IE 8/9 and Safari.
|
||||
*/
|
||||
|
||||
figure {
|
||||
margin: 1em 40px;
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* Address differences between Firefox and other browsers.
|
||||
*/
|
||||
|
||||
hr {
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
height: 0;
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* Contain overflow in all browsers.
|
||||
*/
|
||||
|
||||
pre {
|
||||
overflow: auto;
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* Address odd `em`-unit font size rendering in all browsers.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
pre,
|
||||
samp {
|
||||
font-family: monospace, monospace;
|
||||
font-size: 1em;
|
||||
***REMOVED***
|
||||
|
||||
/* Forms
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Known limitation: by default, Chrome and Safari on OS X allow very limited
|
||||
* styling of `select`, unless a `border` property is set.
|
||||
*/
|
||||
|
||||
/**
|
||||
* 1. Correct color not being inherited.
|
||||
* Known issue: affects color of disabled elements.
|
||||
* 2. Correct font properties not being inherited.
|
||||
* 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {
|
||||
color: inherit; /* 1 */
|
||||
font: inherit; /* 2 */
|
||||
margin: 0; /* 3 */
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* Address `overflow` set to `hidden` in IE 8/9/10/11.
|
||||
*/
|
||||
|
||||
button {
|
||||
overflow: visible;
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* Address inconsistent `text-transform` inheritance for `button` and `select`.
|
||||
* All other form control elements do not inherit `text-transform` values.
|
||||
* Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
|
||||
* Correct `select` style inheritance in Firefox.
|
||||
*/
|
||||
|
||||
button,
|
||||
select {
|
||||
text-transform: none;
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
|
||||
* and `video` controls.
|
||||
* 2. Correct inability to style clickable `input` types in iOS.
|
||||
* 3. Improve usability and consistency of cursor style between image-type
|
||||
* `input` and others.
|
||||
*/
|
||||
|
||||
button,
|
||||
html input[type="button"], /* 1 */
|
||||
input[type="reset"],
|
||||
input[type="submit"] {
|
||||
-webkit-appearance: button; /* 2 */
|
||||
cursor: pointer; /* 3 */
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* Re-set default cursor for disabled elements.
|
||||
*/
|
||||
|
||||
button[disabled],
|
||||
html input[disabled] {
|
||||
cursor: default;
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* Remove inner padding and border in Firefox 4+.
|
||||
*/
|
||||
|
||||
button::-moz-focus-inner,
|
||||
input::-moz-focus-inner {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
|
||||
* the UA stylesheet.
|
||||
*/
|
||||
|
||||
input {
|
||||
line-height: normal;
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* It's recommended that you don't attempt to style these elements.
|
||||
* Firefox's implementation doesn't respect box-sizing, padding, or width.
|
||||
*
|
||||
* 1. Address box sizing set to `content-box` in IE 8/9/10.
|
||||
* 2. Remove excess padding in IE 8/9/10.
|
||||
*/
|
||||
|
||||
input[type="checkbox"],
|
||||
input[type="radio"] {
|
||||
box-sizing: border-box; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* Fix the cursor style for Chrome's increment/decrement buttons. For certain
|
||||
* `font-size` values of the `input`, it causes the cursor style of the
|
||||
* decrement button to change from `default` to `text`.
|
||||
*/
|
||||
|
||||
input[type="number"]::-webkit-inner-spin-button,
|
||||
input[type="number"]::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* 1. Address `appearance` set to `searchfield` in Safari and Chrome.
|
||||
* 2. Address `box-sizing` set to `border-box` in Safari and Chrome
|
||||
* (include `-moz` to future-proof).
|
||||
*/
|
||||
|
||||
input[type="search"] {
|
||||
-webkit-appearance: textfield; /* 1 */
|
||||
-moz-box-sizing: content-box;
|
||||
-webkit-box-sizing: content-box; /* 2 */
|
||||
box-sizing: content-box;
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* Remove inner padding and search cancel button in Safari and Chrome on OS X.
|
||||
* Safari (but not Chrome) clips the cancel button when the search input has
|
||||
* padding (and `textfield` appearance).
|
||||
*/
|
||||
|
||||
input[type="search"]::-webkit-search-cancel-button,
|
||||
input[type="search"]::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* Define consistent border, margin, and padding.
|
||||
*/
|
||||
|
||||
fieldset {
|
||||
border: 1px solid #c0c0c0;
|
||||
margin: 0 2px;
|
||||
padding: 0.35em 0.625em 0.75em;
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* 1. Correct `color` not being inherited in IE 8/9/10/11.
|
||||
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
|
||||
*/
|
||||
|
||||
legend {
|
||||
border: 0; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* Remove default vertical scrollbar in IE 8/9/10/11.
|
||||
*/
|
||||
|
||||
textarea {
|
||||
overflow: auto;
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
* Don't inherit the `font-weight` (applied by a rule above).
|
||||
* NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
|
||||
*/
|
||||
|
||||
optgroup {
|
||||
font-weight: bold;
|
||||
***REMOVED***
|
||||
|
||||
/* Tables
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove most spacing between table cells.
|
||||
*/
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
***REMOVED***
|
||||
|
||||
td,
|
||||
th {
|
||||
padding: 0;
|
||||
***REMOVED***
|
|
@ -0,0 +1,28 @@
|
|||
/************ Page Table ************/
|
||||
@external data-row, tool-panel, top-panel;
|
||||
|
||||
|
||||
/** Top Panel **/
|
||||
#pTable .top-panel {
|
||||
background-color: white;
|
||||
color: black;
|
||||
***REMOVED***
|
||||
/** Tool Panel icons **/
|
||||
#pTable .top-panel .tool-panel i {
|
||||
color: #e91e63;
|
||||
***REMOVED***
|
||||
/** Hovering rows **/
|
||||
#pTable table tbody tr.data-row:hover {
|
||||
background: rgba(33, 150, 243, 0.27);
|
||||
color: #3f3f3f;
|
||||
***REMOVED***
|
||||
/** Columns **/
|
||||
#pTable table tbody td:nth-child(3) {
|
||||
background: #2196f3 !important;
|
||||
color: #fff;
|
||||
border-bottom: 2px solid #1976d2;
|
||||
***REMOVED***
|
||||
/** Table Headers **/
|
||||
#pTable table thead tr th {
|
||||
color: #1976d2;
|
||||
***REMOVED***
|
|
@ -0,0 +1,5 @@
|
|||
.sideNavPBg {
|
||||
/*
|
||||
gwt-sprite: 'sideNavProfileBackground';
|
||||
background-repeat: repeat; */
|
||||
***REMOVED***
|
|
@ -0,0 +1,40 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.rpc;
|
||||
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.computations.ComputationId;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.process.ComputationStatus.Status;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.DMBatchConfig;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.DMConfig;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.DMDiffConfig;
|
||||
***REMOVED***
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.result.BatchTestResult;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.session.UserInfo;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.task.TaskStatus;
|
||||
|
||||
import com.google.gwt.user.client.rpc.RemoteService;
|
||||
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
|
||||
|
||||
/**
|
||||
* The client side stub for the RPC service.
|
||||
*/
|
||||
@RemoteServiceRelativePath("dmtester")
|
||||
public interface DataMinerTesterService extends RemoteService {
|
||||
|
||||
public UserInfo hello(String token) throws ServiceException;
|
||||
|
||||
public String getCapabilities(String token,DMConfig dmConfig) throws ServiceException;
|
||||
|
||||
public String getOperatorsDiff(String token, DMDiffConfig operatorsDiffConfig) throws ServiceException;
|
||||
|
||||
public ComputationId startSimpleTest(String token, DMConfig dmConfig) throws ServiceException;
|
||||
|
||||
public String retrieveOutputForSimpleTest(String token, DMConfig dmConfig, ComputationId computationId) throws ServiceException;
|
||||
|
||||
public Status monitorSimpleTest(String token, DMConfig dmConfig, ComputationId computationId) throws ServiceException;
|
||||
|
||||
public String startBatchTest(String token, DMBatchConfig dmBatchConfig) throws ServiceException;
|
||||
|
||||
public TaskStatus monitorBatchTest(String token, String operationId) throws ServiceException;
|
||||
|
||||
public BatchTestResult retrieveOutputForBatchTest(String token, String operationId) throws ServiceException;
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,46 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.client.rpc;
|
||||
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.computations.ComputationId;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.process.ComputationStatus.Status;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.DMBatchConfig;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.DMConfig;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.DMDiffConfig;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.result.BatchTestResult;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.session.UserInfo;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.task.TaskStatus;
|
||||
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public interface DataMinerTesterServiceAsync {
|
||||
|
||||
// public static DataMinerTesterServiceAsync INSTANCE =
|
||||
// (DataMinerTesterServiceAsync) GWT
|
||||
// .create(DataMinerTesterService.class);
|
||||
|
||||
void hello(String token, AsyncCallback<UserInfo> callback);
|
||||
|
||||
void getCapabilities(String token, DMConfig dmConfig, AsyncCallback<String> callback);
|
||||
|
||||
void getOperatorsDiff(String token, DMDiffConfig operatorsDiffConfig, AsyncCallback<String> callback);
|
||||
|
||||
void startSimpleTest(String token, DMConfig dmConfig, AsyncCallback<ComputationId> callback);
|
||||
|
||||
void retrieveOutputForSimpleTest(String token, DMConfig dmConfig, ComputationId computationId,
|
||||
AsyncCallback<String> callback);
|
||||
|
||||
void monitorSimpleTest(String token, DMConfig dmConfig, ComputationId computationId,
|
||||
AsyncCallback<Status> callback);
|
||||
|
||||
void startBatchTest(String token, DMBatchConfig dmBatchConfig, AsyncCallback<String> callback);
|
||||
|
||||
void monitorBatchTest(String token, String operationId, AsyncCallback<TaskStatus> callback);
|
||||
|
||||
void retrieveOutputForBatchTest(String token, String operationId, AsyncCallback<BatchTestResult> callback);
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module rename-to='dataminermanagertester'>
|
||||
<inherits name="com.google.gwt.user.User" />
|
||||
<inherits name="com.gwtplatform.mvp.MvpWithEntryPoint" />
|
||||
|
||||
<!-- GWT Material -->
|
||||
<inherits name="gwt.material.design.GwtMaterialWithJQueryDebug" />
|
||||
<inherits name="gwt.material.design.themes.ThemeOrange" />
|
||||
<inherits name="gwt.material.design.addins.GwtMaterialAddinsDebug" />
|
||||
<inherits name="gwt.material.design.GwtMaterialTableDebug" />
|
||||
<!-- <inherits name="gwt.material.design.GwtMaterialTable"/> -->
|
||||
|
||||
<inherits name='org.gcube.portal.clientcontext.GCubeClientContext' />
|
||||
<inherits name='org.gcube.data.analysis.dataminermanagercl.dataminermanagercl'/>
|
||||
|
||||
<extend-configuration-property name="gin.ginjector.modules"
|
||||
value="org.gcube.portlets.user.dataminermanagertester.client.gin.DataMinerManagerTesterClientModule" />
|
||||
|
||||
<!-- Specify the paths for translatable code -->
|
||||
<source path="client" />
|
||||
<source path="shared" />
|
||||
|
||||
<set-configuration-property name="CssResource.enableGss"
|
||||
value="true" />
|
||||
|
||||
</module>
|
|
@ -0,0 +1,56 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.dataminermanagertester.portlet;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.portlet.GenericPortlet;
|
||||
import javax.portlet.PortletException;
|
||||
import javax.portlet.PortletRequestDispatcher;
|
||||
import javax.portlet.RenderRequest;
|
||||
import javax.portlet.RenderResponse;
|
||||
|
||||
import org.gcube.common.portal.PortalContext;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class DataMinerManagerTester extends GenericPortlet {
|
||||
|
||||
private final Logger logger= LoggerFactory.getLogger(GenericPortlet.class);
|
||||
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***JSP folder name
|
||||
***REMOVED***
|
||||
public static final String JSP_FOLDER = "/WEB-INF/jsp/";
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
public static final String VIEW_JSP = JSP_FOLDER + "DataMinerManagerTester_view.jsp";
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***@param request .
|
||||
***REMOVED***@param response .
|
||||
***REMOVED***@throws IOException .
|
||||
***REMOVED***@throws PortletException .
|
||||
***REMOVED***
|
||||
public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException {
|
||||
|
||||
logger.trace("DataMinerManagerTester loading from JSP: "+VIEW_JSP);
|
||||
logger.trace("Setting user in session using PortalContext");
|
||||
PortalContext.setUserInSession(request);
|
||||
|
||||
|
||||
logger.trace("passing to the render");
|
||||
PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher(VIEW_JSP);
|
||||
rd.include(request,response);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
|
@ -0,0 +1,150 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.Queue;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
import javax.servlet.ServletContextEvent;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.task.TaskInProgress;
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.task.TaskRequest;
|
||||
***REMOVED***
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.task.TaskStatus;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class DataMinerTesterBatchDaemon implements Runnable {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(DataMinerTesterBatchDaemon.class);
|
||||
|
||||
private long timeout = Constants.SERVICE_CLIENT_TIMEOUT_DEFAULT_MILLIS;
|
||||
private long timeoutUpdate = Constants.SERVICE_CLIENT_THREAD_POOL_TIME_OUT_UPDATE_MILLIS;
|
||||
private ServletContextEvent sce;
|
||||
private volatile boolean running = true;
|
||||
private ArrayList<TaskInProgress> tasks;
|
||||
private Timer threadPoolTimeoutUpdateTimer = null;
|
||||
|
||||
public DataMinerTesterBatchDaemon(ServletContextEvent sce) {
|
||||
this.sce = sce;
|
||||
tasks = new ArrayList<>();
|
||||
initTimeout();
|
||||
***REMOVED***
|
||||
|
||||
private void initTimeout() {
|
||||
sce.getServletContext().setAttribute(SessionConstants.DATAMINERTESTER_MONITOR_TIME_OUT_PERIODMILLIS,
|
||||
Long.valueOf(timeout));
|
||||
retrieveTimeOut();
|
||||
startThreadPoolTimeoutUpdateTimer();
|
||||
***REMOVED***
|
||||
|
||||
public void terminate() {
|
||||
running = false;
|
||||
if (threadPoolTimeoutUpdateTimer != null) {
|
||||
threadPoolTimeoutUpdateTimer.cancel();
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
public void run() {
|
||||
Queue<TaskRequest> jobQueue = new ConcurrentLinkedQueue<>();
|
||||
sce.getServletContext().setAttribute(SessionConstants.TASK_REQUEST_QUEUE, jobQueue);
|
||||
|
||||
// pool size matching Web services capacity
|
||||
|
||||
ExecutorService executorService = Executors.newFixedThreadPool(20);
|
||||
|
||||
while (running) {
|
||||
while (!jobQueue.isEmpty()) {
|
||||
TaskRequest taskRequest = jobQueue.poll();
|
||||
|
||||
DataMinerTesterCallable accountingClientCallable = new DataMinerTesterCallable(taskRequest);
|
||||
Future<TaskStatus> futureResult = executorService.submit(accountingClientCallable);
|
||||
TaskInProgress taskInProgress = new TaskInProgress(new GregorianCalendar(), futureResult);
|
||||
tasks.add(taskInProgress);
|
||||
***REMOVED***
|
||||
|
||||
if (!tasks.isEmpty()) {
|
||||
ArrayList<TaskInProgress> dones = new ArrayList<>();
|
||||
for (TaskInProgress taskInProgress : tasks) {
|
||||
Future<TaskStatus> futureResult = taskInProgress.getFuture();
|
||||
if (futureResult.isDone()) {
|
||||
TaskStatus result = null;
|
||||
***REMOVED***
|
||||
result = futureResult.get(timeout, TimeUnit.MILLISECONDS);
|
||||
logger.debug("DataMinerTesterTask: " + result);
|
||||
|
||||
***REMOVED*** catch (InterruptedException | ExecutionException e) {
|
||||
logger.error("DataMinerTesterTask: " + e.getLocalizedMessage(), e);
|
||||
***REMOVED*** catch (TimeoutException e) {
|
||||
logger.error("DataMinerTesterTask No response after " + timeout + " milliseconds!");
|
||||
futureResult.cancel(true);
|
||||
***REMOVED***
|
||||
dones.add(taskInProgress);
|
||||
***REMOVED*** else {
|
||||
GregorianCalendar now = new GregorianCalendar();
|
||||
long diff = now.getTimeInMillis() - taskInProgress.getStartTime().getTimeInMillis();
|
||||
if (diff > timeout) {
|
||||
futureResult.cancel(true);
|
||||
dones.add(taskInProgress);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
tasks.removeAll(dones);
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
Thread.sleep(Constants.DAEMON_SLEEP_MILLIS);
|
||||
***REMOVED*** catch (InterruptedException e) {
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
private void retrieveTimeOut() {
|
||||
long timeo = 0;
|
||||
|
||||
logger.info("DataMinerTester use default configuration for threadpool");
|
||||
timeo = Constants.SERVICE_CLIENT_TIMEOUT_DEFAULT_MILLIS;
|
||||
|
||||
if (timeo > 0) {
|
||||
timeout = timeo;
|
||||
sce.getServletContext().setAttribute(SessionConstants.DATAMINERTESTER_MONITOR_TIME_OUT_PERIODMILLIS,
|
||||
Long.valueOf(timeout));
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
|
||||
private void startThreadPoolTimeoutUpdateTimer() {
|
||||
***REMOVED***
|
||||
|
||||
threadPoolTimeoutUpdateTimer = new Timer();
|
||||
threadPoolTimeoutUpdateTimer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
logger.debug("ThreadPool request update of timeout");
|
||||
retrieveTimeOut();
|
||||
***REMOVED***
|
||||
***REMOVED***, timeoutUpdate, timeoutUpdate);
|
||||
***REMOVED***
|
||||
logger.error("Error retrieving thread pool timeout!", e);
|
||||
return;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,97 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.task.TaskRequest;
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.task.TaskWrapper;
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.testbatch.TesterCaller;
|
||||
***REMOVED***
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.result.BatchTestResult;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.task.TaskStatus;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class DataMinerTesterCallable implements Callable<TaskStatus> {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(DataMinerTesterCallable.class);
|
||||
|
||||
private TaskRequest taskRequest;
|
||||
|
||||
public DataMinerTesterCallable(TaskRequest taskRequest) {
|
||||
super();
|
||||
this.taskRequest = taskRequest;
|
||||
logger.debug("DataMinerTesterCallable: " + taskRequest);
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public TaskStatus call() throws Exception {
|
||||
***REMOVED***
|
||||
|
||||
HttpSession httpSession = taskRequest.getHttpSession();
|
||||
if (httpSession == null) {
|
||||
logger.error("Error retrieving HttpSession in DataMinerTesterCallable: is null");
|
||||
return TaskStatus.ERROR;
|
||||
***REMOVED***
|
||||
|
||||
logger.debug("Set SecurityToken: " + taskRequest.getServiceCredentials().getToken());
|
||||
SecurityTokenProvider.instance.set(taskRequest.getServiceCredentials().getToken());
|
||||
logger.debug("Set ScopeProvider: " + taskRequest.getServiceCredentials().getScope());
|
||||
ScopeProvider.instance.set(taskRequest.getServiceCredentials().getScope());
|
||||
TesterCaller testerCaller = new TesterCaller();
|
||||
|
||||
BatchTestResult result = null;
|
||||
|
||||
***REMOVED***
|
||||
result = testerCaller.runTest(taskRequest);
|
||||
|
||||
***REMOVED*** catch (ServiceException e) {
|
||||
|
||||
TaskWrapper taskWrapper = new TaskWrapper(taskRequest.getOperationId(), TaskStatus.ERROR,
|
||||
e.getLocalizedMessage());
|
||||
|
||||
HashMap<String, TaskWrapper> taskWrapperMap = SessionUtil.getTaskWrapperMap(httpSession,
|
||||
taskRequest.getServiceCredentials());
|
||||
if (taskWrapperMap == null) {
|
||||
taskWrapperMap = new HashMap<>();
|
||||
SessionUtil.setTaskWrapperMap(httpSession, taskRequest.getServiceCredentials(), taskWrapperMap);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
taskWrapperMap.put(taskWrapper.getOperationId(), taskWrapper);
|
||||
|
||||
return TaskStatus.ERROR;
|
||||
***REMOVED***
|
||||
|
||||
|
||||
TaskWrapper taskWrapper = new TaskWrapper(taskRequest.getOperationId(), TaskStatus.COMPLETED,
|
||||
result);
|
||||
|
||||
HashMap<String, TaskWrapper> taskWrapperMap = SessionUtil.getTaskWrapperMap(httpSession,
|
||||
taskRequest.getServiceCredentials());
|
||||
|
||||
if (taskWrapperMap == null) {
|
||||
taskWrapperMap = new HashMap<>();
|
||||
SessionUtil.setTaskWrapperMap(httpSession, taskRequest.getServiceCredentials(), taskWrapperMap);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
taskWrapperMap.put(taskWrapper.getOperationId(), taskWrapper);
|
||||
return TaskStatus.COMPLETED;
|
||||
|
||||
***REMOVED***
|
||||
logger.error("DataMinerTesterDaemon Execute(): " + e.getLocalizedMessage(), e);
|
||||
return TaskStatus.ERROR;
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***
|
|
@ -0,0 +1,50 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server;
|
||||
|
||||
|
||||
import javax.servlet.ServletContextEvent;
|
||||
import javax.servlet.ServletContextListener;
|
||||
import javax.servlet.annotation.WebListener;
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
@WebListener
|
||||
public class DataMinerTesterListener implements ServletContextListener {
|
||||
|
||||
private static Logger logger = LoggerFactory
|
||||
.getLogger(DataMinerTesterListener.class);
|
||||
|
||||
private DataMinerTesterBatchDaemon dataMinerTesterBatchDaemon = null;
|
||||
private Thread thread = null;
|
||||
|
||||
@Override
|
||||
public void contextInitialized(ServletContextEvent sce) {
|
||||
|
||||
dataMinerTesterBatchDaemon = new DataMinerTesterBatchDaemon(sce);
|
||||
thread = new Thread(dataMinerTesterBatchDaemon);
|
||||
logger.debug("Starting DataMinerTesterBatchDaemon: " + thread);
|
||||
thread.start();
|
||||
logger.info("DataMinerTesterBatchDaemon process successfully started.");
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void contextDestroyed(ServletContextEvent sce) {
|
||||
logger.debug("Stopping DataMinerTesterBatchDaemon: " + thread);
|
||||
if (thread != null) {
|
||||
dataMinerTesterBatchDaemon.terminate();
|
||||
***REMOVED***
|
||||
thread.join();
|
||||
***REMOVED*** catch (InterruptedException e) {
|
||||
***REMOVED***
|
||||
logger.debug("DataMinerTesterBatchDaemon successfully stopped.");
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,442 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server;
|
||||
|
||||
import java.util.HashMap;
|
||||
***REMOVED***
|
||||
import java.util.Queue;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
import org.gcube.data.analysis.dataminermanagercl.server.util.ServiceCredentials;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.OutputData;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.computations.ComputationId;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.Parameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.process.ComputationStatus;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.process.ComputationStatus.Status;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
import org.gcube.portlets.user.dataminermanagertester.client.rpc.DataMinerTesterService;
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.task.TaskRequest;
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.task.TaskWrapper;
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.testbuild.TestBuilder;
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.testconfig.DMTest;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.DMBatchConfig;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.DMConfig;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.DMDiffConfig;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.TestType;
|
||||
***REMOVED***
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.result.BatchTestResult;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.session.UserInfo;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.task.TaskStatus;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class DataMinerTesterServiceImpl extends RemoteServiceServlet implements DataMinerTesterService {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(DataMinerTesterServiceImpl.class);
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***{@inheritDoc***REMOVED***
|
||||
***REMOVED***
|
||||
@Override
|
||||
public void init() throws ServletException {
|
||||
super.init();
|
||||
logger.info("DataMiner Tester Service started!");
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***{@inheritDoc***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
@Override
|
||||
public UserInfo hello(String token) throws ServiceException {
|
||||
***REMOVED***
|
||||
ServiceCredentials serviceCredentials = SessionUtil.getServiceCredentials(this.getThreadLocalRequest(),
|
||||
token);
|
||||
logger.debug("hello()");
|
||||
UserInfo userInfo = new UserInfo(serviceCredentials.getUserName(), serviceCredentials.getGroupId(),
|
||||
serviceCredentials.getGroupName(), serviceCredentials.getScope(), serviceCredentials.getEmail(),
|
||||
serviceCredentials.getFullName());
|
||||
logger.debug("UserInfo: " + userInfo);
|
||||
return userInfo;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
throw e;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
logger.error("Hello(): " + e.getLocalizedMessage(), e);
|
||||
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public String getCapabilities(String token, DMConfig dmConfig) throws ServiceException {
|
||||
|
||||
***REMOVED***
|
||||
HttpServletRequest httpRequest = this.getThreadLocalRequest();
|
||||
@SuppressWarnings("unused")
|
||||
ServiceCredentials serviceCredentials = SessionUtil.getServiceCredentials(httpRequest, token);
|
||||
logger.debug("getCapabilities()");
|
||||
|
||||
SClient sClient = new DataMinerService().getClient(dmConfig.getToken(), dmConfig.getDmUrl());
|
||||
|
||||
List<OperatorsClassification> operatorsClassifications = sClient.getOperatorsClassifications();
|
||||
logger.debug("OperatorsClassifications: " + operatorsClassifications);
|
||||
|
||||
StringBuilder result = new StringBuilder();
|
||||
|
||||
result.append("Success\n");
|
||||
|
||||
for (OperatorsClassification opClass : operatorsClassifications) {
|
||||
for (Operator op : opClass.getOperators()) {
|
||||
result.append("Operator[Name=" + op.getName() + "]");
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
return result.toString();
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
throw e;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public String getOperatorsDiff(String token, DMDiffConfig operatorsDiffConfig) throws ServiceException {
|
||||
***REMOVED***
|
||||
logger.debug("getOperatorsDiff: dm1=" + operatorsDiffConfig.getDm1() + ", dm2="
|
||||
+ operatorsDiffConfig.getDm2());
|
||||
HttpServletRequest httpRequest = this.getThreadLocalRequest();
|
||||
@SuppressWarnings("unused")
|
||||
ServiceCredentials serviceCredentials = SessionUtil.getServiceCredentials(httpRequest, token);
|
||||
|
||||
SClient sClient1 = new DataMinerService().getClient(operatorsDiffConfig.getToken1(),
|
||||
operatorsDiffConfig.getDmUrl1());
|
||||
|
||||
List<OperatorsClassification> operatorsClassifications1 = sClient1.getOperatorsClassifications();
|
||||
logger.debug("OperatorsClassifications1: " + operatorsClassifications1);
|
||||
|
||||
SClient sClient2 = new DataMinerService().getClient(operatorsDiffConfig.getToken2(),
|
||||
operatorsDiffConfig.getDmUrl2());
|
||||
List<OperatorsClassification> operatorsClassifications2 = sClient2.getOperatorsClassifications();
|
||||
logger.debug("OperatorsClassifications2: " + operatorsClassifications2);
|
||||
|
||||
StringBuilder result = new StringBuilder();
|
||||
|
||||
result.append("Success\n");
|
||||
|
||||
result.append("----------------------------------\n");
|
||||
result.append("Operators in: " + operatorsDiffConfig.getDm1() + " \n");
|
||||
result.append("and not in: " + operatorsDiffConfig.getDm2() + " \n");
|
||||
for (OperatorsClassification opClass1 : operatorsClassifications1) {
|
||||
for (Operator op1 : opClass1.getOperators()) {
|
||||
boolean op1Found = false;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
if (op1.getId().compareTo(op2.getId()) == 0) {
|
||||
op1Found = true;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
if (op1Found) {
|
||||
break;
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
if (!op1Found) {
|
||||
result.append("Op: " + op1.getId() + " \n");
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
|
||||
result.append("----------------------------------\n");
|
||||
result.append("Operators in: " + operatorsDiffConfig.getDm2() + " \n");
|
||||
result.append("and not in: " + operatorsDiffConfig.getDm1() + " \n");
|
||||
for (OperatorsClassification opClass2 : operatorsClassifications2) {
|
||||
for (Operator op2 : opClass2.getOperators()) {
|
||||
boolean op2Found = false;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
if (op2.getId().compareTo(op1.getId()) == 0) {
|
||||
op2Found = true;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
if (op2Found) {
|
||||
break;
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
if (!op2Found) {
|
||||
result.append("Op: " + op2.getId() + " \n");
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
|
||||
return result.toString();
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
throw e;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public ComputationId startSimpleTest(String token, DMConfig dmConfig) throws ServiceException {
|
||||
|
||||
***REMOVED***
|
||||
HttpServletRequest httpRequest = this.getThreadLocalRequest();
|
||||
@SuppressWarnings("unused")
|
||||
ServiceCredentials serviceCredentials = SessionUtil.getServiceCredentials(httpRequest, token);
|
||||
logger.debug("startSimpleTest()");
|
||||
TestType t = null;
|
||||
if (dmConfig == null || dmConfig.getTestType() == null || dmConfig.getTestType().isEmpty()) {
|
||||
throw new ServiceException("Invalid test type: " + dmConfig.getTestType());
|
||||
***REMOVED***
|
||||
t = TestType.getTypeFromId(dmConfig.getTestType());
|
||||
***REMOVED***
|
||||
|
||||
TestBuilder testBuilder = new TestBuilder();
|
||||
DMTest dmTest = testBuilder.build(t);
|
||||
|
||||
SClient sClient = new DataMinerService().getClient(dmConfig.getToken(), dmConfig.getDmUrl());
|
||||
|
||||
List<OperatorsClassification> operatorsClassifications = sClient.getOperatorsClassifications();
|
||||
logger.debug("OperatorsClassifications: " + operatorsClassifications);
|
||||
|
||||
Operator operator = sClient.getOperatorById(dmTest.getId());
|
||||
|
||||
if (operator == null) {
|
||||
logger.error("Operator not found");
|
||||
throw new ServiceException("Operator: " + dmTest.getId() + " not found");
|
||||
***REMOVED***
|
||||
logger.debug("Operator Name: " + operator.getName() + " (" + operator.getId() + ")");
|
||||
logger.debug("Operator: " + operator);
|
||||
List<Parameter> parameters = sClient.getInputParameters(operator);
|
||||
logger.debug("Parameters: " + parameters);
|
||||
for (Parameter parameter : parameters) {
|
||||
logger.debug(
|
||||
"Parameter:[Name=" + parameter.getName() + ", Typology=" + parameter.getTypology() + "]");
|
||||
***REMOVED***
|
||||
|
||||
dmTest.createRequest(operator);
|
||||
logger.debug("Start Computation");
|
||||
ComputationId computationId = sClient.startComputation(operator);
|
||||
logger.debug("Started ComputationId: " + computationId);
|
||||
return computationId;
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
throw e;
|
||||
***REMOVED***
|
||||
logger.error("An error occurred starting simple test: " + e.getLocalizedMessage(), e);
|
||||
***REMOVED***
|
||||
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public Status monitorSimpleTest(String token, DMConfig dmConfig, ComputationId computationId)
|
||||
throws ServiceException {
|
||||
|
||||
***REMOVED***
|
||||
HttpServletRequest httpRequest = this.getThreadLocalRequest();
|
||||
@SuppressWarnings("unused")
|
||||
ServiceCredentials serviceCredentials = SessionUtil.getServiceCredentials(httpRequest, token);
|
||||
|
||||
SClient sClient = new DataMinerService().getClient(dmConfig.getToken(), dmConfig.getDmUrl());
|
||||
|
||||
logger.debug("Requesting operation progress");
|
||||
ComputationStatus computationStatus = null;
|
||||
***REMOVED***
|
||||
computationStatus = sClient.getComputationStatus(computationId);
|
||||
***REMOVED*** catch (Exception e) {
|
||||
logger.error("Error retrieving computation Status:" + e.getLocalizedMessage(), e);
|
||||
throw new ServiceException("Error retrieving computation Status:" + e.getLocalizedMessage(), e);
|
||||
|
||||
***REMOVED***
|
||||
logger.debug("ComputationStatus: " + computationStatus);
|
||||
if (computationStatus == null) {
|
||||
logger.error("ComputationStatus is null");
|
||||
throw new ServiceException("Error retrieving computation Status: ComputationStatus is null");
|
||||
***REMOVED***
|
||||
|
||||
Status status = computationStatus.getStatus();
|
||||
if (status == null) {
|
||||
logger.error("Status is null");
|
||||
throw new ServiceException("Error retrieving computation Status: Status is null");
|
||||
***REMOVED***
|
||||
|
||||
return status;
|
||||
|
||||
// monitoringComputation(computationId, sClient);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
throw e;
|
||||
***REMOVED***
|
||||
logger.error("An error occurred monitoring simple test: " + e.getLocalizedMessage(), e);
|
||||
***REMOVED***
|
||||
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public String retrieveOutputForSimpleTest(String token, DMConfig dmConfig, ComputationId computationId)
|
||||
throws ServiceException {
|
||||
|
||||
***REMOVED***
|
||||
HttpServletRequest httpRequest = this.getThreadLocalRequest();
|
||||
@SuppressWarnings("unused")
|
||||
ServiceCredentials serviceCredentials = SessionUtil.getServiceCredentials(httpRequest, token);
|
||||
logger.debug("retrieveOutputForSimpleTest()");
|
||||
|
||||
TestType t = null;
|
||||
if (dmConfig == null || dmConfig.getTestType() == null || dmConfig.getTestType().isEmpty()) {
|
||||
throw new ServiceException("Invalid test type: " + dmConfig.getTestType());
|
||||
***REMOVED***
|
||||
t = TestType.getTypeFromId(dmConfig.getTestType());
|
||||
***REMOVED***
|
||||
|
||||
TestBuilder testBuilder = new TestBuilder();
|
||||
DMTest dmTest = testBuilder.build(t);
|
||||
|
||||
SClient sClient = new DataMinerService().getClient(dmConfig.getToken(), dmConfig.getDmUrl());
|
||||
|
||||
OutputData outputData = sClient.getOutputDataByComputationId(computationId);
|
||||
|
||||
if (dmTest.isValidResult(outputData)) {
|
||||
return dmTest.getResult(outputData);
|
||||
***REMOVED***
|
||||
throw new ServiceException("Invalid output data for test: " + dmTest.getId());
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
throw e;
|
||||
***REMOVED***
|
||||
logger.error("An error occurred monitoring simple test: " + e.getLocalizedMessage(), e);
|
||||
***REMOVED***
|
||||
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public String startBatchTest(String token, DMBatchConfig dmBatchConfig) throws ServiceException {
|
||||
|
||||
***REMOVED***
|
||||
HttpServletRequest httpRequest = this.getThreadLocalRequest();
|
||||
ServiceCredentials serviceCredentials = SessionUtil.getServiceCredentials(httpRequest, token);
|
||||
logger.debug("startBatchTest()");
|
||||
|
||||
String operationId = UUID.randomUUID().toString();
|
||||
logger.info("DataMinerBatchTest Task Operation Id: " + operationId);
|
||||
logger.info("Session Id: " + httpRequest.getSession());
|
||||
|
||||
TaskRequest taskRequest = new TaskRequest(operationId, httpRequest.getSession(), serviceCredentials,
|
||||
dmBatchConfig);
|
||||
|
||||
ServletContext appScope = httpRequest.getServletContext();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Queue<TaskRequest> queue = ((Queue<TaskRequest>) appScope
|
||||
.getAttribute(SessionConstants.TASK_REQUEST_QUEUE));
|
||||
|
||||
queue.add(taskRequest);
|
||||
logger.debug("operationId: " + operationId);
|
||||
return operationId;
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
throw e;
|
||||
***REMOVED***
|
||||
logger.error("An error occurred starting batch test: " + e.getLocalizedMessage(), e);
|
||||
***REMOVED***
|
||||
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public TaskStatus monitorBatchTest(String token, String operationId) throws ServiceException {
|
||||
***REMOVED***
|
||||
HttpServletRequest httpRequest = this.getThreadLocalRequest();
|
||||
ServiceCredentials serviceCredentials = SessionUtil.getServiceCredentials(httpRequest, token);
|
||||
|
||||
HashMap<String, TaskWrapper> taskWrapperMap = SessionUtil.getTaskWrapperMap(httpRequest.getSession(),
|
||||
serviceCredentials);
|
||||
if (taskWrapperMap == null) {
|
||||
return null;
|
||||
***REMOVED***
|
||||
if (taskWrapperMap.containsKey(operationId)) {
|
||||
TaskWrapper taskWrapper = taskWrapperMap.get(operationId);
|
||||
return taskWrapper.getTaskStatus();
|
||||
***REMOVED*** else {
|
||||
return null;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
throw e;
|
||||
***REMOVED***
|
||||
logger.error("MonitorBatchTest(): " + e.getLocalizedMessage(), e);
|
||||
throw new ServiceException(e.getLocalizedMessage());
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public BatchTestResult retrieveOutputForBatchTest(String token, String operationId) throws ServiceException {
|
||||
***REMOVED***
|
||||
HttpServletRequest httpRequest = this.getThreadLocalRequest();
|
||||
ServiceCredentials serviceCredentials = SessionUtil.getServiceCredentials(httpRequest, token);
|
||||
logger.debug("retrieveOutputForBatchTest()");
|
||||
|
||||
HashMap<String, TaskWrapper> taskWrapperMap = SessionUtil.getTaskWrapperMap(httpRequest.getSession(),
|
||||
serviceCredentials);
|
||||
if (taskWrapperMap == null) {
|
||||
return null;
|
||||
***REMOVED***
|
||||
if (taskWrapperMap.containsKey(operationId)) {
|
||||
TaskWrapper taskWrapper = taskWrapperMap.get(operationId);
|
||||
return taskWrapper.getResult();
|
||||
***REMOVED*** else {
|
||||
return null;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
throw e;
|
||||
***REMOVED***
|
||||
logger.error("RetrieveOutputForBatchTest(): " + e.getLocalizedMessage(), e);
|
||||
throw new ServiceException(e.getLocalizedMessage());
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,13 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server;
|
||||
|
||||
public class SessionConstants {
|
||||
|
||||
//Context
|
||||
public static final String DATAMINERTESTER_MONITOR_TIME_OUT_PERIODMILLIS = "DATAMINERTESTER_MONITOR_TIME_OUT_PERIODMILLIS";
|
||||
|
||||
//Session
|
||||
public static final String TASK_WRAPPER_MAP = "TASK_WRAPPER_MAP";
|
||||
public static final String TASK_REQUEST_QUEUE = "TASK_REQUEST_QUEUE";
|
||||
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,164 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.dataminermanagertester.server;
|
||||
|
||||
import static org.gcube.common.authorization.client.Constants.authorizationService;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.gcube.common.authorization.library.AuthorizationEntry;
|
||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||
import org.gcube.common.portal.PortalContext;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.data.analysis.dataminermanagercl.server.util.ServiceCredentials;
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.task.TaskWrapper;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SessionUtil {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(SessionUtil.class);
|
||||
|
||||
public static ServiceCredentials getServiceCredentials(HttpServletRequest httpServletRequest, String token)
|
||||
throws ServiceException {
|
||||
|
||||
ServiceCredentials sCredentials = null;
|
||||
String userName = null;
|
||||
String scope = null;
|
||||
String groupId = null;
|
||||
String groupName = null;
|
||||
|
||||
if (Constants.DEBUG_MODE) {
|
||||
logger.debug("No credential found in session, use test user!");
|
||||
/*
|
||||
***REMOVED***InfoLocale infoLocale = getInfoLocale(httpServletRequest, null);
|
||||
***REMOVED***Locale locale = new Locale(infoLocale.getLanguage());
|
||||
***REMOVED***
|
||||
***REMOVED***ResourceBundle messages = ResourceBundle.getBundle(
|
||||
***REMOVED***StatAlgoImporterServiceMessagesConstants.TDGWTServiceMessages,
|
||||
***REMOVED***locale);
|
||||
***REMOVED***
|
||||
userName = Constants.DEFAULT_USER;
|
||||
scope = Constants.DEFAULT_SCOPE;
|
||||
token = Constants.DEFAULT_TOKEN;
|
||||
|
||||
logger.debug("Set SecurityToken: " + token);
|
||||
SecurityTokenProvider.instance.set(token);
|
||||
logger.debug("Set ScopeProvider: " + scope);
|
||||
ScopeProvider.instance.set(scope);
|
||||
|
||||
sCredentials = new ServiceCredentials(userName, scope, token);
|
||||
|
||||
***REMOVED*** else {
|
||||
logger.debug("Retrieving credential in session!");
|
||||
PortalContext pContext = PortalContext.getConfiguration();
|
||||
|
||||
logger.debug("Set SecurityToken: " + token);
|
||||
SecurityTokenProvider.instance.set(token);
|
||||
|
||||
AuthorizationEntry entry;
|
||||
***REMOVED***
|
||||
entry = authorizationService().get(token);
|
||||
***REMOVED*** catch (Exception e) {
|
||||
throw new ServiceException("AuthorizationEntry not found: " + e.getLocalizedMessage(), e);
|
||||
***REMOVED***
|
||||
|
||||
scope = entry.getContext();
|
||||
logger.debug("Set ScopeProvider: " + scope);
|
||||
ScopeProvider.instance.set(scope);
|
||||
|
||||
if (scope == null || scope.isEmpty()) {
|
||||
String error = "Error retrieving scope: " + scope;
|
||||
logger.error(error);
|
||||
throw new ServiceException(error);
|
||||
***REMOVED***
|
||||
|
||||
GCubeUser gCubeUser = pContext.getCurrentUser(httpServletRequest);
|
||||
|
||||
if (gCubeUser == null) {
|
||||
String error = "Error retrieving gCubeUser in scope " + scope + ": " + gCubeUser;
|
||||
logger.error(error);
|
||||
throw new ServiceException(error);
|
||||
***REMOVED***
|
||||
|
||||
userName = gCubeUser.getUsername();
|
||||
|
||||
if (userName == null || userName.isEmpty()) {
|
||||
String error = "Error retrieving username in scope " + scope + ": " + userName;
|
||||
logger.error(error);
|
||||
throw new ServiceException(error);
|
||||
***REMOVED***
|
||||
|
||||
token = pContext.getCurrentUserToken(scope, userName);
|
||||
|
||||
if (token == null || token.isEmpty()) {
|
||||
String error = "Error retrieving token for " + userName + " in " + scope + ": " + token;
|
||||
logger.error(error);
|
||||
throw new ServiceException(error);
|
||||
***REMOVED***
|
||||
|
||||
String name = gCubeUser.getFirstName();
|
||||
String lastName = gCubeUser.getLastName();
|
||||
String fullName = gCubeUser.getFullname();
|
||||
|
||||
String userAvatarURL = gCubeUser.getUserAvatarURL();
|
||||
|
||||
String email = gCubeUser.getEmail();
|
||||
|
||||
//groupId = String.valueOf(pContext.getCurrentGroupId(httpServletRequest));
|
||||
|
||||
//groupName = pContext.getCurrentGroupName(httpServletRequest);
|
||||
|
||||
sCredentials = new ServiceCredentials(userName, fullName, name, lastName, email, scope, groupId, groupName,
|
||||
userAvatarURL, token);
|
||||
***REMOVED***
|
||||
|
||||
logger.debug("ServiceCredentials: " + sCredentials);
|
||||
|
||||
return sCredentials;
|
||||
***REMOVED***
|
||||
|
||||
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***@param httpSession http session
|
||||
***REMOVED***@param serviceCredentials service credentials
|
||||
***REMOVED***@return hash map of tasks
|
||||
***REMOVED***
|
||||
public static HashMap<String, TaskWrapper> getTaskWrapperMap(
|
||||
HttpSession httpSession,
|
||||
ServiceCredentials serviceCredentials) {
|
||||
@SuppressWarnings("unchecked")
|
||||
HashMap<String, TaskWrapper> taskWrapperMap = (HashMap<String, TaskWrapper>) httpSession
|
||||
.getAttribute(SessionConstants.TASK_WRAPPER_MAP);
|
||||
return taskWrapperMap;
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***@param httpSession session
|
||||
***REMOVED***@param serviceCredentials service credentials
|
||||
***REMOVED***@param taskWrapperMap task wrapper map
|
||||
***REMOVED***
|
||||
public static void setTaskWrapperMap(HttpSession httpSession,
|
||||
ServiceCredentials serviceCredentials,
|
||||
HashMap<String, TaskWrapper> taskWrapperMap) {
|
||||
httpSession.setAttribute(SessionConstants.TASK_WRAPPER_MAP, taskWrapperMap);
|
||||
return;
|
||||
***REMOVED***
|
||||
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,55 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server.is;
|
||||
|
||||
import java.util.ArrayList;
|
||||
***REMOVED***
|
||||
|
||||
import org.gcube.common.resources.gcore.ServiceEndpoint;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.resources.discovery.client.api.DiscoveryClient;
|
||||
import org.gcube.resources.discovery.client.queries.api.SimpleQuery;
|
||||
import org.gcube.resources.discovery.icclient.ICFactory;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class InformationSystemUtils {
|
||||
|
||||
private static Logger logger = LoggerFactory
|
||||
.getLogger(InformationSystemUtils.class);
|
||||
|
||||
public static List<String> retrieveServiceAddress(String category,
|
||||
String name, String scope) throws Exception {
|
||||
***REMOVED***
|
||||
|
||||
if (scope == null || scope.length() == 0)
|
||||
return new ArrayList<String>();
|
||||
|
||||
ScopeProvider.instance.set(scope);
|
||||
|
||||
SimpleQuery query = ICFactory.queryFor(ServiceEndpoint.class);
|
||||
query.addCondition(
|
||||
"$resource/Profile/Category/text() eq '" + category + "'")
|
||||
.addCondition(
|
||||
"$resource/Profile/Name/text() eq '" + name + "'")
|
||||
.setResult(
|
||||
"$resource/Profile/AccessPoint/Interface/Endpoint/text()");
|
||||
DiscoveryClient<String> client = ICFactory.client();
|
||||
List<String> addresses = client.submit(query);
|
||||
|
||||
return addresses;
|
||||
|
||||
***REMOVED***
|
||||
logger.error("Error in discovery DataMiner Service Endpoint in scope: "
|
||||
+ scope);
|
||||
logger.error("Error: " + e.getLocalizedMessage());
|
||||
***REMOVED***
|
||||
throw e;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,48 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server.task;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Calendar;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.task.TaskStatus;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class TaskInProgress implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -1957012551318695316L;
|
||||
private Calendar startTime;
|
||||
private Future<TaskStatus> future;
|
||||
|
||||
public TaskInProgress(Calendar startTime, Future<TaskStatus> future) {
|
||||
super();
|
||||
this.startTime = startTime;
|
||||
this.future = future;
|
||||
***REMOVED***
|
||||
|
||||
public Calendar getStartTime() {
|
||||
return startTime;
|
||||
***REMOVED***
|
||||
|
||||
public void setStartTime(Calendar startTime) {
|
||||
this.startTime = startTime;
|
||||
***REMOVED***
|
||||
|
||||
public Future<TaskStatus> getFuture() {
|
||||
return future;
|
||||
***REMOVED***
|
||||
|
||||
public void setFuture(Future<TaskStatus> future) {
|
||||
this.future = future;
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TaskInProgress [startTime=" + startTime + ", future=" + future + "]";
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,72 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server.task;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.gcube.data.analysis.dataminermanagercl.server.util.ServiceCredentials;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.DMBatchConfig;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class TaskRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -4010108343968344171L;
|
||||
private String operationId;
|
||||
private HttpSession httpSession;
|
||||
private ServiceCredentials serviceCredentials;
|
||||
private DMBatchConfig dmBatchConfig;
|
||||
|
||||
public TaskRequest(String operationId, HttpSession httpSession, ServiceCredentials serviceCredentials,
|
||||
DMBatchConfig dmBatchConfig) {
|
||||
super();
|
||||
this.operationId = operationId;
|
||||
this.httpSession = httpSession;
|
||||
this.serviceCredentials = serviceCredentials;
|
||||
this.dmBatchConfig = dmBatchConfig;
|
||||
|
||||
***REMOVED***
|
||||
|
||||
public String getOperationId() {
|
||||
return operationId;
|
||||
***REMOVED***
|
||||
|
||||
public void setOperationId(String operationId) {
|
||||
this.operationId = operationId;
|
||||
***REMOVED***
|
||||
|
||||
public HttpSession getHttpSession() {
|
||||
return httpSession;
|
||||
***REMOVED***
|
||||
|
||||
public void setHttpSession(HttpSession httpSession) {
|
||||
this.httpSession = httpSession;
|
||||
***REMOVED***
|
||||
|
||||
public ServiceCredentials getServiceCredentials() {
|
||||
return serviceCredentials;
|
||||
***REMOVED***
|
||||
|
||||
public void setServiceCredentials(ServiceCredentials serviceCredentials) {
|
||||
this.serviceCredentials = serviceCredentials;
|
||||
***REMOVED***
|
||||
|
||||
public DMBatchConfig getDmBatchConfig() {
|
||||
return dmBatchConfig;
|
||||
***REMOVED***
|
||||
|
||||
public void setDmBatchConfig(DMBatchConfig dmBatchConfig) {
|
||||
this.dmBatchConfig = dmBatchConfig;
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TaskRequest [operationId=" + operationId + ", httpSession=" + httpSession + ", serviceCredentials="
|
||||
+ serviceCredentials + ", dmBatchConfig=" + dmBatchConfig + "]";
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,76 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server.task;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.result.BatchTestResult;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.task.TaskStatus;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class TaskWrapper implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -4010108343968344171L;
|
||||
private String operationId;
|
||||
private TaskStatus taskStatus;
|
||||
private String errorMessage;
|
||||
private BatchTestResult result;
|
||||
|
||||
public TaskWrapper(String operationId, TaskStatus taskStatus, BatchTestResult result) {
|
||||
super();
|
||||
this.operationId = operationId;
|
||||
this.taskStatus = taskStatus;
|
||||
this.errorMessage = null;
|
||||
this.result = result;
|
||||
***REMOVED***
|
||||
|
||||
public TaskWrapper(String operationId, TaskStatus taskStatus, String errorMessage) {
|
||||
super();
|
||||
this.operationId = operationId;
|
||||
this.taskStatus = taskStatus;
|
||||
this.errorMessage = errorMessage;
|
||||
this.result = null;
|
||||
***REMOVED***
|
||||
|
||||
public String getOperationId() {
|
||||
return operationId;
|
||||
***REMOVED***
|
||||
|
||||
public void setOperationId(String operationId) {
|
||||
this.operationId = operationId;
|
||||
***REMOVED***
|
||||
|
||||
public TaskStatus getTaskStatus() {
|
||||
return taskStatus;
|
||||
***REMOVED***
|
||||
|
||||
public void setTaskStatus(TaskStatus taskStatus) {
|
||||
this.taskStatus = taskStatus;
|
||||
***REMOVED***
|
||||
|
||||
public BatchTestResult getResult() {
|
||||
return result;
|
||||
***REMOVED***
|
||||
|
||||
public void setResult(BatchTestResult result) {
|
||||
this.result = result;
|
||||
***REMOVED***
|
||||
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
***REMOVED***
|
||||
|
||||
public void setErrorMessage(String errorMessage) {
|
||||
this.errorMessage = errorMessage;
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TaskWrapper [operationId=" + operationId + ", taskStatus=" + taskStatus + ", errorMessage="
|
||||
+ errorMessage + ", result=" + result + "]";
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,258 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server.testbatch;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.OutputData;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.computations.ComputationId;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.Parameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.process.ComputationStatus;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.process.ComputationStatus.Status;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.task.TaskRequest;
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.testbuild.TestBuilder;
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.testconfig.DMTest;
|
||||
***REMOVED***
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.DMBatchConfig;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.TestType;
|
||||
***REMOVED***
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.result.BatchTestResult;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.result.SingleTestResult;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class TesterCaller {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(TesterCaller.class);
|
||||
|
||||
private DMTest dmTest;
|
||||
private DMBatchConfig dmBatchconfig;
|
||||
private ArrayList<String> dms;
|
||||
|
||||
public BatchTestResult runTest(TaskRequest taskRequest) throws ServiceException {
|
||||
|
||||
TestType t = null;
|
||||
if (taskRequest == null || taskRequest.getDmBatchConfig() == null
|
||||
|| taskRequest.getDmBatchConfig().getTestType() == null
|
||||
|| taskRequest.getDmBatchConfig().getTestType().isEmpty()) {
|
||||
throw new ServiceException("Invalid test type: " + taskRequest.getDmBatchConfig().getTestType());
|
||||
***REMOVED*** else {
|
||||
t = TestType.getTypeFromId(taskRequest.getDmBatchConfig().getTestType());
|
||||
***REMOVED***
|
||||
|
||||
dmBatchconfig = taskRequest.getDmBatchConfig();
|
||||
dms = taskRequest.getDmBatchConfig().getDms();
|
||||
|
||||
if (dms == null || dms.isEmpty()) {
|
||||
logger.error("Invalid urls list");
|
||||
throw new ServiceException("Invalid urls list");
|
||||
***REMOVED***
|
||||
|
||||
BatchTestResult result;
|
||||
|
||||
if (t.compareTo(TestType.Capabilities) == 0) {
|
||||
result = runGetCapabilities();
|
||||
***REMOVED*** else {
|
||||
result = runAlgorithms(t);
|
||||
***REMOVED***
|
||||
|
||||
return result;
|
||||
***REMOVED***
|
||||
|
||||
private BatchTestResult runGetCapabilities() {
|
||||
BatchTestResult result;
|
||||
LinkedHashMap<String, SingleTestResult> testResultMap = new LinkedHashMap<>();
|
||||
for (String dm : dms) {
|
||||
***REMOVED***
|
||||
String url = null;
|
||||
if (dmBatchconfig.getProtocol() != null && dm != null) {
|
||||
dm = dm.trim();
|
||||
url = new String(dmBatchconfig.getProtocol() + "://" + dm + "/wps/");
|
||||
***REMOVED***
|
||||
|
||||
SClient sClient = new DataMinerService().getClient(dmBatchconfig.getToken(), url);
|
||||
|
||||
List<OperatorsClassification> operatorsClassifications = sClient.getOperatorsClassifications();
|
||||
***REMOVED***
|
||||
|
||||
String response = new String("Success");
|
||||
|
||||
ComputationStatus computationStatus = new ComputationStatus(Status.COMPLETE, 100f);
|
||||
SingleTestResult singleTestResult = new SingleTestResult(computationStatus, response);
|
||||
testResultMap.put(dm, singleTestResult);
|
||||
***REMOVED*** catch (Exception e) {
|
||||
logger.error("Error testing: " + dm);
|
||||
ComputationStatus computationStatus = new ComputationStatus(e);
|
||||
SingleTestResult singleTestResult = new SingleTestResult(computationStatus, null);
|
||||
testResultMap.put(dm, singleTestResult);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
result = new BatchTestResult(testResultMap);
|
||||
return result;
|
||||
***REMOVED***
|
||||
|
||||
private BatchTestResult runAlgorithms(TestType t) throws ServiceException {
|
||||
BatchTestResult result;
|
||||
TestBuilder testBuilder = new TestBuilder();
|
||||
dmTest = testBuilder.build(t);
|
||||
|
||||
LinkedHashMap<String, SingleTestResult> testResultMap = new LinkedHashMap<>();
|
||||
for (String dm : dms) {
|
||||
***REMOVED***
|
||||
String url = null;
|
||||
if (dmBatchconfig.getProtocol() != null && dm != null) {
|
||||
dm = dm.trim();
|
||||
url = new String(dmBatchconfig.getProtocol() + "://" + dm + "/wps/");
|
||||
***REMOVED***
|
||||
|
||||
SClient sClient = new DataMinerService().getClient(dmBatchconfig.getToken(), url);
|
||||
ComputationId computationId = runSingleTest(sClient);
|
||||
String response = null;
|
||||
ComputationStatus computationStatus = monitorSingleTest(sClient, computationId);
|
||||
switch (computationStatus.getStatus()) {
|
||||
case ACCEPTED:
|
||||
break;
|
||||
case CANCELLED:
|
||||
break;
|
||||
case COMPLETE:
|
||||
response = retrieveOutputForSingleTest(sClient, computationId);
|
||||
break;
|
||||
case FAILED:
|
||||
break;
|
||||
case RUNNING:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
***REMOVED***
|
||||
|
||||
SingleTestResult singleTestResult = new SingleTestResult(computationStatus, response);
|
||||
testResultMap.put(dm, singleTestResult);
|
||||
***REMOVED*** catch (Exception e) {
|
||||
logger.error("Error testing: " + dm);
|
||||
ComputationStatus computationStatus = new ComputationStatus(e);
|
||||
SingleTestResult singleTestResult = new SingleTestResult(computationStatus, null);
|
||||
testResultMap.put(dm, singleTestResult);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
result = new BatchTestResult(testResultMap);
|
||||
return result;
|
||||
***REMOVED***
|
||||
|
||||
private ComputationId runSingleTest(SClient sClient) throws ServiceException {
|
||||
***REMOVED***
|
||||
List<OperatorsClassification> operatorsClassifications = sClient.getOperatorsClassifications();
|
||||
logger.debug("OperatorsClassifications: " + operatorsClassifications);
|
||||
|
||||
Operator operator = sClient.getOperatorById(dmTest.getId());
|
||||
|
||||
if (operator == null) {
|
||||
logger.error("Operator not found");
|
||||
throw new ServiceException("Operator: " + dmTest.getId() + " not found");
|
||||
***REMOVED***
|
||||
logger.debug("Operator Name: " + operator.getName() + " (" + operator.getId() + ")");
|
||||
logger.debug("Operator: " + operator);
|
||||
List<Parameter> parameters = sClient.getInputParameters(operator);
|
||||
logger.debug("Parameters: " + parameters);
|
||||
for (Parameter parameter : parameters) {
|
||||
logger.debug(
|
||||
"Parameter:[Name=" + parameter.getName() + ", Typology=" + parameter.getTypology() + "]");
|
||||
***REMOVED***
|
||||
|
||||
dmTest.createRequest(operator);
|
||||
logger.debug("Start Computation");
|
||||
ComputationId computationId = sClient.startComputation(operator);
|
||||
logger.debug("Started ComputationId: " + computationId);
|
||||
return computationId;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
throw e;
|
||||
***REMOVED***
|
||||
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
|
||||
private ComputationStatus monitorSingleTest(SClient sClient, ComputationId computationId) throws ServiceException {
|
||||
***REMOVED***
|
||||
logger.debug("Requesting operation progress");
|
||||
ComputationStatus computationStatus = null;
|
||||
Status status = null;
|
||||
|
||||
while (status == null || status.compareTo(Status.ACCEPTED) == 0 || status.compareTo(Status.RUNNING) == 0) {
|
||||
***REMOVED***
|
||||
computationStatus = sClient.getComputationStatus(computationId);
|
||||
***REMOVED*** catch (Exception e) {
|
||||
logger.error("Error retrieving computation Status:" + e.getLocalizedMessage(), e);
|
||||
throw new ServiceException("Error retrieving computation Status:" + e.getLocalizedMessage(), e);
|
||||
|
||||
***REMOVED***
|
||||
logger.debug("ComputationStatus: " + computationStatus);
|
||||
if (computationStatus == null) {
|
||||
logger.error("ComputationStatus is null");
|
||||
throw new ServiceException("Error retrieving computation Status: ComputationStatus is null");
|
||||
***REMOVED***
|
||||
|
||||
status = computationStatus.getStatus();
|
||||
if (status == null) {
|
||||
logger.error("Status is null");
|
||||
throw new ServiceException("Error retrieving computation Status: Status is null");
|
||||
***REMOVED*** else {
|
||||
switch (status) {
|
||||
case CANCELLED:
|
||||
case COMPLETE:
|
||||
case FAILED:
|
||||
break;
|
||||
case ACCEPTED:
|
||||
case RUNNING:
|
||||
default:
|
||||
***REMOVED***
|
||||
Thread.sleep(Constants.TEST_MONITOR_PERIODMILLIS);
|
||||
***REMOVED*** catch (InterruptedException e) {
|
||||
|
||||
***REMOVED***
|
||||
break;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
return computationStatus;
|
||||
***REMOVED***
|
||||
logger.error(e.getLocalizedMessage(), e);
|
||||
throw e;
|
||||
***REMOVED***
|
||||
logger.error(e.getLocalizedMessage(), e);
|
||||
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
private String retrieveOutputForSingleTest(SClient sClient, ComputationId computationId) throws ServiceException {
|
||||
***REMOVED***
|
||||
OutputData outputData = sClient.getOutputDataByComputationId(computationId);
|
||||
|
||||
if (dmTest.isValidResult(outputData)) {
|
||||
return dmTest.getResult(outputData);
|
||||
***REMOVED***
|
||||
throw new ServiceException("Invalid output data for test: " + dmTest.getId());
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
throw e;
|
||||
***REMOVED***
|
||||
logger.error(e.getLocalizedMessage(), e);
|
||||
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,61 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server.testbuild;
|
||||
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.testconfig.BionymLocalTest;
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.testconfig.CMSY2Test;
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.testconfig.CSquareColumnCreatorTest;
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.testconfig.DBScanTest;
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.testconfig.DMTest;
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.testconfig.FeedForwardAnnTest;
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.testconfig.GenericChartsTest;
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.testconfig.ListDBNameTest;
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.testconfig.OpenMeshRecostructorGPUTest;
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.testconfig.PolygonsToMapTest;
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.testconfig.RasterDataPublisherTest;
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.testconfig.WebAppPublisherTest;
|
||||
import org.gcube.portlets.user.dataminermanagertester.server.testconfig.XYExtractorTest;
|
||||
import org.gcube.portlets.user.dataminermanagertester.shared.config.TestType;
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class TestBuilder {
|
||||
|
||||
public DMTest build(TestType testType) throws ServiceException {
|
||||
if (testType != null) {
|
||||
switch (testType) {
|
||||
case FeedForwardAnn:
|
||||
return new FeedForwardAnnTest();
|
||||
case BionymLocal:
|
||||
return new BionymLocalTest();
|
||||
case CMSY2:
|
||||
return new CMSY2Test();
|
||||
case RasterDataPublisher:
|
||||
return new RasterDataPublisherTest();
|
||||
case WebAppPublisher:
|
||||
return new WebAppPublisherTest();
|
||||
case XYExtractor:
|
||||
return new XYExtractorTest();
|
||||
case CSquareColumnCreator:
|
||||
return new CSquareColumnCreatorTest();
|
||||
case DBScan:
|
||||
return new DBScanTest();
|
||||
case ListDBName:
|
||||
return new ListDBNameTest();
|
||||
case OpenMeshRecostructorGPU:
|
||||
return new OpenMeshRecostructorGPUTest();
|
||||
case GenericCharts:
|
||||
return new GenericChartsTest();
|
||||
case PolygonsToMap:
|
||||
return new PolygonsToMapTest();
|
||||
default:
|
||||
throw new ServiceException("Test not found");
|
||||
***REMOVED***
|
||||
***REMOVED*** else {
|
||||
throw new ServiceException("Test not found");
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***
|
|
@ -0,0 +1,184 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server.testconfig;
|
||||
|
||||
import java.util.ArrayList;
|
||||
***REMOVED***
|
||||
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.OutputData;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.MapResource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.Resource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.EnumParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.ObjectParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.Parameter;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class BionymLocalTest implements DMTest {
|
||||
private static Logger logger = LoggerFactory.getLogger(BionymLocalTest.class);
|
||||
private static final String id = "org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.BIONYM_LOCAL";
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return id;
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void createRequest(Operator operator) {
|
||||
logger.debug("Create Request");
|
||||
|
||||
ObjectParameter speciesAuthorName = new ObjectParameter();
|
||||
speciesAuthorName.setName("SpeciesAuthorName");
|
||||
speciesAuthorName.setValue("Gadus morhua (Linnaeus, 1758)");
|
||||
|
||||
EnumParameter taxaAuthorityFile = new EnumParameter();
|
||||
taxaAuthorityFile.setName("Taxa_Authority_File");
|
||||
taxaAuthorityFile.setValue("FISHBASE");
|
||||
|
||||
EnumParameter parserName = new EnumParameter();
|
||||
parserName.setName("Parser_Name");
|
||||
parserName.setValue("SIMPLE");
|
||||
|
||||
ObjectParameter activatePreparsingProcessing = new ObjectParameter();
|
||||
activatePreparsingProcessing.setName("Activate_Preparsing_Processing");
|
||||
activatePreparsingProcessing.setValue("true");
|
||||
|
||||
ObjectParameter useStemmedGenusAndSpecies = new ObjectParameter();
|
||||
useStemmedGenusAndSpecies.setName("Use_Stemmed_Genus_and_Species");
|
||||
useStemmedGenusAndSpecies.setValue("false");
|
||||
|
||||
EnumParameter accuracyVsSpeed = new EnumParameter();
|
||||
accuracyVsSpeed.setName("Accuracy_vs_Speed");
|
||||
accuracyVsSpeed.setValue("MAX_ACCURACY");
|
||||
|
||||
EnumParameter matcher1 = new EnumParameter();
|
||||
matcher1.setName("Matcher_1");
|
||||
matcher1.setValue("GSAy");
|
||||
|
||||
ObjectParameter threshold1 = new ObjectParameter();
|
||||
threshold1.setName("Threshold_1");
|
||||
threshold1.setValue("0.6");
|
||||
|
||||
ObjectParameter maxResults1 = new ObjectParameter();
|
||||
maxResults1.setName("MaxResults_1");
|
||||
maxResults1.setValue("10");
|
||||
|
||||
EnumParameter matcher2 = new EnumParameter();
|
||||
matcher2.setName("Matcher_2");
|
||||
matcher2.setValue("FUZZYMATCH");
|
||||
|
||||
ObjectParameter threshold2 = new ObjectParameter();
|
||||
threshold2.setName("Threshold_2");
|
||||
threshold2.setValue("0.6");
|
||||
|
||||
ObjectParameter maxResults2 = new ObjectParameter();
|
||||
maxResults2.setName("MaxResults_2");
|
||||
maxResults2.setValue("10");
|
||||
|
||||
EnumParameter matcher3 = new EnumParameter();
|
||||
matcher3.setName("Matcher_3");
|
||||
matcher3.setValue("LEVENSHTEIN");
|
||||
|
||||
ObjectParameter threshold3 = new ObjectParameter();
|
||||
threshold3.setName("Threshold_3");
|
||||
threshold3.setValue("0.4");
|
||||
|
||||
ObjectParameter maxResults3 = new ObjectParameter();
|
||||
maxResults3.setName("MaxResults_3");
|
||||
maxResults3.setValue("5");
|
||||
|
||||
EnumParameter matcher4 = new EnumParameter();
|
||||
matcher4.setName("Matcher_4");
|
||||
matcher4.setValue("TRIGRAM");
|
||||
|
||||
ObjectParameter threshold4 = new ObjectParameter();
|
||||
threshold4.setName("Threshold_4");
|
||||
threshold4.setValue("0.4");
|
||||
|
||||
ObjectParameter maxResults4 = new ObjectParameter();
|
||||
maxResults4.setName("MaxResults_4");
|
||||
maxResults4.setValue("5");
|
||||
|
||||
EnumParameter matcher5 = new EnumParameter();
|
||||
matcher5.setName("Matcher_5");
|
||||
matcher5.setValue("NONE");
|
||||
|
||||
ObjectParameter threshold5 = new ObjectParameter();
|
||||
threshold5.setName("Threshold_5");
|
||||
threshold5.setValue("0.2");
|
||||
|
||||
ObjectParameter maxResults5 = new ObjectParameter();
|
||||
maxResults5.setName("MaxResults_5");
|
||||
maxResults5.setValue("0");
|
||||
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
parameters.add(speciesAuthorName);
|
||||
parameters.add(taxaAuthorityFile);
|
||||
parameters.add(parserName);
|
||||
parameters.add(activatePreparsingProcessing);
|
||||
parameters.add(useStemmedGenusAndSpecies);
|
||||
parameters.add(accuracyVsSpeed);
|
||||
parameters.add(matcher1);
|
||||
parameters.add(threshold1);
|
||||
parameters.add(maxResults1);
|
||||
parameters.add(matcher2);
|
||||
parameters.add(threshold2);
|
||||
parameters.add(maxResults2);
|
||||
parameters.add(matcher3);
|
||||
parameters.add(threshold3);
|
||||
parameters.add(maxResults3);
|
||||
parameters.add(matcher4);
|
||||
parameters.add(threshold4);
|
||||
parameters.add(maxResults4);
|
||||
parameters.add(matcher5);
|
||||
parameters.add(threshold5);
|
||||
parameters.add(maxResults5);
|
||||
|
||||
logger.debug("Parameters set: " + parameters);
|
||||
operator.setOperatorParameters(parameters);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public String getResult(OutputData outputData) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
result.append("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED*** else {
|
||||
|
||||
***REMOVED***
|
||||
return result.toString();
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public boolean isValidResult(OutputData outputData) {
|
||||
boolean valid;
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
***REMOVED***
|
||||
valid = true;
|
||||
|
||||
***REMOVED*** else {
|
||||
valid = false;
|
||||
***REMOVED***
|
||||
return valid;
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,287 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server.testconfig;
|
||||
|
||||
import java.util.ArrayList;
|
||||
***REMOVED***
|
||||
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.OutputData;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.MapResource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.Resource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.EnumParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.FileParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.ObjectParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.Parameter;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class CMSY2Test implements DMTest {
|
||||
private static Logger logger = LoggerFactory.getLogger(CMSY2Test.class);
|
||||
private static final String id = "org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.CMSY_2";
|
||||
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return id;
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void createRequest(Operator operator) {
|
||||
logger.debug("Create Request");
|
||||
|
||||
FileParameter catchFile = new FileParameter();
|
||||
catchFile.setName("catch_file");
|
||||
catchFile
|
||||
.setValue("http://data.d4science.org/R3BDYS91WkRBaVlUQ29LNWFERGs5TTA5U3o3Rmp5R2hHbWJQNStIS0N6Yz0");
|
||||
|
||||
ObjectParameter region = new ObjectParameter();
|
||||
region.setName("Region");
|
||||
region.setValue("Mediterranean");
|
||||
|
||||
ObjectParameter subRegion = new ObjectParameter();
|
||||
subRegion.setName("Subregion");
|
||||
subRegion.setValue("Adriatic Sea");
|
||||
|
||||
ObjectParameter stock = new ObjectParameter();
|
||||
stock.setName("Stock");
|
||||
stock.setValue("Athe_boy_AD");
|
||||
|
||||
ObjectParameter group = new ObjectParameter();
|
||||
group.setName("Group");
|
||||
group.setValue("Plankton feeders");
|
||||
|
||||
ObjectParameter name = new ObjectParameter();
|
||||
name.setName("Name");
|
||||
name.setValue("Sand smelt in Adriatic Sea");
|
||||
|
||||
ObjectParameter englishName = new ObjectParameter();
|
||||
englishName.setName("EnglishName");
|
||||
englishName.setValue("Big scale sand smelt");
|
||||
|
||||
ObjectParameter scientificName = new ObjectParameter();
|
||||
scientificName.setName("ScientificName");
|
||||
scientificName.setValue("Atherina boyeri");
|
||||
|
||||
ObjectParameter source = new ObjectParameter();
|
||||
source.setName("Source");
|
||||
source.setValue("-");
|
||||
|
||||
ObjectParameter minOfYear = new ObjectParameter();
|
||||
minOfYear.setName("MinOfYear");
|
||||
minOfYear.setValue("1970");
|
||||
|
||||
ObjectParameter maxOfYear = new ObjectParameter();
|
||||
maxOfYear.setName("MaxOfYear");
|
||||
maxOfYear.setValue("2014");
|
||||
|
||||
ObjectParameter startYear = new ObjectParameter();
|
||||
startYear.setName("StartYear");
|
||||
startYear.setValue("1970");
|
||||
|
||||
ObjectParameter endYear = new ObjectParameter();
|
||||
endYear.setName("EndYear");
|
||||
endYear.setValue("2014");
|
||||
|
||||
ObjectParameter flim = new ObjectParameter();
|
||||
flim.setName("Flim");
|
||||
flim.setValue("NA");
|
||||
|
||||
ObjectParameter fpa = new ObjectParameter();
|
||||
fpa.setName("Fpa");
|
||||
fpa.setValue("NA");
|
||||
|
||||
ObjectParameter blim = new ObjectParameter();
|
||||
blim.setName("Blim");
|
||||
blim.setValue("NA");
|
||||
|
||||
ObjectParameter bpa = new ObjectParameter();
|
||||
bpa.setName("Bpa");
|
||||
bpa.setValue("NA");
|
||||
|
||||
ObjectParameter bmsy = new ObjectParameter();
|
||||
bmsy.setName("Bmsy");
|
||||
bmsy.setValue("NA");
|
||||
|
||||
ObjectParameter fmsy = new ObjectParameter();
|
||||
fmsy.setName("FMSY");
|
||||
fmsy.setValue("NA");
|
||||
|
||||
ObjectParameter msy = new ObjectParameter();
|
||||
msy.setName("MSY");
|
||||
msy.setValue("NA");
|
||||
|
||||
ObjectParameter msybtrigger = new ObjectParameter();
|
||||
msybtrigger.setName("MSYBtrigger");
|
||||
msybtrigger.setValue("NA");
|
||||
|
||||
ObjectParameter b40 = new ObjectParameter();
|
||||
b40.setName("B40");
|
||||
b40.setValue("NA");
|
||||
|
||||
ObjectParameter m = new ObjectParameter();
|
||||
m.setName("M");
|
||||
m.setValue("NA");
|
||||
|
||||
ObjectParameter fofl = new ObjectParameter();
|
||||
fofl.setName("Fofl");
|
||||
fofl.setValue("NA");
|
||||
|
||||
ObjectParameter last_F = new ObjectParameter();
|
||||
last_F.setName("last_F");
|
||||
last_F.setValue("NA");
|
||||
|
||||
EnumParameter resilience=new EnumParameter();
|
||||
resilience.setName("Resilience");
|
||||
resilience.setValue("Medium");
|
||||
|
||||
ObjectParameter rLow = new ObjectParameter();
|
||||
rLow.setName("r.low");
|
||||
rLow.setValue("NA");
|
||||
|
||||
ObjectParameter rHi = new ObjectParameter();
|
||||
rHi.setName("r.hi");
|
||||
rHi.setValue("NA");
|
||||
|
||||
ObjectParameter stbLow = new ObjectParameter();
|
||||
stbLow.setName("stb.low");
|
||||
stbLow.setValue("0.2");
|
||||
|
||||
ObjectParameter stbHi = new ObjectParameter();
|
||||
stbHi.setName("stb.hi");
|
||||
stbHi.setValue("0.6");
|
||||
|
||||
ObjectParameter intYr = new ObjectParameter();
|
||||
intYr.setName("int.yr");
|
||||
intYr.setValue("NA");
|
||||
|
||||
ObjectParameter intbLow = new ObjectParameter();
|
||||
intbLow.setName("intb.low");
|
||||
intbLow.setValue("NA");
|
||||
|
||||
ObjectParameter intbHi = new ObjectParameter();
|
||||
intbHi.setName("intb.hi");
|
||||
intbHi.setValue("NA");
|
||||
|
||||
ObjectParameter endbLow = new ObjectParameter();
|
||||
endbLow.setName("endb.low");
|
||||
endbLow.setValue("0.01");
|
||||
|
||||
ObjectParameter endbHi = new ObjectParameter();
|
||||
endbHi.setName("endb.hi");
|
||||
endbHi.setValue("0.4");
|
||||
|
||||
ObjectParameter qStart = new ObjectParameter();
|
||||
qStart.setName("q.start");
|
||||
qStart.setValue("NA");
|
||||
|
||||
ObjectParameter qEnd = new ObjectParameter();
|
||||
qEnd.setName("q.end");
|
||||
qEnd.setValue("NA");
|
||||
|
||||
EnumParameter btype=new EnumParameter();
|
||||
btype.setName("btype");
|
||||
btype.setValue("None");
|
||||
|
||||
ObjectParameter forceCmsy = new ObjectParameter();
|
||||
forceCmsy.setName("force.cmsy");
|
||||
forceCmsy.setValue("false");
|
||||
|
||||
ObjectParameter comment = new ObjectParameter();
|
||||
comment.setName("Comment");
|
||||
comment.setValue("landings");
|
||||
|
||||
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
parameters.add(catchFile);
|
||||
parameters.add(region);
|
||||
parameters.add(subRegion);
|
||||
parameters.add(stock);
|
||||
parameters.add(group);
|
||||
parameters.add(name);
|
||||
parameters.add(englishName);
|
||||
parameters.add(scientificName);
|
||||
parameters.add(source);
|
||||
parameters.add(minOfYear);
|
||||
parameters.add(maxOfYear);
|
||||
parameters.add(startYear);
|
||||
parameters.add(endYear);
|
||||
parameters.add(flim);
|
||||
parameters.add(fpa);
|
||||
parameters.add(blim);
|
||||
parameters.add(bpa);
|
||||
parameters.add(bmsy);
|
||||
parameters.add(fmsy);
|
||||
parameters.add(msy);
|
||||
parameters.add(msybtrigger);
|
||||
parameters.add(b40);
|
||||
parameters.add(m);
|
||||
parameters.add(fofl);
|
||||
parameters.add(last_F);
|
||||
parameters.add(resilience);
|
||||
parameters.add(rLow);
|
||||
parameters.add(rHi);
|
||||
parameters.add(stbLow);
|
||||
parameters.add(stbHi);
|
||||
parameters.add(intYr);
|
||||
parameters.add(intbLow);
|
||||
parameters.add(intbHi);
|
||||
parameters.add(endbLow);
|
||||
parameters.add(endbHi);
|
||||
parameters.add(qStart);
|
||||
parameters.add(qEnd);
|
||||
parameters.add(btype);
|
||||
parameters.add(forceCmsy);
|
||||
parameters.add(comment);
|
||||
|
||||
logger.debug("Parameters set: " + parameters);
|
||||
operator.setOperatorParameters(parameters);
|
||||
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public String getResult(OutputData outputData) {
|
||||
StringBuilder result=new StringBuilder();
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
logger.debug("Entry: " + key + " = "
|
||||
+ mapResource.getMap().get(key));
|
||||
result.append("Entry: " + key + " = "
|
||||
+ mapResource.getMap().get(key));
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED*** else {
|
||||
|
||||
***REMOVED***
|
||||
return result.toString();
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public boolean isValidResult(OutputData outputData) {
|
||||
boolean valid;
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
logger.debug("Entry: " + key + " = "
|
||||
+ mapResource.getMap().get(key));
|
||||
***REMOVED***
|
||||
valid=true;
|
||||
|
||||
***REMOVED*** else {
|
||||
valid=false;
|
||||
***REMOVED***
|
||||
return valid;
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,107 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server.testconfig;
|
||||
|
||||
import java.util.ArrayList;
|
||||
***REMOVED***
|
||||
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.OutputData;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.MapResource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.Resource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.ObjectParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.Parameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.TabularParameter;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class CSquareColumnCreatorTest implements DMTest {
|
||||
private static Logger logger = LoggerFactory.getLogger(CSquareColumnCreatorTest.class);
|
||||
private static final String id = "org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.CSQUARE_COLUMN_CREATOR";
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return id;
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void createRequest(Operator operator) {
|
||||
logger.debug("Create Request");
|
||||
|
||||
TabularParameter occurencePointsTable = new TabularParameter();
|
||||
occurencePointsTable.setName("InputTable");
|
||||
occurencePointsTable
|
||||
.setValue("http://goo.gl/sdlD5a");
|
||||
|
||||
ObjectParameter longitude = new ObjectParameter();
|
||||
longitude.setName("Longitude_Column");
|
||||
longitude.setValue("decimallongitude");
|
||||
|
||||
ObjectParameter latitude = new ObjectParameter();
|
||||
latitude.setName("Latitude_Column");
|
||||
latitude.setValue("decimallatitude");
|
||||
|
||||
ObjectParameter cSquareResolution = new ObjectParameter();
|
||||
cSquareResolution.setName("CSquare_Resolution");
|
||||
cSquareResolution.setValue("0.1");
|
||||
|
||||
ObjectParameter outputTableName = new ObjectParameter();
|
||||
outputTableName.setName("OutputTableName");
|
||||
outputTableName.setValue("wps_csquare_column");
|
||||
|
||||
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
parameters.add(occurencePointsTable);
|
||||
parameters.add(longitude);
|
||||
parameters.add(latitude);
|
||||
parameters.add(cSquareResolution);
|
||||
parameters.add(outputTableName);
|
||||
|
||||
|
||||
logger.debug("Parameters set: " + parameters);
|
||||
operator.setOperatorParameters(parameters);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public String getResult(OutputData outputData) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
result.append("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED*** else {
|
||||
|
||||
***REMOVED***
|
||||
return result.toString();
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public boolean isValidResult(OutputData outputData) {
|
||||
boolean valid;
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
***REMOVED***
|
||||
valid = true;
|
||||
|
||||
***REMOVED*** else {
|
||||
valid = false;
|
||||
***REMOVED***
|
||||
return valid;
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,176 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server.testconfig;
|
||||
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
***REMOVED***
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.OutputData;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.FileResource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.ImageResource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.MapResource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.Resource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.TableResource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.ColumnListParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.ObjectParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.Parameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.TabularParameter;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class DBScanTest implements DMTest {
|
||||
private static Logger logger = LoggerFactory.getLogger(DBScanTest.class);
|
||||
private static final String id = "org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.clusterers.DBSCAN";
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return id;
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void createRequest(Operator operator) {
|
||||
logger.debug("Create Request");
|
||||
|
||||
TabularParameter occurencePointsTable = new TabularParameter();
|
||||
occurencePointsTable.setName("OccurrencePointsTable");
|
||||
occurencePointsTable
|
||||
.setValue("http://data.d4science.org/YmRKWDU4Y0RJT2hSLzcybU4zRmJoTEg2YTBMWlRZVUpHbWJQNStIS0N6Yz0");
|
||||
|
||||
ColumnListParameter columnListParameter = new ColumnListParameter();
|
||||
columnListParameter.setName("FeaturesColumnNames");
|
||||
columnListParameter.setValue("depthmean|sstmnmax|salinitymin");
|
||||
|
||||
ObjectParameter occurencePointsClusterLabel = new ObjectParameter();
|
||||
occurencePointsClusterLabel.setName("OccurrencePointsClusterLabel");
|
||||
occurencePointsClusterLabel.setValue("Test");
|
||||
|
||||
ObjectParameter epsilon = new ObjectParameter();
|
||||
epsilon.setName("epsilon");
|
||||
epsilon.setValue("10");
|
||||
|
||||
ObjectParameter minPoints = new ObjectParameter();
|
||||
minPoints.setName("min_points");
|
||||
minPoints.setValue("1");
|
||||
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
parameters.add(occurencePointsTable);
|
||||
parameters.add(columnListParameter);
|
||||
parameters.add(occurencePointsClusterLabel);
|
||||
parameters.add(epsilon);
|
||||
parameters.add(minPoints);
|
||||
|
||||
logger.debug("Parameters set: " + parameters);
|
||||
operator.setOperatorParameters(parameters);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public String getResult(OutputData outputData) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
Resource res = mapResource.getMap().get(key);
|
||||
switch (res.getResourceType()) {
|
||||
case FILE:
|
||||
FileResource fileResource = (FileResource) res;
|
||||
String fileName = retrieveFileName(fileResource.getUrl());
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key) + ", FileName=" + fileName);
|
||||
result.append("Entry: " + key + " = " + mapResource.getMap().get(key) + ", FileName=" + fileName);
|
||||
break;
|
||||
case IMAGE:
|
||||
ImageResource imageResource = (ImageResource) res;
|
||||
String imageName = retrieveFileName(imageResource.getLink());
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key) + ", ImageName=" + imageName);
|
||||
result.append("Entry: " + key + " = " + mapResource.getMap().get(key) + ", ImageName=" + imageName);
|
||||
break;
|
||||
case MAP:
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
result.append("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
|
||||
break;
|
||||
case OBJECT:
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
result.append("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
break;
|
||||
case TABULAR:
|
||||
TableResource tableResource = (TableResource) res;
|
||||
String tableName = retrieveFileName(tableResource.getResourceId());
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key) + ", TableName=" + tableName);
|
||||
result.append("Entry: " + key + " = " + mapResource.getMap().get(key) + ", TableName=" + tableName);
|
||||
break;
|
||||
default:
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
result.append("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
break;
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED*** else {
|
||||
|
||||
***REMOVED***
|
||||
return result.toString();
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public boolean isValidResult(OutputData outputData) {
|
||||
boolean valid;
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
***REMOVED***
|
||||
valid = true;
|
||||
|
||||
***REMOVED*** else {
|
||||
valid = false;
|
||||
***REMOVED***
|
||||
return valid;
|
||||
|
||||
***REMOVED***
|
||||
|
||||
private String retrieveFileName(String url) {
|
||||
String fileName = "output";
|
||||
|
||||
***REMOVED***
|
||||
|
||||
URL urlObj;
|
||||
urlObj = new URL(url);
|
||||
|
||||
HttpURLConnection connection = (HttpURLConnection) urlObj.openConnection();
|
||||
connection.setRequestMethod("GET");
|
||||
String contentDisposition = connection.getHeaderField("Content-Disposition");
|
||||
Pattern regex = Pattern.compile("(?<=filename=\").*?(?=\")");
|
||||
Matcher regexMatcher = regex.matcher(contentDisposition);
|
||||
if (regexMatcher.find()) {
|
||||
fileName = regexMatcher.group();
|
||||
***REMOVED***
|
||||
|
||||
if (fileName == null || fileName.isEmpty()) {
|
||||
fileName = "output";
|
||||
***REMOVED***
|
||||
|
||||
return fileName;
|
||||
***REMOVED***
|
||||
logger.error("Error retrieving file name: " + e.getLocalizedMessage(), e);
|
||||
return fileName;
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,22 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server.testconfig;
|
||||
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.OutputData;
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public interface DMTest {
|
||||
|
||||
public String getId();
|
||||
|
||||
public void createRequest(Operator operator);
|
||||
|
||||
public boolean isValidResult(OutputData outputData);
|
||||
|
||||
public String getResult(OutputData outputData);
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,122 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server.testconfig;
|
||||
|
||||
import java.util.ArrayList;
|
||||
***REMOVED***
|
||||
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.OutputData;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.MapResource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.Resource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.ColumnListParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.ColumnParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.ListParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.ObjectParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.Parameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.TabularParameter;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class FeedForwardAnnTest implements DMTest {
|
||||
private static Logger logger = LoggerFactory.getLogger(FeedForwardAnnTest.class);
|
||||
private static final String id = "org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.modellers.FEED_FORWARD_ANN";
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return id;
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void createRequest(Operator operator) {
|
||||
TabularParameter trainingDataSet = new TabularParameter();
|
||||
trainingDataSet.setName("TrainingDataSet");
|
||||
trainingDataSet.setValue("http://data.d4science.org/K0ZoUlVDNW1hR0hDZWZucS9UQkJmUVRTeWRuRVBGUC9HbWJQNStIS0N6Yz0");
|
||||
|
||||
ColumnListParameter trainingColumns = new ColumnListParameter();
|
||||
trainingColumns.setName("TrainingColumns");
|
||||
trainingColumns.setValue("depthmin|depthmax|depthmean|depthsd");
|
||||
|
||||
ColumnParameter targetColumn = new ColumnParameter();
|
||||
targetColumn.setName("TargetColumn");
|
||||
targetColumn.setValue("sstanmean");
|
||||
|
||||
ListParameter layersNeurons = new ListParameter();
|
||||
layersNeurons.setName("LayersNeurons");
|
||||
layersNeurons.setValue("20");
|
||||
|
||||
ObjectParameter reference = new ObjectParameter();
|
||||
reference.setName("Reference");
|
||||
reference.setValue("1");
|
||||
|
||||
ObjectParameter learningThreshold = new ObjectParameter();
|
||||
learningThreshold.setName("LearningThreshold");
|
||||
learningThreshold.setValue("0.0001");
|
||||
|
||||
ObjectParameter maxIterations = new ObjectParameter();
|
||||
maxIterations.setName("MaxIterations");
|
||||
maxIterations.setValue("10");
|
||||
|
||||
ObjectParameter modelName = new ObjectParameter();
|
||||
modelName.setName("ModelName");
|
||||
modelName.setValue("trained_network");
|
||||
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
parameters.add(trainingDataSet);
|
||||
parameters.add(trainingColumns);
|
||||
parameters.add(targetColumn);
|
||||
parameters.add(layersNeurons);
|
||||
parameters.add(reference);
|
||||
parameters.add(learningThreshold);
|
||||
parameters.add(maxIterations);
|
||||
parameters.add(modelName);
|
||||
|
||||
operator.setOperatorParameters(parameters);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public String getResult(OutputData outputData) {
|
||||
StringBuilder result=new StringBuilder();
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
logger.debug("Entry: " + key + " = "
|
||||
+ mapResource.getMap().get(key));
|
||||
result.append("Entry: " + key + " = "
|
||||
+ mapResource.getMap().get(key));
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED*** else {
|
||||
|
||||
***REMOVED***
|
||||
return result.toString();
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public boolean isValidResult(OutputData outputData) {
|
||||
boolean valid;
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
logger.debug("Entry: " + key + " = "
|
||||
+ mapResource.getMap().get(key));
|
||||
***REMOVED***
|
||||
valid=true;
|
||||
|
||||
***REMOVED*** else {
|
||||
valid=false;
|
||||
***REMOVED***
|
||||
return valid;
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,171 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server.testconfig;
|
||||
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
***REMOVED***
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.OutputData;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.FileResource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.ImageResource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.MapResource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.Resource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.TableResource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.ColumnListParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.ObjectParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.Parameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.TabularParameter;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class GenericChartsTest implements DMTest {
|
||||
private static Logger logger = LoggerFactory.getLogger(GenericChartsTest.class);
|
||||
private static final String id = "org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.GENERIC_CHARTS";
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return id;
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void createRequest(Operator operator) {
|
||||
logger.debug("Create Request");
|
||||
|
||||
TabularParameter inputTableParameter = new TabularParameter();
|
||||
inputTableParameter.setName("InputTable");
|
||||
inputTableParameter.setValue(
|
||||
"https://data.d4science.org/shub/E_N0VSZmRHUkJQckdPOS9RR1NvajdvbUhMTHlRV2FBdGhzNTBLNEZWa21LbG9oV0hFMDUwTHNtZFhGSmh0SkRneQ==");
|
||||
|
||||
ObjectParameter topElementsNumberParameter = new ObjectParameter();
|
||||
topElementsNumberParameter.setName("TopElementsNumber");
|
||||
topElementsNumberParameter.setValue("10");
|
||||
|
||||
ColumnListParameter attributesParameter = new ColumnListParameter();
|
||||
attributesParameter.setName("Attributes");
|
||||
attributesParameter.setValue("x|y");
|
||||
|
||||
ColumnListParameter quantitiesParameter = new ColumnListParameter();
|
||||
quantitiesParameter.setName("Quantities");
|
||||
quantitiesParameter.setValue("fvalue");
|
||||
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
parameters.add(inputTableParameter);
|
||||
parameters.add(topElementsNumberParameter);
|
||||
parameters.add(attributesParameter);
|
||||
parameters.add(quantitiesParameter);
|
||||
|
||||
logger.debug("Parameters set: " + parameters);
|
||||
operator.setOperatorParameters(parameters);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public String getResult(OutputData outputData) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
Resource res = mapResource.getMap().get(key);
|
||||
switch (res.getResourceType()) {
|
||||
case FILE:
|
||||
FileResource fileResource = (FileResource) res;
|
||||
String fileName = retrieveFileName(fileResource.getUrl());
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key) + ", FileName=" + fileName);
|
||||
result.append("Entry: " + key + " = " + mapResource.getMap().get(key) + ", FileName=" + fileName);
|
||||
break;
|
||||
case IMAGE:
|
||||
ImageResource imageResource = (ImageResource) res;
|
||||
String imageName = retrieveFileName(imageResource.getLink());
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key) + ", ImageName=" + imageName);
|
||||
result.append("Entry: " + key + " = " + mapResource.getMap().get(key) + ", ImageName=" + imageName);
|
||||
break;
|
||||
case MAP:
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
result.append("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
|
||||
break;
|
||||
case OBJECT:
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
result.append("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
break;
|
||||
case TABULAR:
|
||||
TableResource tableResource = (TableResource) res;
|
||||
String tableName = retrieveFileName(tableResource.getResourceId());
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key) + ", TableName=" + tableName);
|
||||
result.append("Entry: " + key + " = " + mapResource.getMap().get(key) + ", TableName=" + tableName);
|
||||
break;
|
||||
default:
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
result.append("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
break;
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED*** else {
|
||||
|
||||
***REMOVED***
|
||||
return result.toString();
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public boolean isValidResult(OutputData outputData) {
|
||||
boolean valid;
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
***REMOVED***
|
||||
valid = true;
|
||||
|
||||
***REMOVED*** else {
|
||||
valid = false;
|
||||
***REMOVED***
|
||||
return valid;
|
||||
|
||||
***REMOVED***
|
||||
|
||||
private String retrieveFileName(String url) {
|
||||
String fileName = "output";
|
||||
|
||||
***REMOVED***
|
||||
|
||||
URL urlObj;
|
||||
urlObj = new URL(url);
|
||||
|
||||
HttpURLConnection connection = (HttpURLConnection) urlObj.openConnection();
|
||||
connection.setRequestMethod("GET");
|
||||
String contentDisposition = connection.getHeaderField("Content-Disposition");
|
||||
Pattern regex = Pattern.compile("(?<=filename=\").*?(?=\")");
|
||||
Matcher regexMatcher = regex.matcher(contentDisposition);
|
||||
if (regexMatcher.find()) {
|
||||
fileName = regexMatcher.group();
|
||||
***REMOVED***
|
||||
|
||||
if (fileName == null || fileName.isEmpty()) {
|
||||
fileName = "output";
|
||||
***REMOVED***
|
||||
|
||||
return fileName;
|
||||
***REMOVED***
|
||||
logger.error("Error retrieving file name: " + e.getLocalizedMessage(), e);
|
||||
return fileName;
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,88 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server.testconfig;
|
||||
|
||||
import java.util.ArrayList;
|
||||
***REMOVED***
|
||||
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.OutputData;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.MapResource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.Resource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.ObjectParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.Parameter;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class ListDBNameTest implements DMTest {
|
||||
private static Logger logger = LoggerFactory.getLogger(ListDBNameTest.class);
|
||||
private static final String id = "org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.LISTDBNAMES";
|
||||
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return id;
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void createRequest(Operator operator) {
|
||||
logger.debug("Create Request");
|
||||
|
||||
ObjectParameter maxNumber = new ObjectParameter();
|
||||
maxNumber.setName("MaxNumber");
|
||||
maxNumber.setValue("-1");
|
||||
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
|
||||
parameters.add(maxNumber);
|
||||
|
||||
logger.debug("Parameters set: " + parameters);
|
||||
operator.setOperatorParameters(parameters);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public String getResult(OutputData outputData) {
|
||||
StringBuilder result=new StringBuilder();
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
logger.debug("Entry: " + key + " = "
|
||||
+ mapResource.getMap().get(key));
|
||||
result.append("Entry: " + key + " = "
|
||||
+ mapResource.getMap().get(key));
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED*** else {
|
||||
|
||||
***REMOVED***
|
||||
return result.toString();
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public boolean isValidResult(OutputData outputData) {
|
||||
boolean valid;
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
logger.debug("Entry: " + key + " = "
|
||||
+ mapResource.getMap().get(key));
|
||||
***REMOVED***
|
||||
valid=true;
|
||||
|
||||
***REMOVED*** else {
|
||||
valid=false;
|
||||
***REMOVED***
|
||||
return valid;
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,84 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server.testconfig;
|
||||
|
||||
import java.util.ArrayList;
|
||||
***REMOVED***
|
||||
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.OutputData;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.MapResource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.Resource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.FileParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.Parameter;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class OpenMeshRecostructorGPUTest implements DMTest {
|
||||
private static Logger logger = LoggerFactory.getLogger(OpenMeshRecostructorGPUTest.class);
|
||||
private static final String id = "org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.OPEN_MESH_RECONSTRUCTOR_GPU";
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return id;
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void createRequest(Operator operator) {
|
||||
logger.debug("Create Request");
|
||||
|
||||
FileParameter inputZipFile = new FileParameter();
|
||||
inputZipFile.setName("InputZipFile");
|
||||
inputZipFile
|
||||
.setValue("https://data.d4science.org/shub/E_ZWNlZW1VbzI1NGdyRTRrbWtGZXcvdU52cG1RVnd2UDZrdGp1cDFodmZWRzFtQVlydVNHV0NuVis1VVRFT0FWZg==");
|
||||
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
parameters.add(inputZipFile);
|
||||
|
||||
logger.debug("Parameters set: " + parameters);
|
||||
operator.setOperatorParameters(parameters);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public String getResult(OutputData outputData) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
result.append("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED*** else {
|
||||
|
||||
***REMOVED***
|
||||
return result.toString();
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public boolean isValidResult(OutputData outputData) {
|
||||
boolean valid;
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
***REMOVED***
|
||||
valid = true;
|
||||
|
||||
***REMOVED*** else {
|
||||
valid = false;
|
||||
***REMOVED***
|
||||
return valid;
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,187 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server.testconfig;
|
||||
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
***REMOVED***
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.OutputData;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.FileResource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.ImageResource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.MapResource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.Resource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.TableResource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.ColumnListParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.EnumParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.ObjectParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.Parameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.TabularParameter;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class PolygonsToMapTest implements DMTest {
|
||||
private static Logger logger = LoggerFactory.getLogger(PolygonsToMapTest.class);
|
||||
private static final String id = "org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.POLYGONS_TO_MAP";
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return id;
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void createRequest(Operator operator) {
|
||||
logger.debug("Create Request");
|
||||
|
||||
EnumParameter publicationLevelParameter = new EnumParameter();
|
||||
publicationLevelParameter.setName("PublicationLevel");
|
||||
publicationLevelParameter.setValue("PRIVATE");
|
||||
|
||||
ObjectParameter mapNameParameter = new ObjectParameter();
|
||||
mapNameParameter.setName("MapName");
|
||||
mapNameParameter.setValue("Example polygon map generated for Test");
|
||||
|
||||
TabularParameter inputTableParameter = new TabularParameter();
|
||||
inputTableParameter.setName("InputTable");
|
||||
inputTableParameter.setValue(
|
||||
"https://data.d4science.org/shub/E_TWZKc3hKejZYREZYSWZlVnBsdzlEbkNhdXIxSHUvYlpNTkxUSGx2cXV3TzVHdGJ0M1RQZEpWUFkyc3haNW04Yw==");
|
||||
|
||||
ColumnListParameter xDimensionParameter = new ColumnListParameter();
|
||||
xDimensionParameter.setName("xDimension");
|
||||
xDimensionParameter.setValue("centerlong");
|
||||
|
||||
ColumnListParameter yDimensionParameter = new ColumnListParameter();
|
||||
yDimensionParameter.setName("yDimension");
|
||||
yDimensionParameter.setValue("centerlat");
|
||||
|
||||
ColumnListParameter infoParameter = new ColumnListParameter();
|
||||
infoParameter.setName("Info");
|
||||
infoParameter.setValue("faoaream");
|
||||
|
||||
ObjectParameter resolutionParameter=new ObjectParameter();
|
||||
resolutionParameter.setName("Resolution");
|
||||
resolutionParameter.setValue("0.5");
|
||||
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
parameters.add(publicationLevelParameter);
|
||||
parameters.add(mapNameParameter);
|
||||
parameters.add(inputTableParameter);
|
||||
parameters.add(xDimensionParameter);
|
||||
parameters.add(yDimensionParameter);
|
||||
parameters.add(infoParameter);
|
||||
parameters.add(resolutionParameter);
|
||||
|
||||
logger.debug("Parameters set: " + parameters);
|
||||
operator.setOperatorParameters(parameters);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public String getResult(OutputData outputData) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
Resource res = mapResource.getMap().get(key);
|
||||
switch (res.getResourceType()) {
|
||||
case FILE:
|
||||
FileResource fileResource = (FileResource) res;
|
||||
String fileName = retrieveFileName(fileResource.getUrl());
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key) + ", FileName=" + fileName);
|
||||
result.append("Entry: " + key + " = " + mapResource.getMap().get(key) + ", FileName=" + fileName);
|
||||
break;
|
||||
case IMAGE:
|
||||
ImageResource imageResource = (ImageResource) res;
|
||||
String imageName = retrieveFileName(imageResource.getLink());
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key) + ", ImageName=" + imageName);
|
||||
result.append("Entry: " + key + " = " + mapResource.getMap().get(key) + ", ImageName=" + imageName);
|
||||
break;
|
||||
case MAP:
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
result.append("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
|
||||
break;
|
||||
case OBJECT:
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
result.append("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
break;
|
||||
case TABULAR:
|
||||
TableResource tableResource = (TableResource) res;
|
||||
String tableName = retrieveFileName(tableResource.getResourceId());
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key) + ", TableName=" + tableName);
|
||||
result.append("Entry: " + key + " = " + mapResource.getMap().get(key) + ", TableName=" + tableName);
|
||||
break;
|
||||
default:
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
result.append("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
break;
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED*** else {
|
||||
|
||||
***REMOVED***
|
||||
return result.toString();
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public boolean isValidResult(OutputData outputData) {
|
||||
boolean valid;
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
***REMOVED***
|
||||
valid = true;
|
||||
|
||||
***REMOVED*** else {
|
||||
valid = false;
|
||||
***REMOVED***
|
||||
return valid;
|
||||
|
||||
***REMOVED***
|
||||
|
||||
private String retrieveFileName(String url) {
|
||||
String fileName = "output";
|
||||
|
||||
***REMOVED***
|
||||
|
||||
URL urlObj;
|
||||
urlObj = new URL(url);
|
||||
|
||||
HttpURLConnection connection = (HttpURLConnection) urlObj.openConnection();
|
||||
connection.setRequestMethod("GET");
|
||||
String contentDisposition = connection.getHeaderField("Content-Disposition");
|
||||
Pattern regex = Pattern.compile("(?<=filename=\").*?(?=\")");
|
||||
Matcher regexMatcher = regex.matcher(contentDisposition);
|
||||
if (regexMatcher.find()) {
|
||||
fileName = regexMatcher.group();
|
||||
***REMOVED***
|
||||
|
||||
if (fileName == null || fileName.isEmpty()) {
|
||||
fileName = "output";
|
||||
***REMOVED***
|
||||
|
||||
return fileName;
|
||||
***REMOVED***
|
||||
logger.error("Error retrieving file name: " + e.getLocalizedMessage(), e);
|
||||
return fileName;
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,127 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server.testconfig;
|
||||
|
||||
import java.util.ArrayList;
|
||||
***REMOVED***
|
||||
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.OutputData;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.MapResource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.Resource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.FileParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.ObjectParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.Parameter;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class RasterDataPublisherTest implements DMTest {
|
||||
private static Logger logger = LoggerFactory.getLogger(RasterDataPublisherTest.class);
|
||||
private static final String id = "org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.RASTER_DATA_PUBLISHER";
|
||||
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return id;
|
||||
***REMOVED***
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void createRequest(Operator operator) {
|
||||
logger.debug("Create Request");
|
||||
|
||||
ObjectParameter publicationLevel = new ObjectParameter();
|
||||
publicationLevel.setName("PublicationLevel");
|
||||
publicationLevel.setValue("PUBLIC");
|
||||
|
||||
ObjectParameter datasetAbstract = new ObjectParameter();
|
||||
datasetAbstract.setName("DatasetAbstract");
|
||||
datasetAbstract.setValue("Abstract");
|
||||
|
||||
ObjectParameter datasetTitle = new ObjectParameter();
|
||||
datasetTitle.setName("DatasetTitle");
|
||||
datasetTitle.setValue("Generic Raster Layer Test3");
|
||||
|
||||
FileParameter rasterFile=new FileParameter();
|
||||
rasterFile.setName("RasterFile");
|
||||
rasterFile.setValue("http://data.d4science.org/QTVNbXp5cmI0MG52TTE0K2paNzhXZWlCTHhweU8rUCtHbWJQNStIS0N6Yz0");
|
||||
|
||||
ObjectParameter innerLayerName = new ObjectParameter();
|
||||
innerLayerName.setName("InnerLayerName");
|
||||
innerLayerName.setValue("analyzed_field");
|
||||
|
||||
ObjectParameter fileNameOnInfra = new ObjectParameter();
|
||||
fileNameOnInfra.setName("FileNameOnInfra");
|
||||
fileNameOnInfra.setValue("raster-1465493226242.nc");
|
||||
|
||||
ObjectParameter topics = new ObjectParameter();
|
||||
topics.setName("Topics");
|
||||
topics.setValue("analyzed_field");
|
||||
|
||||
ObjectParameter spatialResolution = new ObjectParameter();
|
||||
spatialResolution.setName("SpatialResolution");
|
||||
spatialResolution.setValue("-1");
|
||||
|
||||
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
|
||||
parameters.add(publicationLevel);
|
||||
parameters.add(datasetAbstract);
|
||||
parameters.add(datasetTitle);
|
||||
parameters.add(rasterFile);
|
||||
parameters.add(innerLayerName);
|
||||
parameters.add(fileNameOnInfra);
|
||||
parameters.add(topics);
|
||||
parameters.add(spatialResolution);
|
||||
|
||||
logger.debug("Parameters set: " + parameters);
|
||||
operator.setOperatorParameters(parameters);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public String getResult(OutputData outputData) {
|
||||
StringBuilder result=new StringBuilder();
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
logger.debug("Entry: " + key + " = "
|
||||
+ mapResource.getMap().get(key));
|
||||
result.append("Entry: " + key + " = "
|
||||
+ mapResource.getMap().get(key));
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED*** else {
|
||||
|
||||
***REMOVED***
|
||||
return result.toString();
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public boolean isValidResult(OutputData outputData) {
|
||||
boolean valid;
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
logger.debug("Entry: " + key + " = "
|
||||
+ mapResource.getMap().get(key));
|
||||
***REMOVED***
|
||||
valid=true;
|
||||
|
||||
***REMOVED*** else {
|
||||
valid=false;
|
||||
***REMOVED***
|
||||
return valid;
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,84 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server.testconfig;
|
||||
|
||||
import java.util.ArrayList;
|
||||
***REMOVED***
|
||||
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.OutputData;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.MapResource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.Resource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.FileParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.Parameter;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class WebAppPublisherTest implements DMTest {
|
||||
private static Logger logger = LoggerFactory.getLogger(WebAppPublisherTest.class);
|
||||
private static final String id = "org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.WEB_APP_PUBLISHER";
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return id;
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public void createRequest(Operator operator) {
|
||||
logger.debug("Create Request");
|
||||
|
||||
FileParameter zipFile = new FileParameter();
|
||||
zipFile.setName("ZipFile");
|
||||
zipFile.setValue("http://goo.gl/dYQ089");
|
||||
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
|
||||
parameters.add(zipFile);
|
||||
|
||||
logger.debug("Parameters set: " + parameters);
|
||||
operator.setOperatorParameters(parameters);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public String getResult(OutputData outputData) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
result.append("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED*** else {
|
||||
|
||||
***REMOVED***
|
||||
return result.toString();
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public boolean isValidResult(OutputData outputData) {
|
||||
boolean valid;
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
logger.debug("Entry: " + key + " = " + mapResource.getMap().get(key));
|
||||
***REMOVED***
|
||||
valid = true;
|
||||
|
||||
***REMOVED*** else {
|
||||
valid = false;
|
||||
***REMOVED***
|
||||
return valid;
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,136 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.server.testconfig;
|
||||
|
||||
import java.util.ArrayList;
|
||||
***REMOVED***
|
||||
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.OutputData;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.MapResource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.output.Resource;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.ObjectParameter;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.Parameter;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class XYExtractorTest implements DMTest {
|
||||
private static Logger logger = LoggerFactory.getLogger(XYExtractorTest.class);
|
||||
private static final String id = "org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.XYEXTRACTOR";
|
||||
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return id;
|
||||
***REMOVED***
|
||||
|
||||
|
||||
@Override
|
||||
public void createRequest(Operator operator) {
|
||||
logger.debug("Create Request");
|
||||
|
||||
ObjectParameter outputTableLabel = new ObjectParameter();
|
||||
outputTableLabel.setName("OutputTableLabel");
|
||||
outputTableLabel.setValue("wps_xy_extractor");
|
||||
|
||||
ObjectParameter layer = new ObjectParameter();
|
||||
layer.setName("Layer");
|
||||
layer.setValue("3fb7fd88-33d4-492d-b241-4e61299c44bb");
|
||||
|
||||
ObjectParameter yResolution = new ObjectParameter();
|
||||
yResolution.setName("YResolution");
|
||||
yResolution.setValue("0.5");
|
||||
|
||||
ObjectParameter xResolution = new ObjectParameter();
|
||||
xResolution.setName("XResolution");
|
||||
xResolution.setValue("0.5");
|
||||
|
||||
ObjectParameter bBox_LowerLeftLong = new ObjectParameter();
|
||||
bBox_LowerLeftLong.setName("BBox_LowerLeftLong");
|
||||
bBox_LowerLeftLong.setValue("-50");
|
||||
|
||||
ObjectParameter bBox_UpperRightLat = new ObjectParameter();
|
||||
bBox_UpperRightLat.setName("BBox_UpperRightLat");
|
||||
bBox_UpperRightLat.setValue("60");
|
||||
|
||||
ObjectParameter bBox_LowerLeftLat = new ObjectParameter();
|
||||
bBox_LowerLeftLat.setName("BBox_LowerLeftLat");
|
||||
bBox_LowerLeftLat.setValue("-60");
|
||||
|
||||
ObjectParameter bBox_UpperRightLong = new ObjectParameter();
|
||||
bBox_UpperRightLong.setName("BBox_UpperRightLong");
|
||||
bBox_UpperRightLong.setValue("50");
|
||||
|
||||
ObjectParameter z = new ObjectParameter();
|
||||
z.setName("Z");
|
||||
z.setValue("0");
|
||||
|
||||
ObjectParameter timeIndex = new ObjectParameter();
|
||||
timeIndex.setName("TimeIndex");
|
||||
timeIndex.setValue("0");
|
||||
|
||||
|
||||
List<Parameter> parameters = new ArrayList<>();
|
||||
|
||||
parameters.add(outputTableLabel);
|
||||
parameters.add(layer);
|
||||
parameters.add(yResolution);
|
||||
parameters.add(xResolution);
|
||||
parameters.add(bBox_LowerLeftLong);
|
||||
parameters.add(bBox_UpperRightLat);
|
||||
parameters.add(bBox_LowerLeftLat);
|
||||
parameters.add(bBox_UpperRightLong);
|
||||
parameters.add(z);
|
||||
parameters.add(timeIndex);
|
||||
|
||||
|
||||
logger.debug("Parameters set: " + parameters);
|
||||
operator.setOperatorParameters(parameters);
|
||||
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public String getResult(OutputData outputData) {
|
||||
StringBuilder result=new StringBuilder();
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
logger.debug("Entry: " + key + " = "
|
||||
+ mapResource.getMap().get(key));
|
||||
result.append("Entry: " + key + " = "
|
||||
+ mapResource.getMap().get(key));
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED*** else {
|
||||
|
||||
***REMOVED***
|
||||
return result.toString();
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public boolean isValidResult(OutputData outputData) {
|
||||
boolean valid;
|
||||
logger.debug("Output: " + outputData);
|
||||
Resource resource = outputData.getResource();
|
||||
if (resource.isMap()) {
|
||||
MapResource mapResource = (MapResource) resource;
|
||||
for (String key : mapResource.getMap().keySet()) {
|
||||
logger.debug("Entry: " + key + " = "
|
||||
+ mapResource.getMap().get(key));
|
||||
***REMOVED***
|
||||
valid=true;
|
||||
|
||||
***REMOVED*** else {
|
||||
valid=false;
|
||||
***REMOVED***
|
||||
return valid;
|
||||
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,75 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.shared;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class Constants {
|
||||
public static final boolean DEBUG_MODE = false;
|
||||
public static final boolean TEST_ENABLE = false;
|
||||
|
||||
public static final String APPLICATION_ID = "org.gcube.portlets.user.dataminermanagertester.portlet.DataMinerManagerTester";
|
||||
public static final String DATA_MINER_MANAGER_ID = "DataMinerManagerTesterId";
|
||||
public static final String DATA_MINER_LANG_COOKIE = "DataMinerTesterLangCookie";
|
||||
public static final String DATA_MINER_LANG = "DataMinerTesterLang";
|
||||
public static final String DATA_MINER_OPERATOR_ID = "OperatorId";
|
||||
|
||||
public static final String TOKEN = "token";
|
||||
|
||||
public static final String DEFAULT_USER = "giancarlo.panichi";
|
||||
public final static String DEFAULT_SCOPE = "/gcube/devNext";
|
||||
public final static String DEFAULT_TOKEN = "ae1208f0-210d-47c9-9b24-d3f2dfcce05f-98187548";
|
||||
|
||||
public static final String DEFAULT_ROLE = "OrganizationMember";
|
||||
// public final static String DEFAULT_SCOPE = "/gcube/devNext";
|
||||
// public final static String DEFAULT_SCOPE = "/gcube/devNext/NextNext";
|
||||
|
||||
public static final String SClientMap = "DataMinerClientMap";
|
||||
public static final String DATA_MINER_SERVICE_NAME = "DataMiner";
|
||||
public static final String DATAMINER_SERVICE_CATEGORY = "DataAnalysis";
|
||||
|
||||
public static final String TD_DATASOURCE_FACTORY_ID = "DataMinerManager";
|
||||
|
||||
public static final int TIME_UPDATE_COMPUTATION_STATUS_PANEL = 5 * 1000;// 7*1000;
|
||||
|
||||
public static final String[] ClassificationNames = { "User Perspective" ***REMOVED***;
|
||||
// "Computation Perspective"***REMOVED***;
|
||||
public static final String UserClassificationName = ClassificationNames[0];
|
||||
// public final static String computationClassificationName =
|
||||
// classificationNames[1];
|
||||
|
||||
// WPS Data Miner
|
||||
public static final String WPSServiceURL = "http://dataminer-d-d4s.d4science.org:80/wps/";
|
||||
public static final String WPSWebProcessingService = "WebProcessingService";
|
||||
public static final String WPSCancelComputationServlet = "CancelComputationServlet";
|
||||
public static final String WPSToken = "f0666597-4302-49ce-bea2-555b94e569cb";
|
||||
public static final String WPSUser = "giancarlo.panichi";
|
||||
public static final String WPSLanguage = "en-US";
|
||||
/*
|
||||
***REMOVED***public static final String WPSToken =
|
||||
***REMOVED***"4ccc2c35-60c9-4c9b-9800-616538d5d48b"; public static final String
|
||||
***REMOVED***WPSUser = "gianpaolo.coro";
|
||||
***REMOVED***
|
||||
|
||||
// DownloadFolderServlet
|
||||
public static final String DOWNLOAD_FOLDER_SERVLET = "DownloadFolderServlet";
|
||||
public static final String DOWNLOAD_FOLDER_SERVLET_ITEM_ID_PARAMETER = "itemId";
|
||||
public static final String DOWNLOAD_FOLDER_SERVLET_FOLDER_NAME_PARAMETER = "folderName";
|
||||
|
||||
// ClientMonitor
|
||||
public static final int CLIENT_MONITOR_PERIODMILLIS = 2000;
|
||||
public static final int CLIENT_MONITOR_TIME_OUT_PERIODMILLIS = 1800000;
|
||||
|
||||
// Session
|
||||
public static final String CURR_GROUP_ID = "CURR_GROUP_ID";
|
||||
public static final String CURR_USER_ID = "CURR_USER_ID";
|
||||
|
||||
// TimeOut
|
||||
public static final long SERVICE_CLIENT_THREAD_POOL_TIME_OUT_UPDATE_MILLIS = 86400000;
|
||||
public static final long SERVICE_CLIENT_TIMEOUT_DEFAULT_MILLIS = 1800000;
|
||||
public static final int DAEMON_SLEEP_MILLIS = 1000;
|
||||
public static final int TEST_MONITOR_PERIODMILLIS = 3000;
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,84 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.shared.config;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class DMBatchConfig implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4251753074961060428L;
|
||||
private ArrayList<String> dms;
|
||||
private String token;
|
||||
private String protocol;
|
||||
private String testType;
|
||||
|
||||
public DMBatchConfig() {
|
||||
super();
|
||||
***REMOVED***
|
||||
|
||||
public DMBatchConfig(ArrayList<String> dms, String token, String protocol, String testType) {
|
||||
super();
|
||||
this.dms = dms;
|
||||
this.token = token;
|
||||
this.protocol = protocol;
|
||||
this.testType = testType;
|
||||
***REMOVED***
|
||||
|
||||
public ArrayList<String> getDms() {
|
||||
return dms;
|
||||
***REMOVED***
|
||||
|
||||
public void setDms(ArrayList<String> dms) {
|
||||
this.dms = dms;
|
||||
***REMOVED***
|
||||
|
||||
public ArrayList<String> getDmsUrls() {
|
||||
ArrayList<String> dmsUrls = new ArrayList<>();
|
||||
if (protocol != null) {
|
||||
if (dms != null && !dms.isEmpty()) {
|
||||
for (int i = 0; i < dms.size(); i++) {
|
||||
String dmName = dms.get(i);
|
||||
String url = new String(protocol + "://" + dmName + "/wps/");
|
||||
dmsUrls.add(url);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
return dmsUrls;
|
||||
***REMOVED***
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
***REMOVED***
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
***REMOVED***
|
||||
|
||||
public String getProtocol() {
|
||||
return protocol;
|
||||
***REMOVED***
|
||||
|
||||
public void setProtocol(String protocol) {
|
||||
this.protocol = protocol;
|
||||
***REMOVED***
|
||||
|
||||
public String getTestType() {
|
||||
return testType;
|
||||
***REMOVED***
|
||||
|
||||
public void setTestType(String testType) {
|
||||
this.testType = testType;
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DMBatchConfig [dms=" + dms + ", token=" + token + ", protocol=" + protocol + ", testType=" + testType
|
||||
+ "]";
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,76 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.shared.config;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class DMConfig implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4251753074961060428L;
|
||||
private String dm;
|
||||
private String token;
|
||||
private String protocol;
|
||||
private String testType;
|
||||
|
||||
public DMConfig() {
|
||||
super();
|
||||
***REMOVED***
|
||||
|
||||
public DMConfig(String dm, String token, String protocol, String testType) {
|
||||
super();
|
||||
this.dm = dm;
|
||||
this.token = token;
|
||||
this.protocol = protocol;
|
||||
this.testType = testType;
|
||||
***REMOVED***
|
||||
|
||||
public String getDm() {
|
||||
return dm;
|
||||
***REMOVED***
|
||||
|
||||
public void setDm(String dm) {
|
||||
this.dm = dm;
|
||||
***REMOVED***
|
||||
|
||||
public String getDmUrl() {
|
||||
String url = null;
|
||||
if (protocol != null && dm != null) {
|
||||
url = new String(protocol + "://" + dm + "/wps/");
|
||||
***REMOVED***
|
||||
return url;
|
||||
***REMOVED***
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
***REMOVED***
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
***REMOVED***
|
||||
|
||||
public String getProtocol() {
|
||||
return protocol;
|
||||
***REMOVED***
|
||||
|
||||
public void setProtocol(String protocol) {
|
||||
this.protocol = protocol;
|
||||
***REMOVED***
|
||||
|
||||
public String getTestType() {
|
||||
return testType;
|
||||
***REMOVED***
|
||||
|
||||
public void setTestType(String testType) {
|
||||
this.testType = testType;
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DMConfig [dm=" + dm + ", token=" + token + ", protocol=" + protocol + ", testType=" + testType + "]";
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,95 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.shared.config;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class DMDiffConfig implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -8892345776441085380L;
|
||||
private String dm1;
|
||||
private String token1;
|
||||
private String dm2;
|
||||
private String token2;
|
||||
private String protocol;
|
||||
|
||||
public DMDiffConfig() {
|
||||
super();
|
||||
***REMOVED***
|
||||
|
||||
public DMDiffConfig(String dm1, String token1, String dm2, String token2, String protocol) {
|
||||
super();
|
||||
this.dm1 = dm1;
|
||||
this.token1 = token1;
|
||||
this.dm2 = dm2;
|
||||
this.token2 = token2;
|
||||
this.protocol = protocol;
|
||||
***REMOVED***
|
||||
|
||||
public String getDm1() {
|
||||
return dm1;
|
||||
***REMOVED***
|
||||
|
||||
public void setDm1(String dm1) {
|
||||
this.dm1 = dm1;
|
||||
***REMOVED***
|
||||
|
||||
public String getDmUrl1() {
|
||||
String url=null;
|
||||
if (protocol != null && dm1 != null) {
|
||||
url = new String(protocol + "://" + dm1 + "/wps/");
|
||||
***REMOVED***
|
||||
return url;
|
||||
***REMOVED***
|
||||
|
||||
public String getToken1() {
|
||||
return token1;
|
||||
***REMOVED***
|
||||
|
||||
public void setToken1(String token1) {
|
||||
this.token1 = token1;
|
||||
***REMOVED***
|
||||
|
||||
public String getDm2() {
|
||||
return dm2;
|
||||
***REMOVED***
|
||||
|
||||
public void setDm2(String dm2) {
|
||||
this.dm2 = dm2;
|
||||
***REMOVED***
|
||||
|
||||
public String getDmUrl2() {
|
||||
String url=null;
|
||||
if (protocol != null && dm2 != null) {
|
||||
url = new String(protocol + "://" + dm2 + "/wps/");
|
||||
***REMOVED***
|
||||
return url;
|
||||
***REMOVED***
|
||||
|
||||
public String getToken2() {
|
||||
return token2;
|
||||
***REMOVED***
|
||||
|
||||
public void setToken2(String token2) {
|
||||
this.token2 = token2;
|
||||
***REMOVED***
|
||||
|
||||
public String getProtocol() {
|
||||
return protocol;
|
||||
***REMOVED***
|
||||
|
||||
public void setProtocol(String protocol) {
|
||||
this.protocol = protocol;
|
||||
***REMOVED***
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DMDiffConfig [dm1=" + dm1 + ", token1=" + token1 + ", dm2=" + dm2 + ", token2=" + token2 + ", protocol="
|
||||
+ protocol + "]";
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,44 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.shared.config;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public enum ProtocolType {
|
||||
Http("http"), https("https");
|
||||
|
||||
private ProtocolType(final String id) {
|
||||
this.id = id;
|
||||
***REMOVED***
|
||||
|
||||
private final String id;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return id;
|
||||
***REMOVED***
|
||||
|
||||
public String getLabel() {
|
||||
return id;
|
||||
***REMOVED***
|
||||
|
||||
public boolean compareId(String identificator) {
|
||||
if (identificator.compareTo(id) == 0) {
|
||||
return true;
|
||||
***REMOVED*** else {
|
||||
return false;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
public static ProtocolType getTypeFromId(String id) {
|
||||
for (ProtocolType testType : values()) {
|
||||
if (testType.id.compareToIgnoreCase(id) == 0) {
|
||||
return testType;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
return null;
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,48 @@
|
|||
package org.gcube.portlets.user.dataminermanagertester.shared.config;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public enum TestType {
|
||||
Capabilities("Capabilities"), DBScan("DBScan"), BionymLocal("Bionym Local"), CMSY2("CMSY 2"), CSquareColumnCreator(
|
||||
"CSquare Column Creator"), FeedForwardAnn("Feed Forward ANN"), GenericCharts("Generic Charts"), ListDBName(
|
||||
"List DB Name"), OpenMeshRecostructorGPU("Open Mesh Recostructor GPU"), PolygonsToMap(
|
||||
"Polygons To Map"), RasterDataPublisher("Raster Data Publisher"), XYExtractor(
|
||||
"XYExtractor"), WebAppPublisher("Web App Publisher");
|
||||
|
||||
private TestType(final String id) {
|
||||
this.id = id;
|
||||
***REMOVED***
|
||||
|
||||
private final String id;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return id;
|
||||
***REMOVED***
|
||||
|
||||
public String getLabel() {
|
||||
return id;
|
||||
***REMOVED***
|
||||
|
||||
public boolean compareId(String identificator) {
|
||||
if (identificator.compareTo(id) == 0) {
|
||||
return true;
|
||||
***REMOVED*** else {
|
||||
return false;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
|
||||
public static TestType getTypeFromId(String id) {
|
||||
for (TestType testType : values()) {
|
||||
if (testType.id.compareToIgnoreCase(id) == 0) {
|
||||
return testType;
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
return null;
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
|
@ -0,0 +1,42 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.dataminermanagertester.shared.exception;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class ServiceException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = 2448597554902518518L;
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
public ServiceException() {
|
||||
super();
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***@param message
|
||||
***REMOVED*** message
|
||||
***REMOVED***
|
||||
public ServiceException(String message) {
|
||||
super(message);
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***@param message
|
||||
***REMOVED*** message
|
||||
***REMOVED***@param throwable
|
||||
***REMOVED*** error
|
||||
***REMOVED***
|
||||
public ServiceException(String message, Throwable throwable) {
|
||||
super(message, throwable);
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue