Merge pull request 'feature/21013' (#1) from feature/21013 into master

Reviewed-on: #1
This commit is contained in:
Giancarlo Panichi 2021-04-16 11:22:00 +02:00
commit 5c219fd246
12 changed files with 226 additions and 195 deletions

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <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> <attributes>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </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> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
@ -45,5 +45,5 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </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> </classpath>

View File

@ -1,9 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> <?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="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> <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/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> <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="java-output-path" value="/accounting-manager/target/accounting-manager-1.3.0-SNAPSHOT/WEB-INF/classes"/>
<property name="context-root" value="accounting-manager"/> <property name="context-root" value="accounting-manager"/>
</wb-module> </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 # 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 (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 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). extent such use is covered by a right of the copyright holder of the Work).
@ -12,7 +13,7 @@ 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 (as defined below) has placed the following notice immediately following the
copyright notice for the Original Work: 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. or has expressed by any other mean his willingness to license under the EUPL.
@ -291,13 +292,12 @@ This licence shall be governed by the Belgian law if:
- or registered office inside a European Union country. - 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 - 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 Infrastructures enabling the dynamic deployment of Virtual Research Environments
by favouring the realisation of reuse oriented policies. 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 projects leading to this software have received funding from a series of European Union programmes see [FUNDING.md](FUNDING.md)
- 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);

View File

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

View File

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

13
pom.xml
View File

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

View File

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