|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.wm.app.tn.util.TNFixedData
com.wm.app.tn.doc.BizDocType
com.wm.app.tn.doc.XMLDocType
public class XMLDocType
This class keeps associated info about XML business document types. XML bizdocs are documents represented in XML. The doc types use XQL queries to identfy specific forms of XML bizdocs (eg, cXML POs, OAG POs, etc) and XQL queries for extracting both system and custom attributes. It is left up the users creating new XML doc types to make sure the identification queries are fine-grained enough to distinguish the different doc types. In addition, methods are provided for converting XMLDocType objects into IData objects and vice versa. This is useful for peristing it in the database. By using the IDataCodable methods in this way, member variables can easily be added without having the change the data model.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.wm.app.tn.util.TNFixedData |
---|
com.wm.app.tn.util.TNFixedData.TreeCursor |
Constructor Summary | |
---|---|
XMLDocType()
Empty constructor. |
|
XMLDocType(com.wm.data.IData in)
Creates a XMLDocType object |
Method Summary | |
---|---|
java.lang.String |
attributeQueriesToString()
|
java.lang.String |
attributesListToString()
|
java.lang.String |
attributeTransformToString()
|
static boolean |
cacheContainsQuery(java.lang.String qry)
|
static void |
cacheQueryResult(java.lang.String qry,
java.lang.String result)
|
static void |
clearQueryCache()
Internal use only. |
void |
compare(BizDocType oldType,
BizDocType newType,
java.util.Vector<ActivityLogEntry> logs)
|
BizDocType |
copy()
Creates a new XMLDocType and copies the contents of the current XMLDocType object (ie, "this") to the new XMLDocType object. |
static com.wm.data.IData |
create()
create needed for IDataCodable implementation. |
BizDocEnvelope |
createEnvelope(com.wm.data.IData in)
Factory method for creating a new BizDocEnvelope for a document of this type. |
com.wm.data.IData |
createPipeline(BizDocEnvelope bizdoc)
Factory method for creating a pipeline from the given BizDoc. |
static void |
createQueryCache(int size)
Internal use only. |
static com.wm.lang.xql.TreeExpression |
createXqlQuery(java.lang.String query)
|
static com.wm.lang.xql.TreeExpression |
createXqlQuery(java.lang.String query,
java.lang.String[][] nsDecls)
|
java.lang.String |
envelopeQueriesToString()
|
java.lang.String |
getAttributeQuery(java.lang.String id)
|
byte[] |
getContentBytes(BizDocEnvelope bizdoc)
Get content of a bizdoc The content of an XML doc is stored in a content part named, "xmldata". |
java.lang.String |
getContentType(BizDocEnvelope bizdoc)
Determine the content-type of the bizdoc |
java.lang.Object |
getDeliveryContent(BizDocEnvelope bizdoc)
Get delivery content for the given envelope |
java.lang.String |
getDisplayName()
Returns a name that will be displayed on the TN Console. |
java.lang.String |
getDocType()
|
static byte[] |
getDocumentContent(com.wm.lang.xml.Document doc)
|
static byte[] |
getDocumentContent(com.wm.data.IData in)
Used to determine if a pipeline contains an XML document and then turns it into a byte array. |
static java.lang.String |
getDocumentEncoding(com.wm.data.IData in)
|
static com.wm.lang.xml.Document |
getDocumentNode(BizDocEnvelope env)
|
java.lang.String |
getDTD()
|
java.lang.String |
getEditorName()
Returns the name of the editor used to by the TN Console to create and modify instances of a doctype. |
static java.lang.String |
getEncodingFromXML(byte[] data)
Utility method to scan for the encoding in the XML header. |
EnvelopeData |
getEnvelopeData(java.lang.String attr)
|
java.lang.String |
getEnvelopeQuery(java.lang.String attr)
|
java.lang.String |
getFtpFileExtension(BizDocEnvelope bizdoc)
Get file extension for FTP transport |
com.wm.data.IData |
getIData()
IDataCodable implementation. |
java.lang.String[] |
getIdentifyingQueries()
|
java.lang.String[] |
getIdentifyingQueryEvaluations()
|
java.lang.String[][] |
getNamespaceMap()
|
java.lang.String[] |
getQueries()
|
java.lang.String[] |
getQueryEvaluations()
|
static java.lang.String |
getQueryResult(java.lang.String qry)
|
com.wm.lang.ns.NSName |
getRecordBlueprint()
|
java.lang.String[] |
getSignatureQueries()
|
java.util.Enumeration<java.lang.String> |
getSystemAttributeIds()
This method overrides implementation in BizDocType and Enumerates List of System attribut IDs after checking if system attribute is available in Envelope Data. |
com.wm.lang.ns.NSName |
getValidationSchema()
|
boolean |
isType(com.wm.data.IData in)
Abstract method for determining if the IData contains data representing a lower level document type (eg, XML, EDI, etc). |
java.lang.String |
namespaceDeclToString()
|
com.wm.lang.xql.TreeExpression |
newXqlQuery(java.lang.String query)
|
java.lang.String |
pipelineDataToString()
|
java.lang.String |
queriesToString()
|
boolean |
recognize(com.wm.data.IData in)
Determines if the XML document in the pipeline is of this XMLDocType (eg, cXML_Order_Request). |
void |
removeAllAttributes()
Remove all associated attributes including envelope attributes and signature queries. |
static boolean |
s_isType(com.wm.data.IData in)
Searches for "node" in the pipeline and checks to see if it is XML. |
void |
setAttributeQuery(BizDocAttribute attr,
java.lang.String qry)
|
void |
setContentBytes(BizDocEnvelope env,
byte[] data)
Set content of a bizdoc The content of an XML doc is stored in a content part named, "xmldata". |
void |
setContentBytes(BizDocEnvelope env,
byte[] data,
java.lang.String enc)
Set content of a bizdoc. |
void |
setDocType(java.lang.String docType)
Sets the DOCTYPE |
void |
setDTD(java.lang.String dtd)
Sets the DTD |
void |
setEnvelopeData(EnvelopeData envelopeData,
java.lang.String attr)
Sets envelope data for a particular envelope attribute |
void |
setEnvelopeQuery(java.lang.String attr,
boolean required,
java.lang.String qry,
int xFn,
java.lang.String[] args)
Sets a query to determine a particular envelope attribute. |
void |
setEnvelopeQuery(java.lang.String attr,
boolean required,
java.lang.String qry,
int xFn,
java.lang.String[] args,
int preFn,
java.lang.String[] preFnArgs)
Sets a query to determine a particular envelope attribute. |
void |
setEnvelopeQuery(java.lang.String attr,
java.lang.String qry,
int xFn,
java.lang.String[] args)
Sets a query to determine a particular envelope attribute. |
void |
setIData(com.wm.data.IData idata)
Sets the attributes of the class based on a IData object. |
void |
setIdentifyingQueries(java.lang.String[] queries)
Set queries used to identify docs of this type |
void |
setIdentifyingQueries(java.lang.String[] queries,
java.lang.String[] results)
Set queries used to identify docs of this type, and the values to which they must evaluate |
void |
setNamespaceMap(java.lang.String[][] nsDecls)
Sets the namespace equivalency map. |
void |
setRecordBlueprint(com.wm.lang.ns.NSName s)
Set the NSRecord used to turn docs of this type into records |
void |
setSignatureQueries(java.lang.String q_sig,
java.lang.String q_bod)
Sets the queries for signature and signed body |
void |
setValidationSchema(com.wm.lang.ns.NSName s)
Set the NSSchema used to validate docs of this type |
java.lang.String |
toString()
Default toString implementation returns class name followed by contents. |
static java.lang.Object[][] |
XMLDocTypeSchema()
|
Methods inherited from class com.wm.app.tn.util.TNFixedData |
---|
clone, dataSize, get, get, getCursor, getHashCursor, getIndexCursor, getKey, getSharedCursor, getTreeCursor, indexOf, merge, set, set |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public XMLDocType()
public XMLDocType(com.wm.data.IData in)
in
- IData object containing values for each class attribute.Method Detail |
---|
public static java.lang.Object[][] XMLDocTypeSchema()
public static boolean s_isType(com.wm.data.IData in)
in
- pipeline containing keyword and data for XML document
public boolean isType(com.wm.data.IData in)
BizDocType
isType
in class BizDocType
in
- IData object containing keyword and data for particular document type
public static void createQueryCache(int size)
public static void clearQueryCache()
public static boolean cacheContainsQuery(java.lang.String qry)
public static java.lang.String getQueryResult(java.lang.String qry)
public static void cacheQueryResult(java.lang.String qry, java.lang.String result)
public boolean recognize(com.wm.data.IData in) throws BizDocTypeException
recognize
in class BizDocType
in
- pipeline containing keyword and data for XML document
BizDocTypeException
- may be thrown if there is an exception when trying to apply the
queriespublic BizDocEnvelope createEnvelope(com.wm.data.IData in) throws BizDocTypeException
createEnvelope
in class BizDocType
in
- input IData for the document in question
BizDocTypeException
- may be thrownpublic com.wm.data.IData createPipeline(BizDocEnvelope bizdoc) throws BizDocTypeException
createPipeline
in class BizDocType
bizdoc
- input BizDocEnvelope
BizDocTypeException
public BizDocType copy()
copy
in class BizDocType
public byte[] getContentBytes(BizDocEnvelope bizdoc)
getContentBytes
in class BizDocType
bizdoc
- BizDoc to get the contents
public void setContentBytes(BizDocEnvelope env, byte[] data)
setContentBytes
in class BizDocType
bizdoc
- BizDoc to set the contentsdata
- the contentpublic void setContentBytes(BizDocEnvelope env, byte[] data, java.lang.String enc)
bizdoc
- BizDoc to set the contentsdata
- the contentenc
- the encoding, defaults to "UTF8"public java.lang.Object getDeliveryContent(BizDocEnvelope bizdoc) throws java.io.IOException
getDeliveryContent
in class BizDocType
bizdoc
- BizDocEnvelope to get the delivery content from
java.io.IOException
public java.lang.String getFtpFileExtension(BizDocEnvelope bizdoc)
getFtpFileExtension
in class BizDocType
bizdoc
- BizDocEnvelope to get the ftp file extension
public java.lang.String getDisplayName()
BizDocType
getDisplayName
in class BizDocType
public java.lang.String getEditorName()
BizDocType
getEditorName
in class BizDocType
public java.lang.String[] getQueries()
public java.lang.String[] getIdentifyingQueries()
public java.lang.String[] getQueryEvaluations()
public java.lang.String[] getIdentifyingQueryEvaluations()
public java.lang.String getDocType()
public java.lang.String getDTD()
public java.lang.String getEnvelopeQuery(java.lang.String attr)
public EnvelopeData getEnvelopeData(java.lang.String attr)
public void setEnvelopeData(EnvelopeData envelopeData, java.lang.String attr)
public java.lang.String getAttributeQuery(java.lang.String id)
name
- name of the interesting attribute
public java.lang.String getContentType(BizDocEnvelope bizdoc)
getContentType
in class BizDocType
bizdoc
- Envelope to test
public com.wm.lang.ns.NSName getValidationSchema()
public com.wm.lang.ns.NSName getRecordBlueprint()
public java.lang.String[] getSignatureQueries()
public java.lang.String[][] getNamespaceMap()
public void removeAllAttributes()
removeAllAttributes
in class BizDocType
public void setDocType(java.lang.String docType)
docType
- String representing the DOCTYPEpublic void setDTD(java.lang.String dtd)
dtc
- string representing the SYSTEMpublic void setNamespaceMap(java.lang.String[][] nsDecls)
nsDecls
- a set of namespace prefix-to-uri mappings.public void setIdentifyingQueries(java.lang.String[] queries) throws BizDocTypeException
BizDocTypeException
public void setIdentifyingQueries(java.lang.String[] queries, java.lang.String[] results) throws BizDocTypeException
BizDocTypeException
public void setEnvelopeQuery(java.lang.String attr, java.lang.String qry, int xFn, java.lang.String[] args) throws BizDocTypeException
attr
- one of the DocConstants for envelope queriesqry
- defining query for the envelope attributexFn
- number of the transformation function (use BizDocAttributeTransform constants)args
- arguments for the transformation function, if any
BizDocTypeException
public void setEnvelopeQuery(java.lang.String attr, boolean required, java.lang.String qry, int xFn, java.lang.String[] args) throws BizDocTypeException
attr
- one of the DocConstants for envelope queriesrequired
- whether or not this attribute is required for the documentqry
- defining query for the envelope attributexFn
- number of the transformation function (use BizDocAttributeTransform constants)args
- arguments for the transformation function, if any
BizDocTypeException
public void setEnvelopeQuery(java.lang.String attr, boolean required, java.lang.String qry, int xFn, java.lang.String[] args, int preFn, java.lang.String[] preFnArgs) throws BizDocTypeException
attr
- one of the DocConstants for envelope queriesrequired
- whether or not this attribute is required for the documentqry
- defining query for the envelope attributexFn
- number of the transformation function (use BizDocAttributeTransform constants)args
- arguments for the transformation function, if anypreFn
- number of the pre transformation function (use BizDocAttributeTransform constants)preFnArgs
- arguments for the pre transformation function, if any
BizDocTypeException
public void setAttributeQuery(BizDocAttribute attr, java.lang.String qry) throws BizDocTypeException
name
- name of the interesting attributeqry
- query to extract interesting attribute value
BizDocTypeException
public void setValidationSchema(com.wm.lang.ns.NSName s)
public void setRecordBlueprint(com.wm.lang.ns.NSName s)
public void setSignatureQueries(java.lang.String q_sig, java.lang.String q_bod) throws BizDocTypeException
q_sig
- identifies the signature in the document (must be B64-encoded)q_bod
- identifies the signed body in the doc
BizDocTypeException
public com.wm.data.IData getIData()
BizDocType
super.getIData()
.
getIData
in interface com.wm.util.coder.IDataCodable
getIData
in class BizDocType
public static com.wm.data.IData create()
public void setIData(com.wm.data.IData idata)
setIData
in interface com.wm.util.coder.IDataCodable
setIData
in class BizDocType
idata
- IData object containing values for class attributespublic java.util.Enumeration<java.lang.String> getSystemAttributeIds()
getSystemAttributeIds
in class BizDocType
public java.lang.String pipelineDataToString()
public java.lang.String attributesListToString()
public java.lang.String queriesToString()
public java.lang.String envelopeQueriesToString()
public java.lang.String attributeQueriesToString()
public java.lang.String attributeTransformToString()
public java.lang.String namespaceDeclToString()
public java.lang.String toString()
com.wm.app.tn.util.TNFixedData
toString
in class com.wm.app.tn.util.TNFixedData
public void compare(BizDocType oldType, BizDocType newType, java.util.Vector<ActivityLogEntry> logs)
compare
in class BizDocType
logs
- the new logs will be added.priorDocType
- the previous value before update operation takes place.newDocType
- the new value against which previous value will be compared.public com.wm.lang.xql.TreeExpression newXqlQuery(java.lang.String query) throws com.wm.lang.widl.WattException
com.wm.lang.widl.WattException
public static com.wm.lang.xql.TreeExpression createXqlQuery(java.lang.String query) throws com.wm.lang.widl.WattException
com.wm.lang.widl.WattException
public static com.wm.lang.xql.TreeExpression createXqlQuery(java.lang.String query, java.lang.String[][] nsDecls) throws com.wm.lang.widl.WattException
com.wm.lang.widl.WattException
public static byte[] getDocumentContent(com.wm.data.IData in) throws BizDocTypeException
BizDocTypeException
public static java.lang.String getDocumentEncoding(com.wm.data.IData in) throws BizDocTypeException
BizDocTypeException
public static byte[] getDocumentContent(com.wm.lang.xml.Document doc) throws com.wm.lang.widl.WattException
com.wm.lang.widl.WattException
public static com.wm.lang.xml.Document getDocumentNode(BizDocEnvelope env) throws java.io.IOException, com.wm.lang.xml.WMDocumentException
java.io.IOException
com.wm.lang.xml.WMDocumentException
public static java.lang.String getEncodingFromXML(byte[] data)
data
- the XML document content
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |