com.ibm.commerce.emarketing.emailtemplate.tag

Class TagEngineImpl

  • java.lang.Object
    • com.ibm.commerce.emarketing.emailtemplate.tag.TagEngineImpl
  • All Implemented Interfaces:
    TagEngine


    public class TagEngineImpl
    extends java.lang.Object
    implements TagEngine
    Default implementation for TagEngine.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      COPYRIGHT
      static java.lang.String END
      HTML content end
      static java.lang.String HEAD
      HTML content head
    • Constructor Summary

      Constructors 
      Constructor and Description
      TagEngineImpl()
      Default Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String parse(java.lang.String inputString)
      This method parses the given input string, looking for predefined tags and replaces them with the values returned by getTagValue method calls.
      java.util.Map parseToGetTagNameValueMap(java.lang.String inputString)
      Parses the given input string looking for the map of the predefined tags and their values returned by getTagValue() method calls.
      java.lang.String renderEmailContent(java.lang.String inputString)
      This method calls parse(inputString) function to replace the predefined tags with the tag replacement values.
      java.lang.String renderEmailContent(java.lang.String inputString, java.util.Hashtable parameters)
      This method calls parse(inputString) function to replace the predefined tags with the tag replacement values.
      void setCommandContext(com.ibm.commerce.command.CommandContext cmdContext)
      Sets the Command Context
      void setTagParameters(java.util.Hashtable tagParametersCopy)
      This method sets the tag parameters (key - value pair)
      void setTagParameters(java.lang.String name, java.lang.String value)
      Sets the key - value pair for the tag..
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TagEngineImpl

        public TagEngineImpl()
        Default Constructor
    • Method Detail

      • parse

        public java.lang.String parse(java.lang.String inputString)
                               throws com.ibm.commerce.exception.ECException
        This method parses the given input string, looking for predefined tags and replaces them with the values returned by getTagValue method calls.
        Specified by:
        parse in interface TagEngine
        Parameters:
        inputString - - The string to be parsed
        Returns:
        - The final String, with all the tags replaced with there values.
        Throws:
        com.ibm.commerce.exception.ECException
      • parseToGetTagNameValueMap

        public java.util.Map parseToGetTagNameValueMap(java.lang.String inputString)
                                                throws com.ibm.commerce.exception.ECException
        Parses the given input string looking for the map of the predefined tags and their values returned by getTagValue() method calls.
        Specified by:
        parseToGetTagNameValueMap in interface TagEngine
        Parameters:
        inputString - - string to be parsed
        Returns:
        Map with the tags name & the actual value
        Throws:
        com.ibm.commerce.exception.ECException
      • renderEmailContent

        public java.lang.String renderEmailContent(java.lang.String inputString)
                                            throws com.ibm.commerce.exception.ECException
        This method calls parse(inputString) function to replace the predefined tags with the tag replacement values. This method then adds the HTML snippet to record email opened event (if recordOpen = true). If the content type is HTML, then this method adds the
        ---
        to the result string...
        Specified by:
        renderEmailContent in interface TagEngine
        Parameters:
        inputString - - The string which needs to be parsed.
        Returns:
        - The final String, which can be rendered in the end user browser.
        Throws:
        com.ibm.commerce.exception.ECException
      • renderEmailContent

        public java.lang.String renderEmailContent(java.lang.String inputString,
                                                   java.util.Hashtable parameters)
                                            throws com.ibm.commerce.exception.ECException
        This method calls parse(inputString) function to replace the predefined tags with the tag replacement values. This method then adds the HTML snippet to record email opened event (if recordOpen = true). If the content type is HTML, then this method adds the
        ---
        to the result string...
        Specified by:
        renderEmailContent in interface TagEngine
        Parameters:
        inputString - - The string which needs to be parsed.
        parameters - - The hashtable containing key-value pairs used during parsing of the given input string. User may also set values for recordOpen(0 or 1) and contentFormat(HTML or Plain text) keys.
        Returns:
        - The final String, which can be rendered in the end user browser.
        Throws:
        com.ibm.commerce.exception.ECException
        See Also:
        TagEngine.renderEmailContent(String inputString);
      • setCommandContext

        public void setCommandContext(com.ibm.commerce.command.CommandContext cmdContext)
        Sets the Command Context
        Specified by:
        setCommandContext in interface TagEngine
        Parameters:
        cmdContext - Command Context
      • setTagParameters

        public void setTagParameters(java.util.Hashtable tagParametersCopy)
        This method sets the tag parameters (key - value pair)
        Specified by:
        setTagParameters in interface TagEngine
        Parameters:
        tagParametersCopy - Hashtable containing tag parameters key-values.
      • setTagParameters

        public void setTagParameters(java.lang.String name,
                                     java.lang.String value)
        Sets the key - value pair for the tag..
        Specified by:
        setTagParameters in interface TagEngine
        Parameters:
        name - - key name
        value - - value of the tag parameter key