diff --git a/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/server/manage/GRSFNotificationService.java b/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/server/manage/GRSFNotificationService.java index 6893cbb..8479fa3 100644 --- a/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/server/manage/GRSFNotificationService.java +++ b/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/server/manage/GRSFNotificationService.java @@ -122,7 +122,7 @@ public class GRSFNotificationService { String annotation = bean.getAnnotation(); if(annotation != null) - obj.put(ANNOTATION, annotation); + obj.put(ANNOTATION, annotation.replaceAll("\"", "")); logger.debug("Update request looks like " + obj.toJSONString()); diff --git a/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/server/manage/PatchProductThread.java b/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/server/manage/PatchProductThread.java index 746ee5a..d49b2a3 100644 --- a/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/server/manage/PatchProductThread.java +++ b/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/server/manage/PatchProductThread.java @@ -48,19 +48,19 @@ public class PatchProductThread extends Thread{ // remove the "Status" field catalogue.removeCustomField(bean.getCatalogueIdentifier(), STATUS_CUSTOM_FIELD_KEY, bean.getCurrentStatus().toString(), apiKey); catalogue.removeTag(bean.getCatalogueIdentifier(), apiKey, bean.getCurrentStatus().toString()); - catalogue.removeDatasetFromGroup(bean.getCurrentStatus().toString().toLowerCase(), bean.getCatalogueIdentifier(), apiKey); + catalogue.removeDatasetFromGroup("grsf" + "-" + bean.getCurrentStatus().toString().toLowerCase(), bean.getCatalogueIdentifier(), apiKey); Map> statusMap = new HashMap>(); statusMap.put(STATUS_CUSTOM_FIELD_KEY, Arrays.asList(bean.getNewStatus().toString())); - statusMap.put(ANNOTATION_KEY, Arrays.asList("date = " + DATE_FORMAT.format(new Date()) - + ", admin = " + username - + ", annotation = " + (bean.getAnnotation() != null ? bean.getAnnotation() : "none") - + ", new status = " + bean.getNewStatus().toString() - + ", old status = " + bean.getCurrentStatus().toString() + statusMap.put(ANNOTATION_KEY, Arrays.asList("date: " + DATE_FORMAT.format(new Date()) + + ", admin: " + username + + ", annotation: " + (bean.getAnnotation() != null ? bean.getAnnotation().replaceAll("\"", "") : "none") + + ", new status: " + bean.getNewStatus().toString() + + ", old status: " + bean.getCurrentStatus().toString() )); catalogue.patchProductCustomFields(bean.getCatalogueIdentifier(), apiKey, statusMap); catalogue.addTag(bean.getCatalogueIdentifier(), apiKey, bean.getNewStatus().toString()); - catalogue.assignDatasetToGroup(bean.getCurrentStatus().toString().toLowerCase(), bean.getCatalogueIdentifier(), apiKey); + catalogue.assignDatasetToGroup("grsf" + "-" + bean.getCurrentStatus().toString().toLowerCase(), bean.getCatalogueIdentifier(), apiKey); logger.info("Record patched ..."); }