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

View File

@ -195,7 +195,7 @@ public class SoftwareVersion {
if(files!=null) { if(files!=null) {
return parseFiles(files); return parseFiles(files);
} }
return parseFiles(softwareConcept.getDefaultFiles()); return parseFiles(softwareConcept.getFiles());
} }
@JsonGetter(value = FILES_PROPERTY_NAME) @JsonGetter(value = FILES_PROPERTY_NAME)
@ -237,7 +237,7 @@ public class SoftwareVersion {
} }
return new URL(replaceVariables(codeLocation.toString())); 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) @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); String s = Utils.replaceVariable("citation_id", getCitationID(), template);
s = Utils.replaceVariable("author", getAuthors(metadata), s); s = Utils.replaceVariable("author", getAuthors(metadata), s);
s = Utils.replaceVariable("title", getTitle(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("date", SoftwareVersion.getDateAsString(softwareVersion.getDate()), s);
s = Utils.replaceVariable("version", softwareVersion.getVersion(), s); s = Utils.replaceVariable("version", softwareVersion.getVersion(), s);
s = Utils.replaceVariable("doi", softwareVersion.getDOIURL().toString(), s); s = Utils.replaceVariable("doi", softwareVersion.getDOIURL().toString(), s);

View File

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