public class RecordOrderHistoryTaskCmdImpl extends TaskCommandImpl implements RecordOrderHistoryTaskCmd
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
The IBM copyright notice field.
|
Constructor and Description |
---|
RecordOrderHistoryTaskCmdImpl() |
Modifier and Type | Method and Description |
---|---|
HistoryOrder | getHistoryOrder()
This method returns the HistoryOrder.
|
OrderHistoryAccessBean | getOrderHistory()
This method returns the OrderHistoryAccessBean.
|
java.lang.Short | getOrderVersion()
This method returns the order version.
|
void | performExecute()
This method executes the business logic of this command implementation.
|
protected XMLRecordable | processExtendableObject()
This method processes the customizable object.
|
void | reset()
This method reset all the fields to reuse this command.
|
void | setCustomizableXMLRecordableObject(XMLRecordable recordable)
This method is used for customizable fields and customized element.
|
void | setLastupdate(java.sql.Timestamp argLastUpdate)
This method sets the LastUpdate to the order history.
|
void | setOrder(OrderAccessBean abOrder)
This method sets an order as a history Order.
|
void | setOrderVersion(java.lang.Short argOrderVersion)
This method sets the order version.
|
public static final java.lang.String COPYRIGHT
public void performExecute() throws ECException
protected XMLRecordable processExtendableObject()
If the user extends this command, s/he can override this method to customize his XMLRecordable object here. Example for refrence: class MyRecordOrderHistoryTaskCmdImpl extends RecordOrderHistoryTaskCmdImpl{ protected XMLRecordable processExtendableObject{ return iCustomizableXMLRecordableObject = new XMLRecordable{ //all the methond need to implements in XMLRecordable here. Refer to exmple documented for setCustomizableXMLRecordableObject }; } } Note: 1.the ojbect this method returns will replace the one set by setCustomizableXMLRecordableObject. 2.Where to get your customizable object? Get HistoryOrder from OrderHistoryDataBean first and then you can get your customizable object by com.ibm.commerce.order.history.HistoryOrder#getOtherRecordablObject()
public void reset()
public void setOrder(OrderAccessBean abOrder)
public void setLastupdate(java.sql.Timestamp argLastUpdate)
public OrderHistoryAccessBean getOrderHistory()
public HistoryOrder getHistoryOrder()
public void setCustomizableXMLRecordableObject(XMLRecordable recordable)
Sample: Assuming there two fields to customize: field1 = "aa", field2 = "bb" and the XML tag to record these fields are field1Element and field2Element respectively. aa bb wherein the '' and '' are defined already in our schema and has been taken care by our code HistoryOrder. Therefore the customize class should only processs the customized element which are of child of '. Here are '' and ''. Steps for refrence only. Step1. Defined a class that implements the specified interface XMLRecordable clase OtherOrderFieldNeedToReacord implements XMLRecordable{ String field1 = ""; String field2 = ""; //See XMLRecordable - toObject(Node xmlNode) public XMLRecordable toObject(Node xmlNode){ toFields(xmlNode); //anything else to do here... } //See XMLRecordable - toFields(Node xmlNode) public XMLRecordable toFields(Node xmlNode){ Node element; element = OrderXMLUtil.getChildElementByName(xmlNode, "field1Element"); if (element != null) { this.field1 = OrderXMLUtil.getElementValue(element); } element = OrderXMLUtil.getChildElementByName(xmlNode, "field2Element"); if (element != null) { this.field2 = OrderXMLUtil.getElementValue(element); } } //See XMLRecordable - toXML() public String toXML(){ return fieldsToXML(); } //See XMLRecordable - fieldsToXML() public String fieldsToXML(){ return ""+getField1()+"" + ""+getField2()+""; } private String getField1(){return "aa";} private String getField2(){return "bb";} } Step2.Instantiate an instance of above customized class OtherOrderFieldNeedToReacord otherOrderFields= new OtherOrderFieldNeedToReacord(); Step3. Call setCustomizableXMLRecordableObject(otherOrderFields) when invoking this cmd - RecordOrderHistoryTaskCmdImpl Note: The ojbect this method set may be overridden one set by processExtendableObject in case you extends this cmd and override that method.
public java.lang.Short getOrderVersion()
public void setOrderVersion(java.lang.Short argOrderVersion)