1 package fr.tiogars.inception.domains.domaintemplate.services;
2
3 import java.io.IOException;
4
5 import org.springframework.stereotype.Service;
6 import org.springframework.transaction.annotation.Transactional;
7
8
9 @Service
10 public class DomainTemplatesPrintAllService {
11
12 private final DomainTemplateFindAllService findAllService;
13 private final DomainTemplatePdfRenderer renderer;
14
15 public DomainTemplatesPrintAllService(DomainTemplateFindAllService findAllService, DomainTemplatePdfRenderer renderer) {
16 this.findAllService = findAllService;
17 this.renderer = renderer;
18 }
19
20
21
22
23
24
25
26 @Transactional(readOnly = true)
27 public byte[] printAll() throws IOException {
28 return renderer.render("DomainTemplates", findAllService.findAll());
29 }
30 }