From 12bfa519cae53bc0f58355556dbaec9a19eb004f Mon Sep 17 00:00:00 2001 From: "CITE\\amentis" Date: Tue, 30 Jul 2024 16:29:15 +0300 Subject: [PATCH] remove logic that calls import description template from plan --- .../opencdmp/service/plan/PlanServiceImpl.java | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/backend/core/src/main/java/org/opencdmp/service/plan/PlanServiceImpl.java b/backend/core/src/main/java/org/opencdmp/service/plan/PlanServiceImpl.java index b39414eb8..7535f128f 100644 --- a/backend/core/src/main/java/org/opencdmp/service/plan/PlanServiceImpl.java +++ b/backend/core/src/main/java/org/opencdmp/service/plan/PlanServiceImpl.java @@ -1868,8 +1868,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); @@ -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();