From fcb1370bd9ae4c6cb6f79fe7ac441bb2d4829dd0 Mon Sep 17 00:00:00 2001 From: Francesco Mangiacrapa Date: Mon, 25 Mar 2019 10:54:07 +0000 Subject: [PATCH] changed utils method to be able to send a post by social-service in testing mode git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/widgets/grsf-manage-widget@178680 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../grsf_manage_widget/server/manage/Utils.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) 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 a40dea4..07e0492 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 @@ -194,13 +194,18 @@ public class Utils { throw new IllegalArgumentException("Item bean to manage cannot be null"); try(CloseableHttpClient httpClient = HttpClientBuilder.create().build();){ - - // send update to the knowledge base - GRSFUpdaterServiceClient.updateKB(httpClient, serviceUrl, bean, catalogue, username, fullName); - // if there are merges, update the status of the other involved records - if(bean.isMergesInvolved()) - updateStatusInvolvedRecords(bean, catalogue); + //ADDED BY FRANCESCO + if(Utils.isIntoPortal()) { + + // send update to the knowledge base + GRSFUpdaterServiceClient.updateKB(httpClient, serviceUrl, bean, catalogue, username, fullName); + + // if there are merges, update the status of the other involved records + if(bean.isMergesInvolved()) + updateStatusInvolvedRecords(bean, catalogue); + + } // require social networking url final String baseUrlSocial = SocialCommunications.getBaseUrlSocialService(httpServletRequest);