diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c3f65a..0108dc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [v1.2.1-SNAPSHOT] - 2023-02-06 + +**Enhancements** + +- [#23692] Changed interface 'approveItem' adding the parameter socialPost + ## [v1.2.0] - 2022-08-01 **Enhancements** diff --git a/pom.xml b/pom.xml index 7ef0fe7..ef0e60b 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.gcube.datacatalogue catalogue-util-library - 1.2.0 + 1.2.1-SNAPSHOT Ckan utility library Utility library to retrieve users information, organizations information and so on from the ckan d4science datacatalogue diff --git a/src/main/java/org/gcube/datacatalogue/utillibrary/gcat/GCatCaller.java b/src/main/java/org/gcube/datacatalogue/utillibrary/gcat/GCatCaller.java index 6179bde..2770259 100644 --- a/src/main/java/org/gcube/datacatalogue/utillibrary/gcat/GCatCaller.java +++ b/src/main/java/org/gcube/datacatalogue/utillibrary/gcat/GCatCaller.java @@ -167,16 +167,18 @@ public class GCatCaller { * * @param datasetName the dataset name * @param moderatorMessage the moderator message + * @param sendSocialPost the send social post. If 'true` sends the social post * @return the string * @throws WebApplicationException the web application exception * @throws MalformedURLException the malformed URL exception */ - public String approveItem(String datasetName, String moderatorMessage) + public String approveItem(String datasetName, String moderatorMessage, Boolean sendSocialPost) throws WebApplicationException, MalformedURLException { LOG.trace("approveItem called"); - LOG.info("Calling approve item with name: " + datasetName + ", and msg: " + moderatorMessage); + LOG.info("Calling approve item with name: " + datasetName + ", sendSocialPost: " + sendSocialPost + + ", msg: " + moderatorMessage); - return new Item().approve(datasetName, moderatorMessage); + return new Item().approve(datasetName, moderatorMessage, sendSocialPost); } @@ -239,8 +241,8 @@ public class GCatCaller { LOG.info("called getListItemsForCMStatus called with [status: " + status + "], [limit: " + limit + "], [offset: " + offset + "], [filters: " + filters + "]"); - Map queryParams = GCatCallerUtil.genericQueryBuilderFor(status, limit, offset, false, allFields, filters, - sortForField); + Map queryParams = GCatCallerUtil.genericQueryBuilderFor(status, limit, offset, false, allFields, + filters, sortForField); return getListItemsForQuery(queryParams); } diff --git a/src/main/java/org/gcube/datacatalogue/utillibrary/server/cms/CatalogueContentModeratorSystem.java b/src/main/java/org/gcube/datacatalogue/utillibrary/server/cms/CatalogueContentModeratorSystem.java index 0af1cd8..12f081a 100644 --- a/src/main/java/org/gcube/datacatalogue/utillibrary/server/cms/CatalogueContentModeratorSystem.java +++ b/src/main/java/org/gcube/datacatalogue/utillibrary/server/cms/CatalogueContentModeratorSystem.java @@ -82,10 +82,11 @@ public interface CatalogueContentModeratorSystem { * * @param itemName the item name * @param moderatorMessage the moderator message + * @param sendSocialPost the send social post. If 'true` sends the social post * @throws WebApplicationException the web application exception * @throws MalformedURLException the malformed URL exception */ - void approveItem(String itemName, String moderatorMessage) throws WebApplicationException, MalformedURLException; + void approveItem(String itemName, String moderatorMessage, Boolean sendSocialPost) throws WebApplicationException, MalformedURLException; diff --git a/src/main/java/org/gcube/datacatalogue/utillibrary/server/cms/DataCatalogueCMSImpl.java b/src/main/java/org/gcube/datacatalogue/utillibrary/server/cms/DataCatalogueCMSImpl.java index 40aba2a..859ed4d 100644 --- a/src/main/java/org/gcube/datacatalogue/utillibrary/server/cms/DataCatalogueCMSImpl.java +++ b/src/main/java/org/gcube/datacatalogue/utillibrary/server/cms/DataCatalogueCMSImpl.java @@ -65,13 +65,14 @@ public class DataCatalogueCMSImpl implements CatalogueContentModeratorSystem { * * @param datasetName the dataset name * @param moderatorMessage the moderator message + * @param sendSocialPost the send social post. If 'true` sends the social post * @throws WebApplicationException the web application exception * @throws MalformedURLException the malformed URL exception */ @Override - public void approveItem(String datasetName, String moderatorMessage) + public void approveItem(String datasetName, String moderatorMessage, Boolean sendSocialPost) throws WebApplicationException, MalformedURLException { - gCatCaller.approveItem(datasetName, moderatorMessage); + gCatCaller.approveItem(datasetName, moderatorMessage, sendSocialPost); }