Compare commits

...

35 Commits

Author SHA1 Message Date
Giancarlo Panichi 358add45aa Updated the scope of xml-apis [#23510] 2 years ago
Giancarlo Panichi 3d9e6bc63a Updated the scope of xml-apis [#23510] 2 years ago
Giancarlo Panichi a4edbbd9cb Ready for Release gCube 4.24.0 4 years ago
Giancarlo Panichi 9801dea0d9 ref 19161: Disable Zoom for charts
https://support.d4science.org/issues/18964

Disabled Zoom for charts
4 years ago
Giancarlo Panichi 602458627b ref 19440: Update the library detachedres-library to store properties
needed to resolve detached Item URLs

https://support.d4science.org/issues/19440

Updated to support new detachedres-library
4 years ago
Giancarlo Panichi ff7ab51743 ref 19440: Update the library detachedres-library to store properties
needed to resolve detached Item URLs

https://support.d4science.org/issues/19440

Updated to support new detachedres-library
4 years ago
Roberto Cirillo bae895059b Update 'pom.xml'
removed SNAPSHOT from artifact version
4 years ago
Giancarlo Panichi d31c9b9f09 Create 1.2.0-SNAPSHOT version 4 years ago
Giancarlo Panichi 6fbc30f520 Merge pull request 'Feature/18753' (#2) from Feature/18753 into master 4 years ago
Giancarlo Panichi a027c3aefd ref 18753: Add menu to Accounting Dashboard pages
https://support.d4science.org/issues/18753

Fixed TOC menu behavior in reports
4 years ago
Giancarlo Panichi 464022838a ref 18753: Add menu to Accounting Dashboard pages
https://support.d4science.org/issues/18753

Added TOC menu in reports
4 years ago
Giancarlo Panichi b820edce39 ref 18753: Add menu to Accounting Dashboard pages containing more than
one graph

https://support.d4science.org/issues/18753

Added TOC menu in reports
4 years ago
Giancarlo Panichi 95f5670e9f ref 18753: Add menu to Accounting Dashboard pages
https://support.d4science.org/issues/18753

Added TOC menu in reports
4 years ago
Giancarlo Panichi 95b009ae60 Merge pull request 'Future/18815' (#1) from Future/18815 into master 4 years ago
Giancarlo Panichi c327d0b00c Branches: Future/18815, origin/Future/18815
ref 18754: Dashboard: Alphabetically sort the tabs

https://support.d4science.org/issues/18754

Added the alphabetical sorting of the tabs
4 years ago
Giancarlo Panichi 68dc1588fb ref 18754: Dashboard: Alphabetically sort the tabs
https://support.d4science.org/issues/18754

Added the alphabetically sort of the tabs
4 years ago
Giancarlo Panichi 44cca496c9 ref 18815: Accounting Dashboard Reminiscence
https://support.d4science.org/issues/18815

Updated detached REs support
4 years ago
Giancarlo Panichi 6b7d32fcbf ref 18815: Accounting Dashboard Reminiscence
https://support.d4science.org/issues/18815

Updated detached REs support
4 years ago
Giancarlo Panichi 2081513f2f ref 18815: Accounting Dashboard Reminiscence
https://support.d4science.org/issues/18815

Updated detached REs support
4 years ago
Giancarlo Panichi e368c174dd ref 18815: Accounting Dashboard Reminiscence
https://support.d4science.org/issues/18815

Added detachedres-library
4 years ago
Giancarlo Panichi 3e0c975f91 ref 18815: Accounting Dashboard Reminiscence
https://support.d4science.org/issues/18815

Added detachedres-library
4 years ago
Giancarlo Panichi 4e5c3a9b4b ref 18815: Accounting Dashboard Reminiscence
https://support.d4science.org/issues/18815

Added detachedres-library
4 years ago
Giancarlo Panichi 82361090f7 ref 18815: Accounting Dashboard Reminiscence
https://support.d4science.org/issues/18815

Added detachedres-library
4 years ago
Giancarlo Panichi d5266a0b7c ref 18291: Modify Accounting Dashboard portlet to support Core Services
https://support.d4science.org/issues/18291

Fixed infra nodes scope
4 years ago
Giancarlo Panichi d0e815d7f7 ref 18291: Modify the Accounting Dashboard portlet to support the Core
Services Category per gateway

https://support.d4science.org/issues/18291

Fixed infra nodes scope
4 years ago
Giancarlo Panichi 58ccefa0b7 ref 18291: Modify the Accounting Dashboard portlet to support the Core
Services Category per gateway

https://support.d4science.org/issues/18291

Fixed infra nodes scope
4 years ago
Giancarlo Panichi b8f99d099e ref 18291: Modify the Accounting Dashboard portlet to support the Core
Services Category per gateway

https://support.d4science.org/issues/18291

Fixed infra nodes scope
4 years ago
Giancarlo Panichi e140afebe4 ref 18291: Modify the Accounting Dashboard portlet to support the Core
Services Category per gateway

https://support.d4science.org/issues/18291

Fixed the creation of the tree
4 years ago
Giancarlo Panichi 8726e63ad7 ref 18291: Modify the Accounting Dashboard portlet to support the Core
Services Category per gateway

https://support.d4science.org/issues/18291

Added IS support
4 years ago
Giancarlo Panichi 52cc4ad7c9 Updated to Git and Jenkins 4 years ago
Giancarlo Panichi 5641f23fe1 Updated to Git and Jenkins 4 years ago
Giancarlo Panichi ac010a1dd3 Updated to Git and Jenkins 4 years ago
Giancarlo Panichi c8f081427a Updated to Git and Jenkins 4 years ago
Giancarlo Panichi 975779d8e4 ref 18034: Support export csv with Firefox and Safari
https://support.d4science.org/issues/18034

Updated csv export
5 years ago
Giancarlo Panichi 3cddab592a ref 18034: Accounting Dashboard - Support export csv with Firefox and
Safari
https://support.d4science.org/issues/18034

Updated csv export
5 years ago

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry including="**/*.java" kind="src" output="target/accounting-dashboard-1.1.0/WEB-INF/classes" path="src/main/java">
<classpathentry including="**/*.java" kind="src" output="target/accounting-dashboard-1.2.1-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.1.0/WEB-INF/classes" path="src/main/resources">
<classpathentry excluding="**" kind="src" output="target/accounting-dashboard-1.2.1-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
@ -50,5 +50,5 @@
</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.1.0/WEB-INF/classes"/>
<classpathentry kind="output" path="target/accounting-dashboard-1.2.1-SNAPSHOT/WEB-INF/classes"/>
</classpath>

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="accounting-dashboard-1.1.0">
<wb-module deploy-name="accounting-dashboard-1.2.1-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"/>

@ -0,0 +1,40 @@
# Changelog
## [v1.2.2] - 2022-06-15
- Updated the scope of xml-apis [#23510]
## [v1.2.1] - 2020-06-18
- Updated to support new detachedres-library [#19440]
- Disabled Zoom for charts [#19161]
## [v1.2.0] - 2020-04-08
- Updated export csv support with Firefox and Safari [#18034]
- Added Core Services support [#18291]
- Added Detached REs support [#18815]
- Added the alphabetical sorting of tabs [#18754]
- Added TOC menu in reports [#18753]
## [v1.1.0] - 2019-10-01
- Updated to support accounting data visualization at the infrastructure level [#17847]
## [v1.0.0] - 2018-08-01
- First Release
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

@ -0,0 +1,26 @@
# Acknowledgments
The projects leading to this software have received funding from a series of European Union programmes including:
- the Sixth Framework Programme for Research and Technological Development
- [DILIGENT](https://cordis.europa.eu/project/id/004260) (grant no. 004260).
- the Seventh Framework Programme for research, technological development and demonstration
- [D4Science](https://cordis.europa.eu/project/id/212488) (grant no. 212488);
- [D4Science-II](https://cordis.europa.eu/project/id/239019) (grant no.239019);
- [ENVRI](https://cordis.europa.eu/project/id/283465) (grant no. 283465);
- [iMarine](https://cordis.europa.eu/project/id/283644) (grant no. 283644);
- [EUBrazilOpenBio](https://cordis.europa.eu/project/id/288754) (grant no. 288754).
- the H2020 research and innovation programme
- [SoBigData](https://cordis.europa.eu/project/id/654024) (grant no. 654024);
- [PARTHENOS](https://cordis.europa.eu/project/id/654119) (grant no. 654119);
- [EGI-Engage](https://cordis.europa.eu/project/id/654142) (grant no. 654142);
- [ENVRI PLUS](https://cordis.europa.eu/project/id/654182) (grant no. 654182);
- [BlueBRIDGE](https://cordis.europa.eu/project/id/675680) (grant no. 675680);
- [PerformFISH](https://cordis.europa.eu/project/id/727610) (grant no. 727610);
- [AGINFRA PLUS](https://cordis.europa.eu/project/id/731001) (grant no. 731001);
- [DESIRA](https://cordis.europa.eu/project/id/818194) (grant no. 818194);
- [ARIADNEplus](https://cordis.europa.eu/project/id/823914) (grant no. 823914);
- [RISIS 2](https://cordis.europa.eu/project/id/824091) (grant no. 824091);
- [EOSC-Pillar](https://cordis.europa.eu/project/id/857650) (grant no. 857650);
- [Blue Cloud](https://cordis.europa.eu/project/id/862409) (grant no. 862409);
- [SoBigData-PlusPlus](https://cordis.europa.eu/project/id/871042) (grant no. 871042);

@ -1,9 +1,10 @@
#European Union Public Licence V.1.1
# European Union Public Licence V. 1.1
##*EUPL © the European Community 2007*
EUPL © the European Community 2007
This **European Union Public Licence** (the **“EUPL”**) applies to the Work or Software
This European Union Public Licence (the “EUPL”) applies to the Work or Software
(as defined below) which is provided under the terms of this Licence. Any use of
the Work, other than as authorised under this Licence is prohibited (to the
extent such use is covered by a right of the copyright holder of the Work).
@ -12,13 +13,13 @@ The Original Work is provided under the terms of this Licence when the Licensor
(as defined below) has placed the following notice immediately following the
copyright notice for the Original Work:
**Licensed under the EUPL V.1.1**
Licensed under the EUPL V.1.1
or has expressed by any other mean his willingness to license under the EUPL.
##1. Definitions
## 1. Definitions
In this Licence, the following terms have the following meaning:
@ -59,7 +60,7 @@ In this Licence, the following terms have the following meaning:
##2. Scope of the rights granted by the Licence
## 2. Scope of the rights granted by the Licence
The Licensor hereby grants You a world-wide, royalty-free, non-exclusive,
sub-licensable licence to do the following, for the duration of copyright vested
@ -85,7 +86,7 @@ rights granted on the Work under this Licence.
##3. Communication of the Source Code
## 3. Communication of the Source Code
The Licensor may provide the Work either in its Source Code form, or as
Executable Code. If the Work is provided as Executable Code, the Licensor
@ -97,7 +98,7 @@ continues to distribute and/or communicate the Work.
##4. Limitations on copyright
## 4. Limitations on copyright
Nothing in this Licence is intended to deprive the Licensee of the benefits from
any exception or limitation to the exclusive rights of the rights owners in the
@ -106,7 +107,7 @@ applicable limitations thereto.
##5. Obligations of the Licensee
## 5. Obligations of the Licensee
The grant of the rights mentioned above is subject to some restrictions and
obligations imposed on the Licensee. Those obligations are the following:
@ -147,7 +148,7 @@ reproducing the content of the copyright notice.
##6. Chain of Authorship
## 6. Chain of Authorship
The original Licensor warrants that the copyright in the Original Work granted
hereunder is owned by him/her or licensed to him/her and that he/she has the
@ -163,7 +164,7 @@ terms of this Licence.
##7. Disclaimer of Warranty
## 7. Disclaimer of Warranty
The Work is a work in progress, which is continuously improved by numerous
contributors. It is not a finished work and may therefore contain defects or
@ -180,7 +181,7 @@ for the grant of any rights to the Work.
##8. Disclaimer of Liability
## 8. Disclaimer of Liability
Except in the cases of wilful misconduct or damages directly caused to natural
persons, the Licensor will in no event be liable for any direct or indirect,
@ -193,7 +194,7 @@ laws as far such laws apply to the Work.
##9. Additional agreements
## 9. Additional agreements
While distributing the Original Work or Derivative Works, You may choose to
conclude an additional agreement to offer, and charge a fee for, acceptance of
@ -207,7 +208,7 @@ any such warranty or additional liability.
##10. Acceptance of the Licence
## 10. Acceptance of the Licence
The provisions of this Licence can be accepted by clicking on an icon “I agree”
placed under the bottom of a window displaying the text of this Licence or by
@ -222,7 +223,7 @@ Distribution and/or Communication by You of the Work or copies thereof.
##11. Information to the public
## 11. Information to the public
In case of any Distribution and/or Communication of the Work by means of
electronic communication by You (for example, by offering to download the Work
@ -233,7 +234,7 @@ accessible, concluded, stored and reproduced by the Licensee.
##12. Termination of the Licence
## 12. Termination of the Licence
The Licence and the rights granted hereunder will terminate automatically upon
any breach by the Licensee of the terms of the Licence.
@ -244,7 +245,7 @@ remain in full compliance with the Licence.
##13. Miscellaneous
## 13. Miscellaneous
Without prejudice of Article 9 above, the Licence represents the complete
agreement between the Parties as to the Work licensed hereunder.
@ -265,7 +266,7 @@ their choice.
##14. Jurisdiction
## 14. Jurisdiction
Any litigation resulting from the interpretation of this License, arising
between the European Commission, as a Licensor, and any Licensee, will be
@ -279,7 +280,7 @@ conducts its primary business.
##15. Applicable Law
## 15. Applicable Law
This Licence shall be governed by the law of the European Union country where
the Licensor resides or has his registered office.
@ -291,13 +292,12 @@ This licence shall be governed by the Belgian law if:
- or registered office inside a European Union country.
---
## Appendix
##Appendix
**“Compatible Licences”** according to article 5 EUPL are:
“Compatible Licences” according to article 5 EUPL are:
- GNU General Public License (GNU GPL) v. 2

@ -35,12 +35,4 @@ open-source software toolkit used for building and operating Hybrid Data
Infrastructures enabling the dynamic deployment of Virtual Research Environments
by favouring the realisation of reuse oriented policies.
The projects leading to this software have received funding from a series of European Union programmes including:
- the Sixth Framework Programme for Research and Technological Development
- DILIGENT (grant no. 004260);
- the Seventh Framework Programme for research, technological development and demonstration
- D4Science (grant no. 212488), D4Science-II (grant no.239019), ENVRI (grant no. 283465), EUBrazilOpenBio (grant no. 288754), iMarine(grant no. 283644);
- the H2020 research and innovation programme
- BlueBRIDGE (grant no. 675680), EGIEngage (grant no. 654142), ENVRIplus (grant no. 654182), Parthenos (grant no. 654119), SoBigData (grant no. 654024),DESIRA (grant no. 818194), ARIADNEplus (grant no. 823914), RISIS2 (grant no. 824091), PerformFish (grant no. 727610), AGINFRAplus (grant no. 731001);
The projects leading to this software have received funding from a series of European Union programmes see [FUNDING.md](FUNDING.md)

@ -1,8 +1,25 @@
<ReleaseNotes>
<Changeset component="org.gcube.portlets.user.accounting-dashboard.1-2-2"
date="2022-06-15">
<Change>Updated the scope of xml-apis [#23530]</Change>
</Changeset>
<Changeset component="org.gcube.portlets.user.accounting-dashboard.1-2-1"
date="2020-06-18">
<Change>Updated to support new detachedres-library [#19440]</Change>
<Change>Disabled Zoom for charts [#19161]</Change>
</Changeset>
<Changeset component="org.gcube.portlets.user.accounting-dashboard.1-2-0"
date="2020-04-08">
<Change>Updated export csv support with Firefox and Safari [#18034]</Change>
<Change>Added Core Services support [#18291]</Change>
<Change>Added Detached REs support [#18815]</Change>
<Change>Added the alphabetical sorting of tabs [#18754]</Change>
<Change>Added TOC menu in reports [#18753]</Change>
</Changeset>
<Changeset component="org.gcube.portlets.user.accounting-dashboard.1-1-0"
date="2019-10-01">
<Change>Updated to support accounting data visualization at the
infrastructure level [ticket #17847]</Change>
infrastructure level [#17847]</Change>
</Changeset>
<Changeset component="org.gcube.portlets.user.accounting-dashboard.1-0-0"
date="2018-08-01">

@ -14,8 +14,9 @@
<includes>
<include>README.md</include>
<include>LICENSE.md</include>
<include>CHANGELOG.md</include>
<include>FUNDING.md</include>
<include>profile.xml</include>
<include>changelog.xml</include>
</includes>
<fileMode>755</fileMode>
<filtered>true</filtered>

@ -13,16 +13,16 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>accounting-dashboard</artifactId>
<version>1.1.0</version>
<version>1.2.2</version>
<packaging>war</packaging>
<name>accounting-dashboard</name>
<description>Accounting Dashboard is a tool for monitoring and displaying statistical data concerning the D4Science Infrastructure</description>
<scm>
<connection>scm:git:https://code-repo.d4science.org/gCubeSystem/accounting-dashboard.git</connection>
<developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/accounting-dashboard.git</developerConnection>
<url>https://code-repo.d4science.org/gCubeSystem/accounting-dashboard</url>
<connection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</connection>
<developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</developerConnection>
<url>https://code-repo.d4science.org/gCubeSystem/${project.artifactId}</url>
</scm>
@ -205,7 +205,7 @@
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-scope-maps</artifactId>
<scope>compile</scope>
<scope>provided</scope>
</dependency>
<dependency>
@ -223,7 +223,7 @@
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>client-context-library</artifactId>
<version>[1.0.0-SNAPSHOT,)</version>
<version>[1.0.0,2.0.0-SNAPSHOT)</version>
<scope>compile</scope>
</dependency>
@ -253,9 +253,17 @@
<dependency>
<groupId>org.gcube.accounting</groupId>
<artifactId>accounting-summary-access</artifactId>
<version>[0.0.1-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<version>[1.0.0,2.0.0-SNAPSHOT)</version>
</dependency>
<!-- detachedres-library -->
<dependency>
<groupId>org.gcube.infrastructure.detachedres</groupId>
<artifactId>detachedres-library</artifactId>
<version>[1.0.0,2.0.0-SNAPSHOT)</version>
</dependency>
<!-- Portal Service -->
<dependency>
<groupId>com.liferay.portal</groupId>
@ -312,13 +320,13 @@
</includes>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/resources</directory>
</testResource>
</testResources>
<plugins>
<!-- GWT -->
@ -351,7 +359,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<phase>compile</phase>
@ -366,7 +373,6 @@
<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>
@ -403,7 +409,7 @@
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId>
<version>LATEST</version>
<version>3.6.4</version>
<type>pom</type>
<scope>import</scope>
</dependency>

@ -1,8 +1,11 @@
package org.gcube.portlets.user.accountingdashboard.client.application;
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.client.application.menu.MenuPresenter;
import org.gcube.portlets.user.accountingdashboard.client.place.NameTokens;
import com.google.gwt.user.client.Window;
import com.google.inject.Inject;
@ -15,6 +18,7 @@ import com.gwtplatform.mvp.client.presenter.slots.PermanentSlot;
import com.gwtplatform.mvp.client.proxy.NavigationEvent;
import com.gwtplatform.mvp.client.proxy.NavigationHandler;
import com.gwtplatform.mvp.client.proxy.Proxy;
import com.gwtplatform.mvp.shared.proxy.PlaceRequest;
/**
*
@ -24,6 +28,9 @@ import com.gwtplatform.mvp.client.proxy.Proxy;
public class ApplicationPresenter
extends Presenter<ApplicationPresenter.PresenterView, ApplicationPresenter.ApplicationPresenterProxy>
implements NavigationHandler {
private static Logger logger = java.util.logging.Logger.getLogger("");
interface PresenterView extends View {
}
@ -36,11 +43,10 @@ public class ApplicationPresenter
private MenuPresenter menuPresenter;
private Controller controller;
@Inject
ApplicationPresenter(EventBus eventBus, PresenterView view, ApplicationPresenterProxy proxy, MenuPresenter menuPresenter,
Controller controller) {
ApplicationPresenter(EventBus eventBus, PresenterView view, ApplicationPresenterProxy proxy,
MenuPresenter menuPresenter, Controller controller) {
super(eventBus, view, proxy, RevealType.Root);
this.menuPresenter = menuPresenter;
this.controller = controller;
@ -63,16 +69,21 @@ public class ApplicationPresenter
@Override
public void onNavigation(NavigationEvent navigationEvent) {
Window.scrollTo(0, 0);
// PlaceRequest placeRequest=navigationEvent.getRequest();
// placeManager.revealPlace(placeRequest);
if (navigationEvent != null) {
PlaceRequest placeRequest = navigationEvent.getRequest();
logger.log(Level.FINE, "Navigation: " + placeRequest);
// If the navigation is related to mainarea scrollbar is not reset
if (placeRequest.getNameToken().compareTo(NameTokens.getMainArea()) != 0) {
Window.scrollTo(0, 0);
}
// placeManager.revealPlace(placeRequest);
} else {
Window.scrollTo(0, 0);
}
}
private void callHello(){
private void callHello() {
controller.callHello();
}
}

@ -6,6 +6,7 @@ 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.EnvironmentEvent;
import org.gcube.portlets.user.accountingdashboard.client.application.event.HelloEvent;
import org.gcube.portlets.user.accountingdashboard.client.application.event.ReportEvent;
import org.gcube.portlets.user.accountingdashboard.client.application.event.ScopeDataEvent;
@ -13,6 +14,8 @@ import org.gcube.portlets.user.accountingdashboard.client.rpc.AccountingDashboar
import org.gcube.portlets.user.accountingdashboard.shared.data.ReportData;
import org.gcube.portlets.user.accountingdashboard.shared.data.RequestReportData;
import org.gcube.portlets.user.accountingdashboard.shared.data.ScopeData;
import org.gcube.portlets.user.accountingdashboard.shared.env.EnvironmentData;
import org.gcube.portlets.user.accountingdashboard.shared.options.TreeOptions;
import org.gcube.portlets.user.accountingdashboard.shared.session.UserInfo;
import com.google.gwt.event.shared.EventBus;
@ -37,6 +40,7 @@ public class Controller {
private MonitorPresenter monitorPresenter;
private ErrorPresenter errorPresenter;
private InfoPresenter infoPresenter;
private TreeOptions treeOptions=null;
@Inject
Controller(@Named("ControllerEventBus") EventBus eventBus, AccountingDashboardServiceAsync service,
@ -47,6 +51,7 @@ public class Controller {
this.errorPresenter = errorPresenter;
this.infoPresenter = infoPresenter;
//this.cache = new ApplicationCache();
this.setTreeOptions(new TreeOptions(false));
}
@ -72,6 +77,14 @@ public class Controller {
infoPresenter.infoMessage(info);
}
public TreeOptions getTreeOptions() {
return treeOptions;
}
public void setTreeOptions(TreeOptions treeOptions) {
this.treeOptions = treeOptions;
}
public void hello() {
eventBus.fireEvent(new HelloEvent());
@ -100,9 +113,30 @@ public class Controller {
});
}
public void getEnvironment() {
service.getEnvironment(new AsyncCallback<EnvironmentData>() {
@Override
public void onFailure(Throwable caught) {
logger.log(Level.FINE, "Error in getEnvironment(): ", caught);
errorPresenter.errorMessage(caught.getLocalizedMessage());
}
@Override
public void onSuccess(EnvironmentData environmentData) {
logger.log(Level.FINE, "ScopeData: " + environmentData);
EnvironmentEvent event = new EnvironmentEvent(environmentData);
eventBus.fireEvent(event);
}
});
}
public void getTree() {
service.getScopeData(new AsyncCallback<ScopeData>() {
service.getScopeData(treeOptions,new AsyncCallback<ScopeData>() {
@Override
public void onFailure(Throwable caught) {
@ -123,7 +157,7 @@ public class Controller {
public void getReport(RequestReportData requestReportData) {
monitorPresenter.enable(true);
service.getReport(requestReportData, new AsyncCallback<ReportData>() {
service.getReport(requestReportData,treeOptions, new AsyncCallback<ReportData>() {
@Override
public void onFailure(Throwable caught) {
@ -144,4 +178,5 @@ public class Controller {
}
}

@ -0,0 +1,51 @@
package org.gcube.portlets.user.accountingdashboard.client.application.event;
import org.gcube.portlets.user.accountingdashboard.shared.env.EnvironmentData;
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 EnvironmentEvent extends GwtEvent<EnvironmentEvent.EnvironmentEventHandler> {
private EnvironmentData environmentData;
public interface EnvironmentEventHandler extends EventHandler {
void onInit(EnvironmentEvent event);
}
public static final Type<EnvironmentEventHandler> TYPE = new Type<>();
public EnvironmentEvent(EnvironmentData environmentData) {
this.environmentData = environmentData;
}
public static void fire(HasHandlers source, EnvironmentEvent event) {
source.fireEvent(event);
}
@Override
public Type<EnvironmentEventHandler> getAssociatedType() {
return TYPE;
}
@Override
protected void dispatch(EnvironmentEventHandler handler) {
handler.onInit(this);
}
public EnvironmentData getEnvironmentData() {
return environmentData;
}
@Override
public String toString() {
return "EnvironmentEvent [environmentData=" + environmentData + "]";
}
}

@ -5,9 +5,12 @@ 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.client.application.event.EnvironmentEvent;
import org.gcube.portlets.user.accountingdashboard.client.application.event.ScopeDataEvent;
import org.gcube.portlets.user.accountingdashboard.shared.data.RequestReportData;
import org.gcube.portlets.user.accountingdashboard.shared.data.ScopeData;
import org.gcube.portlets.user.accountingdashboard.shared.env.EnvironmentData;
import org.gcube.portlets.user.accountingdashboard.shared.options.TreeOptions;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.inject.Inject;
@ -29,6 +32,8 @@ public class FilterAreaPresenter extends PresenterWidget<FilterAreaPresenter.Fil
interface FilterAreaView extends View, HasUiHandlers<FilterAreaPresenter> {
void displayScopeData(ScopeData scopeData);
void setEnvironment(EnvironmentData environmentData);
}
@ -47,7 +52,6 @@ public class FilterAreaPresenter extends PresenterWidget<FilterAreaPresenter.Fil
}
private void addProviders() {
}
@ -62,26 +66,44 @@ public class FilterAreaPresenter extends PresenterWidget<FilterAreaPresenter.Fil
}
});
controller.getEventBus().addHandler(EnvironmentEvent.TYPE, new EnvironmentEvent.EnvironmentEventHandler() {
@Override
public void onInit(EnvironmentEvent event) {
logger.log(Level.FINE, "EnvironmentEvent received");
getView().setEnvironment(event.getEnvironmentData());
}
});
}
@Override
protected void onBind() {
super.onBind();
controller.getEnvironment();
controller.getTree();
}
@Override
public void updateTreeOptions(TreeOptions treeOptions) {
logger.fine("UpdateTreeOption: " + treeOptions);
controller.setTreeOptions(treeOptions);
controller.getTree();
}
@Override
public void getReport(RequestReportData requestReportData) {
if(checkDate(requestReportData.getDateFrom(),requestReportData.getDateTo())){
if (checkDate(requestReportData.getDateFrom(), requestReportData.getDateTo())) {
controller.getReport(requestReportData);
}
}
private boolean checkDate(String dateStart, String dateEnd) {
DateTimeFormat dateTimeFormat = DateTimeFormat.getFormat("yyyy-MM-dd");
Date dateStartD = null;
try {
logger.fine("DateTemp1: " + dateStart);
@ -92,7 +114,6 @@ public class FilterAreaPresenter extends PresenterWidget<FilterAreaPresenter.Fil
return false;
}
Date dateEndD = null;
try {
logger.fine("DateTemp2: " + dateEnd);

@ -1,6 +1,7 @@
package org.gcube.portlets.user.accountingdashboard.client.application.mainarea.filter;
import org.gcube.portlets.user.accountingdashboard.shared.data.RequestReportData;
import org.gcube.portlets.user.accountingdashboard.shared.options.TreeOptions;
import com.gwtplatform.mvp.client.UiHandlers;
@ -12,4 +13,6 @@ import com.gwtplatform.mvp.client.UiHandlers;
public interface FilterAreaUiHandlers extends UiHandlers {
public void getReport(RequestReportData requestReportData);
public void updateTreeOptions(TreeOptions treeOptions);
}

@ -14,11 +14,17 @@ 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.RequestReportData;
import org.gcube.portlets.user.accountingdashboard.shared.data.ScopeData;
import org.gcube.portlets.user.accountingdashboard.shared.env.EnvironmentData;
import org.gcube.portlets.user.accountingdashboard.shared.options.TreeOptions;
import com.github.gwtbootstrap.client.ui.ControlGroup;
import com.github.gwtbootstrap.client.ui.ListBox;
import com.github.gwtbootstrap.client.ui.RadioButton;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ChangeEvent;
import com.google.gwt.event.dom.client.ChangeHandler;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
import com.google.gwt.i18n.client.LocaleInfo;
@ -61,7 +67,16 @@ public class FilterAreaView extends ViewWithUiHandlers<FilterAreaPresenter>
@UiField(provided = true)
ListBox monthEnd;
@UiField(provided = false)
ControlGroup cgDetachedREs;
@UiField(provided = true)
RadioButton btnShowDetachedREs;
@UiField(provided = true)
RadioButton btnHideDetachedREs;
@UiField(provided = true)
CellTree scopeTree;
@ -161,6 +176,33 @@ public class FilterAreaView extends ViewWithUiHandlers<FilterAreaPresenter>
}
});
logger.log(Level.FINE, "Configuring buttons DetachedREs");
//cgDetachedREs=new ControlGroup();
btnShowDetachedREs=new RadioButton("radioDetachedREs");
btnShowDetachedREs.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
TreeOptions treeOptions=new TreeOptions(true);
getUiHandlers().updateTreeOptions(treeOptions);
}
});
btnHideDetachedREs=new RadioButton("radioDetachedREs");
btnHideDetachedREs.setValue(true);
btnHideDetachedREs.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
TreeOptions treeOptions=new TreeOptions(false);
getUiHandlers().updateTreeOptions(treeOptions);
}
});
logger.log(Level.FINE, "Configuring DataProvider");
dataProvider = new ListDataProvider<ScopeData>();
RequestReportEventHandler handler = new RequestReportEventHandler() {
@ -177,10 +219,38 @@ public class FilterAreaView extends ViewWithUiHandlers<FilterAreaPresenter>
ScopeTreeResources scopeTreeResources = GWT.create(ScopeTreeResources.class);
scopeTree = new CellTree(scopeTreeModel, null, scopeTreeResources);
scopeTree.setDefaultNodeSize(500);
logger.log(Level.FINE, "FilterAreaView init end");
}
@Override
public void setEnvironment(EnvironmentData environmentData) {
logger.log(Level.FINE, "displayScopeData()");
if(environmentData!=null&&environmentData.getAccountingServiceType()!=null){
switch(environmentData.getAccountingServiceType()){
case CurrentScope:
cgDetachedREs.setVisible(false);
break;
case Infrastructure:
cgDetachedREs.setVisible(true);
break;
case PortalContex:
cgDetachedREs.setVisible(false);
break;
default:
cgDetachedREs.setVisible(false);
break;
}
} else {
cgDetachedREs.setVisible(false);
}
}
@Override
public void displayScopeData(ScopeData scopeData) {
logger.log(Level.FINE, "displayScopeData()");
ArrayList<ScopeData> scopeDataList = new ArrayList<>();
scopeDataList.add(scopeData);
this.scopeData = scopeData;
@ -194,6 +264,7 @@ public class FilterAreaView extends ViewWithUiHandlers<FilterAreaPresenter>
}
private void requestReport() {
logger.log(Level.FINE, "requestReport()");
String[] months = LocaleInfo.getCurrentLocale().getDateTimeFormatInfo().monthsFull();
logger.log(Level.FINE, "Months: " + months.length);
@ -238,4 +309,6 @@ public class FilterAreaView extends ViewWithUiHandlers<FilterAreaPresenter>
}
}

@ -11,38 +11,47 @@
<g:HTMLPanel styleName="{res.uiDataCss.uiDataFiltersPanel}">
<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="104px" b:id="yearStart">
</b:ListBox>
<b:ListBox ui:field="monthStart" width="104px" 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="104px" b:id="yearEnd">
</b:ListBox>
<b:ListBox ui:field="monthEnd" width="104px" 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: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 styleName="{res.uiDataCss.uiDataFiltersControlGroup}">
<b:ControlLabel width="70px" for="fromPeriod">From:</b:ControlLabel>
<b:Controls styleName="{res.uiDataCss.uiDataFiltersControls}">
<b:ListBox ui:field="yearStart" width="104px" b:id="yearStart">
</b:ListBox>
<b:ListBox ui:field="monthStart" width="104px" b:id="monthStart">
</b:ListBox>
<b:HelpBlock>Select the start date</b:HelpBlock>
</b:Controls>
</b:ControlGroup>
<b:ControlGroup styleName="{res.uiDataCss.uiDataFiltersControlGroup}">
<b:ControlLabel width="70px" for="endPeriod">To:</b:ControlLabel>
<b:Controls styleName="{res.uiDataCss.uiDataFiltersControls}">
<b:ListBox ui:field="yearEnd" width="104px" b:id="yearEnd">
</b:ListBox>
<b:ListBox ui:field="monthEnd" width="104px" b:id="monthEnd">
</b:ListBox>
<b:HelpBlock>Select the end date</b:HelpBlock>
</b:Controls>
</b:ControlGroup>
<b:ControlGroup ui:field="cgDetachedREs" styleName="{res.uiDataCss.uiDataFiltersControlGroup}">
<b:ControlLabel width="70px" for="detachedREs">Detached:</b:ControlLabel>
<b:Controls styleName="{res.uiDataCss.uiDataFiltersControls}">
<b:RadioButton ui:field="btnShowDetachedREs" text="Show" />
<b:RadioButton ui:field="btnHideDetachedREs" text="Hide" />
<b:HelpBlock>Detached REs</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>
</g:HTMLPanel>
</ui:UiBinder>

@ -1,6 +1,7 @@
package org.gcube.portlets.user.accountingdashboard.client.application.mainarea.report;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.logging.Logger;
@ -11,9 +12,13 @@ import org.gcube.portlets.user.accountingdashboard.client.resources.AppResources
import org.gcube.portlets.user.accountingdashboard.shared.data.ReportData;
import org.gcube.portlets.user.accountingdashboard.shared.data.ReportElementData;
import com.github.gwtbootstrap.client.ui.NavHeader;
import com.github.gwtbootstrap.client.ui.NavLink;
import com.github.gwtbootstrap.client.ui.Tab;
import com.github.gwtbootstrap.client.ui.TabPanel;
import com.github.gwtbootstrap.client.ui.WellNavList;
import com.github.gwtbootstrap.client.ui.base.IconAnchor;
import com.github.gwtbootstrap.client.ui.constants.IconType;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.uibinder.client.UiBinder;
@ -87,10 +92,39 @@ public class ReportAreaView extends ViewWithUiHandlers<ReportAreaPresenter>
TabPanel tabPanel = new TabPanel();
tabPanel.addStyleName(resources.uiDataCss().uiDataReportTabPanel());
boolean first = true;
for (String category : categories.keySet()) {
ArrayList<String> sortedKeys =
new ArrayList<String>(categories.keySet());
Collections.sort(sortedKeys);
for (String category : sortedKeys) {
Tab tab = new Tab();
tab.setHeading(category);
HTMLPanel tabContent = new HTMLPanel("");
if(categories.get(category).size()>0){
WellNavList toc=new WellNavList();
toc.addStyleName(resources.uiDataCss().uiDataReportToc());
NavHeader navHeader=new NavHeader();
if(categories.get(category).size()>1){
navHeader.setText("Available Graphs");
}else {
navHeader.setText("Available Graph");
}
toc.add(navHeader);
for (Chart chart : categories.get(category)) {
ReportElementData reData=chart.getReportElementData();
StringBuilder navLinkText=new StringBuilder();
navLinkText.append(reData.getLabel());
//navLinkText.append("[");
//navLinkText.append(reData.getCategory());
//navLinkText.append("]");
NavLink navLink=new NavLink(navLinkText.toString(),"#"+chart.getWrapperName());
navLink.setIcon(IconType.BAR_CHART);
navLink.addStyleName(resources.uiDataCss().uiDataReportTocNavLink());
toc.add(navLink);
}
tabContent.add(toc);
}
for (Chart chart : categories.get(category)) {
tabContent.add(chart);
}

@ -14,6 +14,7 @@ import com.google.gwt.user.client.ui.HTMLPanel;
public class Chart extends HTMLPanel {
private String name;
private String wrapperName;
private ReportElementData reportElementData;
@ -30,9 +31,11 @@ public class Chart extends HTMLPanel {
+ "</ul>" + "</div>" + "<canvas id=" + name + " class='" + resources.uiDataCss().uiDataChartCanvas()
+ "'></canvas>");
this.name = name;
this.wrapperName="wrapper_"+name;
this.reportElementData = reportElementData;
this.getElement().setId(wrapperName);
this.addStyleName(resources.uiDataCss().uiDataChartWrapper());
addAttachHandler(new AttachEvent.Handler() {
@Override
@ -46,6 +49,18 @@ public class Chart extends HTMLPanel {
}
public String getName() {
return name;
}
public String getWrapperName() {
return wrapperName;
}
public ReportElementData getReportElementData() {
return reportElementData;
}
public void forceLayout() {
redrawChart();
}
@ -181,16 +196,19 @@ public class Chart extends HTMLPanel {
heading += "," + recordData.getX();
datasetRow += "," + recordData.getY();
}
csvContent += heading + "\r\n";
csvContent += datasetRow + "\r\n";
var csvData = heading + "\n" + datasetRow + "\n";
var csvDataEncoded = encodeURI(csvData);
csvContent += csvDataEncoded;
} else {
var datasetRow = seriesData.getLabel();
for (var j = 0; j < dataRowLen; j++) {
var recordData = dataRow[j];
datasetRow += "," + recordData.getY();
}
csvContent += datasetRow + "\r\n";
var csvData = datasetRow + "\n";
var csvDataEncoded = encodeURI(csvData);
csvContent += csvDataEncoded;
}
}
this.href = csvContent;
@ -317,8 +335,10 @@ public class Chart extends HTMLPanel {
datasets : datasetsArray
};
var label = [ reportElementData.getLabel(), ' [',
reportElementData.getCategory(), ']' ].filter(Boolean).join("");
//var label = [ reportElementData.getLabel(), ' [',
// reportElementData.getCategory(), ']' ].filter(Boolean).join("");
var label = reportElementData.getLabel();
var scalesType = @org.gcube.portlets.user.accountingdashboard.client.application.mainarea.report.chartjs.Chart::getScales(Lorg/gcube/portlets/user/accountingdashboard/client/application/mainarea/report/chartjs/Chart;)(this);
@ -352,7 +372,7 @@ public class Chart extends HTMLPanel {
},
zoom : {
enabled : true,
enabled : false,
mode : 'xy',
limits : {
max : 20,
@ -361,7 +381,7 @@ public class Chart extends HTMLPanel {
}
}
});
chart.update();
console.log('Canvas offset: left=' + canvas.offsetLeft + ', top='
+ canvas.offsetTop);

@ -28,6 +28,8 @@ public interface AppResources extends ClientBundle {
String uiDataFiltersTitle();
String uiDataFiltersFormPanel();
String uiDataFiltersControlGroup();
String uiDataFiltersControls();
@ -36,7 +38,11 @@ public interface AppResources extends ClientBundle {
String uiDataReportPanel();
String uiDataReportTabPanel();
String uiDataReportToc();
String uiDataReportTocNavLink();
String uiDataChartWrapper();
String uiDataChartCanvas();

Before

Width:  |  Height:  |  Size: 430 B

After

Width:  |  Height:  |  Size: 430 B

@ -40,8 +40,12 @@
margin: 0px !important;
}
.uiDataFiltersControlGroup {
margin-bottom: 10px;
}
.uiDataFiltersControls {
margin-left: 60px;
margin-left: 80px;
}
.uiDataExploreTree {
@ -63,10 +67,27 @@
max-width: 800px;
}
/* TOC WellNavList */
.uiDataReportToc {
padding: 8px 0px;
max-width: 650px;
}
/* TOC NavLink */
.uiDataReportTocNavLink {
color: rgb(59, 89, 152);
}
/* TOC NavLink href */
.uiDataReportTocNavLink a {
color: rgb(59, 89, 152);
}
/* Chart */
.uiDataChartWrapper {
width: 800px;
padding-top: 50px;
/*border: solid 1px;*/
}

@ -3,7 +3,9 @@ package org.gcube.portlets.user.accountingdashboard.client.rpc;
import org.gcube.portlets.user.accountingdashboard.shared.data.ReportData;
import org.gcube.portlets.user.accountingdashboard.shared.data.RequestReportData;
import org.gcube.portlets.user.accountingdashboard.shared.data.ScopeData;
import org.gcube.portlets.user.accountingdashboard.shared.env.EnvironmentData;
import org.gcube.portlets.user.accountingdashboard.shared.exception.ServiceException;
import org.gcube.portlets.user.accountingdashboard.shared.options.TreeOptions;
import org.gcube.portlets.user.accountingdashboard.shared.session.UserInfo;
import com.google.gwt.user.client.rpc.RemoteService;
@ -26,8 +28,10 @@ public interface AccountingDashboardService extends RemoteService {
*/
public UserInfo hello() throws ServiceException;
public ScopeData getScopeData() throws ServiceException;
public ScopeData getScopeData(TreeOptions treeOptions) throws ServiceException;
public ReportData getReport(RequestReportData requestReportdata) throws ServiceException;
public ReportData getReport(RequestReportData requestReportdata, TreeOptions treeOptions) throws ServiceException;
public EnvironmentData getEnvironment() throws ServiceException;
}

@ -6,6 +6,8 @@ package org.gcube.portlets.user.accountingdashboard.client.rpc;
import org.gcube.portlets.user.accountingdashboard.shared.data.ReportData;
import org.gcube.portlets.user.accountingdashboard.shared.data.RequestReportData;
import org.gcube.portlets.user.accountingdashboard.shared.data.ScopeData;
import org.gcube.portlets.user.accountingdashboard.shared.env.EnvironmentData;
import org.gcube.portlets.user.accountingdashboard.shared.options.TreeOptions;
import org.gcube.portlets.user.accountingdashboard.shared.session.UserInfo;
import com.google.gwt.core.client.GWT;
@ -24,8 +26,11 @@ public interface AccountingDashboardServiceAsync {
void hello(AsyncCallback<UserInfo> callback);
void getScopeData(AsyncCallback<ScopeData> callback);
void getEnvironment(AsyncCallback<EnvironmentData> callback);
void getScopeData(TreeOptions treeOptions, AsyncCallback<ScopeData> callback);
void getReport(RequestReportData requestReportdata, AsyncCallback<ReportData> asyncCallback);
void getReport(RequestReportData requestReportdata, TreeOptions treeOptions,
AsyncCallback<ReportData> asyncCallback);
}

@ -6,12 +6,14 @@ import org.gcube.common.scope.impl.ScopeBean;
import org.gcube.common.scope.impl.ScopeBean.Type;
import org.gcube.portlets.user.accountingdashboard.client.rpc.AccountingDashboardService;
import org.gcube.portlets.user.accountingdashboard.server.accounting.AccountingService;
import org.gcube.portlets.user.accountingdashboard.server.accounting.AccountingServiceType;
import org.gcube.portlets.user.accountingdashboard.server.util.ServiceCredentials;
import org.gcube.portlets.user.accountingdashboard.shared.data.ReportData;
import org.gcube.portlets.user.accountingdashboard.shared.data.RequestReportData;
import org.gcube.portlets.user.accountingdashboard.shared.data.ScopeData;
import org.gcube.portlets.user.accountingdashboard.shared.env.AccountingServiceType;
import org.gcube.portlets.user.accountingdashboard.shared.env.EnvironmentData;
import org.gcube.portlets.user.accountingdashboard.shared.exception.ServiceException;
import org.gcube.portlets.user.accountingdashboard.shared.options.TreeOptions;
import org.gcube.portlets.user.accountingdashboard.shared.session.UserInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -63,13 +65,30 @@ public class AccountingDashboardServiceImpl extends RemoteServiceServlet impleme
}
}
@Override
public EnvironmentData getEnvironment() throws ServiceException {
try {
logger.debug("AccountingDashboardServiceImpl getEnvironment()");
ServiceCredentials serviceCredentials = SessionUtil.getServiceCredentials(this.getThreadLocalRequest());
AccountingServiceType accountingServiceType=getAccountingContext(serviceCredentials.getScope());
EnvironmentData environmentData=new EnvironmentData(accountingServiceType);
return environmentData;
} catch (ServiceException e) {
logger.error(e.getLocalizedMessage(), e);
throw e;
} catch (Throwable e) {
logger.error("GetEnvironment(): " + e.getLocalizedMessage(), e);
throw new ServiceException("Error retrieving environment info: " + e.getLocalizedMessage(), e);
}
}
@Override
public ScopeData getScopeData() throws ServiceException {
public ScopeData getScopeData(TreeOptions treeOptions) throws ServiceException {
try {
logger.debug("AccountingDashboardServiceImpl getScopeData()");
ServiceCredentials serviceCredentials = SessionUtil.getServiceCredentials(this.getThreadLocalRequest());
AccountingService as = new AccountingService(getAccountingContext(serviceCredentials.getScope()));
AccountingService as = new AccountingService(getAccountingContext(serviceCredentials.getScope()),treeOptions);
ScopeData scopeData = as.getTree(this.getThreadLocalRequest());
return scopeData;
} catch (ServiceException e) {
@ -83,11 +102,11 @@ public class AccountingDashboardServiceImpl extends RemoteServiceServlet impleme
}
@Override
public ReportData getReport(RequestReportData requestReportData) throws ServiceException {
public ReportData getReport(RequestReportData requestReportData,TreeOptions treeOptions) throws ServiceException {
try {
logger.debug("AccountingDashboardServiceImpl getReport(): " + requestReportData);
ServiceCredentials serviceCredentials = SessionUtil.getServiceCredentials(this.getThreadLocalRequest());
AccountingService as = new AccountingService(getAccountingContext(serviceCredentials.getScope()));
AccountingService as = new AccountingService(getAccountingContext(serviceCredentials.getScope()), treeOptions);
ReportData reportData = as.getReport(this.getThreadLocalRequest(), requestReportData);
return reportData;
} catch (ServiceException e) {
@ -117,4 +136,6 @@ public class AccountingDashboardServiceImpl extends RemoteServiceServlet impleme
}
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save