Compare commits

...

11 Commits

9 changed files with 84 additions and 33 deletions

View File

@ -12,10 +12,17 @@
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<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="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@ -1,12 +1,15 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
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.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -1,5 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="rmp-common-library">
<wb-resource deploy-path="/" source-path="/src/main/java"/>
</wb-module>
</project-modules>

View File

@ -4,11 +4,27 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v2.9.0] - 2023-04-22
- Feature #25384: rmp-common-library ContextManager should read VO IDs as well
## [v2.8.6] - 2022-06-17
- Fixed pom for HL portal removal
## [v2.8.5] - 2022-03-17
- Fix for #21652 Some keys contain the context and some other (the VRE contextes) contains in the context name.
## [v2.8.4] - 2020-12-14
- Fix Bug #20337 infrastructure-monitor: the searchById doesn't work anymore
## [v2.8.3] - 2020-09-25
Ported to git and revised xqueries to support new Exists DB version
- Ported to git and revised xqueries to support new Exists DB version
## [v1.0.0] - 2010-10-15
First release, for other logs see distro/changelog.xml
- First release, for other logs see distro/changelog.xml

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,4 +1,4 @@
# gCube System - gCube Resource Management Portlet Common LIbrary
# gCube System - gCube Resource Management Common LIbrary
## Structure of the project
@ -32,16 +32,8 @@ This project is licensed under the EUPL V.1.1 License - see the [LICENSE.md](LIC
## About the gCube Framework
This software is part of the [gCubeFramework](https://www.gcube-system.org/ "gCubeFramework"): an
open-source software toolkit used for building and operating Hybrid Data
open-source software toolkit used for building and operating 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)

12
pom.xml
View File

@ -11,16 +11,16 @@
<groupId>org.gcube.portlets.admin</groupId>
<artifactId>rmp-common-library</artifactId>
<version>2.8.3</version>
<version>2.9.0</version>
<name>Resource Management Library</name>
<description>
gCube Resource Management Library is a common library containing shared code for Information System Operations
used by all the Portlets and Widgets partaking into the Monitoring and Management of the Infrasturcture.
</description>
<scm>
<connection>scm:git:https://code-repo.d4science.org/gCubeSystem/rmp-common-library.git</connection>
<developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/rmp-common-library.git</developerConnection>
<url>https://code-repo.d4science.org/gCubeSystem/rmp-common-library</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>
<properties>
<!-- Convenience property to set the GWT version -->
@ -38,7 +38,7 @@
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId>
<version>3.6.0</version>
<version>3.7.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@ -104,7 +104,7 @@
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<scope>provided</scope>
<version>1.4.9</version>
</dependency>
<dependency>
<groupId>junit</groupId>

View File

@ -1,7 +1,4 @@
declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry';
let $_res_type := '<RES_TYPE ISdefault ='' />'
let $_res_id := '<RES_ID/>'
let $res_type := if (empty($_res_type)) then $_res_id else concat($_res_type, '/', $_res_id )
let $res_docname := concat('/db/Profiles/',$res_type)
let $res := doc($res_docname)//Document/Data/ic:Profile/Resource
return $res
for $resource in collection('/db/Profiles/<RES_TYPE ISdefault ='' />')//Document/Data/ic:Profile/Resource
where $resource/ID/string() eq '<RES_ID/>'
return $resource

View File

@ -58,7 +58,7 @@ import org.xml.sax.SAXException;
public class ContextManager {
private static final Map<String, ScopeBean> CONTEXTS = new LinkedHashMap<String, ScopeBean>();
private static String confFile = null;
private static final String LOG_PREFIX = "[SCOPE-MGR]";
private static final String LOG_PREFIX = "[CONTEXT-MGR]";
private static final String GEN_RESOURCE_TYPE = "INFRASTRUCTURE";
private static final String GEN_RESOURCE_NAME = "VirtualOrganisation";
@ -104,7 +104,7 @@ public class ContextManager {
public static LinkedHashMap<String, ScopeBean> readContexts() throws Exception {
LinkedHashMap<String, ScopeBean> toReturn = new LinkedHashMap<String, ScopeBean>();
String scopeXML = readInfraVoFromIS();
System.out.println("**** readContexts()");
ServerConsole.info(LOG_PREFIX, "**** readContexts()");
Document scopeDocument = getDocumentGivenXML(scopeXML);
NodeList voElements = scopeDocument.getElementsByTagName("vo");
ServerConsole.debug("voElements="+ voElements.getLength());
@ -115,9 +115,9 @@ public class ContextManager {
toReturn.put(vo.toString(), vo);
try {
for (String vre : getVREFromVO(vo)) {
for (String vreName : getVREFromVO(vo)) {
// This operation overrides the vo map
toReturn.put(vre.toString(), new ScopeBean(vo.toString()+"/"+vre));
toReturn.put(new ScopeBean(vo.toString()+"/"+vreName).toString(), new ScopeBean(vo.toString()+"/"+vreName));
}
} catch (Exception e) {
ServerConsole.error("Exception raised while loading VREs for VO : " + vo, e);
@ -136,15 +136,21 @@ public class ContextManager {
public static LinkedHashMap<String, D4SEnvironment> readContextsWithUUIDs() throws Exception {
LinkedHashMap<String, D4SEnvironment> toReturn = new LinkedHashMap<String, D4SEnvironment>();
String scopeXML = readInfraVoFromIS();
System.out.println("**** readContexts()");
ServerConsole.info(LOG_PREFIX, "**** readContexts()");
Document scopeDocument = getDocumentGivenXML(scopeXML);
NodeList voElements = scopeDocument.getElementsByTagName("vo");
ServerConsole.debug("voElements="+ voElements.getLength());
for (int i = 0; i < voElements.getLength(); i++) {
NodeList voDetails = voElements.item(i).getChildNodes();
String voString = voDetails.item(2).getFirstChild().getNodeValue();
String voID = "non-existing-vo-id";
try {
voID = voDetails.item(3).getFirstChild().getNodeValue();
} catch (Exception e) {
ServerConsole.error("Exception raised while trying reading VO ID from GenericResource having name: " + GEN_RESOURCE_NAME, e);
}
ScopeBean vo = new ScopeBean(voString);
D4SEnvironment voWrapper = new D4SEnvironment(vo, "uuid-not-exisiting-for-vos");
D4SEnvironment voWrapper = new D4SEnvironment(vo, voID);
toReturn.put(vo.toString(), voWrapper);
try {
for (GenericResource resVRE : getVREResourcesFromVO(vo)) {