Renaming properties

This commit is contained in:
Luca Frosini 2023-01-11 09:02:48 +01:00
parent 3cbdd04b96
commit 2a9932ae2a
4 changed files with 19 additions and 19 deletions

View File

@ -12,11 +12,11 @@ import org.gcube.com.fasterxml.jackson.databind.JsonNode;
public class SoftwareConcept {
public static final String NAME_PROPERTY_NAME = "name";
public static final String SHORT_DESCRIPTION_PROPERTY_NAME = "short_description";
public static final String DESCRIPTION_PROPERTY_NAME = "description";
public static final String PUBLISH_PROPERTY_NAME = "publish";
public static final String EXPORT_PROPERTY_NAME = "export";
public static final String DEFAULT_FILES_PROPERTY_NAME = "default_files";
public static final String DEFAULT_CODE_LOCATION_PROPERTY_NAME = "default_code_location";
public static final String FILES_PROPERTY_NAME = "files";
public static final String CODE_LOCATION_PROPERTY_NAME = "code_location";
public static final String CODE_LOCATION_TEXT_PROPERTY_NAME = "code_location_text";
public static final String VERSIONS_PROPERTY_NAME = "versions";
public static final String METADATA_PROPERTY_NAME = "metadata";
@ -24,8 +24,8 @@ public class SoftwareConcept {
@JsonProperty(NAME_PROPERTY_NAME)
protected String name;
@JsonProperty(SHORT_DESCRIPTION_PROPERTY_NAME)
protected String shortDescription;
@JsonProperty(DESCRIPTION_PROPERTY_NAME)
protected String description;
@JsonProperty(PUBLISH_PROPERTY_NAME)
@JsonFormat(shape=JsonFormat.Shape.STRING)
@ -35,11 +35,11 @@ public class SoftwareConcept {
@JsonFormat(shape=JsonFormat.Shape.STRING)
protected ElaborationType export;
@JsonProperty(DEFAULT_FILES_PROPERTY_NAME)
protected List<SoftwareVersionFile> defaultFiles;
@JsonProperty(FILES_PROPERTY_NAME)
protected List<SoftwareVersionFile> files;
@JsonProperty(DEFAULT_CODE_LOCATION_PROPERTY_NAME)
protected String defaultCodeLocation;
@JsonProperty(CODE_LOCATION_PROPERTY_NAME)
protected String codeLocation;
@JsonProperty(CODE_LOCATION_TEXT_PROPERTY_NAME)
protected String codeLocationAdditionalDescription;
@ -54,8 +54,8 @@ public class SoftwareConcept {
return name;
}
public String getShortDescription() {
return shortDescription;
public String getDescription() {
return description;
}
public ElaborationType getPublish() {
@ -66,12 +66,12 @@ public class SoftwareConcept {
return export;
}
public List<SoftwareVersionFile> getDefaultFiles() {
return defaultFiles;
public List<SoftwareVersionFile> getFiles() {
return files;
}
public String getDefaultCodeLocation() {
return defaultCodeLocation;
public String getCodeLocation() {
return codeLocation;
}
public String getCodeLocationAdditionalDescription() {

View File

@ -195,7 +195,7 @@ public class SoftwareVersion {
if(files!=null) {
return parseFiles(files);
}
return parseFiles(softwareConcept.getDefaultFiles());
return parseFiles(softwareConcept.getFiles());
}
@JsonGetter(value = FILES_PROPERTY_NAME)
@ -237,7 +237,7 @@ public class SoftwareVersion {
}
return new URL(replaceVariables(codeLocation.toString()));
}
return new URL(replaceVariables(softwareConcept.getDefaultCodeLocation().toString()));
return new URL(replaceVariables(softwareConcept.getCodeLocation().toString()));
}
@JsonGetter(value = CODE_LOCATION_PROPERTY_NAME)

View File

@ -166,7 +166,7 @@ public class BibLaTeXSoftwareVersionExporter extends SoftwareVersionExporter {
String s = Utils.replaceVariable("citation_id", getCitationID(), template);
s = Utils.replaceVariable("author", getAuthors(metadata), s);
s = Utils.replaceVariable("title", getTitle(metadata), s);
s = Utils.replaceVariable("short_description", softwareConcept.getShortDescription(), s);
s = Utils.replaceVariable("description", softwareConcept.getDescription(), s);
s = Utils.replaceVariable("date", SoftwareVersion.getDateAsString(softwareVersion.getDate()), s);
s = Utils.replaceVariable("version", softwareVersion.getVersion(), s);
s = Utils.replaceVariable("doi", softwareVersion.getDOIURL().toString(), s);

View File

@ -1,7 +1,7 @@
@software{{{citation_id}},
author = {{{author}}},
title = {{{title}}},
abstract = {{{short_description}}},
abstract = {{{description}}},
date = {{{date}}},
version = {{{version}}},
url = {{{doi}}},