From d730066655192c6addd92ba8816e36fa39d1c007 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Thu, 26 Jan 2023 12:27:58 +0100 Subject: [PATCH 1/5] Moved to 2.2.5-SNAPSHOT. Integrating feature #23903 --- .classpath | 6 +-- .../com.gwtplugins.gdt.eclipse.core.prefs | 2 +- .settings/org.eclipse.wst.common.component | 50 +++++++++++++++---- CHANGELOG.md | 6 +++ pom.xml | 2 +- .../GcubeCkanDataCatalogServiceImpl.java | 1 + 6 files changed, 52 insertions(+), 15 deletions(-) diff --git a/.classpath b/.classpath index 597f1a2..7826cdd 100644 --- a/.classpath +++ b/.classpath @@ -1,12 +1,12 @@ - + - + @@ -35,5 +35,5 @@ - + diff --git a/.settings/com.gwtplugins.gdt.eclipse.core.prefs b/.settings/com.gwtplugins.gdt.eclipse.core.prefs index 113de54..7e5f92e 100644 --- a/.settings/com.gwtplugins.gdt.eclipse.core.prefs +++ b/.settings/com.gwtplugins.gdt.eclipse.core.prefs @@ -1,6 +1,6 @@ >>>>>>>=refs/heads/task_20699 eclipse.preferences.version=1 jarsExcludedFromWebInfLib= -lastWarOutDir=/home/francescomangiacrapa/git/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-2.2.4-SNAPSHOT +lastWarOutDir=/home/francescomangiacrapa/git/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-2.2.5-SNAPSHOT warSrcDir=src/main/webapp warSrcDirIsOutput=false diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 7e8d7ef..a5e1088 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,5 @@ - + @@ -31,8 +31,14 @@ - - + + + + + + + + @@ -65,7 +71,10 @@ - + + + + @@ -98,7 +107,10 @@ - + + + + @@ -131,7 +143,10 @@ - + + + + @@ -164,7 +179,13 @@ - + + uses + + + + + @@ -197,7 +218,10 @@ - + + + + @@ -230,7 +254,10 @@ - + + + + @@ -263,7 +290,10 @@ - + + + + diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b5b5f1..8edc215 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). +## [v2.2.5-SNAPSHOT] - 2023-01-26 + +#### Enhancements + +- [#23903] Catalogue Moderation: allow to send a message to the moderators + ## [v2.2.4] - 2022-10-27 #### Enhancements diff --git a/pom.xml b/pom.xml index 80e754e..4442e9a 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ org.gcube.portlets.gcubeckan gcube-ckan-datacatalog war - 2.2.4 + 2.2.5-SNAPSHOT gCube CKAN Data Catalog The gCube CKAN Data Catalog portlet diff --git a/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/server/GcubeCkanDataCatalogServiceImpl.java b/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/server/GcubeCkanDataCatalogServiceImpl.java index 2ff0c7d..d7d34d8 100644 --- a/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/server/GcubeCkanDataCatalogServiceImpl.java +++ b/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/server/GcubeCkanDataCatalogServiceImpl.java @@ -552,6 +552,7 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem String scopePerCurrentUrl = SessionUtil.getScopeFromClientUrl(getThreadLocalRequest()); DataCatalogue catalogue = getCatalogue(scopePerCurrentUrl); boolean moderationEnabled = catalogue.isModerationEnabled(reloadConfig); + logger.info("moderation Enabled? "+moderationEnabled); return new ManageProductResponse(moderationEnabled, scopePerCurrentUrl); } From 45c178579b39877fe3a73714badd12a6d73dd8c3 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Fri, 27 Jan 2023 15:16:52 +0100 Subject: [PATCH 2/5] removed commented servlets --- .settings/org.eclipse.wst.common.component | 47 +++++++++++++++++----- CHANGELOG.md | 1 + pom.xml | 13 ++++-- src/main/webapp/WEB-INF/web.xml | 17 -------- 4 files changed, 48 insertions(+), 30 deletions(-) diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index a5e1088..be08aff 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,8 @@ - + + + + @@ -35,7 +38,10 @@ - + + + + @@ -71,7 +77,10 @@ - + + + + @@ -107,7 +116,10 @@ - + + + + @@ -143,7 +155,10 @@ - + + + + @@ -179,10 +194,13 @@ - + uses - + + + + @@ -218,7 +236,10 @@ - + + + + @@ -254,7 +275,10 @@ - + + + + @@ -290,7 +314,10 @@ - + + + + diff --git a/CHANGELOG.md b/CHANGELOG.md index 8edc215..3e9c83b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm #### Enhancements - [#23903] Catalogue Moderation: allow to send a message to the moderators +- Moved to gwt 2.10.0 ## [v2.2.4] - 2022-10-27 diff --git a/pom.xml b/pom.xml index 4442e9a..5c80528 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ - 2.9.0 + 2.10.0 ${project.build.directory}/${project.build.finalName} UTF-8 @@ -40,7 +40,7 @@ org.gcube.distribution maven-portal-bom - 3.6.4 + 3.7.0-SNAPSHOT pom import @@ -59,6 +59,13 @@ + + + + + + + com.google.gwt gwt-user @@ -75,7 +82,7 @@ com.google.gwt gwt-servlet ${gwtVersion} - runtime + provided com.github.gwtbootstrap diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 3d0747d..748e3fb 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -11,13 +11,6 @@ /gcube/service/connect - - - - - - ckan connector logout from CKAN CkanConnectorLogout @@ -30,16 +23,6 @@ org.gcube.portlets.gcubeckan.gcubeckandatacatalog.server.GcubeCkanDataCatalogServiceImpl - - - - - - - - - - ckanpublisherservices org.gcube.portlets.widgets.ckandatapublisherwidget.server.CKANPublisherServicesImpl From b1a17f1ea50aa9bcc2d61a55564bff5d40f39a60 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Fri, 27 Jan 2023 16:35:35 +0100 Subject: [PATCH 3/5] #24309 done --- CHANGELOG.md | 1 + .../view/CkanMetadataManagementPanel.java | 36 ++++++++++++++++--- .../view/GCubeCkanDataCatalogPanel.java | 8 +++-- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e9c83b..8802776 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm #### Enhancements - [#23903] Catalogue Moderation: allow to send a message to the moderators +- [#24309] Inform the VRE users that the catalogue is moderated - Moved to gwt 2.10.0 ## [v2.2.4] - 2022-10-27 diff --git a/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/view/CkanMetadataManagementPanel.java b/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/view/CkanMetadataManagementPanel.java index 78271c0..c77f5c7 100644 --- a/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/view/CkanMetadataManagementPanel.java +++ b/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/view/CkanMetadataManagementPanel.java @@ -16,6 +16,7 @@ import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowOrgani import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowStatisticsEvent; import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowTypesEvent; +import com.github.gwtbootstrap.client.ui.Alert; import com.github.gwtbootstrap.client.ui.AlertBlock; import com.github.gwtbootstrap.client.ui.Button; import com.github.gwtbootstrap.client.ui.constants.AlertType; @@ -23,6 +24,7 @@ import com.github.gwtbootstrap.client.ui.constants.ButtonType; import com.github.gwtbootstrap.client.ui.constants.IconType; import com.google.gwt.dom.client.Style.Float; import com.google.gwt.dom.client.Style.FontWeight; +import com.google.gwt.dom.client.Style.TextAlign; import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; @@ -39,6 +41,10 @@ import com.google.gwt.user.client.ui.InlineHTML; */ public class CkanMetadataManagementPanel extends FlowPanel { + private static final String MESSAGE_MODERATED_CATALOGUE = "Controlled Catalogue"; + + public static final String CATALOGUE_ITEMS_WERE_APPROVED_BY_CATALOGUE_MODERATOR_S = "Catalogue items were approved by Catalogue Moderator(s)."; + /** * */ @@ -74,8 +80,11 @@ public class CkanMetadataManagementPanel extends FlowPanel { private Button uploadToZenodo = new Button("Upload to Zenodo"); private Button insertMeta = new Button("Publish Item"); private Button editMeta = new Button("Edit Item"); - private Button manageGRSFProduct = new Button("Manage GRSF Item"); //GRSF Manage - private Button manageCModS = new Button("Manage Items"); //Moderation + private Button manageGRSFProduct = new Button("Manage GRSF Item"); // GRSF Manage + private Button manageCModS = new Button("Manage Items"); // Moderation + + private Alert messageModerationEnanbled = new Alert(MESSAGE_MODERATED_CATALOGUE); // Moderation message + private HandlerManager eventBus; /** @@ -111,6 +120,11 @@ public class CkanMetadataManagementPanel extends FlowPanel { manageCModS.setType(ButtonType.PRIMARY); manageCModS.getElement().getStyle().setFloat(Float.RIGHT); manageCModS.getElement().getStyle().setMarginRight(20, Unit.PX); + messageModerationEnanbled.setType(AlertType.INFO); + messageModerationEnanbled.setClose(false); + //messageModerationEnanbled.addStyleName("moderation-message"); + messageModerationEnanbled.getElement().getStyle().setTextAlign(TextAlign.CENTER); + messageModerationEnanbled.setTitle(CATALOGUE_ITEMS_WERE_APPROVED_BY_CATALOGUE_MODERATOR_S); // set icons home.setIcon(IconType.HOME); @@ -138,6 +152,7 @@ public class CkanMetadataManagementPanel extends FlowPanel { manageGRSFProduct.setEnabled(false); manageCModS.setVisible(false); manageCModS.setEnabled(false); + messageModerationEnanbled.setVisible(false); // manage GRSF item info manageGRSFProduct.setTitle(MANAGE_GRSF_ITEM_TOOLTIP); @@ -147,6 +162,7 @@ public class CkanMetadataManagementPanel extends FlowPanel { manageCModS.setTitle(MANAGE_CMS_ITEMS_TOOLTIP); manageCModS.getElement().getStyle().setFontWeight(FontWeight.BOLD); + nav.add(messageModerationEnanbled); // add to navigation bar nav.add(home); nav.add(organizations); @@ -374,7 +390,8 @@ public class CkanMetadataManagementPanel extends FlowPanel { } /** - * Button to manage the products under moderation via Content Moderation System (CMS) + * Button to manage the products under moderation via Content Moderation System + * (CMS) * * @param value true or false */ @@ -382,6 +399,17 @@ public class CkanMetadataManagementPanel extends FlowPanel { manageCModS.setVisible(value); } + + /** + * Show message catalogue is moderated. + * + * @param isContentModerationEnabled the is content moderation enabled + */ + public void showMessageCatalogueIsModerated(boolean isContentModerationEnabled) { + messageModerationEnanbled.setVisible(isContentModerationEnabled); + + } + /** * Enable manage CMS products button. * @@ -408,7 +436,7 @@ public class CkanMetadataManagementPanel extends FlowPanel { public void enablePublishOnZenodoButton(boolean value) { uploadToZenodo.setEnabled(value); } - + /** * Visibility publish on zenodo button. * diff --git a/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/view/GCubeCkanDataCatalogPanel.java b/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/view/GCubeCkanDataCatalogPanel.java index 95780b6..5099582 100644 --- a/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/view/GCubeCkanDataCatalogPanel.java +++ b/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/view/GCubeCkanDataCatalogPanel.java @@ -109,13 +109,13 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate { String queryStringParameter = paramsMap.get(GCubeCkanDataCatalog.GET_QUERY_STRING_PARAMETER); if (queryStringParameter != null) { - GWT.log("Read "+GCubeCkanDataCatalog.GET_QUERY_STRING_PARAMETER+ " as: "+queryStringParameter); + GWT.log("Read " + GCubeCkanDataCatalog.GET_QUERY_STRING_PARAMETER + " as: " + queryStringParameter); String base64DecodeQueryString = QueryStringUtil.base64DecodeQueryString(queryStringParameter); ModerationBuilder moderationBuilder = new ModerationQueryStringUtil() .toModerationBuilder(base64DecodeQueryString); if (moderationBuilder != null) { - GWT.log("Moderation Builder is: "+moderationBuilder); + GWT.log("Moderation Builder is: " + moderationBuilder); CkanContentModeratorWidget ccmw = new CkanContentModeratorWidget(moderationBuilder); ccmw.showAsModal("Manage Items"); } @@ -268,6 +268,10 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate { GWT.log("Moderator role is assigned? " + isModeratorRoleAssingned); GWT.log("isExistsMyItemInModeration? " + isExistsMyItemInModeration); + if (isContentModerationEnabled) { + managementPanel.showMessageCatalogueIsModerated(isContentModerationEnabled); + } + // Enabling moderation if the moderation is active in the context and // the user has the role of MODERATOR in the context if (isContentModerationEnabled && isModeratorRoleAssingned) { From f8026d6a72479b77ca709d0c01c6de40a263d521 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Fri, 27 Jan 2023 16:44:57 +0100 Subject: [PATCH 4/5] Fixing CMS button tooltip --- .../client/view/CkanMetadataManagementPanel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/view/CkanMetadataManagementPanel.java b/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/view/CkanMetadataManagementPanel.java index c77f5c7..c7d39a7 100644 --- a/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/view/CkanMetadataManagementPanel.java +++ b/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/view/CkanMetadataManagementPanel.java @@ -53,8 +53,8 @@ public class CkanMetadataManagementPanel extends FlowPanel { private static final String MANAGE_GRSF_ITEM_TOOLTIP = "By pushing on this button, you will be able to manage the item you are viewing." + " Manageable items are the GRSF ones."; - private static final String MANAGE_CMS_ITEMS_TOOLTIP = "By pushing on this button, you will be able to manage (APPROVING or REJECTING) the item under approval" - + "Manageable items are not APPROVED and NOT PUBLISHED in the Catalogue."; + private static final String MANAGE_CMS_ITEMS_TOOLTIP = "By pushing on this button, you will be able to manage (APPROVING or REJECTING) the item under approval." + + " Manageable items are not APPROVED and NOT PUBLISHED in the Catalogue."; private AlertBlock nav = new AlertBlock(); From cda233bfa098bde9e12f65d8286094e331829a03 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Tue, 7 Feb 2023 08:42:41 +0100 Subject: [PATCH 5/5] moved to gwt 2.9 --- .settings/org.eclipse.wst.common.component | 39 +++++++++++++++++----- pom.xml | 2 +- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index be08aff..200bb84 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,7 @@ - + + + @@ -38,7 +40,9 @@ - + + + @@ -77,7 +81,9 @@ - + + + @@ -116,7 +122,9 @@ - + + + @@ -155,7 +163,9 @@ - + + + @@ -194,10 +204,15 @@ + + uses + uses - + + + @@ -236,7 +251,9 @@ - + + + @@ -275,7 +292,9 @@ - + + + @@ -314,7 +333,9 @@ - + + + diff --git a/pom.xml b/pom.xml index 5c80528..cd8a2f2 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ - 2.10.0 + 2.9.0 ${project.build.directory}/${project.build.finalName} UTF-8