fixed the issue on getWorkspaceFolderURL method

This commit is contained in:
Massimiliano Assante 2021-04-22 14:57:38 +02:00
parent b204c9f343
commit 9b1c436756
1 changed files with 10 additions and 0 deletions

View File

@ -27,6 +27,7 @@ import org.gcube.portlets.user.wswidget.shared.WSItem;
import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.util.PortalUtil;
public class StorageHubServiceUtil { public class StorageHubServiceUtil {
private static Log _log = LogFactoryUtil.getLog(StorageHubServiceUtil.class); private static Log _log = LogFactoryUtil.getLog(StorageHubServiceUtil.class);
@ -141,6 +142,15 @@ public class StorageHubServiceUtil {
String toReturn = siteLandingPagePath; String toReturn = siteLandingPagePath;
try { try {
String currentContext = Utils.getCurrentContext(request);
try {
long userId = PortalUtil.getUser(request).getUserId();
JWTToken umaToken = OIDCUmaUtil.getUMAToken(request, userId, currentContext);
UmaJWTProvider.instance.set(umaToken.getRaw());
} catch (Exception e1) {
e1.printStackTrace();
}
ScopeProvider.instance.set(currentContext);
WorkspaceManagerClient wsclient = AbstractPlugin.workspace().build(); WorkspaceManagerClient wsclient = AbstractPlugin.workspace().build();
String itemId = wsclient.getVreFolder("hl:accounting").getId(); String itemId = wsclient.getVreFolder("hl:accounting").getId();
toReturn = new String(new StringBuffer(siteLandingPagePath) toReturn = new String(new StringBuffer(siteLandingPagePath)