Class SiteMessageService
java.lang.Object
fr.paris.lutece.portal.service.message.SiteMessageService
This class provides a service that build messages
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcleanMessageSession(javax.servlet.http.HttpServletRequest request) Delete the message in sessionstatic SiteMessagegetMessage(javax.servlet.http.HttpServletRequest request) Returns the message associated to the current requeststatic voidsetCustomMessage(javax.servlet.http.HttpServletRequest request, String strText, int nMessageType) Set the custom message, store it in session and throw a LuteceSiteMessageExceptionstatic voidsetCustomMessage(javax.servlet.http.HttpServletRequest request, String strTitle, String strText, int nMessageType) Set the custom message, store it in session and throw a LuteceSiteMessageExceptionstatic voidsetCustomMessage(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 LuteceSiteMessageExceptionstatic voidsetMessage(javax.servlet.http.HttpServletRequest request, String strMessageKey) Set the INFO message, store it in session and throw a LuteceSiteMessageExceptionstatic voidsetMessage(javax.servlet.http.HttpServletRequest request, String strMessageKey, int nMessageType) Set the message, store it in session and throw a LuteceSiteMessageExceptionstatic voidsetMessage(javax.servlet.http.HttpServletRequest request, String strMessageKey, int nMessageType, String strUrl) Set the message, store it in session and throw a LuteceSiteMessageExceptionstatic voidsetMessage(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 LuteceSiteMessageExceptionstatic voidsetMessage(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 LuteceSiteMessageExceptionstatic voidsetMessage(javax.servlet.http.HttpServletRequest request, String strMessageKey, Object[] messageArgs, int nMessageType) Set the message, store it in session and throw a LuteceSiteMessageExceptionstatic voidsetMessage(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 LuteceSiteMessageExceptionstatic voidsetMessage(javax.servlet.http.HttpServletRequest request, String strMessageKey, Object[] messageArgs, String strTitleKey, int nMessageType) Set the message, store it in session and throw a LuteceSiteMessageExceptionstatic voidsetMessage(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 LuteceSiteMessageExceptionstatic voidsetMessage(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 LuteceSiteMessageExceptionstatic voidsetMessage(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 LuteceSiteMessageExceptionstatic voidsetMessage(javax.servlet.http.HttpServletRequest request, String strMessageKey, String strTitleKey, int nMessageType) Set the message, store it in session and throw a LuteceSiteMessageExceptionstatic StringsetSiteMessageUrl(String strRequestUrl) Set the site message url with parameters if necessary
-
Method Details
-
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 HttpRequeststrMessageKey- 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 HttpRequeststrMessageKey- The message keynMessageType- 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 HttpRequeststrMessageKey- The message keynMessageType- The message typestrUrl- 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 SiteMessageExceptionSet the message, store it in session and throw a LuteceSiteMessageException- Parameters:
request- The HttpRequeststrMessageKey- The message keynMessageType- The message typestrUrl- The url of the Ok buttonrequestParameters- 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 HttpRequeststrMessageKey- The message keystrTitleKey- The title keynMessageType- 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 HttpRequeststrMessageKey- The message keymessageArgs- Message ArgumentsstrTitleKey- The title keynMessageType- 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 HttpRequeststrMessageKey- The message keymessageArgs- Message ArgumentsnMessageType- 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 HttpRequeststrMessageKey- The message keymessageArgs- Message argumentsstrTitleKey- The title keynMessageType- The message typestrUrl- 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 HttpRequeststrMessageKey- The message keymessageArgs- Message ArgumentsstrUrl- The forward URLstrTitleKey- The title keynMessageType- 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 HttpRequeststrMessageKey- The message keymessageArgs- Message ArgumentsstrTitleKey- The title keystrUrl- The Url of the Ok buttonstrTarget- 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 SiteMessageExceptionSet the message, store it in session and throw a LuteceSiteMessageException- Parameters:
request- The HttpRequeststrMessageKey- The message keymessageArgs- Message ArgumentsstrTitleKey- The title keystrUrl- The Url of the Ok buttonstrTarget- The url target if not "_self"nMessageType- The message typerequestParameters- 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 SiteMessageExceptionSet the message, store it in session and throw a LuteceSiteMessageException- Parameters:
request- The HttpRequeststrMessageKey- The message keymessageArgs- Message ArgumentsstrTitleKey- The title keystrUrl- The Url of the Ok buttonstrTarget- The url target if not "_self"nMessageType- The message typerequestParameters- The request parametersstrBackUrl- 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 HttpRequesttitle- The titlestrUrl- The Url of the Ok buttontext- The messagenMessageType- The message typestrBackUrl- 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 HttpRequeststrText- The messagenMessageType- 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 HttpRequeststrText- The messagestrTitle- The titlenMessageType- The message type- Throws:
SiteMessageException
-
getMessage
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
Set the site message url with parameters if necessary- Parameters:
strRequestUrl- The Request url- Returns:
- The message url
-