Package de.xima.fc.entities
Class SystemMessage
- java.lang.Object
-
- de.xima.cmn.dao.model.AEntity<Long>
-
- de.xima.fc.entities.AbstractEntity
-
- de.xima.fc.entities.AbstractLockableEntity
-
- de.xima.fc.entities.SystemMessage
-
- 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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTR_DATE_CREATED
static String
ATTR_DATE_EDITED
static String
ATTR_DATE_END
static String
ATTR_DATE_START
static String
ATTR_FLAG_ACTIVE
static String
ATTR_I18N_VALUES
static String
ATTR_ICON
static String
ATTR_ICON_COLOR
static String
ATTR_MESSAGE
static String
ATTR_USER_NAME_CREATOR
static String
ATTR_USER_NAME_EDITOR
static String
ATTR_USER_REF_CREATOR
static String
ATTR_USER_REF_EDITOR
static String
COL_UUID
-
Fields inherited from class de.xima.fc.entities.AbstractLockableEntity
COL_LOCKINGVERSION, lockingVersion
-
Fields inherited from class de.xima.fc.entities.AbstractEntity
COL_ID, id
-
Fields inherited from interface de.xima.fc.entities.interfaces.IDescriptionProviding
ATTR_BESCHREIBUNG, ATTR_DESCRIPTION, COL_DESCRIPTION
-
Fields inherited from interface de.xima.fc.entities.interfaces.INameProviding
ATTR_NAME, COL_NAME
-
Fields inherited from interface de.xima.fc.entities.interfaces.ITransferableEntity
IMPORT_ID, INVALID_ID
-
Fields inherited from interface de.xima.fc.entities.interfaces.IUUIDEntity
ATTR_UUID, INVALID_UUID, INVALID_UUID_OBJECT, NULL_SAFE_UUID_TYPE, TYPE_NAME_UUID
-
-
Constructor Summary
Constructors Constructor Description SystemMessage()
-
Method Summary
-
Methods inherited from class de.xima.fc.entities.AbstractLockableEntity
entityHasChanged, getLockingVersion, setLockingVersion, toString
-
Methods inherited from class de.xima.fc.entities.AbstractEntity
asIntValue, isPersisted, setId
-
Methods inherited from class de.xima.cmn.dao.model.AEntity
compareTo, equals, getDBTableName, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Field Detail
-
ATTR_DATE_CREATED
public static final String ATTR_DATE_CREATED
- See Also:
- Constant Field Values
-
ATTR_DATE_EDITED
public static final String ATTR_DATE_EDITED
- See Also:
- Constant Field Values
-
ATTR_DATE_END
public static final String ATTR_DATE_END
- See Also:
- Constant Field Values
-
ATTR_DATE_START
public static final String ATTR_DATE_START
- See Also:
- Constant Field Values
-
ATTR_I18N_VALUES
public static final String ATTR_I18N_VALUES
- See Also:
- Constant Field Values
-
ATTR_ICON
public static final String ATTR_ICON
- See Also:
- Constant Field Values
-
ATTR_ICON_COLOR
public static final String ATTR_ICON_COLOR
- See Also:
- Constant Field Values
-
ATTR_FLAG_ACTIVE
public static final String ATTR_FLAG_ACTIVE
- See Also:
- Constant Field Values
-
ATTR_MESSAGE
public static final String ATTR_MESSAGE
- See Also:
- Constant Field Values
-
ATTR_USER_NAME_CREATOR
public static final String ATTR_USER_NAME_CREATOR
- See Also:
- Constant Field Values
-
ATTR_USER_NAME_EDITOR
public static final String ATTR_USER_NAME_EDITOR
- See Also:
- Constant Field Values
-
ATTR_USER_REF_CREATOR
public static final String ATTR_USER_REF_CREATOR
- See Also:
- Constant Field Values
-
ATTR_USER_REF_EDITOR
public static final String ATTR_USER_REF_EDITOR
- See Also:
- Constant Field Values
-
COL_UUID
public static final String COL_UUID
- See Also:
- Constant Field Values
-
-
Method Detail
-
setId
public void setId(Long id)
Description copied from class:AbstractEntity
!!!WARNING: Currently values biggerInteger.MAX_VALUE
or lower thenInteger.MIN_VALUE
will be altered to null!!!- Specified by:
setId
in interfacede.xima.cmn.dao.interfaces.IEntity<Long>
- Overrides:
setId
in classAbstractEntity
- Parameters:
id
-Long
the database-id to set
-
getBeschreibung
public String getBeschreibung()
- Specified by:
getBeschreibung
in interfaceIDescriptionProviding
- 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 interfaceIDescriptionProviding
- 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
orrgb(20, 80, 42)
.
-
getMessage
public String getMessage()
- Returns:
- The main message that is shown on screen.
-
getName
public String getName()
- Specified by:
getName
in interfaceINameProviding
- 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 interfaceIUUIDEntity
- 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 interfaceIUUIDEntity
-
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 interfaceIUUIDEntity
-
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:
isHasI18nVersion(Locale)
-
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:
isHasI18nVersion(ELanguage)
-
isAvailableFor
public boolean isAvailableFor(Date date)
- Parameters:
date
- Date to check. Ifnull
, 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:
isAvailableFor(Locale)
-
isHasI18nVersion
public boolean isHasI18nVersion(ELanguage language)
- Parameters:
language
- Language locale to check.- Returns:
true
iff a #SystemMessageI18n
exists for the given language.- See Also:
isAvailableFor(ELanguage)
-
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.
-
-