wt.workflow.work
Class NotificationRobotProcessor

java.lang.Object
  extended bywt.enterprise.BasicTemplateProcessor
      extended bywt.workflow.work.NotificationRobotProcessor
All Implemented Interfaces:
ContextHolder, ContextTranslator, Evolvable, Externalizable, Serializable, TemplateProcessor

public class NotificationRobotProcessor
extends BasicTemplateProcessor
implements Evolvable

See Also:
Serialized Form

Field Summary
private  WfActivity activity
           
private  String actRefStr
           
private  String body
           
private static String CLASSNAME
           
protected static String CODEBASE
           
private static ResourceBundle dateFormatRB
           
private static String[] dateFormats
           
static long EXTERNALIZATION_VERSION_UID
           
private static String INSTRUCTIONS
           
private static String PRIMARY_BUS_OBJ
           
private  WfProcess process
           
private static ResourceBundle rb
           
private static String RESOURCE
          Resources for localizing message text
protected static String TABLE_ATTRIBUTES
          HTML formatting styles
protected static String TABLE_DATA_ATTRIBUTES
           
protected static String TABLE_DATA_FONT
           
protected static String TABLE_HEAD_ATTRIBUTES
           
protected static String TABLE_HEAD_FONT
           
private static boolean VERBOSE
           
 
Fields inherited from class wt.enterprise.BasicTemplateProcessor
ACTION, ADD_HELP_ICON, ALL_CABINETS, BLANK_SPACE, BREAK_SEPARATOR, BREAK_TAG, CLASS, componentFactory, CONTAINER_NAME, CONTENT_RESOURCE, contextClass, DEFAULT_CHARSET, DEFAULT_HELP_ICON_SELECTOR, DEFAULT_HELP_LABEL, DEFAULT_PREFERENCE_CONTEXT, DOCFROMTEMPLATE, ENABLE_HELP_ICON_PROPERTY_NAME, ENTERPRISE_SEARCH, FEDERATION_SEARCH, GLOBAL_NAVIGATION_ENABLE_HELP_ICON, globalNavBarHelpIconEnabledDefault, HELP_CONTEXT, HELP_ICON_POSITION, HELP_ICON_SELECTOR, HELP_LABEL, HELP_LABEL_RESOURCE, HELP_WINDOW_NAME, helpContext, helpIconEnabled, helpIconEnabledDefault, HOMEPAGE, IDPREFIX, IMPORT, INTEGRATED_SEARCH, isDndMicroAppletEnabled, isDndMicroAppletEnabledInitialized, LABEL_SEPARATOR, LINE_FEED_DELIMITER, linkPrefix, LOCAL_SEARCH, OID, OLD_FORMAT_VERSION_UID, pageContext, PDMLINK_INSTALL_KEY, PERSONAL_CABINET, PREF_WINDOW_NAME, PREFERENCE_CONTEXT, PRESENT_HELP_LABEL, PROJECTLINK_INSTALL_KEY, SEARCH, SHARE_ICON, TEXT_RESOURCE_BUNDLE, URL_RESOURCE, WORKLIST, wtAttribute, WTCORE_IMAGE_DIR
 
Fields inherited from interface wt.templateutil.processor.ContextTranslator
CONTEXT_LIST_IN, CONTEXT_LIST_OUT
 
Fields inherited from interface wt.templateutil.processor.ContextHolder
CONTEXT_ACTION, CONTEXT_CLASS_NAME, CONTEXT_OBJ, CONTEXT_PROPERTIES, FORM_DATA, QUERY_DATA, RESPONSE_EXCEPTIONS, RESPONSE_FOOTERS, RESPONSE_HEADERS, RESPONSE_MESSAGES, RESPONSE_STRING, STATUS
 
Constructor Summary
NotificationRobotProcessor()
          A no argument constructor with no side effects.
NotificationRobotProcessor(Object context)
          Constructs a NotificationRobotProcessor.
NotificationRobotProcessor(Object context, String msgBody)
          Constructs a NotificationRobotProcessor.
 
Method Summary
 void activityDescription(Properties parameters, Locale locale, OutputStream os)
          Print the Activity description
 void activityDescriptionPlain(Properties parameters, Locale locale, OutputStream os)
          Print the Activity description with no HTML editing.
 void activityName(Properties parameters, Locale locale, OutputStream os)
          Print the name of the Activity
 WfActivity getActivity()
          Returns the workflow activity context
 Object getContextObj()
          Returns the processor's object context
 WfProcess getProcess()
          Returns the workflow activity process.
 void getProcessManagerURL(Properties properties, Locale locale, OutputStream os)
          Print the URL of the program manager.
 void getProcessManagerURLPlain(Properties properties, Locale locale, OutputStream os)
          Print the URL of the program manager, stripped of HTML formatting
 HTMLTemplate getTemplate(Vector preferences)
           
 void handleRequest(HTTPRequest req, HTTPResponse resp)
          This method handles HTTP GET requests to produce an HTML page which enables the user to initiate a workflow process based on the previously selected workflow template The format of the HTML output is determined by the InitiateWorkFlow template.
