com.ibm.commerce.emarketing.emailtemplate.tag

Interface TagEngine

  • All Known Implementing Classes:
    TagEngineImpl


    public interface TagEngine
    An interface for an engine which parses the content of e-mail templates and replaces the template tags with actual values.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      Copyright.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      java.lang.String parse(java.lang.String inputString)
      Parses the given input string looking for predefined tags and replacing them with the value 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 is overloaded version of renderEmailContent(String, Hashtable).
      java.lang.String renderEmailContent(java.lang.String inputString, java.util.Hashtable parameters)
      After setting the tagParmeters in class level variable, this method calls the overloaded version renderEmailContent(inputString) function to get the result.
      void setCommandContext(com.ibm.commerce.command.CommandContext commandContext)
      Sets the command Context
      void setTagParameters(java.util.Hashtable tagParametersCopy)
      Sets the tag parameters, which might be used while getting the replacement value for tag
      void setTagParameters(java.lang.String name, java.lang.String value)
      Sets the key-value pair, used while parsing the tag.
    • Method Detail

      • parse

        java.lang.String parse(java.lang.String inputString)
                        throws com.ibm.commerce.exception.ECException
        Parses the given input string looking for predefined tags and replacing them with the value returned by getTagValue() method calls.
        Parameters:
        inputString - - string to be parsed
        Returns:
        String with the tags replaced by actual value
        Throws:
        com.ibm.commerce.exception.ECException
      • parseToGetTagNameValueMap

        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.
        Parameters:
        inputString - - string to be parsed
        Returns:
        Map with the tags name & the actual value
        Throws:
        com.ibm.commerce.exception.ECException
      • renderEmailContent

        java.lang.String renderEmailContent(java.lang.String inputString)
                                     throws com.ibm.commerce.exception.ECException
        This method is overloaded version of renderEmailContent(String, Hashtable). This method can be used, to set the tag parameters separately instead of passing it through hashtable. 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 = 1). If the content type is HTML (contentFormat = 1), then this method adds the
        ---
        to the result string.
        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 - - throws ECException
      • renderEmailContent

        java.lang.String renderEmailContent(java.lang.String inputString,
                                            java.util.Hashtable parameters)
                                     throws com.ibm.commerce.exception.ECException
        After setting the tagParmeters in class level variable, this method calls the overloaded version renderEmailContent(inputString) function to get the result.
        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. This method then adds the HTML snippet to record e-mail opened event (if recordOpen = 1). If the content type is HTML. (contentFormat = 1), then this method adds the
        ---
        to the result string.
        Returns:
        - The final String, which can be rendered in the end user browser.
        Throws:
        - - throws ECException
        com.ibm.commerce.exception.ECException
        See Also:
        TagEngine.renderEmailContent(String inputString);
      • setCommandContext

        void setCommandContext(com.ibm.commerce.command.CommandContext commandContext)
        Sets the command Context
        Parameters:
        commandContext -
      • setTagParameters

        void setTagParameters(java.util.Hashtable tagParametersCopy)
        Sets the tag parameters, which might be used while getting the replacement value for tag
        Parameters:
        tagParametersCopy -
      • setTagParameters

        void setTagParameters(java.lang.String name,
                              java.lang.String value)
        Sets the key-value pair, used while parsing the tag.
        Parameters:
        name - - key
        value - - tag parameter value