bug fixes

This commit is contained in:
Efstratios Giannopoulos 2024-05-23 17:51:53 +03:00
parent ab4631526b
commit 16503002dd
8 changed files with 32 additions and 20 deletions

View File

@ -6,6 +6,8 @@ import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType; import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.opencdmp.commons.xmladapter.InstantXmlAdapter;
import java.time.Instant; import java.time.Instant;
import java.util.List; import java.util.List;
@ -20,6 +22,7 @@ public class DescriptionFieldImportExport {
@XmlElement(name = "textListValue") @XmlElement(name = "textListValue")
private List<String> textListValue; private List<String> textListValue;
@XmlElement(name = "dateValue") @XmlElement(name = "dateValue")
@XmlJavaTypeAdapter(InstantXmlAdapter.class)
private Instant dateValue; private Instant dateValue;
@XmlElement(name = "booleanValue") @XmlElement(name = "booleanValue")

View File

@ -1,7 +1,9 @@
package org.opencdmp.commons.types.description.importexport; package org.opencdmp.commons.types.description.importexport;
import jakarta.xml.bind.annotation.*; import jakarta.xml.bind.annotation.*;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.opencdmp.commons.types.descriptiontemplate.importexport.DescriptionTemplateImportExport; import org.opencdmp.commons.types.descriptiontemplate.importexport.DescriptionTemplateImportExport;
import org.opencdmp.commons.xmladapter.InstantXmlAdapter;
import java.time.Instant; import java.time.Instant;
import java.util.List; import java.util.List;
@ -21,6 +23,7 @@ public class DescriptionImportExport {
private String label; private String label;
@XmlElement(name = "finalizedAt") @XmlElement(name = "finalizedAt")
@XmlJavaTypeAdapter(InstantXmlAdapter.class)
private Instant finalizedAt; private Instant finalizedAt;
@XmlElement(name = "sectionId") @XmlElement(name = "sectionId")
@ -105,7 +108,7 @@ public class DescriptionImportExport {
} }
public List<String> getTags() { public List<String> getTags() {
return tags; return this.tags;
} }
public void setTags(List<String> tags) { public void setTags(List<String> tags) {

View File

@ -71,7 +71,7 @@ public class DescriptionTemplateImportExport {
} }
public Short getVersion() { public Short getVersion() {
return version; return this.version;
} }
public void setVersion(Short version) { public void setVersion(Short version) {
@ -79,7 +79,7 @@ public class DescriptionTemplateImportExport {
} }
public UUID getGroupId() { public UUID getGroupId() {
return groupId; return this.groupId;
} }
public void setGroupId(UUID groupId) { public void setGroupId(UUID groupId) {

View File

@ -2,8 +2,9 @@ package org.opencdmp.commons.types.dmp.importexport;
import jakarta.xml.bind.annotation.XmlAccessType; import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType; import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.opencdmp.commons.xmladapter.InstantXmlAdapter;
import java.time.Instant; import java.time.Instant;
import java.util.UUID; import java.util.UUID;
@ -19,6 +20,7 @@ public class DmpBlueprintValueImportExport {
private String value; private String value;
@XmlElement(name = "dateValue") @XmlElement(name = "dateValue")
@XmlJavaTypeAdapter(InstantXmlAdapter.class)
private Instant dateValue; private Instant dateValue;
public UUID getFieldId() { public UUID getFieldId() {
@ -38,7 +40,7 @@ public class DmpBlueprintValueImportExport {
} }
public Instant getDateValue() { public Instant getDateValue() {
return dateValue; return this.dateValue;
} }
public void setDateValue(Instant dateValue) { public void setDateValue(Instant dateValue) {

View File

@ -1,9 +1,11 @@
package org.opencdmp.commons.types.dmp.importexport; package org.opencdmp.commons.types.dmp.importexport;
import jakarta.xml.bind.annotation.*; import jakarta.xml.bind.annotation.*;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.opencdmp.commons.enums.DmpAccessType; import org.opencdmp.commons.enums.DmpAccessType;
import org.opencdmp.commons.types.description.importexport.DescriptionImportExport; import org.opencdmp.commons.types.description.importexport.DescriptionImportExport;
import org.opencdmp.commons.types.dmpblueprint.importexport.BlueprintImportExport; import org.opencdmp.commons.types.dmpblueprint.importexport.BlueprintImportExport;
import org.opencdmp.commons.xmladapter.InstantXmlAdapter;
import java.time.Instant; import java.time.Instant;
import java.util.List; import java.util.List;
@ -40,9 +42,11 @@ public class DmpImportExport {
private List<DmpUserImportExport> users; private List<DmpUserImportExport> users;
@XmlElement(name = "finalizedAt") @XmlElement(name = "finalizedAt")
@XmlJavaTypeAdapter(InstantXmlAdapter.class)
private Instant finalizedAt; private Instant finalizedAt;
@XmlElement(name = "publicAfter") @XmlElement(name = "publicAfter")
@XmlJavaTypeAdapter(InstantXmlAdapter.class)
private Instant publicAfter; private Instant publicAfter;
@XmlElement(name = "blueprint") @XmlElement(name = "blueprint")
@ -178,7 +182,7 @@ public class DmpImportExport {
} }
public Short getVersion() { public Short getVersion() {
return version; return this.version;
} }
public void setVersion(Short version) { public void setVersion(Short version) {

View File

@ -13,7 +13,7 @@ public class BlueprintDefinitionImportExport {
private List<BlueprintSectionImportExport> sections; private List<BlueprintSectionImportExport> sections;
public List<BlueprintSectionImportExport> getSections() { public List<BlueprintSectionImportExport> getSections() {
return sections; return this.sections;
} }
public void setSections(List<BlueprintSectionImportExport> sections) { public void setSections(List<BlueprintSectionImportExport> sections) {

View File

@ -32,7 +32,7 @@ public class BlueprintSectionImportExport {
private List<BlueprintDescriptionTemplateImportExport> descriptionTemplates; private List<BlueprintDescriptionTemplateImportExport> descriptionTemplates;
public UUID getId() { public UUID getId() {
return id; return this.id;
} }
public void setId(UUID id) { public void setId(UUID id) {
@ -40,7 +40,7 @@ public class BlueprintSectionImportExport {
} }
public String getLabel() { public String getLabel() {
return label; return this.label;
} }
public void setLabel(String label) { public void setLabel(String label) {
@ -48,7 +48,7 @@ public class BlueprintSectionImportExport {
} }
public String getDescription() { public String getDescription() {
return description; return this.description;
} }
public void setDescription(String description) { public void setDescription(String description) {
@ -56,7 +56,7 @@ public class BlueprintSectionImportExport {
} }
public int getOrdinal() { public int getOrdinal() {
return ordinal; return this.ordinal;
} }
public void setOrdinal(int ordinal) { public void setOrdinal(int ordinal) {
@ -64,7 +64,7 @@ public class BlueprintSectionImportExport {
} }
public List<BlueprintSystemFieldImportExport> getSystemFields() { public List<BlueprintSystemFieldImportExport> getSystemFields() {
return systemFields; return this.systemFields;
} }
public void setSystemFields(List<BlueprintSystemFieldImportExport> systemFields) { public void setSystemFields(List<BlueprintSystemFieldImportExport> systemFields) {
@ -72,7 +72,7 @@ public class BlueprintSectionImportExport {
} }
public List<BlueprintExtraFieldImportExport> getExtraFields() { public List<BlueprintExtraFieldImportExport> getExtraFields() {
return extraFields; return this.extraFields;
} }
public void setExtraFields(List<BlueprintExtraFieldImportExport> extraFields) { public void setExtraFields(List<BlueprintExtraFieldImportExport> extraFields) {
@ -80,7 +80,7 @@ public class BlueprintSectionImportExport {
} }
public List<BlueprintReferenceTypeFieldImportExport> getReferenceFields() { public List<BlueprintReferenceTypeFieldImportExport> getReferenceFields() {
return referenceFields; return this.referenceFields;
} }
public void setReferenceFields(List<BlueprintReferenceTypeFieldImportExport> referenceFields) { public void setReferenceFields(List<BlueprintReferenceTypeFieldImportExport> referenceFields) {
@ -88,7 +88,7 @@ public class BlueprintSectionImportExport {
} }
public boolean isHasTemplates() { public boolean isHasTemplates() {
return hasTemplates; return this.hasTemplates;
} }
public void setHasTemplates(boolean hasTemplates) { public void setHasTemplates(boolean hasTemplates) {
@ -96,7 +96,7 @@ public class BlueprintSectionImportExport {
} }
public List<BlueprintDescriptionTemplateImportExport> getDescriptionTemplates() { public List<BlueprintDescriptionTemplateImportExport> getDescriptionTemplates() {
return descriptionTemplates; return this.descriptionTemplates;
} }
public void setDescriptionTemplates(List<BlueprintDescriptionTemplateImportExport> descriptionTemplates) { public void setDescriptionTemplates(List<BlueprintDescriptionTemplateImportExport> descriptionTemplates) {

View File

@ -65,7 +65,7 @@ public class EntityDoiController {
} }
@PostMapping("query") @PostMapping("query")
public QueryResult<EntityDoi> Query(@RequestBody EntityDoiLookup lookup) throws MyApplicationException, MyForbiddenException { public QueryResult<EntityDoi> query(@RequestBody EntityDoiLookup lookup) throws MyApplicationException, MyForbiddenException {
logger.debug("querying {}", EntityDoi.class.getSimpleName()); logger.debug("querying {}", EntityDoi.class.getSimpleName());
this.censorFactory.censor(EntityDoiCensor.class).censor(lookup.getProject(), null); this.censorFactory.censor(EntityDoiCensor.class).censor(lookup.getProject(), null);
@ -82,7 +82,7 @@ public class EntityDoiController {
} }
@GetMapping("{id}") @GetMapping("{id}")
public EntityDoi Get(@PathVariable("id") UUID id, FieldSet fieldSet, Locale locale) throws MyApplicationException, MyForbiddenException, MyNotFoundException { public EntityDoi get(@PathVariable("id") UUID id, FieldSet fieldSet, Locale locale) throws MyApplicationException, MyForbiddenException, MyNotFoundException {
logger.debug(new MapLogEntry("retrieving" + EntityDoi.class.getSimpleName()).And("id", id).And("fields", fieldSet)); logger.debug(new MapLogEntry("retrieving" + EntityDoi.class.getSimpleName()).And("id", id).And("fields", fieldSet));
this.censorFactory.censor(EntityDoiCensor.class).censor(fieldSet, null); this.censorFactory.censor(EntityDoiCensor.class).censor(fieldSet, null);
@ -103,7 +103,7 @@ public class EntityDoiController {
@PostMapping("persist") @PostMapping("persist")
@Transactional @Transactional
@ValidationFilterAnnotation(validator = EntityDoiPersist.EntityDoiPersistValidator.ValidatorName, argumentName = "model") @ValidationFilterAnnotation(validator = EntityDoiPersist.EntityDoiPersistValidator.ValidatorName, argumentName = "model")
public EntityDoi Persist(@RequestBody EntityDoiPersist model, FieldSet fieldSet) throws MyApplicationException, MyForbiddenException, MyNotFoundException, InvalidApplicationException { public EntityDoi persist(@RequestBody EntityDoiPersist model, FieldSet fieldSet) throws MyApplicationException, MyForbiddenException, MyNotFoundException, InvalidApplicationException {
logger.debug(new MapLogEntry("persisting" + DescriptionTemplateType.class.getSimpleName()).And("model", model).And("fieldSet", fieldSet)); logger.debug(new MapLogEntry("persisting" + DescriptionTemplateType.class.getSimpleName()).And("model", model).And("fieldSet", fieldSet));
EntityDoi persisted = this.entityDoiService.persist(model, false, fieldSet); EntityDoi persisted = this.entityDoiService.persist(model, false, fieldSet);
@ -117,7 +117,7 @@ public class EntityDoiController {
@DeleteMapping("{id}") @DeleteMapping("{id}")
@Transactional @Transactional
public void Delete(@PathVariable("id") UUID id) throws MyForbiddenException, InvalidApplicationException { public void delete(@PathVariable("id") UUID id) throws MyForbiddenException, InvalidApplicationException {
logger.debug(new MapLogEntry("retrieving" + EntityDoi.class.getSimpleName()).And("id", id)); logger.debug(new MapLogEntry("retrieving" + EntityDoi.class.getSimpleName()).And("id", id));
this.entityDoiService.deleteAndSave(id); this.entityDoiService.deleteAndSave(id);