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 void
addMessage(GenericMessage msg)
void
clearGlobalMessage()
String
forwardMessage(String url)
forward the main globalMessage to the next request (for forwarding).GenericMessage
getGlobalMessage()
I18nMessage
getI18nMessage(String key)
static MessageRepository
getInstance(javax.servlet.http.HttpServletRequest request)
static MessageRepository
getInstance(ContentContext inCtx)
GenericMessage
getMessage(String key)
String
getParameterName()
String
getRawGlobalMessage()
boolean
haveImportantMessage()
boolean
haveMessages()
Collection<GenericMessage>
outAllMessages()
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.void
setGlobalMessageAndNotification(ContentContext ctx, GenericMessage globalMessage)
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.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.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.
-
-
-
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:
FileNotFoundException
IOException
-
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()
-
-