Class SystemMessage

java.lang.Object
de.xima.cmn.dao.model.AEntity<Long>
All Implemented Interfaces:
de.xima.cmn.dao.interfaces.IEntity<Long>, de.xima.cmn.dao.interfaces.ILockableEntity<Long>, IDescriptionProviding, ILockingVersionProviding, INameProviding, ITransferable, ITransferableEntity, ITransferableLockableEntity, IUUIDEntity, Serializable, Comparable<de.xima.cmn.dao.interfaces.IEntity<Long>>

@Entity public class SystemMessage extends AbstractLockableEntity implements IUUIDEntity, INameProviding, IDescriptionProviding
Entity for system messages. System messages can be configured arbitrarily by users or administrators and are shown on the dashboard.
Author:
XIMA MEDIA GmbH
See Also:
  • Field Details

  • Constructor Details

    • SystemMessage

      public SystemMessage()
  • Method Details

    • getId

      public Long getId()
      Specified by:
      getId in interface de.xima.cmn.dao.interfaces.IEntity<Long>
    • setId

      public void setId(Long id)
      Description copied from class: AbstractEntity
      !!!WARNING: Currently values bigger Integer.MAX_VALUE or lower then Integer.MIN_VALUE will be altered to null!!!
      Specified by:
      setId in interface de.xima.cmn.dao.interfaces.IEntity<Long>
      Overrides:
      setId in class AbstractEntity
      Parameters:
      id - Long the database-id to set
    • getBeschreibung

      public String getBeschreibung()
      Specified by:
      getBeschreibung in interface IDescriptionProviding
      Returns:
      An internal description or comment that is shown in the backend.
    • getDateCreated

      public Date getDateCreated()
      Returns:
      The date when this entity was created.
    • getDateEdited

      public Date getDateEdited()
      Returns:
      The date of the most recent edit of this entity.
    • getDateEnd

      public Date getDateEnd()
      Returns:
      The latest date when this message is shown.
    • getDateStart

      public Date getDateStart()
      Returns:
      The earliest date when this message is shown.
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface IDescriptionProviding
      Returns:
      A human-readable description for this object.
    • getIcon

      public String getIcon()
      Returns:
      An icon that is shown for this message. This is currently the ID of an icon from the formcycle custom font, eg. ico-fc-lan-connect.
    • getIconColor

      public String getIconColor()
      Returns:
      The color of the icon. Must be a valid CSS color property value, eg. #333 or rgb(20, 80, 42).
    • getMessage

      public String getMessage()
      Returns:
      The main message that is shown on screen.
    • getName

      public String getName()
      Specified by:
      getName in interface INameProviding
      Returns:
      The title (heading, subject) of this message.
    • getUserCreator

      public IUser getUserCreator()
      Returns:
      The user who created this entity.
    • getUserEditor

      public IUser getUserEditor()
      Returns:
      The user who made the most recent edit to this entity.
    • getUserNameCreator

      public String getUserNameCreator()
      Returns:
      The name of the user that created this entity. If the user changed their username afterwards, this value will not change.
    • getUserNameEditor

      public String getUserNameEditor()
      Returns:
      The name of the user that made the last change to this entity. If the user changed their username afterwards, this value will not change.
    • getUserRefCreator

      public String getUserRefCreator()
      Returns:
      A reference to the user who created this entity.
    • getUserRefEditor

      public String getUserRefEditor()
      Returns:
      A reference to the user who made the last change to this entity.
    • getUUID

      public String getUUID()
      Specified by:
      getUUID in interface IUUIDEntity
      Returns:
      UUID (Universal Unique Identifier) that identifies this type of entity. Usually is unique within a context, e.g. Mandant, Projekt, ...
    • getUUIDObject

      public UUID getUUIDObject()
      Specified by:
      getUUIDObject in interface IUUIDEntity
    • isFlagActive

      public boolean isFlagActive()
      Returns:
      Whether this message is currently active, ie. shown to users.
    • setBeschreibung

      @Deprecated public void setBeschreibung(String beschreibung)
      Deprecated.
    • setDateCreated

      public void setDateCreated(Date dateCreated)
    • setDateEdited

      public void setDateEdited(Date dateEdited)
    • setDateEnd

      public void setDateEnd(Date dateEnd)
    • setDateStart

      public void setDateStart(Date start)
    • setDescription

      public void setDescription(String description)
    • setFlagActive

      public void setFlagActive(boolean flagActive)
    • setIcon

      public void setIcon(String icon)
    • setIconColor

      public void setIconColor(String iconColor)
    • setMessage

      public void setMessage(String message)
    • setName

      public void setName(String title)
    • setUserCreator

      public void setUserCreator(IUser userCreator)
    • setUserEditor

      public void setUserEditor(IUser userEditor)
    • setUserNameCreator

      public void setUserNameCreator(String userNameCreator)
    • setUserNameEditor

      public void setUserNameEditor(String userNameEditor)
    • setUserRefCreator

      public void setUserRefCreator(String userRefCreator)
    • setUserRefEditor

      public void setUserRefEditor(String userRefEditor)
    • setUUID

      public void setUUID(String uuid)
      Specified by:
      setUUID in interface IUUIDEntity
    • setUUIDObject

      public void setUUIDObject(UUID uuid)
    • getI18nValues

      public Map<String,SystemMessageI18n> getI18nValues()
    • setI18nValues

      public void setI18nValues(Map<String,SystemMessageI18n> i18nValues)
    • isAvailableFor

      public boolean isAvailableFor(Locale locale)
      Parameters:
      locale - The language to check.
      Returns:
      Whether this message is available (should be displayed) for the given language.
      See Also:
    • isAvailableFor

      public boolean isAvailableFor(ELanguage language)
      Parameters:
      language - The language to check.
      Returns:
      Whether this message is available (should be displayed) for the given language.
      See Also:
    • isAvailableFor

      public boolean isAvailableFor(Date date)
      Parameters:
      date - Date to check. If null, take the current date.
      Returns:
      Whether this message is available (should be displayed) at the given date. This means that the message must be set to active, and the given date must be between the start and end date (inclusive). If not start or end date is set, no lower or upper limit is applied, respectively.
    • isHasI18nVersion

      public boolean isHasI18nVersion(Locale locale)
      Parameters:
      locale - Locale to check.
      Returns:
      true iff a #SystemMessageI18n exists for the given language.
      See Also:
    • isHasI18nVersion

      public boolean isHasI18nVersion(ELanguage language)
      Parameters:
      language - Language locale to check.
      Returns:
      true iff a #SystemMessageI18n exists for the given language.
      See Also:
    • getI18n

      public SystemMessageI18n getI18n(Locale locale)
      Parameters:
      locale - The desired language locale.
      Returns:
      The #SystemMessageI18n for the given language. If none is available, a new #SystemMessageI18n with the default values.
    • getI18n

      public SystemMessageI18n getI18n(ELanguage language)
      Parameters:
      language - The desired language.
      Returns:
      The #SystemMessageI18n for the given language. If none is available, a new #SystemMessageI18n with the default values.
    • getI18nName

      public String getI18nName(Locale locale)
      Parameters:
      locale - The desired language locale.
      Returns:
      The getName() of this message, for the given language. Resolves according to #SystemMessageI18n.getI18nSource(). If no translation could be determined, returns the empty string.
    • getI18nMessage

      public String getI18nMessage(Locale locale)
      Parameters:
      locale - The desired language locale.
      Returns:
      The getName() of this message, for the given language. Resolves according to #SystemMessageI18n.getI18nSource(). If no translation could be determined, returns the empty string.
    • getI18nName

      public String getI18nName(ELanguage language)
      Parameters:
      language - The desired language.
      Returns:
      The getName() of this message, for the given language. Resolves according to #SystemMessageI18n.getI18nSource(). If no translation could be determined, returns the empty string.
    • getI18nMessage

      public String getI18nMessage(ELanguage language)
      Parameters:
      language - The desired language.
      Returns:
      The getName() of this message, for the given language. Resolves according to #SystemMessageI18n.getI18nSource(). If no translation could be determined, returns the empty string.