remove logic that calls import description template from plan
This commit is contained in:
parent
f7af5465f9
commit
12bfa519ca
|
@ -1869,8 +1869,6 @@ public class PlanServiceImpl implements PlanService {
|
|||
this.authorizationService.authorizeForce(Permission.NewPlan);
|
||||
PlanImportExport planXml = this.xmlHandlingService.fromXml(PlanImportExport.class, new String(bytes, StandardCharsets.UTF_8));
|
||||
|
||||
this.xmlEnsureDescriptionTemplates(planXml);
|
||||
|
||||
PlanPersist persist = new PlanPersist();
|
||||
persist.setLabel(label);
|
||||
persist.setStatus(PlanStatus.Draft);
|
||||
|
@ -1898,20 +1896,6 @@ public class PlanServiceImpl implements PlanService {
|
|||
return plan;
|
||||
}
|
||||
|
||||
private void xmlEnsureDescriptionTemplates(PlanImportExport planImportExport) throws JAXBException, InvalidApplicationException, ParserConfigurationException, IOException, TransformerException, InstantiationException, IllegalAccessException, SAXException {
|
||||
if (!this.conventionService.isListNullOrEmpty(planImportExport.getDescriptions())){
|
||||
for (DescriptionImportExport descriptionXml: planImportExport.getDescriptions()) {
|
||||
if (descriptionXml.getDescriptionTemplate() != null) {
|
||||
org.opencdmp.data.DescriptionTemplateEntity descriptionTemplateEntity = this.queryFactory.query(DescriptionTemplateQuery.class).disableTracking().ids(descriptionXml.getDescriptionTemplate().getId()).first();
|
||||
if (descriptionTemplateEntity == null) descriptionTemplateEntity = this.queryFactory.query(DescriptionTemplateQuery.class).disableTracking().groupIds(descriptionXml.getDescriptionTemplate().getGroupId()).versionStatuses(DescriptionTemplateVersionStatus.Current).isActive(IsActive.Active).statuses(DescriptionTemplateStatus.Finalized).first();
|
||||
if (descriptionTemplateEntity == null) {
|
||||
this.descriptionTemplateService.importXml(descriptionXml.getDescriptionTemplate(), null, descriptionXml.getDescriptionTemplate().getDescription(), new BaseFieldSet().ensure(PlanBlueprint._label).ensure(PlanBlueprint._hash));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private UUID xmlPlanBlueprintToPersist(PlanImportExport planXml) throws JAXBException, InvalidApplicationException, ParserConfigurationException, IOException, TransformerException, InstantiationException, IllegalAccessException, SAXException {
|
||||
if (planXml.getBlueprint() != null){
|
||||
PlanBlueprintEntity planBlueprintEntity = this.queryFactory.query(PlanBlueprintQuery.class).disableTracking().ids(planXml.getBlueprint().getId()).first();
|
||||
|
|
Loading…
Reference in New Issue