wt.templateutil.processor
Class DefaultTemplateProcessor

java.lang.Object
  extended by wt.enterprise.BasicTemplateProcessor
      extended by wt.templateutil.processor.DefaultTemplateProcessor
All Implemented Interfaces:
Externalizable, Serializable, TemplateProcessor, ContextHolder, ContextTranslator, Evolvable
Direct Known Subclasses:
ChangeIntermediateActionProcessor, ContainerTemplateProcessor, ExpandCollapseSectionProcessor, GenerateFormProcessor, ObjectPropertiesTableProcessor, PartReplacementsProcessor, WorkspaceCommonTemplateProcessor, WsPrefCommonTemplateProcessor

Deprecated.

public class DefaultTemplateProcessor
extends 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 class represents the base Template Processor that should be subclassed for the Template Processors that will be used to generate an HTML page that purely present information, i.e., there is not an HTML Form in the page. By subclassing this Template Processor, all of set up to process an HTML template is done for you. One of the most important default services is finding and initializing the HTML Template. The DefaultHTMLTemplateFactory is used behind the scenes to do this based on the current settings in the the HTTPState object.

Once you have subclassed this class and added the proper entries in an .properties file to that you subclass and the corresponding HTML Template can be found, you only need to implement the methods to support the Windchill script calls in the HTML Template.



Supported API: true

Extendable: false

See Also:
Serialized Form

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 displayAttributeLabel(Properties parameters, Locale locale, OutputStream os)
          Deprecated.  
 void displayAttributeVal(Properties parameters, Locale locale, OutputStream os)
          Deprecated.  
 void getAttributes(Properties parameters, Locale locale, OutputStream os)
          Deprecated.  
 String getContextPropertyValue(String token)
          Deprecated.  
 AbstractHTMLTemplateFactory getHtmlTemplateFactory()
          Deprecated. Gets the object for the association that plays role: htmlTemplateFactory.
 int getPAGE_EXPIRATION()
          Deprecated.  
 String getPageExpirationResource()
          Deprecated.  
 wt.htmlutil.HTMLTemplate getTemplate(HTTPRequest req)
          Deprecated.  
 void setContextPropertyValue(String propertyName, String propertyValue)
          Deprecated.  
 void setNameProcessor(TemplateNameProcessor a_NameProcessor)
          Deprecated.  
 void setPAGE_EXPIRATION(int a_PAGE_EXPIRATION)
          Deprecated.  
 void setPageExpirationResource(String a_PageExpirationResource)
          Deprecated.  
 
Methods inherited from class wt.enterprise.BasicTemplateProcessor
addHTMLHelpLink, addToResponseExceptions, addToResponseFooters, addToResponseHeaders, addToResponseMessages, createActionsBar, createGlobalNavigationBar, createNavigationBar, currentTimestamp, getContextAction, getContextClassName, getContextListIn, getContextListOut, getContextObj, getContextProperties, getEncoding, getFormData, getHTMLHelpURL, getHTMLTableService, getLocalizedPrintWriter, getObjectIcon, getPrintWriter, getQueryData, getResourceString, getResponseExceptions, getResponseFooters, getResponseHeaders, getResponseMessages, getResponseString, getStatus, getURLProcessorLink, getWCColor, getWCColor, getWCColorDec, getWCFontFamily, getWCFontFamily, objectActionLink, objectBackground, objectIdentification, objectPropertyName, objectPropertyValue, processSubTemplate, setContextAction, setContextClassName, setContextListIn, setContextListOut, setContextObj, setContextProperties, setFormData, setQueryData, setResponseExceptions, setResponseFooters, setResponseHeaders, setResponseMessages, setResponseString, setStatus, showResponseExceptions, tableService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPageExpirationResource

public String getPageExpirationResource()
Deprecated. 

Gets the value of the attribute: pageExpirationResource.

Supported API: true

Returns:
String

setPageExpirationResource

public void setPageExpirationResource(String a_PageExpirationResource)
Deprecated. 

Sets the value of the attribute: pageExpirationResource.

Supported API: true

Parameters:
a_PageExpirationResource -

getPAGE_EXPIRATION

public int getPAGE_EXPIRATION()
Deprecated. 

Gets the value of the attribute: PAGE_EXPIRATION.

Supported API: true

Returns:
int

setPAGE_EXPIRATION

public void setPAGE_EXPIRATION(int a_PAGE_EXPIRATION)
Deprecated. 

Sets the value of the attribute: PAGE_EXPIRATION.

Supported API: true

Parameters:
a_PAGE_EXPIRATION -

getHtmlTemplateFactory

public AbstractHTMLTemplateFactory getHtmlTemplateFactory()
                                                   throws WTException
Deprecated. 
Gets the object for the association that plays role: htmlTemplateFactory.

Returns the current implementation of an AbstractHTMLTemplateFactory that will be used to locate the HTML Template to be used. The default implementation of an AbstractHTMLTemplateFactory to be used is the DefaultHTMLTemplateFactory. However, any implementation of an AbstractHTMLTemplateFactory is valid.

Supported API: true

Returns:
AbstractHTMLTemplateFactory
Throws:
WTException

getTemplate

public wt.htmlutil.HTMLTemplate getTemplate(HTTPRequest req)
                                     throws WTException
Deprecated. 

Returns the HTML Template to be processed using the current implementation of an AbstractHTMLTemplateFactory returned by the getHtmlTemplateFactory method.

The current "state" and locale is used to find the correct HTML template.

Supported API: true

Parameters:
req -
Returns:
HTMLTemplate
Throws:
WTException

setNameProcessor

public void setNameProcessor(TemplateNameProcessor a_NameProcessor)
                      throws WTException
Deprecated. 



Supported API: true

Parameters:
a_NameProcessor -
Throws:
WTException

setContextPropertyValue

public void setContextPropertyValue(String propertyName,
                                    String propertyValue)
Deprecated. 



Supported API: true

Parameters:
propertyName -
propertyValue -

getContextPropertyValue

public String getContextPropertyValue(String token)
Deprecated. 



Supported API: true

Parameters:
token -
Returns:
String

displayAttributeLabel

public void displayAttributeLabel(Properties parameters,
                                  Locale locale,
                                  OutputStream os)
                           throws WTException
Deprecated. 

Displays the the localized label for a given soft or modeled attribute of the current context object. For a soft attribute, this requires a database query unless the data was previously requested via a script call to getAttributes(). For a modeled attribute this method is equivalent to calling BasicTemplateProcessor.objectPropertyName() and no query is needed.

For better performance, if more than one call is to be made to displayAttributeLabel() for soft attributes from the same HTML template, first call getAttributes() to retrieve the data for all the soft attributes before calling displayAttributeLabel().

Supported API: true

Parameters:
parameters -
  • attributeName - External form of the attribute type identifer for the attribute whose label is desired. Modeled attributes should have the protocol prefix "MBA|" and soft attributes should have the protocol prefix "IBA|".
    Examples:
    • "IBA|booleanIBA" for the soft attribute named booleanIBA
    • "MBA|partType" for the modeled attribute named partType
locale - Locale to use for localizing the attribute label
os - HTTP output stream
Throws:
WTException

displayAttributeVal

public void displayAttributeVal(Properties parameters,
                                Locale locale,
                                OutputStream os)
                         throws WTException
Deprecated. 

Displays the the value for a given soft or modeled attribute of the current context object. For a soft attribute, this requires a database query unless the data was previously requested via a script call to getAttributes(). For a modeled attribute, this method is equivalent to calling BasicTemplateProcessor.objectPropertyValue() and no query is needed.

If a soft attribute has more than one value, the values will be comma-separated in one string.

For better performance, if more than one call is to be made to displayAttributeVal() for soft attributes from the same HTML template, first call getAttributes() to retrieve the data for all the soft attributes to be displayed before calling displayAttributeVal().

Supported API: true

Parameters:
parameters -
  • attributeName - External form of the attribute type identifer for the attribute whose value is desired. Modeled attribute names should have the protocol prefix "MBA|" and soft attribute names should have the protocol prefix "IBA|".
    Examples:
    • "IBA|booleanIBA" for the soft attribute named booleanIBA
    • "MBA|partType" for the modeled attribute named partType
locale - Locale to use for localizing the attribute value
os - HTTP output stream
Throws:
WTException

getAttributes

public void getAttributes(Properties parameters,
                          Locale locale,
                          OutputStream os)
                   throws WTException
Deprecated. 

Retrieves the display name and value(s) for one or more given soft attributes of the current context object and stores them in the contextProperties attribute of the HTTPState object for later use by the displayAttributeLabel() and/or displayAttributeVal() methods. The purpose of this method is to make multiple calls to displayAttributeLabel() and/or displayAttributeVal() more efficient by retrieving all the required attribute data in one query.



Supported API: true

Parameters:
parameters -
  • attributeNames - Comma-separated list of the external form of the attribute type identifers for the desired attributes. Modeled attribute names should have the protocol prefix "MBA|" and soft attribute names should have the protocol prefix "IBA|".
    For example, to retrieve the data for the soft attributes booleanIBA and stringIBA and the modeled attribute partType you would use the following value: "IBA|booleanIBA, IBA|stringIBA, MBA|partType"
locale - Locale to use for localizing the attribute labels and values
os - Output stream
Throws:
WTException