|
© 2002 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--examples.e2e.common.BuyerFactory
This class provides various methods for obtaining, deleting and parsing XML and data files for the portal application.
Field Summary | |
static java.lang.String |
DATA_LOCATION_PROPERTY
The value of this system property is used to determine the location of XML files containing application data. |
static java.lang.String |
PO_ACK_DATA_FILE
The name of the file produced by the workflow engine containing acknowledged purchase order data. |
static java.lang.String |
PO_ACK_FILE
The name of the file produced by the workflow engine containing an acknowledged purchase order. |
static java.lang.String |
PO_DATA_FILE
The name of the file produced by the workflow engine containing purchase order data. |
static java.lang.String |
PO_FILE
The name of the file produced by the workflow engine containing a purchase order. |
static java.lang.String |
QUOTE_FILE
The name of the file produced by the workflow engine containing a collection of quotes in response to a query for price and availability ( QPA ). |
static java.lang.String |
STATIC_PO_BASE_NAME
The base file name for XML documents containing static purchase orders. |
static java.lang.String |
XML_SUFFIX
The value of this constant is ".xml". |
static java.lang.String |
xmlDateFormatString
Used to format and parse date strings in XML documents. |
Method Summary | |
static QPA |
createQPA(java.lang.String productId,
java.lang.String requestId,
java.lang.String description,
Money desiredUnitPrice,
long desiredQty,
java.util.Calendar creationDate,
java.util.Calendar desiredDate)
Returns a object populated from the method parameters. |
static void |
deletePoXML()
This method deletes the purchase order XML and data files for the application. |
static void |
deleteXML()
This method deletes the XML and data files for the application. |
static boolean |
doesPOAckXMLExist()
Returns true if the PO_ACK_FILE exists and is a file (not a directory). |
static boolean |
doesQuoteXMLExist()
Returns true if the QUOTE_FILE exists and is a file (not a directory). |
static java.lang.String |
getDataLocation()
Returns the path to the data directory. |
static org.xml.sax.InputSource |
getPOSource()
Obtains an org.xml.sax.InputSource based on the following
rules:
If the PO_ACK_FILE exists its InputSource is returned. |
static org.xml.sax.InputSource |
getQuoteSource()
Obtains an org.xml.sax.InputSource corresponding
to the QUOTE_FILE. |
static org.xml.sax.InputSource |
getSource(java.lang.ClassLoader classloader,
java.lang.String name)
Obtains the InputSource corresponding to the specified
file name. |
static java.util.List |
getStaticPOSources()
Returns a List of InputSource objects
for the static purchase order source files present in the data directory. |
static PO |
parsePO(org.xml.sax.InputSource source)
Returns a List of objects
populated from the data supplied in the XML document. |
static java.util.List |
parsePOs(java.util.List srcs)
Returns a List of objects
populated from the data supplied in the XML document. |
static java.util.List |
parseQuote(org.xml.sax.InputSource source)
Returns a List of PurchaseQuote objects
populated from the data supplied in the XML document specified as
an org.xml.sax.InputSource . |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String xmlDateFormatString
public static final java.lang.String STATIC_PO_BASE_NAME
DATA_LOCATION_PROPERTY
,
getStaticPOSources()
public static final java.lang.String QUOTE_FILE
QPA
).
The file is located using the value of the system property
defined by the constant DATA_LOCATION_PROPERTY as a path.
The value of this constant is "E2E_AggregatedQPAResponse.xml".DATA_LOCATION_PROPERTY
public static final java.lang.String PO_FILE
DATA_LOCATION_PROPERTY
public static final java.lang.String PO_DATA_FILE
DATA_LOCATION_PROPERTY
public static final java.lang.String PO_ACK_FILE
DATA_LOCATION_PROPERTY
public static final java.lang.String PO_ACK_DATA_FILE
DATA_LOCATION_PROPERTY
public static final java.lang.String XML_SUFFIX
public static final java.lang.String DATA_LOCATION_PROPERTY
STATIC_PO_BASE_NAME
,
QUOTE_FILE
,
PO_FILE
,
PO_ACK_FILE
,
getQuoteSource()
,
getPOSource()
,
getStaticPOSources()
Method Detail |
public static QPA createQPA(java.lang.String productId, java.lang.String requestId, java.lang.String description, Money desiredUnitPrice, long desiredQty, java.util.Calendar creationDate, java.util.Calendar desiredDate)
QPA
object populated from the method parameters.
productId
- the identifier for the product to be quoted.requestId
- the unique identifier for this QPA request.description
- the product description.desiredUnitPrice
- the price the buyer would like to pay for the product.desiredQty
- the quantity of product the buyer would like quoted.creationDate
- the creation date for this QPA.desiredDate
- the date the purchaser desires to receive the product.QPA
object.QPA
public static java.util.List parseQuote(org.xml.sax.InputSource source) throws ParsingException
List
of PurchaseQuote
objects
populated from the data supplied in the XML document specified as
an org.xml.sax.InputSource
.
source
- org.xml.sax.InputSource
XML to be parsed.List
of PurchaseQuote
objects.PurchaseQuote
public static PO parsePO(org.xml.sax.InputSource source) throws ParsingException
List
of PO
objects
populated from the data supplied in the XML document.
source
- xml InputSource
to use to
create PurchaseQuote
s.public static java.util.List parsePOs(java.util.List srcs) throws ParsingException
List
of PO
objects
populated from the data supplied in the XML document.
srcs
- xml InputSource
to use to create PurchaseQuote
s.public static org.xml.sax.InputSource getQuoteSource()
org.xml.sax.InputSource
corresponding
to the QUOTE_FILE.
InputSource
or null if the file does not exist.QUOTE_FILE
public static org.xml.sax.InputSource getPOSource()
org.xml.sax.InputSource
based on the following
rules:
If the PO_ACK_FILE exists its InputSource
is returned.
If the PO_ACK_FILE does not exist but PO_FILE does exist, an
InputSource
corresponding to PO_FILE will be returned.
Null will be returned otherwise
InputSource
or null if the files does not exist.PO_FILE
,
PO_ACK_FILE
public static java.util.List getStaticPOSources()
List
of InputSource
objects
for the static purchase order source files present in the data directory.
Static purchase order source files are of the form:
STATIC_PO_BASE_NAME<n>XML_SUFFIX
where n
is a positive integer.
When searching for files, this method sets n
to zero and
attempts to find the first file. If finding the file is succesful
n
is incremented and the method tries to find the next file.
The method quits when a file cannot be found.
List
of InputSource
s will be
returned, one for each static source present. If no static source
files exist than null will be returned.STATIC_PO_BASE_NAME
,
XML_SUFFIX
public static org.xml.sax.InputSource getSource(java.lang.ClassLoader classloader, java.lang.String name)
InputSource
corresponding to the specified
file name. The specified classloader and its classpath are used
when attempting to locate the file.
classloader
- a classloader to use to locate the filename
- the name of the file to locateInputSource
or null if
the classloader was unable to locate the file.public static void deleteXML() throws java.lang.NullPointerException, java.lang.SecurityException, java.lang.RuntimeException
QUOTE_FILE
,
PO_FILE
,
PO_DATA_FILE
,
PO_ACK_FILE
,
PO_ACK_DATA_FILE
public static void deletePoXML() throws java.lang.NullPointerException, java.lang.SecurityException, java.lang.RuntimeException
PO_FILE
,
PO_DATA_FILE
,
PO_ACK_FILE
,
PO_ACK_DATA_FILE
public static boolean doesQuoteXMLExist()
QUOTE_FILE
public static boolean doesPOAckXMLExist()
PO_ACK_FILE
public static java.lang.String getDataLocation() throws java.lang.NullPointerException, java.lang.SecurityException, java.lang.RuntimeException
DATA_LOCATION_PROPERTY
|
© 2002 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |