Generalised solution
This commit is contained in:
parent
5c3209d07e
commit
e056470957
|
@ -2,6 +2,8 @@ package org.gcube.common.software.analyser;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Calendar;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
@ -9,7 +11,8 @@ import org.gcube.com.fasterxml.jackson.databind.JsonNode;
|
||||||
import org.gcube.com.fasterxml.jackson.databind.ObjectMapper;
|
import org.gcube.com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import org.gcube.com.fasterxml.jackson.databind.node.ArrayNode;
|
import org.gcube.com.fasterxml.jackson.databind.node.ArrayNode;
|
||||||
import org.gcube.com.fasterxml.jackson.databind.node.ObjectNode;
|
import org.gcube.com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
import org.gcube.common.software.model.SoftwareGlobalConfig;
|
import org.gcube.com.fasterxml.jackson.databind.node.TextNode;
|
||||||
|
import org.gcube.common.software.model.SoftwareConfig;
|
||||||
import org.gcube.common.software.model.SoftwareVersionConfig;
|
import org.gcube.common.software.model.SoftwareVersionConfig;
|
||||||
import org.gcube.common.software.model.Variables;
|
import org.gcube.common.software.model.Variables;
|
||||||
import org.gcube.common.software.utils.Utils;
|
import org.gcube.common.software.utils.Utils;
|
||||||
|
@ -57,12 +60,11 @@ public class SoftwareConfigAnalyser {
|
||||||
|
|
||||||
public void analyse() throws Exception {
|
public void analyse() throws Exception {
|
||||||
ObjectNode originalGlobal = (ObjectNode) jsonNode.get(GLOBAL_PROPERTY_NAME).deepCopy();
|
ObjectNode originalGlobal = (ObjectNode) jsonNode.get(GLOBAL_PROPERTY_NAME).deepCopy();
|
||||||
SoftwareGlobalConfig softwareGlobalConfig = objectMapper.treeToValue(originalGlobal, SoftwareGlobalConfig.class);
|
SoftwareConfig softwareConfig = objectMapper.treeToValue(originalGlobal, SoftwareConfig.class);
|
||||||
softwareGlobalConfig.setOriginalJson(originalGlobal);
|
softwareConfig.setOriginalJson(originalGlobal);
|
||||||
|
|
||||||
ArrayNode versions = (ArrayNode) jsonNode.get(VERSIONS_PROPERTY_NAME);
|
ArrayNode versions = (ArrayNode) jsonNode.get(VERSIONS_PROPERTY_NAME);
|
||||||
|
|
||||||
String name = softwareGlobalConfig.getName();
|
|
||||||
SoftwareVersionConfig previous = null;
|
SoftwareVersionConfig previous = null;
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
@ -90,12 +92,12 @@ public class SoftwareConfigAnalyser {
|
||||||
|
|
||||||
|
|
||||||
logger.trace("Going to process {} {} (previous version {})",
|
logger.trace("Going to process {} {} (previous version {})",
|
||||||
name, softwareVersion.getVersion(),
|
softwareVersion.getName(), softwareVersion.getVersion(),
|
||||||
softwareVersion.getPrevious()!=null ? softwareVersion.getPrevious().getVersion(): null);
|
softwareVersion.getPrevious()!=null ? softwareVersion.getPrevious().getVersion(): null);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
SoftwareVersionConfigAnalyser softwareVersionAnalyser = new SoftwareVersionConfigAnalyser(softwareVersion);
|
SoftwareVersionConfigAnalyser softwareVersionAnalyser = new SoftwareVersionConfigAnalyser(softwareVersion);
|
||||||
softwareVersionAnalyser.setSoftwareGlobalConfig(softwareGlobalConfig);
|
softwareVersionAnalyser.setSoftwareConfig(softwareConfig);
|
||||||
softwareVersionAnalyser.setFirst(i==0);
|
softwareVersionAnalyser.setFirst(i==0);
|
||||||
softwareVersionAnalyser.analyse();
|
softwareVersionAnalyser.analyse();
|
||||||
|
|
||||||
|
@ -113,8 +115,8 @@ public class SoftwareConfigAnalyser {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(newDOI) {
|
if(newDOI) {
|
||||||
softwareGlobalConfig.setDOIURL(doiURL);
|
softwareConfig.addAdditionalProperty(SoftwareVersionConfig.DOI_URL_PROPERTY_NAME, new TextNode(doiURL.toString()));
|
||||||
originalGlobal.put(SoftwareGlobalConfig.DOI_URL_PROPERTY_NAME, doiURL.toString());
|
originalGlobal.put(SoftwareVersionConfig.DOI_URL_PROPERTY_NAME, doiURL.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Thread.sleep(TimeUnit.SECONDS.toMillis(2));
|
Thread.sleep(TimeUnit.SECONDS.toMillis(2));
|
||||||
|
@ -147,7 +149,10 @@ public class SoftwareConfigAnalyser {
|
||||||
|
|
||||||
toBeExported.replace(VERSIONS_PROPERTY_NAME, exportingVersions);
|
toBeExported.replace(VERSIONS_PROPERTY_NAME, exportingVersions);
|
||||||
|
|
||||||
File file = new File(name+EXPORT_FILENAME_EXTENSION);
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
|
||||||
|
String fileName = simpleDateFormat.format(Calendar.getInstance().getTime());
|
||||||
|
|
||||||
|
File file = new File(fileName+EXPORT_FILENAME_EXTENSION);
|
||||||
objectMapper.writeValue(file, toBeExported);
|
objectMapper.writeValue(file, toBeExported);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.gcube.common.software.model.ProcessorConfig;
|
import org.gcube.common.software.model.ProcessorConfig;
|
||||||
import org.gcube.common.software.model.SoftwareGlobalConfig;
|
import org.gcube.common.software.model.SoftwareConfig;
|
||||||
import org.gcube.common.software.model.SoftwareVersionConfig;
|
import org.gcube.common.software.model.SoftwareVersionConfig;
|
||||||
import org.gcube.common.software.model.SoftwareVersionFile;
|
import org.gcube.common.software.model.SoftwareVersionFile;
|
||||||
import org.gcube.common.software.model.Variables;
|
import org.gcube.common.software.model.Variables;
|
||||||
|
@ -17,7 +17,7 @@ import org.gcube.common.software.process.publish.SoftwareVersionPublisher;
|
||||||
*/
|
*/
|
||||||
public class SoftwareVersionConfigAnalyser {
|
public class SoftwareVersionConfigAnalyser {
|
||||||
|
|
||||||
protected SoftwareGlobalConfig softwareGlobalConfig;
|
protected SoftwareConfig softwareConfig;
|
||||||
protected SoftwareVersionConfig softwareVersionConfig;
|
protected SoftwareVersionConfig softwareVersionConfig;
|
||||||
protected boolean first;
|
protected boolean first;
|
||||||
|
|
||||||
|
@ -25,12 +25,12 @@ public class SoftwareVersionConfigAnalyser {
|
||||||
this.softwareVersionConfig = softwareVersionConfig;
|
this.softwareVersionConfig = softwareVersionConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SoftwareGlobalConfig getSoftwareGlobalConfig() {
|
public SoftwareConfig getSoftwareConfig() {
|
||||||
return softwareGlobalConfig;
|
return softwareConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSoftwareGlobalConfig(SoftwareGlobalConfig softwareGlobalConfig) {
|
public void setSoftwareConfig(SoftwareConfig softwareConfig) {
|
||||||
this.softwareGlobalConfig = softwareGlobalConfig;
|
this.softwareConfig = softwareConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SoftwareVersionConfig getSoftwareVersionConfig() {
|
public SoftwareVersionConfig getSoftwareVersionConfig() {
|
||||||
|
@ -50,6 +50,7 @@ public class SoftwareVersionConfigAnalyser {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void analyse() throws Exception {
|
public void analyse() throws Exception {
|
||||||
|
|
||||||
Variables variables = softwareVersionConfig.getVariables();
|
Variables variables = softwareVersionConfig.getVariables();
|
||||||
List<SoftwareVersionFile> svfs = softwareVersionConfig.getFiles();
|
List<SoftwareVersionFile> svfs = softwareVersionConfig.getFiles();
|
||||||
for(SoftwareVersionFile svf : svfs) {
|
for(SoftwareVersionFile svf : svfs) {
|
||||||
|
@ -84,6 +85,4 @@ public class SoftwareVersionConfigAnalyser {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
package org.gcube.common.software.model;
|
||||||
|
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.gcube.com.fasterxml.jackson.annotation.JsonAnyGetter;
|
||||||
|
import org.gcube.com.fasterxml.jackson.annotation.JsonAnySetter;
|
||||||
|
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import org.gcube.com.fasterxml.jackson.databind.JsonNode;
|
||||||
|
import org.gcube.com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
|
*/
|
||||||
|
public class SoftwareConfig {
|
||||||
|
|
||||||
|
protected Map<String, JsonNode> additionalProperties;
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
protected ObjectNode originalJson;
|
||||||
|
|
||||||
|
public SoftwareConfig() {
|
||||||
|
this.additionalProperties = new LinkedHashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public ObjectNode getOriginalJson() {
|
||||||
|
return originalJson;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public void setOriginalJson(ObjectNode originalJson) {
|
||||||
|
this.originalJson = originalJson;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@JsonAnyGetter
|
||||||
|
public Map<String, JsonNode> getAdditionalProperties() {
|
||||||
|
return additionalProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonAnySetter
|
||||||
|
public void addAdditionalProperty(String key, JsonNode value) {
|
||||||
|
this.additionalProperties.put(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public JsonNode getAdditionalProperty(String key) {
|
||||||
|
return this.additionalProperties.get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,141 +0,0 @@
|
||||||
package org.gcube.common.software.model;
|
|
||||||
|
|
||||||
import java.net.URL;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import org.gcube.com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import org.gcube.com.fasterxml.jackson.databind.JsonNode;
|
|
||||||
import org.gcube.com.fasterxml.jackson.databind.node.ArrayNode;
|
|
||||||
import org.gcube.com.fasterxml.jackson.databind.node.ObjectNode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Luca Frosini (ISTI - CNR)
|
|
||||||
*/
|
|
||||||
public class SoftwareGlobalConfig {
|
|
||||||
|
|
||||||
public static final String NAME_PROPERTY_NAME = "name";
|
|
||||||
public static final String GROUP_PROPERTY_NAME = "group";
|
|
||||||
public static final String TITLE_PROPERTY_NAME = "title";
|
|
||||||
public static final String LICENSE_PROPERTY_NAME = "license";
|
|
||||||
public static final String KEYWORDS_PROPERTY_NAME = "keywords";
|
|
||||||
public static final String DESCRIPTION_PROPERTY_NAME = "description";
|
|
||||||
public static final String AUTHORS_PROPERTY_NAME = "authors";
|
|
||||||
public static final String FILES_PROPERTY_NAME = "files";
|
|
||||||
public static final String CODE_LOCATION_PROPERTY_NAME = "code_location";
|
|
||||||
public static final String DOI_URL_PROPERTY_NAME = "doi_url";
|
|
||||||
public static final String GRANTS_PROPERTY_NAME = "grants";
|
|
||||||
public static final String PUBLISHERS_PROPERTY_NAME = "publishers";
|
|
||||||
public static final String EXPORTERS_PROPERTY_NAME = "exporters";
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
protected ObjectNode originalJson;
|
|
||||||
|
|
||||||
@JsonProperty(NAME_PROPERTY_NAME)
|
|
||||||
protected String name;
|
|
||||||
|
|
||||||
@JsonProperty(GROUP_PROPERTY_NAME)
|
|
||||||
protected String group;
|
|
||||||
|
|
||||||
@JsonProperty(TITLE_PROPERTY_NAME)
|
|
||||||
protected String title;
|
|
||||||
|
|
||||||
@JsonProperty(LICENSE_PROPERTY_NAME)
|
|
||||||
protected JsonNode license;
|
|
||||||
|
|
||||||
@JsonProperty(KEYWORDS_PROPERTY_NAME)
|
|
||||||
protected Set<String> keywords;
|
|
||||||
|
|
||||||
@JsonProperty(DESCRIPTION_PROPERTY_NAME)
|
|
||||||
protected String description;
|
|
||||||
|
|
||||||
@JsonProperty(AUTHORS_PROPERTY_NAME)
|
|
||||||
protected ArrayNode authors;
|
|
||||||
|
|
||||||
@JsonProperty(FILES_PROPERTY_NAME)
|
|
||||||
protected List<SoftwareVersionFile> files;
|
|
||||||
|
|
||||||
@JsonProperty(CODE_LOCATION_PROPERTY_NAME)
|
|
||||||
protected String codeLocation;
|
|
||||||
|
|
||||||
@JsonProperty(DOI_URL_PROPERTY_NAME)
|
|
||||||
protected URL doiURL;
|
|
||||||
|
|
||||||
@JsonProperty(GRANTS_PROPERTY_NAME)
|
|
||||||
protected JsonNode grants;
|
|
||||||
|
|
||||||
@JsonProperty(PUBLISHERS_PROPERTY_NAME)
|
|
||||||
protected Map<String,ProcessorConfig> publishers;
|
|
||||||
|
|
||||||
@JsonProperty(EXPORTERS_PROPERTY_NAME)
|
|
||||||
protected Map<String,ProcessorConfig> exporters;
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public ObjectNode getOriginalJson() {
|
|
||||||
return originalJson;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public void setOriginalJson(ObjectNode originalJson) {
|
|
||||||
this.originalJson = originalJson;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getGroup() {
|
|
||||||
return group;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTitle() {
|
|
||||||
return title;
|
|
||||||
}
|
|
||||||
|
|
||||||
public JsonNode getLicense() {
|
|
||||||
return license;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<String> getKeywords() {
|
|
||||||
return keywords;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDescription() {
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArrayNode getAuthors() {
|
|
||||||
return authors;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<SoftwareVersionFile> getFiles() {
|
|
||||||
return files;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCodeLocation() {
|
|
||||||
return codeLocation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public URL getDOIURL() {
|
|
||||||
return doiURL;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDOIURL(URL doiURL) {
|
|
||||||
this.doiURL = doiURL;
|
|
||||||
}
|
|
||||||
|
|
||||||
public JsonNode getGrants() {
|
|
||||||
return grants;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String,ProcessorConfig> getPublishers() {
|
|
||||||
return publishers;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String,ProcessorConfig> getExporters() {
|
|
||||||
return exporters;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -2,27 +2,38 @@ package org.gcube.common.software.model;
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.gcube.com.fasterxml.jackson.annotation.JsonFormat;
|
import org.gcube.com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import org.gcube.com.fasterxml.jackson.annotation.JsonGetter;
|
|
||||||
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore;
|
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import org.gcube.com.fasterxml.jackson.annotation.JsonProperty;
|
import org.gcube.com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import org.gcube.com.fasterxml.jackson.annotation.JsonSetter;
|
|
||||||
import org.gcube.com.fasterxml.jackson.databind.JsonNode;
|
import org.gcube.com.fasterxml.jackson.databind.JsonNode;
|
||||||
import org.gcube.com.fasterxml.jackson.databind.ObjectMapper;
|
import org.gcube.com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import org.gcube.com.fasterxml.jackson.databind.node.ArrayNode;
|
||||||
import org.gcube.common.software.utils.Utils;
|
import org.gcube.common.software.utils.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR)
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
public class SoftwareVersionConfig extends SoftwareGlobalConfig {
|
public class SoftwareVersionConfig extends SoftwareConfig {
|
||||||
|
|
||||||
|
public static final String NAME_PROPERTY_NAME = "name";
|
||||||
public static final String VERSION_PROPERTY_NAME = "version";
|
public static final String VERSION_PROPERTY_NAME = "version";
|
||||||
|
public static final String TITLE_PROPERTY_NAME = "title";
|
||||||
public static final String DATE_PROPERTY_NAME = "date";
|
public static final String DATE_PROPERTY_NAME = "date";
|
||||||
public static final String GCUBE_RELEASE_VERSION_PROPERTY_NAME = "gcube_release_version";
|
public static final String LICENSE_PROPERTY_NAME = "license";
|
||||||
public static final String GCUBE_RELEASE_TICKET_PROPERTY_NAME = "gcube_release_ticket";
|
public static final String KEYWORDS_PROPERTY_NAME = "keywords";
|
||||||
|
public static final String DESCRIPTION_PROPERTY_NAME = "description";
|
||||||
|
public static final String AUTHORS_PROPERTY_NAME = "authors";
|
||||||
|
public static final String FILES_PROPERTY_NAME = "files";
|
||||||
|
public static final String CODE_LOCATION_PROPERTY_NAME = "code_location";
|
||||||
|
public static final String DOI_URL_PROPERTY_NAME = "doi_url";
|
||||||
public static final String VERSION_DOI_URL_PROPERTY_NAME = "version_doi_url";
|
public static final String VERSION_DOI_URL_PROPERTY_NAME = "version_doi_url";
|
||||||
|
public static final String GRANTS_PROPERTY_NAME = "grants";
|
||||||
|
public static final String PUBLISHERS_PROPERTY_NAME = "publishers";
|
||||||
|
public static final String EXPORTERS_PROPERTY_NAME = "exporters";
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
protected SoftwareVersionConfig previous;
|
protected SoftwareVersionConfig previous;
|
||||||
|
@ -33,22 +44,48 @@ public class SoftwareVersionConfig extends SoftwareGlobalConfig {
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
protected Boolean newDeposition;
|
protected Boolean newDeposition;
|
||||||
|
|
||||||
|
@JsonProperty(NAME_PROPERTY_NAME)
|
||||||
|
protected String name;
|
||||||
|
|
||||||
@JsonProperty(VERSION_PROPERTY_NAME)
|
@JsonProperty(VERSION_PROPERTY_NAME)
|
||||||
protected String version;
|
protected String version;
|
||||||
|
|
||||||
@JsonProperty(DATE_PROPERTY_NAME)
|
@JsonProperty(DATE_PROPERTY_NAME)
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = Utils.DATETIME_PATTERN)
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = Utils.DATETIME_PATTERN)
|
||||||
protected Date date;
|
protected Date date;
|
||||||
|
|
||||||
@JsonProperty(GCUBE_RELEASE_VERSION_PROPERTY_NAME)
|
@JsonProperty(TITLE_PROPERTY_NAME)
|
||||||
protected String gCubeReleaseVersion;
|
protected String title;
|
||||||
|
|
||||||
@JsonProperty(GCUBE_RELEASE_TICKET_PROPERTY_NAME)
|
@JsonProperty(LICENSE_PROPERTY_NAME)
|
||||||
protected URL gCubeReleaseTicket;
|
protected JsonNode license;
|
||||||
|
|
||||||
|
@JsonProperty(KEYWORDS_PROPERTY_NAME)
|
||||||
|
protected Set<String> keywords;
|
||||||
|
|
||||||
|
@JsonProperty(AUTHORS_PROPERTY_NAME)
|
||||||
|
protected ArrayNode authors;
|
||||||
|
|
||||||
|
@JsonProperty(FILES_PROPERTY_NAME)
|
||||||
|
protected List<SoftwareVersionFile> files;
|
||||||
|
|
||||||
|
@JsonProperty(CODE_LOCATION_PROPERTY_NAME)
|
||||||
|
protected String codeLocation;
|
||||||
|
|
||||||
|
@JsonProperty(DOI_URL_PROPERTY_NAME)
|
||||||
|
protected URL doiURL;
|
||||||
|
|
||||||
@JsonProperty(VERSION_DOI_URL_PROPERTY_NAME)
|
@JsonProperty(VERSION_DOI_URL_PROPERTY_NAME)
|
||||||
protected URL versionDOIURL;
|
protected URL versionDOIURL;
|
||||||
|
|
||||||
|
@JsonProperty(GRANTS_PROPERTY_NAME)
|
||||||
|
protected JsonNode grants;
|
||||||
|
|
||||||
|
@JsonProperty(PUBLISHERS_PROPERTY_NAME)
|
||||||
|
protected Map<String,ProcessorConfig> publishers;
|
||||||
|
|
||||||
|
@JsonProperty(EXPORTERS_PROPERTY_NAME)
|
||||||
|
protected Map<String,ProcessorConfig> exporters;
|
||||||
|
|
||||||
public SoftwareVersionConfig() {
|
public SoftwareVersionConfig() {
|
||||||
this.newDeposition = false;
|
this.newDeposition = false;
|
||||||
|
@ -97,58 +134,69 @@ public class SoftwareVersionConfig extends SoftwareGlobalConfig {
|
||||||
}
|
}
|
||||||
return variables;
|
return variables;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
@JsonGetter(value = VERSION_PROPERTY_NAME)
|
|
||||||
public String getVersion() {
|
public String getVersion() {
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonSetter(value = VERSION_PROPERTY_NAME)
|
|
||||||
public void setVersion(String version) {
|
|
||||||
if(version==null || version.length()==0) {
|
|
||||||
throw new RuntimeException("Invalid version");
|
|
||||||
}
|
|
||||||
this.version = version;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonGetter(value = DATE_PROPERTY_NAME)
|
|
||||||
public Date getDate() {
|
public Date getDate() {
|
||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonSetter(value = DATE_PROPERTY_NAME)
|
public String getTitle() {
|
||||||
public void setDate(Date date) {
|
return title;
|
||||||
this.date = date;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonGetter(value = GCUBE_RELEASE_VERSION_PROPERTY_NAME)
|
public JsonNode getLicense() {
|
||||||
public String getGCubeReleaseVersion() {
|
return license;
|
||||||
return gCubeReleaseVersion;
|
}
|
||||||
}
|
|
||||||
|
public Set<String> getKeywords() {
|
||||||
@JsonSetter(value = GCUBE_RELEASE_VERSION_PROPERTY_NAME)
|
return keywords;
|
||||||
public void setGCubeReleaseVersion(String gCubeReleaseVersion) {
|
}
|
||||||
this.gCubeReleaseVersion = gCubeReleaseVersion;
|
|
||||||
}
|
public ArrayNode getAuthors() {
|
||||||
|
return authors;
|
||||||
@JsonGetter(value = GCUBE_RELEASE_TICKET_PROPERTY_NAME)
|
}
|
||||||
public URL getGCubeReleaseTicket() {
|
|
||||||
return gCubeReleaseTicket;
|
public List<SoftwareVersionFile> getFiles() {
|
||||||
}
|
return files;
|
||||||
|
}
|
||||||
@JsonSetter(value = GCUBE_RELEASE_TICKET_PROPERTY_NAME)
|
|
||||||
public void setGCubeReleaseTicket(URL gCubeReleaseTicket) {
|
public String getCodeLocation() {
|
||||||
this.gCubeReleaseTicket = gCubeReleaseTicket;
|
return codeLocation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public URL getDOIURL() {
|
||||||
|
return doiURL;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDOIURL(URL doiURL) {
|
||||||
|
this.doiURL = doiURL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonGetter(VERSION_DOI_URL_PROPERTY_NAME)
|
|
||||||
public URL getVersionDOIURL() {
|
public URL getVersionDOIURL() {
|
||||||
return versionDOIURL;
|
return versionDOIURL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public void setVersionDOIURL(URL versionDOIURL) {
|
public void setVersionDOIURL(URL versionDOIURL) {
|
||||||
this.versionDOIURL = versionDOIURL;
|
this.versionDOIURL = versionDOIURL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JsonNode getGrants() {
|
||||||
|
return grants;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
public Map<String,ProcessorConfig> getPublishers() {
|
||||||
|
return publishers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String,ProcessorConfig> getExporters() {
|
||||||
|
return exporters;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue