Package org.javlo.message
Class MessageRepository
- java.lang.Object
-
- org.javlo.message.MessageRepository
-
public class MessageRepository extends Object
contain the list of message.- Author:
- pvandermaesen
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMessage(GenericMessage msg)voidclearGlobalMessage()StringforwardMessage(String url)forward the main globalMessage to the next request (for forwarding).GenericMessagegetGlobalMessage()I18nMessagegetI18nMessage(String key)static MessageRepositorygetInstance(javax.servlet.http.HttpServletRequest request)static MessageRepositorygetInstance(ContentContext inCtx)GenericMessagegetMessage(String key)StringgetParameterName()StringgetRawGlobalMessage()booleanhaveImportantMessage()booleanhaveMessages()Collection<GenericMessage>outAllMessages()voidsetGlobalMessage(GenericMessage globalMessage)set a new global message. if the type of the current message is more important or equal the new message is ignored.voidsetGlobalMessageAndNotification(ContentContext ctx, GenericMessage globalMessage)voidsetGlobalMessageAndNotification(ContentContext ctx, GenericMessage globalMessage, boolean admin)set a new global message. if the type of the current message is more important or equal the new message is ignored.voidsetGlobalMessageAndNotificationToAll(ContentContext ctx, GenericMessage globalMessage, boolean admin)set a new global message. if the type of the current message is more important or equal the new message is ignored.voidsetGlobalMessageForced(GenericMessage globalMessage)set a new global message. if the type of the current message is more important or equal the new message is ignored.
-
-
-
Field Detail
-
KEY
public static final String KEY
- See Also:
- Constant Field Values
-
logger
protected static Logger logger
create a static logger.
-
-
Method Detail
-
getInstance
public static final MessageRepository getInstance(ContentContext inCtx)
-
getInstance
public static final MessageRepository getInstance(javax.servlet.http.HttpServletRequest request)
-
forwardMessage
public String forwardMessage(String url)
forward the main globalMessage to the next request (for forwarding).- Parameters:
url- a url to page- Returns:
- the same url with globalmessage as parameter
-
getRawGlobalMessage
public String getRawGlobalMessage()
-
getParameterName
public String getParameterName()
-
addMessage
public void addMessage(GenericMessage msg)
-
outAllMessages
public Collection<GenericMessage> outAllMessages()
-
getMessage
public GenericMessage getMessage(String key)
-
getI18nMessage
public I18nMessage getI18nMessage(String key) throws FileNotFoundException, IOException
- Throws:
FileNotFoundExceptionIOException
-
getGlobalMessage
public GenericMessage getGlobalMessage()
-
setGlobalMessage
public void setGlobalMessage(GenericMessage globalMessage)
set a new global message. if the type of the current message is more important or equal the new message is ignored.- Parameters:
globalMessage- a global message
-
setGlobalMessageForced
public void setGlobalMessageForced(GenericMessage globalMessage)
set a new global message. if the type of the current message is more important or equal the new message is ignored.- Parameters:
globalMessage- a global message
-
setGlobalMessageAndNotificationToAll
public void setGlobalMessageAndNotificationToAll(ContentContext ctx, GenericMessage globalMessage, boolean admin)
set a new global message. if the type of the current message is more important or equal the new message is ignored.- Parameters:
globalMessage- a global message
-
setGlobalMessageAndNotification
public void setGlobalMessageAndNotification(ContentContext ctx, GenericMessage globalMessage)
-
setGlobalMessageAndNotification
public void setGlobalMessageAndNotification(ContentContext ctx, GenericMessage globalMessage, boolean admin)
set a new global message. if the type of the current message is more important or equal the new message is ignored.- Parameters:
globalMessage- a global message
-
clearGlobalMessage
public void clearGlobalMessage()
-
haveMessages
public boolean haveMessages()
-
haveImportantMessage
public boolean haveImportantMessage()
-
-