|
||||||||||
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
public abstract class BizDocType
Abstract class for business document types. Actual doc types used in the recognition engine should subclass this class. The important methods to be overridden include isType(), recognize() and createEnvelope(). Subclasses also need to supply the IDataCodable methods (e.g., setIData() and getIData()) so that subclass specific information can be stored in the database and re-constituted from the database at run-time. The createEnvelope() method is the factory method for creating a BizDocEnvelope and should be the only place where bizdocs are created. The IDataCodable methods can be used for converting subclassed 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 to change the data model. A no-arg constructor should exist for each concrete subclass. This allows the IDataCoder to instantiate objects that were "put" in an IData object without having to "put" the object's IData. ex. put(key, MY_BIZDOC_TYPE_OBJECT) instead of put(key, MY_BIZDOCTYPE_OBJECT.getIData());
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.wm.app.tn.util.TNFixedData |
---|
TNFixedData.TreeCursor |
Method Summary | |
---|---|
void |
addBAMAttribute(java.lang.String key,
com.wm.data.IData value)
Add a monitoring attribute. |
void |
addPipelineMatch(java.lang.String key,
java.lang.String value)
Add a pipeline matching criterion. |
abstract void |
compare(BizDocType priorDocType,
BizDocType newDocType,
java.util.Vector<ActivityLogEntry> logs)
|
abstract BizDocType |
copy()
Abstract method for copying one BizDocType to another. |
static ActivityLogEntry |
createActivityLog(java.lang.String operation,
java.lang.String fieldname,
java.lang.String oldValue,
java.lang.String newValue,
java.lang.String docTypeID)
Return new message entry comprising of full and brief message. |
abstract BizDocEnvelope |
createEnvelope(com.wm.data.IData in)
Factory method for creating new BizDocs of this type. |
abstract com.wm.data.IData |
createPipeline(BizDocEnvelope bizdoc)
Factory method for creating a pipeline from the given BizDoc. |
boolean |
determineSenderFromSession()
Retrieves the setting that indicates whether to use the connected user to determine the sender of the document during recognition. |
BizDocAttribute |
getAttribute(java.lang.String id)
|
java.util.Enumeration |
getAttributeIds()
|
BizDocAttributeTransform |
getAttributeTransform(java.lang.String id)
|
java.lang.String |
getBAMAction()
|
java.util.Vector<java.lang.String> |
getBAMDocTypeDependency()
|
java.lang.String |
getBAMDocTypeMapping()
|
java.lang.String |
getBAMEventMap()
|
java.lang.String |
getBAMEventMapName()
|
com.wm.data.IData |
getBAMMonitoringAttributes()
For internal use only |
abstract byte[] |
getContentBytes(BizDocEnvelope bizdoc)
Abstract method to get content of a bizdoc In general, this is called from the BizDocEnvelope.getContentBytes. |
abstract java.lang.String |
getContentType(BizDocEnvelope bizdoc)
Abstract method for determining the content-type of the bizdoc (eg, text/xml). |
java.lang.Object |
getDeliveryContent(BizDocEnvelope bizdoc)
Get delivery content for the given envelope |
java.lang.String |
getDescription()
|
java.lang.String |
getDisplayName()
Returns a name that will be displayed on the TN Console. |
java.lang.String |
getEditorName()
Returns the name of the editor used to by the TN Console to create and modify instances of a doctype. |
java.io.Reader |
getFormattedContentPart(BizDocEnvelope bizdoc,
java.lang.String partName)
|
java.lang.String |
getFtpFileExtension(BizDocEnvelope bizdoc)
Get file extension for FTP transport |
java.lang.String |
getId()
|
com.wm.data.IData |
getIData()
IDataCodable implementation. |
java.sql.Timestamp |
getLastModifiedTime()
|
java.lang.String |
getName()
|
com.wm.data.IData |
getPipelineMatchIData()
For internal use only |
PreRoutingFlags |
getPreRoutingFlags()
|
com.wm.lang.ns.NSName |
getSigningService()
|
java.lang.String |
getSubDocTypeID()
|
java.util.Enumeration<java.lang.String> |
getSystemAttributeIds()
|
java.lang.String |
getType()
|
com.wm.lang.ns.NSName |
getValidationService()
|
com.wm.lang.ns.NSName |
getVerificationService()
|
java.lang.String |
getVersion()
returns the version number of this document type. |
boolean |
isAttributeListEventOption()
|
boolean |
isAttributeRequired(java.lang.String id)
|
boolean |
isDeleted()
|
boolean |
isFormattedContentPart(BizDocEnvelope bizdoc,
java.lang.String partName)
|
boolean |
isHidden()
|
boolean |
isMonitored()
Retrieves the setting that indicates whether to doctype has been set for BAM monitoring or not. |
boolean |
isRoutable()
|
abstract 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). |
void |
monitor(boolean b)
Indicates whether to use the doctype is set for bam monitoring. |
BizDocEnvelope |
newEnvelope()
Factory method for creating new uninitialized BizDocs of this type. |
boolean |
pipelineMatch(com.wm.data.IData in)
Performs pipeline matching on an IData. |
abstract boolean |
recognize(com.wm.data.IData in)
Abstract method for determining if the data in IData is a particular document type. |
void |
removeAllAttributes()
Remove all associated attributes. |
void |
removeAttribute(BizDocAttribute attr)
Remove a attribute. |
void |
removeBAMAttribute(java.lang.String key)
Remove a BAM Attribute. |
void |
removePipelineMatch(java.lang.String key)
Remove a pipeline match criterion. |
void |
setAttribute(BizDocAttribute attr)
Associates documents of this type with a BizDocAttribute |
void |
setAttribute(BizDocAttribute attr,
boolean required)
Associates documents of this type with a BizDocAttribute |
void |
setAttributeRequirement(java.lang.String id,
boolean required)
Set the requirement for an attribute. |
void |
setAttributeTransform(BizDocAttribute bda,
boolean required,
int fn,
java.lang.String[] args)
|
void |
setAttributeTransform(BizDocAttribute bda,
int fn,
java.lang.String[] args)
Associates documents of this type with a BizDocAttribute, and a transformation function. |
void |
setAttributeTransform(BizDocAttributeTransform bdat)
Associates documents of this type with a BizDocAttributeTransform (this specifies both an attribute and a transformation function to apply to it). |
void |
setBAMAction(java.lang.String action)
Set the BAM Action (for firing the event) |
void |
setBAMDocTypeDependency(java.util.Vector<java.lang.String> bamDocTypeDependency)
Set the docTypes dependent on this doctype for bam monitoring configuration - for BAM Monitoring |
void |
setBAMDocTypeMapping(java.lang.String bamDocTypeMapping)
Set the event option when attribute list is available - for BAM Monitoring |
void |
setBAMEventMap(java.lang.String name)
Set the BAM EventMap type name (should only be called once) |
void |
setBAMEventMapName(java.lang.String name)
Set the Internal BAM EventMap type name (should only be called once) |
void |
setBAMEventOptionForAttrList(java.lang.String eventOption)
Set the event option when attribute list is available - for BAM Monitoring |
void |
setBAMMonitoringAttributes(com.wm.data.IData monitoringAttributes)
For internal use only |
abstract void |
setContentBytes(BizDocEnvelope bizdoc,
byte[] data)
Abstract method to set the content bytes. |
void |
setDeleted(boolean b)
Flag this document as deleted |
void |
setDescription(java.lang.String description)
Set the type description (should only be called once) |
void |
setDetermineSenderFromSession(boolean b)
Indicates whether to use the connected user to determine the sender of the document during recognition. |
void |
setHidden(boolean b)
Flag this document as deleted |
void |
setId(java.lang.String id)
Set the type ID (should only be called once) |
void |
setIData(com.wm.data.IData data)
IDataCodable implementation. |
void |
setLastModifiedTime(java.sql.Timestamp time)
Set the last mod time |
void |
setName(java.lang.String name)
Set the type name (should only be called once) |
void |
setPipelineMatchIData(com.wm.data.IData pipematch)
For internal use only |
void |
setPreRoutingFlags(PreRoutingFlags fl)
Set the pre-routing flags for documents of this type (can be overridden in routing rules) |
void |
setReceiveSvc(com.wm.data.IData in,
BizDocEnvelope bde)
Support for resubmit: extract TN_parms/$receiveSvc from the pipeline "in" and calls BizDocEnvelope.setReceiveSvc(). |
void |
setRouting(boolean b)
Flag this document to route |
void |
setSigningService(com.wm.lang.ns.NSName svc)
Set the signing service for documents of this type |
void |
setSubDocTypeID(java.lang.String subDocId)
Set the sub document type id of the document |
void |
setType(java.lang.String type)
Set the type of the document (EDI/XML/UNKNOWN/FF) |
void |
setValidationService(com.wm.lang.ns.NSName svc)
Set the validation service for documents of this type |
void |
setVerificationService(com.wm.lang.ns.NSName svc)
Set the verification service for documents of this type |
void |
setVersion(java.lang.String version)
Sets version of this document type. |
Methods inherited from class com.wm.app.tn.util.TNFixedData |
---|
clone, dataSize, get, get, getCursor, getHashCursor, getIndexCursor, getKey, getSharedCursor, getTreeCursor, indexOf, merge, set, set, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public java.lang.String getId()
public java.lang.String getName()
public java.lang.String getDescription()
public boolean isDeleted()
public boolean isHidden()
public boolean isRoutable()
public java.sql.Timestamp getLastModifiedTime()
public PreRoutingFlags getPreRoutingFlags()
public boolean isAttributeRequired(java.lang.String id)
public java.lang.String getDisplayName()
public java.lang.String getEditorName()
public java.lang.String getBAMEventMap()
public java.lang.String getBAMAction()
public java.lang.String getBAMEventMapName()
public java.lang.String getSubDocTypeID()
public java.lang.String getBAMDocTypeMapping()
public java.util.Vector<java.lang.String> getBAMDocTypeDependency()
public boolean isAttributeListEventOption()
public java.lang.String getType()
public void setId(java.lang.String id)
public void setName(java.lang.String name)
public void setDescription(java.lang.String description)
public void setDeleted(boolean b)
public void setHidden(boolean b)
public void setRouting(boolean b)
public void setDetermineSenderFromSession(boolean b)
b
- true
means use connected user as the senderpublic boolean determineSenderFromSession()
true
if the connected user will be used to
determine the sender, otherwise false
.public void monitor(boolean b)
b
- true
means doctype is enabled for doctypepublic boolean isMonitored()
true
if the doctype has been set for BAM Monitoring,
otherwise false
.public void setLastModifiedTime(java.sql.Timestamp time)
public void setPreRoutingFlags(PreRoutingFlags fl)
public void setBAMEventMap(java.lang.String name)
public void setBAMAction(java.lang.String action)
public void setBAMEventMapName(java.lang.String name)
public void setSubDocTypeID(java.lang.String subDocId)
public void setBAMEventOptionForAttrList(java.lang.String eventOption)
public void setBAMDocTypeMapping(java.lang.String bamDocTypeMapping)
public void setBAMDocTypeDependency(java.util.Vector<java.lang.String> bamDocTypeDependency)
public void setType(java.lang.String type)
public com.wm.lang.ns.NSName getValidationService()
public com.wm.lang.ns.NSName getVerificationService()
public com.wm.lang.ns.NSName getSigningService()
public void setValidationService(com.wm.lang.ns.NSName svc)
public void setVerificationService(com.wm.lang.ns.NSName svc)
public void setSigningService(com.wm.lang.ns.NSName svc)
public BizDocAttributeTransform getAttributeTransform(java.lang.String id)
public BizDocAttribute getAttribute(java.lang.String id)
public java.util.Enumeration getAttributeIds()
public java.util.Enumeration<java.lang.String> getSystemAttributeIds()
public void setAttribute(BizDocAttribute attr)
attr
- attribute for this BizDocTypepublic void setAttribute(BizDocAttribute attr, boolean required)
attr
- attribute for this BizDocTypepublic void removeAttribute(BizDocAttribute attr)
attr
- attribute to removepublic void removeAllAttributes()
public void setAttributeRequirement(java.lang.String id, boolean required)
id
- ID of the attributerequired
- requirement setting for this attributepublic void setAttributeTransform(BizDocAttribute bda, int fn, java.lang.String[] args)
bda
- BizDocAttribute to associate with the transformationfn
- transformation function number (use constants from
BizDocAttributeTransform)args
- additional arguments for the transformation functionpublic void setAttributeTransform(BizDocAttribute bda, boolean required, int fn, java.lang.String[] args)
public void setAttributeTransform(BizDocAttributeTransform bdat)
bdat
- attribute transform to usepublic abstract java.lang.String getContentType(BizDocEnvelope bizdoc)
bizdoc
- BizDoc to test
public abstract BizDocEnvelope createEnvelope(com.wm.data.IData in) throws BizDocTypeException
in
- input IData for the document in question
BizDocTypeException
public abstract com.wm.data.IData createPipeline(BizDocEnvelope bizdoc) throws BizDocTypeException
bizdoc
- input BizDocEnvelope
BizDocTypeException
public BizDocEnvelope newEnvelope()
public abstract BizDocType copy()
public abstract boolean isType(com.wm.data.IData in)
in
- IData object containing keyword and data for particular document
type
public abstract boolean recognize(com.wm.data.IData in) throws BizDocTypeException
in
- IData object containing keyword and data for particular document
type
BizDocTypeException
public abstract byte[] getContentBytes(BizDocEnvelope bizdoc)
bizdoc
- BizDoc to get the contents
public abstract void setContentBytes(BizDocEnvelope bizdoc, byte[] data)
bizdoc
- BizDoc to set the contentsdata
- the document content byte[]public java.io.Reader getFormattedContentPart(BizDocEnvelope bizdoc, java.lang.String partName)
public boolean isFormattedContentPart(BizDocEnvelope bizdoc, java.lang.String partName)
public void setVersion(java.lang.String version)
version
- is the version number that needs to be set on this document type.
You can get the current TN version from com.wm.app.tn.util.TNBuild.getVersion()public java.lang.String getVersion()
public java.lang.Object getDeliveryContent(BizDocEnvelope bizdoc) throws java.io.IOException
bizdoc
- BizDocEnvelope to get the delivery content from
java.io.IOException
public java.lang.String getFtpFileExtension(BizDocEnvelope bizdoc)
bizdoc
- BizDocEnvelope to get the ftp file extension
public com.wm.data.IData getIData()
super.getIData()
.
getIData
in interface com.wm.util.coder.IDataCodable
public void setIData(com.wm.data.IData data)
super.setIData()
.
setIData
in interface com.wm.util.coder.IDataCodable
data
- a representation of this doc type as an IData objectpublic void addPipelineMatch(java.lang.String key, java.lang.String value)
key
- is the pipeline variable to be matched againstvalue
- is the value of the pipeline variable to match with.
Value can be null. If value is null, then we just check
the existence of the pipeline variablepublic void removePipelineMatch(java.lang.String key)
key
- the key to be removed from pipeline match criterionpublic com.wm.data.IData getPipelineMatchIData()
public void setPipelineMatchIData(com.wm.data.IData pipematch)
public boolean pipelineMatch(com.wm.data.IData in)
in
- the IData on which to match
true
if all criteria match, otherwise false
.public void addBAMAttribute(java.lang.String key, com.wm.data.IData value)
key
- is the attribute variablevalue
- is the value of the IData which explains about the attribute
related particularly to the eventMap.
Value cannot be null. If value is null, then we just don't add the
attribute for monitoringpublic void removeBAMAttribute(java.lang.String key)
key
- the key to be removed from BAM Attributespublic void setBAMMonitoringAttributes(com.wm.data.IData monitoringAttributes)
public com.wm.data.IData getBAMMonitoringAttributes()
public void setReceiveSvc(com.wm.data.IData in, BizDocEnvelope bde)
in
- - an IData objectbizdoc
- - an BizDocEnvelope objectpublic static ActivityLogEntry createActivityLog(java.lang.String operation, java.lang.String fieldname, java.lang.String oldValue, java.lang.String newValue, java.lang.String docTypeID)
operation
- the type of operation performed i.e, insert or updatefieldname
- the name that needs to be displayed in messageoldValue
- the previous value before update operation takes place (It will be null in case of insert operation)newValue
- the new value against which previous value will be compared.
public abstract void compare(BizDocType priorDocType, BizDocType newDocType, java.util.Vector<ActivityLogEntry> logs)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |