Compare commits
No commits in common. "master" and "feature_23026" have entirely different histories.
master
...
feature_23
43
.classpath
43
.classpath
|
@ -11,30 +11,7 @@
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
<classpathentry kind="src" path="src/test/resources"/>
|
||||||
<attributes>
|
|
||||||
<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">
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
@ -46,5 +23,23 @@
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</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"/>
|
<classpathentry kind="output" path="target/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -2,5 +2,4 @@ eclipse.preferences.version=1
|
||||||
encoding//src/main/java=UTF-8
|
encoding//src/main/java=UTF-8
|
||||||
encoding//src/main/resources=UTF-8
|
encoding//src/main/resources=UTF-8
|
||||||
encoding//src/test/java=UTF-8
|
encoding//src/test/java=UTF-8
|
||||||
encoding//src/test/resources=UTF-8
|
|
||||||
encoding/<project>=UTF-8
|
encoding/<project>=UTF-8
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
<?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">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,11 +9,7 @@
|
||||||
|
|
||||||
|
|
||||||
<wb-module deploy-name="workspace-tree-widget">
|
<wb-module deploy-name="workspace-tree-widget">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,11 +19,7 @@
|
||||||
|
|
||||||
|
|
||||||
<wb-resource deploy-path="/" source-path="/src/main/java"/>
|
<wb-resource deploy-path="/" source-path="/src/main/java"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,12 +29,16 @@
|
||||||
|
|
||||||
|
|
||||||
<wb-resource deploy-path="/" source-path="/src/main/resources"/>
|
<wb-resource deploy-path="/" source-path="/src/main/resources"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<wb-resource deploy-path="/" source-path="/target/generated-sources/annotations"/>
|
<wb-resource deploy-path="/" source-path="/target/generated-sources/annotations"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,11 +48,7 @@
|
||||||
|
|
||||||
|
|
||||||
</wb-module>
|
</wb-module>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
35
CHANGELOG.md
35
CHANGELOG.md
|
@ -4,32 +4,7 @@
|
||||||
All notable changes to this project will be documented in this file.
|
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).
|
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## [v6.35.3] - 2024-03-19
|
## [v6.34.3-SNAPSHOT] - 2022-03-23
|
||||||
|
|
||||||
- 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
|
|
||||||
|
|
||||||
- [#23676] Fixed - Added extension .txt to ASC files when dowloaded
|
|
||||||
- [#23789] Fixed - Notebook files (.ipynb) are downloaded with .txt attached.
|
|
||||||
- [#23862] Fixed - Downloading folders containing a "." in the name, the .zip is appended to file name
|
|
||||||
|
|
||||||
## [v6.35.1] - 2022-06-27
|
|
||||||
|
|
||||||
- [#23523] Updated to maven-portal-bom 3.6.4
|
|
||||||
|
|
||||||
## [v6.35.0] - 2022-05-03
|
|
||||||
|
|
||||||
#### Enhancements
|
|
||||||
|
|
||||||
- [#23225] Updated the method to read the members of (VRE or Simple) shared folders
|
|
||||||
|
|
||||||
## [v6.34.3] - 2022-03-24
|
|
||||||
|
|
||||||
#### Enhancements
|
#### Enhancements
|
||||||
|
|
||||||
|
@ -87,7 +62,7 @@ Declared the workspace-uploader range [2.X, 3.X-SNAPSHOT)
|
||||||
|
|
||||||
[#19952] Fixed incident
|
[#19952] Fixed incident
|
||||||
|
|
||||||
## [v6.31.0] - 2020-09-29
|
## [v6.31.0] [r4.25.0] - 2020-09-29
|
||||||
|
|
||||||
#### Enhancements
|
#### Enhancements
|
||||||
|
|
||||||
|
@ -101,14 +76,14 @@ Declared the workspace-uploader range [2.X, 3.X-SNAPSHOT)
|
||||||
|
|
||||||
[#19759#note-12] Fixed updating the description of a folder
|
[#19759#note-12] Fixed updating the description of a folder
|
||||||
|
|
||||||
## [v6.30.1] - 2020-06-25
|
## [v6.30.1] [r4.24.0] - 2020-06-25
|
||||||
|
|
||||||
#### Fixes
|
#### Fixes
|
||||||
|
|
||||||
[#19544] update the unsharing messages in the accounting history
|
[#19544] update the unsharing messages in the accounting history
|
||||||
|
|
||||||
|
|
||||||
## [v6.30.0] - 2020-05-18
|
## [v6.30.0] [r4.23.0] - 2020-05-18
|
||||||
|
|
||||||
#### New Features
|
#### New Features
|
||||||
|
|
||||||
|
@ -121,7 +96,7 @@ Declared the workspace-uploader range [2.X, 3.X-SNAPSHOT)
|
||||||
[#19243] Fixed upload archive facility does not work properly with Windows OS
|
[#19243] Fixed upload archive facility does not work properly with Windows OS
|
||||||
|
|
||||||
|
|
||||||
## [v6.29.0] - 2020-03-27
|
## [v6.29.0] [r4.21.0] - 2020-03-27
|
||||||
|
|
||||||
#### New Features
|
#### New Features
|
||||||
|
|
||||||
|
|
73
pom.xml
73
pom.xml
|
@ -5,13 +5,13 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>maven-parent</artifactId>
|
<artifactId>maven-parent</artifactId>
|
||||||
<groupId>org.gcube.tools</groupId>
|
<groupId>org.gcube.tools</groupId>
|
||||||
<version>1.2.0</version>
|
<version>1.1.0</version>
|
||||||
<relativePath />
|
<relativePath />
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>org.gcube.portlets.user</groupId>
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
<artifactId>workspace-tree-widget</artifactId>
|
<artifactId>workspace-tree-widget</artifactId>
|
||||||
<version>6.35.3</version>
|
<version>6.34.3-SNAPSHOT</version>
|
||||||
<name>gCube Workspace Tree Widget</name>
|
<name>gCube Workspace Tree Widget</name>
|
||||||
<description>
|
<description>
|
||||||
gCube Workspace Tree Widget is a widget to navigate and interact with gCube Workspace
|
gCube Workspace Tree Widget is a widget to navigate and interact with gCube Workspace
|
||||||
|
@ -39,9 +39,6 @@
|
||||||
<maven.compiler.target>1.8</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>
|
||||||
<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>
|
</properties>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
|
@ -49,38 +46,13 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.distribution</groupId>
|
<groupId>org.gcube.distribution</groupId>
|
||||||
<artifactId>maven-portal-bom</artifactId>
|
<artifactId>maven-portal-bom</artifactId>
|
||||||
<version>${gcube-portal-bom-version}</version>
|
<version>3.7.0-SNAPSHOT</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</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>
|
<dependencies>
|
||||||
|
|
||||||
<!-- Google Web Toolkit (GWT) -->
|
<!-- Google Web Toolkit (GWT) -->
|
||||||
|
@ -98,7 +70,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.sencha.gxt</groupId>
|
<groupId>com.sencha.gxt</groupId>
|
||||||
<artifactId>gxt2.2.5-gwt2.X</artifactId>
|
<artifactId>gxt2.2.5-gwt2.X</artifactId>
|
||||||
<version>${gxt2.2.5-gwt2.X-version}</version>
|
<version>${gwtVersion}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -166,7 +138,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.portlets.widgets</groupId>
|
<groupId>org.gcube.portlets.widgets</groupId>
|
||||||
<artifactId>image-previewer-widget</artifactId>
|
<artifactId>image-previewer-widget</artifactId>
|
||||||
<version>[1.0.0, 1.3.0-SNAPSHOT)</version>
|
<version>[1.0.0,)</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>com.google.gwt</groupId>
|
<groupId>com.google.gwt</groupId>
|
||||||
|
@ -188,20 +160,6 @@
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</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>
|
<dependency>
|
||||||
<groupId>org.gcube.portlets.widgets</groupId>
|
<groupId>org.gcube.portlets.widgets</groupId>
|
||||||
<artifactId>ws-task-executor-widget</artifactId>
|
<artifactId>ws-task-executor-widget</artifactId>
|
||||||
|
@ -276,22 +234,9 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.portal</groupId>
|
<groupId>org.gcube.portal</groupId>
|
||||||
<artifactId>social-library-stubs</artifactId>
|
<artifactId>social-networking-library</artifactId>
|
||||||
<version>[1.0.0-SNAPSHOT, 2.0.0)</version>
|
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.gcube.social-networking</groupId>
|
|
||||||
<artifactId>social-service-client</artifactId>
|
|
||||||
<version>[2.0.0-SNAPSHOT, 3.0.0)</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.gcube.portal</groupId>
|
|
||||||
<artifactId>social-networking-library</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.applicationsupportlayer</groupId>
|
<groupId>org.gcube.applicationsupportlayer</groupId>
|
||||||
<artifactId>aslsocial</artifactId>
|
<artifactId>aslsocial</artifactId>
|
||||||
|
@ -304,12 +249,6 @@
|
||||||
<artifactId>ckan-metadata-publisher-widget</artifactId>
|
<artifactId>ckan-metadata-publisher-widget</artifactId>
|
||||||
<version>[2.0.0-SNAPSHOT, 3.0.0)</version>
|
<version>[2.0.0-SNAPSHOT, 3.0.0)</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.allen-sauer.gwt.log</groupId>
|
|
||||||
<artifactId>gwt-log</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- JSON PARSER -->
|
<!-- JSON PARSER -->
|
||||||
|
|
|
@ -153,7 +153,7 @@ public class DownloadServlet extends HttpServlet{
|
||||||
ByteArrayInputStream is = new ByteArrayInputStream(fileContent.getBytes());
|
ByteArrayInputStream is = new ByteArrayInputStream(fileContent.getBytes());
|
||||||
String contentDisposition = viewContent?"inline":"attachment";
|
String contentDisposition = viewContent?"inline":"attachment";
|
||||||
String urlMimeType = "text/uri-list";
|
String urlMimeType = "text/uri-list";
|
||||||
String itemName = MimeTypeUtility.getNameWithExtension(item.getName(), urlMimeType, false);
|
String itemName = MimeTypeUtility.getNameWithExtension(item.getName(), urlMimeType);
|
||||||
resp.setHeader("Content-Disposition", contentDisposition+"; filename=\"" + itemName + "\"" );
|
resp.setHeader("Content-Disposition", contentDisposition+"; filename=\"" + itemName + "\"" );
|
||||||
resp.setContentType(urlMimeType);
|
resp.setContentType(urlMimeType);
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ public class DownloadServlet extends HttpServlet{
|
||||||
logger.info("Downloading the folder: "+workspaceFolder);
|
logger.info("Downloading the folder: "+workspaceFolder);
|
||||||
String contentDisposition = viewContent?"inline":"attachment";
|
String contentDisposition = viewContent?"inline":"attachment";
|
||||||
String mimeType = "application/zip";
|
String mimeType = "application/zip";
|
||||||
String itemName = MimeTypeUtility.getNameWithExtension(item.getName(), mimeType,true);
|
String itemName = MimeTypeUtility.getNameWithExtension(item.getName(), mimeType);
|
||||||
resp.setHeader("Content-Disposition", contentDisposition+"; filename=\"" + itemName + "\"" );
|
resp.setHeader("Content-Disposition", contentDisposition+"; filename=\"" + itemName + "\"" );
|
||||||
resp.setContentType(mimeType);
|
resp.setContentType(mimeType);
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@ public class DownloadServlet extends HttpServlet{
|
||||||
String mimeType = pdfFile.getMimeType();
|
String mimeType = pdfFile.getMimeType();
|
||||||
logger.trace("EXTERNAL_FILE DOWNLOAD FOR "+pdfFile.getId());
|
logger.trace("EXTERNAL_FILE DOWNLOAD FOR "+pdfFile.getId());
|
||||||
String contentDisposition = viewContent?"inline":"attachment";
|
String contentDisposition = viewContent?"inline":"attachment";
|
||||||
String itemName = MimeTypeUtility.getNameWithExtension(descr.getItemName(), mimeType,false);
|
String itemName = MimeTypeUtility.getNameWithExtension(descr.getItemName(), mimeType);
|
||||||
|
|
||||||
resp.setHeader("Content-Disposition", contentDisposition+"; filename=\"" + itemName + "\"" );
|
resp.setHeader("Content-Disposition", contentDisposition+"; filename=\"" + itemName + "\"" );
|
||||||
resp.setContentType(mimeType);
|
resp.setContentType(mimeType);
|
||||||
|
@ -267,7 +267,7 @@ public class DownloadServlet extends HttpServlet{
|
||||||
ImageFileItem imageFile = (ImageFileItem) workspaceFileItem;
|
ImageFileItem imageFile = (ImageFileItem) workspaceFileItem;
|
||||||
logger.info("Downloading: "+imageFile);
|
logger.info("Downloading: "+imageFile);
|
||||||
String mimeType = imageFile.getMimeType();
|
String mimeType = imageFile.getMimeType();
|
||||||
String itemName = MimeTypeUtility.getNameWithExtension(descr.getItemName(), mimeType,false);
|
String itemName = MimeTypeUtility.getNameWithExtension(descr.getItemName(), mimeType);
|
||||||
String contentDisposition = viewContent?"inline":"attachment";
|
String contentDisposition = viewContent?"inline":"attachment";
|
||||||
resp.setHeader("Content-Disposition", contentDisposition+"; filename=\"" + itemName + "\"" );
|
resp.setHeader("Content-Disposition", contentDisposition+"; filename=\"" + itemName + "\"" );
|
||||||
resp.setContentType(mimeType);
|
resp.setContentType(mimeType);
|
||||||
|
@ -298,7 +298,7 @@ public class DownloadServlet extends HttpServlet{
|
||||||
URLFileItem externalUrl = (URLFileItem) workspaceFileItem;
|
URLFileItem externalUrl = (URLFileItem) workspaceFileItem;
|
||||||
logger.info("Downloading: "+externalUrl);
|
logger.info("Downloading: "+externalUrl);
|
||||||
String urlMimeType = "text/uri-list";
|
String urlMimeType = "text/uri-list";
|
||||||
String itemName = MimeTypeUtility.getNameWithExtension(descr.getItemName(), urlMimeType,false);
|
String itemName = MimeTypeUtility.getNameWithExtension(descr.getItemName(), urlMimeType);
|
||||||
String contentDisposition = viewContent?"inline":"attachment";
|
String contentDisposition = viewContent?"inline":"attachment";
|
||||||
resp.setHeader("Content-Disposition", contentDisposition+"; filename=\"" + itemName + "\"" );
|
resp.setHeader("Content-Disposition", contentDisposition+"; filename=\"" + itemName + "\"" );
|
||||||
resp.setContentType(urlMimeType);
|
resp.setContentType(urlMimeType);
|
||||||
|
@ -347,7 +347,7 @@ public class DownloadServlet extends HttpServlet{
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
|
||||||
String itemName = MimeTypeUtility.getNameWithExtension(descr.getItemName(), workspaceFileItem.getMimeType(),false);
|
String itemName = MimeTypeUtility.getNameWithExtension(descr.getItemName(), workspaceFileItem.getMimeType());
|
||||||
logger.info("Downloading default item: "+workspaceFileItem);
|
logger.info("Downloading default item: "+workspaceFileItem);
|
||||||
|
|
||||||
//String contentDisposition = viewContent?"inline":"attachment";
|
//String contentDisposition = viewContent?"inline":"attachment";
|
||||||
|
|
|
@ -9,7 +9,6 @@ import java.util.List;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import org.gcube.common.storagehub.model.types.WorkspaceItemType;
|
import org.gcube.common.storagehub.model.types.WorkspaceItemType;
|
||||||
import org.gcube.common.storagehubwrapper.shared.Member;
|
|
||||||
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceFolder;
|
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceFolder;
|
||||||
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem;
|
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem;
|
||||||
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceSharedFolder;
|
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceSharedFolder;
|
||||||
|
@ -161,13 +160,18 @@ public class NotificationStorageHubUtil {
|
||||||
|
|
||||||
if(isFolderAndShared(rootSharedFolder)){ //JUST TO BE SURE
|
if(isFolderAndShared(rootSharedFolder)){ //JUST TO BE SURE
|
||||||
|
|
||||||
List<Member> listMembers = workspace.getSharedFolderMembers(rootSharedFolder.getId());
|
List<String> listPortalLogin = workspace.getSharedFolderMembers(rootSharedFolder.getId());
|
||||||
logger.debug("StorageHub returned "+ listMembers.size() + " user/s");
|
logger.debug("StorageHub returned "+ listPortalLogin.size() + " user/s");
|
||||||
|
|
||||||
if(!WsUtil.isWithinPortal())
|
if(!WsUtil.isWithinPortal())
|
||||||
return StorageHubToWorkpaceConverter.buildGxtInfoContactFromPortalLoginTestMode(listMembers);
|
return StorageHubToWorkpaceConverter.buildGxtInfoContactFromPortalLoginTestMode(listPortalLogin);
|
||||||
|
|
||||||
|
List<InfoContactModel> listContacts = new ArrayList<InfoContactModel>(listPortalLogin.size());
|
||||||
|
for (String login : listPortalLogin) {
|
||||||
|
listContacts.add(StorageHubToWorkpaceConverter.buildGxtInfoContactFromPortalLogin(login));
|
||||||
|
}
|
||||||
|
|
||||||
return StorageHubToWorkpaceConverter.listMembersToListContact(listMembers);
|
return listContacts;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
logger.debug("the item with id: "+rootSharedFolder.getId()+ " is not "+WorkspaceItemType.SHARED_FOLDER);
|
logger.debug("the item with id: "+rootSharedFolder.getId()+ " is not "+WorkspaceItemType.SHARED_FOLDER);
|
||||||
|
|
|
@ -25,7 +25,6 @@ import org.gcube.common.storagehub.model.items.nodes.accounting.AccountFolderEnt
|
||||||
import org.gcube.common.storagehub.model.items.nodes.accounting.AccountFolderEntryRemoval;
|
import org.gcube.common.storagehub.model.items.nodes.accounting.AccountFolderEntryRemoval;
|
||||||
import org.gcube.common.storagehub.model.items.nodes.accounting.AccountFolderEntryRenaming;
|
import org.gcube.common.storagehub.model.items.nodes.accounting.AccountFolderEntryRenaming;
|
||||||
import org.gcube.common.storagehub.model.items.nodes.accounting.AccountingEntryType;
|
import org.gcube.common.storagehub.model.items.nodes.accounting.AccountingEntryType;
|
||||||
import org.gcube.common.storagehubwrapper.shared.Member;
|
|
||||||
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem;
|
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem;
|
||||||
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItemType;
|
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItemType;
|
||||||
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceSharedFolder;
|
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceSharedFolder;
|
||||||
|
@ -45,11 +44,6 @@ import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingEntryTyp
|
||||||
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField;
|
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField;
|
||||||
import org.gcube.portlets.widgets.workspacesharingwidget.shared.InfoContactModel;
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.InfoContactModel;
|
||||||
import org.gcube.usecases.ws.thredds.model.ContainerType;
|
import org.gcube.usecases.ws.thredds.model.ContainerType;
|
||||||
import org.gcube.vomanagement.usermanagement.UserManager;
|
|
||||||
import org.gcube.vomanagement.usermanagement.exception.GroupRetrievalFault;
|
|
||||||
import org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException;
|
|
||||||
import org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault;
|
|
||||||
import org.gcube.vomanagement.usermanagement.impl.LiferayUserManager;
|
|
||||||
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
|
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -140,8 +134,7 @@ public class StorageHubToWorkpaceConverter implements Serializable {
|
||||||
public FileModel toTreeFileModel(org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem wrappedItem,
|
public FileModel toTreeFileModel(org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem wrappedItem,
|
||||||
FileModel parentFolderModel, Boolean isParentShared) throws InternalErrorException {
|
FileModel parentFolderModel, Boolean isParentShared) throws InternalErrorException {
|
||||||
|
|
||||||
FileModel fileModel = ObjectStorageHubToWorkpaceMapper.toTreeFileModelItem(wrappedItem, parentFolderModel,
|
FileModel fileModel = ObjectStorageHubToWorkpaceMapper.toTreeFileModelItem(wrappedItem, parentFolderModel, isParentShared, loggedUser);
|
||||||
isParentShared, loggedUser);
|
|
||||||
return setSynchedWithWsThredds(fileModel, wrappedItem);
|
return setSynchedWithWsThredds(fileModel, wrappedItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,11 +149,11 @@ public class StorageHubToWorkpaceConverter implements Serializable {
|
||||||
public FileGridModel toGridFileModel(org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem wrappedItem,
|
public FileGridModel toGridFileModel(org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem wrappedItem,
|
||||||
FileModel parentFolderModel) throws InternalErrorException {
|
FileModel parentFolderModel) throws InternalErrorException {
|
||||||
|
|
||||||
FileGridModel fileGridModel = ObjectStorageHubToWorkpaceMapper.toGridFileModelItem(wrappedItem,
|
FileGridModel fileGridModel = ObjectStorageHubToWorkpaceMapper.toGridFileModelItem(wrappedItem, parentFolderModel, loggedUser);
|
||||||
parentFolderModel, loggedUser);
|
|
||||||
return (FileGridModel) setSynchedWithWsThredds(fileGridModel, wrappedItem);
|
return (FileGridModel) setSynchedWithWsThredds(fileGridModel, wrappedItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected FileModel setSynchedWithWsThredds(FileModel fileModel, WorkspaceItem wrappedItem) {
|
protected FileModel setSynchedWithWsThredds(FileModel fileModel, WorkspaceItem wrappedItem) {
|
||||||
logger.debug("called setSynchedThreddsStateFor item id: " + wrappedItem.getId());
|
logger.debug("called setSynchedThreddsStateFor item id: " + wrappedItem.getId());
|
||||||
|
|
||||||
|
@ -304,47 +297,6 @@ public class StorageHubToWorkpaceConverter implements Serializable {
|
||||||
return new InfoContactModel(portalLogin, portalLogin, fullName, emailDomain, false);
|
return new InfoContactModel(portalLogin, portalLogin, fullName, emailDomain, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<InfoContactModel> listMembersToListContact(List<Member> members) {
|
|
||||||
logger.info("listMembersToListContact called for " + members.size() + " member/s");
|
|
||||||
|
|
||||||
List<InfoContactModel> listContacts = new ArrayList<InfoContactModel>();
|
|
||||||
UserManager userManager = new LiferayUserManager();
|
|
||||||
|
|
||||||
for (Member member : members) {
|
|
||||||
logger.debug("Resolving member: " + member);
|
|
||||||
boolean isGroup = member.getMemberType().equals(Member.TYPE.GROUP) ? true : false;
|
|
||||||
|
|
||||||
if (!isGroup) {
|
|
||||||
InfoContactModel icm = buildGxtInfoContactFromPortalLogin(member.getIdentity());
|
|
||||||
// HE/SHE IS A USER
|
|
||||||
listContacts.add(icm);
|
|
||||||
} else {
|
|
||||||
// HE/SHE IS A GROUP
|
|
||||||
logger.debug("The member: " + member + " is a group, resolving list of Users from "
|
|
||||||
+ LiferayUserManager.class.getSimpleName() + " for the group name: " + member.getName());
|
|
||||||
try {
|
|
||||||
List<GCubeUser> listUsers = userManager.listUsersByGroupName(member.getName());
|
|
||||||
|
|
||||||
if (listUsers != null) {
|
|
||||||
logger.debug("List of user for groupName are: " + listUsers.size());
|
|
||||||
for (GCubeUser user : listUsers) {
|
|
||||||
InfoContactModel icm = buildGxtInfoContactFromPortalLogin(user.getUsername());
|
|
||||||
listContacts.add(icm);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
logger.warn("List of user for groupName: " + member.getName() + " is null");
|
|
||||||
}
|
|
||||||
} catch (UserManagementSystemException | GroupRetrievalFault | UserRetrievalFault e) {
|
|
||||||
logger.warn("Error occurrend on resolving the member: " + member.getName(), e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.info("Returning " + listContacts.size() + " from members");
|
|
||||||
return listContacts;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO ********TEMPORARY SOLUTION HL MUST MANAGE SPECIAL FOLDER AS
|
* TODO ********TEMPORARY SOLUTION HL MUST MANAGE SPECIAL FOLDER AS
|
||||||
* WORKSPACESPECIALFOLDER**** REMOVE THIS METHOD AND ADDING INSTANCE OF AT
|
* WORKSPACESPECIALFOLDER**** REMOVE THIS METHOD AND ADDING INSTANCE OF AT
|
||||||
|
@ -394,8 +346,7 @@ public class StorageHubToWorkpaceConverter implements Serializable {
|
||||||
.isPublicFolder(); // TODO
|
.isPublicFolder(); // TODO
|
||||||
FileModel parentModel = null;
|
FileModel parentModel = null;
|
||||||
if (parent != null)
|
if (parent != null)
|
||||||
parentModel = ObjectStorageHubToWorkpaceMapper.toTreeFileModelItem(parent, null, parent.isShared(),
|
parentModel = ObjectStorageHubToWorkpaceMapper.toTreeFileModelItem(parent, null, parent.isShared(), loggedUser);
|
||||||
loggedUser);
|
|
||||||
|
|
||||||
FolderModel folder = new FolderModel(wsFolder.getId(), name, parentModel, true, wsFolder.isShared(), false,
|
FolderModel folder = new FolderModel(wsFolder.getId(), name, parentModel, true, wsFolder.isShared(), false,
|
||||||
isPublicDir);
|
isPublicDir);
|
||||||
|
@ -930,12 +881,12 @@ public class StorageHubToWorkpaceConverter implements Serializable {
|
||||||
return hashTestUser;
|
return hashTestUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<InfoContactModel> buildGxtInfoContactFromPortalLoginTestMode(List<Member> listMemebers) {
|
public static List<InfoContactModel> buildGxtInfoContactFromPortalLoginTestMode(List<String> listPortalLogin) {
|
||||||
|
|
||||||
List<InfoContactModel> listContact = new ArrayList<InfoContactModel>();
|
List<InfoContactModel> listContact = new ArrayList<InfoContactModel>();
|
||||||
|
|
||||||
for (Member member : listMemebers)
|
for (String portalLogin : listPortalLogin)
|
||||||
listContact.add(getHashTestUsers().get(member.getIdentity()));
|
listContact.add(getHashTestUsers().get(portalLogin));
|
||||||
|
|
||||||
return listContact;
|
return listContact;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ import org.apache.tika.mime.MediaType;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
|
||||||
// TODO: Auto-generated Javadoc
|
// TODO: Auto-generated Javadoc
|
||||||
/**
|
/**
|
||||||
* The Class MimeTypeUtil.
|
* The Class MimeTypeUtil.
|
||||||
|
@ -119,6 +120,7 @@ public class MimeTypeUtility {
|
||||||
}
|
}
|
||||||
br.close();
|
br.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load preview mime types.
|
* Load preview mime types.
|
||||||
|
@ -163,12 +165,12 @@ public class MimeTypeUtility {
|
||||||
*
|
*
|
||||||
* @param name the file name.
|
* @param name the file name.
|
||||||
* @param mimeType the mime type.
|
* @param mimeType the mime type.
|
||||||
* @param isFolder the is folder
|
|
||||||
* @return the right name.
|
* @return the right name.
|
||||||
* @throws IOException Signals that an I/O exception has occurred.
|
* @throws IOException Signals that an I/O exception has occurred.
|
||||||
*/
|
*/
|
||||||
public static String getNameWithExtension(String name, String mimeType, boolean isFolder) throws IOException {
|
public static String getNameWithExtension(String name, String mimeType) throws IOException {
|
||||||
logger.debug("Deriving the file extension for file name: " + name + ", with mimeType: " + mimeType+", isFolder: "+isFolder);
|
|
||||||
|
logger.debug("Deriving the file extension for file name: " + name + ", with mimeType: " + mimeType);
|
||||||
|
|
||||||
if (mimeType == null || mimeType.isEmpty()) {
|
if (mimeType == null || mimeType.isEmpty()) {
|
||||||
logger.debug("Input mime type is null or empty returning passed name: " + name);
|
logger.debug("Input mime type is null or empty returning passed name: " + name);
|
||||||
|
@ -176,30 +178,52 @@ public class MimeTypeUtility {
|
||||||
}
|
}
|
||||||
|
|
||||||
String declaredExtension = FilenameUtils.getExtension(name);
|
String declaredExtension = FilenameUtils.getExtension(name);
|
||||||
logger.info("The name " + name + " contains the extension: " + declaredExtension);
|
logger.debug("The name " + name + " contains the extension: " + declaredExtension);
|
||||||
|
|
||||||
//If the filename contains the extension returning the name like it is (skipping the folder)
|
if (declaredExtension.equals("exe"))
|
||||||
if (declaredExtension != null && !declaredExtension.isEmpty() && !isFolder) {
|
|
||||||
logger.debug(
|
|
||||||
"The filename contains a not empty extension: " + declaredExtension + ", so returning the name like it is");
|
|
||||||
return name;
|
return name;
|
||||||
}
|
|
||||||
|
|
||||||
logger.debug("Either the name does not contains the extension or it is a folder, deriving extension from mimeType");
|
|
||||||
List<String> extensions = MimeTypeUtility.getExtension(mimeType);
|
List<String> extensions = MimeTypeUtility.getExtension(mimeType);
|
||||||
logger.debug("Extension/s available for input mimetype: " + mimeType + " into map is/are: " + extensions);
|
logger.trace("Extension/s available for input mimetype: " + mimeType + " into map is/are: " + extensions);
|
||||||
|
|
||||||
String toMimeTypeExtension = "";
|
String toMimeTypeExtension = "";
|
||||||
String fullName = name;
|
if (extensions != null) {
|
||||||
if (extensions != null && extensions.size() > 0) {
|
toMimeTypeExtension = extensions.get(extensions.size() - 1); // I'm reading the last extension in the map
|
||||||
// I'm reading the last extension in the map (myme type - list of extensions)
|
// (myme type - list of extensions)
|
||||||
toMimeTypeExtension = extensions.get(extensions.size() - 1);
|
logger.debug("Using the last extension read into list of available extensions: " + toMimeTypeExtension);
|
||||||
logger.info("Using the last extension read into list of available extensions: " + toMimeTypeExtension);
|
|
||||||
fullName = String.format("%s%s%s", name, DOT_STRING, toMimeTypeExtension);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info("returning full name:" + fullName);
|
// MANAGING ALREADY DECLARED EXTENSION IN THE FILE NAME
|
||||||
return fullName;
|
if (!declaredExtension.isEmpty() && !toMimeTypeExtension.isEmpty()) {
|
||||||
|
String dEextL = declaredExtension.toLowerCase();
|
||||||
|
String mtExtL = toMimeTypeExtension.toLowerCase();
|
||||||
|
|
||||||
|
// The extension writes in the file name is matching the mime type extension
|
||||||
|
// declared in the map
|
||||||
|
if (dEextL.equals(mtExtL)) {
|
||||||
|
logger.trace("The Extension declared in the name " + name
|
||||||
|
+ " is matching derived mime type extension so returning the input name: " + name);
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if(!dEextL.trim().contains(" ")) {
|
||||||
|
// logger.trace("The Extension declared in the name "+name+" seems a valid suffix (without other spaces) so returning the input name: "+name);
|
||||||
|
// return name;
|
||||||
|
// }
|
||||||
|
|
||||||
|
logger.debug("No logic seems to match the extension declared in the name " + declaredExtension
|
||||||
|
+ " as a valid extension so I'm adding the extension derived from mime type map: "
|
||||||
|
+ toMimeTypeExtension);
|
||||||
|
}
|
||||||
|
|
||||||
|
// CHECKING THE FOLLOWING IN ORDER TO AVOID THE DOT AS LAST CHAR OF FILENAME
|
||||||
|
if (toMimeTypeExtension.isEmpty()) {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
String fullname = String.format("%s%s%s", name, DOT_STRING, toMimeTypeExtension);
|
||||||
|
logger.trace("returning full name:" + fullname);
|
||||||
|
return fullname;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -290,10 +314,11 @@ public class MimeTypeUtility {
|
||||||
public static Map<String, String> getExtensionToMimeTypeMap() {
|
public static Map<String, String> getExtensionToMimeTypeMap() {
|
||||||
return extension_mimetype_map;
|
return extension_mimetype_map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the preview mimetype extension map with the mime types allowed for
|
* Gets the preview mimetype extension map with the
|
||||||
* preview displaying
|
* mime types allowed for preview displaying
|
||||||
*
|
*
|
||||||
* @return the preview mimetype extension map
|
* @return the preview mimetype extension map
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -181,7 +181,6 @@ text/iuls=uls
|
||||||
text/plain=bas
|
text/plain=bas
|
||||||
text/plain=c
|
text/plain=c
|
||||||
text/plain=h
|
text/plain=h
|
||||||
text/plain=asc
|
|
||||||
text/plain=txt
|
text/plain=txt
|
||||||
text/richtext=rtx
|
text/richtext=rtx
|
||||||
text/scriptlet=sct
|
text/scriptlet=sct
|
||||||
|
|
|
@ -149,7 +149,6 @@ text/iuls=uls
|
||||||
text/plain=bas
|
text/plain=bas
|
||||||
text/plain=c
|
text/plain=c
|
||||||
text/plain=h
|
text/plain=h
|
||||||
text/plain=asc
|
|
||||||
text/plain=txt
|
text/plain=txt
|
||||||
text/richtext=rtx
|
text/richtext=rtx
|
||||||
text/scriptlet=sct
|
text/scriptlet=sct
|
||||||
|
|
|
@ -175,5 +175,5 @@ public class HttpCallerUtil {
|
||||||
public void setPassword(String password) {
|
public void setPassword(String password) {
|
||||||
this.password = password;
|
this.password = password;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,71 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -38,7 +38,7 @@ public class MimeTypeUtilityTest {
|
||||||
for (String keyFileName : fileNamesToMimeTypes.keySet()) {
|
for (String keyFileName : fileNamesToMimeTypes.keySet()) {
|
||||||
try {
|
try {
|
||||||
System.out.println("\nResolving file name with extension for name: "+keyFileName);
|
System.out.println("\nResolving file name with extension for name: "+keyFileName);
|
||||||
String toFileName = MimeTypeUtility.getNameWithExtension(keyFileName, fileNamesToMimeTypes.get(keyFileName), false);
|
String toFileName = MimeTypeUtility.getNameWithExtension(keyFileName, fileNamesToMimeTypes.get(keyFileName));
|
||||||
System.out.println("Assigned the file name: "+toFileName);
|
System.out.println("Assigned the file name: "+toFileName);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
@ -3,7 +3,10 @@
|
||||||
*/
|
*/
|
||||||
package org.gcube.portlets.user.workspace;
|
package org.gcube.portlets.user.workspace;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.gcube.common.encryption.StringEncrypter;
|
import org.gcube.common.encryption.StringEncrypter;
|
||||||
|
import org.gcube.common.scope.api.ScopeProvider;
|
||||||
import org.gcube.portlets.user.workspace.server.util.StringUtil;
|
import org.gcube.portlets.user.workspace.server.util.StringUtil;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,25 +2,27 @@ package org.gcube.portlets.user.workspace.junit;
|
||||||
|
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
import org.gcube.common.scope.api.ScopeProvider;
|
||||||
import org.gcube.portlets.user.workspace.server.reader.ApplicationProfileReader;
|
import org.gcube.portlets.user.workspace.server.reader.ApplicationProfileReader;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
public class WEA_AP_Reader {
|
public class WEA_AP_Reader {
|
||||||
|
|
||||||
public static String SCOPE = "/d4science.research-infrastructures.eu";
|
String scope = "/gcube/devsec/devVRE";
|
||||||
public static String resourceName = "Workspace-Explorer-App";
|
String resourceName = "Workspace-Explorer-App";
|
||||||
public static String appID = "org.gcube.portlets.user.workspaceexplorerapp.server.WorkspaceExplorerAppServiceImpl";
|
String appID = "org.gcube.portlets.user.workspaceexplorerapp.server.WorkspaceExplorerAppServiceImpl";
|
||||||
|
|
||||||
// @Test
|
@Test
|
||||||
public void readAP() {
|
public void readAP() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// ScopeProvider.instance.set("/d4science.research-infrastructures.eu/D4Research/Limnodata");
|
// ScopeProvider.instance.set("/d4science.research-infrastructures.eu/D4Research/Limnodata");
|
||||||
ScopeProvider.instance.set(SCOPE);
|
ScopeProvider.instance.set(scope);
|
||||||
ApplicationProfileReader ap = new ApplicationProfileReader(resourceName, appID);
|
ApplicationProfileReader ap = new ApplicationProfileReader(resourceName, appID);
|
||||||
System.out.println("ApplicationProfile found: " + ap.readProfileFromInfrastrucure());
|
System.out.println("ApplicationProfile found: "+ap.readProfileFromInfrastrucure());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue