Class Alert

All Implemented Interfaces:
DBConstants, DBData, JcmsConstants, ImportConstants, MashupConstants, RelatedData<Data>, Storable, JaliosConstants, LangPropertyArgument, Serializable, Cloneable, Comparable<BasicStorable>

public class Alert extends Data implements DBData, RelatedData<Data>, DBConstants
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • getFullName

      public String getFullName()
      Returns the full name of the alert (domain + name).
      Returns:
      the full name of the alert (domain + name).
      Since:
      jcms-8.0.0
    • hasMessage

      public boolean hasMessage()
      Returns true if a message is attached to this alert.
      Returns:
      true if a message is attached to this alert.
      Since:
      jcms-8.0.0
    • checkIntegrity

      public ControllerStatus checkIntegrity()
      Description copied from class: Data
      Checks whether or not data integrity constraints are respected.
      Overrides:
      checkIntegrity in class Data
      Returns:
      a ControllerStatus
    • matches

      public boolean matches(AlertRule rule)
      Returns true if this alert matches the given rule.
      Parameters:
      rule - the rule
      Returns:
      true if this alert matches the given rule.
      Since:
      jcms-8.0.0
    • setAuthorId

      public void setAuthorId(String authordId)
      Description copied from class: Data
      Sets the JStore ID of the author (only for DBData).

      If the specified authorId is an invalid ID (non existing Member), the author will be set to the Member specified by property channel.default-author (or left null if this property has not been set).

      Overrides:
      setAuthorId in class Data
      Parameters:
      authordId - the JStore author id
    • getRecipient

      public Member getRecipient()
    • setRecipient

      public void setRecipient(Member recipient)
    • getRecipientId

      public String getRecipientId()
    • setRecipientId

      public void setRecipientId(String v)
    • getLevelValue

      public int getLevelValue()
    • setLevelValue

      public void setLevelValue(int v)
    • getLevel

      public Alert.Level getLevel()
    • setLevel

      public void setLevel(Alert.Level level)
    • getDomain

      public String getDomain()
    • setDomain

      public void setDomain(String domain)
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • getData

      @Deprecated public Data getData()
      Deprecated.
    • setData

      @Deprecated public void setData(Data v)
      Deprecated.
      Change 'data' (and workspace if applyable)
      Parameters:
      v - the data
    • getDataId

      @Deprecated public String getDataId()
      Deprecated.
      Do not call this method. It is reserved for DBData mapping.
      Returns:
      the data ID
    • setDataId

      @Deprecated public void setDataId(String v)
      Deprecated.
      Do not call this method. It is reserved for DBData mapping.
      Parameters:
      v - the data id
    • getTargetData

      public Data getTargetData()
      Specified by:
      getTargetData in interface RelatedData<Data>
    • setTargetData

      public void setTargetData(Data targetData)
      Specified by:
      setTargetData in interface RelatedData<Data>
    • getTargetDataId

      public String getTargetDataId()
      Specified by:
      getTargetDataId in interface RelatedData<Data>
    • setTargetDataId

      public void setTargetDataId(String targetDataId)
      Specified by:
      setTargetDataId in interface RelatedData<Data>
    • getWorkspace

      public Workspace getWorkspace()
    • getWorkspaceId

      public String getWorkspaceId()
      Do not call this method. It is reserved for DBData mapping.
      Returns:
      the workspace ID.
    • setWorkspaceId

      public void setWorkspaceId(String v)
      Do not call this method. It is reserved for DBData mapping.
      Parameters:
      v - The workspace ID.
    • isRead

      public boolean isRead()
    • setRead

      public void setRead(boolean read)
    • getTitle

      public String getTitle()
    • setTitle

      public void setTitle(String title)
    • getDescription

      public String getDescription()
    • setDescription

      public void setDescription(String description)
    • getShortDescription

      public String getShortDescription()
    • setShortDescription

      public void setShortDescription(String shortDescription)
    • getSummary

      public String getSummary()
    • setSummary

      public void setSummary(String summary)
    • getMessage

      public String getMessage()
    • setMessage

      public void setMessage(String message)
    • getMessageMarkup

      public String getMessageMarkup()
    • setMessageMarkup

      public void setMessageMarkup(String messageMarkup)
    • hasExpiration

      public boolean hasExpiration()
      Returns true if the alert has an expiration date.
      Returns:
      true if the alert has an expiration date.
      Since:
      jcms-9.0.0
    • getExpiration

      public Date getExpiration()
    • setExpiration

      public void setExpiration(Date expiration)
    • canBeSaved

      public boolean canBeSaved()
    • setCanBeSaved

      public void setCanBeSaved(boolean canBeSaved)
    • setContext

      public void setContext(Map<String,Object> context)
    • getContext

      public Map<String,Object> getContext()
    • setAttribute

      public String setAttribute(String name, String value)
      Stores an attribute in this Alert.
      If the string passed in is null, the effect is the same as calling removeAttribute(java.lang.String).
      Parameters:
      name - a String specifying the name of the attribute
      value - the String to be stored
      Returns:
      previous value associated with specified name, or null if there was no mapping for name. A null return can also indicate that null was associated with the specified name.
      Since:
      jcms-10.0.4 / JCMS-7932
    • removeAttribute

      public String removeAttribute(String name)
      Removes an attribute from this Alert.
      Parameters:
      name - a String specifying
      Returns:
      previous value associated with specified name, or null if there was no mapping for name. A null return can also indicate that null was associated with the specified name.
      Since:
      jcms-10.0.4 / JCMS-7932
    • getAttribute

      public String getAttribute(String name)
      Returns the value of the named attribute as an String, or null if no attribute of the given name exists.
      Parameters:
      name - a String specifying the name of the attribute
      Returns:
      an String containing the value of the attribute, or null if the attribute does not exist
      Since:
      jcms-10.0.4 / JCMS-7932
    • setAttributeMap

      public void setAttributeMap(Map<String,String> map)
      Set the Map of the attributes of this Alert.
      Parameters:
      map - the new map to use for this Alert, modify with care.
      Since:
      jcms-10.0.4 / JCMS-7932
    • getAttributeMap

      public Map<String,String> getAttributeMap()
      Returns a java.util.Map of the attributes of this Alert.
      Returns:
      the internal Map used by this Alert, modify with care.
      Since:
      jcms-10.0.4 / JCMS-7932
    • getAttributeMapStr

      public String getAttributeMapStr()
      Returns a JSON representation of the attribute map of this Alert.
      Returns:
      a JSON representation of the attribute map
      Since:
      jcms-10.0.4 / JCMS-7932
    • getScore

      public int getScore()
    • setScore

      public void setScore(Integer v)
    • setAttributeMapStr

      public void setAttributeMapStr(String json)
      Set the attribute map of this Alert, from the specified JSON representation.
      Parameters:
      json - a JSON representation of the attribute map
      Since:
      jcms-10.0.4 / JCMS-7932
    • getColorLevel

      public ColorLevel getColorLevel()
      Returns the ColorLevel for this Alert
      Returns:
      the Alert ColorLevel
      Since:
      jcms-11.0.0
    • exportXmlField

      public void exportXmlField(StringBuffer sb, int indentLevel)
      Description copied from class: Data
      Fills the given StringBuffer with Xml export of fields of this data.
      Overrides:
      exportXmlField in class Data
      Parameters:
      sb - the StringBuffer
      indentLevel - the indent level
    • toString

      public String toString()
      Overrides:
      toString in class Data