Class SiteMessageService


  • public final class SiteMessageService
    extends Object
    This class provides a service that build messages
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void cleanMessageSession​(javax.servlet.http.HttpServletRequest request)
      Delete the message in session
      static SiteMessage getMessage​(javax.servlet.http.HttpServletRequest request)
      Returns the message associated to the current request
      static void setCustomMessage​(javax.servlet.http.HttpServletRequest request, String strText, int nMessageType)
      Set the custom message, store it in session and throw a LuteceSiteMessageException
      static void setCustomMessage​(javax.servlet.http.HttpServletRequest request, String strTitle, String strText, int nMessageType)
      Set the custom message, store it in session and throw a LuteceSiteMessageException
      static void setCustomMessage​(javax.servlet.http.HttpServletRequest request, String title, String text, String strUrl, int nMessageType, String strBackUrl)
      Set the custom message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, String strMessageKey)
      Set the INFO message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, String strMessageKey, int nMessageType)
      Set the message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, String strMessageKey, int nMessageType, String strUrl)
      Set the message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, String strMessageKey, int nMessageType, String strUrl, String strTitleKey, Object[] messageArgs)
      Set the message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, String strMessageKey, int nMessageType, String strUrl, Map<String,​Object> requestParameters)
      Set the message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, String strMessageKey, Object[] messageArgs, int nMessageType)
      Set the message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, String strMessageKey, Object[] messageArgs, int nMessageType, String strUrl, String strTitleKey)
      Set the message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, String strMessageKey, Object[] messageArgs, String strTitleKey, int nMessageType)
      Set the message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, String strMessageKey, Object[] messageArgs, String strTitleKey, String strUrl, String strTarget, int nMessageType)
      Set the message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, String strMessageKey, Object[] messageArgs, String strTitleKey, String strUrl, String strTarget, int nMessageType, Map<String,​Object> requestParameters)
      Set the message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, String strMessageKey, Object[] messageArgs, String strTitleKey, String strUrl, String strTarget, int nMessageType, Map<String,​Object> requestParameters, String strBackUrl)
      Set the message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, String strMessageKey, String strTitleKey, int nMessageType)
      Set the message, store it in session and throw a LuteceSiteMessageException
      static String setSiteMessageUrl​(String strRequestUrl)
      Set the site message url with parameters if necessary
    • Method Detail

      • setMessage

        public static void setMessage​(javax.servlet.http.HttpServletRequest request,
                                      String strMessageKey)
                               throws SiteMessageException
        Set the INFO message, store it in session and throw a LuteceSiteMessageException
        Parameters:
        request - The HttpRequest
        strMessageKey - The message key
        Throws:
        SiteMessageException - occurs when a site message need to be displayed
      • setMessage

        public static void setMessage​(javax.servlet.http.HttpServletRequest request,
                                      String strMessageKey,
                                      int nMessageType)
                               throws SiteMessageException
        Set the message, store it in session and throw a LuteceSiteMessageException
        Parameters:
        request - The HttpRequest
        strMessageKey - The message key
        nMessageType - The message type
        Throws:
        SiteMessageException - occurs when a site message need to be displayed
      • setMessage

        public static void setMessage​(javax.servlet.http.HttpServletRequest request,
                                      String strMessageKey,
                                      int nMessageType,
                                      String strUrl)
                               throws SiteMessageException
        Set the message, store it in session and throw a LuteceSiteMessageException
        Parameters:
        request - The HttpRequest
        strMessageKey - The message key
        nMessageType - The message type
        strUrl - The url of the Ok button
        Throws:
        SiteMessageException - occurs when a site message need to be displayed
      • setMessage

        public static void setMessage​(javax.servlet.http.HttpServletRequest request,
                                      String strMessageKey,
                                      int nMessageType,
                                      String strUrl,
                                      Map<String,​Object> requestParameters)
                               throws SiteMessageException
        Set the message, store it in session and throw a LuteceSiteMessageException
        Parameters:
        request - The HttpRequest
        strMessageKey - The message key
        nMessageType - The message type
        strUrl - The url of the Ok button
        requestParameters - The request parameters as a map
        Throws:
        SiteMessageException - occurs when a site message need to be displayed
      • setMessage

        public static void setMessage​(javax.servlet.http.HttpServletRequest request,
                                      String strMessageKey,
                                      String strTitleKey,
                                      int nMessageType)
                               throws SiteMessageException
        Set the message, store it in session and throw a LuteceSiteMessageException
        Parameters:
        request - The HttpRequest
        strMessageKey - The message key
        strTitleKey - The title key
        nMessageType - The message type
        Throws:
        SiteMessageException - occurs when a site message need to be displayed
      • setMessage

        public static void setMessage​(javax.servlet.http.HttpServletRequest request,
                                      String strMessageKey,
                                      Object[] messageArgs,
                                      String strTitleKey,
                                      int nMessageType)
                               throws SiteMessageException
        Set the message, store it in session and throw a LuteceSiteMessageException
        Parameters:
        request - The HttpRequest
        strMessageKey - The message key
        messageArgs - Message Arguments
        strTitleKey - The title key
        nMessageType - The message type
        Throws:
        SiteMessageException - occurs when a site message need to be displayed
      • setMessage

        public static void setMessage​(javax.servlet.http.HttpServletRequest request,
                                      String strMessageKey,
                                      Object[] messageArgs,
                                      int nMessageType)
                               throws SiteMessageException
        Set the message, store it in session and throw a LuteceSiteMessageException
        Parameters:
        request - The HttpRequest
        strMessageKey - The message key
        messageArgs - Message Arguments
        nMessageType - The message type
        Throws:
        SiteMessageException - occurs when a site message need to be displayed
      • setMessage

        public static void setMessage​(javax.servlet.http.HttpServletRequest request,
                                      String strMessageKey,
                                      Object[] messageArgs,
                                      int nMessageType,
                                      String strUrl,
                                      String strTitleKey)
                               throws SiteMessageException
        Set the message, store it in session and throw a LuteceSiteMessageException
        Parameters:
        request - The HttpRequest
        strMessageKey - The message key
        messageArgs - Message arguments
        strTitleKey - The title key
        nMessageType - The message type
        strUrl - The URL
        Throws:
        SiteMessageException - occurs when a site message need to be displayed
      • setMessage

        public static void setMessage​(javax.servlet.http.HttpServletRequest request,
                                      String strMessageKey,
                                      int nMessageType,
                                      String strUrl,
                                      String strTitleKey,
                                      Object[] messageArgs)
                               throws SiteMessageException
        Set the message, store it in session and throw a LuteceSiteMessageException
        Parameters:
        request - The HttpRequest
        strMessageKey - The message key
        messageArgs - Message Arguments
        strUrl - The forward URL
        strTitleKey - The title key
        nMessageType - The message type
        Throws:
        SiteMessageException - occurs when a site message need to be displayed
      • setMessage

        public static void setMessage​(javax.servlet.http.HttpServletRequest request,
                                      String strMessageKey,
                                      Object[] messageArgs,
                                      String strTitleKey,
                                      String strUrl,
                                      String strTarget,
                                      int nMessageType)
                               throws SiteMessageException
        Set the message, store it in session and throw a LuteceSiteMessageException
        Parameters:
        request - The HttpRequest
        strMessageKey - The message key
        messageArgs - Message Arguments
        strTitleKey - The title key
        strUrl - The Url of the Ok button
        strTarget - The url target if not "_self"
        nMessageType - The message type
        Throws:
        SiteMessageException - occurs when a site message need to be displayed
      • setMessage

        public static void setMessage​(javax.servlet.http.HttpServletRequest request,
                                      String strMessageKey,
                                      Object[] messageArgs,
                                      String strTitleKey,
                                      String strUrl,
                                      String strTarget,
                                      int nMessageType,
                                      Map<String,​Object> requestParameters)
                               throws SiteMessageException
        Set the message, store it in session and throw a LuteceSiteMessageException
        Parameters:
        request - The HttpRequest
        strMessageKey - The message key
        messageArgs - Message Arguments
        strTitleKey - The title key
        strUrl - The Url of the Ok button
        strTarget - The url target if not "_self"
        nMessageType - The message type
        requestParameters - The request parameters
        Throws:
        SiteMessageException - occurs when a site message need to be displayed
      • setMessage

        public static void setMessage​(javax.servlet.http.HttpServletRequest request,
                                      String strMessageKey,
                                      Object[] messageArgs,
                                      String strTitleKey,
                                      String strUrl,
                                      String strTarget,
                                      int nMessageType,
                                      Map<String,​Object> requestParameters,
                                      String strBackUrl)
                               throws SiteMessageException
        Set the message, store it in session and throw a LuteceSiteMessageException
        Parameters:
        request - The HttpRequest
        strMessageKey - The message key
        messageArgs - Message Arguments
        strTitleKey - The title key
        strUrl - The Url of the Ok button
        strTarget - The url target if not "_self"
        nMessageType - The message type
        requestParameters - The request parameters
        strBackUrl - The Url of back button
        Throws:
        SiteMessageException - occurs when a site message need to be displayed
      • setCustomMessage

        public static void setCustomMessage​(javax.servlet.http.HttpServletRequest request,
                                            String title,
                                            String text,
                                            String strUrl,
                                            int nMessageType,
                                            String strBackUrl)
                                     throws SiteMessageException
        Set the custom message, store it in session and throw a LuteceSiteMessageException
        Parameters:
        request - The HttpRequest
        title - The title
        strUrl - The Url of the Ok button
        text - The message
        nMessageType - The message type
        strBackUrl - The Url of back button
        Throws:
        SiteMessageException
      • setCustomMessage

        public static void setCustomMessage​(javax.servlet.http.HttpServletRequest request,
                                            String strText,
                                            int nMessageType)
                                     throws SiteMessageException
        Set the custom message, store it in session and throw a LuteceSiteMessageException
        Parameters:
        request - The HttpRequest
        strText - The message
        nMessageType - The message type
        Throws:
        SiteMessageException
      • setCustomMessage

        public static void setCustomMessage​(javax.servlet.http.HttpServletRequest request,
                                            String strTitle,
                                            String strText,
                                            int nMessageType)
                                     throws SiteMessageException
        Set the custom message, store it in session and throw a LuteceSiteMessageException
        Parameters:
        request - The HttpRequest
        strText - The message
        strTitle - The title
        nMessageType - The message type
        Throws:
        SiteMessageException
      • getMessage

        public static SiteMessage getMessage​(javax.servlet.http.HttpServletRequest request)
        Returns the message associated to the current request
        Parameters:
        request - The HttpRequest
        Returns:
        The message associated to the current request
      • cleanMessageSession

        public static void cleanMessageSession​(javax.servlet.http.HttpServletRequest request)
        Delete the message in session
        Parameters:
        request - The HTTP request
      • setSiteMessageUrl

        public static String setSiteMessageUrl​(String strRequestUrl)
        Set the site message url with parameters if necessary
        Parameters:
        strRequestUrl - The Request url
        Returns:
        The message url