check if dmp description is null or empty

This commit is contained in:
Aldo Mihasi 2023-01-31 14:53:00 +02:00
parent 60368bc98c
commit b17719ab43
2 changed files with 7 additions and 1 deletions

View File

@ -22,3 +22,4 @@ note: depositType should be set to **0** since dataverse does not provide oauth2
**repositoryRecordUrl** - repository's record url, this url is used to index dmps that are created e.g. "https://demo.dataverse.org/dataset.xhtml?persistentId=doi:"<br>
**server** - repository's server url e.g. "https://demo.dataverse.org"<br>
**parentDataverseAlias** - dataverse alias in which all dmps that are deposited will be resided, **note**: the dataverse alias used should be published before making any dmp deposit<br>
**hasLogo** - if the repository has a logo<br>

View File

@ -73,13 +73,18 @@ public class DataverseDeposit implements RepositoryDeposit {
if(!this.isApiSet)
this.setDataverseApi();
String dmpDescription = dmpDepositModel.getDescription();
if(dmpDescription == null || dmpDescription.isEmpty()){
dmpDescription = "-";
}
String doi;
DatasetFacade dataset = DatasetFacade.builder()
.title(dmpDepositModel.getLabel())
.authors(dmpDepositModel.getUsers().stream().map(x -> DatasetAuthor.builder().authorName(x.getUser().getName()).build()).collect(Collectors.toList()))
.contacts(dmpDepositModel.getUsers().stream().map(x -> DatasetContact.builder().datasetContactEmail(x.getUser().getEmail()).build()).collect(Collectors.toList()))
.subject("Other")
.description(DatasetDescription.builder().description(dmpDepositModel.getDescription()).build())
.description(DatasetDescription.builder().description(dmpDescription).build())
.languages(new ArrayList<>())
.depositor("")
.build();