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

This commit is contained in:
Kilian Schuettler 2024-08-26 16:10:02 +02:00
parent 5e8d8ea6f6
commit a377270141

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)));
}