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..200bb84 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,5 @@ - + @@ -31,8 +31,24 @@ - - + + + + + + + + + + + + + + + + + + @@ -65,7 +81,15 @@ - + + + + + + + + + @@ -98,7 +122,15 @@ - + + + + + + + + + @@ -131,7 +163,15 @@ - + + + + + + + + + @@ -164,7 +204,21 @@ - + + uses + + + uses + + + + + + + + + + @@ -197,7 +251,15 @@ - + + + + + + + + + @@ -230,7 +292,15 @@ - + + + + + + + + + @@ -263,7 +333,15 @@ - + + + + + + + + + diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b5b5f1..8802776 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ 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 +- [#24309] Inform the VRE users that the catalogue is moderated +- Moved to gwt 2.10.0 + ## [v2.2.4] - 2022-10-27 #### Enhancements diff --git a/pom.xml b/pom.xml index 80e754e..cd8a2f2 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 @@ -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/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..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 @@ -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)."; + /** * */ @@ -47,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(); @@ -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) { 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); } 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