diff --git a/src/main/java/org/gcube/datacatalogue/grsf_manage_widget/server/manage/GRSFNotificationService.java b/src/main/java/org/gcube/datacatalogue/grsf_manage_widget/server/manage/GRSFNotificationService.java index e62282e..48377f4 100644 --- a/src/main/java/org/gcube/datacatalogue/grsf_manage_widget/server/manage/GRSFNotificationService.java +++ b/src/main/java/org/gcube/datacatalogue/grsf_manage_widget/server/manage/GRSFNotificationService.java @@ -324,7 +324,8 @@ public class GRSFNotificationService extends RemoteServiceServlet implements GRS String context = Utils.getScopeFromClientUrl(getThreadLocalRequest()); DataCatalogue catalogue = getCatalogue(context); - + String administratorFullName = Utils.getCurrentUser(getThreadLocalRequest()).getFullname(); + String username = Utils.getCurrentUser(getThreadLocalRequest()).getUsername(); // check if the base url of the service is in session String keyPerContext = UtilMethods.concatenateSessionKeyScope(Constants.GRSF_UPDATER_SERVICE, context); String baseUrl = (String)getThreadLocalRequest().getSession().getAttribute(keyPerContext); @@ -332,7 +333,7 @@ public class GRSFNotificationService extends RemoteServiceServlet implements GRS baseUrl = Utils.discoverEndPoint(context); getThreadLocalRequest().getSession().setAttribute(keyPerContext, baseUrl); } - return Utils.updateRecord(baseUrl, bean, catalogue, Utils.getCurrentUser(getThreadLocalRequest()).getUsername()); + return Utils.updateRecord(baseUrl, bean, catalogue, username, administratorFullName); }catch(Exception e){ logger.error("Unable to update the product.." + e.getMessage()); diff --git a/src/main/java/org/gcube/datacatalogue/grsf_manage_widget/server/manage/Utils.java b/src/main/java/org/gcube/datacatalogue/grsf_manage_widget/server/manage/Utils.java index 0554723..7c4a63a 100644 --- a/src/main/java/org/gcube/datacatalogue/grsf_manage_widget/server/manage/Utils.java +++ b/src/main/java/org/gcube/datacatalogue/grsf_manage_widget/server/manage/Utils.java @@ -258,7 +258,8 @@ public class Utils { * @return true on success, false otherwise */ @SuppressWarnings("unchecked") - public static String updateRecord(String serviceUrl, ManageProductBean bean, DataCatalogue catalogue, String username) throws Exception{ + public static String updateRecord(String serviceUrl, ManageProductBean bean, DataCatalogue catalogue, String username, + String fullName) throws Exception{ if(serviceUrl == null) throw new IllegalArgumentException("GRSF Updater service url cannot be null"); @@ -269,6 +270,7 @@ public class Utils { try(CloseableHttpClient httpClient = HttpClientBuilder.create().build();){ JSONObject obj = new JSONObject(); + obj.put(Constants.ADMINISTRATOR_FULLNAME, fullName); obj.put(Constants.CATALOGUE_ID, bean.getCatalogueIdentifier()); obj.put(Constants.KB_ID, bean.getKnowledgeBaseIdentifier()); obj.put(Constants.NEW_STATUS, bean.getNewStatus().toString().toLowerCase());