Package com.easydesk.notification.util
Class NotificationContext
- All Implemented Interfaces:
NotificationConstants,Serializable,Cloneable,Map<String,Object>
Notification 템플릿(Thymeleaf)에 전달할 "변수 바구니" 이다.
예전에는 Fulcrum Template Service 의 DefaultTemplateContext(Velocity context 의 래퍼)를 상속했지만,
Spring + Thymeleaf 로 전환하면서 평범한 HashMap 으로 바꾸었다. 이 map 의 key/value 는
NotificationRenderer 가 그대로 Thymeleaf org.thymeleaf.context.Context 의 변수로
복사하므로, 템플릿 안에서는 ${item}, ${module}, ${user}, ${link} 처럼
key 이름 그대로 접근한다. (key 상수는 NotificationConstants 참고)
- Version:
- $Id: NotificationContext.java,v 1.6 2008/08/07 07:44:22 youngho Exp $
- Author:
- Youncho Cho
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
Fields inherited from interface com.easydesk.notification.NotificationConstants
ACTIVITIES, ACTIVITY_SET, DEFAULT_TEXT, DEFAULT_TEXT_KEY, FORMAT_TOOL, FRIST_STATUS, GLOBAL_TOOL, HIDE_MESSAGE_INFO, ITEM, ITEM_TYPE_NAME, LINK, LOCALE, LOCALIZATION_TOOL, MATH_TOOL, MODEL, MODULE, MODULE_NAME, NO_REPLY_TO_ADDRESS, NOTIFICATION_TYPE, NUMBER_TOOL, RENDERER, STATIC_LINK, USER -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty NotificationContext object.NotificationContext(Item item) Creates a new NotificationContext object.NotificationContext(Item item, User receiver) Creates a new NotificationContext object. -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidsetDefaultTextKey(String defaultTextKey) voidAction 이나 Screens 에서 직접 만들 때voidMethods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Constructor Details
-
NotificationContext
public NotificationContext()Creates an empty NotificationContext object. -
NotificationContext
Creates a new NotificationContext object.- Parameters:
item- 통지 대상 item. item 과 item 의 module 이 context 에 설정된다.- Throws:
Exception
-
NotificationContext
Creates a new NotificationContext object.- Parameters:
item- 통지 대상 itemreceiver- 수신자- Throws:
Exception
-
-
Method Details
-
setUser
- Parameters:
receiver- 수신자
-
setDefaultTextKey
- Parameters:
defaultTextKey- 기본 text key
-
setInProcess
public void setInProcess()Action 이나 Screens 에서 직접 만들 때 -
isInProcess
public boolean isInProcess()- Returns:
- 실시간 처리 여부
-