improving code

This commit is contained in:
Luca Frosini 2023-01-16 15:31:24 +01:00
parent 715091f304
commit efca1627a3
6 changed files with 60 additions and 66 deletions

View File

@ -42,7 +42,7 @@ public class SoftwareConfigAnalyser {
this.jsonNode = objectMapper.readTree(json); this.jsonNode = objectMapper.readTree(json);
} }
protected SoftwareVersionConfig actualize(JsonNode version) throws Exception { protected SoftwareVersionConfig actualizeSoftwareVersionConfig(JsonNode version) throws Exception {
Variables variables = objectMapper.treeToValue(version, Variables.class); Variables variables = objectMapper.treeToValue(version, Variables.class);
Set<String> missingVariables = variables.parse(); Set<String> missingVariables = variables.parse();
int size = missingVariables.size(); int size = missingVariables.size();
@ -52,13 +52,20 @@ public class SoftwareConfigAnalyser {
} }
JsonNode swVersion = objectMapper.convertValue(variables.getProperties(), JsonNode.class); JsonNode swVersion = objectMapper.convertValue(variables.getProperties(), JsonNode.class);
SoftwareVersionConfig softwareVersion = objectMapper.treeToValue(swVersion, SoftwareVersionConfig.class); SoftwareVersionConfig softwareVersion = objectMapper.treeToValue(swVersion, SoftwareVersionConfig.class);
// softwareVersion.setVariables(variables);
return softwareVersion; return softwareVersion;
} }
protected SoftwareConfig actualizeSoftwareConfig(JsonNode node) throws Exception {
Variables variables = objectMapper.treeToValue(node, Variables.class);
variables.parse();
JsonNode sc = objectMapper.convertValue(variables.getProperties(), JsonNode.class);
SoftwareConfig softwareConfig = objectMapper.treeToValue(sc, SoftwareConfig.class);
return softwareConfig;
}
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();
SoftwareConfig softwareConfig = objectMapper.treeToValue(originalGlobal, SoftwareConfig.class); SoftwareConfig softwareConfig = actualizeSoftwareConfig(originalGlobal);
softwareConfig.setOriginalJson(originalGlobal); softwareConfig.setOriginalJson(originalGlobal);
ObjectNode global = originalGlobal.deepCopy(); ObjectNode global = originalGlobal.deepCopy();
@ -78,7 +85,7 @@ public class SoftwareConfigAnalyser {
JsonNode version = Utils.merge(global, originalVersion); JsonNode version = Utils.merge(global, originalVersion);
SoftwareVersionConfig softwareVersion = actualize(version); SoftwareVersionConfig softwareVersion = actualizeSoftwareVersionConfig(version);
softwareVersion.setOriginalJson(originalVersion); softwareVersion.setOriginalJson(originalVersion);
boolean newDOI = false; boolean newDOI = false;
@ -91,10 +98,7 @@ public class SoftwareConfigAnalyser {
previous.setNext(softwareVersion); previous.setNext(softwareVersion);
} }
logger.trace("Going to process {}", softwareVersion.getTitle());
logger.trace("Going to process {} {} (previous version {})",
softwareVersion.getName(), softwareVersion.getVersion(),
softwareVersion.getPrevious()!=null ? softwareVersion.getPrevious().getVersion(): null);
try { try {
SoftwareVersionConfigAnalyser softwareVersionAnalyser = new SoftwareVersionConfigAnalyser(softwareVersion); SoftwareVersionConfigAnalyser softwareVersionAnalyser = new SoftwareVersionConfigAnalyser(softwareVersion);

View File

@ -66,8 +66,9 @@ public class SoftwareVersionConfigAnalyser {
List<SoftwareVersionPublisher> svps = SoftwareVersionPublisher.getPublishers(); List<SoftwareVersionPublisher> svps = SoftwareVersionPublisher.getPublishers();
for(SoftwareVersionPublisher svp: svps) { for(SoftwareVersionPublisher svp: svps) {
ProcessorConfig processorConfig = processors.get(svp.getClass().getSimpleName()); ProcessorConfig processorConfig = processors.get(svp.getClass().getSimpleName());
svp.setProcessorConfig(processorConfig); svp.setSoftwareConfig(softwareConfig);
svp.setSoftwareVersion(softwareVersionConfig); svp.setSoftwareVersion(softwareVersionConfig);
svp.setProcessorConfig(processorConfig);
svp.setFirst(first); svp.setFirst(first);
svp.publish(); svp.publish();
} }
@ -77,8 +78,9 @@ public class SoftwareVersionConfigAnalyser {
List<SoftwareVersionExporter> sves = SoftwareVersionExporter.getExporters(); List<SoftwareVersionExporter> sves = SoftwareVersionExporter.getExporters();
for(SoftwareVersionExporter sve: sves) { for(SoftwareVersionExporter sve: sves) {
ProcessorConfig processorConfig = exporters.get(sve.getClass().getSimpleName()); ProcessorConfig processorConfig = exporters.get(sve.getClass().getSimpleName());
sve.setProcessorConfig(processorConfig); sve.setSoftwareConfig(softwareConfig);
sve.setSoftwareVersion(softwareVersionConfig); sve.setSoftwareVersion(softwareVersionConfig);
sve.setProcessorConfig(processorConfig);
sve.setFirst(first); sve.setFirst(first);
sve.export(); sve.export();
} }

View File

@ -51,9 +51,6 @@ public class SoftwareVersionConfig {
@JsonIgnore @JsonIgnore
protected ObjectNode originalJson; protected ObjectNode originalJson;
@JsonProperty(NAME_PROPERTY_NAME)
protected String name;
@JsonProperty(VERSION_PROPERTY_NAME) @JsonProperty(VERSION_PROPERTY_NAME)
protected String version; protected String version;
@ -155,10 +152,6 @@ public class SoftwareVersionConfig {
this.originalJson = originalJson; this.originalJson = originalJson;
} }
public String getName() {
return name;
}
public String getVersion() { public String getVersion() {
return version; return version;
} }

View File

@ -10,7 +10,7 @@ import org.gcube.common.software.model.SoftwareVersionConfig;
public abstract class SoftwareVersionProcessor { public abstract class SoftwareVersionProcessor {
protected SoftwareConfig softwareConfig; protected SoftwareConfig softwareConfig;
protected SoftwareVersionConfig softwareVersion; protected SoftwareVersionConfig softwareVersionConfig;
protected ProcessorConfig processorConfig; protected ProcessorConfig processorConfig;
protected boolean first; protected boolean first;
@ -23,11 +23,11 @@ public abstract class SoftwareVersionProcessor {
} }
public SoftwareVersionConfig getSoftwareVersionConfig() { public SoftwareVersionConfig getSoftwareVersionConfig() {
return softwareVersion; return softwareVersionConfig;
} }
public void setSoftwareVersion(SoftwareVersionConfig softwareVersionConfig) { public void setSoftwareVersion(SoftwareVersionConfig softwareVersionConfig) {
this.softwareVersion = softwareVersionConfig; this.softwareVersionConfig = softwareVersionConfig;
} }
public ProcessorConfig getProcessorConfig() { public ProcessorConfig getProcessorConfig() {

View File

@ -28,7 +28,7 @@ public class BibLaTeXSoftwareVersionExporter extends SoftwareVersionExporter {
public static final String TEMPLATE_FILENAME = "biblatex.template"; public static final String TEMPLATE_FILENAME = "biblatex.template";
public void export() throws Exception { public void export() throws Exception {
String name = softwareVersion.getName(); String title = softwareVersionConfig.getTitle();
ElaborationType export = processorConfig.getElaboration(); ElaborationType export = processorConfig.getElaboration();
@ -38,16 +38,16 @@ public class BibLaTeXSoftwareVersionExporter extends SoftwareVersionExporter {
break; break;
case UPDATE_ONLY: case UPDATE_ONLY:
if (softwareVersion.isNewDeposition()) { if (softwareVersionConfig.isNewDeposition()) {
logger.info("Skipping export for {} {}.", name, softwareVersion.getVersion()); logger.info("Skipping export for {}.", title);
return; return;
} }
generate(); generate();
break; break;
case NEW: case NEW:
if (!softwareVersion.isNewDeposition()) { if (!softwareVersionConfig.isNewDeposition()) {
logger.info("Skipping export for {} {}.", name, softwareVersion.getVersion()); logger.info("Skipping export for {}.", title);
return; return;
} }
generate(); generate();
@ -55,7 +55,7 @@ public class BibLaTeXSoftwareVersionExporter extends SoftwareVersionExporter {
case NONE: case NONE:
default: default:
logger.info("Skipping export for {} {}.", name, softwareVersion.getVersion()); logger.info("Skipping export for {}.", title);
return; return;
} }
@ -143,12 +143,11 @@ public class BibLaTeXSoftwareVersionExporter extends SoftwareVersionExporter {
// } // }
protected String parseTemplate(String template) throws Exception { protected String parseTemplate(String template) throws Exception {
// String s = Utils.replaceVariable("citation_id", getCitationID(), template);
String s = template; String s = template;
s = Utils.replaceVariable("author", getAuthors(softwareVersion.getAuthors()), s); s = Utils.replaceVariable("author", getAuthors(softwareVersionConfig.getAuthors()), s);
s = Utils.replaceVariable("keywords", getKeywords(softwareVersion.getKeywords()), s); s = Utils.replaceVariable("keywords", getKeywords(softwareVersionConfig.getKeywords()), s);
Variables variables = softwareVersion.getVariables(); Variables variables = softwareVersionConfig.getVariables();
s = variables.replaceAllVariables(s); s = variables.replaceAllVariables(s);
// s = addNotes(s); // s = addNotes(s);
@ -156,12 +155,12 @@ public class BibLaTeXSoftwareVersionExporter extends SoftwareVersionExporter {
} }
protected void generate() throws Exception { protected void generate() throws Exception {
String name = softwareVersion.getName(); String title = softwareVersionConfig.getTitle();
if(softwareVersion.getVersionDOIURL()==null) { if(softwareVersionConfig.getVersionDOIURL()==null) {
logger.info("No Version DOI URL for {} {}. It will not be exported in BibLaTex format.", name, softwareVersion.getVersion()); logger.info("No Version DOI URL for {}. It will not be exported in BibLaTex format.", title);
return; return;
} }
logger.info("Going to export {} {} in BibLaTex format.", name, softwareVersion.getVersion()); logger.info("Going to export {} in BibLaTex format.", title);
String template = getTemplate(); String template = getTemplate();
String toBeExported = parseTemplate(template); String toBeExported = parseTemplate(template);

View File

@ -96,7 +96,7 @@ public class ZenodoSoftwareVersionPublisher extends SoftwareVersionPublisher {
public ZenodoSoftwareVersionPublisher() {} public ZenodoSoftwareVersionPublisher() {}
protected void addFilesToDeposition(List<File> files ) throws Exception { protected void addFilesToDeposition(List<File> files ) throws Exception {
String depositID = getZenodoIDFromDOIURL(softwareVersion.getVersionDOIURL()); String depositID = getZenodoIDFromDOIURL(softwareVersionConfig.getVersionDOIURL());
String newFilePath = DEPOSTION_FILES_PATH.replace(":id", depositID); String newFilePath = DEPOSTION_FILES_PATH.replace(":id", depositID);
URL url = new URL(zenodoBaseURL, newFilePath); URL url = new URL(zenodoBaseURL, newFilePath);
@ -131,7 +131,7 @@ public class ZenodoSoftwareVersionPublisher extends SoftwareVersionPublisher {
gxHTTPStringRequest.header("Content-Type", "application/json"); gxHTTPStringRequest.header("Content-Type", "application/json");
gxHTTPStringRequest.header("Accept", "application/json"); gxHTTPStringRequest.header("Accept", "application/json");
String id = getZenodoIDFromDOIURL(softwareVersion.getVersionDOIURL()); String id = getZenodoIDFromDOIURL(softwareVersionConfig.getVersionDOIURL());
gxHTTPStringRequest.path(DEPOSITION_PATH.replace(":id", id)); gxHTTPStringRequest.path(DEPOSITION_PATH.replace(":id", id));
ObjectNode metadata = generateMetadata(); ObjectNode metadata = generateMetadata();
@ -148,7 +148,7 @@ public class ZenodoSoftwareVersionPublisher extends SoftwareVersionPublisher {
gxHTTPStringRequest.header("Content-Type", "application/json"); gxHTTPStringRequest.header("Content-Type", "application/json");
gxHTTPStringRequest.header("Accept", "application/json"); gxHTTPStringRequest.header("Accept", "application/json");
String id = getZenodoIDFromDOIURL(softwareVersion.getVersionDOIURL()); String id = getZenodoIDFromDOIURL(softwareVersionConfig.getVersionDOIURL());
gxHTTPStringRequest.path(DEPOSTION_PUBLISH_PATH.replace(":id", id)); gxHTTPStringRequest.path(DEPOSTION_PUBLISH_PATH.replace(":id", id));
HttpURLConnection httpURLConnection = gxHTTPStringRequest.post(); HttpURLConnection httpURLConnection = gxHTTPStringRequest.post();
@ -157,7 +157,7 @@ public class ZenodoSoftwareVersionPublisher extends SoftwareVersionPublisher {
protected void finalize() throws Exception { protected void finalize() throws Exception {
List<File> files = new ArrayList<>(); List<File> files = new ArrayList<>();
for(SoftwareVersionFile svf : softwareVersion.getFiles()) { for(SoftwareVersionFile svf : softwareVersionConfig.getFiles()) {
File file = svf.downloadFile(); File file = svf.downloadFile();
files.add(file); files.add(file);
Thread.sleep(TimeUnit.SECONDS.toMillis(1)); Thread.sleep(TimeUnit.SECONDS.toMillis(1));
@ -272,15 +272,15 @@ public class ZenodoSoftwareVersionPublisher extends SoftwareVersionPublisher {
response = getResponse(httpURLConnection); response = getResponse(httpURLConnection);
URL conceptDOIURL = createZenodoDOIURLFromID(response.get("conceptrecid").asText()); URL conceptDOIURL = createZenodoDOIURLFromID(response.get("conceptrecid").asText());
softwareVersion.setDOIURL(conceptDOIURL); softwareVersionConfig.setDOIURL(conceptDOIURL);
URL doiURL = new URL(doiBaseURL + response.get("id").asText()); URL doiURL = new URL(doiBaseURL + response.get("id").asText());
softwareVersion.setVersionDOIURL(doiURL); softwareVersionConfig.setVersionDOIURL(doiURL);
finalize(); finalize();
} }
private ArrayNode getAuthors(){ private ArrayNode getAuthors(){
ArrayNode authors = softwareVersion.getAuthors().deepCopy(); ArrayNode authors = softwareVersionConfig.getAuthors().deepCopy();
return authors; return authors;
} }
@ -288,7 +288,7 @@ public class ZenodoSoftwareVersionPublisher extends SoftwareVersionPublisher {
StringBuffer stringBuffer = new StringBuffer(); StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append(processorConfig.getProperty(HTML_DESCRIPTION_CONFIG_FIELD_NAME).asText()); stringBuffer.append(processorConfig.getProperty(HTML_DESCRIPTION_CONFIG_FIELD_NAME).asText());
String codeLocation = softwareVersion.getCodeLocation(); String codeLocation = softwareVersionConfig.getCodeLocation();
if(codeLocation!=null) { if(codeLocation!=null) {
String htmlCodeLocation = processorConfig.getProperty(HTML_CODE_LOCATION_CONFIG_FIELD_NAME).asText(); String htmlCodeLocation = processorConfig.getProperty(HTML_CODE_LOCATION_CONFIG_FIELD_NAME).asText();
htmlCodeLocation = Utils.replaceVariable("code_location", codeLocation, htmlCodeLocation); htmlCodeLocation = Utils.replaceVariable("code_location", codeLocation, htmlCodeLocation);
@ -306,7 +306,7 @@ public class ZenodoSoftwareVersionPublisher extends SoftwareVersionPublisher {
for(JsonNode idNode : arrayNode) { for(JsonNode idNode : arrayNode) {
idToSkip.add(idNode.asText()); idToSkip.add(idNode.asText());
} }
for(JsonNode g : softwareVersion.getGrants()) { for(JsonNode g : softwareVersionConfig.getGrants()) {
String id = g.get("id").asText(); String id = g.get("id").asText();
if(idToSkip.contains(id)) { if(idToSkip.contains(id)) {
continue; continue;
@ -319,7 +319,7 @@ public class ZenodoSoftwareVersionPublisher extends SoftwareVersionPublisher {
} }
private ArrayNode getKeywords(){ private ArrayNode getKeywords(){
Set<String> keywords = softwareVersion.getKeywords(); Set<String> keywords = softwareVersionConfig.getKeywords();
ObjectMapper objectMapper = Utils.getObjectMapper(); ObjectMapper objectMapper = Utils.getObjectMapper();
ArrayNode keywordsArrayNode = objectMapper.createArrayNode(); ArrayNode keywordsArrayNode = objectMapper.createArrayNode();
for(String keyword : keywords) { for(String keyword : keywords) {
@ -329,11 +329,11 @@ public class ZenodoSoftwareVersionPublisher extends SoftwareVersionPublisher {
} }
private String getLicense() { private String getLicense() {
return softwareVersion.getLicense().get("id").asText(); return softwareVersionConfig.getLicense().get("id").asText();
} }
private String getDate() { private String getDate() {
return Utils.getDateAsString(softwareVersion.getDate()); return Utils.getDateAsString(softwareVersionConfig.getDate());
} }
private ObjectNode generateMetadata() { private ObjectNode generateMetadata() {
@ -349,8 +349,8 @@ public class ZenodoSoftwareVersionPublisher extends SoftwareVersionPublisher {
metadata.replace("keywords", getKeywords()); metadata.replace("keywords", getKeywords());
metadata.put("license", getLicense()); metadata.put("license", getLicense());
metadata.put("publication_date", getDate()); metadata.put("publication_date", getDate());
metadata.put("title", softwareVersion.getTitle()); metadata.put("title", softwareVersionConfig.getTitle());
metadata.put("version", softwareVersion.getVersion()); metadata.put("version", softwareVersionConfig.getVersion());
metadatWrapper.set(METADATA_FIELD_NAME, metadata); metadatWrapper.set(METADATA_FIELD_NAME, metadata);
return metadatWrapper; return metadatWrapper;
@ -363,7 +363,7 @@ public class ZenodoSoftwareVersionPublisher extends SoftwareVersionPublisher {
gxHTTPStringRequest.from(GUCBE_ZENODO_SOFTWARE_DEPOSIT); gxHTTPStringRequest.from(GUCBE_ZENODO_SOFTWARE_DEPOSIT);
gxHTTPStringRequest.queryParams(getAccessTokenQueryParamters()); gxHTTPStringRequest.queryParams(getAccessTokenQueryParamters());
gxHTTPStringRequest.header("Accept", "application/json"); gxHTTPStringRequest.header("Accept", "application/json");
String id = getZenodoIDFromDOIURL(softwareVersion.getVersionDOIURL()); String id = getZenodoIDFromDOIURL(softwareVersionConfig.getVersionDOIURL());
gxHTTPStringRequest.path(DEPOSTION_EDIT_PATH.replace(":id", id)); gxHTTPStringRequest.path(DEPOSTION_EDIT_PATH.replace(":id", id));
HttpURLConnection httpURLConnection = gxHTTPStringRequest.post(); HttpURLConnection httpURLConnection = gxHTTPStringRequest.post();
getResponse(httpURLConnection); getResponse(httpURLConnection);
@ -402,7 +402,7 @@ public class ZenodoSoftwareVersionPublisher extends SoftwareVersionPublisher {
gxHTTPStringRequest.queryParams(getAccessTokenQueryParamters()); gxHTTPStringRequest.queryParams(getAccessTokenQueryParamters());
gxHTTPStringRequest.header("Content-Type", "application/json"); gxHTTPStringRequest.header("Content-Type", "application/json");
gxHTTPStringRequest.header("Accept", "application/json"); gxHTTPStringRequest.header("Accept", "application/json");
String conceptID = getZenodoIDFromDOIURL(softwareVersion.getDOIURL()); String conceptID = getZenodoIDFromDOIURL(softwareVersionConfig.getDOIURL());
gxHTTPStringRequest.path(RECORD_PATH.replace(":id", conceptID)); gxHTTPStringRequest.path(RECORD_PATH.replace(":id", conceptID));
HttpURLConnection httpURLConnection = gxHTTPStringRequest.get(); HttpURLConnection httpURLConnection = gxHTTPStringRequest.get();
JsonNode jsonNode = getResponse(httpURLConnection); JsonNode jsonNode = getResponse(httpURLConnection);
@ -414,13 +414,13 @@ public class ZenodoSoftwareVersionPublisher extends SoftwareVersionPublisher {
* this should avoid errors on softwareConcept. * this should avoid errors on softwareConcept.
*/ */
String latestVersionDOI = jsonNode.get("links").get("doi").asText(); String latestVersionDOI = jsonNode.get("links").get("doi").asText();
String previousVersionDOI = softwareVersion.getPrevious().getVersionDOIURL().toString(); String previousVersionDOI = softwareVersionConfig.getPrevious().getVersionDOIURL().toString();
if(previousVersionDOI.compareTo(latestVersionDOI)!=0) { if(previousVersionDOI.compareTo(latestVersionDOI)!=0) {
logger.error("Zenodo obtained latest DOI {} != {} DOI from previous version", latestVersionDOI, previousVersionDOI); logger.error("Zenodo obtained latest DOI {} != {} DOI from previous version", latestVersionDOI, previousVersionDOI);
throw new RuntimeException("It seems that your json is not up to date with Zenodo."); throw new RuntimeException("It seems that your json is not up to date with Zenodo.");
} }
String latestVersionVersion = jsonNode.get("metadata").get("version").asText(); String latestVersionVersion = jsonNode.get("metadata").get("version").asText();
String previousVersionVersion = softwareVersion.getPrevious().getVersion().toString(); String previousVersionVersion = softwareVersionConfig.getPrevious().getVersion().toString();
if(latestVersionVersion.compareTo(previousVersionVersion)!=0) { if(latestVersionVersion.compareTo(previousVersionVersion)!=0) {
logger.error("Zenodo obtained latest Version {} != {} Versoin from previous version", latestVersionVersion, previousVersionVersion); logger.error("Zenodo obtained latest Version {} != {} Versoin from previous version", latestVersionVersion, previousVersionVersion);
throw new RuntimeException("It seems that your json is not up to date with Zenodo."); throw new RuntimeException("It seems that your json is not up to date with Zenodo.");
@ -456,7 +456,7 @@ public class ZenodoSoftwareVersionPublisher extends SoftwareVersionPublisher {
// The reserved DOI of this created new version will be // The reserved DOI of this created new version will be
URL doiURL = new URL(response.get("doi_url").asText()); URL doiURL = new URL(response.get("doi_url").asText());
softwareVersion.setVersionDOIURL(doiURL); softwareVersionConfig.setVersionDOIURL(doiURL);
// Remove previous depositionFiles // Remove previous depositionFiles
deletePreviousFiles(); deletePreviousFiles();
@ -486,39 +486,35 @@ public class ZenodoSoftwareVersionPublisher extends SoftwareVersionPublisher {
public void publish() throws Exception { public void publish() throws Exception {
getZenodoConnectionConfig(); getZenodoConnectionConfig();
String name = softwareVersion.getName(); String title = softwareVersionConfig.getTitle();
ElaborationType publish = processorConfig.getElaboration(); ElaborationType publish = processorConfig.getElaboration();
if(publish==ElaborationType.NONE) { if(publish==ElaborationType.NONE) {
logger.info("Deposit is disabled for {} {}.", logger.info("Deposit is disabled for {}.",title);
name , softwareVersion.getVersion());
return; return;
} }
if(softwareVersion.getVersionDOIURL()!=null) { if(softwareVersionConfig.getVersionDOIURL()!=null) {
softwareVersion.setNewDeposition(false); softwareVersionConfig.setNewDeposition(false);
if(publish==ElaborationType.ALL || if(publish==ElaborationType.ALL ||
publish==ElaborationType.UPDATE_ONLY) { publish==ElaborationType.UPDATE_ONLY) {
logger.info("Going to update {} {}.", logger.info("Going to update {}.",title);
name , softwareVersion.getVersion());
update(); update();
}else { }else {
logger.info("{} {} has been already deposited.", logger.info("{} has been already deposited.", title);
name , softwareVersion.getVersion());
} }
}else { }else {
if(publish==ElaborationType.ALL || if(publish==ElaborationType.ALL ||
publish==ElaborationType.NEW) { publish==ElaborationType.NEW) {
logger.info("Going to deposit {} {}", logger.info("Going to deposit {}", title);
name , softwareVersion.getVersion());
softwareVersion.setNewDeposition(true); softwareVersionConfig.setNewDeposition(true);
if(softwareVersion.getDOIURL()==null) { if(softwareVersionConfig.getDOIURL()==null) {
create(); create();
}else { }else {
newVersion(); newVersion();