Package mc.core.domain.system.dobj
Class NotificationDO
java.lang.Object
mc.core.system.base.BaseBean
- All Implemented Interfaces:
IBaseDO<Notification>
-
Nested Class Summary
Nested classes/interfaces inherited from class mc.core.domain.base.dobj.AbstractBaseDO
AbstractBaseDO.Initializer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionmc.core.system.search.SearchFilterbuildFilterGetPersonalNotificationsForUser(User user, Boolean readFlag) voiddelete(Notification notification, boolean force) NOTE: when overriding this method and you delete any other objects you need to call validateNotUsed before in case flag force is false!voiddelete(Notification notification, User user) Removes Notification of User from database:
case 1: message board notification --> delete only if user is root or sender of this notification
case 2: if receiver list contains only this user --> delete notification,
else remove only notification receiver for userstatic String[]formatDate(String[] args, Locale keyLocale) getForMessageBoard(String boardType) getNotificationMaxLevel(Notification notification) mc.core.system.util.misc.StringMapgetPage(List<Notification> notifications, int pageSize, int page) helper for pseudo paging of complete listintgetPageCount(List<Notification> notifications, int pageSize) helper for pseudo paging of complete listget at least needed user base role for the entity classbooleanisMessageBoardNotification(Notification notification) check whether this is a message board or private notificationsave(Notification notification, DataMap dataMap) map data to entity if any, validate and savesend(Notification notification) Inserts given Notification in database.Methods inherited from class mc.core.domain.base.dobj.AbstractBaseDO
addDefaultSearchCriteria, copy, delete, getAll, getAllActive, getEntityDisplay, getFromId, getFromKey, getOne, map, map, prepareSearchFilter, save, validator
-
Constructor Details
-
NotificationDO
public NotificationDO()
-
-
Method Details
-
getUserRole
Description copied from interface:IBaseDOget at least needed user base role for the entity class- Specified by:
getUserRolein interfaceIBaseDO<Notification>- Overrides:
getUserRolein classAbstractBaseDO<Notification>
-
save
public Notification save(Notification notification, DataMap dataMap) throws ApplicationException, UserException Description copied from interface:IBaseDOmap data to entity if any, validate and save- Specified by:
savein interfaceIBaseDO<Notification>- Overrides:
savein classAbstractBaseDO<Notification>- Parameters:
notification- mandatorydataMap- optional- Returns:
- mapped entity
- Throws:
ApplicationExceptionUserException
-
delete
Description copied from class:AbstractBaseDONOTE: when overriding this method and you delete any other objects you need to call validateNotUsed before in case flag force is false!- Overrides:
deletein classAbstractBaseDO<Notification>- Parameters:
notification- mandatoryforce- ignored, references are deleted in any case
-
delete
Removes Notification of User from database:
case 1: message board notification --> delete only if user is root or sender of this notification
case 2: if receiver list contains only this user --> delete notification,
else remove only notification receiver for user- Parameters:
notification- mandatoryuser- mandatory- Throws:
ApplicationException
-
buildFilterGetPersonalNotificationsForUser
-
getForMessageBoard
- Parameters:
boardType- optional, get for all boards if not set- Returns:
- all message board notification without paging, allowed by current user
-
getPageCount
helper for pseudo paging of complete list -
getPage
helper for pseudo paging of complete list -
isMessageBoardNotification
check whether this is a message board or private notification -
getNotificationTypes
public mc.core.system.util.misc.StringMap getNotificationTypes() -
send
Inserts given Notification in database. It will be visible to all its receivers. If no sender is set sets service user JOBUSER as sender. If mail notification enabled by SystemProperty sends an email to each receiver if the receiver is a User, not a UserGroup.- Parameters:
notification- mandatory, must have at least one receiver if not for message board- Throws:
ApplicationException
-
getNotificationMaxLevel
-
formatDate
-