Added DOI to message returned as result

This commit is contained in:
Francesco Mangiacrapa 2020-01-28 15:06:33 +01:00
parent b5e5244c6f
commit 032d01f57c
3 changed files with 29 additions and 2 deletions

View File

@ -153,7 +153,7 @@ public class CkanToZendoPublisherWidget {
}
@Override
public void onSuccess(String result) {
public void onSuccess(String doi) {
buttonPublish.setEnabled(false);
basicTabPanel.getElement().getStyle().setOpacity(1.0);
try {
@ -163,6 +163,9 @@ public class CkanToZendoPublisherWidget {
}
String msg = "The item has been uploaded to Zenodo correctly";
if(doi!=null)
msg+=" "+doi;
Alert infoLabel = new Alert();
infoLabel.setClose(false);
infoLabel.setType(AlertType.INFO);

View File

@ -10,14 +10,38 @@ import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
/**
* The client side stub for the RPC service.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Jan 28, 2020
*/
@RemoteServiceRelativePath("ckantozenodo")
public interface CkanToZenodoPublisherService extends RemoteService {
/**
* Convert to zenodo item.
*
* @param item the item
* @return the zenodo item
* @throws Exception the exception
*/
ZenodoItem convertToZenodoItem(CatalogueItem item) throws Exception;
/**
* Publish on zenodo.
*
* @param zenodoItem the zenodo item
* @return the DOI of published Zenodo Item
* @throws Exception the exception
*/
String publishOnZenodo(ZenodoItem zenodoItem) throws Exception;
/**
* Read fields descriptions.
*
* @return the map
* @throws Exception the exception
*/
Map<String, String> readFieldsDescriptions() throws Exception;
}

View File

@ -106,7 +106,7 @@ public class CkanToZenodoPublisherServiceImpl extends RemoteServiceServlet imple
//Finalize
LOG.debug("Calling publish on Zenodo for: "+zenodoDepositionPreview);
zenodoDepositionPreview = client.publish(zenodoDepositionPreview, item);
return zenodoDepositionPreview.toString();
return zenodoDepositionPreview.getDoi();
}catch (TimeoutException e) {
String error = "I'm waiting too time for publishing on Zenodo the catalogue item: "+zenodoItem.getName()+". Check by yourself the result later";