From ad00cd0c7c92de891f59cb3b625325bf9e3d677d Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Mon, 9 Dec 2019 12:03:51 +0100 Subject: [PATCH] Starting work on Feature #18226 --- .classpath | 10 ++-- .../com.gwtplugins.gdt.eclipse.core.prefs | 2 +- .settings/org.eclipse.jdt.core.prefs | 2 +- .settings/org.eclipse.wst.common.component | 6 +-- .../client/event/PublishOnZenodoEvent.java | 53 +++++++++++++++++++ .../event/PublishOnZenodoEventHandler.java | 16 ++++++ .../view/CkanMetadataManagementPanel.java | 10 ++++ 7 files changed, 87 insertions(+), 12 deletions(-) create mode 100644 src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/event/PublishOnZenodoEvent.java create mode 100644 src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/event/PublishOnZenodoEventHandler.java diff --git a/.classpath b/.classpath index a190e04..9915abc 100644 --- a/.classpath +++ b/.classpath @@ -1,6 +1,6 @@ - + @@ -26,15 +26,15 @@ - + - + - + - + diff --git a/.settings/com.gwtplugins.gdt.eclipse.core.prefs b/.settings/com.gwtplugins.gdt.eclipse.core.prefs index 99f741f..f1ffe25 100644 --- a/.settings/com.gwtplugins.gdt.eclipse.core.prefs +++ b/.settings/com.gwtplugins.gdt.eclipse.core.prefs @@ -1,5 +1,5 @@ eclipse.preferences.version=1 jarsExcludedFromWebInfLib= -lastWarOutDir=/home/francesco-mangiacrapa/git/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-1.7.0-SNAPSHOT +lastWarOutDir=/home/francesco-mangiacrapa/git/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-1.7.0 warSrcDir=src/main/webapp warSrcDirIsOutput=false diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 8db228c..a5c7673 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,6 +1,6 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index f9a9d56..2e78af9 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,13 +1,9 @@ - + - - - uses - diff --git a/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/event/PublishOnZenodoEvent.java b/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/event/PublishOnZenodoEvent.java new file mode 100644 index 0000000..6bb4d4f --- /dev/null +++ b/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/event/PublishOnZenodoEvent.java @@ -0,0 +1,53 @@ +package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event; + +import com.google.gwt.event.shared.GwtEvent; + + +/** + * The Class PublishOnZenodoEvent. + * + * @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it) + * + * Dec 9, 2019 + */ +public class PublishOnZenodoEvent extends GwtEvent{ + + public static Type TYPE = new Type(); + private String uuidItem; + + /** + * Instantiates a new insert metadata event. + * + * @param uuidItem the uuid item + */ + public PublishOnZenodoEvent(String uuidItem) { + this.uuidItem = uuidItem; + } + + /** + * Gets the uuid item. + * + * @return the uuid item + */ + public String getUuidItem() { + return uuidItem; + } + + /* (non-Javadoc) + * @see com.google.gwt.event.shared.GwtEvent#getAssociatedType() + */ + @Override + public Type getAssociatedType() { + return TYPE; + } + + /* (non-Javadoc) + * @see com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.EventHandler) + */ + @Override + protected void dispatch(PublishOnZenodoEventHandler handler) { + handler.onPublishOnZenodo(this); + } + + +} diff --git a/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/event/PublishOnZenodoEventHandler.java b/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/event/PublishOnZenodoEventHandler.java new file mode 100644 index 0000000..99f9918 --- /dev/null +++ b/src/main/java/org/gcube/portlets/gcubeckan/gcubeckandatacatalog/client/event/PublishOnZenodoEventHandler.java @@ -0,0 +1,16 @@ +package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event; + +import com.google.gwt.event.shared.EventHandler; + + +/** + * The Interface PublishOnZenodoEventHandler. + * + * @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it) + * + * Dec 9, 2019 + */ +public interface PublishOnZenodoEventHandler extends EventHandler { + + void onPublishOnZenodo(PublishOnZenodoEvent publishOnZenodoEvent); +} 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 c138746..0da6faf 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 @@ -67,6 +67,7 @@ public class CkanMetadataManagementPanel extends FlowPanel{ // other stuff private Button shareLink = new Button("Share Link"); + private Button publishOnZenodoLink = new Button("Publish on Zenodo"); private Button insertMeta = new Button("Publish Item"); private Button editMeta = new Button("Edit Item"); private Button manageProduct = new Button("Manage Item"); @@ -288,6 +289,15 @@ public class CkanMetadataManagementPanel extends FlowPanel{ } }); + + publishOnZenodoLink.addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + + eventBus.fireEvent(new ShareLinkEvent(GCubeCkanDataCatalogPanel.getLatestSelectedProductIdentifier())); + } + }); } /**