import dmp blueprint fix

This commit is contained in:
amentis 2024-05-28 11:31:15 +03:00
parent 81f5cb6c78
commit 7407fc6c39
9 changed files with 56 additions and 21 deletions

View File

@ -4,7 +4,6 @@ import jakarta.xml.bind.annotation.*;
import java.util.List;
@XmlRootElement(name = "root")
@XmlAccessorType(XmlAccessType.FIELD)
public class BlueprintDefinitionImportExport {

View File

@ -13,9 +13,9 @@ public class BlueprintDescriptionTemplateImportExport {
@XmlAttribute(name = "label")
private String label;
@XmlAttribute(name = "minMultiplicity")
private int minMultiplicity;
private Integer minMultiplicity;
@XmlAttribute(name = "maxMultiplicity")
private int maxMultiplicity;
private Integer maxMultiplicity;
public UUID getDescriptionTemplateGroupId() {
return this.descriptionTemplateGroupId;
@ -33,16 +33,20 @@ public class BlueprintDescriptionTemplateImportExport {
this.label = label;
}
public int getMinMultiplicity() {
return this.minMultiplicity;
public Integer getMinMultiplicity() {
return minMultiplicity;
}
public void setMinMultiplicity(int minMultiplicity) {
public void setMinMultiplicity(Integer minMultiplicity) {
this.minMultiplicity = minMultiplicity;
}
public int getMaxMultiplicity() {
return this.maxMultiplicity;
public Integer getMaxMultiplicity() {
return maxMultiplicity;
}
public void setMaxMultiplicity(Integer maxMultiplicity) {
this.maxMultiplicity = maxMultiplicity;
}
public void setMaxMultiplicity(int maxMultiplicity) {

View File

@ -5,6 +5,7 @@ import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import java.util.List;
import java.util.UUID;
@XmlAccessorType(XmlAccessType.FIELD)
@ -20,6 +21,8 @@ public class BlueprintExtraFieldImportExport {
private String placeholder;
@XmlAttribute(name = "description")
private String description;
@XmlAttribute(name="semantics")
private List<String> semantics;
@XmlAttribute(name = "ordinal")
private int ordinal;
@XmlAttribute(name = "required")
@ -81,5 +84,11 @@ public class BlueprintExtraFieldImportExport {
this.required = required;
}
public List<String> getSemantics() {
return semantics;
}
public void setSemantics(List<String> semantics) {
this.semantics = semantics;
}
}

View File

@ -4,6 +4,7 @@ import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import java.util.List;
import java.util.UUID;
@XmlAccessorType(XmlAccessType.FIELD)
@ -19,6 +20,8 @@ public class BlueprintReferenceTypeFieldImportExport {
private String placeholder;
@XmlAttribute(name = "description")
private String description;
@XmlAttribute(name="semantics")
private List<String> semantics;
@XmlAttribute(name = "ordinal")
private int ordinal;
@XmlAttribute(name = "required")
@ -90,4 +93,12 @@ public class BlueprintReferenceTypeFieldImportExport {
public void setMultipleSelect(Boolean multipleSelect) {
this.multipleSelect = multipleSelect;
}
public List<String> getSemantics() {
return semantics;
}
public void setSemantics(List<String> semantics) {
this.semantics = semantics;
}
}

View File

@ -5,6 +5,7 @@ import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import java.util.List;
import java.util.UUID;
@XmlAccessorType(XmlAccessType.FIELD)
@ -20,6 +21,8 @@ public class BlueprintSystemFieldImportExport {
private String placeholder;
@XmlAttribute(name = "description")
private String description;
@XmlAttribute(name="semantics")
private List<String> semantics;
@XmlAttribute(name = "ordinal")
private int ordinal;
@XmlAttribute(name = "required")
@ -80,4 +83,12 @@ public class BlueprintSystemFieldImportExport {
public void setRequired(boolean required) {
this.required = required;
}
public List<String> getSemantics() {
return semantics;
}
public void setSemantics(List<String> semantics) {
this.semantics = semantics;
}
}

View File

@ -555,6 +555,7 @@ public class DmpBlueprintServiceImpl implements DmpBlueprintService {
xml.setDescription(entity.getDescription());
xml.setOrdinal(entity.getOrdinal());
xml.setRequired(entity.isRequired());
xml.setSemantics(entity.getSemantics());
return xml;
}
@ -568,6 +569,7 @@ public class DmpBlueprintServiceImpl implements DmpBlueprintService {
xml.setOrdinal(entity.getOrdinal());
xml.setRequired(entity.isRequired());
xml.setMultipleSelect(entity.getMultipleSelect());
xml.setSemantics(entity.getSemantics());
return xml;
}
@ -580,6 +582,7 @@ public class DmpBlueprintServiceImpl implements DmpBlueprintService {
xml.setDescription(entity.getDescription());
xml.setOrdinal(entity.getOrdinal());
xml.setRequired(entity.isRequired());
xml.setSemantics(entity.getSemantics());
return xml;
}
@ -600,15 +603,6 @@ public class DmpBlueprintServiceImpl implements DmpBlueprintService {
BlueprintImportExport dmpDefinition = this.xmlHandlingService.fromXml(BlueprintImportExport.class, new String(bytes, StandardCharsets.UTF_8));
if (dmpDefinition != null) {
persist.setDefinition(this.xmlDefinitionToPersist(dmpDefinition.getDmpBlueprintDefinition()));
if (dmpDefinition.getId() != null) {
persist.setId(dmpDefinition.getId());
DmpBlueprintEntity data = this.entityManager.find(DmpBlueprintEntity.class, dmpDefinition.getId(), true);
if (data == null) {
throw new MyNotFoundException(this.messageSource.getMessage("General_ItemNotFound", new Object[]{dmpDefinition.getId(), DmpBlueprint.class.getSimpleName()}, LocaleContextHolder.getLocale()));
}
persist.setHash(this.conventionService.hashValue(data.getUpdatedAt()));
}
persist.setLabel(dmpDefinition.getLabel());
}
this.validatorFactory.validator(DmpBlueprintPersist.DmpBlueprintPersistValidator.class).validateForce(persist);
@ -682,6 +676,7 @@ public class DmpBlueprintServiceImpl implements DmpBlueprintService {
persist.setDescription(importXml.getDescription());
persist.setOrdinal(importXml.getOrdinal());
persist.setRequired(importXml.isRequired());
persist.setSemantics(importXml.getSemantics());
return persist;
}
@ -695,6 +690,7 @@ public class DmpBlueprintServiceImpl implements DmpBlueprintService {
persist.setDescription(importXml.getDescription());
persist.setOrdinal(importXml.getOrdinal());
persist.setRequired(importXml.isRequired());
persist.setSemantics(importXml.getSemantics());
return persist;
}
@ -709,6 +705,7 @@ public class DmpBlueprintServiceImpl implements DmpBlueprintService {
persist.setOrdinal(importXml.getOrdinal());
persist.setRequired(importXml.isRequired());
persist.setMultipleSelect(importXml.getMultipleSelect());
persist.setSemantics(importXml.getSemantics());
return persist;
}

View File

@ -182,6 +182,7 @@ public class DmpBlueprintController {
}
@RequestMapping(method = RequestMethod.POST, value = "/xml/import")
@Transactional
public DmpBlueprint importXml(@RequestParam("file") MultipartFile file, FieldSet fieldSet) throws IOException, JAXBException, InvalidApplicationException, ParserConfigurationException, TransformerException, InstantiationException, IllegalAccessException, SAXException {
logger.debug(new MapLogEntry("clone" + DmpBlueprint.class.getSimpleName()).And("file", file));

View File

@ -233,11 +233,11 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
this.dmpBlueprintService.uploadFile(data.file, data.name)
.pipe(takeUntil(this._destroyed))
.subscribe(_ => {
this.uiNotificationService.snackBarNotification(this.language.instant('DMP-BLUEPRINT-LISTING.MESSAGES.TEMPLATE-UPLOAD-SUCCESS'), SnackBarNotificationLevel.Success);
this.uiNotificationService.snackBarNotification(this.language.instant('DMP-BLUEPRINT-LISTING.MESSAGES.BLUEPRINT-UPLOAD-SUCCESS'), SnackBarNotificationLevel.Success);
this.refresh();
},
error => {
this.uiNotificationService.snackBarNotification(error.message, SnackBarNotificationLevel.Error);
this.uiNotificationService.snackBarNotification(error.error.error, SnackBarNotificationLevel.Error);
});
}
});

View File

@ -1630,7 +1630,8 @@
"DESCRIPTIONS": "Descriptions",
"DESCRIPTIONS-HINT": "Select which descriptions to include in the new Plan. Selected descriptions will be editable.",
"BLUEPRINT": "Plan Blueprint",
"BLUEPRINT-PLACEHOLDER": "Plan Blueprint"
"BLUEPRINT-PLACEHOLDER": "Plan Blueprint",
"SELECT-BLUEPRINT-SECTION": "Select Plan Section"
},
"NO-DESCRIPTIONS": "Not available Descriptions for this Plan.",
"ACTIONS": {
@ -1680,7 +1681,9 @@
"UPLOAD-XML-NAME": "Name Of Plan Blueprint",
"UPLOAD-XML-FILE-CANCEL": "Cancel"
},
"MESSAGES": "Blueprint successfully uploaded"
"MESSAGES": {
"BLUEPRINT-UPLOAD-SUCCESS": "Blueprint successfully uploaded"
}
},
"USER-LISTING": {
"TITLE": "Users",