Compare commits

...

19 Commits

Author SHA1 Message Date
Massimiliano Assante 255af95d61 Feature #25384ContextManager should read VO IDs as well 2024-04-22 16:34:17 +02:00
Massimiliano Assante cc1db56298 updated bom 2024-04-22 15:38:07 +02:00
Massimiliano Assante c48c8bd783 ContextManager should read VO IDs as well 2023-07-14 15:19:29 +02:00
Massimiliano Assante eb617ee395 ready to release 2022-06-16 16:24:09 +02:00
Massimiliano Assante d810ef1b62 - Fixed pom for HL portal removal 2022-06-16 16:22:34 +02:00
Massimiliano Assante 14652a3b2b ready to release 2022-03-17 16:27:53 +01:00
Massimiliano Assante 85afef71be Fix for #21652 Some keys contain the context and some other not 2022-03-17 16:26:38 +01:00
Massimiliano Assante df1b051233 removed -SNAPSHOT from Changelog 2021-01-21 09:28:54 +01:00
Massimiliano Assante 222111ffea added funding 2020-12-14 18:30:35 +01:00
Massimiliano Assante 7305c9b15b added FUNDING, remove -snapshot for release 2020-12-14 18:30:19 +01:00
Massimiliano Assante 097e2aebdb Fix Bug #20337 the searchById doesn't work anymore 2020-12-14 18:28:48 +01:00
Massimiliano Assante f47ec96983 REMOVED -SNAPSHOT FROM BOM 2020-10-19 13:27:46 +02:00
Massimiliano Assante ef2d9b23b5 updated wrong chagelog 2020-10-19 11:21:25 +02:00
Massimiliano Assante 0244ebd82d ready for release 2020-09-25 14:38:35 +02:00
Massimiliano Assante 35c85d4ef7 pom updated for git 2020-09-25 12:48:04 +02:00
Massimiliano Assante 89de73c612 pom updated for git 2020-09-25 12:47:15 +02:00
Massimiliano Assante d161f2a09b added changelog 2020-09-25 12:44:08 +02:00
Massimiliano Assante 02fa846148 updated queries from SVN Branch part 2 2020-09-25 12:40:45 +02:00
Massimiliano Assante 628ba14f41 updated queries (SVN branch) as the porting to git ported the old ones 2020-09-25 12:39:08 +02:00
25 changed files with 215 additions and 171 deletions

View File

@ -6,22 +6,23 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/> <attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </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"/> <classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>

View File

@ -1,12 +1,15 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 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.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 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.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 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 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"> <?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="rmp-common-library"> <wb-module deploy-name="rmp-common-library">
<wb-resource deploy-path="/" source-path="/src/main/java"/> <wb-resource deploy-path="/" source-path="/src/main/java"/>
</wb-module> </wb-module>
</project-modules> </project-modules>

30
CHANGELOG.md Normal file
View File

