From 07e66d5dedf5fc1a0dc695f5435100fee42c8117 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Tue, 2 Mar 2021 16:02:51 +0100 Subject: [PATCH] aligned with 'deleteResourceFromDataset(String resourceId, String username)' --- .../server/CKANPublisherServicesImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/CKANPublisherServicesImpl.java b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/CKANPublisherServicesImpl.java index 4d1674c..df034cc 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/CKANPublisherServicesImpl.java +++ b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/CKANPublisherServicesImpl.java @@ -553,7 +553,8 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C // get the scope in which we should discover the ckan instance given the organization name in which the dataset was created String scope = getScopeFromOrgName(resource.getOrganizationNameDatasetParent()); DataCatalogue catalogue = getCatalogue(scope); - deleted = catalogue.deleteResourceFromDataset(resource.getOriginalIdInWorkspace()); + String username = GenericUtils.getCurrentUser(getThreadLocalRequest()).getUsername(); + deleted = catalogue.deleteResourceFromDataset(resource.getOriginalIdInWorkspace(),username); if(deleted){ logger.info("Resource described by " + resource + " deleted"); }else @@ -619,7 +620,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C */ private String getScopeFromOrgName(String orgName){ - logger.debug("Request for scope related to orgName " + orgName + "[ map that will be used is " + mapOrganizationScope.toString() + " ]"); + logger.info("Request for scope related to orgName " + orgName + " [map that will be used is " + mapOrganizationScope.toString() + "]"); if(orgName == null || orgName.isEmpty()) throw new IllegalArgumentException("orgName cannot be empty or null!"); @@ -647,7 +648,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C toReturn = GenericUtils.getCurrentContext(this.getThreadLocalRequest(), false); mapOrganizationScope.put(orgName, toReturn); } - logger.debug("Returning scope " + toReturn); + logger.info("Returning scope " + toReturn); return toReturn; }