wt.lifecycle
Class StateProcessorService

java.lang.Object
  extended bywt.lifecycle.StateProcessorService
All Implemented Interfaces:
ContextHolder, Externalizable, ProcessorService, Serializable
Direct Known Subclasses:
CADDocStateProcessorService

public class StateProcessorService
extends Object
implements ProcessorService, Externalizable

When executed from a class that extends BasicTemplateProcessor, these script call can be invoked by using the 'useProcessorService service = ' html template entry.



Supported API: true

Extendable: false

See Also:
BasicTemplateProcessor, ProcessorService, Serialized Form

Field Summary
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private  HTTPState theState
           
private static String URLCLASSNAME
           
private static String URLMETHODNAME
           
private static boolean VERBOSE
           
 
Fields inherited from interface wt.templateutil.processor.ProcessorService
STATE
 
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
StateProcessorService()
           
 
Method Summary
 void addToResponseExceptions(Exception newException)
          Deprecated.  
 void addToResponseFooters(LocalizableMessage newFooter)
          Deprecated.  
 void addToResponseHeaders(LocalizableMessage newHeader)
          Deprecated.  
 void addToResponseMessages(LocalizableMessage newMessage)
          Deprecated.  
private  String buildURL(Persistable object, String action, String label)
           
 void getAtGateLabel(Properties parameters, Locale locale, OutputStream os)
          If the context object is life cycle managed, return the 'Awaiting Promotion' label (configurable via the life cycle resource bundle).
 String getContextAction()
          Gets the value of the attribute: contextAction; Context Action is the name of the action of the current page

Supported API: true
 String getContextClassName()
          Gets the value of the attribute: contextClassName; Context Object Name is the name of the class of the current page

Supported API: true
 Object getContextObj()
          Gets the value of the attribute: contextObj; Context Object is the reference object of the current page

Supported API: true
 Properties getContextProperties()
          Gets the value of the attribute: contextProperties.
 Properties getFormData()
          Gets the value of the attribute: formData; Form Data is the data present in the form of the current HTML page.
 void getHistoryLink(Properties parameters, Locale locale, OutputStream os)
          If the context object is life cycle managed, return a link to the life cycle history page.
 void getLifeCycleLabel(Properties parameters, Locale locale, OutputStream os)
          If the context object is lifecycle managed, get the 'Life Cycle' label (configurable via the life cycle resource bundle).
 void getObjProp(Properties parameters, Locale locale, OutputStream os)
          Provides the getLifeCycleLabel, getTemplateNameLink, getStatesLink, and getHistoryLink all in one script call.
 void getObjPropBrief(Properties parameters, Locale locale, OutputStream os)
          Provides the getLifeCycleLabel, getTemplateNameLink, getStateLabel and getStateLink all in one script call.
 void getObjPropVerbose(Properties parameters, Locale locale, OutputStream os)
          Provides the getLifeCycleLabel, getTemplateNameLink, getStatesLabel, getAtGateLabel, and isAtGate all in one script call.
private  PrintWriter getPrintWriter(OutputStream out, Locale locale)
           
 Properties getQueryData()
          Gets the value of the attribute: queryData; Query Data is the information present after the "?" mark on the URL of the current page.
 Vector getResponseExceptions()
          Gets the value of the attribute: responseExceptions.
 Vector getResponseFooters()
          Gets the value of the attribute: responseFooters.
 Vector getResponseHeaders()
          Gets the value of the attribute: responseHeaders.
 Vector getResponseMessages()
          Gets the value of the attribute: responseMessages.
 String getResponseString()
          Gets the value of the attribute: responseString.
 HTTPState getState()
          Gets the object for the association that plays role: theState.
 void getState(Properties parameters, Locale locale, OutputStream os)
          If the context object is lifecycle managed, return the state of the LifeCycle Managed object.
 void getStateLabel(Properties parameters, Locale locale, OutputStream os)
          If the context object is lifecycle managed, return the 'State:' label (configurable in the life cycle resource bundle).
 void getStateLink(Properties parameters, Locale locale, OutputStream os)
          If the context object is lifecycle managed, return the state of the LifeCycle Managed object as a hyperlink to the ProcessManager.
 void getStates(Properties parameters, Locale locale, OutputStream os)
          If the context object is lifecycle managed, return the states of the LifeCycle Managed object.
 void getStatesLabel(Properties parameters, Locale locale, OutputStream os)
          If the context object is lifecycle managed, return the 'States:" label (configurable in the life cycle resource bundle)

