From 3af13a07e8f8b4b3c4e21f7db5e658e8fd034702 Mon Sep 17 00:00:00 2001 From: Massimiliano Assante Date: Fri, 6 May 2022 15:14:16 +0200 Subject: [PATCH] comm --- CHANGELOG.md | 1 + pom.xml | 5 ++- .../server/DBCassandraAstyanaxImpl.java | 45 ++++++++++++++----- .../portal/databook/server/DatabookStore.java | 7 +++ .../databook/shared/NotificationType.java | 27 +++++++++++ 5 files changed, 72 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7638f42..d5759f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [v1.17.0-SNAPSHOT] - 2022-04-20 + - Added support for Catalogue notifications - Ported to git ## [v1.16.1] - 2018-03-07 diff --git a/pom.xml b/pom.xml index 4fe6203..23d5215 100644 --- a/pom.xml +++ b/pom.xml @@ -24,6 +24,8 @@ 2.8.1 + 1.7 + 1.8 UTF-8 UTF-8 @@ -32,7 +34,7 @@ org.gcube.distribution maven-portal-bom - 3.7.0-SNAPSHOT + 3.6.3 pom import @@ -153,5 +155,4 @@ - \ No newline at end of file diff --git a/src/main/java/org/gcube/portal/databook/server/DBCassandraAstyanaxImpl.java b/src/main/java/org/gcube/portal/databook/server/DBCassandraAstyanaxImpl.java index bbaa32e..135f37f 100644 --- a/src/main/java/org/gcube/portal/databook/server/DBCassandraAstyanaxImpl.java +++ b/src/main/java/org/gcube/portal/databook/server/DBCassandraAstyanaxImpl.java @@ -1413,10 +1413,10 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore { * {@inheritDoc} */ @Override - public List getAllCommentByFeed(String feedid) { + public List getAllCommentByPost(String postId) { List toReturn = new ArrayList(); - PreparedIndexExpression clause = cf_Comments.newIndexClause().whereColumn("Feedid").equals().value(feedid); + PreparedIndexExpression clause = cf_Comments.newIndexClause().whereColumn("Feedid").equals().value(postId); OperationResult> result; try { result = conn.getKeyspace().prepareQuery(cf_Comments) @@ -1458,6 +1458,14 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore { } return toReturn; } + /** + * {@inheritDoc} + */ + @Override + @Deprecated + public List getAllCommentByFeed(String feedid) { + return getAllCommentByPost(feedid); + } /** * {@inheritDoc} @@ -2497,6 +2505,30 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore { else if (type.compareTo("JOB_COMPLETED_OK") == 0) { return NotificationType.JOB_COMPLETED_OK; } + else if (type.compareTo("CAT_ITEM_SUBMITTED") == 0) { + return NotificationType.CAT_ITEM_SUBMITTED; + } + else if (type.compareTo("CAT_ITEM_REJECTED") == 0) { + return NotificationType.CAT_ITEM_REJECTED; + } + else if (type.compareTo("CAT_ITEM_PUBLISHED") == 0) { + return NotificationType.CAT_ITEM_PUBLISHED; + } + else if (type.compareTo("CAT_ITEM_UPDATED") == 0) { + return NotificationType.CAT_ITEM_UPDATED; + } + else if (type.compareTo("CAT_ITEM_DELETE") == 0) { + return NotificationType.CAT_ITEM_DELETE; + } + else if (type.compareTo("TDM_TAB_RESOURCE_SHARE") == 0) { + return NotificationType.TDM_TAB_RESOURCE_SHARE; + } + else if (type.compareTo("TDM_RULE_SHARE") == 0) { + return NotificationType.TDM_RULE_SHARE; + } + else if (type.compareTo("TDM_TEMPLATE_SHARE") == 0) { + return NotificationType.TDM_TEMPLATE_SHARE; + } else if (type.compareTo("DOCUMENT_WORKFLOW_EDIT") == 0) { return NotificationType.DOCUMENT_WORKFLOW_EDIT; } @@ -2518,15 +2550,6 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore { else if (type.compareTo("DOCUMENT_WORKFLOW_FIRST_STEP_REQUEST_INVOLVMENT") == 0) { return NotificationType.DOCUMENT_WORKFLOW_FIRST_STEP_REQUEST_INVOLVMENT; } - else if (type.compareTo("TDM_TAB_RESOURCE_SHARE") == 0) { - return NotificationType.TDM_TAB_RESOURCE_SHARE; - } - else if (type.compareTo("TDM_RULE_SHARE") == 0) { - return NotificationType.TDM_RULE_SHARE; - } - else if (type.compareTo("TDM_TEMPLATE_SHARE") == 0) { - return NotificationType.TDM_TEMPLATE_SHARE; - } else if (type.compareTo("GENERIC") == 0) { return NotificationType.GENERIC; } diff --git a/src/main/java/org/gcube/portal/databook/server/DatabookStore.java b/src/main/java/org/gcube/portal/databook/server/DatabookStore.java index 09c8531..3ab9b9b 100644 --- a/src/main/java/org/gcube/portal/databook/server/DatabookStore.java +++ b/src/main/java/org/gcube/portal/databook/server/DatabookStore.java @@ -298,10 +298,17 @@ public interface DatabookStore { */ boolean addComment(Comment comment) throws FeedIDNotFoundException; /** + * @deprecated use {@link #getAllCommentByPost()} instead. * @param feedid feed identifier * return all the comments belonging to the feedid */ + @Deprecated List getAllCommentByFeed(String feedid); + /** + * @param feedid feed identifier + * return all the comments belonging to the feedid + */ + List getAllCommentByPost(String postId); /** * @param userid user identifier * @param timeInMillis time in milliseconds from which you want to start retrieve the feeds diff --git a/src/main/java/org/gcube/portal/databook/shared/NotificationType.java b/src/main/java/org/gcube/portal/databook/shared/NotificationType.java index 2d7a03a..89e9cca 100644 --- a/src/main/java/org/gcube/portal/databook/shared/NotificationType.java +++ b/src/main/java/org/gcube/portal/databook/shared/NotificationType.java @@ -12,14 +12,17 @@ public enum NotificationType { /** * use to notify a user he got a Tabular Resource shared */ + @Deprecated TDM_TAB_RESOURCE_SHARE, /** * use to notify a user he got a TDM Rule shared */ + @Deprecated TDM_RULE_SHARE, /** * use to notify a user he got a TDM Templated shared */ + @Deprecated TDM_TEMPLATE_SHARE, /** * use to notify a user he got a workspace folder shared @@ -85,6 +88,26 @@ public enum NotificationType { * use to notify a user he got a message */ MESSAGE, + /** + * catalogue, use to notify someone submits an item for consideration + */ + CAT_ITEM_SUBMITTED, + /** + * catalogue, use to notify someone rejected a submitted item + */ + CAT_ITEM_REJECTED, + /** + * catalogue, use to notify someone published an item + */ + CAT_ITEM_PUBLISHED, + /** + * catalogue, use to notify someone updated an item + */ + CAT_ITEM_UPDATED, + /** + * catalogue, use to notify someone removed an item + */ + CAT_ITEM_DELETE, /** * use to notify every user of a VRE/Group that the post was made */ @@ -92,18 +115,22 @@ public enum NotificationType { /** * use to notify a user that someone in his VRE created a new Event in the Calendar */ + @Deprecated CALENDAR_ADDED_EVENT, /** * use to notify a user that someone in his VRE updated an Event in the Calendar */ + @Deprecated CALENDAR_UPDATED_EVENT, /** * use to notify a user that someone in his VRE deleted an Event in the Calendar */ + @Deprecated CALENDAR_DELETED_EVENT, /** * use to notify a user he got a connections request */ + @Deprecated REQUEST_CONNECTION, /** * use to notify a user he got a job completed ok