Trying to fix the issue reported at

https://support.d4science.org/issues/19763#note-12
This commit is contained in:
Francesco Mangiacrapa 2020-09-23 11:38:26 +02:00
parent db79604770
commit e55251dfbb
3 changed files with 20 additions and 9 deletions

View File

@ -240,14 +240,18 @@ public class CkanToZendoPublisherWidget {
} }
JSONValue theMessage = theErrorJSON.get("message"); JSONValue theMessage = theErrorJSON.get("message");
return "Error reported from Zenodo: " + theMessage.toString(); String theErrors = null;
try {
// //GWT.log("array: "+array.toString()); JSONValue theError = theErrorJSON.get("errors");
// JSONObject theErrorValue = (JSONObject) array.get(0); theErrors = theError.toString();
// //GWT.log("theErrorValue: "+theErrorValue.toString()); }catch (Exception e) {
// JSONValue theMessage = theErrorValue.get("message"); //silent
// //GWT.log("message: "+message.toString()); }
// return "Error reported from Zenodo: " + theMessage.toString(); String toReport = "Message reported from Zenodo: " + theMessage.toString();
if(theErrors!=null)
toReport+= " Errors: "+theErrors;
return toReport;
} }
}catch (Exception e) { }catch (Exception e) {
return message; return message;

View File

@ -104,7 +104,7 @@ public class CkanToZenodoPublisherServiceImpl extends RemoteServiceServlet imple
//Actually publish to zenodo : //Actually publish to zenodo :
// Step 1 : metadata // Step 1 : metadata
client= new Ckan2ZenodoImpl(); client= new Ckan2ZenodoImpl();
LOG.debug("Calling updatedMetadta for: "+zenodoDepositionPreview); LOG.debug("Calling updatedMetadata for: "+zenodoDepositionPreview);
zenodoDepositionPreview = client.updatedMetadata(zenodoDepositionPreview); zenodoDepositionPreview = client.updatedMetadata(zenodoDepositionPreview);
//Step 2 : publish Resources //Step 2 : publish Resources

View File

@ -444,6 +444,13 @@ public class ItemToZenodoConverter {
*/ */
public static DepositionMetadata updateMetadataInfoOfDepositionMetadata(ZenodoMetadata metadata, DepositionMetadata depositionMetadata) { public static DepositionMetadata updateMetadataInfoOfDepositionMetadata(ZenodoMetadata metadata, DepositionMetadata depositionMetadata) {
//description
String description = metadata.getDescription();
LOG.debug("Read description: "+description);
if(description!=null) {
depositionMetadata.setDescription(description);
}
//upload type //upload type
SerializableEnum<String> uploadType = metadata.getUpload_type(); SerializableEnum<String> uploadType = metadata.getUpload_type();
LOG.debug("Read upload type: "+uploadType); LOG.debug("Read upload type: "+uploadType);