Class SiteMessageService


  • public final class SiteMessageService
    extends java.lang.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, java.lang.String strText, int nMessageType)
      Set the custom message, store it in session and throw a LuteceSiteMessageException
      static void setCustomMessage​(javax.servlet.http.HttpServletRequest request, java.lang.String strTitle, java.lang.String strText, int nMessageType)
      Set the custom message, store it in session and throw a LuteceSiteMessageException
      static void setCustomMessage​(javax.servlet.http.HttpServletRequest request, java.lang.String title, java.lang.String text, java.lang.String strUrl, int nMessageType, java.lang.String strBackUrl)
      Set the custom message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, java.lang.String strMessageKey)
      Set the INFO message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, java.lang.String strMessageKey, int nMessageType)
      Set the message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, java.lang.String strMessageKey, int nMessageType, java.lang.String strUrl)
      Set the message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, java.lang.String strMessageKey, int nMessageType, java.lang.String strUrl, java.lang.String strTitleKey, java.lang.Object[] messageArgs)
      Set the message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, java.lang.String strMessageKey, int nMessageType, java.lang.String strUrl, java.util.Map<java.lang.String,​java.lang.Object> requestParameters)
      Set the message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, java.lang.String strMessageKey, java.lang.Object[] messageArgs, int nMessageType)
      Set the message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, java.lang.String strMessageKey, java.lang.Object[] messageArgs, int nMessageType, java.lang.String strUrl, java.lang.String strTitleKey)
      Set the message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, java.lang.String strMessageKey, java.lang.Object[] messageArgs, java.lang.String strTitleKey, int nMessageType)
      Set the message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, java.lang.String strMessageKey, java.lang.Object[] messageArgs, java.lang.String strTitleKey, java.lang.String strUrl, java.lang.String strTarget, int nMessageType)
      Set the message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, java.lang.String strMessageKey, java.lang.Object[] messageArgs, java.lang.String strTitleKey, java.lang.String strUrl, java.lang.String strTarget, int nMessageType, java.util.Map<java.lang.String,​java.lang.Object> requestParameters)
      Set the message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, java.lang.String strMessageKey, java.lang.Object[] messageArgs, java.lang.String strTitleKey, java.lang.String strUrl, java.lang.String strTarget, int nMessageType, java.util.Map<java.lang.String,​java.lang.Object> requestParameters, java.lang.String strBackUrl)
      Set the message, store it in session and throw a LuteceSiteMessageException
      static void setMessage​(javax.servlet.http.HttpServletRequest request, java.lang.String strMessageKey, java.lang.String strTitleKey, int nMessageType)
      Set the message, store it in session and throw a LuteceSiteMessageException
      static java.lang.String setSiteMessageUrl​(java.lang.String strRequestUrl)
      Set the site message url with parameters if necessary
      • Methods inherited from class java.lang.Object

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

      • setMessage

        public static void setMessage​(javax.servlet.http.HttpServletRequest request,
                                      java.lang.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,
                                      java.lang.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,
                                      java.lang.String strMessageKey,
                                      int nMessageType,
                                      java.lang.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,
                                      java.lang.String strMessageKey,
                                      int nMessageType,
                                      java.lang.String strUrl,
                                      java.util.Map<java.lang.String,​java.lang.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,
                                      java.lang.String strMessageKey,
                                      java.lang.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,
                                      java.lang.String strMessageKey,
                                      java.lang.Object[] messageArgs,
                                      java.lang.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,
                                      java.lang.String strMessageKey,
                                      java.lang.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,
                                      java.lang.String strMessageKey,
                                      java.lang.Object[] messageArgs,
                                      int nMessageType,
                                      java.lang.String strUrl,
                                      java.lang.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,
                                      java.lang.String strMessageKey,
                                      int nMessageType,
                                      java.lang.String strUrl,
                                      java.lang.String strTitleKey,
                                      java.lang.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,
                                      java.lang.String strMessageKey,
                                      java.lang.Object[] messageArgs,
                                      java.lang.String strTitleKey,
                                      java.lang.String strUrl,
                                      java.lang.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,
                                      java.lang.String strMessageKey,
                                      java.lang.Object[] messageArgs,
                                      java.lang.String strTitleKey,
                                      java.lang.String strUrl,
                                      java.lang.String strTarget,
                                      int nMessageType,
                                      java.util.Map<java.lang.String,​java.lang.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,
                                      java.lang.String strMessageKey,
                                      java.lang.Object[] messageArgs,
                                      java.lang.String strTitleKey,
                                      java.lang.String strUrl,
                                      java.lang.String strTarget,
                                      int nMessageType,
                                      java.util.Map<java.lang.String,​java.lang.Object> requestParameters,
                                      java.lang.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,
                                            java.lang.String title,
                                            java.lang.String text,
                                            java.lang.String strUrl,
                                            int nMessageType,
                                            java.lang.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,
                                            java.lang.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,
                                            java.lang.String strTitle,
                                            java.lang.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 java.lang.String setSiteMessageUrl​(java.lang.String strRequestUrl)
        Set the site message url with parameters if necessary
        Parameters:
        strRequestUrl - The Request url
        Returns:
        The message url