@Test @SuppressWarnings("unchecked") public void generateDetailedReport() throws Exception { JAXBContext context = JAXBContext.newInstance(XmlDetailedReport.class.getPackage().getName()); Unmarshaller unmarshaller = context.createUnmarshaller(); Marshaller marshaller = context.createMarshaller(); JAXBElement<XmlDetailedReport> unmarshal = (JAXBElement<XmlDetailedReport>) unmarshaller.unmarshal(new File("src/test/resources/detailedReport.xml")); assertNotNull(unmarshal); XmlDetailedReport detailedReport = unmarshal.getValue(); assertNotNull(detailedReport); StringWriter writer = new StringWriter(); marshaller.marshal(OF_DETAILED_REPORT.createDetailedReport(detailedReport), writer); FileOutputStream fos = new FileOutputStream("target/detailedReport.pdf"); service.generateDetailedReport(writer.toString(), fos); }
public void generateDetailedReport(String detailedReport, OutputStream os) throws Exception { Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, os); Result result = new SAXResult(fop.getDefaultHandler()); DetailedReportFacade.newFacade().generatePdfReport(detailedReport, result); }
FOPService { public void generateDetailedReport(String detailedReport, OutputStream os) throws Exception { Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, os); Result result = new SAXResult(fop.getDefaultHandler()); DetailedReportFacade.newFacade().generatePdfReport(detailedReport, result); } }
FOPService { public void generateDetailedReport(String detailedReport, OutputStream os) throws Exception { Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, os); Result result = new SAXResult(fop.getDefaultHandler()); DetailedReportFacade.newFacade().generatePdfReport(detailedReport, result); }  }
FOPService { public void generateDetailedReport(String detailedReport, OutputStream os) throws Exception { Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, os); Result result = new SAXResult(fop.getDefaultHandler()); DetailedReportFacade.newFacade().generatePdfReport(detailedReport, result); }  @PostConstruct void init(); void generateSimpleReport(String simpleReport, OutputStream os); void generateDetailedReport(String detailedReport, OutputStream os); }
FOPService { public void generateDetailedReport(String detailedReport, OutputStream os) throws Exception { Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, os); Result result = new SAXResult(fop.getDefaultHandler()); DetailedReportFacade.newFacade().generatePdfReport(detailedReport, result); }  @PostConstruct void init(); void generateSimpleReport(String simpleReport, OutputStream os); void generateDetailedReport(String detailedReport, OutputStream os);  }