Merge pull request 'feature_23903' (!4) from feature_23903 into master

Reviewed-on: #4
This commit is contained in:
Francesco Mangiacrapa 2023-02-07 08:43:29 +01:00
commit 3680ffd875
9 changed files with 151 additions and 42 deletions

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/gcube-ckan-datacatalog-2.2.4-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry kind="src" output="target/gcube-ckan-datacatalog-2.2.5-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/gcube-ckan-datacatalog-2.2.4-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<classpathentry excluding="**" kind="src" output="target/gcube-ckan-datacatalog-2.2.5-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
@ -35,5 +35,5 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/gcube-ckan-datacatalog-2.2.4-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="output" path="target/gcube-ckan-datacatalog-2.2.5-SNAPSHOT/WEB-INF/classes"/>
</classpath>

View File

@ -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

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
@ -31,8 +31,24 @@
<wb-module deploy-name="gcube-ckan-datacatalog-2.2.4-SNAPSHOT">
<wb-module deploy-name="gcube-ckan-datacatalog-2.2.5-SNAPSHOT">
@ -65,7 +81,15 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -98,7 +122,15 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -131,7 +163,15 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
@ -164,7 +204,21 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="catalogue-util-library-1.3.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/catalogue-util-library/catalogue-util-library">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="ckan-content-moderator-widget-1.2.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/ckan-content-moderator-widget/ckan-content-moderator-widget">
<dependency-type>uses</dependency-type>
</dependent-module>
@ -197,7 +251,15 @@
<property name="context-root" value="gcube-ckan-datacatalog"/>
@ -230,7 +292,15 @@
<property name="java-output-path" value="/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-1.0.0-SNAPSHOT/WEB-INF/classes"/>
@ -263,7 +333,15 @@
</wb-module>

View File

@ -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

13
pom.xml
View File

@ -14,7 +14,7 @@
<groupId>org.gcube.portlets.gcubeckan</groupId>
<artifactId>gcube-ckan-datacatalog</artifactId>
<packaging>war</packaging>
<version>2.2.4</version>
<version>2.2.5-SNAPSHOT</version>
<name>gCube CKAN Data Catalog</name>
<description>The gCube CKAN Data Catalog portlet</description>
@ -40,7 +40,7 @@
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId>
<version>3.6.4</version>
<version>3.7.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
<exclusions>
@ -59,6 +59,13 @@
</dependencyManagement>
<dependencies>
<!-- <dependency> -->
<!-- <groupId>javax.servlet</groupId> -->
<!-- <artifactId>javax.servlet-api</artifactId> -->
<!-- <version>3.0.1</version> -->
<!-- <scope>compile</scope> -->
<!-- </dependency> -->
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
@ -75,7 +82,7 @@
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwtVersion}</version>
<scope>runtime</scope>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.gwtbootstrap</groupId>

View File

@ -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.
*

View File

@ -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) {

View File

@ -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);
}

View File

@ -11,13 +11,6 @@
<param-value>/gcube/service/connect</param-value>
</context-param>
<!-- <context-param> -->
<!-- <description>Used like GET parameter in order to hide header section
of CKAN template from gCube Portal</description> -->
<!-- <param-name>CkanHideHeader</param-name> -->
<!-- <param-value>hh</param-value> -->
<!-- </context-param> -->
<context-param>
<description>ckan connector logout from CKAN</description>
<param-name>CkanConnectorLogout</param-name>
@ -30,16 +23,6 @@
<servlet-class>org.gcube.portlets.gcubeckan.gcubeckandatacatalog.server.GcubeCkanDataCatalogServiceImpl</servlet-class>
</servlet>
<!-- <servlet> -->
<!-- <servlet-name>gcubeckanlogout</servlet-name> -->
<!-- <servlet-class>org.gcube.portlets.gcubeckan.gcubeckandatacatalog.server.CkanLogout</servlet-class> -->
<!-- </servlet> -->
<!-- <servlet> -->
<!-- <servlet-name>checkServlet</servlet-name> -->
<!-- <servlet-class>org.gcube.portlets.widgets.sessionchecker.server.SessionCheckerServiceImpl</servlet-class> -->
<!-- </servlet> -->
<servlet>
<servlet-name>ckanpublisherservices</servlet-name>
<servlet-class>org.gcube.portlets.widgets.ckandatapublisherwidget.server.CKANPublisherServicesImpl</servlet-class>