From ca4f796b72e091e9beb8e6743289dab99b358d1f Mon Sep 17 00:00:00 2001 From: Costantino Perciante Date: Sat, 10 Dec 2016 12:33:47 +0000 Subject: [PATCH] annotation key was missed git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@139889 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../server/manage/GRSFNotificationService.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 55c4b67..a7c99b8 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 @@ -208,16 +208,18 @@ public class GRSFNotificationService { // add the new one and the annotation message JSONObject newStatus = new JSONObject(); - newStatus.put(STATUS_CUSTOM_FIELD_KEY, bean.getNewStatus().toString()); + newStatus.put("key", STATUS_CUSTOM_FIELD_KEY); + newStatus.put("value", bean.getNewStatus().toString()); customFieldsAsJson.add(newStatus); JSONObject newAnnotation = new JSONObject(); - newAnnotation.put(ANNOTATION_KEY, Arrays.asList("date: " + DATE_FORMAT.format(new Date()) + newAnnotation.put("key", ANNOTATION_KEY); + newAnnotation.put("value", "date: " + DATE_FORMAT.format(new Date()) + ", admin: " + new LiferayUserManager().getUserByUsername(username).getFullname() + ", message: " + (bean.getAnnotation() != null ? bean.getAnnotation().replaceAll("\"", "") : "none") + ", old status: " + bean.getCurrentStatus().toString() + ", new status: " + bean.getNewStatus().toString() - )); + ); customFieldsAsJson.add(newAnnotation); // manage the tags @@ -238,6 +240,7 @@ public class GRSFNotificationService { // add the new one JSONObject newTag = new JSONObject(); newTag.put("name", bean.getNewStatus().toString()); + newTag.put("display_name", bean.getNewStatus().toString()); tagsAsJson.add(newTag); // manage the groups