git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/accounting-dashboard@169691 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
cd7664a294
commit
f307dfe922
|
@ -0,0 +1,54 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry including="**/*.java" kind="src" output="target/accounting-dashboard-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/accounting-dashboard-1.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
<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="lib" path="/home/giancarlo/gwt/gwt-2.8.2/gwt-user.jar">
|
||||
<attributes>
|
||||
<attribute name="javadoc_location" value="file:/home/giancarlo/gwt/gwt-2.8.2/doc/javadoc/"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.8.2/gwt-codeserver.jar">
|
||||
<attributes>
|
||||
<attribute name="javadoc_location" value="file:/home/giancarlo/gwt/gwt-2.8.2/doc/javadoc/"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.8.2/gwt-dev.jar">
|
||||
<attributes>
|
||||
<attribute name="javadoc_location" value="file:/home/giancarlo/gwt/gwt-2.8.2/doc/javadoc/"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.8.2/validation-api-1.0.0.GA.jar" sourcepath="/home/giancarlo/gwt/gwt-2.8.2/validation-api-1.0.0.GA-sources.jar"/>
|
||||
<classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.8.2/validation-api-1.0.0.GA-sources.jar"/>
|
||||
<classpathentry kind="output" path="target/accounting-dashboard-1.0.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
</classpath>
|
|
@ -0,0 +1,53 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>accounting-dashboard</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.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
|
||||
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
|
||||
<nature>com.google.gwt.eclipse.core.gwtNature</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,3 @@
|
|||
eclipse.preferences.version=1
|
||||
entryPointModules=
|
||||
filesCopiedToWebInfLib=
|
|
@ -0,0 +1,6 @@
|
|||
eclipse.preferences.version=1
|
||||
encoding//src/main/java=UTF-8
|
||||
encoding//src/main/resources=UTF-8
|
||||
encoding//src/test/java=UTF-8
|
||||
encoding//src/test/resources=UTF-8
|
||||
encoding/<project>=UTF-8
|
|
@ -0,0 +1,13 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.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="accounting-dashboard-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="/cmems-importer/target/cmems-importer-1.0.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
<property name="context-root" value="accounting-dashboard"/>
|
||||
</wb-module>
|
||||
</project-modules>
|
|
@ -0,0 +1,7 @@
|
|||
<root>
|
||||
<facet id="jst.jaxrs">
|
||||
<node name="libprov">
|
||||
<attribute name="provider-id" value="jaxrs-no-op-library-provider"/>
|
||||
</node>
|
||||
</facet>
|
||||
</root>
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faceted-project>
|
||||
<fixed facet="wst.jsdt.web"/>
|
||||
<installed facet="java" version="1.8"/>
|
||||
<installed facet="jst.web" version="3.0"/>
|
||||
<installed facet="wst.jsdt.web" version="1.0"/>
|
||||
<installed facet="jst.jaxrs" version="2.0"/>
|
||||
</faceted-project>
|
|
@ -0,0 +1,2 @@
|
|||
disabled=06target
|
||||
eclipse.preferences.version=1
|
|
@ -0,0 +1 @@
|
|||
${gcube.license}
|
|
@ -0,0 +1,68 @@
|
|||
The gCube System - ${name}
|
||||
--------------------------------------------------
|
||||
|
||||
${description}
|
||||
|
||||
|
||||
${gcube.description}
|
||||
|
||||
${gcube.funding}
|
||||
|
||||
|
||||
Version
|
||||
--------------------------------------------------
|
||||
|
||||
${version} (${buildDate})
|
||||
|
||||
Please see the file named "changelog.xml" in this directory for the release notes.
|
||||
|
||||
|
||||
Authors
|
||||
--------------------------------------------------
|
||||
|
||||
* Giancarlo Panichi (giancarlo.panichi-AT-isti.cnr.it),
|
||||
Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" CNR, Pisa IT
|
||||
|
||||
|
||||
Maintainers
|
||||
-----------
|
||||
|
||||
* Giancarlo Panichi (giancarlo.panichi-AT-isti.cnr.it),
|
||||
Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" CNR, Pisa IT
|
||||
|
||||
|
||||
Download information
|
||||
--------------------------------------------------
|
||||
|
||||
Source code is available from SVN:
|
||||
${scm.url}
|
||||
|
||||
Binaries can be downloaded from the gCube website:
|
||||
${gcube.website}
|
||||
|
||||
|
||||
Installation
|
||||
--------------------------------------------------
|
||||
|
||||
Installation documentation is available on-line in the gCube Wiki:
|
||||
https://wiki.gcube-system.org/gcube/CMEMS_Scheduler_Manager
|
||||
|
||||
|
||||
Documentation
|
||||
--------------------------------------------------
|
||||
|
||||
Documentation is available on-line in the gCube Wiki:
|
||||
https://wiki.gcube-system.org/gcube/CMEMS_Scheduler_Manager
|
||||
|
||||
|
||||
Support
|
||||
--------------------------------------------------
|
||||
|
||||
Bugs and support requests can be reported in the gCube issue tracking tool:
|
||||
${gcube.issueTracking}
|
||||
|
||||
|
||||
Licensing
|
||||
--------------------------------------------------
|
||||
|
||||
This software is licensed under the terms you may find in the file named "LICENSE" in this directory.
|
|
@ -0,0 +1,5 @@
|
|||
<ReleaseNotes>
|
||||
<Changeset component="${groupId}.${artifactId}.1-0-0" date="2018-08-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}</directory>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<useDefaultExcludes>true</useDefaultExcludes>
|
||||
<includes>
|
||||
<include>README</include>
|
||||
<include>LICENSE</include>
|
||||
<include>changelog.xml</include>
|
||||
<include>profile.xml</include>
|
||||
</includes>
|
||||
<fileMode>755</fileMode>
|
||||
<filtered>true</filtered>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
<files>
|
||||
<file>
|
||||
<source>target/${build.finalName}.${project.packaging}</source>
|
||||
<outputDirectory>/${artifactId}</outputDirectory>
|
||||
</file>
|
||||
|
||||
</files>
|
||||
</assembly>
|
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Resource>
|
||||
<ID></ID>
|
||||
<Type>Service</Type>
|
||||
<Profile>
|
||||
<Description>${project.description}</Description>
|
||||
<Class>PortletsUser</Class>
|
||||
<Name>${project.name}</Name>
|
||||
<Version>1.0.0</Version>
|
||||
<Packages>
|
||||
<Software>
|
||||
<Description>${project.description}</Description>
|
||||
<Name>${project.name}</Name>
|
||||
<Version>${version}</Version>
|
||||
<MavenCoordinates>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>${project.artifactId}</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</MavenCoordinates>
|
||||
<Type>webapplication</Type>
|
||||
<Files>
|
||||
<File>${project.build.finalName}.${project.packaging}</File>
|
||||
</Files>
|
||||
</Software>
|
||||
</Packages>
|
||||
</Profile>
|
||||
</Resource>
|
||||
|
||||
|
|
@ -0,0 +1,395 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
|
||||
<parent>
|
||||
<artifactId>maven-parent</artifactId>
|
||||
<groupId>org.gcube.tools</groupId>
|
||||
<version>1.0.0</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<!-- POM file generated with GWT webAppCreator -->
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.gcube.portlets.user</groupId>
|
||||
<artifactId>accounting-dashboard</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<name>accounting-dashboard</name>
|
||||
<description>Accounting Dashboard</description>
|
||||
|
||||
<scm>
|
||||
<url>https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/accounting-dashborad</url>
|
||||
</scm>
|
||||
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<name>Giancarlo Panichi</name>
|
||||
<email>g.panichi@isti.cnr.it</email>
|
||||
<organization>CNR Pisa, Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo"</organization>
|
||||
<roles>
|
||||
<role>architect</role>
|
||||
<role>developer</role>
|
||||
</roles>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
|
||||
<properties>
|
||||
<distroDirectory>distro</distroDirectory>
|
||||
<configDirectory>config</configDirectory>
|
||||
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
|
||||
|
||||
<!-- 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>
|
||||
<gwt.log.version>3.3.2</gwt.log.version>
|
||||
<gwtp.version>1.6</gwtp.version>
|
||||
<gin.version>2.1.2</gin.version>
|
||||
<gwtBootStrapVersion>2.3.2.0</gwtBootStrapVersion>
|
||||
|
||||
<gwt.runTarget>AccountingDashboard.html</gwt.runTarget>
|
||||
<gwt.module.name>org.gcube.portlets.user.accountingdashboard.accountingdashb</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}</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>
|
||||
|
||||
<!-- javax.servlet-api -->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</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>
|
||||
|
||||
</dependencies>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- GWT -->
|
||||
<dependency>
|
||||
<groupId>com.google.gwt</groupId>
|
||||
<artifactId>gwt-servlet</artifactId>
|
||||
<version>${gwt.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.gwt</groupId>
|
||||
<artifactId>gwt-user</artifactId>
|
||||
<version>${gwt.version}</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}</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}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.gwtplatform</groupId>
|
||||
<artifactId>gwtp-processors</artifactId>
|
||||
<version>${gwtp.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- DI -->
|
||||
<dependency>
|
||||
<groupId>com.google.gwt.inject</groupId>
|
||||
<artifactId>gin</artifactId>
|
||||
<version>${gin.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- XML Apis -->
|
||||
<dependency>
|
||||
<groupId>xml-apis</groupId>
|
||||
<artifactId>xml-apis</artifactId>
|
||||
<version>1.4.01</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<!-- GWTBootstrap -->
|
||||
<dependency>
|
||||
<groupId>com.github.gwtbootstrap</groupId>
|
||||
<artifactId>gwt-bootstrap</artifactId>
|
||||
<version>${gwtBootStrapVersion}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<!-- Portlet -->
|
||||
<dependency>
|
||||
<groupId>javax.portlet</groupId>
|
||||
<artifactId>portlet-api</artifactId>
|
||||
</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>
|
||||
|
||||
<!-- Information System -->
|
||||
<dependency>
|
||||
<groupId>org.gcube.resources.discovery</groupId>
|
||||
<artifactId>ic-client</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- accounting-summary-access -->
|
||||
<dependency>
|
||||
<groupId>org.gcube.data.access</groupId>
|
||||
<artifactId>accounting-summary-access</artifactId>
|
||||
<version>[0.0.1-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||
</dependency>
|
||||
|
||||
<!-- LOGGING -->
|
||||
<dependency>
|
||||
<groupId>com.allen-sauer.gwt.log</groupId>
|
||||
<artifactId>gwt-log</artifactId>
|
||||
<version>${gwt.log.version}</version>
|
||||
</dependency>
|
||||
|
||||
<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 TEST -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
<!-- Generate compiled stuff in the folder used for developing mode -->
|
||||
<outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**/*.css</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/*.*</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
|
||||
<!-- GWT -->
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>gwt-maven-plugin</artifactId>
|
||||
<version>${gwt.version}</version>
|
||||
<configuration>
|
||||
<strict>true</strict>
|
||||
<testTimeOut>180</testTimeOut>
|
||||
<mode>htmlunit</mode>
|
||||
<includes>**/*GwtTest.java</includes>
|
||||
<logLevel>INFO</logLevel>
|
||||
<runTarget>${gwt.runTarget}</runTarget>
|
||||
<hostedWebapp>${webappDirectory}</hostedWebapp>
|
||||
<module>${gwt.module.name}</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}</webappDirectory>
|
||||
<warName>${project.build.finalName}</warName>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- Maven Compiler Plugin -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${maven-compiler-plugin.version}</version>
|
||||
<configuration>
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
<!-- <configuration> <excludes> <exclude>src/java/main/org/gcube/portlets/user/cmemsschedulermanager/client/application/event/*</exclude>
|
||||
</excludes> </configuration> -->
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>${distroDirectory}/descriptor.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>servicearchive</id>
|
||||
<phase>install</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
</build>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.gcube.distribution</groupId>
|
||||
<artifactId>maven-portal-bom</artifactId>
|
||||
<version>LATEST</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
||||
|
||||
</project>
|
|
@ -0,0 +1,39 @@
|
|||
<module rename-to="accountingdashb">
|
||||
<inherits name="com.google.gwt.user.User" />
|
||||
<inherits name="com.google.gwt.http.HTTP" />
|
||||
<inherits name="com.google.gwt.resources.Resources" />
|
||||
<inherits name="com.google.gwt.logging.Logging" />
|
||||
<inherits name='com.google.gwt.user.theme.standard.Standard' />
|
||||
|
||||
<inherits name="com.github.gwtbootstrap.Bootstrap" />
|
||||
<inherits name='com.github.gwtbootstrap.datetimepicker.Datetimepicker' />
|
||||
|
||||
<!--pay attention in this part -->
|
||||
<!-- <replace-with class="org.gcube.portlets.user.cmemsschedulermanager.client.resources.ThemeConfigurator">
|
||||
<when-type-is class="com.github.gwtbootstrap.client.ui.config.Configurator"
|
||||
/> </replace-with> -->
|
||||
|
||||
|
||||
<inherits name="com.gwtplatform.mvp.MvpWithEntryPoint" />
|
||||
|
||||
<extend-configuration-property name="gin.ginjector.modules"
|
||||
value="org.gcube.portlets.user.accountingdashboard.client.gin.AccountingDashBoardClientModule" />
|
||||
<!-- Specify the paths for translatable code -->
|
||||
<source path="client" />
|
||||
<source path="shared" />
|
||||
|
||||
<set-configuration-property name="CssResource.enableGss"
|
||||
value="true" />
|
||||
<set-configuration-property name="CssResource.conversionMode"
|
||||
value="strict" />
|
||||
|
||||
<!-- <set-property name="gwt.logging.logLevel" value="SEVERE" /> <set-property
|
||||
name="gwt.logging.enabled" value="TRUE" /> -->
|
||||
|
||||
<set-property name="gwt.logging.logLevel" value="FINE" />
|
||||
<set-property name="gwt.logging.enabled" value="TRUE" />
|
||||
<set-property name="gwt.logging.consoleHandler" value="ENABLED" />
|
||||
|
||||
</module>
|
||||
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application;
|
||||
|
||||
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.controller.ControllerModule;
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.dialog.error.ErrorModule;
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.dialog.info.InfoModule;
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.dialog.monitor.MonitorModule;
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.mainarea.MainAreaModule;
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.menu.MenuModule;
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.providers.DataProviderModule;
|
||||
|
||||
import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class ApplicationModule extends AbstractPresenterModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
install(new MonitorModule());
|
||||
install(new InfoModule());
|
||||
install(new ErrorModule());
|
||||
install(new ControllerModule());
|
||||
install(new DataProviderModule());
|
||||
install(new MenuModule());
|
||||
install(new MainAreaModule());
|
||||
|
||||
|
||||
bindPresenter(ApplicationPresenter.class, ApplicationPresenter.PresenterView.class, ApplicationView.class,
|
||||
ApplicationPresenter.ApplicationPresenterProxy.class);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application;
|
||||
|
||||
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.controller.Controller;
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.menu.MenuPresenter;
|
||||
|
||||
import com.google.gwt.user.client.Window;
|
||||
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;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class ApplicationPresenter
|
||||
extends Presenter<ApplicationPresenter.PresenterView, ApplicationPresenter.ApplicationPresenterProxy>
|
||||
implements NavigationHandler {
|
||||
interface PresenterView extends View {
|
||||
}
|
||||
|
||||
@ProxyStandard
|
||||
interface ApplicationPresenterProxy extends Proxy<ApplicationPresenter> {
|
||||
}
|
||||
|
||||
public static final PermanentSlot<MenuPresenter> SLOT_MENU = new PermanentSlot<>();
|
||||
public static final NestedSlot SLOT_MAIN = new NestedSlot();
|
||||
|
||||
private MenuPresenter menuPresenter;
|
||||
private Controller controller;
|
||||
|
||||
|
||||
@Inject
|
||||
ApplicationPresenter(EventBus eventBus, PresenterView view, ApplicationPresenterProxy proxy, MenuPresenter menuPresenter,
|
||||
Controller controller) {
|
||||
super(eventBus, view, proxy, RevealType.Root);
|
||||
this.menuPresenter = menuPresenter;
|
||||
this.controller = controller;
|
||||
callHello();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBind() {
|
||||
super.onBind();
|
||||
|
||||
setInSlot(SLOT_MENU, menuPresenter);
|
||||
addRegisteredHandler(NavigationEvent.getType(), this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onReveal() {
|
||||
super.onReveal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNavigation(NavigationEvent navigationEvent) {
|
||||
Window.scrollTo(0, 0);
|
||||
// PlaceRequest placeRequest=navigationEvent.getRequest();
|
||||
// placeManager.revealPlace(placeRequest);
|
||||
|
||||
}
|
||||
|
||||
private void callHello(){
|
||||
controller.callHello();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.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> {
|
||||
}
|
||||
|
||||
@UiField
|
||||
HTMLPanel menu;
|
||||
@UiField
|
||||
HTMLPanel main;
|
||||
|
||||
@Inject
|
||||
ApplicationView(Binder uiBinder) {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
bindSlot(ApplicationPresenter.SLOT_MENU, menu);
|
||||
bindSlot(ApplicationPresenter.SLOT_MAIN, main);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
<!-- @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:b="urn:import:com.github.gwtbootstrap.client.ui">
|
||||
|
||||
<ui:with field="res"
|
||||
type="org.gcube.portlets.user.accountingdashboard.client.resources.AppResources" />
|
||||
|
||||
|
||||
<g:HTMLPanel>
|
||||
<g:HTMLPanel ui:field="menu" />
|
||||
<g:HTMLPanel ui:field="main" />
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
|
@ -0,0 +1,23 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application;
|
||||
|
||||
import com.google.gwt.i18n.client.Messages;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public interface CommonMessages extends Messages {
|
||||
|
||||
//
|
||||
@DefaultMessage("Attention")
|
||||
String attention();
|
||||
|
||||
@DefaultMessage("Error")
|
||||
String error();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.controller;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class ApplicationCache implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 4076265357737593194L;
|
||||
|
||||
public ApplicationCache() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ApplicationCache";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,88 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.controller;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.dialog.error.ErrorPresenter;
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.dialog.info.InfoPresenter;
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.dialog.monitor.MonitorPresenter;
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.event.HelloEvent;
|
||||
import org.gcube.portlets.user.accountingdashboard.client.rpc.AccountingDashboardServiceAsync;
|
||||
import org.gcube.portlets.user.accountingdashboard.shared.session.UserInfo;
|
||||
|
||||
import com.google.gwt.event.shared.EventBus;
|
||||
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.user.client.rpc.AsyncCallback;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.name.Named;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class Controller {
|
||||
private static Logger logger = java.util.logging.Logger.getLogger("");
|
||||
|
||||
private EventBus eventBus;
|
||||
private AccountingDashboardServiceAsync service;
|
||||
private ApplicationCache cache;
|
||||
private MonitorPresenter monitorPresenter;
|
||||
private ErrorPresenter errorPresenter;
|
||||
private InfoPresenter infoPresenter;
|
||||
|
||||
@Inject
|
||||
Controller(@Named("ControllerEventBus") EventBus eventBus, AccountingDashboardServiceAsync service,
|
||||
MonitorPresenter monitorPresenter, ErrorPresenter errorPresenter, InfoPresenter infoPresenter) {
|
||||
this.eventBus = eventBus;
|
||||
this.service = service;
|
||||
this.monitorPresenter = monitorPresenter;
|
||||
this.errorPresenter = errorPresenter;
|
||||
this.infoPresenter = infoPresenter;
|
||||
this.cache = new ApplicationCache();
|
||||
}
|
||||
|
||||
public void fireEvent(GwtEvent<?> event) {
|
||||
eventBus.fireEventFromSource(event, this);
|
||||
}
|
||||
|
||||
public final <H extends EventHandler> HandlerRegistration addHandler(GwtEvent.Type<H> type, H handler) {
|
||||
return eventBus.addHandler(type, handler);
|
||||
}
|
||||
|
||||
public EventBus getEventBus() {
|
||||
return eventBus;
|
||||
}
|
||||
|
||||
public void hello() {
|
||||
eventBus.fireEvent(new HelloEvent());
|
||||
}
|
||||
|
||||
public void callHello() {
|
||||
/* String groupId= GCubeClientContext.getCurrentContextId(); */
|
||||
|
||||
// String token = Window.Location.getParameter(Constants.TOKEN);
|
||||
// logger.log(Level.FINE,"Token: " + token);
|
||||
|
||||
// MaterialLoader.showLoading(true);
|
||||
service.hello(new AsyncCallback<UserInfo>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
logger.log(Level.FINE, "Error in Hello(): ", caught);
|
||||
errorPresenter.errorMessage(caught.getLocalizedMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(UserInfo result) {
|
||||
logger.log(Level.FINE, "Hello: " + result.getUsername());
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.controller;
|
||||
|
||||
import com.google.gwt.event.shared.EventBus;
|
||||
import com.google.gwt.event.shared.SimpleEventBus;
|
||||
import com.google.gwt.inject.client.AbstractGinModule;
|
||||
import com.google.inject.Singleton;
|
||||
import com.google.inject.name.Names;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class ControllerModule extends AbstractGinModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
|
||||
bind(Controller.class).in(Singleton.class);
|
||||
bind(EventBus.class).annotatedWith(Names.named("ControllerEventBus")).to(SimpleEventBus.class)
|
||||
.in(Singleton.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.customwidget;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.customwidget.TagWidgetHideEvent.HasTagWidgetHideEventHandlers;
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.customwidget.TagWidgetHideEvent.TagWidgetHideEventHandler;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.SpanElement;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.shared.HandlerRegistration;
|
||||
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.Event;
|
||||
import com.google.gwt.user.client.ui.Button;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HasText;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class TagWidget extends Composite implements HasText, HasTagWidgetHideEventHandlers {
|
||||
private static Logger logger = java.util.logging.Logger.getLogger("");
|
||||
private static TagWidgetUiBinder uiBinder = GWT.create(TagWidgetUiBinder.class);
|
||||
|
||||
interface TagWidgetUiBinder extends UiBinder<Widget, TagWidget> {
|
||||
}
|
||||
|
||||
public TagWidget() {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
int typeInt = Event.getTypeInt(ClickEvent.getType().getName());
|
||||
sinkEvents(typeInt);
|
||||
}
|
||||
|
||||
@UiField
|
||||
Button button;
|
||||
|
||||
@UiField
|
||||
SpanElement tagLabel;
|
||||
|
||||
public TagWidget(String label) {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
tagLabel.setInnerText(label);
|
||||
button.setText("x");
|
||||
}
|
||||
|
||||
@UiHandler("button")
|
||||
void onClick(ClickEvent e) {
|
||||
logger.log(Level.FINE,"Button Click");
|
||||
TagWidgetHideEvent event = new TagWidgetHideEvent(this);
|
||||
fireEvent(event);
|
||||
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
tagLabel.setInnerText(text);
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return tagLabel.getInnerText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerRegistration addTagWidgetHideEventHandler(TagWidgetHideEventHandler handler) {
|
||||
return addHandler(handler, TagWidgetHideEvent.TYPE);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
<!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">
|
||||
<ui:with field="res"
|
||||
type="org.gcube.portlets.user.accountingdashboard.client.resources.AppResources" />
|
||||
|
||||
|
||||
<ui:style>
|
||||
.cmsTagLabelText {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.cmsTagLabelButton {
|
||||
border-radius: 10px;
|
||||
border-bottom-style: inset;
|
||||
background-color: white;
|
||||
font-weight: normal;
|
||||
font-size: small;
|
||||
padding: 2px;
|
||||
margin: 1px;
|
||||
line-height: 11px!important;
|
||||
vertical-align: baseline;
|
||||
color: #5a5a5a;
|
||||
}
|
||||
|
||||
.csmTagLabelPanel {
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
background-color: #00ace2;
|
||||
border-radius: 8px;
|
||||
padding: 3px;
|
||||
margin: 2px;
|
||||
width: auto;
|
||||
display: inline-block;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
</ui:style>
|
||||
<g:HTMLPanel styleName="{style.csmTagLabelPanel}">
|
||||
<span ui:field="tagLabel" styleName="{style.cmsTagLabelText}" />
|
||||
<g:Button styleName="{style.cmsTagLabelButton}" ui:field="button" />
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
|
@ -0,0 +1,54 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.customwidget;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class TagWidgetHideEvent extends GwtEvent<TagWidgetHideEvent.TagWidgetHideEventHandler> {
|
||||
|
||||
public interface TagWidgetHideEventHandler extends EventHandler {
|
||||
void onHide(TagWidgetHideEvent event);
|
||||
}
|
||||
|
||||
public interface HasTagWidgetHideEventHandlers extends HasHandlers {
|
||||
HandlerRegistration addTagWidgetHideEventHandler(TagWidgetHideEventHandler handler);
|
||||
}
|
||||
|
||||
private TagWidget tagWidget;
|
||||
|
||||
public static final Type<TagWidgetHideEventHandler> TYPE = new Type<>();
|
||||
|
||||
public TagWidgetHideEvent(TagWidget tagWidget) {
|
||||
this.tagWidget = tagWidget;
|
||||
}
|
||||
|
||||
public static void fire(HasHandlers source, TagWidgetHideEvent event) {
|
||||
source.fireEvent(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<TagWidgetHideEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(TagWidgetHideEventHandler handler) {
|
||||
handler.onHide(this);
|
||||
}
|
||||
|
||||
public TagWidget getTagWidget() {
|
||||
return tagWidget;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TagWidgetHideEvent [tagWidget=" + tagWidget + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.dialog.error;
|
||||
|
||||
|
||||
import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class ErrorModule extends AbstractPresenterModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bindPresenterWidget(ErrorPresenter.class, ErrorPresenter.ErrorPresenterView.class, ErrorView.class);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.dialog.error;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.gwtplatform.mvp.client.HasUiHandlers;
|
||||
import com.gwtplatform.mvp.client.PopupView;
|
||||
import com.gwtplatform.mvp.client.PresenterWidget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
public class ErrorPresenter extends PresenterWidget<ErrorPresenter.ErrorPresenterView>
|
||||
implements ErrorUiHandlers {
|
||||
private static Logger logger = java.util.logging.Logger.getLogger("");
|
||||
|
||||
interface ErrorPresenterView extends PopupView, HasUiHandlers<ErrorPresenter> {
|
||||
public void errorMessage(String error);
|
||||
}
|
||||
|
||||
|
||||
@Inject
|
||||
ErrorPresenter(EventBus eventBus, ErrorPresenterView view) {
|
||||
super(eventBus, view);
|
||||
|
||||
getView().setUiHandlers(this);
|
||||
bindToEvent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBind() {
|
||||
super.onBind();
|
||||
}
|
||||
|
||||
private void bindToEvent() {
|
||||
/*
|
||||
controller.getEventBus().addHandler(MonitorEvent.TYPE, new MonitorEvent.MonitorEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onMonitor(MonitorEvent event) {
|
||||
|
||||
}
|
||||
});
|
||||
*/
|
||||
}
|
||||
|
||||
public void errorMessage(String error) {
|
||||
logger.log(Level.FINE,"Error message: " + error);
|
||||
getView().errorMessage(error);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.dialog.error;
|
||||
|
||||
|
||||
import com.gwtplatform.mvp.client.UiHandlers;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public interface ErrorUiHandlers extends UiHandlers{
|
||||
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.dialog.error;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Button;
|
||||
import com.github.gwtbootstrap.client.ui.Paragraph;
|
||||
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.DialogBox;
|
||||
import com.google.gwt.user.client.ui.PopupPanel;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.gwtplatform.mvp.client.PopupViewWithUiHandlers;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class ErrorView extends PopupViewWithUiHandlers<ErrorPresenter> implements ErrorPresenter.ErrorPresenterView {
|
||||
private static Logger logger = java.util.logging.Logger.getLogger("");
|
||||
|
||||
interface Binder extends UiBinder<PopupPanel, ErrorView> {
|
||||
|
||||
}
|
||||
|
||||
@UiField
|
||||
DialogBox dialogBox;
|
||||
|
||||
@UiField
|
||||
Paragraph errorMsg;
|
||||
|
||||
@UiField
|
||||
Button okBtn;
|
||||
|
||||
@UiHandler("okBtn")
|
||||
void handleClick(ClickEvent e) {
|
||||
logger.log(Level.FINE,"Close error dialog");
|
||||
dialogBox.hide();
|
||||
}
|
||||
|
||||
@Inject
|
||||
ErrorView(Binder uiBinder, EventBus eventBus) {
|
||||
super(eventBus);
|
||||
init();
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
|
||||
}
|
||||
|
||||
private void init() {
|
||||
dialogBox = new DialogBox(false, true);
|
||||
dialogBox.getElement().getStyle().setZIndex(1070);
|
||||
errorMsg = new Paragraph();
|
||||
okBtn = new Button();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void errorMessage(String error) {
|
||||
errorMsg.setText(error);
|
||||
dialogBox.center();
|
||||
dialogBox.show();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
<!-- @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:b="urn:import:com.github.gwtbootstrap.client.ui">
|
||||
|
||||
<ui:with field="res"
|
||||
type="org.gcube.portlets.user.accountingdashboard.client.resources.AppResources" />
|
||||
|
||||
|
||||
<!-- styleName="{style.popup}" -->
|
||||
<g:DialogBox ui:field="dialogBox" styleName="{res.uiDataCss.uiDataPopup}"
|
||||
glassStyleName="{res.uiDataCss.uiDataPopupGlass}" glassEnabled="true">
|
||||
<g:caption>
|
||||
<b>Error</b>
|
||||
</g:caption>
|
||||
<g:HTMLPanel>
|
||||
<b:Container>
|
||||
<b:Paragraph ui:field="errorMsg">
|
||||
</b:Paragraph>
|
||||
</b:Container>
|
||||
<b:Paragraph styleName="{res.uiDataCss.uiDataParagraphCentered}">
|
||||
<b:Button ui:field="okBtn">
|
||||
Ok
|
||||
</b:Button>
|
||||
</b:Paragraph>
|
||||
</g:HTMLPanel>
|
||||
</g:DialogBox>
|
||||
</ui:UiBinder>
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.dialog.info;
|
||||
|
||||
|
||||
import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class InfoModule extends AbstractPresenterModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bindPresenterWidget(InfoPresenter.class, InfoPresenter.InfoPresenterView.class, InfoView.class);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.dialog.info;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.gwtplatform.mvp.client.HasUiHandlers;
|
||||
import com.gwtplatform.mvp.client.PopupView;
|
||||
import com.gwtplatform.mvp.client.PresenterWidget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
public class InfoPresenter extends PresenterWidget<InfoPresenter.InfoPresenterView>
|
||||
implements InfoUiHandlers {
|
||||
private static Logger logger = java.util.logging.Logger.getLogger("");
|
||||
|
||||
interface InfoPresenterView extends PopupView, HasUiHandlers<InfoPresenter> {
|
||||
public void infoMessage(String info);
|
||||
}
|
||||
|
||||
|
||||
@Inject
|
||||
InfoPresenter(EventBus eventBus, InfoPresenterView view) {
|
||||
super(eventBus, view);
|
||||
|
||||
getView().setUiHandlers(this);
|
||||
bindToEvent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBind() {
|
||||
super.onBind();
|
||||
}
|
||||
|
||||
private void bindToEvent() {
|
||||
/*
|
||||
controller.getEventBus().addHandler(MonitorEvent.TYPE, new MonitorEvent.MonitorEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onMonitor(MonitorEvent event) {
|
||||
|
||||
}
|
||||
});
|
||||
*/
|
||||
}
|
||||
|
||||
public void infoMessage(String error) {
|
||||
logger.log(Level.FINE,"Info message: " + error);
|
||||
getView().infoMessage(error);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.dialog.info;
|
||||
|
||||
|
||||
import com.gwtplatform.mvp.client.UiHandlers;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public interface InfoUiHandlers extends UiHandlers{
|
||||
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.dialog.info;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Button;
|
||||
import com.github.gwtbootstrap.client.ui.Paragraph;
|
||||
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.DialogBox;
|
||||
import com.google.gwt.user.client.ui.PopupPanel;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.gwtplatform.mvp.client.PopupViewWithUiHandlers;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class InfoView extends PopupViewWithUiHandlers<InfoPresenter> implements InfoPresenter.InfoPresenterView {
|
||||
private static Logger logger = java.util.logging.Logger.getLogger("");
|
||||
|
||||
interface Binder extends UiBinder<PopupPanel, InfoView> {
|
||||
|
||||
}
|
||||
|
||||
@UiField
|
||||
DialogBox dialogBox;
|
||||
|
||||
@UiField
|
||||
Paragraph infoMsg;
|
||||
|
||||
@UiField
|
||||
Button okBtn;
|
||||
|
||||
@UiHandler("okBtn")
|
||||
void handleClick(ClickEvent e) {
|
||||
logger.log(Level.FINE,"Close info dialog");
|
||||
dialogBox.hide();
|
||||
}
|
||||
|
||||
@Inject
|
||||
InfoView(Binder uiBinder, EventBus eventBus) {
|
||||
super(eventBus);
|
||||
init();
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
|
||||
}
|
||||
|
||||
private void init() {
|
||||
dialogBox = new DialogBox(false, true);
|
||||
dialogBox.getElement().getStyle().setZIndex(1070);
|
||||
infoMsg = new Paragraph();
|
||||
okBtn = new Button();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void infoMessage(String error) {
|
||||
infoMsg.setText(error);
|
||||
dialogBox.center();
|
||||
dialogBox.show();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
<!-- @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:b="urn:import:com.github.gwtbootstrap.client.ui">
|
||||
|
||||
<ui:with field="res"
|
||||
type="org.gcube.portlets.user.accountingdashboard.client.resources.AppResources" />
|
||||
|
||||
|
||||
<!-- styleName="{style.popup}" -->
|
||||
<g:DialogBox ui:field="dialogBox" styleName="{res.uiDataCss.uiDataPopup}"
|
||||
glassStyleName="{res.uiDataCss.uiDataPopupGlass}" glassEnabled="true">
|
||||
<g:caption>
|
||||
<b>Error</b>
|
||||
</g:caption>
|
||||
<g:HTMLPanel>
|
||||
<b:Container>
|
||||
<b:Paragraph ui:field="infoMsg">
|
||||
</b:Paragraph>
|
||||
</b:Container>
|
||||
<b:Paragraph styleName="{res.uiDataCss.uiDataParagraphCentered}">
|
||||
<b:Button ui:field="okBtn">
|
||||
Ok
|
||||
</b:Button>
|
||||
</b:Paragraph>
|
||||
</g:HTMLPanel>
|
||||
</g:DialogBox>
|
||||
</ui:UiBinder>
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.dialog.monitor;
|
||||
|
||||
|
||||
import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class MonitorModule extends AbstractPresenterModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bindPresenterWidget(MonitorPresenter.class, MonitorPresenter.MonitorPresenterView.class, MonitorView.class);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.dialog.monitor;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.gwtplatform.mvp.client.HasUiHandlers;
|
||||
import com.gwtplatform.mvp.client.PopupView;
|
||||
import com.gwtplatform.mvp.client.PresenterWidget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
public class MonitorPresenter extends PresenterWidget<MonitorPresenter.MonitorPresenterView>
|
||||
implements MonitorUiHandlers {
|
||||
private static Logger logger = java.util.logging.Logger.getLogger("");
|
||||
|
||||
interface MonitorPresenterView extends PopupView, HasUiHandlers<MonitorPresenter> {
|
||||
public void monitor(boolean enable);
|
||||
}
|
||||
|
||||
|
||||
@Inject
|
||||
MonitorPresenter(EventBus eventBus, MonitorPresenterView view) {
|
||||
super(eventBus, view);
|
||||
|
||||
getView().setUiHandlers(this);
|
||||
bindToEvent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBind() {
|
||||
super.onBind();
|
||||
}
|
||||
|
||||
private void bindToEvent() {
|
||||
/*
|
||||
controller.getEventBus().addHandler(MonitorEvent.TYPE, new MonitorEvent.MonitorEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onMonitor(MonitorEvent event) {
|
||||
|
||||
}
|
||||
});
|
||||
*/
|
||||
}
|
||||
|
||||
public void enable(boolean enable) {
|
||||
logger.log(Level.FINE,"Monitor enable: " + enable);
|
||||
getView().monitor(enable);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.dialog.monitor;
|
||||
|
||||
|
||||
import com.gwtplatform.mvp.client.UiHandlers;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public interface MonitorUiHandlers extends UiHandlers{
|
||||
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.dialog.monitor;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.gcube.portlets.user.accountingdashboard.client.resources.AppResources;
|
||||
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.ui.DialogBox;
|
||||
import com.google.gwt.user.client.ui.PopupPanel;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.gwtplatform.mvp.client.PopupViewWithUiHandlers;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class MonitorView extends PopupViewWithUiHandlers<MonitorPresenter>
|
||||
implements MonitorPresenter.MonitorPresenterView {
|
||||
interface Binder extends UiBinder<PopupPanel, MonitorView> {
|
||||
|
||||
}
|
||||
|
||||
@UiField
|
||||
DialogBox dialogBox;
|
||||
|
||||
private AppResources resources;
|
||||
|
||||
|
||||
@Inject
|
||||
MonitorView(Binder uiBinder, EventBus eventBus, AppResources resources) {
|
||||
super(eventBus);
|
||||
this.resources=resources;
|
||||
init();
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
|
||||
}
|
||||
|
||||
private void init() {
|
||||
dialogBox = new DialogBox(false, true);
|
||||
dialogBox.addStyleName(resources.uiDataCss().uiDataMonitorPopup());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void monitor(boolean enable) {
|
||||
if (enable) {
|
||||
dialogBox.center();
|
||||
dialogBox.show();
|
||||
} else {
|
||||
dialogBox.hide();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
<!-- @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:b="urn:import:com.github.gwtbootstrap.client.ui">
|
||||
<ui:with field="res"
|
||||
type="org.gcube.portlets.user.accountingdashboard.client.resources.AppResources" />
|
||||
|
||||
<!-- styleName="{style.popup}" -->
|
||||
<g:DialogBox ui:field="dialogBox" styleName="{res.uiDataCss.uiDataMonitorPopup}"
|
||||
glassStyleName="{res.uiDataCss.uiDataMonitorPopupGlass}" glassEnabled="true">
|
||||
<g:caption>
|
||||
<b>Please wait</b>
|
||||
</g:caption>
|
||||
<g:HTMLPanel width="300px" styleName="{res.uiDataCss.uiDataMonitorPopupProgress}">
|
||||
<b:ProgressBar type="ANIMATED" percent="100" text="In progress..." />
|
||||
</g:HTMLPanel>
|
||||
</g:DialogBox>
|
||||
</ui:UiBinder>
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.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 HelloEvent extends GwtEvent<HelloEvent.HelloEventHandler> {
|
||||
|
||||
public interface HelloEventHandler extends EventHandler {
|
||||
void onHello(HelloEvent event);
|
||||
}
|
||||
|
||||
public static final Type<HelloEventHandler> TYPE = new Type<>();
|
||||
|
||||
|
||||
public HelloEvent() {}
|
||||
|
||||
|
||||
public static void fire(HasHandlers source, HelloEvent event) {
|
||||
source.fireEvent(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<HelloEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(HelloEventHandler handler) {
|
||||
handler.onHello(this);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.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 MonitorEvent extends GwtEvent<MonitorEvent.MonitorEventHandler> {
|
||||
|
||||
private boolean enable;
|
||||
public interface MonitorEventHandler extends EventHandler {
|
||||
void onMonitor(MonitorEvent event);
|
||||
}
|
||||
|
||||
public static final Type<MonitorEventHandler> TYPE = new Type<>();
|
||||
|
||||
public MonitorEvent(boolean enable) {
|
||||
this.enable=enable;
|
||||
}
|
||||
|
||||
public static void fire(HasHandlers source, MonitorEvent event) {
|
||||
source.fireEvent(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<MonitorEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(MonitorEventHandler handler) {
|
||||
handler.onMonitor(this);
|
||||
}
|
||||
|
||||
public boolean isEnable() {
|
||||
return enable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MonitorEvent [enable=" + enable + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.mainarea;
|
||||
|
||||
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.mainarea.filter.FilterAreaModule;
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.mainarea.report.ReportAreaModule;
|
||||
|
||||
import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class MainAreaModule extends AbstractPresenterModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
install(new FilterAreaModule());
|
||||
install(new ReportAreaModule());
|
||||
bindPresenter(MainAreaPresenter.class, MainAreaPresenter.MainAreaView.class, MainAreaView.class, MainAreaPresenter.MainAreaPresenterProxy.class);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.mainarea;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.ApplicationPresenter;
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.controller.Controller;
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.mainarea.filter.FilterAreaPresenter;
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.mainarea.report.ReportAreaPresenter;
|
||||
import org.gcube.portlets.user.accountingdashboard.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.presenter.slots.SingleSlot;
|
||||
import com.gwtplatform.mvp.client.proxy.ProxyPlace;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class MainAreaPresenter
|
||||
extends Presenter<MainAreaPresenter.MainAreaView, MainAreaPresenter.MainAreaPresenterProxy>
|
||||
implements MainAreaUiHandlers {
|
||||
|
||||
private static Logger logger = Logger.getLogger("");
|
||||
|
||||
interface MainAreaView extends View, HasUiHandlers<MainAreaPresenter> {
|
||||
|
||||
}
|
||||
|
||||
@ProxyStandard
|
||||
@NameToken(NameTokens.MAIN_AREA)
|
||||
@NoGatekeeper
|
||||
interface MainAreaPresenterProxy extends ProxyPlace<MainAreaPresenter> {
|
||||
}
|
||||
|
||||
public static final SingleSlot<FilterAreaPresenter> SLOT_FILTER = new SingleSlot<>();
|
||||
public static final SingleSlot<ReportAreaPresenter> SLOT_REPORT = new SingleSlot<>();
|
||||
|
||||
private EventBus eventBus;
|
||||
private Controller controller;
|
||||
private FilterAreaPresenter filterAreaPresenter;
|
||||
private ReportAreaPresenter reportAreaPresenter;
|
||||
|
||||
@Inject
|
||||
MainAreaPresenter(EventBus eventBus, MainAreaView view, MainAreaPresenterProxy proxy, Controller controller,
|
||||
FilterAreaPresenter filterAreaPresenter, ReportAreaPresenter reportAreaPresenter) {
|
||||
super(eventBus, view, proxy, ApplicationPresenter.SLOT_MAIN);
|
||||
this.eventBus = eventBus;
|
||||
this.controller = controller;
|
||||
this.filterAreaPresenter = filterAreaPresenter;
|
||||
this.reportAreaPresenter = reportAreaPresenter;
|
||||
getView().setUiHandlers(this);
|
||||
addProviders();
|
||||
bindToEvent();
|
||||
}
|
||||
|
||||
private void addProviders() {
|
||||
|
||||
}
|
||||
|
||||
private void bindToEvent() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBind() {
|
||||
super.onBind();
|
||||
setInSlot(SLOT_FILTER, filterAreaPresenter);
|
||||
setInSlot(SLOT_REPORT, reportAreaPresenter);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.mainarea;
|
||||
|
||||
import com.gwtplatform.mvp.client.UiHandlers;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public interface MainAreaUiHandlers extends UiHandlers {
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.mainarea;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.gcube.portlets.user.accountingdashboard.client.resources.AppResources;
|
||||
|
||||
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.ViewWithUiHandlers;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class MainAreaView extends ViewWithUiHandlers<MainAreaPresenter> implements MainAreaPresenter.MainAreaView {
|
||||
|
||||
private static Logger logger = java.util.logging.Logger.getLogger("");
|
||||
|
||||
interface Binder extends UiBinder<Widget, MainAreaView> {
|
||||
}
|
||||
|
||||
@UiField
|
||||
HTMLPanel filterPanel;
|
||||
|
||||
@UiField
|
||||
HTMLPanel reportPanel;
|
||||
|
||||
|
||||
private AppResources resources;
|
||||
|
||||
@Inject
|
||||
MainAreaView(Binder uiBinder, AppResources resources) {
|
||||
this.resources = resources;
|
||||
init();
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
bindSlot(MainAreaPresenter.SLOT_FILTER, filterPanel);
|
||||
bindSlot(MainAreaPresenter.SLOT_REPORT, reportPanel);
|
||||
|
||||
}
|
||||
|
||||
private void init() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
<!-- @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:c="urn:import:com.google.gwt.user.cellview.client"
|
||||
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui" xmlns:b2="urn:import:com.github.gwtbootstrap.datetimepicker.client.ui">
|
||||
|
||||
|
||||
<g:HTMLPanel ui:field="mainAreaPanel">
|
||||
<g:HTMLPanel ui:field="filterPanel" />
|
||||
<g:HTMLPanel ui:field="reportPanel" />
|
||||
</g:HTMLPanel>
|
||||
|
||||
</ui:UiBinder>
|
|
@ -0,0 +1,16 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.mainarea.filter;
|
||||
|
||||
|
||||
import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class FilterAreaModule extends AbstractPresenterModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bindPresenterWidget(FilterAreaPresenter.class, FilterAreaPresenter.FilterAreaView.class, FilterAreaView.class);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.mainarea.filter;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.controller.Controller;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class FilterAreaPresenter
|
||||
extends PresenterWidget<FilterAreaPresenter.FilterAreaView> implements FilterAreaUiHandlers {
|
||||
|
||||
private static Logger logger = Logger.getLogger("");
|
||||
|
||||
interface FilterAreaView extends View, HasUiHandlers<FilterAreaPresenter> {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private EventBus eventBus;
|
||||
private Controller controller;
|
||||
|
||||
@Inject
|
||||
FilterAreaPresenter(EventBus eventBus, FilterAreaView view,
|
||||
Controller controller) {
|
||||
super(eventBus, view);
|
||||
this.eventBus = eventBus;
|
||||
this.controller = controller;
|
||||
getView().setUiHandlers(this);
|
||||
addProviders();
|
||||
bindToEvent();
|
||||
}
|
||||
|
||||
private void addProviders() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void bindToEvent() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBind() {
|
||||
super.onBind();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.mainarea.filter;
|
||||
|
||||
import com.gwtplatform.mvp.client.UiHandlers;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public interface FilterAreaUiHandlers extends UiHandlers {
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,132 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.mainarea.filter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.mainarea.filter.scopetree.ScopeTreeModel;
|
||||
import org.gcube.portlets.user.accountingdashboard.client.resources.AppResources;
|
||||
import org.gcube.portlets.user.accountingdashboard.client.resources.ScopeTreeResources;
|
||||
import org.gcube.portlets.user.accountingdashboard.shared.data.ScopeData;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.ListBox;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.i18n.client.DateTimeFormat;
|
||||
import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
|
||||
import com.google.gwt.i18n.client.LocaleInfo;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.cellview.client.CellTree;
|
||||
import com.google.gwt.user.cellview.client.CellTree.Resources;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.google.gwt.view.client.ListDataProvider;
|
||||
import com.gwtplatform.mvp.client.ViewWithUiHandlers;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class FilterAreaView extends ViewWithUiHandlers<FilterAreaPresenter>
|
||||
implements FilterAreaPresenter.FilterAreaView {
|
||||
|
||||
private static Logger logger = java.util.logging.Logger.getLogger("");
|
||||
|
||||
interface Binder extends UiBinder<Widget, FilterAreaView> {
|
||||
}
|
||||
|
||||
@UiField
|
||||
HTMLPanel periodPanel;
|
||||
|
||||
@UiField
|
||||
HTMLPanel explorePanel;
|
||||
|
||||
@UiField(provided = true)
|
||||
ListBox yearStart;
|
||||
|
||||
@UiField(provided = true)
|
||||
ListBox monthStart;
|
||||
|
||||
@UiField(provided = true)
|
||||
ListBox yearEnd;
|
||||
|
||||
@UiField(provided = true)
|
||||
ListBox monthEnd;
|
||||
|
||||
@UiField(provided = true)
|
||||
CellTree scopeTree;
|
||||
|
||||
|
||||
private AppResources resources;
|
||||
|
||||
@Inject
|
||||
FilterAreaView(Binder uiBinder, AppResources resources) {
|
||||
this.resources = resources;
|
||||
init();
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
|
||||
}
|
||||
|
||||
private void init() {
|
||||
yearStart = new ListBox();
|
||||
yearStart.setMultipleSelect(false);
|
||||
|
||||
yearEnd = new ListBox();
|
||||
yearEnd.setMultipleSelect(false);
|
||||
|
||||
|
||||
Date now=new Date();
|
||||
String currentYear=DateTimeFormat.getFormat(PredefinedFormat.YEAR).format(now);
|
||||
logger.log(Level.FINE, "Current year: " + currentYear);
|
||||
int year=Integer.parseInt(currentYear);
|
||||
for(int i=2015; i<=year;i++){
|
||||
yearStart.addItem(String.valueOf(i));
|
||||
yearEnd.addItem(String.valueOf(i));
|
||||
}
|
||||
|
||||
|
||||
// returns a String array with localized names of the months
|
||||
String[] months = LocaleInfo.getCurrentLocale().getDateTimeFormatInfo().monthsFull();
|
||||
logger.log(Level.FINE, "Months: " + months.length);
|
||||
monthStart = new ListBox();
|
||||
monthStart.setMultipleSelect(false);
|
||||
|
||||
monthEnd = new ListBox();
|
||||
monthEnd.setMultipleSelect(false);
|
||||
|
||||
for (int i = 0; i < months.length; i++) {
|
||||
monthStart.addItem(months[i]);
|
||||
monthEnd.addItem(months[i]);
|
||||
}
|
||||
|
||||
ScopeData children1=new ScopeData("1","children1",null);
|
||||
ScopeData children3=new ScopeData("3","children3",null);
|
||||
ScopeData children4=new ScopeData("4","children4",null);
|
||||
|
||||
|
||||
|
||||
ArrayList<ScopeData> children2List=new ArrayList<>();
|
||||
children2List.add(children3);
|
||||
children2List.add(children4);
|
||||
ScopeData children2=new ScopeData("2","children2",children2List);
|
||||
|
||||
ArrayList<ScopeData> rootList=new ArrayList<>();
|
||||
rootList.add(children1);
|
||||
rootList.add(children2);
|
||||
ScopeData root=new ScopeData("0","root",rootList);
|
||||
|
||||
ArrayList<ScopeData> scopeDataList=new ArrayList<>();
|
||||
scopeDataList.add(root);
|
||||
|
||||
ListDataProvider<ScopeData> dataProvider = new ListDataProvider<ScopeData>(scopeDataList);
|
||||
ScopeTreeModel scopeTreeModel=new ScopeTreeModel(dataProvider);
|
||||
|
||||
ScopeTreeResources scopeTreeResources = GWT.create(ScopeTreeResources.class);
|
||||
scopeTree=new CellTree(scopeTreeModel, null,scopeTreeResources);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
<!-- @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:c="urn:import:com.google.gwt.user.cellview.client"
|
||||
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui" xmlns:b2="urn:import:com.github.gwtbootstrap.datetimepicker.client.ui">
|
||||
|
||||
|
||||
<ui:with field="res"
|
||||
type="org.gcube.portlets.user.accountingdashboard.client.resources.AppResources" />
|
||||
|
||||
|
||||
|
||||
<g:HTMLPanel styleName="{res.uiDataCss.uiDataFiltersPanel}">
|
||||
<b:FluidContainer>
|
||||
<b:FluidRow>
|
||||
<b:Heading size="5" styleName="{res.uiDataCss.uiDataFiltersTitle}">Filters</b:Heading>
|
||||
<g:HTMLPanel ui:field="periodPanel" styleName="{res.uiDataCss.uiDataFiltersPeriodPanel}">
|
||||
<b:Form type="HORIZONTAL" styleName="{res.uiDataCss.uiDataFiltersFormPanel}" >
|
||||
<b:Fieldset>
|
||||
<b:ControlGroup>
|
||||
<b:ControlLabel width="50px" for="fromPeriod">From:</b:ControlLabel>
|
||||
<b:Controls styleName="{res.uiDataCss.uiDataFiltersControls}">
|
||||
<b:ListBox ui:field="yearStart" width="100px" b:id="yearStart">
|
||||
</b:ListBox>
|
||||
<b:ListBox ui:field="monthStart" width="100px" b:id="monthStart">
|
||||
</b:ListBox>
|
||||
<b:HelpBlock>Select the start date</b:HelpBlock>
|
||||
</b:Controls>
|
||||
</b:ControlGroup>
|
||||
<b:ControlGroup>
|
||||
<b:ControlLabel width="50px" for="endPeriod">To:</b:ControlLabel>
|
||||
<b:Controls styleName="{res.uiDataCss.uiDataFiltersControls}">
|
||||
<b:ListBox ui:field="yearEnd" width="100px" b:id="yearEnd">
|
||||
</b:ListBox>
|
||||
<b:ListBox ui:field="monthEnd" width="100px" b:id="monthEnd">
|
||||
</b:ListBox>
|
||||
<b:HelpBlock>Select the end date</b:HelpBlock>
|
||||
</b:Controls>
|
||||
</b:ControlGroup>
|
||||
</b:Fieldset>
|
||||
</b:Form>
|
||||
</g:HTMLPanel>
|
||||
<g:HTMLPanel ui:field="explorePanel" styleName="{res.uiDataCss.uiDataFiltersExplorePanel}">
|
||||
<c:CellTree addStyleNames="{res.uiDataCss.uiDataExploreTree}"
|
||||
ui:field='scopeTree' />
|
||||
</g:HTMLPanel>
|
||||
</b:FluidRow>
|
||||
</b:FluidContainer>
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
|
@ -0,0 +1,97 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.mainarea.filter.scopetree;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.user.accountingdashboard.shared.data.ScopeData;
|
||||
|
||||
import com.google.gwt.cell.client.AbstractCell;
|
||||
import com.google.gwt.cell.client.Cell;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.google.gwt.view.client.ListDataProvider;
|
||||
import com.google.gwt.view.client.TreeViewModel;
|
||||
|
||||
public class ScopeTreeModel implements TreeViewModel {
|
||||
private ListDataProvider<ScopeData> dataProvider;
|
||||
|
||||
/**
|
||||
* This selection model is shared across all leaf nodes. A selection model
|
||||
* can also be shared across all nodes in the tree, or each set of child
|
||||
* nodes can have its own instance. This gives you flexibility to determine
|
||||
* how nodes are selected.
|
||||
*/
|
||||
//private final SingleSelectionModel<String> selectionModel = new SingleSelectionModel<String>();
|
||||
|
||||
public ScopeTreeModel(ListDataProvider<ScopeData> dataProvider) {
|
||||
this.dataProvider=dataProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the {@link NodeInfo} that provides the children of the specified
|
||||
* value.
|
||||
*/
|
||||
@Override
|
||||
public <T> NodeInfo<?> getNodeInfo(T value) {
|
||||
if (value == null) {
|
||||
// LEVEL 0.
|
||||
// We passed null as the root value. Return the composers.
|
||||
// Create a data provider that contains the list of composers.
|
||||
|
||||
// Create a cell to display a composer.
|
||||
Cell<ScopeData> cell = new AbstractCell<ScopeData>() {
|
||||
@Override
|
||||
public void render(Context context, ScopeData value, SafeHtmlBuilder sb) {
|
||||
if (value != null) {
|
||||
sb.appendEscaped(value.getName());
|
||||
}
|
||||
}
|
||||
};
|
||||
// Return a node info that pairs the data provider and the cell.
|
||||
return new DefaultNodeInfo<ScopeData>(dataProvider, cell);
|
||||
} else if (value instanceof ScopeData) {
|
||||
// LEVEL 1.
|
||||
// We want the children of the composer. Return the playlists.
|
||||
ListDataProvider<ScopeData> dataProvider = new ListDataProvider<ScopeData>(
|
||||
((ScopeData) value).getChildren());
|
||||
Cell<ScopeData> cell = new AbstractCell<ScopeData>() {
|
||||
|
||||
@Override
|
||||
public void render(Context context, ScopeData value, SafeHtmlBuilder sb) {
|
||||
if (value != null) {
|
||||
sb.appendEscaped(value.getName());
|
||||
}
|
||||
}
|
||||
};
|
||||
return new DefaultNodeInfo<ScopeData>(dataProvider, cell);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
else if (value instanceof ScopeData) {
|
||||
|
||||
// LEVEL 2 - LEAF.
|
||||
// We want the children of the playlist. Return the songs.
|
||||
ListDataProvider<String> dataProvider = new ListDataProvider<String>(((ScopeData) value).geSongs());
|
||||
// Use the shared selection model.
|
||||
return new DefaultNodeInfo<String>(dataProvider, new TextCell(), selectionModel, null);
|
||||
}*/
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the specified value represents a leaf node. Leaf nodes cannot be
|
||||
* opened.
|
||||
*/
|
||||
@Override
|
||||
public boolean isLeaf(Object value) {
|
||||
// The leaf nodes are the songs, which are Strings.
|
||||
if (value != null && value instanceof ScopeData) {
|
||||
ArrayList<ScopeData> childrens = ((ScopeData) value).getChildren();
|
||||
if (childrens == null || childrens.isEmpty()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.mainarea.report;
|
||||
|
||||
import com.gwtplatform.mvp.client.UiHandlers;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public interface ReaportAreaUiHandlers extends UiHandlers {
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.mainarea.report;
|
||||
|
||||
import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class ReportAreaModule extends AbstractPresenterModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
|
||||
bindPresenterWidget(ReportAreaPresenter.class, ReportAreaPresenter.ReportAreaView.class, ReportAreaView.class);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.mainarea.report;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.controller.Controller;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class ReportAreaPresenter extends PresenterWidget<ReportAreaPresenter.ReportAreaView>
|
||||
implements ReaportAreaUiHandlers {
|
||||
|
||||
private static Logger logger = Logger.getLogger("");
|
||||
|
||||
interface ReportAreaView extends View, HasUiHandlers<ReportAreaPresenter> {
|
||||
|
||||
}
|
||||
|
||||
private EventBus eventBus;
|
||||
private Controller controller;
|
||||
|
||||
@Inject
|
||||
ReportAreaPresenter(EventBus eventBus, ReportAreaView view, Controller controller) {
|
||||
super(eventBus, view);
|
||||
this.eventBus = eventBus;
|
||||
this.controller = controller;
|
||||
getView().setUiHandlers(this);
|
||||
addProviders();
|
||||
bindToEvent();
|
||||
}
|
||||
|
||||
private void addProviders() {
|
||||
|
||||
}
|
||||
|
||||
private void bindToEvent() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBind() {
|
||||
super.onBind();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.mainarea.report;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.gcube.portlets.user.accountingdashboard.client.resources.AppResources;
|
||||
|
||||
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 ReportAreaView extends ViewWithUiHandlers<ReportAreaPresenter> implements ReportAreaPresenter.ReportAreaView {
|
||||
|
||||
private static Logger logger = java.util.logging.Logger.getLogger("");
|
||||
|
||||
interface Binder extends UiBinder<Widget, ReportAreaView> {
|
||||
}
|
||||
|
||||
/*@UiField
|
||||
HTMLPanel periodPanel;
|
||||
*/
|
||||
|
||||
|
||||
|
||||
private AppResources resources;
|
||||
|
||||
@Inject
|
||||
ReportAreaView(Binder uiBinder, AppResources resources) {
|
||||
this.resources = resources;
|
||||
init();
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
|
||||
}
|
||||
|
||||
private void init() {
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -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:c="urn:import:com.google.gwt.user.cellview.client"
|
||||
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui" xmlns:b2="urn:import:com.github.gwtbootstrap.datetimepicker.client.ui">
|
||||
|
||||
|
||||
<ui:with field="res"
|
||||
type="org.gcube.portlets.user.accountingdashboard.client.resources.AppResources" />
|
||||
|
||||
|
||||
|
||||
<g:HTMLPanel>
|
||||
<g:Label>Report Area</g:Label>
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
|
@ -0,0 +1,16 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.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);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.menu;
|
||||
|
||||
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> {
|
||||
|
||||
}
|
||||
|
||||
@Inject
|
||||
MenuPresenter(EventBus eventBus, PresenterView view) {
|
||||
super(eventBus, view);
|
||||
getView().setUiHandlers(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBind() {
|
||||
super.onBind();
|
||||
addRegisteredHandler(NavigationEvent.getType(), this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onNavigation(NavigationEvent navigationEvent) {
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.menu;
|
||||
|
||||
|
||||
import com.gwtplatform.mvp.client.UiHandlers;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
interface MenuUiHandlers extends UiHandlers {
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.menu;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Nav;
|
||||
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;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
class MenuView extends ViewWithUiHandlers<MenuUiHandlers> implements MenuPresenter.PresenterView {
|
||||
|
||||
interface Binder extends UiBinder<Widget, MenuView> {
|
||||
}
|
||||
|
||||
@UiField
|
||||
Nav nav;
|
||||
|
||||
@Inject
|
||||
MenuView(Binder uiBinder) {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
<!-- @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:b="urn:import:com.github.gwtbootstrap.client.ui">
|
||||
|
||||
<ui:with field="res"
|
||||
type="org.gcube.portlets.user.accountingdashboard.client.resources.AppResources" />
|
||||
|
||||
<ui:with field="tokens"
|
||||
type="org.gcube.portlets.user.accountingdashboard.client.place.NameTokens" />
|
||||
|
||||
<g:HTMLPanel>
|
||||
<b:Navbar>
|
||||
<b:Brand>Accounting Dashboard</b:Brand>
|
||||
|
||||
<b:Nav ui:field="nav">
|
||||
<!-- <b:NavLink text="Batch" targetHistoryToken="{tokens.getBatchCollect}">Batch</b:NavLink> -->
|
||||
<!-- <b:NavLink text="Help" targetHistoryToken="{tokens.getHelp}">Help</b:NavLink> -->
|
||||
<b:NavLink href="http://wiki.gcube-system.org/gcube/AccountingDashboard" target="_blank">Help</b:NavLink>
|
||||
</b:Nav>
|
||||
</b:Navbar>
|
||||
</g:HTMLPanel>
|
||||
|
||||
</ui:UiBinder>
|
|
@ -0,0 +1,16 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.providers;
|
||||
|
||||
import com.google.gwt.inject.client.AbstractGinModule;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class DataProviderModule extends AbstractGinModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,183 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.providers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.controller.Controller;
|
||||
import org.gcube.portlets.user.accountingdashboard.shared.data.ScopeData;
|
||||
|
||||
import com.google.gwt.view.client.AsyncDataProvider;
|
||||
import com.google.gwt.view.client.HasData;
|
||||
import com.google.gwt.view.client.Range;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class DeadFishBySpecificDiseasesProvider extends AsyncDataProvider<ScopeData> {
|
||||
private static Logger logger = java.util.logging.Logger.getLogger("");
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private Controller controller;
|
||||
private int start;
|
||||
private int length;
|
||||
private int columnSortIndex;
|
||||
private boolean ascending = false;
|
||||
private String id;
|
||||
private ArrayList<ScopeData> list;
|
||||
|
||||
@Inject
|
||||
public DeadFishBySpecificDiseasesProvider(String id, Controller controller) {
|
||||
this.id = id;
|
||||
this.controller = controller;
|
||||
list = new ArrayList<>();
|
||||
bindEvents();
|
||||
}
|
||||
|
||||
private void bindEvents() {
|
||||
/*
|
||||
* EventBus eventBus = controller.getEventBus();
|
||||
* eventBus.addHandler(DatasetsEvent.TYPE, new
|
||||
* DatasetsEvent.DatasetsEventHandler() {
|
||||
*
|
||||
* @Override public void onDatasets(DatasetsEvent event) {
|
||||
* update(event.getList());
|
||||
*
|
||||
* } });
|
||||
*/
|
||||
}
|
||||
|
||||
private void update(ArrayList<ScopeData> list) {
|
||||
|
||||
logger.log(Level.FINE, "Disease Data Display is empty: " + getDataDisplays().isEmpty());
|
||||
|
||||
logger.log(Level.FINE, "Show=[Start=" + start + ", Length=" + length + "]");
|
||||
|
||||
int limits = start + length;
|
||||
if (limits > list.size()) {
|
||||
limits = list.size();
|
||||
if (limits < start) {
|
||||
start = limits;
|
||||
}
|
||||
}
|
||||
|
||||
List<ScopeData> dataInRange = new ArrayList<>();
|
||||
if (list != null && list.size() > 1) {
|
||||
if (columnSortIndex > -1) {
|
||||
logger.log(Level.FINE, "ColumnSortIndex: " + columnSortIndex);
|
||||
logger.log(Level.FINE, "Ascending: " + ascending);
|
||||
Comparator<ScopeData> comparator;
|
||||
switch (columnSortIndex) {
|
||||
case 0:
|
||||
comparator = new Comparator<ScopeData>() {
|
||||
public int compare(ScopeData d1, ScopeData d2) {
|
||||
if (d1 == d2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int diff = -1;
|
||||
if (d1 == null) {
|
||||
diff = -1;
|
||||
} else {
|
||||
if (d2 == null) {
|
||||
diff = 1;
|
||||
} else {
|
||||
|
||||
if (d1 != null) {
|
||||
if (d1.getName() != null) {
|
||||
diff = ((d2 != null) && (d2.getName() != null))
|
||||
? d1.getName().compareTo(d2.getName()) : 1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return ascending ? -diff : diff;
|
||||
}
|
||||
};
|
||||
break;
|
||||
default:
|
||||
comparator = new Comparator<ScopeData>() {
|
||||
public int compare(ScopeData d1, ScopeData d2) {
|
||||
if (d1 == d2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int diff = -1;
|
||||
if (d1 == null) {
|
||||
diff = -1;
|
||||
} else {
|
||||
if (d2 == null) {
|
||||
diff = 1;
|
||||
} else {
|
||||
|
||||
if (d1 != null) {
|
||||
if (d1.getName() != null) {
|
||||
diff = ((d2 != null) && (d2.getName() != null))
|
||||
? d1.getName().compareTo(d2.getName()) : 1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return ascending ? -diff : diff;
|
||||
}
|
||||
};
|
||||
break;
|
||||
}
|
||||
|
||||
Collections.sort(list, comparator);
|
||||
|
||||
}
|
||||
|
||||
dataInRange = list.subList(start, limits);
|
||||
} else {
|
||||
dataInRange = list;
|
||||
}
|
||||
this.updateRowCount(list.size(), true);
|
||||
this.updateRowData(start, dataInRange);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onRangeChanged(HasData<ScopeData> display) {
|
||||
Range range = display.getVisibleRange();
|
||||
start = range.getStart();
|
||||
length = range.getLength();
|
||||
logger.log(Level.FINE, "Diseases Provider Range Change: [start=" + start + ", length=" + length + "]");
|
||||
retrieveData();
|
||||
}
|
||||
|
||||
public void onSortChanged(int start, int length, int columnSortIndex, boolean ascending) {
|
||||
logger.log(Level.FINE, "Disease Provider Sort: [start=" + start + ", length=" + length + "]");
|
||||
this.start = start;
|
||||
this.length = length;
|
||||
this.columnSortIndex = columnSortIndex;
|
||||
this.ascending = ascending;
|
||||
retrieveData();
|
||||
}
|
||||
|
||||
public void onRefreshDiseases() {
|
||||
logger.log(Level.FINE, "Disease Provider Refresh");
|
||||
retrieveData();
|
||||
}
|
||||
|
||||
private void retrieveData() {
|
||||
logger.log(Level.FINE, "Disease Provider: " + id);
|
||||
update(list);
|
||||
// controller.getDatasets(productId);
|
||||
|
||||
}
|
||||
|
||||
public void addNewDisease() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,181 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.providers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.controller.Controller;
|
||||
import org.gcube.portlets.user.accountingdashboard.shared.data.TreatmentData;
|
||||
|
||||
import com.google.gwt.view.client.AsyncDataProvider;
|
||||
import com.google.gwt.view.client.HasData;
|
||||
import com.google.gwt.view.client.Range;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class TreatmentsProvider extends AsyncDataProvider<TreatmentData> {
|
||||
private static Logger logger = java.util.logging.Logger.getLogger("");
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private Controller controller;
|
||||
private int start;
|
||||
private int length;
|
||||
private int columnSortIndex;
|
||||
private boolean ascending = false;
|
||||
private String id;
|
||||
private ArrayList<TreatmentData> list;
|
||||
|
||||
@Inject
|
||||
public TreatmentsProvider(String id, Controller controller) {
|
||||
this.id = id;
|
||||
this.controller = controller;
|
||||
list = new ArrayList<>();
|
||||
bindEvents();
|
||||
}
|
||||
|
||||
private void bindEvents() {
|
||||
/*
|
||||
* EventBus eventBus = controller.getEventBus();
|
||||
* eventBus.addHandler(DatasetsEvent.TYPE, new
|
||||
* DatasetsEvent.DatasetsEventHandler() {
|
||||
*
|
||||
* @Override public void onDatasets(DatasetsEvent event) {
|
||||
* update(event.getList());
|
||||
*
|
||||
* } });
|
||||
*/
|
||||
}
|
||||
|
||||
private void update(ArrayList<TreatmentData> list) {
|
||||
|
||||
logger.log(Level.FINE, "Treatments Data Display is empty: " + getDataDisplays().isEmpty());
|
||||
|
||||
logger.log(Level.FINE, "Show=[Start=" + start + ", Length=" + length + "]");
|
||||
|
||||
int limits = start + length;
|
||||
if (limits > list.size()) {
|
||||
limits = list.size();
|
||||
if (limits < start) {
|
||||
start = limits;
|
||||
}
|
||||
}
|
||||
|
||||
List<TreatmentData> dataInRange = new ArrayList<>();
|
||||
if (list != null && list.size() > 1) {
|
||||
if (columnSortIndex > -1) {
|
||||
logger.log(Level.FINE, "ColumnSortIndex: " + columnSortIndex);
|
||||
logger.log(Level.FINE, "Ascending: " + ascending);
|
||||
Comparator<TreatmentData> comparator;
|
||||
switch (columnSortIndex) {
|
||||
case 0:
|
||||
comparator = new Comparator<TreatmentData>() {
|
||||
public int compare(TreatmentData d1, TreatmentData d2) {
|
||||
if (d1 == d2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int diff = -1;
|
||||
if (d1 != null) {
|
||||
if (d1.getTreatmentType() != null) {
|
||||
diff = ((d2 != null) && (d2.getTreatmentType() != null))
|
||||
? d1.getTreatmentType().compareTo(d2.getTreatmentType()) : 1;
|
||||
}
|
||||
}
|
||||
return ascending ? -diff : diff;
|
||||
}
|
||||
};
|
||||
break;
|
||||
case 1:
|
||||
comparator = new Comparator<TreatmentData>() {
|
||||
public int compare(TreatmentData d1, TreatmentData d2) {
|
||||
if (d1 == d2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int diff = -1;
|
||||
if (d1 != null) {
|
||||
if (d1.getNumberOfTreatments() != null) {
|
||||
diff = ((d2 != null) && (d2.getNumberOfTreatments() != null))
|
||||
? d1.getNumberOfTreatments().compareTo(d2.getNumberOfTreatments()) : 1;
|
||||
}
|
||||
}
|
||||
return ascending ? -diff : diff;
|
||||
}
|
||||
};
|
||||
break;
|
||||
default:
|
||||
comparator = new Comparator<TreatmentData>() {
|
||||
public int compare(TreatmentData d1, TreatmentData d2) {
|
||||
if (d1 == d2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int diff = -1;
|
||||
if (d1 != null) {
|
||||
if (d1.getTreatmentType() != null) {
|
||||
diff = ((d2 != null) && (d2.getTreatmentType() != null))
|
||||
? d1.getTreatmentType().compareTo(d2.getTreatmentType()) : 1;
|
||||
}
|
||||
}
|
||||
return ascending ? -diff : diff;
|
||||
}
|
||||
};
|
||||
break;
|
||||
}
|
||||
|
||||
Collections.sort(list, comparator);
|
||||
|
||||
}
|
||||
|
||||
dataInRange = list.subList(start, limits);
|
||||
} else {
|
||||
dataInRange = list;
|
||||
}
|
||||
this.updateRowCount(list.size(), true);
|
||||
this.updateRowData(start, dataInRange);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onRangeChanged(HasData<TreatmentData> display) {
|
||||
Range range = display.getVisibleRange();
|
||||
start = range.getStart();
|
||||
length = range.getLength();
|
||||
logger.log(Level.FINE, "Treatmentss Provider Range Change: [start=" + start + ", length=" + length + "]");
|
||||
retrieveData();
|
||||
}
|
||||
|
||||
public void onSortChanged(int start, int length, int columnSortIndex, boolean ascending) {
|
||||
logger.log(Level.FINE, "Treatments Provider Sort: [start=" + start + ", length=" + length + "]");
|
||||
this.start = start;
|
||||
this.length = length;
|
||||
this.columnSortIndex = columnSortIndex;
|
||||
this.ascending = ascending;
|
||||
retrieveData();
|
||||
}
|
||||
|
||||
public void onRefreshTreatments() {
|
||||
logger.log(Level.FINE, "Treatments Provider Refresh");
|
||||
retrieveData();
|
||||
}
|
||||
|
||||
private void retrieveData() {
|
||||
logger.log(Level.FINE, "Treatments Provider: " + id);
|
||||
update(list);
|
||||
// controller.getDatasets(productId);
|
||||
|
||||
}
|
||||
|
||||
public void addNewTreatment() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.utils;
|
||||
|
||||
import com.google.gwt.cell.client.AbstractCell;
|
||||
import com.google.gwt.safehtml.shared.SafeHtml;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class CheckCellHead extends AbstractCell<Boolean> {
|
||||
|
||||
private Boolean isSelected = false;
|
||||
private static final SafeHtml INPUT_CHECKED = SafeHtmlUtils.fromSafeConstant("<input type=\"checkbox\" tabindex=\"-1\" checked/>");
|
||||
private static final SafeHtml INPUT_UNCHECKED = SafeHtmlUtils.fromSafeConstant("<input type=\"checkbox\" tabindex=\"-1\"/>");
|
||||
|
||||
public CheckCellHead() {
|
||||
super("click");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Context context, Boolean value, SafeHtmlBuilder sb) {
|
||||
if (isSelected) {
|
||||
sb.append(INPUT_CHECKED);
|
||||
} else {
|
||||
sb.append(INPUT_UNCHECKED);
|
||||
}
|
||||
}
|
||||
|
||||
public Boolean isIsSelected() {
|
||||
return isSelected;
|
||||
}
|
||||
|
||||
public void setIsSelected(Boolean isSelected) {
|
||||
this.isSelected = isSelected;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.application.utils;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.gcube.portlets.user.accountingdashboard.shared.exception.ServiceException;
|
||||
|
||||
import com.google.gwt.i18n.client.DateTimeFormat;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class DateTimeUtils {
|
||||
private static Logger logger = java.util.logging.Logger.getLogger("");
|
||||
|
||||
public static String toString(Date c) {
|
||||
DateTimeFormat format = DateTimeFormat.getFormat("yyyy-MM-dd'T'HH:mm:ss");
|
||||
if (c == null) {
|
||||
logger.log(Level.FINE,"DateTimeUtils: ");
|
||||
return "";
|
||||
} else {
|
||||
String s = format.format(c);
|
||||
logger.log(Level.FINE,"DateTimeUtils: " + s);
|
||||
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
public static Date toDate(String s) throws ServiceException {
|
||||
|
||||
DateTimeFormat format = DateTimeFormat.getFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
|
||||
try {
|
||||
Date d = format.parse(s);
|
||||
return d;
|
||||
} catch (IllegalArgumentException e) {
|
||||
logger.log(Level.FINE,"Invalid Time Format: " + s);
|
||||
throw new ServiceException("Invalid Time Format: " + s);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.gin;
|
||||
|
||||
import org.gcube.portlets.user.accountingdashboard.client.application.ApplicationModule;
|
||||
import org.gcube.portlets.user.accountingdashboard.client.place.NameTokens;
|
||||
import org.gcube.portlets.user.accountingdashboard.client.resources.ResourceLoader;
|
||||
import org.gcube.portlets.user.accountingdashboard.client.rpc.AccountingDashboardServiceAsync;
|
||||
|
||||
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;
|
||||
import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
|
||||
import com.gwtplatform.mvp.client.gin.DefaultModule;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class AccountingDashBoardClientModule extends AbstractPresenterModule {
|
||||
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(ResourceLoader.class).asEagerSingleton();
|
||||
bind(AccountingDashboardServiceAsync.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.MAIN_AREA);
|
||||
bindConstant().annotatedWith(ErrorPlace.class).to(NameTokens.MAIN_AREA);
|
||||
bindConstant().annotatedWith(UnauthorizedPlace.class).to(NameTokens.MAIN_AREA);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.gin;
|
||||
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
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 Logger logger = java.util.logging.Logger.getLogger("");
|
||||
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) {
|
||||
logger.log(Level.FINE,"Add Panel in Div " + SM_DIV);
|
||||
root.add(widget);
|
||||
} else {
|
||||
logger.log(Level.FINE,"Add Panel in Root");
|
||||
RootPanel.get().add(widget);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Inject
|
||||
CustomRootPresenter(EventBus eventBus, CustomRootView myRootView) {
|
||||
super( eventBus, myRootView );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.place;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class NameTokens {
|
||||
public static final String MAIN_AREA = "mainarea";
|
||||
|
||||
public static final String SAVE = "save";
|
||||
public static final String HELP = "help";
|
||||
|
||||
public static String getMainArea() {
|
||||
return MAIN_AREA;
|
||||
}
|
||||
|
||||
public static String getSave() {
|
||||
return SAVE;
|
||||
}
|
||||
|
||||
public static String getHelp() {
|
||||
return HELP;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.place;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class TokenParameters {
|
||||
public static final String ID = "id";
|
||||
|
||||
public static String getId() {
|
||||
return ID;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.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 uiDataCss extends CssResource {
|
||||
String uiDataBody();
|
||||
String uiDataLabel();
|
||||
String uiDataLabelKeyTag();
|
||||
String uiDataLabelGeoAreaTag();
|
||||
String uiDataParagraphCentered();
|
||||
String uiDataActionParagraph();
|
||||
String uiDataAccordionGroup();
|
||||
String uiDataFiltersPanel();
|
||||
String uiDataFiltersPeriodPanel();
|
||||
String uiDataFiltersExplorePanel();
|
||||
String uiDataFiltersTitle();
|
||||
String uiDataFiltersFormPanel();
|
||||
String uiDataFiltersControls();
|
||||
String uiDataExploreTree();
|
||||
|
||||
|
||||
String uiDataButtonRefresh();
|
||||
String uiDataIconRefresh();
|
||||
String uiDataMainDataPanel();
|
||||
String uiDataRow();
|
||||
String uiDataTable();
|
||||
String uiDataTableStriped();
|
||||
String uiDataPager();
|
||||
String uiDataDataTable();
|
||||
String uiDataDataFirstTr();
|
||||
String uiDataDataFirstTdHead();
|
||||
String uiDataDataFirstTd();
|
||||
String uiDataDataTr();
|
||||
String uiDataDataTdHead();
|
||||
String uiDataDataTd();
|
||||
String uiDataDataUl();
|
||||
String uiDataDataLi();
|
||||
String uiDataSmallDataTable();
|
||||
String uiDataSmallDataTh();
|
||||
String uiDataSmallDataTd();
|
||||
String uiDataNoMarginTable();
|
||||
String uiDataMarginBottomFixedTable();
|
||||
String uiDataTh();
|
||||
String uiDataColumnCentered();
|
||||
String uiDataMonitorPopup();
|
||||
String uiDataMonitorPopupGlass();
|
||||
String uiDataMonitorPopupProgress();
|
||||
String uiDataPopup();
|
||||
String uiDataPopupGlass();
|
||||
String uiDataFormTable();
|
||||
String uiDataFormPager();
|
||||
}
|
||||
|
||||
@Source("uiData.css")
|
||||
uiDataCss uiDataCss();
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.resources;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class ResourceLoader {
|
||||
|
||||
@Inject
|
||||
ResourceLoader(AppResources appResources) {
|
||||
appResources.uiDataCss().ensureInjected();
|
||||
//scopeTreeResources.cellTreeStyle().ensureInjected();
|
||||
|
||||
/*appResources.bootstrapCss().ensureInjected();
|
||||
appResources.style().ensureInjected();
|
||||
appResources.pageTable().ensureInjected();*/
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.resources;
|
||||
|
||||
import com.google.gwt.user.cellview.client.CellTree.Resources;
|
||||
import com.google.gwt.user.cellview.client.CellTree.Style;
|
||||
|
||||
public interface ScopeTreeResources extends Resources {
|
||||
|
||||
interface ScopeTreeStyle extends Style {
|
||||
/**
|
||||
* The path to the default CSS styles used by this resource.
|
||||
*/
|
||||
String DEFAULT_CSS = "uiScopeTree.css";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The styles used in this widget.
|
||||
*/
|
||||
@Source(ScopeTreeStyle.DEFAULT_CSS)
|
||||
ScopeTreeStyle cellTreeStyle();
|
||||
}
|
|
@ -0,0 +1,292 @@
|
|||
/* Style */
|
||||
.uiDataBody {
|
||||
padding-top: 0px;
|
||||
}
|
||||
|
||||
.uiDataLabel {
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.uiDataLabelKeyTag {
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
background-color: #00ace2;
|
||||
border-radius: 8px;
|
||||
padding: 3px;
|
||||
margin: 2px;
|
||||
width: auto;
|
||||
display: inline-block;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.uiDataLabelGeoAreaTag {
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
background-color: #009688;
|
||||
border-radius: 8px;
|
||||
padding: 3px;
|
||||
margin: 2px;
|
||||
width: auto;
|
||||
display: inline-block;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.uiDataParagraphCentered {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.uiDataActionParagraph {
|
||||
padding: 19px 20px 20px;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
background-color: #f5f5f5;
|
||||
border-top: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
.uiDataAccordionGroup {
|
||||
margin-bottom: 2px;
|
||||
padding-left: 10px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: rgb(229, 229, 229);
|
||||
border-image: initial;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.uiDataFiltersPanel {
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.uiDataFiltersPeriodPanel {
|
||||
border-color: #eeeeee !important;
|
||||
border-style: solid !important;
|
||||
border-width: 1px !important;
|
||||
padding: 3px !important;
|
||||
}
|
||||
|
||||
.uiDataFiltersExplorePanel {
|
||||
border-color: #eeeeee !important;
|
||||
border-style: solid !important;
|
||||
border-width: 1px !important;
|
||||
padding: 3px !important;
|
||||
}
|
||||
|
||||
.uiDataFiltersTitle {
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
color: #333;
|
||||
padding: 0px;
|
||||
margin: 1px;
|
||||
}
|
||||
|
||||
.uiDataFiltersFormPanel {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.uiDataFiltersControls {
|
||||
margin-left: 60px;
|
||||
}
|
||||
|
||||
.uiDataExploreTree {
|
||||
/*float: left;
|
||||
margin-right: 10px;*/
|
||||
}
|
||||
|
||||
|
||||
.uiDataMainDataPanel {
|
||||
float: left;
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
.uiDataButtonRefresh {
|
||||
width: 10px !important;
|
||||
height: 10px !important;
|
||||
padding: 5px !important;
|
||||
margin: 0px !important;
|
||||
margin-top: 6px !important;
|
||||
line-height: 10px !important;
|
||||
float: left !important;
|
||||
}
|
||||
|
||||
.uiDataIconRefresh {
|
||||
font-size: 12px !important;
|
||||
}
|
||||
|
||||
.uiDataTable {
|
||||
width: 100%;
|
||||
background-color: white;
|
||||
margin-bottom: 10px
|
||||
}
|
||||
|
||||
.uiDataRow {
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
.uiDataTableStriped {
|
||||
width: 100%;
|
||||
background-color: white;
|
||||
margin-bottom: 10px
|
||||
}
|
||||
|
||||
.uiDataTableStriped tr:nth-child\(even\) {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.uiDataTableStriped th {
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
.uiDataPager {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-top: 6px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.uiDataFormTable {
|
||||
width: 320px;
|
||||
background-color: white;
|
||||
border: 1px solid #ccc;
|
||||
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
|
||||
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
|
||||
-webkit-transition: border linear .2s, box-shadow linear .2s;
|
||||
-moz-transition: border linear .2s, box-shadow linear .2s;
|
||||
-o-transition: border linear .2s, box-shadow linear .2s;
|
||||
transition: border linear .2s, box-shadow linear .2s;
|
||||
}
|
||||
|
||||
.uiDataFormTable tr:nth-child\(even\) {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.uiDataFormTable th {
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
background-color: #f0f0f0;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.uiDataFormTable td {
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
.uiDataFormPager {
|
||||
margin-top: 6px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.uiDataDataTable {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
border: 1px ridge;
|
||||
}
|
||||
|
||||
.uiDataDataFirstTr {
|
||||
background-color: #b3e5fc;
|
||||
}
|
||||
|
||||
.uiDataDataFirstTdHead {
|
||||
text-align: left;
|
||||
font-weight: normal;
|
||||
/*font-weight: bold;*/
|
||||
background-color: #b3e5fc;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.uiDataDataFirstTd {
|
||||
background-color: #b3e5fc;
|
||||
}
|
||||
|
||||
.uiDataDataTr {
|
||||
/*background-color: white;*/
|
||||
|
||||
}
|
||||
|
||||
.uiDataDataTdHead {
|
||||
text-align: left;
|
||||
font-weight: normal;
|
||||
/*font-weight: bold;*/ /* background-color: white; */
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.uiDataDataTd {
|
||||
/*background-color: white; */
|
||||
|
||||
}
|
||||
|
||||
.uiDataSmallDataTable, .uiDataSmallDataTh, .uiDataSmallDataTd {
|
||||
border-width: 1px;
|
||||
border-style: groove;
|
||||
/*border-color: #FFEB3B;*/
|
||||
border-collapse: collapse;
|
||||
/*background-color: #FFEB3B;*/
|
||||
}
|
||||
|
||||
.uiDataDataUl {
|
||||
|
||||
}
|
||||
|
||||
.uiDataDataLi {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.uiDataNoMarginTable {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.uiDataMarginBottomFixedTable {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.uiDataTh {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
.uiDataColumnCentered {
|
||||
margin: auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.uiDataColumnCentered button {
|
||||
margin: auto !important;
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
/* Monitor Dialog */
|
||||
.uiDataMonitorPopup {
|
||||
background-color: white;
|
||||
border: 1px double black;
|
||||
padding: 0 15px;
|
||||
z-index: 1070;
|
||||
}
|
||||
|
||||
.uiDataMonitorPopupGlass {
|
||||
background-color: #333333;
|
||||
opacity: 0.5;
|
||||
clip: rect(auto, auto, auto, auto);
|
||||
z-index: 1050;
|
||||
}
|
||||
|
||||
.uiDataMonitorPopupProgress {
|
||||
margin: 5px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
/* Dialog */
|
||||
.uiDataPopup {
|
||||
background-color: white;
|
||||
border: 1px double black;
|
||||
padding: 0 15px;
|
||||
z-index: 1070;
|
||||
}
|
||||
|
||||
.uiDataPopupGlass {
|
||||
background-color: #333333;
|
||||
opacity: 0.5;
|
||||
clip: rect(auto, auto, auto, auto);
|
||||
z-index: 1050;
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
.cellTreeWidget {
|
||||
|
||||
}
|
||||
|
||||
.cellTreeEmptyMessage {
|
||||
padding-left: 16px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.cellTreeItem {
|
||||
padding-top: 4px;
|
||||
padding-bottom: 4px;
|
||||
cursor: hand;
|
||||
cursor: pointer;
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
.cellTreeItemImage {
|
||||
|
||||
}
|
||||
|
||||
.cellTreeItemImageValue {
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
.cellTreeItemValue {
|
||||
padding-left: 3px;
|
||||
padding-right: 3px;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.cellTreeOpenItem {
|
||||
|
||||
}
|
||||
|
||||
.cellTreeTopItem {
|
||||
/*font-weight: bold;*/
|
||||
color: #4b4a4a;
|
||||
margin-top: 20px;
|
||||
padding: 3px 13px 3px 10px !important;
|
||||
}
|
||||
|
||||
.cellTreeTopItemImage {
|
||||
|
||||
}
|
||||
|
||||
.cellTreeTopItemImageValue {
|
||||
/*border-bottom: 1px solid #6f7277;
|
||||
padding-bottom: 1px;*/
|
||||
}
|
||||
|
||||
.cellTreeKeyboardSelectedItem {
|
||||
background-color: #ffc;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
@sprite .cellTreeSelectedItem {
|
||||
gwt-image: 'cellTreeSelectedBackground';
|
||||
background-color: #628cd5;
|
||||
color: white;
|
||||
height: auto;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.cellTreeShowMoreButton {
|
||||
padding-left: 16px;
|
||||
outline: none;
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.client.rpc;
|
||||
|
||||
import org.gcube.portlets.user.accountingdashboard.shared.exception.ServiceException;
|
||||
import org.gcube.portlets.user.accountingdashboard.shared.session.UserInfo;
|
||||
|
||||
import com.google.gwt.user.client.rpc.RemoteService;
|
||||
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
@RemoteServiceRelativePath("accountingdashboardservice")
|
||||
public interface AccountingDashboardService extends RemoteService {
|
||||
/**
|
||||
* Get informations on the current user
|
||||
*
|
||||
* @return UserInfo user inforamations
|
||||
* @throws ServiceException
|
||||
* exception
|
||||
*/
|
||||
public UserInfo hello() throws ServiceException;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.accountingdashboard.client.rpc;
|
||||
|
||||
import org.gcube.portlets.user.accountingdashboard.shared.session.UserInfo;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public interface AccountingDashboardServiceAsync {
|
||||
|
||||
public static AccountingDashboardServiceAsync INSTANCE = (AccountingDashboardServiceAsync) GWT
|
||||
.create(AccountingDashboardService.class);
|
||||
|
||||
void hello(AsyncCallback<UserInfo> callback);
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.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;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class AccountingDashboardPortlet extends GenericPortlet {
|
||||
|
||||
private final Logger logger= LoggerFactory.getLogger(GenericPortlet.class);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static final String VIEW_JSP = "/WEB-INF/jsp/AccountingDashboardPortlet_view.jsp";
|
||||
|
||||
/**
|
||||
* @param request .
|
||||
* @param response .
|
||||
* @throws IOException .
|
||||
* @throws PortletException .
|
||||
*/
|
||||
public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException {
|
||||
|
||||
logger.trace("AccountingDashboard 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);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.server;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
|
||||
import org.gcube.portlets.user.accountingdashboard.client.rpc.AccountingDashboardService;
|
||||
import org.gcube.portlets.user.accountingdashboard.server.util.ServiceCredentials;
|
||||
import org.gcube.portlets.user.accountingdashboard.shared.exception.ServiceException;
|
||||
import org.gcube.portlets.user.accountingdashboard.shared.session.UserInfo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class AccountingDashboardServiceImpl extends RemoteServiceServlet implements AccountingDashboardService {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(AccountingDashboardServiceImpl.class);
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void init() throws ServletException {
|
||||
super.init();
|
||||
logger.info("AccountingDashbord Service started!");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* {@inheritDoc}
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public UserInfo hello() throws ServiceException {
|
||||
try {
|
||||
logger.debug("AccountingDashboardServiceImpl hello()");
|
||||
ServiceCredentials serviceCredentials = SessionUtil.getServiceCredentials(this.getThreadLocalRequest());
|
||||
UserInfo userInfo = new UserInfo(serviceCredentials.getUserName(), serviceCredentials.getGroupId(),
|
||||
serviceCredentials.getGroupName(), serviceCredentials.getScope(), serviceCredentials.getEmail(),
|
||||
serviceCredentials.getFullName());
|
||||
logger.debug("UserInfo: " + userInfo);
|
||||
return userInfo;
|
||||
} catch (ServiceException e) {
|
||||
logger.error(e.getLocalizedMessage(), e);
|
||||
throw e;
|
||||
} catch (Throwable e) {
|
||||
logger.error("Hello(): " + e.getLocalizedMessage(), e);
|
||||
throw new ServiceException(e.getLocalizedMessage(), e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,187 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.accountingdashboard.server;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
|
||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||
import org.gcube.common.portal.PortalContext;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.portlets.user.accountingdashboard.server.util.ServiceCredentials;
|
||||
import org.gcube.portlets.user.accountingdashboard.shared.Constants;
|
||||
import org.gcube.portlets.user.accountingdashboard.shared.exception.ServiceException;
|
||||
import org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager;
|
||||
import org.gcube.vomanagement.usermanagement.model.GCubeGroup;
|
||||
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SessionUtil {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SessionUtil.class);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param httpServletRequest
|
||||
* http servlet request
|
||||
* @return service credentials
|
||||
* @throws ServiceException
|
||||
* exception
|
||||
*/
|
||||
public static ServiceCredentials getServiceCredentials(HttpServletRequest httpServletRequest)
|
||||
throws ServiceException {
|
||||
return getServiceCredentials(httpServletRequest, null);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param httpServletRequest
|
||||
* http servlet request
|
||||
* @param scopeGroupId
|
||||
* scope group id
|
||||
* @return service credentials
|
||||
* @throws ServiceException
|
||||
* exception
|
||||
*/
|
||||
public static ServiceCredentials getServiceCredentials(HttpServletRequest httpServletRequest, String scopeGroupId)
|
||||
throws ServiceException {
|
||||
|
||||
ServiceCredentials sCredentials = null;
|
||||
String userName = null;
|
||||
String scope = null;
|
||||
String token = null;
|
||||
String groupId = null;
|
||||
String groupName = null;
|
||||
|
||||
if (Constants.DEBUG_MODE) {
|
||||
logger.debug("No credential found in session, use test user!");
|
||||
/*
|
||||
* InfoLocale infoLocale = getInfoLocale(httpServletRequest, null);
|
||||
* Locale locale = new Locale(infoLocale.getLanguage());
|
||||
*
|
||||
* ResourceBundle messages = ResourceBundle.getBundle(
|
||||
* StatAlgoImporterServiceMessagesConstants.TDGWTServiceMessages,
|
||||
* locale);
|
||||
*/
|
||||
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);
|
||||
|
||||
} else {
|
||||
logger.debug("Retrieving credential in session!");
|
||||
PortalContext pContext = PortalContext.getConfiguration();
|
||||
boolean hasScopeGroupId = false;
|
||||
|
||||
if (scopeGroupId != null && !scopeGroupId.isEmpty()) {
|
||||
hasScopeGroupId = true;
|
||||
|
||||
} else {
|
||||
hasScopeGroupId = false;
|
||||
}
|
||||
|
||||
if (hasScopeGroupId) {
|
||||
scope = pContext.getCurrentScope(scopeGroupId);
|
||||
} else {
|
||||
scope = pContext.getCurrentScope(httpServletRequest);
|
||||
}
|
||||
|
||||
if (scope == null || scope.isEmpty()) {
|
||||
String error = "Error retrieving scope: " + scope;
|
||||
logger.error(error);
|
||||
throw new ServiceException(error);
|
||||
}
|
||||
|
||||
GCubeUser gCubeUser = pContext.getCurrentUser(httpServletRequest);
|
||||
|
||||
if (gCubeUser == null) {
|
||||
String error = "Error retrieving gCubeUser in scope " + scope + ": " + gCubeUser;
|
||||
logger.error(error);
|
||||
throw new ServiceException(error);
|
||||
}
|
||||
|
||||
userName = gCubeUser.getUsername();
|
||||
|
||||
if (userName == null || userName.isEmpty()) {
|
||||
String error = "Error retrieving username in scope " + scope + ": " + userName;
|
||||
logger.error(error);
|
||||
throw new ServiceException(error);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
String name = gCubeUser.getFirstName();
|
||||
String lastName = gCubeUser.getLastName();
|
||||
String fullName = gCubeUser.getFullname();
|
||||
|
||||
String userAvatarURL = gCubeUser.getUserAvatarURL();
|
||||
|
||||
String email = gCubeUser.getEmail();
|
||||
|
||||
if (hasScopeGroupId) {
|
||||
logger.debug("Set SecurityToken: " + token);
|
||||
SecurityTokenProvider.instance.set(token);
|
||||
logger.debug("Set ScopeProvider: " + scope);
|
||||
ScopeProvider.instance.set(scope);
|
||||
|
||||
groupId = scopeGroupId;
|
||||
|
||||
long gId;
|
||||
|
||||
try {
|
||||
gId = Long.parseLong(scopeGroupId);
|
||||
} catch (Throwable e) {
|
||||
String error = "Error retrieving groupId: " + scopeGroupId;
|
||||
logger.error(error, e);
|
||||
throw new ServiceException(error);
|
||||
}
|
||||
|
||||
GCubeGroup group;
|
||||
try {
|
||||
group = new LiferayGroupManager().getGroup(gId);
|
||||
} catch (Throwable e) {
|
||||
String error = "Error retrieving group: " + groupName;
|
||||
logger.error(error);
|
||||
throw new ServiceException(error);
|
||||
}
|
||||
|
||||
groupName = group.getGroupName();
|
||||
|
||||
} else {
|
||||
|
||||
groupId = String.valueOf(pContext.getCurrentGroupId(httpServletRequest));
|
||||
|
||||
groupName = pContext.getCurrentGroupName(httpServletRequest);
|
||||
|
||||
}
|
||||
|
||||
sCredentials = new ServiceCredentials(userName, fullName, name, lastName, email, scope, groupId, groupName,
|
||||
userAvatarURL, token);
|
||||
}
|
||||
|
||||
logger.debug("ServiceCredentials: " + sCredentials);
|
||||
|
||||
return sCredentials;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.server.accounting;
|
||||
|
||||
import org.gcube.data.access.accounting.summary.access.AccountingDao;
|
||||
import org.gcube.data.access.accounting.summary.access.model.ScopeDescriptor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class AccountingService {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(AccountingService.class);
|
||||
|
||||
private AccountingDao dao;
|
||||
|
||||
public AccountingService() {
|
||||
dao = AccountingDao.get();
|
||||
}
|
||||
|
||||
public void getTree() {
|
||||
try {
|
||||
logger.debug("AccountingService GetTree()");
|
||||
ScopeDescriptor scopeDescriptor = dao.getTree(null);
|
||||
logger.debug("ScopeDescriptor: "+scopeDescriptor);
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("Error retrieving Tree: "+e.getLocalizedMessage(),e);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,141 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.server.util;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class ServiceCredentials implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -2151806926120378275L;
|
||||
private String userName;
|
||||
private String fullName;
|
||||
private String name;
|
||||
private String lastName;
|
||||
private String email;
|
||||
private String scope;
|
||||
private String groupId;
|
||||
private String groupName;
|
||||
private String userAvatarURL;
|
||||
private String token;
|
||||
|
||||
public ServiceCredentials() {
|
||||
super();
|
||||
}
|
||||
|
||||
public ServiceCredentials(String userName, String scope, String token) {
|
||||
super();
|
||||
this.userName = userName;
|
||||
this.scope = scope;
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public ServiceCredentials(String userName, String fullName, String name,
|
||||
String lastName, String email, String scope, String groupId,
|
||||
String groupName, String userAvatarURL, String token) {
|
||||
super();
|
||||
this.userName = userName;
|
||||
this.fullName = fullName;
|
||||
this.name = name;
|
||||
this.lastName = lastName;
|
||||
this.email = email;
|
||||
this.scope = scope;
|
||||
this.groupId = groupId;
|
||||
this.groupName = groupName;
|
||||
this.userAvatarURL = userAvatarURL;
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getFullName() {
|
||||
return fullName;
|
||||
}
|
||||
|
||||
public void setFullName(String fullName) {
|
||||
this.fullName = fullName;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getScope() {
|
||||
return scope;
|
||||
}
|
||||
|
||||
public void setScope(String scope) {
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
public String getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public void setGroupId(String groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
|
||||
public String getUserAvatarURL() {
|
||||
return userAvatarURL;
|
||||
}
|
||||
|
||||
public void setUserAvatarURL(String userAvatarURL) {
|
||||
this.userAvatarURL = userAvatarURL;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ServiceCredentials [userName=" + userName + ", fullName="
|
||||
+ fullName + ", name=" + name + ", lastName=" + lastName
|
||||
+ ", email=" + email + ", scope=" + scope + ", groupId="
|
||||
+ groupId + ", groupName=" + groupName + ", userAvatarURL="
|
||||
+ userAvatarURL + ", token=" + token + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.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.accountingdashboard.server.portlet.AccountingDashboardPortlet";
|
||||
public static final String CMEMS_IMPORTER_ID = "AccountingDashboardId";
|
||||
public static final String CMEMS_IMPORTER_COOKIE = "AccountingDashboardLangCookie";
|
||||
public static final String CMEMS_IMPORTER_LANG = "AccountingDashBoradLang";
|
||||
|
||||
public static final String DEFAULT_USER = "giancarlo.panichi";
|
||||
public static final String DEFAULT_SCOPE = "/gcube/devNext/NextNext";
|
||||
public static final String DEFAULT_TOKEN = "";
|
||||
public static final String DEFAULT_ROLE = "OrganizationMember";
|
||||
|
||||
//
|
||||
public static final int PAGE_SIZE_DEFAULT = 20;
|
||||
public static final int PAGE_SIZE_IN_FORM_DEFAULT = 10;
|
||||
|
||||
// Session
|
||||
public static final String CURR_GROUP_ID = "CURR_GROUP_ID";
|
||||
public static final String CURR_USER_ID = "CURR_USER_ID";
|
||||
|
||||
|
||||
// Service
|
||||
public static final int CLIENT_MONITOR_PERIODMILLIS = 2000;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.shared.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class ScopeData implements Serializable, Comparator<ScopeData>, Comparable<ScopeData> {
|
||||
|
||||
private static final long serialVersionUID = -8445665293115680236L;
|
||||
private String id;
|
||||
private String name;
|
||||
private ArrayList<ScopeData> children;
|
||||
|
||||
public ScopeData() {
|
||||
super();
|
||||
}
|
||||
|
||||
public ScopeData(String id, String name, ArrayList<ScopeData> children) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public ArrayList<ScopeData> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(ArrayList<ScopeData> children) {
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compare(ScopeData o1, ScopeData o2) {
|
||||
if (o1 == o2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (o1 == null) {
|
||||
return -1;
|
||||
} else {
|
||||
if (o2 == null) {
|
||||
return 1;
|
||||
} else {
|
||||
int diff = -1;
|
||||
if (o1 != null) {
|
||||
if (o1.getId() != null) {
|
||||
diff = ((o2 != null) && (o2.getId() != null)) ? o1.getId().compareTo(o2.getId()) : 1;
|
||||
}
|
||||
}
|
||||
return diff;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(ScopeData o) {
|
||||
return compare(this, o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ScopeData [id=" + id + ", name=" + name + ", children=" + children + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.shared.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Comparator;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class TreatmentData implements Serializable, Comparator<TreatmentData>, Comparable<TreatmentData> {
|
||||
|
||||
private static final long serialVersionUID = -8445665293115680236L;
|
||||
private int id;
|
||||
private String treatmentType;
|
||||
private Integer numberOfTreatments;
|
||||
|
||||
public TreatmentData() {
|
||||
super();
|
||||
}
|
||||
|
||||
public TreatmentData(int id, String treatmentType, Integer numberOfTreatments) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.treatmentType = treatmentType;
|
||||
this.numberOfTreatments = numberOfTreatments;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTreatmentType() {
|
||||
return treatmentType;
|
||||
}
|
||||
|
||||
public void setTreatmentType(String treatmentType) {
|
||||
this.treatmentType = treatmentType;
|
||||
}
|
||||
|
||||
public Integer getNumberOfTreatments() {
|
||||
return numberOfTreatments;
|
||||
}
|
||||
|
||||
public void setNumberOfTreatments(Integer numberOfTreatments) {
|
||||
this.numberOfTreatments = numberOfTreatments;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compare(TreatmentData o1, TreatmentData o2) {
|
||||
if (o1 == null) {
|
||||
return -1;
|
||||
} else {
|
||||
if (o2 == null) {
|
||||
return 1;
|
||||
} else {
|
||||
return (o1.getId() < o2.getId()) ? -1 : ((o1.getId() == o2.getId()) ? 0 : 1);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TreatmentData o) {
|
||||
return compare(this, o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TreatmentData [id=" + id + ", treatmentType=" + treatmentType + ", numberOfTreatments="
|
||||
+ numberOfTreatments + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.shared.exception;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class ServiceException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = -2255657546267656458L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public ServiceException() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message
|
||||
* message
|
||||
*/
|
||||
public ServiceException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param message
|
||||
* message
|
||||
* @param throwable
|
||||
* throwable
|
||||
*
|
||||
*/
|
||||
public ServiceException(String message, Throwable throwable) {
|
||||
super(message, throwable);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.shared.exception;
|
||||
|
||||
/**
|
||||
* ASL Session Expired Exception
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*/
|
||||
public class SessionExpiredException extends ServiceException {
|
||||
|
||||
private static final long serialVersionUID = -4831171355042165166L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public SessionExpiredException() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message
|
||||
* message
|
||||
*/
|
||||
public SessionExpiredException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param message
|
||||
* message
|
||||
* @param throwable
|
||||
* throwable
|
||||
*/
|
||||
public SessionExpiredException(String message, Throwable throwable) {
|
||||
super(message, throwable);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.shared.session;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SessionConstants {
|
||||
|
||||
public static final String SAI_DESCRIPTOR="SAI_DESCRIPTOR";
|
||||
public static final String FILE_UPLOAD_MONITOR="FILE_UPLOAD_MONITOR";
|
||||
public static final String IMPORT_CODE_FILE_UPLOAD_SESSION = "IMPORT_CODE_FILE_UPLOAD_SESSION";
|
||||
public static final String PROJECT = "PROJECT";
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
package org.gcube.portlets.user.accountingdashboard.shared.session;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class UserInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -2826549639677017234L;
|
||||
|
||||
private String username;
|
||||
private String groupId;
|
||||
private String groupName;
|
||||
private String scope;
|
||||
private String userEmailAddress;
|
||||
private String userFullName;
|
||||
|
||||
public UserInfo() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param username
|
||||
* user name
|
||||
* @param groupId
|
||||
* group id
|
||||
* @param groupName
|
||||
* group name
|
||||
* @param scope
|
||||
* scope
|
||||
* @param userEmailAddress
|
||||
* email
|
||||
* @param userFullName
|
||||
* full name
|
||||
*/
|
||||
public UserInfo(String username, String groupId, String groupName, String scope, String userEmailAddress,
|
||||
String userFullName) {
|
||||
super();
|
||||
this.username = username;
|
||||
this.groupId = groupId;
|
||||
this.groupName = groupName;
|
||||
this.scope = scope;
|
||||
this.userEmailAddress = userEmailAddress;
|
||||
this.userFullName = userFullName;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public void setGroupId(String groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
|
||||
public String getScope() {
|
||||
return scope;
|
||||
}
|
||||
|
||||
public void setScope(String scope) {
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
public String getUserEmailAddress() {
|
||||
return userEmailAddress;
|
||||
}
|
||||
|
||||
public void setUserEmailAddress(String userEmailAddress) {
|
||||
this.userEmailAddress = userEmailAddress;
|
||||
}
|
||||
|
||||
public String getUserFullName() {
|
||||
return userFullName;
|
||||
}
|
||||
|
||||
public void setUserFullName(String userFullName) {
|
||||
this.userFullName = userFullName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UserInfo [username=" + username + ", groupId=" + groupId + ", groupName=" + groupName + ", scope="
|
||||
+ scope + ", userEmailAddress=" + userEmailAddress + ", userFullName=" + userFullName + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
<module rename-to="accountingdashb">
|
||||
<inherits name="com.google.gwt.user.User" />
|
||||
<inherits name="com.google.gwt.http.HTTP" />
|
||||
<inherits name="com.google.gwt.resources.Resources" />
|
||||
<inherits name="com.google.gwt.logging.Logging" />
|
||||
<inherits name='com.google.gwt.user.theme.standard.Standard' />
|
||||
|
||||
<inherits name="com.github.gwtbootstrap.Bootstrap" />
|
||||
<inherits name='com.github.gwtbootstrap.datetimepicker.Datetimepicker' />
|
||||
|
||||
<!--pay attention in this part -->
|
||||
<!-- <replace-with class="org.gcube.portlets.user.cmemsschedulermanager.client.resources.ThemeConfigurator">
|
||||
<when-type-is class="com.github.gwtbootstrap.client.ui.config.Configurator"
|
||||
/> </replace-with> -->
|
||||
|
||||
|
||||
<inherits name="com.gwtplatform.mvp.MvpWithEntryPoint" />
|
||||
|
||||
<extend-configuration-property name="gin.ginjector.modules"
|
||||
value="org.gcube.portlets.user.accountingdashboard.client.gin.AccountingDashBoardClientModule" />
|
||||
<!-- Specify the paths for translatable code -->
|
||||
<source path="client" />
|
||||
<source path="shared" />
|
||||
|
||||
<set-configuration-property name="CssResource.enableGss"
|
||||
value="true" />
|
||||
<set-configuration-property name="CssResource.conversionMode"
|
||||
value="strict" />
|
||||
|
||||
<!-- <set-property name="gwt.logging.logLevel" value="SEVERE" /> <set-property
|
||||
name="gwt.logging.enabled" value="TRUE" /> -->
|
||||
|
||||
<set-property name="gwt.logging.logLevel" value="FINE" />
|
||||
<set-property name="gwt.logging.enabled" value="TRUE" />
|
||||
<set-property name="gwt.logging.consoleHandler" value="ENABLED" />
|
||||
|
||||
</module>
|
||||
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
/* FIX FOR Portal Theme
|
||||
.aui body {
|
||||
color: #000;
|
||||
font-weight: normal !important;
|
||||
}
|
||||
|
||||
.aui input[type="text"], .aui select, .aui textarea, .aui .uneditable-input
|
||||
{
|
||||
margin-bottom: 1px !important;
|
||||
padding: 0px !important;
|
||||
}
|
||||
|
||||
.aui input[type="radio"], .aui input[type="checkbox"] {
|
||||
margin: 0px !important;
|
||||
width: 10px !important;
|
||||
}
|
||||
|
||||
.aui input, .aui textarea, .aui .uneditable-input {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.aui p {
|
||||
margin: 0px !important;
|
||||
}
|
||||
|
||||
.aui img {
|
||||
vertical-align: baseline !important;
|
||||
}
|
||||
|
||||
.aui fieldset {
|
||||
padding: 9px !important;
|
||||
border: 1px solid rgb(181, 184, 200) !important;
|
||||
}
|
||||
|
||||
.aui legend {
|
||||
margin-bottom: 0px !important;
|
||||
width: auto !important;
|
||||
border-bottom: none !important;
|
||||
}
|
||||
|
||||
.aui label {
|
||||
display: inline !important;
|
||||
|
||||
}
|
||||
|
||||
.aui ul, .aui ol {
|
||||
margin: 0px !important;
|
||||
}
|
||||
*/
|
||||
/* Workspace Explorer */
|
||||
/*
|
||||
#drop_target_inner {
|
||||
background-image: url("statalgoimporter/images/upload_128.png") !important;
|
||||
}
|
||||
*/
|
|
@ -0,0 +1,51 @@
|
|||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
|
||||
<!-- -->
|
||||
<!-- Consider inlining CSS to reduce the number of requested files -->
|
||||
<!-- -->
|
||||
<!-- <link rel="stylesheet" type="text/css"
|
||||
href="cmemsschedulermanager/reset.css" /> -->
|
||||
|
||||
<!-- -->
|
||||
<!-- Any title is fine -->
|
||||
<!-- -->
|
||||
<title>Accounting Dashboard</title>
|
||||
|
||||
<!-- -->
|
||||
<!-- This script loads your compiled module. -->
|
||||
<!-- If you add any GWT meta tags, they must -->
|
||||
<!-- be added before this line. -->
|
||||
<!-- -->
|
||||
<link type="text/css" rel="stylesheet" href="AccountingDashboard.css">
|
||||
|
||||
<script type="text/javascript"
|
||||
src="accountingdashb/accountingdashb.nocache.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<!-- -->
|
||||
<!-- The body can have arbitrary html, or -->
|
||||
<!-- you can leave the body empty if you want -->
|
||||
<!-- to create a completely dynamic UI. -->
|
||||
<!-- -->
|
||||
<body style="padding-top:0px;">
|
||||
|
||||
<!-- OPTIONAL: include this if you want history support -->
|
||||
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1'
|
||||
style="position: absolute; width: 0; height: 0; border: 0"></iframe>
|
||||
|
||||
<!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
|
||||
<noscript>
|
||||
<div
|
||||
style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
|
||||
Your web browser must have JavaScript enabled in order for this
|
||||
application to display correctly.</div>
|
||||
</noscript>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,14 @@
|
|||
<%@page contentType="text/html"%>
|
||||
<%@page pageEncoding="UTF-8"%>
|
||||
|
||||
<!-- -->
|
||||
<!-- The module reference below is the link -->
|
||||
<!-- between html and your Web Toolkit module -->
|
||||
<%-- <link rel="stylesheet" href="<%= request.getContextPath()%>/accountingdashb/reset.css" type="text/css"/> --%>
|
||||
<link rel="stylesheet" href="<%= request.getContextPath()%>/AccountingDashboard.css" type="text/css">
|
||||
|
||||
<script src="<%=request.getContextPath()%>/accountingdashb/accountingdashb.nocache.js"></script>
|
||||
|
||||
<div class="contentDiv" id="contentDiv"></div>
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue