Class AdminMessageService


  • public final class AdminMessageService
    extends java.lang.Object
    This class provides a service that build messages and deliver the Url to display them
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getFormattedList​(java.util.List<java.lang.String> list, java.util.Locale locale)
      Format a list of item to include in a message
      static java.lang.String getLogoutMessageUrl​(javax.servlet.http.HttpServletRequest request)
      Build the logout message url
      static AdminMessage getMessage​(javax.servlet.http.HttpServletRequest request)
      Returns the message associated to the current request
      static java.lang.String getMessageRelativeUrl()
      Return relative url for the admin message jsp.
      static java.lang.String getMessageUrl​(javax.servlet.http.HttpServletRequest request, java.lang.String strMessageKey)
      Returns the Url that display the given message
      static java.lang.String getMessageUrl​(javax.servlet.http.HttpServletRequest request, java.lang.String strMessageKey, int nMessageType)
      Returns the Url that display the given message
      static java.lang.String getMessageUrl​(javax.servlet.http.HttpServletRequest request, java.lang.String strMessageKey, java.lang.Object[] messageArgs, int nMessageType)
      Returns the Url that display the given message
      static java.lang.String getMessageUrl​(javax.servlet.http.HttpServletRequest request, java.lang.String strMessageKey, java.lang.Object[] messageArgs, java.lang.String strUrl, int nMessageType)
      Returns the Url that display the given message
      static java.lang.String getMessageUrl​(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)
      Returns the Url that display the given message
      static java.lang.String getMessageUrl​(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)
      Returns the Url that display the given message
      static java.lang.String getMessageUrl​(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)
      Returns the Url that display the given message.
      static java.lang.String getMessageUrl​(javax.servlet.http.HttpServletRequest request, java.lang.String strMessageKey, java.lang.String strUrl, int nMessageType)
      Returns the Url that display the given message
      static java.lang.String getMessageUrl​(javax.servlet.http.HttpServletRequest request, java.lang.String strMessageKey, java.lang.String strUrl, int nMessageType, java.util.Map requestParameters)
      Returns the Url that display the given message
      static java.lang.String getMessageUrl​(javax.servlet.http.HttpServletRequest request, java.lang.String strMessageKey, java.lang.String strUrl, java.lang.String strTarget)
      Returns the Url that display the given message
      static java.lang.String getMessageUrl​(javax.servlet.http.HttpServletRequest request, java.lang.String strMessageKey, java.lang.String strUrl, java.lang.String strTarget, int nMessageType)
      Returns the Url that display the given message
      static java.lang.String getMessageUrl​(javax.servlet.http.HttpServletRequest request, java.lang.String strMessageKey, java.util.List<? extends ErrorMessage> errors)
      Returns the Url that display the given message
      static <T> java.lang.String getMessageUrl​(javax.servlet.http.HttpServletRequest request, java.lang.String strMessageKey, java.util.Set<javax.validation.ConstraintViolation<T>> constraintViolations)
      Returns the Url that display the given message
      static boolean isLogoutMessageUrl​(javax.servlet.http.HttpServletRequest request)
      Checks if the message url is the logout message url
      • Methods inherited from class java.lang.Object

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

      • getMessageUrl

        public static java.lang.String getMessageUrl​(javax.servlet.http.HttpServletRequest request,
                                                     java.lang.String strMessageKey)
        Returns the Url that display the given message
        Parameters:
        request - The HttpRequest
        strMessageKey - The message key
        Returns:
        The Url of the JSP that display the message
      • getMessageUrl

        public static java.lang.String getMessageUrl​(javax.servlet.http.HttpServletRequest request,
                                                     java.lang.String strMessageKey,
                                                     int nMessageType)
        Returns the Url that display the given message
        Parameters:
        request - The HttpRequest
        strMessageKey - The message key
        nMessageType - The message type
        Returns:
        The Url of the JSP that display the message
      • getMessageUrl

        public static java.lang.String getMessageUrl​(javax.servlet.http.HttpServletRequest request,
                                                     java.lang.String strMessageKey,
                                                     java.lang.Object[] messageArgs,
                                                     int nMessageType)
        Returns the Url that display the given message
        Parameters:
        messageArgs - Message arguments
        request - The HttpRequest
        strMessageKey - The message key
        nMessageType - The message type
        Returns:
        The Url of the JSP that display the message
      • getMessageUrl

        public static java.lang.String getMessageUrl​(javax.servlet.http.HttpServletRequest request,
                                                     java.lang.String strMessageKey,
                                                     java.lang.String strUrl,
                                                     java.lang.String strTarget)
        Returns the Url that display the given message
        Parameters:
        strTarget - Target
        request - The HttpRequest
        strMessageKey - The message key
        strUrl - The Url of the OK button
        Returns:
        The Url of the JSP that display the message
      • getMessageUrl

        public static java.lang.String getMessageUrl​(javax.servlet.http.HttpServletRequest request,
                                                     java.lang.String strMessageKey,
                                                     java.lang.String strUrl,
                                                     java.lang.String strTarget,
                                                     int nMessageType)
        Returns the Url that display the given message
        Parameters:
        strTarget - The url target if not "_self"
        request - The HttpRequest
        strMessageKey - The message key
        strUrl - The Url of the Ok button
        nMessageType - The message type
        Returns:
        The Url of the JSP that display the message
      • getMessageUrl

        public static java.lang.String getMessageUrl​(javax.servlet.http.HttpServletRequest request,
                                                     java.lang.String strMessageKey,
                                                     java.lang.String strUrl,
                                                     int nMessageType)
        Returns the Url that display the given message
        Parameters:
        request - The HttpRequest
        strMessageKey - The message key
        strUrl - The Url of the Ok button
        nMessageType - The message type
        Returns:
        The Url of the JSP that display the message
      • getMessageUrl

        public static java.lang.String getMessageUrl​(javax.servlet.http.HttpServletRequest request,
                                                     java.lang.String strMessageKey,
                                                     java.lang.String strUrl,
                                                     int nMessageType,
                                                     java.util.Map requestParameters)
        Returns the Url that display the given message
        Parameters:
        request - The HttpRequest
        strMessageKey - The message key
        strUrl - The Url of the Ok button
        nMessageType - The message type
        requestParameters - a collection of parameters
        Returns:
        The Url of the JSP that display the message
      • getMessageUrl

        public static java.lang.String getMessageUrl​(javax.servlet.http.HttpServletRequest request,
                                                     java.lang.String strMessageKey,
                                                     java.lang.Object[] messageArgs,
                                                     java.lang.String strUrl,
                                                     int nMessageType)
        Returns the Url that display the given message
        Parameters:
        messageArgs - Message Arguments
        request - The HttpRequest
        strMessageKey - The message key
        strUrl - The Url of the Ok button
        nMessageType - The message type
        Returns:
        The Url of the JSP that display the message
      • getMessageUrl

        public static java.lang.String getMessageUrl​(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)
        Returns the Url that display the given message
        Parameters:
        messageArgs - Message Arguments
        strTarget - The url target if not "_self"
        strTitleKey - The title key
        nMessageType - The message type
        request - The HttpRequest
        strMessageKey - The message key
        strUrl - The Url of the Ok button
        Returns:
        The Url of the JSP that display the message
      • getMessageUrl

        public static java.lang.String getMessageUrl​(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)
        Returns the Url that display the given message
        Parameters:
        messageArgs - Message Arguments
        strTarget - The url target if not "_self"
        strTitleKey - The title key
        nMessageType - The message type
        request - The HttpRequest
        strMessageKey - The message key
        strUrl - The Url of the Ok button
        requestParameters - a collection of parameters
        Returns:
        The Url of the JSP that display the message
      • getMessageUrl

        public static <T> java.lang.String getMessageUrl​(javax.servlet.http.HttpServletRequest request,
                                                         java.lang.String strMessageKey,
                                                         java.util.Set<javax.validation.ConstraintViolation<T>> constraintViolations)
        Returns the Url that display the given message
        Type Parameters:
        T - The type of the bean that has been validated
        Parameters:
        request - The HTTP request
        strMessageKey - The message key
        constraintViolations - The set of violations
        Returns:
        The Url of the JSP that display the message
      • getMessageUrl

        public static java.lang.String getMessageUrl​(javax.servlet.http.HttpServletRequest request,
                                                     java.lang.String strMessageKey,
                                                     java.util.List<? extends ErrorMessage> errors)
        Returns the Url that display the given message
        Parameters:
        request - The HTTP request
        strMessageKey - The message key
        errors - The set of violations
        Returns:
        The Url of the JSP that display the message
      • getMessageUrl

        public static java.lang.String getMessageUrl​(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)
        Returns the Url that display the given message.
        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 - a collection of parameters
        strBackUrl - the str back url
        Returns:
        The Url of the JSP that display the message
      • getMessage

        public static AdminMessage 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
      • getMessageRelativeUrl

        public static java.lang.String getMessageRelativeUrl()
        Return relative url for the admin message jsp. This method does not generate admin message.
        Returns:
        The relative url
      • getFormattedList

        public static java.lang.String getFormattedList​(java.util.List<java.lang.String> list,
                                                        java.util.Locale locale)
        Format a list of item to include in a message
        Parameters:
        list - The list of item as string
        locale - The current locale
        Returns:
        The formatted list
      • getLogoutMessageUrl

        public static java.lang.String getLogoutMessageUrl​(javax.servlet.http.HttpServletRequest request)
        Build the logout message url
        Parameters:
        request - The HTTP request
        Returns:
        The Url
      • isLogoutMessageUrl

        public static boolean isLogoutMessageUrl​(javax.servlet.http.HttpServletRequest request)
        Checks if the message url is the logout message url
        Parameters:
        request - The HTTP request
        Returns:
        True if the url is the logout message url