Search in sources :

Example 1 with CommHeaderAbstract

use of org.incode.module.communications.dom.spi.CommHeaderAbstract in project estatio by estatio.

the class DocumentCommunicationSupportForDocumentsAttachedToDemoInvoice method addTo.

private <T extends CommunicationChannel> void addTo(final DemoInvoice invoice, final CommHeaderAbstract<T> header, final CommunicationChannelType channelType) {
    final DemoObjectWithNotes customer = invoice.getCustomer();
    final List<CommunicationChannelOwnerLink> links = communicationChannelOwnerLinkRepository.findByOwner(customer);
    final List channels = links.stream().map(CommunicationChannelOwnerLink::getCommunicationChannel).filter(cc -> cc.getType() == channelType).collect(Collectors.toList());
    header.getToChoices().addAll(channels);
}
Also used : NatureOfService(org.apache.isis.applib.annotation.NatureOfService) DocumentType(org.incode.module.document.dom.impl.types.DocumentType) PaperclipRepository(org.incode.module.document.dom.impl.paperclips.PaperclipRepository) CommunicationChannel(org.incode.module.communications.dom.impl.commchannel.CommunicationChannel) Paperclip(org.incode.module.document.dom.impl.paperclips.Paperclip) CommunicationChannelType(org.incode.module.communications.dom.impl.commchannel.CommunicationChannelType) Document(org.incode.module.document.dom.impl.docs.Document) DocumentTypeRepository(org.incode.module.document.dom.impl.types.DocumentTypeRepository) DemoObjectWithNotes(org.incode.platform.dom.communications.integtests.demo.dom.demowithnotes.DemoObjectWithNotes) CommHeaderForEmail(org.incode.module.communications.dom.spi.CommHeaderForEmail) DomainService(org.apache.isis.applib.annotation.DomainService) CommHeaderAbstract(org.incode.module.communications.dom.spi.CommHeaderAbstract) Collectors(java.util.stream.Collectors) DocumentType_and_DocumentTemplates_createSome(org.incode.platform.dom.communications.integtests.dom.communications.fixture.data.doctypes.DocumentType_and_DocumentTemplates_createSome) Inject(javax.inject.Inject) List(java.util.List) DemoInvoice(org.incode.platform.dom.communications.integtests.demo.dom.invoice.DemoInvoice) CommunicationChannelOwnerLink(org.incode.module.communications.dom.impl.commchannel.CommunicationChannelOwnerLink) DocumentCommunicationSupport(org.incode.module.communications.dom.spi.DocumentCommunicationSupport) CommunicationChannelOwnerLinkRepository(org.incode.module.communications.dom.impl.commchannel.CommunicationChannelOwnerLinkRepository) CommHeaderForPost(org.incode.module.communications.dom.spi.CommHeaderForPost) List(java.util.List) CommunicationChannelOwnerLink(org.incode.module.communications.dom.impl.commchannel.CommunicationChannelOwnerLink) DemoObjectWithNotes(org.incode.platform.dom.communications.integtests.demo.dom.demowithnotes.DemoObjectWithNotes)

Aggregations

List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Inject (javax.inject.Inject)1 DomainService (org.apache.isis.applib.annotation.DomainService)1 NatureOfService (org.apache.isis.applib.annotation.NatureOfService)1 CommunicationChannel (org.incode.module.communications.dom.impl.commchannel.CommunicationChannel)1 CommunicationChannelOwnerLink (org.incode.module.communications.dom.impl.commchannel.CommunicationChannelOwnerLink)1 CommunicationChannelOwnerLinkRepository (org.incode.module.communications.dom.impl.commchannel.CommunicationChannelOwnerLinkRepository)1 CommunicationChannelType (org.incode.module.communications.dom.impl.commchannel.CommunicationChannelType)1 CommHeaderAbstract (org.incode.module.communications.dom.spi.CommHeaderAbstract)1 CommHeaderForEmail (org.incode.module.communications.dom.spi.CommHeaderForEmail)1 CommHeaderForPost (org.incode.module.communications.dom.spi.CommHeaderForPost)1 DocumentCommunicationSupport (org.incode.module.communications.dom.spi.DocumentCommunicationSupport)1 Document (org.incode.module.document.dom.impl.docs.Document)1 Paperclip (org.incode.module.document.dom.impl.paperclips.Paperclip)1 PaperclipRepository (org.incode.module.document.dom.impl.paperclips.PaperclipRepository)1 DocumentType (org.incode.module.document.dom.impl.types.DocumentType)1 DocumentTypeRepository (org.incode.module.document.dom.impl.types.DocumentTypeRepository)1 DemoObjectWithNotes (org.incode.platform.dom.communications.integtests.demo.dom.demowithnotes.DemoObjectWithNotes)1 DemoInvoice (org.incode.platform.dom.communications.integtests.demo.dom.invoice.DemoInvoice)1