|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tuscany.samples.sdo.otherSources.PurchaseOrderControl
public class PurchaseOrderControl
Provides operational API for purchase order sample for SDO. It is used by
PurchaseOrderCmdLine
for an interactive sample. Often relies upon
methods that are located within the org.apache.tuscany.samples.sdo.otherSources
package.
PurchaseOrderCmdLine
Field Summary | |
---|---|
static int |
SET_DECIMAL_PROPERTY_VIA_SET
|
static int |
SET_DECIMAL_PROPERTY_VIA_SET_DOUBLE
|
static int |
SET_DECIMAL_PROPERTY_VIA_SET_STRING
|
Constructor Summary | |
---|---|
PurchaseOrderControl()
Uses resources files included in jar file to define types (using xsd), and populate DataObjects (xml) |
|
PurchaseOrderControl(java.lang.String xsdFileName,
java.lang.String xmlFileName)
Uses files on the file system to define types (using xsd), and populate DataObjects (xml) |
Method Summary | |
---|---|
void |
addItem(java.lang.String partNumber,
java.lang.String productName,
double price,
int quantity,
java.lang.String comment)
Adds an additional item to the items list of the item property on purchase order DataObject |
void |
appendComment(java.lang.String newComment)
Appends new comment to comment property of purchase order Accesses comment property by name |
commonj.sdo.ChangeSummary |
getChangeSummary()
Currently this does not work |
int |
getDecimalPropertyMethod()
Gets the mechanism used to zip decimal property for the zip code of an address |
commonj.sdo.DataObject |
getDeepCopyPurchaseOrder()
|
commonj.sdo.DataObject |
getPurchaseOrder()
|
commonj.sdo.DataObject |
getShallowCopyPurchaseOrder()
|
commonj.sdo.helper.XMLDocument |
getXMLDocuement()
|
java.lang.String |
getXMLString()
|
void |
modifyBillTo(java.lang.String name,
java.lang.String street,
java.lang.String city,
java.lang.String state,
java.lang.String zip)
Modifies complex address type for billTo. |
void |
modifyShipTo(java.lang.String name,
java.lang.String street,
java.lang.String city,
java.lang.String state,
java.lang.String zip)
Modifies complex address type for shipTo. |
void |
printBillTo()
Prints properties of shipTo |
void |
printChangeSummary()
Prints purchase order summary to System.out |
void |
printPurchaseOrderProperties()
Uses simple sample PrintPropertiesOfDataObject |
void |
printPurchaseOrderSummary()
Accesses key properties via name and prints to System.out |
void |
printShipTo()
Prints properties of billTo |
void |
readPurchaseOrderXml()
Reads in xml and populates DataGraph. |
void |
removeItem(int index)
Removes a particular item from the items list. |
void |
save()
Saves modified purchase order DataObject to original xml used to populate it If resource packaged within jar is used will create a new file on file system |
void |
saveAs(java.lang.String fileName)
Saves modified purchaseOrder DataObject to file |
void |
setComment(java.lang.String comment)
Sets comment property on purchase order by accessing property by name |
void |
setDecimalPropertyMethod(int i)
Sets the mechanism to set decimal property for zip code Decimals can be set in a number of ways. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SET_DECIMAL_PROPERTY_VIA_SET
public static final int SET_DECIMAL_PROPERTY_VIA_SET_STRING
public static final int SET_DECIMAL_PROPERTY_VIA_SET_DOUBLE
Constructor Detail |
---|
public PurchaseOrderControl() throws java.lang.Exception
java.lang.Exception
public PurchaseOrderControl(java.lang.String xsdFileName, java.lang.String xmlFileName) throws java.lang.Exception
xsdFileName
- location of po.xsdxmlFileName
- location of xml to populate DataObject (for example po.xml)
java.lang.Exception
Method Detail |
---|
public void readPurchaseOrderXml() throws java.lang.Exception, java.io.FileNotFoundException
java.lang.Exception
java.io.FileNotFoundException
public void appendComment(java.lang.String newComment)
newComment
- public void setComment(java.lang.String comment)
comment
- public void modifyBillTo(java.lang.String name, java.lang.String street, java.lang.String city, java.lang.String state, java.lang.String zip)
name
- street
- city
- state
- zip
- public void modifyShipTo(java.lang.String name, java.lang.String street, java.lang.String city, java.lang.String state, java.lang.String zip)
name
- street
- city
- state
- zip
- public void addItem(java.lang.String partNumber, java.lang.String productName, double price, int quantity, java.lang.String comment)
partNumber
- productName
- price
- quantity
- comment
- public void removeItem(int index)
index
- public void save() throws java.io.IOException
java.io.IOException
public void saveAs(java.lang.String fileName) throws java.io.IOException
fileName.
- Location to save file to save DataObject to
java.io.IOException
public void printChangeSummary()
public void printPurchaseOrderProperties() throws java.lang.Exception
java.lang.Exception
public void printPurchaseOrderSummary()
public void printBillTo()
public void printShipTo()
public void setDecimalPropertyMethod(int i)
public int getDecimalPropertyMethod()
public commonj.sdo.DataObject getPurchaseOrder()
public commonj.sdo.DataObject getDeepCopyPurchaseOrder()
public commonj.sdo.DataObject getShallowCopyPurchaseOrder()
public commonj.sdo.ChangeSummary getChangeSummary()
public commonj.sdo.helper.XMLDocument getXMLDocuement()
public java.lang.String getXMLString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |