Class DefaultTemplateProcessor

java.lang.Object
wt.enterprise.BasicTemplateProcessor
wt.templateutil.processor.DefaultTemplateProcessor
All Implemented Interfaces:
Externalizable, Serializable, TemplateProcessor, ContextHolder, ContextTranslator, Evolvable
Direct Known Subclasses:
ContainerTemplateProcessor, ExpandCollapseSectionProcessor, GenerateFormProcessor, com.ptc.windchill.cadx.common.HelpGenerationProcessor, ObjectPropertiesTableProcessor, PartReplacementsProcessor, WsPrefCommonTemplateProcessor

public class DefaultTemplateProcessor extends BasicTemplateProcessor
Deprecated.
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:
  • Method Details

    • 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