feature/21013 #1

Merged
giancarlo.panichi merged 7 commits from feature/21013 into master 2021-04-16 11:22:00 +02:00
12 changed files with 226 additions and 195 deletions

View File

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

View File

@ -1,9 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="accounting-manager-1.12.2-SNAPSHOT">
<wb-module deploy-name="accounting-manager-1.13.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"/>
<dependent-module archiveName="accounting-manager-theme-1.3.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/accounting-manager-theme/accounting-manager-theme">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/accounting-manager/target/accounting-manager-1.3.0-SNAPSHOT/WEB-INF/classes"/>
<property name="context-root" value="accounting-manager"/>
</wb-module>

133
CHANGELOG.md Normal file
View File

@ -0,0 +1,133 @@
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
# Changelog for "dataminer-manager"
## [v1-13-0-SNAPSHOT] - 2021-03-23
### Features
- Migrate accounting-manager to postgresql persistence [#21013]
## [v1-12-0] - 2019-05-02
### Features
- Added autocomplete combo scope and fixed scope list view width
## [v1-11-0] - 2018-12-28
### Features
- Added scope selection [#10188]
## [v1-10-0] - 2018-10-01
### Features
- Updated to StorageHub [#12474]
## [v1-9-1] - 2018-04-11
### Features
- Updated log level to debug [#11259]
## [v1-9-0] - 2017-11-20
### Features
- Updated to support Operation Count as default in all charts
## [v1-8-0] - 2017-10-01
### Features
- Updated to new version of accounting client library
## [v1-7-0] - 2017-06-12
### Features
- Added Spaces chart [#8397]
## [v1-6-0] - 2017-02-28
### Features
- Fixed download in case of multitab on different scopes
## [v1-5-0] - 2016-12-01
### Features
- Added Context Chart
- Added Cache
- Updated to PortalContext
## [v1-4-0] - 2016-10-01
### Features
- Updated to AUTH2.0
- Added Job
- Added configuration by generic resource
## [v1-3-0] - 2016-07-15
### Features
- Added CSV download [Ticket #4041]
- Added Show Others option
- Updated to Liferay 6.2
## [v1-2-0] - 2016-05-01
### Features
- Added Top N Chart[#2251]
- Fixed back button behavior[#3251]
## [v1-1-0] - 2016-01-31
### Features
- Added to Storage Accounting more formats for DataVolume axis [#1831]
- Fixed on Storage Accounting the popup validation on filters [#1832]
- Fixed library dependencies
## [v1-0-0] - 2015-10-15
### Features
- First Release

26
FUNDING.md Normal file
View File

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

View File

@ -1,9 +1,10 @@
#European Union Public Licence V.1.1
##*EUPL © the European Community 2007*
# European Union Public Licence V. 1.1
This **European Union Public Licence** (the **“EUPL”**) applies to the Work or Software
EUPL © the European Community 2007
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

View File

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

View File

@ -1,19 +1,23 @@
<ReleaseNotes>
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-13-0"
date="2021-03-23">
<Change>Migrate accounting-manager to postgresql persistence [#21013]</Change>
</Changeset>
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-12-0"
date="2019-05-02">
<Change>Added autocomplete combo scope and fixed scope list view width</Change>
</Changeset>
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-11-0"
date="2018-12-28">
<Change>Added scope selection [Ticket #10188]</Change>
<Change>Added scope selection [#10188]</Change>
</Changeset>
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-10-0"
date="2018-10-01">
<Change>Updated to StorageHub [Ticket #12474]</Change>
<Change>Updated to StorageHub [#12474]</Change>
</Changeset>
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-9-1"
date="2018-04-11">
<Change>Updated log level to debug [Ticket #11259]</Change>
<Change>Updated log level to debug [#11259]</Change>
</Changeset>
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-9-0"
date="2017-11-20">
@ -26,7 +30,7 @@
</Changeset>
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-7-0"
date="2017-06-12">
<Change>Added Spaces chart [Ticket #8397]</Change>
<Change>Added Spaces chart [#8397]</Change>
</Changeset>
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-6-0"
date="2017-02-28">
@ -53,16 +57,16 @@
</Changeset>
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-2-0"
date="2016-05-01">
<Change>Added Top N Chart[Ticket #2251]</Change>
<Change>Fixed back button behavior[Ticket #3251]</Change>
<Change>Added Top N Chart[#2251]</Change>
<Change>Fixed back button behavior[#3251]</Change>
</Changeset>
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-1-0"
date="2016-01-31">
<Change>Added to Storage Accounting more formats for DataVolume axis
[Ticket #1831]
[#1831]
</Change>
<Change>Fixed on Storage Accounting the popup validation on filters
[Ticket #1832]
[#1832]
</Change>
<Change>Fixed library dependencies</Change>
</Changeset>

View File

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

15
pom.xml
View File

@ -15,7 +15,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.portlets.admin</groupId>
<artifactId>accounting-manager</artifactId>
<version>1.12.2-SNAPSHOT</version>
<version>1.13.0-SNAPSHOT</version>
<packaging>war</packaging>
@ -108,7 +108,7 @@
<dependency>
<groupId>org.gcube.accounting</groupId>
<artifactId>accounting-lib</artifactId>
<version>[2.0.0,3.0.0-SNAPSHOT)</version>
<version>[4.0.0,5.0.0-SNAPSHOT)</version>
</dependency>
</dependencies>
@ -246,7 +246,7 @@
<dependency>
<groupId>org.gcube.accounting</groupId>
<artifactId>accounting-analytics</artifactId>
<version>[2.0.0,3.0.0-SNAPSHOT)</version>
<version>[3.0.0-SNAPSHOT,4.0.0-SNAPSHOT)</version>
</dependency>
<!-- Document Store Lib -->
@ -257,11 +257,12 @@
</dependency>
<!-- Accounting Persistence-CouchBase -->
<!-- Accounting Persistence -->
<dependency>
<groupId>org.gcube.accounting</groupId>
<artifactId>accounting-analytics-persistence-couchbase</artifactId>
<version>[1.0.0,2.0.0-SNAPSHOT)</version>
<artifactId>accounting-analytics-persistence-postgresql</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<scope>runtime</scope>
</dependency>
<!-- Apache Commons CSV -->
@ -400,7 +401,7 @@
</configuration>
</plugin>
<!-- Maven Surefire Plugin for Test -->
<!-- Maven Surefire Plugin for Test -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>

View File

@ -12,14 +12,12 @@ import org.slf4j.LoggerFactory;
/**
*
* @author Giancarlo Panichi
* @author Giancarlo Panichi
*
*
*/
public class AccountingCommandGetSpaces implements
AccountingCommand<Spaces> {
private static final Logger logger = LoggerFactory
.getLogger(AccountingCommandGetSpaces.class);
public class AccountingCommandGetSpaces implements AccountingCommand<Spaces> {
private static final Logger logger = LoggerFactory.getLogger(AccountingCommandGetSpaces.class);
public AccountingCommandGetSpaces() {
}
@ -29,21 +27,20 @@ public class AccountingCommandGetSpaces implements
try {
logger.debug("getSpaces()");
SortedSet<String> keys = null;
AccountingPersistenceQuery apq = AccountingPersistenceQueryFactory
.getInstance();
AccountingPersistenceQuery apq = AccountingPersistenceQueryFactory.getInstance();
keys = apq.getSpaceProvidersIds();
logger.debug("AccountingPersistenceQuery.getSpaces: " + keys);
if (keys == null || keys.isEmpty()) {
return null;
}
ArrayList<String> spaceList = new ArrayList<>();
for (String key : keys) {
if (key != null && !key.isEmpty()) {
spaceList.add(key);
if (keys == null || keys.isEmpty()) {
logger.error("Spaces have not keys: {}", keys);
} else {
for (String key : keys) {
if (key != null && !key.isEmpty()) {
spaceList.add(key);
}
}
}
Spaces categories = new Spaces(spaceList);
@ -52,9 +49,7 @@ public class AccountingCommandGetSpaces implements
return categories;
} catch (Throwable e) {
logger.error("Error in AccountingCommandGetSpaces(): "
+ e.getLocalizedMessage());
e.printStackTrace();
logger.error("Error in AccountingCommandGetSpaces(): {}", e.getLocalizedMessage(), e);
throw new ServiceException("No spaces available!");
}

View File

@ -1,50 +0,0 @@
/**
*
*/
package org.gcube.portlets.admin.accountingmanager;
import junit.framework.TestCase;
import org.gcube.portlets.admin.accountingmanager.server.is.EnableTabsJAXB;
import org.gcube.portlets.admin.accountingmanager.server.is.InformationSystemUtils;
import org.gcube.portlets.admin.accountingmanager.shared.Constants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Giancarlo Panichi
*
*
*/
public class TestAccountingMananger extends TestCase {
private static Logger logger = LoggerFactory
.getLogger(TestAccountingMananger.class);
public void testAccountingManagerResource() {
if (Constants.TEST_ENABLE) {
logger.debug("Test Enabled");
try {
logger.debug("Scope: " + Constants.DEFAULT_SCOPE);
EnableTabsJAXB enableTabs = InformationSystemUtils
.retrieveEnableTab(Constants.DEFAULT_SCOPE);
logger.debug("EnableTabs: " + enableTabs);
assertTrue(true);
} catch (Exception e) {
assertTrue("Error searching the resource!", false);
e.printStackTrace();
}
} else {
logger.debug("Test Disabled");
assertTrue(true);
}
}
}

View File

@ -1,74 +0,0 @@
/**
*
*/
package org.gcube.portlets.admin.accountingmanager;
import junit.framework.TestCase;
import org.gcube.portlets.admin.accountingmanager.server.amservice.cache.AccountingCache;
import org.gcube.portlets.admin.accountingmanager.shared.Constants;
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Giancarlo Panichi
*
*
*/
public class TestAccountingManangerCache extends TestCase {
private static Logger logger = LoggerFactory
.getLogger(TestAccountingManangerCache.class);
public void testAccountingManagerCache() {
if (Constants.TEST_ENABLE) {
logger.debug("Test Enabled");
try {
AccountingCache accountingCache = new AccountingCache();
SeriesResponse s = new SeriesResponse();
for (int i = 0; i < 1000000; i++) {
accountingCache.putSeries("key" + i, s);
}
Thread.sleep(180000);
accountingCache.finalize();
assertTrue(true);
} catch (Throwable e) {
logger.error(e.getLocalizedMessage(), e);
assertTrue("Error in cache!", false);
}
} else {
logger.debug("Test Disabled");
assertTrue(true);
}
}
public void testAccountingManagerCacheRemoveAll() {
if (Constants.TEST_ENABLE) {
logger.debug("Test Enabled");
try {
AccountingCache accountingCache = new AccountingCache();
accountingCache.finalize();
assertTrue(true);
} catch (Throwable e) {
logger.error(e.getLocalizedMessage(), e);
assertTrue("Error in cache!", false);
}
} else {
logger.debug("Test Disabled");
assertTrue(true);
}
}
}