public abstract class TemplateInvoiceService<O extends Order<I>,I extends OrderItem,INVOICE> extends Object implements InvoiceService<O,I,INVOICE>
Publisher
publish an Invoice Format (Default @ HTML); where the Order
is provided to the context with order + processContext(Order, Map)
:
#processContext(Order, Publisher)
Constructor and Description |
---|
TemplateInvoiceService() |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(ChangeListener changeListener)
Allow Notify all
ChangeListener s about a change |
protected INVOICE |
convertStreamToInvoice(Writer writer)
Using the writer produce the final INVOICE output.
|
INVOICE |
generateInvoice(O order)
Generate the INVOICE
|
ExportType |
getInvoiceType()
Mime type/Extension etc if any
|
List |
getListeners()
Get list directly.
|
protected abstract Publisher |
getPublisher(O order)
Get Publisher for each instance request
|
void |
notifyAllListeners(Object object)
Whenever a node is selected/updated, it also notifies its listeners.
|
protected void |
processContext(O order,
Map dataMap)
Can process order to derive other intermediate context variables and put them in the context Map.
|
void |
setListeners(List listeners)
Set list directly.
|
protected void |
updateInvoiceHistory(O order,
INVOICE invoice)
By Default no Invoice history is maintained.
|
protected abstract Publisher getPublisher(O order)
@Transactional(readOnly=false) protected void updateInvoiceHistory(O order, INVOICE invoice) throws Exception
AsynchronousChangeListener
order
- invoice
- Exception
@Transactional(readOnly=false) public INVOICE generateInvoice(O order)
InvoiceService
generateInvoice
in interface InvoiceService<O extends Order<I>,I extends OrderItem,INVOICE>
protected void processContext(O order, Map dataMap)
Date
(If new it will update the order object)order
- context
- protected INVOICE convertStreamToInvoice(Writer writer)
writer
- as Writer
public ExportType getInvoiceType()
InvoiceService
getInvoiceType
in interface InvoiceService<O extends Order<I>,I extends OrderItem,INVOICE>
public void addChangeListener(ChangeListener changeListener)
ChangeGenerator
ChangeListener
s about a changeaddChangeListener
in interface ChangeGenerator<Object>
public void notifyAllListeners(Object object)
ChangeGenerator
notifyAllListeners
in interface ChangeGenerator<Object>
public List getListeners()
ChangeGenerator
getListeners
in interface ChangeGenerator<Object>
public void setListeners(List listeners)
ChangeGenerator
setListeners
in interface ChangeGenerator<Object>
Copyright © 2018. All rights reserved.