Search in sources :

Example 1 with DemoInvoice

use of org.incode.platform.dom.document.integtests.demo.dom.invoice.DemoInvoice in project estatio by estatio.

the class RenderModelFactoryOfDocumentAttachedToDemoInvoice method doNewRendererModel.

@Override
protected Object doNewRendererModel(final DocumentTemplate documentTemplate, final Document document) {
    final List<Paperclip> paperclips = paperclipRepository.findByDocument(document);
    final DemoInvoice demoInvoice = paperclips.stream().map(Paperclip::getAttachedTo).filter(DemoInvoice.class::isInstance).map(DemoInvoice.class::cast).findFirst().get();
    return new DataModel(demoInvoice.getCustomer(), demoInvoice);
}
Also used : Paperclip(org.incode.module.document.dom.impl.paperclips.Paperclip) DemoInvoice(org.incode.platform.dom.document.integtests.demo.dom.invoice.DemoInvoice)

Aggregations

Paperclip (org.incode.module.document.dom.impl.paperclips.Paperclip)1 DemoInvoice (org.incode.platform.dom.document.integtests.demo.dom.invoice.DemoInvoice)1