|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectwt.enterprise.BasicTemplateProcessor
public abstract class BasicTemplateProcessor
Deprecation Notice: This class is still valid for this release, however
this serves as advance notice that it will be removed in the future.
All user interfaces built using the Windchill HTML Template Processing
client architecture will be rewritten using a different framework in
an upcoming release.
This abstract class implements several methods useful for template processing.
It is suggested that most new template processors should extend DefaultTemplateProcessor.
Supported API: true
Extendable: false
| Field Summary |
|---|
| 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 |
| Method Summary | |
|---|---|
void |
addHTMLHelpLink(Properties parameters,
Locale locale,
OutputStream os)
Deprecated. |
void |
addToResponseExceptions(Exception newException)
Deprecated. |
void |
addToResponseFooters(LocalizableMessage newFooter)
Deprecated. |
void |
addToResponseHeaders(LocalizableMessage newHeader)
Deprecated. |
void |
addToResponseMessages(LocalizableMessage newMessage)
Deprecated. |
void |
createActionsBar(Properties parameters,
Locale locale,
OutputStream os)
Deprecated. Write a list of links to actions corresponding to the context object to the given OutputStream. |
void |
createGlobalNavigationBar(Properties parameters,
Locale locale,
OutputStream os)
Deprecated. Output a table of links to global actions. |
void |
createNavigationBar(Properties parameters,
Locale locale,
OutputStream os)
Deprecated. Outputs HTML Navigation Bar specific for object. |
void |
currentTimestamp(Properties parameters,
Locale locale,
OutputStream os)
Deprecated. Outputs HTML that describes the current date and time. |
String |
getContextAction()
Deprecated. |
String |
getContextClassName()
Deprecated. |
String[] |
getContextListIn()
Deprecated. |
String[] |
getContextListOut()
Deprecated. |
Object |
getContextObj()
Deprecated. |
Properties |
getContextProperties()
Deprecated. |
String |
getEncoding(OutputStream out,
Locale locale)
Deprecated. Get character encoding that should be used with the template processing output stream. |
Properties |
getFormData()
Deprecated. |
void |
getHTMLHelpURL(Properties parameters,
Locale locale,
OutputStream os)
Deprecated. |
TemplateProcessorTableService |
getHTMLTableService()
Deprecated. |
static PrintWriter |
getLocalizedPrintWriter(OutputStream out,
Locale locale)
Deprecated. Get a PrintWriter for the given output stream and locale. |
void |
getObjectIcon(Properties parameters,
Locale locale,
OutputStream os)
Deprecated. Outputs the icon associated with the context object to the given OutputStream. |
PrintWriter |
getPrintWriter(OutputStream out,
Locale locale)
Deprecated. Get a PrintWriter for the given output stream and locale. |
Properties |
getQueryData()
Deprecated. |
void |
getResourceString(Properties parameters,
Locale locale,
OutputStream os)
Deprecated. |
Vector |
getResponseExceptions()
Deprecated. |
Vector |
getResponseFooters()
Deprecated. |
Vector |
getResponseHeaders()
Deprecated. |
Vector |
getResponseMessages()
Deprecated. |
String |
getResponseString()
Deprecated. |
int |
getStatus()
Deprecated. |
void |
getURLProcessorLink(Properties parameters,
Locale locale,
OutputStream os)
Deprecated. |
void |
getWCColor(Properties parameters,
Locale locale,
OutputStream os)
Deprecated. Retrieves the value of a HTML color property from wt.properties and writes it to the HTML page. |
static String |
getWCColor(String styleClass)
Deprecated. Retrieves the value of a HTML color property from wt.properties |
void |
getWCColorDec(Properties parameters,
Locale locale,
OutputStream os)
Deprecated. Retrieves the value of a HTML color property from wt.properties and writes it to the HTML page as a decimal integer. |
static String |
getWCFontFamily()
Deprecated. Retrieves the list of preferred HTML font faces from wt.properties |
void |
getWCFontFamily(Properties parameters,
Locale locale,
OutputStream os)
Deprecated. Retrieves the list of preferred HTML font faces from wt.properties. |
void |
objectActionLink(Properties parameters,
Locale locale,
OutputStream os)
Deprecated. Outputs an HTML HREF with a URL to the wt.enterprise.URLProcessor class and its URLTemplateAction method. |
void |
objectBackground(Properties parameters,
Locale locale,
OutputStream os)
Deprecated. Outputs HTML to set the background of the page to a supplied image. |
void |
objectIdentification(Properties parameters,
Locale locale,
OutputStream os)
Deprecated. Produces HTML which represents identification information for the contextual object of a BasicTemplateProcessor. |
void |
objectPropertyName(Properties parameters,
Locale locale,
OutputStream os)
Deprecated. Outputs HTML which represents the display name of a property. |
void |
objectPropertyValue(Properties parameters,
Locale locale,
OutputStream os)
Deprecated. Outputs HTML which represents the value of a property. |
void |
processSubTemplate(Properties parameters,
Locale locale,
OutputStream os)
Deprecated. |
void |
setContextAction(String a_ContextAction)
Deprecated. |
void |
setContextClassName(String a_ContextClassName)
Deprecated. |
void |
setContextListIn(String[] a_ContextListIn)
Deprecated. |
void |
setContextListOut(String[] a_ContextListOut)
Deprecated. |
void |
setContextObj(Object a_ContextObj)
Deprecated. |
void |
setContextProperties(Properties a_ContextProperties)
Deprecated. |
void |
setFormData(Properties a_FormData)
Deprecated. |
void |
setQueryData(Properties a_QueryData)
Deprecated. |
void |
setResponseExceptions(Vector a_ResponseExceptions)
Deprecated. |
void |
setResponseFooters(Vector a_ResponseFooters)
Deprecated. |
void |
setResponseHeaders(Vector a_ResponseHeaders)
Deprecated. |
void |
setResponseMessages(Vector a_ResponseMessages)
Deprecated. |
void |
setResponseString(String a_ResponseString)
Deprecated. |
void |
setStatus(int a_Status)
Deprecated. |
void |
showResponseExceptions(Properties parameters,
Locale locale,
OutputStream os)
Deprecated. |
void |
tableService(Properties parameters,
Locale locale,
OutputStream os)
Deprecated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface wt.enterprise.TemplateProcessor |
|---|
handleRequest |
| Method Detail |
|---|
public String[] getContextListIn()
getContextListIn in interface ContextTranslatorpublic void setContextListIn(String[] a_ContextListIn)
setContextListIn in interface ContextTranslatora_ContextListIn - public String[] getContextListOut()
getContextListOut in interface ContextTranslatorpublic void setContextListOut(String[] a_ContextListOut)
setContextListOut in interface ContextTranslatora_ContextListOut - public String getContextAction()
getContextAction in interface ContextHolderpublic void setContextAction(String a_ContextAction)
setContextAction in interface ContextHoldera_ContextAction - public Object getContextObj()
getContextObj in interface ContextHolderpublic void setContextObj(Object a_ContextObj)
setContextObj in interface ContextHoldera_ContextObj - public String getContextClassName()
getContextClassName in interface ContextHolderpublic void setContextClassName(String a_ContextClassName)
setContextClassName in interface ContextHoldera_ContextClassName - public Properties getContextProperties()
getContextProperties in interface ContextHolderpublic void setContextProperties(Properties a_ContextProperties)
setContextProperties in interface ContextHoldera_ContextProperties - public Vector getResponseExceptions()
getResponseExceptions in interface ContextHolderpublic void setResponseExceptions(Vector a_ResponseExceptions)
setResponseExceptions in interface ContextHoldera_ResponseExceptions - public Vector getResponseFooters()
getResponseFooters in interface ContextHolderpublic void setResponseFooters(Vector a_ResponseFooters)
setResponseFooters in interface ContextHoldera_ResponseFooters - public Vector getResponseHeaders()
getResponseHeaders in interface ContextHolderpublic void setResponseHeaders(Vector a_ResponseHeaders)
setResponseHeaders in interface ContextHoldera_ResponseHeaders - public Vector getResponseMessages()
getResponseMessages in interface ContextHolderpublic void setResponseMessages(Vector a_ResponseMessages)
setResponseMessages in interface ContextHoldera_ResponseMessages - public String getResponseString()
getResponseString in interface ContextHolderpublic void setResponseString(String a_ResponseString)
setResponseString in interface ContextHoldera_ResponseString - public int getStatus()
getStatus in interface ContextHolderpublic void setStatus(int a_Status)
setStatus in interface ContextHoldera_Status - public Properties getFormData()
getFormData in interface ContextHolderpublic void setFormData(Properties a_FormData)
setFormData in interface ContextHoldera_FormData - public Properties getQueryData()
getQueryData in interface ContextHolderpublic void setQueryData(Properties a_QueryData)
setQueryData in interface ContextHoldera_QueryData -
public static PrintWriter getLocalizedPrintWriter(OutputStream out,
Locale locale)
PrintWriter for the given output stream and locale.
Template processing uses a special output stream that allows reuse of a
shared print writer and writes to the output stream using a character
encoding determined from the locale of the template file resource.
Therefore, all template processor methods should call this method when they
need a print writer for writing text to their output stream.
out - the output stream passed to the processing methodlocale - the locale passed to the processing method
public PrintWriter getPrintWriter(OutputStream out,
Locale locale)
PrintWriter for the given output stream and locale.
Template processing uses a special output stream that allows reuse of a
shared print writer and writes to the output stream using a character
encoding determined from the locale of the template file resource.
Therefore, all template processor methods should call this method when they
need a print writer for writing text to their output stream.
out - the output stream passed to the processing methodlocale - the locale passed to the processing method
public String getEncoding(OutputStream out,
Locale locale)
out - the output stream passed to the processing methodlocale - the locale passed to the processing method
public void objectIdentification(Properties parameters,
Locale locale,
OutputStream os)
throws WTException
It is expected that this method will be invoked as a result of an objectIdentification script call in an HTML template file. The format of objectIdentification script calls is:
The format of the HTML that is output is determined by an HTML template file. The template that is used is chosen from the templates directory based on the class of the contextual object, the locale and the parameters passed to the objectIdentification script call within a higher level HTML template. Currently the template file is chosen from either the ObjectIdentificationVerbose or ObjectIdentificationBrief directories. Within those directories the template is chosen on the basis of:
1. the class name of the context object 2. the wt.enterprise super class of the context object 3. the default template
Supported API: true
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.
WTException - Description of the Exception
public void objectPropertyValue(Properties parameters,
Locale locale,
OutputStream os)
throws IllegalAccessException,
InvocationTargetException,
wt.introspection.WTIntrospectionException,
WTException
It is expected that this method will be invoked as a result of an objectPropertyValue script call in an HTML template file. The format of objectPropertyValue script calls is:
The format of the HTML that is output is dependent on the type of the
property value.
Caution: This method will return " " for null
property values. Also, if the MethodContext contains the property
"preserveFormatting=true", characters with special meaning or treatment
in HTML will be encoded to display properly in browsers. For example,
'>' will be encoded as ">" and a carriage return will be encoded
as "<BR>." The preserveFormatting flag can be set using the
Windchill script method DefaultTemplateProcessor.setMethodContextProperty().
Supported API: true
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.
IllegalAccessException - Description of the
Exception
InvocationTargetException - Description of the
Exception
wt.introspection.WTIntrospectionException - Description of the
Exception
WTException - Description of the
Exception
public void objectPropertyName(Properties parameters,
Locale locale,
OutputStream os)
throws IllegalAccessException,
InvocationTargetException,
wt.introspection.WTIntrospectionException,
WTException
It is expected that this method will be invoked as a result of an objectPropertyName script call in an HTML template file. The format of objectPropertyName script calls is:
Supported API: true
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.
IllegalAccessException - Description of the
Exception
InvocationTargetException - Description of the
Exception
wt.introspection.WTIntrospectionException - Description of the
Exception
WTException - Description of the
Exception
public void objectActionLink(Properties parameters,
Locale locale,
OutputStream os)
throws WTException
It is expected that this method will be invoked as a result of an objectActionLink script call in an HTML template file. The format of objectActionLink script calls is:
objectActionLink action=ObjProps labelPropertyName=requester
objectActionLink action=ObjProps
Supported API: true
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.
WTException - Description of the Exception
public void objectBackground(Properties parameters,
Locale locale,
OutputStream os)
throws WTException
It is expected that this method will be invoked as a result of an objectBackground script call in an HTML template file. The format of objectBackground script calls is:
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.
WTException - Description of the Exception
public void currentTimestamp(Properties parameters,
Locale locale,
OutputStream os)
throws WTException
It is expected that this method will be invoked as a result of an currentTimestamp script call in an HTML template file. The format of currentTimestamp script calls is:
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.
WTException - Description of the Exception
public void getObjectIcon(Properties parameters,
Locale locale,
OutputStream os)
parameters - the Properties passed in when this method is invoked;
this parameter is not used by this methodlocale - the Locale in which the image will be displayedos - the OutputStream to write the image to.
public void createNavigationBar(Properties parameters,
Locale locale,
OutputStream os)
throws WTException
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.
WTException - Description of the Exception
public void createActionsBar(Properties parameters,
Locale locale,
OutputStream os)
throws WTException
parameters - the Properties which contains parameter values
specified in the script call. Can contain values for the link color and
background color of the table cells.locale - the locale in which the links will be displayedos - the OutputStream to write the table of links to.
WTException - if an error occurs building the links to the actions
public void createGlobalNavigationBar(Properties parameters,
Locale locale,
OutputStream os)
parameters - Description of the Parameterlocale - Description of the Parameteros - Description of the Parameter
public void getHTMLHelpURL(Properties parameters,
Locale locale,
OutputStream os)
throws WTException
The correct Windchill script call is
getHTMLHelpURL HelpContext=<Context to locate Help Page>
The HelpContext parameter is optional. See comments below.
The help page is based on the context of the current HTML page and is found via an entry in a *.properties file. The correct entry in a properties file will look like
wt.services/rsc/default/wt.templateutil.processor.HelpHTMLTemplate/<Context Action>/<Context Class>/0=<Path to HTML Help Page><Anchor>
Where
wt.helpfiles.federation.help.IEServices
wt.helpfiles.federation.help.IEServices#VIEWIESERVICE
parameters - The name/value pairs passed in from the Windchill
Script Calllocale - The current Locale of the browseros - The OutputStream to the Browser
WTException - Description of the Exception
public void addHTMLHelpLink(Properties parameters,
Locale locale,
OutputStream os)
throws WTException
The correct Windchill script call is
addHTMLHelpLink <name/value pairs indicating customized options>
Please the javadoc for the method, getHTMLHelpLink, for listing and description of the name/value pairs that specify the options for presenting an HTML help link.
Please the javadoc for the method, getHTMLHelpLink, for description of how
register an HTML Help page for the page that the help link is to appear.
Supported API: true
parameters - locale - os -
WTException
public void getResourceString(Properties parameters,
Locale locale,
OutputStream os)
throws WTException
parameters - Description of the Parameterlocale - Description of the Parameteros - Description of the Parameter
WTException - Description of the Exception
public void getURLProcessorLink(Properties parameters,
Locale locale,
OutputStream os)
throws WTException
parameters - Description of the Parameterlocale - Description of the Parameteros - Description of the Parameter
WTException - Description of the Exceptionpublic void addToResponseExceptions(Exception newException)
The stackTraces for the list of exceptions can be presented using the following Windchill Script call
addToResponseExceptions in interface ContextHoldernewException - public void addToResponseMessages(LocalizableMessage newMessage)
The messages will be presented in the Locale of the HTML template
Supported API: true
addToResponseMessages in interface ContextHoldernewMessage - public void addToResponseHeaders(LocalizableMessage newHeader)
The goal of this option is to provide a way to present any information that occured preparing the processing of the page at the top of the page.
The LocalizableMessages will be presented in the locale of the HTML page
Supported API: true
addToResponseHeaders in interface ContextHoldernewHeader - public void addToResponseFooters(LocalizableMessage newFooter)
addToResponseFooters in interface ContextHoldernewFooter - The feature to be added to the ToResponseFooters attribute
public void processSubTemplate(Properties parameters,
Locale locale,
OutputStream os)
The correct Windchill script call is
This entry will look for the following in entry in a properties file
The action specified in the Windchill script call and the current context
object are used to locate the correct TemplateProcessor and the HTML
template via entries in the properties files, as usual.
After getting the TemplateProcessor, the current state is passed off the
the sub-TemplateProcessor via the HTTPState object. The action on the
HTTPState object is temporalily set to the action in the Windchill script
call. The contextAction is restored to its previous value after the
processing of the sub-HTML template is finished.
The Locale and OutputStream are passed off to the sub-TemplateProcessor so
it knows the current Locale and has access to output stream to the browser.
The name/values pairs passed in via the Windchill script are made available
to the Sub-TemplateProcessor via contextProperties object of the
TemplateProcessor.
Supported API: true
parameters - locale - os -
public void showResponseExceptions(Properties parameters,
Locale locale,
OutputStream os)
The correct Windchill script call is
showResponseExceptions
The goal of this option is to provide a way to present a list of non-fatal
stackTraces that occured in the processing of an HTML template or a HTTP
Get/Post request.
Supported API: true
parameters - locale - os - public TemplateProcessorTableService getHTMLTableService()
tableService action=...
If there is not an instance of TemplateProcessorTableService available, lazy initialization is done to present one.
The current state is passed to the TemplateProcessorTableService instance
via the HTTPState object.
Supported API: true
public void tableService(Properties parameters,
Locale locale,
OutputStream os)
throws WTException
The correct Windchill script call is
tableService action=<A valid action for a HTMLTableServiceEventListener> <More name/value pairs>
The HTMLTableServiceEventListeners are registered in wt.properties in the entry
wt.templateutil.table.HTMLTableServiceEventListeners=...
Please see the Javadoc for the registered HTMLTableServiceEventListeners as
to how to use the individual method calls and what parameters they take
Supported API: true
parameters - locale - os -
WTException - Description of the Exceptionpublic static String getWCColor(String styleClass)
styleClass - Refers to the name of a wt.html.color property in
wt.properties (for example, "bg-body")
public void getWCColor(Properties parameters,
Locale locale,
OutputStream os)
throws WTException
The script call must pass the required parameter "styleClass" which refers to the name of a wt.html.color property in wt.properties.
The optional parameter "quotes" determines what kind of quotes will be included in the output.
The output written to the html page will be a color number string.
If quotes=none, the output will not have quotes: #NNNNNN
If quotes=single, the output will be in single quotes: '#NNNNNN'
If quotes=double or if there is no quotes parameter, the output will be in
double quotes: "#NNNNNN"
Example usage in an html template:
Supported API: true
parameters - Description of the Parameterlocale - Description of the Parameteros - Description of the Parameter
WTException - Description of the Exception
public void getWCColorDec(Properties parameters,
Locale locale,
OutputStream os)
throws WTException
The script call must pass the required parameter "styleClass" which refers to the name of a wt.html.color property in wt.properties.
The output written to the html page will be an unquoted string in the form: nnnn...
Example usage in an html template:
getWCColor styleClass=bg-body >
parameters - Description of the Parameterlocale - Description of the Parameteros - Description of the Parameter
WTException - Description of the Exceptionpublic static String getWCFontFamily()
public void getWCFontFamily(Properties parameters,
Locale locale,
OutputStream os)
The output written to the HTML page will be a string in the form: "
The optional parameter "quotes" determines what kind of quotes will be
included in the output.
If quotes=none, the output will not have quotes:
Supported API: true
parameters - Description of the Parameterlocale - Description of the Parameteros - Description of the Parameter
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||