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
ChangeListeners 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
AsynchronousChangeListenerorder - invoice - Exception@Transactional(readOnly=false) public INVOICE generateInvoice(O order)
InvoiceServicegenerateInvoice 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 Writerpublic ExportType getInvoiceType()
InvoiceServicegetInvoiceType in interface InvoiceService<O extends Order<I>,I extends OrderItem,INVOICE>public void addChangeListener(ChangeListener changeListener)
ChangeGeneratorChangeListeners about a changeaddChangeListener in interface ChangeGenerator<Object>public void notifyAllListeners(Object object)
ChangeGeneratornotifyAllListeners in interface ChangeGenerator<Object>public List getListeners()
ChangeGeneratorgetListeners in interface ChangeGenerator<Object>public void setListeners(List listeners)
ChangeGeneratorsetListeners in interface ChangeGenerator<Object>Copyright © 2018. All rights reserved.