Supported API: true
 void getStatesLink(Properties parameters, Locale locale, OutputStream os)
          If the context object is lifecycle managed, return the states of the LifeCycle Managed object.
 int getStatus()
          Gets the value of the attribute: status.
 void getTemplateName(Properties parameters, Locale locale, OutputStream os)
          If the object is life cycle managed, return the name of the life cycle template.
 void getTemplateNameLink(Properties parameters, Locale locale, OutputStream os)
          If the context object is life cycle managed, return the name of the life cycle template as a hyperlink to viewing the life cycle.
 void isAtGate(Properties parameters, Locale locale, OutputStream os)
          If the context object is life cycle managed, return the 'isAtGate' value in a yes/no format (configurable via the life cycle resource bundle).
 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(StateProcessorService thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void setContextAction(String a_ContextAction)
          Sets the value of the attribute: contextAction; Context Action is the name of the action of the current page

Supported API: true
 void setContextClassName(String a_ContextClassName)
          Sets the value of the attribute: contextClassName; Context Object Name is the name of the class of the current page

Supported API: true
 void setContextObj(Object a_ContextObj)
          Sets the value of the attribute: contextObj; Context Object is the reference object of the current page

Supported API: true
 void setContextProperties(Properties a_ContextProperties)
          Sets the value of the attribute: contextProperties.
 void setFormData(Properties a_FormData)
          Sets the value of the attribute: formData; Form Data is the data present in the form of the current HTML page.
 void setQueryData(Properties a_QueryData)
          Sets the value of the attribute: queryData; Query Data is the information present after the "?" mark on the URL of the current page.
 void setResponseExceptions(Vector a_ResponseExceptions)
          Sets the value of the attribute: responseExceptions.
 void setResponseFooters(Vector a_ResponseFooters)
          Sets the value of the attribute: responseFooters.
 void setResponseHeaders(Vector a_ResponseHeaders)
          Sets the value of the attribute: responseHeaders.
 void setResponseMessages(Vector a_ResponseMessages)
          Sets the value of the attribute: responseMessages.
 void setResponseString(String a_ResponseString)
          Sets the value of the attribute: responseString.
 void setState(HTTPState a_State)
          Sets the object for the association that plays role: theState.
 void setStatus(int a_Status)
          Sets the value of the attribute: status.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

theState

private HTTPState theState

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

URLCLASSNAME

private static String URLCLASSNAME

URLMETHODNAME

private static String URLMETHODNAME

VERBOSE

private static final boolean VERBOSE
Constructor Detail

StateProcessorService

public StateProcessorService()
Method Detail

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
Parameters:
output -
Throws:
IOException

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
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(StateProcessorService 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.

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

getStateLabel

public void getStateLabel(Properties parameters,
                          Locale locale,
                          OutputStream os)
If the context object is lifecycle managed, return the 'State:' label (configurable in the life cycle resource bundle).

Supported API: true

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

getState

public void getState(Properties parameters,
                     Locale locale,
                     OutputStream os)
If the context object is lifecycle managed, return the state of the LifeCycle Managed object.

Supported API: true

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

getStateLink

public void getStateLink(Properties parameters,
                         Locale locale,
                         OutputStream os)
If the context object is lifecycle managed, return the state of the LifeCycle Managed object as a hyperlink to the ProcessManager. If the context action is 'ProcessManager', the equivalent of the 'getState' will be returned. If the object is in the phase and there is is a workflow associated with the phase, the link will reference that workflow. If the object is at the gate and there is a workflow associated with the gate, the link will reference that workflow. If there is no associated workflow, the equivalent of the 'getState' will be returned.

Supported API: true

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

getStatesLabel

public void getStatesLabel(Properties parameters,
                           Locale locale,
                           OutputStream os)
If the context object is lifecycle managed, return the 'States:" label (configurable in the life cycle resource bundle)

Supported API: true

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

getStates

public void getStates(Properties parameters,
                      Locale locale,
                      OutputStream os)
If the context object is lifecycle managed, return the states of the LifeCycle Managed object. The current state is highlighted (configurable in the life cycle resource bundle). The seperator between the states is configurable via the life cycle resource bundle. If the object is in a dropped state, that state will be appended to the end of the string.

Supported API: true

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

getStatesLink

public void getStatesLink(Properties parameters,
                          Locale locale,
                          OutputStream os)
If the context object is lifecycle managed, return the states of the LifeCycle Managed object. The current state is shown as a hyperlink to the ProcessManager. If the context action is 'ProcessManager', the equivalent of 'getStates' will be returned. If the object is in the phase and there is is a workflow associated with the phase, the link will reference that workflow. If the object is at the gate and there is a workflow associated with the gate, the link will reference that workflow. If there is no associated workflow, the equivalent of the 'getStates' will be returned.

Supported API: true

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

getLifeCycleLabel

public void getLifeCycleLabel(Properties parameters,
                              Locale locale,
                              OutputStream os)
If the context object is lifecycle managed, get the 'Life Cycle' label (configurable via the life cycle resource bundle).

Supported API: true

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

getTemplateName

public void getTemplateName(Properties parameters,
                            Locale locale,
                            OutputStream os)
If the object is life cycle managed, return the name of the life cycle template.

Supported API: true

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

getTemplateNameLink

public void getTemplateNameLink(Properties parameters,
                                Locale locale,
                                OutputStream os)
If the context object is life cycle managed, return the name of the life cycle template as a hyperlink to viewing the life cycle.

Supported API: true

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

getAtGateLabel

public void getAtGateLabel(Properties parameters,
                           Locale locale,
                           OutputStream os)
If the context object is life cycle managed, return the 'Awaiting Promotion' label (configurable via the life cycle resource bundle).

Supported API: true

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

isAtGate

public void isAtGate(Properties parameters,
                     Locale locale,
                     OutputStream os)
If the context object is life cycle managed, return the 'isAtGate' value in a yes/no format (configurable via the life cycle resource bundle).

Supported API: true

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

getHistoryLink

public void getHistoryLink(Properties parameters,
                           Locale locale,
                           OutputStream os)
If the context object is life cycle managed, return a link to the life cycle history page. The name of the link is configurable via the life cycle resource bundle. If the context action is 'lchistory' return nothing. This is done to eliminate the display of a link to the same page the user is currently on.

Supported API: true

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

getObjPropBrief

public void getObjPropBrief(Properties parameters,
                            Locale locale,
                            OutputStream os)
Provides the getLifeCycleLabel, getTemplateNameLink, getStateLabel and getStateLink all in one script call.

Supported API: true

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

getObjProp

public void getObjProp(Properties parameters,
                       Locale locale,
                       OutputStream os)
Provides the getLifeCycleLabel, getTemplateNameLink, getStatesLink, and getHistoryLink all in one script call.

Supported API: true

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

getObjPropVerbose

public void getObjPropVerbose(Properties parameters,
                              Locale locale,
                              OutputStream os)
Provides the getLifeCycleLabel, getTemplateNameLink, getStatesLabel, getAtGateLabel, and isAtGate all in one script call.

Supported API: true

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

getState

public HTTPState getState()
Gets the object for the association that plays role: theState.

Supported API: true

Specified by:
getState in interface ProcessorService
Returns:
HTTPState

setState

public void setState(HTTPState a_State)
Sets the object for the association that plays role: theState.

Supported API: true

Specified by:
setState in interface ProcessorService
Parameters:
a_State -

getContextAction

public String getContextAction()
Gets the value of the attribute: contextAction; Context Action is the name of the action of the current page

Supported API: true

Specified by:
getContextAction in interface ContextHolder
Returns:
String

setContextAction

public void setContextAction(String a_ContextAction)
Sets the value of the attribute: contextAction; Context Action is the name of the action of the current page

Supported API: true

Specified by:
setContextAction in interface ContextHolder
Parameters:
a_ContextAction -

getContextObj

public Object getContextObj()
Gets the value of the attribute: contextObj; Context Object is the reference object of the current page

Supported API: true

Specified by:
getContextObj in interface ContextHolder
Returns:
Object

setContextObj

public void setContextObj(Object a_ContextObj)
Sets the value of the attribute: contextObj; Context Object is the reference object of the current page

Supported API: true

Specified by:
setContextObj in interface ContextHolder
Parameters:
a_ContextObj -

getContextClassName

public String getContextClassName()
Gets the value of the attribute: contextClassName; Context Object Name is the name of the class of the current page

Supported API: true

Specified by:
getContextClassName in interface ContextHolder
Returns:
String

setContextClassName

public void setContextClassName(String a_ContextClassName)
Sets the value of the attribute: contextClassName; Context Object Name is the name of the class of the current page

Supported API: true

Specified by:
setContextClassName in interface ContextHolder
Parameters:
a_ContextClassName -

getContextProperties

public Properties getContextProperties()
Gets the value of the attribute: contextProperties.

Supported API: true

Specified by:
getContextProperties in interface ContextHolder
Returns:
Properties

setContextProperties

public void setContextProperties(Properties a_ContextProperties)
Sets the value of the attribute: contextProperties.

Supported API: true

Specified by:
setContextProperties in interface ContextHolder
Parameters:
a_ContextProperties -

getResponseExceptions

public Vector getResponseExceptions()
Gets the value of the attribute: responseExceptions.

Supported API: true

Specified by:
getResponseExceptions in interface ContextHolder
Returns:
Vector

setResponseExceptions

public void setResponseExceptions(Vector a_ResponseExceptions)
Sets the value of the attribute: responseExceptions.

Supported API: true

Specified by:
setResponseExceptions in interface ContextHolder
Parameters:
a_ResponseExceptions -

getResponseFooters

public Vector getResponseFooters()
Gets the value of the attribute: responseFooters.

Supported API: true

Specified by:
getResponseFooters in interface ContextHolder
Returns:
Vector

setResponseFooters

public void setResponseFooters(Vector a_ResponseFooters)
Sets the value of the attribute: responseFooters.

Supported API: true

Specified by:
setResponseFooters in interface ContextHolder
Parameters:
a_ResponseFooters -

getResponseHeaders

public Vector getResponseHeaders()
Gets the value of the attribute: responseHeaders.

Supported API: true

Specified by:
getResponseHeaders in interface ContextHolder
Returns:
Vector

setResponseHeaders

public void setResponseHeaders(Vector a_ResponseHeaders)
Sets the value of the attribute: responseHeaders.

Supported API: true

Specified by:
setResponseHeaders in interface ContextHolder
Parameters:
a_ResponseHeaders -

getResponseMessages

public Vector getResponseMessages()
Gets the value of the attribute: responseMessages.

Supported API: true

Specified by:
getResponseMessages in interface ContextHolder
Returns:
Vector

setResponseMessages

public void setResponseMessages(Vector a_ResponseMessages)
Sets the value of the attribute: responseMessages.

Supported API: true

Specified by:
setResponseMessages in interface ContextHolder
Parameters:
a_ResponseMessages -

getResponseString

public String getResponseString()
Gets the value of the attribute: responseString.

Supported API: true

Specified by:
getResponseString in interface ContextHolder
Returns:
String

setResponseString

public void setResponseString(String a_ResponseString)
Sets the value of the attribute: responseString.

Supported API: true

Specified by:
setResponseString in interface ContextHolder
Parameters:
a_ResponseString -

getStatus

public int getStatus()
Gets the value of the attribute: status.

Supported API: true

Specified by:
getStatus in interface ContextHolder
Returns:
int

setStatus

public void setStatus(int a_Status)
Sets the value of the attribute: status.

Supported API: true

Specified by:
setStatus in interface ContextHolder
Parameters:
a_Status -

getFormData

public Properties getFormData()
Gets the value of the attribute: formData; Form Data is the data present in the form of the current HTML page.

Supported API: true

Specified by:
getFormData in interface ContextHolder
Returns:
Properties

setFormData

public void setFormData(Properties a_FormData)
Sets the value of the attribute: formData; Form Data is the data present in the form of the current HTML page.

Supported API: true

Specified by:
setFormData in interface ContextHolder
Parameters:
a_FormData -

getQueryData

public Properties getQueryData()
Gets the value of the attribute: queryData; Query Data is the information present after the "?" mark on the URL of the current page.

Supported API: true

Specified by:
getQueryData in interface ContextHolder
Returns:
Properties

setQueryData

public void setQueryData(Properties a_QueryData)
Sets the value of the attribute: queryData; Query Data is the information present after the "?" mark on the URL of the current page.

Supported API: true

Specified by:
setQueryData in interface ContextHolder
Parameters:
a_QueryData -

addToResponseExceptions

public void addToResponseExceptions(Exception newException)
Deprecated.  

Adds a LocalizableMessage message to the list of stackTraces that can be presented with the Windchill Script call

showResponseExceptions

Supported API: true

Specified by:
addToResponseExceptions in interface ContextHolder
Parameters:
newException -

addToResponseMessages

public void addToResponseMessages(LocalizableMessage newMessage)
Deprecated.  

Adds a LocalizableMessage message to the list of localizable messages that can be presented with the Windchill Script call

showResponseMessages

Supported API: true

Specified by:
addToResponseMessages in interface ContextHolder
Parameters:
newMessage -

addToResponseHeaders

public void addToResponseHeaders(LocalizableMessage newHeader)
Deprecated.  

Adds a LocalizableMessage message to the list of localizable messages that can be presented with the Windchill Script call

showResponseHeaders

Supported API: true

Specified by:
addToResponseHeaders in interface ContextHolder
Parameters:
newHeader -

addToResponseFooters

public void addToResponseFooters(LocalizableMessage newFooter)
Deprecated.  

Adds a LocalizableMessage message to the list of localizable messages that can be presented with the Windchill Script call

showResponseFooters

Supported API: true

Specified by:
addToResponseFooters in interface ContextHolder
Parameters:
newFooter -

buildURL

private String buildURL(Persistable object,
                        String action,
                        String label)

getPrintWriter

private PrintWriter getPrintWriter(OutputStream out,
                                   Locale locale)