#19988 Integrated with `checkEnvironment` for Zenodo. Moved to

2.1.0-SNAPSHOT
This commit is contained in:
Francesco Mangiacrapa 2021-10-05 11:10:13 +02:00
parent 219a4c3b4e
commit cefe1f43d8
5 changed files with 101 additions and 61 deletions

View File

@ -1,6 +1,5 @@
eclipse.preferences.version=1
jarsExcludedFromWebInfLib=
lastWarOutDir=/home/francescomangiacrapa/git/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-2.0.0-SNAPSHOT
>>>>>>> refs/heads/task_20699
lastWarOutDir=/home/francescomangiacrapa/git/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-2.0.1
warSrcDir=src/main/webapp
warSrcDirIsOutput=false

View File

@ -2,7 +2,9 @@
<wb-module deploy-name="gcube-ckan-datacatalog-2.0.0-SNAPSHOT">
<wb-module deploy-name="gcube-ckan-datacatalog-2.0.1">
@ -10,15 +12,22 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="ckan2zenodo-publisher-widget-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/ckan2zenodo-publisher-widget/ckan2zenodo-publisher-widget">
<dependency-type>uses</dependency-type>
</dependent-module>
@ -26,12 +35,15 @@
<property name="java-output-path" value="/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-1.0.0-SNAPSHOT/WEB-INF/classes"/>
</wb-module>
</project-modules>

View File

@ -5,6 +5,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.1.0-SNAPSHOT] - 2021-10-05
#### Enhancements
[#19988] Integrated with `checkEnvironment` to show or not the "Upload to Zenodo" facility
## [v2.0.1] - 2021-05-04
#### Enhancements

View File

@ -29,13 +29,11 @@ import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.InlineHTML;
/**
* The Class CkanMetadataManagementPanel.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* @author Costantino Perciante costantino.perciante@isti.cnr.it
* Jun 9, 2016
* @author Costantino Perciante costantino.perciante@isti.cnr.it Jun 9, 2016
*/
public class CkanMetadataManagementPanel extends FlowPanel {
@ -254,7 +252,6 @@ public class CkanMetadataManagementPanel extends FlowPanel{
}
});
myGroups.addClickHandler(new ClickHandler() {
@Override
@ -280,7 +277,8 @@ public class CkanMetadataManagementPanel extends FlowPanel{
@Override
public void onClick(ClickEvent event) {
eventBus.fireEvent(new ShowManageProductWidgetEvent(GCubeCkanDataCatalogPanel.getLatestSelectedProductIdentifier()));
eventBus.fireEvent(new ShowManageProductWidgetEvent(
GCubeCkanDataCatalogPanel.getLatestSelectedProductIdentifier()));
}
});
@ -300,7 +298,8 @@ public class CkanMetadataManagementPanel extends FlowPanel{
@Override
public void onClick(ClickEvent event) {
eventBus.fireEvent(new PublishOnZenodoEvent(GCubeCkanDataCatalogPanel.getLatestSelectedProductIdentifier()));
eventBus.fireEvent(
new PublishOnZenodoEvent(GCubeCkanDataCatalogPanel.getLatestSelectedProductIdentifier()));
}
});
}
@ -315,7 +314,8 @@ public class CkanMetadataManagementPanel extends FlowPanel{
}
/**
* Those buttons can be only visible when the logged user has role edit/admin/sysadmin.
* Those buttons can be only visible when the logged user has role
* edit/admin/sysadmin.
*
* @param show the show
*/
@ -363,6 +363,14 @@ public class CkanMetadataManagementPanel extends FlowPanel{
uploadToZenodo.setEnabled(value);
}
/**
* Visibility publish on zenodo button.
*
* @param value the value
*/
public void visibilityPublishOnZenodoButton(boolean value) {
uploadToZenodo.setVisible(value);
}
/**
* Show only home/statistics buttons.
@ -402,7 +410,6 @@ public class CkanMetadataManagementPanel extends FlowPanel{
}
/**
* Customize label according translate.
*
@ -411,7 +418,6 @@ public class CkanMetadataManagementPanel extends FlowPanel{
*/
public void customizeLabelAccordingTranslate(String labelName, String translateValue) {
if (labelName == null || labelName.isEmpty() || translateValue == null || translateValue.isEmpty())
return;
@ -450,7 +456,6 @@ public class CkanMetadataManagementPanel extends FlowPanel{
}
/**
* Capitalize.
*

View File

@ -14,6 +14,7 @@ import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowRevert
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.resource.CkanPortletResources;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.BeanUserInOrgGroupRole;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.CkanConnectorAccessPoint;
import org.gcube.portlets.widgets.ckan2zenodopublisher.client.CkanToZenodoPublisherServiceAsync;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.logical.shared.ResizeEvent;
@ -269,6 +270,23 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
// listen for DOM messages
listenForPostMessage();
CkanToZenodoPublisherServiceAsync.Util.getInstance().checkZenodoEnvironment(new AsyncCallback<Boolean>() {
@Override
public void onFailure(Throwable caught) {
managementPanel.visibilityPublishOnZenodoButton(false);
}
@Override
public void onSuccess(Boolean result) {
GWT.log("checkZenodoEnvironment result: "+result);
managementPanel.visibilityPublishOnZenodoButton(result);
}
});
}