RED-9965: component definitions are outside of template folder for file export #697

Merged
kilian.schuettler1 merged 1 commits from RED-9965 into master 2024-08-26 17:26:14 +02:00

View File

@ -124,6 +124,7 @@ public class DossierTemplateExportService {
});
}
@Observed(name = "DossierTemplateExportService", contextualName = "export-dossier-template")
public long createDownloadArchive(ExportDownloadMessage downloadJob) throws IOException {
@ -143,6 +144,7 @@ public class DossierTemplateExportService {
}
@Observed(name = "DossierTemplateExportService", contextualName = "write-dossier-template-to-archive")
public void addDossierTemplateToArchive(FileSystemBackedArchiver fileSystemBackedArchiver, String folder, DossierTemplateEntity dossierTemplate) throws IOException {
@ -276,7 +278,7 @@ public class DossierTemplateExportService {
// components
List<ComponentDefinitionEntity> componentDefinitions = componentDefinitionPersistenceService.findByDossierTemplateIdAndNotSoftDeleted(dossierTemplate.getId());
for (ComponentDefinitionEntity componentDefinition : componentDefinitions) {
fileSystemBackedArchiver.addEntries(new FileSystemBackedArchiver.ArchiveModel(componentDefinition.getTechnicalName(),
fileSystemBackedArchiver.addEntries(new FileSystemBackedArchiver.ArchiveModel(resolveFolder(folder, componentDefinition.getTechnicalName()),
getFilename(ExportFilename.COMPONENTS, JSON_EXT),
objectMapper.writeValueAsBytes(componentDefinition)));
}