Fixing `publication_date` issue [#26166]

This commit is contained in:
Francesco Mangiacrapa 2023-12-06 09:33:43 +01:00
parent 6dbc1d8e4c
commit 4eb65dc4ed
3 changed files with 202 additions and 207 deletions

View File

@ -4,6 +4,10 @@
All notable changes to this project will be documented in this file. 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). This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v1.1.4-SNAPSHOT] - 2023-12-05
- Fixing `publication_date` issue [#26166]
## [v1.1.3] - 2023-07-25 ## [v1.1.3] - 2023-07-25
- Fixing `null` issue, recompiling this component [#25275] - Fixing `null` issue, recompiling this component [#25275]

View File

@ -14,7 +14,7 @@
<groupId>org.gcube.portlets.widgets</groupId> <groupId>org.gcube.portlets.widgets</groupId>
<artifactId>ckan2zenodo-publisher-widget</artifactId> <artifactId>ckan2zenodo-publisher-widget</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>1.1.3</version> <version>1.1.4-SNAPSHOT</version>
<description> <description>
gCube Ckan2Zenodo Publisher widget allows to publish D4Science catalogue's items on Zenodo gCube Ckan2Zenodo Publisher widget allows to publish D4Science catalogue's items on Zenodo

View File

@ -35,8 +35,6 @@ import org.gcube.portlets.widgets.ckan2zenodopublisher.shared.wrapped.ZenodoSubj
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
/** /**
* The Class ItemToZenodoConverter. * The Class ItemToZenodoConverter.
* *
@ -47,6 +45,7 @@ import org.slf4j.LoggerFactory;
public class ItemToZenodoConverter { public class ItemToZenodoConverter {
private static Logger LOG = LoggerFactory.getLogger(ItemToZenodoConverter.class); private static Logger LOG = LoggerFactory.getLogger(ItemToZenodoConverter.class);
/** /**
* ** * **
* *
@ -57,7 +56,6 @@ public class ItemToZenodoConverter {
* @return the zenodo item * @return the zenodo item
*/ */
/** /**
* To zenodo item. * To zenodo item.
* *
@ -95,7 +93,6 @@ public class ItemToZenodoConverter {
return zi; return zi;
} }
/** /**
* Adds the files. * Adds the files.
* *
@ -135,8 +132,6 @@ public class ItemToZenodoConverter {
return listOfFiles; return listOfFiles;
} }
/** /**
* To zenodo file. * To zenodo file.
* *
@ -158,7 +153,6 @@ public class ItemToZenodoConverter {
return zf; return zf;
} }
/** /**
* To zenodo file. * To zenodo file.
* *
@ -183,7 +177,6 @@ public class ItemToZenodoConverter {
return zf; return zf;
} }
/** /**
* To zenodo metadata. * To zenodo metadata.
* *
@ -199,6 +192,9 @@ public class ItemToZenodoConverter {
zm.setAccess_conditions(depositionMetadata.getAccess_conditions()); zm.setAccess_conditions(depositionMetadata.getAccess_conditions());
zm.setDescription(depositionMetadata.getDescription()); zm.setDescription(depositionMetadata.getDescription());
// fixing bug #26165 on publication_date = null
zm.setPublication_date(depositionMetadata.getPublication_date());
// Access Type // Access Type
AccessRights[] accessRight = null; AccessRights[] accessRight = null;
if (depositionMetadata.getAccess_right() != null) { if (depositionMetadata.getAccess_right() != null) {
@ -275,7 +271,6 @@ public class ItemToZenodoConverter {
return zm; return zm;
} }
/** /**
* To zenodo subjects. * To zenodo subjects.
* *
@ -317,7 +312,6 @@ public class ItemToZenodoConverter {
return list; return list;
} }
/** /**
* To zenodo date intervals. * To zenodo date intervals.
* *
@ -337,7 +331,8 @@ public class ItemToZenodoConverter {
types = CkanToZenodoUtil.toSerializableEnum(rel, DateInterval.Type.values()); types = CkanToZenodoUtil.toSerializableEnum(rel, DateInterval.Type.values());
} }
list.add(new ZenodoDateInterval(dateInterval.getStart(), dateInterval.getEnd(), types, dateInterval.getDescription())); list.add(new ZenodoDateInterval(dateInterval.getStart(), dateInterval.getEnd(), types,
dateInterval.getDescription()));
} }
return list; return list;
@ -416,7 +411,6 @@ public class ItemToZenodoConverter {
return list; return list;
} }
/** /**
* To service file deposition. * To service file deposition.
* *
@ -440,7 +434,6 @@ public class ItemToZenodoConverter {
return fileDep; return fileDep;
} }
/** /**
* Update metadata info of deposition metadata. * Update metadata info of deposition metadata.
* *
@ -448,7 +441,8 @@ public class ItemToZenodoConverter {
* @param depositionMetadata the deposition metadata * @param depositionMetadata the deposition metadata
* @return the deposition metadata * @return the deposition metadata
*/ */
public static DepositionMetadata updateMetadataInfoOfDepositionMetadata(ZenodoMetadata metadata, DepositionMetadata depositionMetadata) { public static DepositionMetadata updateMetadataInfoOfDepositionMetadata(ZenodoMetadata metadata,
DepositionMetadata depositionMetadata) {
// description // description
String description = metadata.getDescription(); String description = metadata.getDescription();
@ -569,7 +563,6 @@ public class ItemToZenodoConverter {
return depositionMetadata; return depositionMetadata;
} }
/** /**
* To creators. * To creators.
* *
@ -639,6 +632,4 @@ public class ItemToZenodoConverter {
return listOfContributors; return listOfContributors;
} }
} }