com.ibm.commerce.emarketing.emailtemplate.tag

Class TagUtil

  • java.lang.Object
    • com.ibm.commerce.emarketing.emailtemplate.tag.TagUtil


  • public class TagUtil
    extends java.lang.Object
    This class contains utility functions used in tag engine implementation
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String CARRIAGERETURN
      CARRIAGE RETURN
      static java.lang.String COPYRIGHT
      Copyright String
      static java.lang.String LINEFEED
      Line Feed
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.lang.StringBuffer bufferReplace(java.lang.StringBuffer content, java.lang.String pattern, java.lang.String replace)
      Replace all patterns with replace string for a string buffer.
      static java.lang.String getContentsAt(java.lang.String urlLocation)
      This function returns the contents of the given URL Location
      static java.lang.String getMainURL()
      It returns the main part of the URL: http:///webapp/....
      static java.lang.String getMainURL(com.ibm.commerce.command.CommandContext context)
      It returns the main part of the URL: http:///webapp/....
      static java.lang.String getSecuredMainURL()
      It returns the main part of the URL.
      static java.lang.String getSecuredMainURL(com.ibm.commerce.command.CommandContext context)
      It returns the main part of the URL.
      static java.lang.String getServerAddress()
      Returns the Server IP Address
      static java.lang.String getServerAddress(com.ibm.commerce.command.CommandContext context)
      Returns the Server Address
      static java.lang.String getSpotContentFromView(java.lang.String view, java.lang.Long userId, com.ibm.commerce.datatype.TypedProperty properties, com.ibm.commerce.command.CommandContext comContext)
      This method invokes the view URL as the user of the specified user identifier and returns the generated the content.
      static java.lang.String getSpotContentFromView(java.lang.String view, java.lang.String recipientIdS, java.lang.String storeIdS, com.ibm.commerce.datatype.TypedProperty properties)
      This method invokes the view URL as the user of the specified user identifier and returns the generated the content.
      static java.lang.String getStoresWebPath()
      This method returns the store web path.
      • Methods inherited from class java.lang.Object

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

      • CARRIAGERETURN

        public static final java.lang.String CARRIAGERETURN
        CARRIAGE RETURN
      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        Copyright String
        See Also:
        Constant Field Values
      • LINEFEED

        public static final java.lang.String LINEFEED
        Line Feed
    • Method Detail

      • bufferReplace

        public static java.lang.StringBuffer bufferReplace(java.lang.StringBuffer content,
                                                           java.lang.String pattern,
                                                           java.lang.String replace)
        Replace all patterns with replace string for a string buffer. This utility method is used to help efficient operation with string buffer, used in email Tag value which can be very performance sensitive. It is a replacement for Util.replace.
        Parameters:
        content -
        pattern -
        replace -
        Returns:
        the replaced content.
      • getContentsAt

        public static java.lang.String getContentsAt(java.lang.String urlLocation)
                                              throws com.ibm.commerce.exception.ECException
        This function returns the contents of the given URL Location
        Parameters:
        urlLocation - - String
        Returns:
        String - The contents of the given location.
        Throws:
        com.ibm.commerce.exception.ECException - - If any exception occurs during reading the contents from specifed URL location .
      • getMainURL

        public static java.lang.String getMainURL()
        It returns the main part of the URL: http:///webapp/....
        Returns:
        - String - main part of the URL
      • getMainURL

        public static java.lang.String getMainURL(com.ibm.commerce.command.CommandContext context)
        It returns the main part of the URL: http:///webapp/....
        Parameters:
        context - The command context
        Returns:
        - String - main part of the URL
      • getSecuredMainURL

        public static java.lang.String getSecuredMainURL()
        It returns the main part of the URL. This function uses secure HTTP. http:///webapp/....
        Returns:
        - String - main part of the URL
      • getSecuredMainURL

        public static java.lang.String getSecuredMainURL(com.ibm.commerce.command.CommandContext context)
        It returns the main part of the URL. This function uses secure HTTP. http:///webapp/....
        Parameters:
        context - The command context
        Returns:
        - String - main part of the URL
      • getServerAddress

        public static java.lang.String getServerAddress()
        Returns the Server IP Address
        Returns:
        String - IP Address
      • getServerAddress

        public static java.lang.String getServerAddress(com.ibm.commerce.command.CommandContext context)
        Returns the Server Address
        Parameters:
        context - CommandContext of the current request
        Returns:
        String - Server Address returned. If preview is active, returns server name of HttpServletRequest, otherwise, returns by GetWebHostCmd. If context is null, the address returned is the WebServer/HostName from wc-server.xml
      • getSpotContentFromView

        public static java.lang.String getSpotContentFromView(java.lang.String view,
                                                              java.lang.Long userId,
                                                              com.ibm.commerce.datatype.TypedProperty properties,
                                                              com.ibm.commerce.command.CommandContext comContext)
        This method invokes the view URL as the user of the specified user identifier and returns the generated the content.
        Parameters:
        view - The name of the view URL to invoke.
        userId - The identifier of the user
        properties - URL parameters to call the view with
        comContext - The command context used when invoking the view URL
        Returns:
        The content returned by the view URL. null is returned if an error occurred during processing.
      • getSpotContentFromView

        public static java.lang.String getSpotContentFromView(java.lang.String view,
                                                              java.lang.String recipientIdS,
                                                              java.lang.String storeIdS,
                                                              com.ibm.commerce.datatype.TypedProperty properties)
        This method invokes the view URL as the user of the specified user identifier and returns the generated the content. The processing is running under a new Business Context.
        Parameters:
        view - The name of the view URL to invoke.
        recipientIdS - The String identifier of the user.
        storeIdS - The String identifier of the store.
        properties - URL parameters to call the view with
        Returns:
        The content returned by the view URL. null is returned if an error occurred during processing.
      • getStoresWebPath

        public static java.lang.String getStoresWebPath()
        This method returns the store web path.
        Returns:
        the store web path.