Merge pull request 'edit_facility_26115' (!5) from edit_facility_26115 into master

Reviewed-on: #5
This commit is contained in:
Francesco Mangiacrapa 2024-03-19 10:42:37 +01:00
commit 693a4fc281
6 changed files with 165 additions and 45 deletions

View File

@ -13,8 +13,26 @@
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
<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="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
@ -28,23 +46,5 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
@ -12,7 +13,8 @@
<wb-module deploy-name="workspace-tree-widget">
@ -25,7 +27,8 @@
<wb-resource deploy-path="/" source-path="/src/main/java"/>
@ -38,19 +41,9 @@
<wb-resource deploy-path="/" source-path="/src/main/resources"/>
<wb-resource deploy-path="/" source-path="/target/generated-sources/annotations"/>
@ -63,7 +56,8 @@
</wb-module>

View File

@ -4,6 +4,13 @@
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).
## [v6.35.3-SNAPSHOT] - 2024-03-19
- Moved to maven parent 1.2.0
- Added lombok 1.18.4 (provided) to avoid `java.lang.ClassNotFoundException: com.sun.tools.javac.code.TypeTags`
- Equipped with the new Catalogue Publishing Widget [#26825]
- image-previewer-widget range at [1.0.0, 1.3.0-SNAPSHOT)
## [v6.35.2] - 2022-09-14
#### Bug fixed
@ -80,7 +87,7 @@ Declared the workspace-uploader range [2.X, 3.X-SNAPSHOT)
[#19952] Fixed incident
## [v6.31.0] [r4.25.0] - 2020-09-29
## [v6.31.0] - 2020-09-29
#### Enhancements
@ -94,14 +101,14 @@ Declared the workspace-uploader range [2.X, 3.X-SNAPSHOT)
[#19759#note-12] Fixed updating the description of a folder
## [v6.30.1] [r4.24.0] - 2020-06-25
## [v6.30.1] - 2020-06-25
#### Fixes
[#19544] update the unsharing messages in the accounting history
## [v6.30.0] [r4.23.0] - 2020-05-18
## [v6.30.0] - 2020-05-18
#### New Features
@ -114,7 +121,7 @@ Declared the workspace-uploader range [2.X, 3.X-SNAPSHOT)
[#19243] Fixed upload archive facility does not work properly with Windows OS
## [v6.29.0] [r4.21.0] - 2020-03-27
## [v6.29.0] - 2020-03-27
#### New Features

58
pom.xml
View File

@ -5,13 +5,13 @@
<parent>
<artifactId>maven-parent</artifactId>
<groupId>org.gcube.tools</groupId>
<version>1.1.0</version>
<version>1.2.0</version>
<relativePath />
</parent>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>workspace-tree-widget</artifactId>
<version>6.35.2</version>
<version>6.35.3-SNAPSHOT</version>
<name>gCube Workspace Tree Widget</name>
<description>
gCube Workspace Tree Widget is a widget to navigate and interact with gCube Workspace
@ -39,6 +39,9 @@
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<gxt2.2.5-gwt2.X-version>2.7.0</gxt2.2.5-gwt2.X-version>
<gcube-portal-bom-version>3.7.0</gcube-portal-bom-version>
</properties>
<dependencyManagement>
@ -46,13 +49,38 @@
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId>
<version>3.6.4</version>
<version>${gcube-portal-bom-version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<!-- <profiles> -->
<!-- <profile> -->
<!-- <id>workspace-tree-release-profile</id> -->
<!-- <activation> -->
<!-- <property> -->
<!-- <name>Release</name> -->
<!-- </property> -->
<!-- </activation> -->
<!-- <properties> -->
<!-- <gcube-portal-bom-version>3.7.0</gcube-portal-bom-version> -->
<!-- </properties> -->
<!-- </profile> -->
<!-- <profile> -->
<!-- <id>workspace-tree-snapshot-profile</id> -->
<!-- <activation> -->
<!-- <property> -->
<!-- <name>!Release</name> -->
<!-- </property> -->
<!-- </activation> -->
<!-- <properties> -->
<!-- <gcube-portal-bom-version>3.8.0-SNAPSHOT</gcube-portal-bom-version> -->
<!-- </properties> -->
<!-- </profile> -->
<!-- </profiles> -->
<dependencies>
<!-- Google Web Toolkit (GWT) -->
@ -70,7 +98,7 @@
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt2.2.5-gwt2.X</artifactId>
<version>${gwtVersion}</version>
<version>${gxt2.2.5-gwt2.X-version}</version>
<scope>compile</scope>
</dependency>
@ -138,7 +166,7 @@
<dependency>
<groupId>org.gcube.portlets.widgets</groupId>
<artifactId>image-previewer-widget</artifactId>
<version>[1.0.0,)</version>
<version>[1.0.0, 1.3.0-SNAPSHOT)</version>
<exclusions>
<exclusion>
<groupId>com.google.gwt</groupId>
@ -160,6 +188,20 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.portlets.widgets</groupId>
<artifactId>ws-task-executor-widget</artifactId>
@ -249,6 +291,12 @@
<artifactId>ckan-metadata-publisher-widget</artifactId>
<version>[2.0.0-SNAPSHOT, 3.0.0)</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>com.allen-sauer.gwt.log</groupId>
<artifactId>gwt-log</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- JSON PARSER -->

View File

@ -175,5 +175,5 @@ public class HttpCallerUtil {
public void setPassword(String password) {
this.password = password;
}
}

View File

@ -0,0 +1,71 @@
package org.gcube.portlets.user.workspace;
import org.gcube.common.storagehubwrapper.server.StorageHubClientService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class MappingGroupNameToScopeName {
private static Logger logger = LoggerFactory.getLogger(MappingGroupNameToScopeName.class);
public static void main(String[] args) {
// VRE
String context = "d4science.research-infrastructures.eu-D4OS-FAO-Tuna_Atlas";
String rootName = "/d4science.research-infrastructures.eu";
String vreName = "FAO-Tuna_Atlas";
//
// //VO
// String context = "d4science.research-infrastructures.eu-D4OS";
// String rootName = "/d4science.research-infrastructures.eu";
// String vreName = null;
// ROOT
// String context = "d4science.research-infrastructures.eu";
// String rootName = "/d4science.research-infrastructures.eu";
// String vreName = null;
System.out.println(getScopeFromVREGroupName(context, rootName, vreName));
}
/**
* Gets the scope from VRE group name.
*
* @param context the context
* @return the scope from VRE group name. Eg. with the input
* 'gcube-devNext-NextNext' returns '/gcube/devNext/NextNext'
*/
public static String getScopeFromVREGroupName(String context, String infrastructurName, String vreName) {
// String entireScopeName = context.replaceAll("^/(.*)/?$", "$1").replaceAll("-", "/");
// return entireScopeName;
if (vreName == null)
vreName = "";
logger.debug("vreName: " + vreName);
if (infrastructurName.startsWith("/"))
infrastructurName = infrastructurName.substring(1, infrastructurName.length());
logger.debug("infrastructurName: " + infrastructurName);
String voGroup = context.replaceAll(infrastructurName, "");
if (vreName != null) {
voGroup = voGroup.replaceAll(vreName, "").replaceAll("-", "");
}
String voName = voGroup.replaceAll("-", "");
logger.debug("voName: " + voName);
StringBuilder theScopeBuilder = new StringBuilder();
theScopeBuilder.append("/" + infrastructurName);
if (voName != null && !voName.isEmpty()) {
theScopeBuilder.append("/" + voName);
}
if (vreName != null && !vreName.isEmpty()) {
theScopeBuilder.append("/" + vreName);
}
String theScope = theScopeBuilder.toString();
logger.info("Built scope: " + theScope);
return theScope;
}
}