Compare commits

..

No commits in common. "master" and "Bug/21794" have entirely different histories.

4 changed files with 17 additions and 33 deletions

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
@ -8,8 +7,7 @@
<wb-module deploy-name="workspace-widget-portlet">
@ -17,8 +15,7 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -26,8 +23,7 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -35,13 +31,11 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
@ -49,8 +43,7 @@
<property name="context-root" value="workspace-widget-portlet"/>
@ -58,8 +51,7 @@
<property name="java-output-path" value="/workspace-widget-portlet/target/classes"/>
@ -67,8 +59,7 @@
</wb-module>

View File

@ -4,12 +4,7 @@
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).
## [v1.5.2] - 2021-10-04
- Feature #22109 Workspace widget to load VRE Folders without using JCR indices
## [v1.5.1] - 2021-07-13
## [v1.5.1-SNAPSHOT] - 2021-05-25
- Feature #21507 support new UMATokensProvider class
- Bug #21794 folder names were not URI encoded

View File

@ -13,7 +13,7 @@
<artifactId>workspace-widget-portlet</artifactId>
<packaging>war</packaging>
<name>workspace-widget-portlet Portlet</name>
<version>1.5.2</version>
<version>1.5.1-SNAPSHOT</version>
<description>
Workspace Widget Portlet is a small Front-end component looking like G Drive which exposes the content of the user's workspace or VRE Folders in read only mode.
</description>

View File

@ -3,7 +3,6 @@ package org.gcube.portlets.user.wswidget;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.Scanner;
import javax.portlet.PortletException;
@ -28,11 +27,14 @@ import org.gcube.common.storagehub.model.items.Item;
import org.gcube.oidc.rest.JWTToken;
import org.gcube.portal.oidc.lr62.JWTTokenUtil;
import org.gcube.portal.oidc.lr62.OIDCUmaUtil;
import org.gcube.portlets.user.wswidget.shared.AuthorizedUser;
import org.gcube.portlets.user.wswidget.shared.Breadcrumb;
import org.gcube.portlets.user.wswidget.shared.WSItem;
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.json.JSONArray;
import com.liferay.portal.kernel.json.JSONFactoryUtil;
import com.liferay.portal.kernel.json.JSONObject;
@ -112,6 +114,7 @@ public class WorkspaceWidget extends MVCPortlet {
String cmd = ParamUtil.getString(resourceRequest, "cmd", "");
String selectedItemId = "root";
String selectedItemName = "";
System.out.println("****\n\n\n*** String cmd2 ="+cmd);
if (cmd != null && cmd.split("_selectedName").length > 1) {
String[] splits = cmd.split("_selectedName");
selectedItemId = splits[0].split("=")[1];
@ -141,13 +144,8 @@ public class WorkspaceWidget extends MVCPortlet {
toSet = new Breadcrumb(itemId, Utils.getCurrentUser(request).getFirstName()+"\'s home");
request.getPortletSession().setAttribute(BREADCRUMB_ATTR, toSet, PortletSession.APPLICATION_SCOPE);
} else { //is in a VRE
_log.debug("looking for vre context");
String context = Utils.getCurrentContext(request);
final String vreContext = context.replace("/", "-").substring(1); //shub expects this name, e.g. gcube-devsec-devVRE
_log.debug("shub vre name to look for: "+vreContext);
StorageHubClient shc = new StorageHubClient();
Optional<ItemContainer<? extends Item>> vreContainer = shc.getVREFolders().getContainers().stream().filter(v -> v.get().getTitle().equals(vreContext)).findFirst();
itemId = vreContainer.get().getId();
WorkspaceManagerClient wsclient = AbstractPlugin.workspace().build();
itemId = wsclient.getVreFolder("hl:accounting").getId();
itemsList = StorageHubServiceUtil.getItemChildren(authUser, itemId, itemId, start, offset);
String groupName = GroupLocalServiceUtil.getGroup(groupId).getName();
groupName = groupName.replace("_", " ");