remove logic that calls import description template from plan

This commit is contained in:
CITE\amentis 2024-07-30 16:29:15 +03:00
parent f7af5465f9
commit 12bfa519ca
1 changed files with 0 additions and 16 deletions

View File

@ -1869,8 +1869,6 @@ public class PlanServiceImpl implements PlanService {
this.authorizationService.authorizeForce(Permission.NewPlan); this.authorizationService.authorizeForce(Permission.NewPlan);
PlanImportExport planXml = this.xmlHandlingService.fromXml(PlanImportExport.class, new String(bytes, StandardCharsets.UTF_8)); PlanImportExport planXml = this.xmlHandlingService.fromXml(PlanImportExport.class, new String(bytes, StandardCharsets.UTF_8));
this.xmlEnsureDescriptionTemplates(planXml);
PlanPersist persist = new PlanPersist(); PlanPersist persist = new PlanPersist();
persist.setLabel(label); persist.setLabel(label);
persist.setStatus(PlanStatus.Draft); persist.setStatus(PlanStatus.Draft);
@ -1898,20 +1896,6 @@ public class PlanServiceImpl implements PlanService {
return plan; 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 { private UUID xmlPlanBlueprintToPersist(PlanImportExport planXml) throws JAXBException, InvalidApplicationException, ParserConfigurationException, IOException, TransformerException, InstantiationException, IllegalAccessException, SAXException {
if (planXml.getBlueprint() != null){ if (planXml.getBlueprint() != null){
PlanBlueprintEntity planBlueprintEntity = this.queryFactory.query(PlanBlueprintQuery.class).disableTracking().ids(planXml.getBlueprint().getId()).first(); PlanBlueprintEntity planBlueprintEntity = this.queryFactory.query(PlanBlueprintQuery.class).disableTracking().ids(planXml.getBlueprint().getId()).first();