From c02408cc9076afb41a3f9f1a4b3adcf233f92cae Mon Sep 17 00:00:00 2001 From: Ahmed Ibrahim Date: Tue, 21 Nov 2023 18:37:45 +0100 Subject: [PATCH] Implementation of databookstore using social client REST API --- .../server/DBCassandraAstyanaxImpl.java | 30 ++----------------- 1 file changed, 3 insertions(+), 27 deletions(-) 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 a205562..2293422 100644 --- a/src/main/java/org/gcube/portal/databook/server/DBCassandraAstyanaxImpl.java +++ b/src/main/java/org/gcube/portal/databook/server/DBCassandraAstyanaxImpl.java @@ -170,19 +170,7 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore { */ @Override public boolean saveUserPost(Post post, List attachments) { - if (attachments != null && !attachments.isEmpty()) - post.setMultiFileUpload(true); - boolean savePostResult = saveUserPost(post); - if (savePostResult) { - String postkey = post.getKey(); - for (Attachment attachment : attachments) { - boolean attachSaveResult = postClient.saveAttachmentEntryLib(postkey, attachment); - if (!attachSaveResult) - _log.warn("Some of the attachments failed to be saved: " + attachment.getName()); - } - return true; - } - else return false; + return postClient.saveUserPostLib(post, attachments); } /** @@ -213,19 +201,7 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore { */ @Override public boolean saveAppPost(Post post, List attachments) { - if (attachments != null && !attachments.isEmpty()) - post.setMultiFileUpload(true); - boolean saveFeedResult = saveAppPost(post); - if (saveFeedResult) { - String feedKey = post.getKey(); - for (Attachment attachment : attachments) { - boolean attachSaveResult = postClient.saveAttachmentEntryLib(feedKey, attachment); - if (!attachSaveResult) - _log.warn("Some of the attachments failed to be saved: " + attachment.getName()); - } - return true; - } - else return false; + return postClient.saveAppPostLib(post, attachments); } /** * {@inheritDoc} @@ -826,7 +802,7 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore { */ @Override public List getVREFeedsByHashtag(String vreid, String hashtag) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, FeedIDNotFoundException, ColumnNameNotFoundException { - return hashTagClient.getVREFeedsByHashtagLib(vreid, hashtag); + return null; } /** * {@inheritDoc}