@ -0,0 +1,30 @@
# Changelog for workspace
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
## [v1.0.0] - 2010-10-15
- 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 ## 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 ## About the gCube Framework
This software is part of the [gCubeFramework](https://www.gcube-system.org/ "gCubeFramework"): an 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 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);

65
pom.xml
View File

@ -11,16 +11,16 @@
<groupId>org.gcube.portlets.admin</groupId> <groupId>org.gcube.portlets.admin</groupId>
<artifactId>rmp-common-library</artifactId> <artifactId>rmp-common-library</artifactId>
<version>2.8.2-SNAPSHOT</version> <version>2.9.0</version>
<name>Resource Management Library</name> <name>Resource Management Library</name>
<description> <description>
gCube Resource Management Library is a common library containing shared code for Information System Operations 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. used by all the Portlets and Widgets partaking into the Monitoring and Management of the Infrasturcture.
</description> </description>
<scm> <scm>
<connection>scm:git:https://code-repo.d4science.org/gCubeSystem/rmp-common-library.git</connection> <connection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</connection>
<developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/rmp-common-library.git</developerConnection> <developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</developerConnection>
<url>https://code-repo.d4science.org/gCubeSystem/rmp-common-library</url> <url>https://code-repo.d4science.org/gCubeSystem/${project.artifactId}</url>
</scm> </scm>
<properties> <properties>
<!-- Convenience property to set the GWT version --> <!-- Convenience property to set the GWT version -->
@ -28,7 +28,7 @@
<distroDirectory>distro</distroDirectory> <distroDirectory>distro</distroDirectory>
<!-- GWT needs at least java 1.6 --> <!-- GWT needs at least java 1.6 -->
<maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target> <maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
@ -38,7 +38,7 @@
<dependency> <dependency>
<groupId>org.gcube.distribution</groupId> <groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId> <artifactId>maven-portal-bom</artifactId>
<version>LATEST</version> <version>3.7.0</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
@ -104,7 +104,7 @@
<dependency> <dependency>
<groupId>com.thoughtworks.xstream</groupId> <groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId> <artifactId>xstream</artifactId>
<scope>provided</scope> <version>1.4.9</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
@ -126,15 +126,14 @@
<plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<configuration> <configuration>
<source>1.7</source> <source>${maven.compiler.source}</source>
<target>1.7</target> <target>${maven.compiler.target}</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>2.2</version>
<executions> <executions>
<execution> <execution>
<goals> <goals>
@ -143,61 +142,27 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration> <configuration>
<skipTests>true</skipTests> <skipTests>true</skipTests>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>copy-profile</id>
<phase>install</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>target</outputDirectory>
<resources>
<resource>
<directory>${distroDirectory}</directory>
<filtering>true</filtering>
<includes>
<include>profile.xml</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration> <configuration>
<descriptors> <additionalparam>-Xdoclint:none</additionalparam>
<descriptor>${distroDirectory}/descriptor.xml</descriptor> <additionalJOption>-Xdoclint:none</additionalJOption>
</descriptors>
<archive>
<manifest>
<mainClass>fully.qualified.MainClass</mainClass>
</manifest>
</archive>
</configuration> </configuration>
<version>3.1.0</version>
<executions> <executions>
<execution> <execution>
<id>servicearchive</id> <id>generate-doc</id>
<phase>install</phase> <phase>install</phase>
<goals> <goals>
<goal>single</goal> <goal>jar</goal>
</goals> </goals>
</execution> </execution>
</executions> </executions>

View File

@ -4,25 +4,26 @@
# RES_TYPE the main type of the resource # RES_TYPE the main type of the resource
# This query is used by forms # This query is used by forms
for $profiles in collection('/db/Profiles/<RES_TYPE ISdefault ='GHN' />')//Resource declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry';
let $ghn-name := $profiles//Resource/Profile/GHN/@UniqueID/string() for $profiles in collection('/db/Profiles/<RES_TYPE ISdefault ='GHN' />')//Document/Data/ic:Profile/Resource
let $gcf-version := $profiles//Resource/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'gCF-version']/Value/text() let $ghn-name := $profiles/Profile/GHN/@UniqueID/string()
let $ghn-version := $profiles//Resource/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'GHN-distribution-version']/Value/text() let $gcf-version := $profiles/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'gCF-version']/Value/text()
let $scopes := string-join( $profiles//Resource/Scopes//Scope/text(), ';') let $ghn-version := $profiles/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'GHN-distribution-version']/Value/text()
let $scopes := string-join( $profiles/Scopes//Scope/text(), ';')
let $subtype := let $subtype :=
if ($profiles//Resource/Type eq "Service") if ($profiles/Type eq "Service")
then $profiles//Resource/Profile/Class/text() then $profiles/Profile/Class/text()
else if ($profiles//Resource/Type eq "RunningInstance") else if ($profiles/Type eq "RunningInstance")
then $profiles//Resource/Profile/ServiceClass/text() then $profiles/Profile/ServiceClass/text()
else if ($profiles//Resource/Type eq "GenericResource") else if ($profiles/Type eq "GenericResource")
then $profiles//Resource/Profile/SecondaryType/text() then $profiles/Profile/SecondaryType/text()
else if ($profiles//Resource/Type eq "GHN") else if ($profiles/Type eq "GHN")
then $profiles//Resource/Profile/Site/Domain/text() then $profiles/Profile/Site/Domain/text()
else if ($profiles//Resource/Type eq "MetadataCollection") else if ($profiles/Type eq "MetadataCollection")
then $profiles//Resource/Profile/MetadataFormat/Name/text() then $profiles/Profile/MetadataFormat/Name/text()
else if ($profiles//Resource/Type eq "Collection" and ($profiles//Resource/Profile/IsUserCollection/string(@value) eq 'true')) else if ($profiles/Type eq "Collection" and ($profiles/Profile/IsUserCollection/string(@value) eq 'true'))
then "User" then "User"
else if ($profiles//Resource/Type eq "Collection" and ($profiles//Resource/Profile/IsUserCollection/string(@value) eq 'false')) else if ($profiles/Type eq "Collection" and ($profiles/Profile/IsUserCollection/string(@value) eq 'false'))
then "System" then "System"
else "" else ""
return return

View File

@ -4,25 +4,26 @@
# RES_TYPE the main type of the resource # RES_TYPE the main type of the resource
# This query is used by forms # This query is used by forms
for $profiles in collection('/db/Profiles/<RES_TYPE ISdefault ='GHN' />')//Resource declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry';
let $ghn-name := $profiles//Resource/Profile/GHN/@UniqueID/string() for $profiles in collection('/db/Profiles/<RES_TYPE ISdefault ='GHN' />'))//Document/Data/ic:Profile/Resource
let $gcf-version := $profiles//Resource/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'gCF-version']/Value/text() let $ghn-name := $profiles/Profile/GHN/@UniqueID/string()
let $ghn-version := $profiles//Resource/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'GHN-distribution-version']/Value/text() let $gcf-version := $profiles/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'gCF-version']/Value/text()
let $scopes := string-join( $profiles//Resource/Scopes//Scope/text(), ';') let $ghn-version := $profiles/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'GHN-distribution-version']/Value/text()
let $scopes := string-join( $profiles/Scopes//Scope/text(), ';')
let $subtype := let $subtype :=
if ($profiles//Resource/Type eq "Service") if ($profiles/Type eq "Service")
then $profiles//Resource/Profile/Class/text() then $profiles/Profile/Class/text()
else if ($profiles//Resource/Type eq "RunningInstance") else if ($profiles/Type eq "RunningInstance")
then $profiles//Resource/Profile/ServiceClass/text() then $profiles/Profile/ServiceClass/text()
else if ($profiles//Resource/Type eq "GenericResource") else if ($profiles/Type eq "GenericResource")
then $profiles//Resource/Profile/SecondaryType/text() then $profiles/Profile/SecondaryType/text()
else if ($profiles//Resource/Type eq "GHN") else if ($profiles/Type eq "GHN")
then $profiles//Resource/Profile/Site/Domain/text() then $profiles/Profile/Site/Domain/text()
else if ($profiles//Resource/Type eq "MetadataCollection") else if ($profiles/Type eq "MetadataCollection")
then $profiles//Resource/Profile/MetadataFormat/Name/text() then $profiles/Profile/MetadataFormat/Name/text()
else if ($profiles//Resource/Type eq "Collection" and ($profiles//Resource/Profile/IsUserCollection/string(@value) eq 'true')) else if ($profiles/Type eq "Collection" and ($profiles/Profile/IsUserCollection/string(@value) eq 'true'))
then "User" then "User"
else if ($profiles//Resource/Type eq "Collection" and ($profiles//Resource/Profile/IsUserCollection/string(@value) eq 'false')) else if ($profiles/Type eq "Collection" and ($profiles/Profile/IsUserCollection/string(@value) eq 'false'))
then "System" then "System"
else "" else ""
where $subtype eq '<RES_SUBTYPE ISdefault='isti.cnr.it'/>' where $subtype eq '<RES_SUBTYPE ISdefault='isti.cnr.it'/>'

View File

@ -1,21 +1,22 @@
declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry';
let $type := '<RES_TYPE ISdefault ='MetadataCollection'/>' let $type := '<RES_TYPE ISdefault ='MetadataCollection'/>'
let $subtypes := let $subtypes :=
for $_profiles in collection('/db/Profiles/<RES_TYPE ISdefault ='MetadataCollection'/>')//Resource for $_profiles in collection('/db/Profiles/<RES_TYPE ISdefault ='MetadataCollection'/>')//Document/Data/ic:Profile/Resource
let $elem := if ($type eq "Service") let $elem := if ($type eq "Service")
then $_profiles//Resource/Profile/Class then $_profiles/Profile/Class
else if ($type eq "RunningInstance") else if ($type eq "RunningInstance")
then $_profiles//Resource/Profile/ServiceClass then $_profiles/Profile/ServiceClass
else if ($type eq "GenericResource") else if ($type eq "GenericResource")
then $_profiles//Resource/Profile/SecondaryType then $_profiles/Profile/SecondaryType
else if ($type eq "GHN") else if ($type eq "GHN")
then $_profiles//Resource/Profile/Site/Domain then $_profiles/Profile/Site/Domain
else if ($type eq "MetadataCollection") else if ($type eq "MetadataCollection")
then $_profiles//Resource/Profile/MetadataFormat/Name then $_profiles/Profile/MetadataFormat/Name
else if ($type eq "RuntimeResource") else if ($type eq "RuntimeResource")
then $_profiles//Resource/Profile/Category then $_profiles/Profile/Category
else if ($type eq "Collection" and ($_profiles//Resource/Profile/IsUserCollection/string(@value) eq 'true')) else if ($type eq "Collection" and ($_profiles/Profile/IsUserCollection/string(@value) eq 'true'))
then "User" then "User"
else if ($type eq "Collection" and ($_profiles//Resource/Profile/IsUserCollection/string(@value) eq 'false')) else if ($type eq "Collection" and ($_profiles/Profile/IsUserCollection/string(@value) eq 'false'))
then "System" then "System"
else "" else ""
return $elem return $elem

View File

@ -12,7 +12,9 @@
<Status>ready</Status> <Status>ready</Status>
</Resource> </Resource>
--> -->
for $ris in collection('/db/Profiles/RunningInstance')//Resource
where $ris//Resource/Profile/GHN/@UniqueID/string() eq '<RES_ID/>' declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry';
for $ris in collection('/db/Profiles/RunningInstance')//Document/Data/ic:Profile/Resource
where $ris/Profile/GHN/@UniqueID/string() eq '<RES_ID/>'
return return
<RESOURCE/> <RESOURCE/>

View File

@ -2,7 +2,7 @@
{$ris/ID} {$ris/ID}
{$ris/Profile/ServiceName} {$ris/Profile/ServiceName}
{$ris/Profile/ServiceClass} {$ris/Profile/ServiceClass}
<ServiceVersion>{$ris//Resource/@version/string()}</ServiceVersion> <ServiceVersion>{$ris/@version/string()}</ServiceVersion>
<MainVersion>{$ris/Profile/Version/text()}</MainVersion> <MainVersion>{$ris/Profile/Version/text()}</MainVersion>
<Status>{$ris/Profile/DeploymentData/Status/text()}</Status> <Status>{$ris/Profile/DeploymentData/Status/text()}</Status>
</Resource> </Resource>

View File

@ -1,7 +1,7 @@
<Resources> <Resources>
<Resource> <Resource>
<Key>ID</Key> <Key>ID</Key>
<Value>{$ri//Resource/ID/string()}</Value> <Value>{$ri/ID/string()}</Value>
</Resource> </Resource>
<Resource> <Resource>
<Key>ServiceStatus</Key> <Key>ServiceStatus</Key>

View File

@ -1,11 +1,18 @@
<!-- <!--
Notice: the <Resources> node must be removed in using the resource grid factory. Notice: the <Resources> node must be removed in using the resource grid factory.
--> -->
let $profiles := collection('/db/Profiles/<RES_TYPE ISdefault ='RunningInstance'/>')//Resource[ID/string() eq '<RES_ID/>'] declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry';
let $relatedghn := collection('/db/Profiles/GHN')//Resource[ID/string() eq $profiles/Profile/GHN/@UniqueID/string()]
let $ghn-name := if (empty($relatedghn/Profile/GHNDescription/Name/string())) let $_ri_type := '<RES_TYPE ISdefault ='RunningInstance'/>'
then $profiles/Profile/GHN/@UniqueID/string() let $_ri_id := '<RES_ID/>'
else $relatedghn/Profile/GHNDescription/Name/string()
for $ri in $profiles let $ri_docname := concat('/db/Profiles/RunningInstance/',$_ri_id)
let $ri := doc($ri_docname)//Document/Data/ic:Profile/Resource
let $ghn-id := $ri/Profile/GHN/@UniqueID/string()
let $ghn_docname := concat('/db/Profiles/GHN/',$ri/Profile/GHN/@UniqueID/string())
let $relatedghn := doc($ghn_docname)//Document/Data/ic:Profile/Resource
let $_ghn-name := $relatedghn/Profile/GHNDescription/Name/string()
let $ghn-name := if (empty($_ghn-name)) then $ghn-id else $_ghn-name
return return
<RESOURCE/> <RESOURCE/>

View File

@ -2,15 +2,17 @@
PARAMETS: PARAMETS:
RES_ID the ID of the Service RES_ID the ID of the Service
--> -->
let $service := collection('/db/Profiles/Service')//Resource//Resource[ID/text() eq '<RES_ID/>'] -->
declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry';
let $service := collection('/db/Profiles/Service')//Document/Data/ic:Profile/Resource[ID/text() eq '<RES_ID/>']
let $ServiceClass := $service/Profile/Class let $ServiceClass := $service/Profile/Class
let $ServiceName := $service/Profile/Name let $ServiceName := $service/Profile/Name
let $ServiceVersion := $service/Profile/Version let $ServiceVersion := $service/Profile/Version
let $riloop := collection('/db/Profiles/RunningInstance')//Resource[Profile/ServiceClass/string() eq $ServiceClass and Profile/ServiceName/string() eq $ServiceName] let $riloop := collection('/db/Profiles/RunningInstance')//Document/Data/ic:Profile/Resource[Profile/ServiceClass/string() eq $ServiceClass and Profile/ServiceName/string() eq $ServiceName]
let $relatedris := let $relatedris :=
for $ri in $riloop for $ri in $riloop
let $ghn-id := $ri/Profile/GHN/@UniqueID/string() let $ghn-id := $ri/Profile/GHN/@UniqueID/string()
let $ghn := collection('/db/Profiles/GHN')//Resource[ID/string() eq $ghn-id] let $ghn := doc(concat('/db/Profiles/GHN',$ghn-id))//Document/Data/ic:Profile/Resource
<!-- and $ri//Profile/Version/string() eq $ServiceVersion --> <!-- and $ri//Profile/Version/string() eq $ServiceVersion -->
return return
<RESOURCE/> <RESOURCE/>

View File

@ -1,7 +1,8 @@
for $profiles in collection('/db/Profiles/GenericResource')//Resource, $wsresource in collection('/db/Properties')//Document declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry';
for $profiles in collection('/db/Profiles/GenericResource')//Document/Data/ic:Profile/Resource, $wsresource in collection('/db/Properties')//Document
let $scopes := string-join( $profiles/Scopes//Scope/text(), ';') let $scopes := string-join( $profiles/Scopes//Scope/text(), ';')
let $subtype := $profiles//Resource/Profile/SecondaryType/text() let $subtype := $profiles//Resource/Profile/SecondaryType/text()
where $subtype = "DataSource" and $profiles//Resource/ID eq $wsresource/SourceKey and $wsresource/Data//child::*[local-name()='ServiceName']/string() eq 'tree-manager-service' where $subtype = "DataSource" and $profiles/ID eq $wsresource/SourceKey and $wsresource/Data//child::*[local-name()='ServiceName']/string() eq 'tree-manager-service'
<RES_SUBTYPE ISdefault =''/> <RES_SUBTYPE ISdefault =''/>
return return
<RESOURCE/> <RESOURCE/>

View File

@ -1,8 +1,9 @@
for $profiles in collection('/db/Profiles/GHN')//Resource declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry';
let $gcf-version := $profiles//Resource/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'gCF-version']/Value/text() | $profiles//Resource/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'SmartGears']/Value/text() for $profiles in collection('/db/Profiles/GHN')//Document/Data/ic:Profile/Resource
let $ghn-version := $profiles//Resource/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'GHN-distribution-version']/Value/text() | $profiles//Resource/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'SmartGearsDistribution']/Value/text() let $gcf-version := $profiles/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'gCF-version']/Value/text() | $profiles/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'SmartGears']/Value/text()
let $ghn-version := $profiles/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'GHN-distribution-version']/Value/text() | $profiles/Profile/GHNDescription/RunTimeEnv/Variable[Key/text() = 'SmartGearsDistribution']/Value/text()
let $scopes := string-join( $profiles/Scopes//Scope/text(), ';') let $scopes := string-join( $profiles/Scopes//Scope/text(), ';')
let $subtype := $profiles//Resource/Profile/Site/Domain/text() let $subtype := $profiles/Profile/Site/Domain/text()
<RES_SUBTYPE ISdefault =''/> <RES_SUBTYPE ISdefault =''/>
return return
<RESOURCE/> <RESOURCE/>

View File

@ -1,17 +1,17 @@
<Resource> <Resource>
{$profiles//Resource/ID} {$profiles/ID}
<Type>{$profiles//Resource/Type/text()}</Type> <Type>{$profiles/Type/text()}</Type>
<SubType>{$subtype}</SubType> <SubType>{$subtype}</SubType>
<Status>{$profiles//Resource/Profile/GHNDescription/Status/text()}</Status> <Status>{$profiles/Profile/GHNDescription/Status/text()}</Status>
<Name>{$profiles//Resource/Profile/GHNDescription/Name/text()}</Name> <Name>{$profiles/Profile/GHNDescription/Name/text()}</Name>
<Uptime>{$profiles//Resource/Profile/GHNDescription/Uptime/text()}</Uptime> <Uptime>{$profiles/Profile/GHNDescription/Uptime/text()}</Uptime>
<LastUpdate>{$profiles//Resource/Profile/GHNDescription/LastUpdate/text()}</LastUpdate> <LastUpdate>{$profiles/Profile/GHNDescription/LastUpdate/text()}</LastUpdate>
<LocalAvailableSpace>{$profiles//Resource/Profile/GHNDescription/LocalAvailableSpace/text()}</LocalAvailableSpace> <LocalAvailableSpace>{$profiles/Profile/GHNDescription/LocalAvailableSpace/text()}</LocalAvailableSpace>
<VirtualSize>{$profiles//Resource/Profile/GHNDescription/MainMemory/string(@VirtualSize)}</VirtualSize> <VirtualSize>{$profiles/Profile/GHNDescription/MainMemory/string(@VirtualSize)}</VirtualSize>
<VirtualAvailable>{$profiles//Resource/Profile/GHNDescription/MainMemory/string(@VirtualAvailable)}</VirtualAvailable> <VirtualAvailable>{$profiles/Profile/GHNDescription/MainMemory/string(@VirtualAvailable)}</VirtualAvailable>
<LoadLast1Min>{$profiles//Resource/Profile/GHNDescription/Load/string(@Last1Min)}</LoadLast1Min> <LoadLast1Min>{$profiles/Profile/GHNDescription/Load/string(@Last1Min)}</LoadLast1Min>
<LoadLast5Min>{$profiles//Resource/Profile/GHNDescription/Load/string(@Last5Min)}</LoadLast5Min> <LoadLast5Min>{$profiles/Profile/GHNDescription/Load/string(@Last5Min)}</LoadLast5Min>
<LoadLast15Min>{$profiles//Resource/Profile/GHNDescription/Load/string(@Last15Min)}</LoadLast15Min> <LoadLast15Min>{$profiles/Profile/GHNDescription/Load/string(@Last15Min)}</LoadLast15Min>
<gcf-version>{$gcf-version}</gcf-version> <gcf-version>{$gcf-version}</gcf-version>
<ghn-version>{$ghn-version}</ghn-version> <ghn-version>{$ghn-version}</ghn-version>
<Scopes>{$scopes}</Scopes> <Scopes>{$scopes}</Scopes>

View File

@ -1,8 +1,8 @@
<Resource> <Resource>
{$profiles//Resource/ID} {$profiles/ID}
<Type>{$profiles//Resource/Type/text()}</Type> <Type>{$profiles//Resource/Type/text()}</Type>
<SubType>{$subtype}</SubType> <SubType>{$subtype}</SubType>
<Scopes>{$scopes}</Scopes> <Scopes>{$scopes}</Scopes>
<Name>{$profiles//Resource/Profile/Name/text()}</Name> <Name>{$profiles/Profile/Name/text()}</Name>
<Description>{$profiles//Resource/Profile/Description/text()}</Description> <Description>{$profiles/Profile/Description/text()}</Description>
</Resource> </Resource>

View File

@ -1,8 +1,8 @@
<Resource> <Resource>
{$profiles//Resource/ID} {$profiles/ID}
<Type>{$profiles//Resource/Type/text()}</Type> <Type>{$profiles/Type/text()}</Type>
<SubType>{$subtype}</SubType> <SubType>{$subtype}</SubType>
<Scopes>{$scopes}</Scopes> <Scopes>{$scopes}</Scopes>
<Name>{$profiles//Resource/Profile/Name/text()}</Name> <Name>{$profiles/Profile/Name/text()}</Name>
<Host>{$profiles//Resource/Profile/RunTime/HostedOn/text()}</Host> <Host>{$profiles/Profile/RunTime/HostedOn/text()}</Host>
</Resource> </Resource>

View File

@ -1,10 +1,10 @@
<Resource> <Resource>
{$profiles//Resource/ID} {$profiles/ID}
<Type>{$profiles//Resource/Type/text()}</Type> <Type>{$profiles/Type/text()}</Type>
<SubType>{$subtype}</SubType> <SubType>{$subtype}</SubType>
<Scopes>{$scopes}</Scopes> <Scopes>{$scopes}</Scopes>
<ServiceClass>{$profiles//Resource/Profile/Class/text()}</ServiceClass> <ServiceClass>{$profiles/Profile/Class/text()}</ServiceClass>
<ServiceName>{$profiles//Resource/Profile/Name/text()}</ServiceName> <ServiceName>{$profiles/Profile/Name/text()}</ServiceName>
<Version>{$profiles//Resource/Profile/Packages/Software[1]/Version/text()}</Version> <Version>{$profiles/Profile/Packages/Software[1]/Version/text()}</Version>
<Shareable>{$profiles//Resource/Profile/Packages/Software/Shareable/string(@level)}</Shareable> <Shareable>{$profiles/Profile/Packages/Software/Shareable/string(@level)}</Shareable>
</Resource> </Resource>

View File

@ -1,8 +1,7 @@
for $profiles in collection('/db/Profiles/RunningInstance')//Resource declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry';
let $ghns := collection('/db/Profiles/GHN')//Resource for $profiles in collection('/db/Profiles/RunningInstance')//Document/Data/ic:Profile/Resource
let $_ghn-name := for $ghn in $ghns let $docname := concat('/db/Profiles/GHN/',$profiles/Profile/GHN/@UniqueID/string())
where $ghn/ID/string() eq $profiles/Profile/GHN/@UniqueID/string() let $_ghn-name := doc($docname)//Document/Data/ic:Profile/Resource/Profile/GHNDescription/Name/string()
return $ghn/Profile/GHNDescription/Name/string()
let $ghn-name := if (empty($_ghn-name)) then $profiles/Profile/GHN/@UniqueID/string() else $_ghn-name let $ghn-name := if (empty($_ghn-name)) then $profiles/Profile/GHN/@UniqueID/string() else $_ghn-name
let $scopes := string-join( $profiles/Scopes//Scope/text(), ';') let $scopes := string-join( $profiles/Scopes//Scope/text(), ';')
let $subtype := $profiles/Profile/ServiceClass/text() let $subtype := $profiles/Profile/ServiceClass/text()

View File

@ -1,6 +1,7 @@
for $profiles in collection('/db/Profiles/RuntimeResource')//Resource declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry';
for $profiles in collection('/db/Profiles/RuntimeResource')//Document/Data/ic:Profile/Resource
let $scopes := string-join( $profiles/Scopes//Scope/text(), ';') let $scopes := string-join( $profiles/Scopes//Scope/text(), ';')
let $subtype := $profiles//Resource/Profile/Category/text() let $subtype := $profiles/Profile/Category/text()
<RES_SUBTYPE ISdefault =''/> <RES_SUBTYPE ISdefault =''/>
return return
<RESOURCE/> <RESOURCE/>

View File

@ -1,6 +1,7 @@
for $profiles in collection('/db/Profiles/Service')//Resource declare namespace ic = 'http://gcube-system.org/namespaces/informationsystem/registry';
for $profiles in collection('/db/Profiles/Service')//Document/Data/ic:Profile/Resource
let $scopes := string-join( $profiles/Scopes//Scope/text(), ';') let $scopes := string-join( $profiles/Scopes//Scope/text(), ';')
let $subtype := $profiles//Resource/Profile/Class/text() let $subtype := $profiles/Profile/Class/text()
<RES_SUBTYPE ISdefault =''/> <RES_SUBTYPE ISdefault =''/>
return return
<RESOURCE/> <RESOURCE/>

View File

@ -58,7 +58,7 @@ import org.xml.sax.SAXException;
public class ContextManager { public class ContextManager {
private static final Map<String, ScopeBean> CONTEXTS = new LinkedHashMap<String, ScopeBean>(); private static final Map<String, ScopeBean> CONTEXTS = new LinkedHashMap<String, ScopeBean>();
private static String confFile = null; 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_TYPE = "INFRASTRUCTURE";
private static final String GEN_RESOURCE_NAME = "VirtualOrganisation"; private static final String GEN_RESOURCE_NAME = "VirtualOrganisation";
@ -104,7 +104,7 @@ public class ContextManager {
public static LinkedHashMap<String, ScopeBean> readContexts() throws Exception { public static LinkedHashMap<String, ScopeBean> readContexts() throws Exception {
LinkedHashMap<String, ScopeBean> toReturn = new LinkedHashMap<String, ScopeBean>(); LinkedHashMap<String, ScopeBean> toReturn = new LinkedHashMap<String, ScopeBean>();
String scopeXML = readInfraVoFromIS(); String scopeXML = readInfraVoFromIS();
System.out.println("**** readContexts()"); ServerConsole.info(LOG_PREFIX, "**** readContexts()");
Document scopeDocument = getDocumentGivenXML(scopeXML); Document scopeDocument = getDocumentGivenXML(scopeXML);
NodeList voElements = scopeDocument.getElementsByTagName("vo"); NodeList voElements = scopeDocument.getElementsByTagName("vo");
ServerConsole.debug("voElements="+ voElements.getLength()); ServerConsole.debug("voElements="+ voElements.getLength());
@ -115,9 +115,9 @@ public class ContextManager {
toReturn.put(vo.toString(), vo); toReturn.put(vo.toString(), vo);
try { try {
for (String vre : getVREFromVO(vo)) { for (String vreName : getVREFromVO(vo)) {
// This operation overrides the vo map // 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) { } catch (Exception e) {
ServerConsole.error("Exception raised while loading VREs for VO : " + vo, 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 { public static LinkedHashMap<String, D4SEnvironment> readContextsWithUUIDs() throws Exception {
LinkedHashMap<String, D4SEnvironment> toReturn = new LinkedHashMap<String, D4SEnvironment>(); LinkedHashMap<String, D4SEnvironment> toReturn = new LinkedHashMap<String, D4SEnvironment>();
String scopeXML = readInfraVoFromIS(); String scopeXML = readInfraVoFromIS();
System.out.println("**** readContexts()"); ServerConsole.info(LOG_PREFIX, "**** readContexts()");
Document scopeDocument = getDocumentGivenXML(scopeXML); Document scopeDocument = getDocumentGivenXML(scopeXML);
NodeList voElements = scopeDocument.getElementsByTagName("vo"); NodeList voElements = scopeDocument.getElementsByTagName("vo");
ServerConsole.debug("voElements="+ voElements.getLength()); ServerConsole.debug("voElements="+ voElements.getLength());
for (int i = 0; i < voElements.getLength(); i++) { for (int i = 0; i < voElements.getLength(); i++) {
NodeList voDetails = voElements.item(i).getChildNodes(); NodeList voDetails = voElements.item(i).getChildNodes();
String voString = voDetails.item(2).getFirstChild().getNodeValue(); 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); 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); toReturn.put(vo.toString(), voWrapper);
try { try {
for (GenericResource resVRE : getVREResourcesFromVO(vo)) { for (GenericResource resVRE : getVREResourcesFromVO(vo)) {