Class NotificationDO

java.lang.Object
mc.core.system.base.BaseBean
mc.core.domain.base.dobj.AbstractBaseDO<Notification>
mc.core.domain.system.dobj.NotificationDO
All Implemented Interfaces:
IBaseDO<Notification>

public class NotificationDO extends AbstractBaseDO<Notification>
  • Constructor Details

    • NotificationDO

      public NotificationDO()
  • Method Details

    • getUserRole

      public User.UserBaseRole getUserRole()
      Description copied from interface: IBaseDO
      get at least needed user base role for the entity class
      Specified by:
      getUserRole in interface IBaseDO<Notification>
      Overrides:
      getUserRole in class AbstractBaseDO<Notification>
    • save

      public Notification save(Notification notification, DataMap dataMap) throws ApplicationException, UserException
      Description copied from interface: IBaseDO
      map data to entity if any, validate and save
      Specified by:
      save in interface IBaseDO<Notification>
      Overrides:
      save in class AbstractBaseDO<Notification>
      Parameters:
      notification - mandatory
      dataMap - optional
      Returns:
      mapped entity
      Throws:
      ApplicationException
      UserException
    • delete

      public void delete(Notification notification, boolean force)
      Description copied from class: AbstractBaseDO
      NOTE: when overriding this method and you delete any other objects you need to call validateNotUsed before in case flag force is false!
      Overrides:
      delete in class AbstractBaseDO<Notification>
      Parameters:
      notification - mandatory
      force - ignored, references are deleted in any case
    • delete

      public void delete(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 user
      Parameters:
      notification - mandatory
      user - mandatory
      Throws:
      ApplicationException
    • buildFilterGetPersonalNotificationsForUser

      public mc.core.system.search.SearchFilter buildFilterGetPersonalNotificationsForUser(User user, Boolean readFlag)
    • getForMessageBoard

      public List<Notification> getForMessageBoard(String boardType)
      Parameters:
      boardType - optional, get for all boards if not set
      Returns:
      all message board notification without paging, allowed by current user
    • getPageCount

      public int getPageCount(List<Notification> notifications, int pageSize)
      helper for pseudo paging of complete list
    • getPage

      public List<Notification> getPage(List<Notification> notifications, int pageSize, int page)
      helper for pseudo paging of complete list
    • isMessageBoardNotification

      public boolean isMessageBoardNotification(Notification notification)
      check whether this is a message board or private notification
    • getNotificationTypes

      public mc.core.system.util.misc.StringMap getNotificationTypes()
    • send

      public Notification send(Notification notification) throws ApplicationException
      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

      public ReportItem.ReportItemLevel getNotificationMaxLevel(Notification notification)
    • formatDate

      public static String[] formatDate(String[] args, Locale keyLocale)