Class Alert

    • Field Detail

      • LEVEL_PREFIX_PROP

        public static final java.lang.String LEVEL_PREFIX_PROP
        See Also:
        Constant Field Values
      • SHORT_DESCRIPTION_MAXSIZE

        public static final int SHORT_DESCRIPTION_MAXSIZE
        See Also:
        Constant Field Values
      • RECIPIEND_ID_FIELD

        public static final java.lang.String RECIPIEND_ID_FIELD
        See Also:
        Constant Field Values
      • WORKSPACE_ID_FIELD

        public static final java.lang.String WORKSPACE_ID_FIELD
        See Also:
        Constant Field Values
      • EXPIRATION_FIELD

        public static final java.lang.String EXPIRATION_FIELD
        See Also:
        Constant Field Values
      • ATTRIBUTE_MAP_STR_FIELD

        public static final java.lang.String ATTRIBUTE_MAP_STR_FIELD
        See Also:
        Constant Field Values
      • HIBERNATE_MAPPING_RECIPIENT_ID

        public static final int HIBERNATE_MAPPING_RECIPIENT_ID
        See Also:
        Constant Field Values
      • HIBERNATE_MAPPING_LEVEL_VALUE

        public static final int HIBERNATE_MAPPING_LEVEL_VALUE
        See Also:
        Constant Field Values
      • HIBERNATE_MAPPING_DOMAIN

        public static final int HIBERNATE_MAPPING_DOMAIN
        See Also:
        Constant Field Values
      • HIBERNATE_MAPPING_DATA_ID

        public static final int HIBERNATE_MAPPING_DATA_ID
        See Also:
        Constant Field Values
      • HIBERNATE_MAPPING_TITLE

        public static final int HIBERNATE_MAPPING_TITLE
        See Also:
        Constant Field Values
      • HIBERNATE_MAPPING_DESCRIPTION

        public static final int HIBERNATE_MAPPING_DESCRIPTION
        See Also:
        Constant Field Values
      • HIBERNATE_MAPPING_SHORT_DESCRIPTION

        public static final int HIBERNATE_MAPPING_SHORT_DESCRIPTION
        See Also:
        Constant Field Values
      • HIBERNATE_MAPPING_SUMMARY

        public static final int HIBERNATE_MAPPING_SUMMARY
        See Also:
        Constant Field Values
      • HIBERNATE_MAPPING_MESSAGE

        public static final int HIBERNATE_MAPPING_MESSAGE
        See Also:
        Constant Field Values
      • HIBERNATE_MAPPING_MESSAGE_MARKUP

        public static final int HIBERNATE_MAPPING_MESSAGE_MARKUP
        See Also:
        Constant Field Values
      • HIBERNATE_MAPPING_EXPIRATION

        public static final int HIBERNATE_MAPPING_EXPIRATION
        See Also:
        Constant Field Values
      • HIBERNATE_MAPPING_WORKSPACE_ID

        public static final int HIBERNATE_MAPPING_WORKSPACE_ID
        See Also:
        Constant Field Values
      • HIBERNATE_MAPPING_ATTRIBUTE_MAP_STR

        public static final int HIBERNATE_MAPPING_ATTRIBUTE_MAP_STR
        See Also:
        Constant Field Values
      • dataId

        protected transient java.lang.String dataId
      • data

        protected transient Data data
      • workspaceId

        protected transient java.lang.String workspaceId
      • workspace

        protected transient Workspace workspace
      • recipient

        protected Member recipient
      • domain

        protected java.lang.String domain
      • name

        protected java.lang.String name
      • title

        protected java.lang.String title
      • description

        protected java.lang.String description
      • shortDescription

        protected java.lang.String shortDescription
      • summary

        protected java.lang.String summary
      • message

        protected java.lang.String message
      • messageMarkup

        protected java.lang.String messageMarkup
      • read

        protected boolean read
      • expiration

        protected java.util.Date expiration
    • Constructor Detail

      • Alert

        public Alert()
      • Alert

        public Alert​(Alert.Level level,
                     java.lang.String domain,
                     java.lang.String name,
                     Member recipient,
                     Data data,
                     Member author)
    • Method Detail

      • getFullName

        public java.lang.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​(java.lang.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 java.lang.String getRecipientId()
      • setRecipientId

        public void setRecipientId​(java.lang.String v)
      • getLevelValue

        public int getLevelValue()
      • setLevelValue

        public void setLevelValue​(int v)
      • setLevel

        public void setLevel​(Alert.Level level)
      • getDomain

        public java.lang.String getDomain()
      • setDomain

        public void setDomain​(java.lang.String domain)
      • getName

        public java.lang.String getName()
      • setName

        public void setName​(java.lang.String name)
      • getData

        public Data getData()
      • setData

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

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

        public void setDataId​(java.lang.String v)
        Do not call this method. It is reserved for DBData mapping.
        Parameters:
        v - the data id
      • getWorkspace

        public Workspace getWorkspace()
      • getWorkspaceId

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

        public void setWorkspaceId​(java.lang.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 java.lang.String getTitle()
      • setTitle

        public void setTitle​(java.lang.String title)
      • getDescription

        public java.lang.String getDescription()
      • setDescription

        public void setDescription​(java.lang.String description)
      • getShortDescription

        public java.lang.String getShortDescription()
      • setShortDescription

        public void setShortDescription​(java.lang.String shortDescription)
      • getSummary

        public java.lang.String getSummary()
      • setSummary

        public void setSummary​(java.lang.String summary)
      • getMessage

        public java.lang.String getMessage()
      • setMessage

        public void setMessage​(java.lang.String message)
      • getMessageMarkup

        public java.lang.String getMessageMarkup()
      • setMessageMarkup

        public void setMessageMarkup​(java.lang.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 java.util.Date getExpiration()
      • setExpiration

        public void setExpiration​(java.util.Date expiration)
      • canBeSaved

        public boolean canBeSaved()
      • setCanBeSaved

        public void setCanBeSaved​(boolean canBeSaved)
      • setContext

        public void setContext​(java.util.Map<java.lang.String,​java.lang.Object> context)
      • getContext

        public java.util.Map<java.lang.String,​java.lang.Object> getContext()
      • setAttribute

        public java.lang.String setAttribute​(java.lang.String name,
                                             java.lang.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 java.lang.String removeAttribute​(java.lang.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 java.lang.String getAttribute​(java.lang.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​(java.util.Map<java.lang.String,​java.lang.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 java.util.Map<java.lang.String,​java.lang.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 java.lang.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
      • setAttributeMapStr

        public void setAttributeMapStr​(java.lang.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
      • exportXmlField

        public void exportXmlField​(java.lang.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 java.lang.String toString()
        Overrides:
        toString in class Data