protected  String hideBlanks(String value)
          hideBlanks replaces null values or empty strings with the HTML code for a non-breakable space.
 void messageText(Properties parameters, Locale locale, OutputStream os)
          Print the Message body
 void messageTextPlain(Properties parameters, Locale locale, OutputStream os)
          Print the Message body without doing html formatting.
 void primaryBusinessObjectLink(Properties parameters, Locale locale, OutputStream os)
          Create a link to go to a page to update the content of the workflow process
 void primaryBusinessObjectLinkPlain(Properties parameters, Locale locale, OutputStream os)
          Create a link to go to a page to update the content of the workflow process
 void processDescription(Properties parameters, Locale locale, OutputStream os)
          Print the Proces description
 void processDescriptionPlain(Properties parameters, Locale locale, OutputStream os)
          Print the Proces description without any HTML editing.
 void processName(Properties parameters, Locale locale, OutputStream os)
          Print the name of the Process
 void projectLinkAttributes(Properties properties, Locale locale, OutputStream os)
          If this is a notification from a ProjectLink object, print the ProjectLink attributesInserts event message in notification body.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(NotificationRobotProcessor thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void setActivity(WfActivity activity)
          Set the workflow activity context object
 void setBody(String body)
          Set the body of the message to be delivered
private  String stripHtmlFormat(String urlRef)
          Strip HTML format from string.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class wt.enterprise.BasicTemplateProcessor
AccessOK, addHiddenProperty, addHTMLHelpLink, addToResponseExceptions, addToResponseFooters, addToResponseHeaders, addToResponseMessages, allVersions, bcwti, buildFormProcessorURL, buildFormProcessorURL, comment, createActionsBar, createFederationNavigationBar, createGlobalNavigationBar, createNavigationBar, createParentFolderLink, currentTimestamp, displayAllCabinets, displayAttributeName, displayAttributesTable, displayAttributeValue, displayFolderContents, displayFolderObject, displayFolderTrail, displayGoToLatestLink, displayOrganizationIdentifier, displayPendingChangeIndicator, displayStyleSheetAttributesTable, displayVisualData, formatDate, getActionPairs, getAllCabinetsURL, getBaselineItems, getCharsetEncoding, getCheckedOutFolderURL, getClassIcon, getClassInfo, getContextAction, getContextClass, getContextClassName, getContextListIn, getContextListOut, getContextProperties, getContextServiceName, getDisplayName, getDomainPath, getEnabledVersion, getEncoding, getFederationSearchURL, getFolderLocation, getFolderPath, getFormData, getGenericInstanceIconImgTag, getGlyphImageTag, getGlyphsArray, getGlyphTagsNoDnD, getHelpContext, getHomepageURL, getHTMLComponentFactory, getHTMLHelpLink, getHTMLHelpURL, getHTMLHelpURL, getHTMLTableService, getIconResource, getIconResource, getIconResource, getIconSelector, getId, getJavaScriptManager, getLocalizedDateFormatMessage, getLocalizedMessage, getLocalizedPrintWriter, getLocalizedString, getObjectDnDIcon, getObjectIcon, getObjectIconDnDTag, getObjectIconGlyphs, getObjectIconImgTag, getObjectIconImgTag, getObjectIconImgTag, getObjectIconImgTag, getObjectIconImgTag, getObjectIconImgTag, getObjectPropertyValueString, getObjectPropertyValueString, getPageContext, getParentFolderLink, getPersonalCabinet, getPersonalCabinetURL, getPreferenceValue, getPrincipalEmailLink, getPrincipalEmailLink, getPrintWriter, getPropertyFromPropertyFile, getQuery, getQueryData, getReferenceString, getReferenceString, getResourceString, getResourceString, getResponseExceptions, getResponseFooters, getResponseHeaders, getResponseMessages, getResponseString, getSearchCriteriaURL, getSearchCriteriaURL, getSearchResultsURL, getShareImage, getShareImage, getState, getStatus, getStringFromResourceBundle, getStringFromResourceBundle, getTemplateDisplayGeneral, getTrailId, getTrlIdAttribute, getURLActions, getURLActions, getURLActions, getURLActions, getURLActionsString, getURLActionsString, getURLFactory, getURLFromDelegate, getURLProcessorLink, getURLProcessorLink, getURLProcessorLink, getURLProcessorLinkWithLabel, getUsedByLinks, getWCColor, getWCColor, getWCColorDec, getWCColorDec, getWCFontFamily, getWCFontFamily, getWorklistURL, getWTAttribute, getWTContainerByName, getWTContainerRef, handleExceptionTP, handleExceptionTP, handleProcessorException, hiddenContextString, include, initJavaScriptManager, isDndMicroAppletEnabled, isEqual, listContent, objectActionLink, objectActionLinkAux, objectActionLinkAux, objectActionLinkAux, objectActionLinkAux, objectActionLinkAux, objectActionLinkAux, objectActionLinkAux, objectBackground, objectIdentification, objectIdentifier, objectProperties, objectPropertyName, objectPropertyNameAux, objectPropertyNameAux2, objectPropertyValue, objectPropertyValueAux, objectPropertyValueAux2, objectPropertyValueString, outputLink, outputPropertyFromPropertyFile, parameterValue, partUsedBy, PDMLinkIsInstalled, printQueryTable, printTable, printTextArea, processSubTemplate, readContext, readVersion, setColumnProperties, setContextAction, setContextClass, setContextClassName, setContextListIn, setContextListOut, setContextObj, setContextProperties, setFormData, setHelpContext, setHTMLTableService, setJavaScriptManager, setPageContext, setQueryData, setResponseExceptions, setResponseFooters, setResponseHeaders, setResponseMessages, setResponseString, setState, setStatus, showResponseExceptions, showResponseFooters, showResponseHeaders, showResponseMessage, showResponseMessages, showVersions, sortQueryResult, splitStringIntoTokens, tableService, translateToHtml, useProcessorService, visualizationIsEnabled, writeHiddenContext, writeQueryStringContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

actRefStr

private String actRefStr

activity

private WfActivity activity

process

private WfProcess process

body

private String body

VERBOSE

private static boolean VERBOSE

CODEBASE

protected static String CODEBASE

INSTRUCTIONS

private static final String INSTRUCTIONS
See Also:
Constant Field Values

PRIMARY_BUS_OBJ

private static final String PRIMARY_BUS_OBJ
See Also:
Constant Field Values

TABLE_ATTRIBUTES

protected static final String TABLE_ATTRIBUTES
HTML formatting styles

See Also:
Constant Field Values

TABLE_HEAD_ATTRIBUTES

protected static final String TABLE_HEAD_ATTRIBUTES
See Also:
Constant Field Values

TABLE_HEAD_FONT

protected static final String TABLE_HEAD_FONT
See Also:
Constant Field Values

TABLE_DATA_ATTRIBUTES

protected static final String TABLE_DATA_ATTRIBUTES
See Also:
Constant Field Values

TABLE_DATA_FONT

protected static final String TABLE_DATA_FONT
See Also:
Constant Field Values

RESOURCE

private static final String RESOURCE
Resources for localizing message text

See Also:
Constant Field Values

rb

private static final ResourceBundle rb

dateFormatRB

private static final ResourceBundle dateFormatRB

dateFormats

private static String[] dateFormats
Constructor Detail

NotificationRobotProcessor

public NotificationRobotProcessor()
A no argument constructor with no side effects.


NotificationRobotProcessor

public NotificationRobotProcessor(Object context)
Constructs a NotificationRobotProcessor. The contextual object of the instance is set to the object context.

Parameters:
context - The contextual object of the NotificationRobotProcessor.

NotificationRobotProcessor

public NotificationRobotProcessor(Object context,
                                  String msgBody)
Constructs a NotificationRobotProcessor. The contextual object of the instance is set to the object context.

Parameters:
context - The contextual object of the NotificationRobotProcessor.
Method Detail

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class BasicTemplateProcessor
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(NotificationRobotProcessor thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Supported API: false

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class BasicTemplateProcessor
Parameters:
output -
Throws:
IOException

getTemplate

public HTMLTemplate getTemplate(Vector preferences)
                         throws WTException
Throws:
WTException

handleRequest

public void handleRequest(HTTPRequest req,
                          HTTPResponse resp)
                   throws WTException
This method handles HTTP GET requests to produce an HTML page which enables the user to initiate a workflow process based on the previously selected workflow template The format of the HTML output is determined by the InitiateWorkFlow template.

Specified by:
handleRequest in interface TemplateProcessor
Parameters:
req - HTTPRequest
resp - HTTPResponse
Throws:
WTException

processName

public void processName(Properties parameters,
                        Locale locale,
                        OutputStream os)
                 throws WTException
Print the name of the Process

Parameters:
parameters - The arguments that were passed to the Windchill script call.
locale - The Locale to send to the invoked methods for localization.
os - The output stream.
Throws:
WTException

activityName

public void activityName(Properties parameters,
                         Locale locale,
                         OutputStream os)
                  throws WTException
Print the name of the Activity

Parameters:
parameters - The arguments that were passed to the Windchill script call.
locale - The Locale to send to the invoked methods for localization.
os - The output stream.
Throws:
WTException

activityDescription

public void activityDescription(Properties parameters,
                                Locale locale,
                                OutputStream os)
                         throws WTException
Print the Activity description

Parameters:
parameters - The arguments that were passed to the Windchill script call.
locale - The Locale to send to the invoked methods for localization.
os - The output stream.
Throws:
WTException

activityDescriptionPlain

public void activityDescriptionPlain(Properties parameters,
                                     Locale locale,
                                     OutputStream os)
                              throws WTException
Print the Activity description with no HTML editing.

Parameters:
parameters - The arguments that were passed to the Windchill script call.
locale - The Locale to send to the invoked methods for localization.
os - The output stream.
Throws:
WTException

processDescription

public void processDescription(Properties parameters,
                               Locale locale,
                               OutputStream os)
                        throws WTException
Print the Proces description

Parameters:
parameters - The arguments that were passed to the Windchill script call.
locale - The Locale to send to the invoked methods for localization.
os - The output stream.
Throws:
WTException

processDescriptionPlain

public void processDescriptionPlain(Properties parameters,
                                    Locale locale,
                                    OutputStream os)
                             throws WTException
Print the Proces description without any HTML editing.

Parameters:
parameters - The arguments that were passed to the Windchill script call.
locale - The Locale to send to the invoked methods for localization.
os - The output stream.
Throws:
WTException

messageText

public void messageText(Properties parameters,
                        Locale locale,
                        OutputStream os)
                 throws WTException
Print the Message body

Parameters:
parameters - The arguments that were passed to the Windchill script call.
locale - The Locale to send to the invoked methods for localization.
os - The output stream.
Throws:
WTException

messageTextPlain

public void messageTextPlain(Properties parameters,
                             Locale locale,
                             OutputStream os)
                      throws WTException
Print the Message body without doing html formatting.

Parameters:
parameters - The arguments that were passed to the Windchill script call.
locale - The Locale to send to the invoked methods for localization.
os - The output stream.
Throws:
WTException

primaryBusinessObjectLink

public void primaryBusinessObjectLink(Properties parameters,
                                      Locale locale,
                                      OutputStream os)
Create a link to go to a page to update the content of the workflow process

Parameters:
parameters - The arguments that were passed to the Windchill script call.
locale - The Locale to send to the invoked methods for localization.
os - The output stream.

primaryBusinessObjectLinkPlain

public void primaryBusinessObjectLinkPlain(Properties parameters,
                                           Locale locale,
                                           OutputStream os)
Create a link to go to a page to update the content of the workflow process

Parameters:
parameters - The arguments that were passed to the Windchill script call.
locale - The Locale to send to the invoked methods for localization.
os - The output stream.

getContextObj

public Object getContextObj()
Returns the processor's object context

Specified by:
getContextObj in interface ContextHolder
Overrides:
getContextObj in class BasicTemplateProcessor
Returns:
Object

getActivity

public WfActivity getActivity()
Returns the workflow activity context


getProcess

public WfProcess getProcess()
Returns the workflow activity process.


setActivity

public void setActivity(WfActivity activity)
Set the workflow activity context object

Parameters:
activity - The workflow activity that spawned this request.

setBody

public void setBody(String body)
Set the body of the message to be delivered

Parameters:
body - The message body

getProcessManagerURL

public void getProcessManagerURL(Properties properties,
                                 Locale locale,
                                 OutputStream os)
Print the URL of the program manager.

Parameters:
properties -
locale -
os -

getProcessManagerURLPlain

public void getProcessManagerURLPlain(Properties properties,
                                      Locale locale,
                                      OutputStream os)
Print the URL of the program manager, stripped of HTML formatting

Parameters:
properties -
locale -
os -

projectLinkAttributes

public void projectLinkAttributes(Properties properties,
                                  Locale locale,
                                  OutputStream os)
If this is a notification from a ProjectLink object, print the ProjectLink attributesInserts event message in notification body.

Supported API: false

Parameters:
properties -
locale -
os -

stripHtmlFormat

private String stripHtmlFormat(String urlRef)
Strip HTML format from string. Return pure URL. It does this by returned the last quoted string (limit = 2 quoted strings)

Parameters:
urlRef - - URL string with HTML formatting

hideBlanks

protected String hideBlanks(String value)
hideBlanks replaces null values or empty strings with the HTML code for a non-breakable space. This forces the browser to display table data in the table data format instead of showing the cell in the table background color.

Parameters:
value - The value to be displayed
Returns:
If value is null or an empty string return the html code for a non-breakable space, otherwise return value.