Class AlertHandler

    • Field Detail

      • PARAM_ALERT_AUTHOR

        public static final java.lang.String PARAM_ALERT_AUTHOR
        See Also:
        Constant Field Values
      • PARAM_ALERT_END_DATE

        public static final java.lang.String PARAM_ALERT_END_DATE
        See Also:
        Constant Field Values
      • PARAM_ALERT_START_DATE

        public static final java.lang.String PARAM_ALERT_START_DATE
        See Also:
        Constant Field Values
      • PARAM_ALERT_WORKSPACE

        public static final java.lang.String PARAM_ALERT_WORKSPACE
        See Also:
        Constant Field Values
      • PARAM_ALERT_PAGER_REVERSE

        public static final java.lang.String PARAM_ALERT_PAGER_REVERSE
        See Also:
        Constant Field Values
      • PARAM_ALERT_LEVEL

        public static final java.lang.String PARAM_ALERT_LEVEL
        See Also:
        Constant Field Values
      • PARAM_ALERT_READ_MODE

        public static final java.lang.String PARAM_ALERT_READ_MODE
        See Also:
        Constant Field Values
      • opUnfollow

        protected boolean opUnfollow
      • opUnfollowRead

        protected boolean opUnfollowRead
      • opReadAllPub

        protected boolean opReadAllPub
      • alertAuthor

        protected Member alertAuthor
      • alertStartDate

        protected java.util.Date alertStartDate
      • alertEndDate

        protected java.util.Date alertEndDate
      • alertWorkspace

        protected Workspace alertWorkspace
      • DEFAULT_ALERT_LEVELS

        protected static final Alert.Level[] DEFAULT_ALERT_LEVELS
      • alertLevelList

        protected Alert.Level[] alertLevelList
      • moreDate

        protected java.util.Date moreDate
      • opRead

        protected boolean opRead
      • opUnread

        protected boolean opUnread
      • opReadAll

        protected boolean opReadAll
      • sort

        protected java.lang.String sort
      • reverse

        protected boolean reverse
      • start

        protected int start
      • pageSize

        protected int pageSize
      • pagerAll

        protected boolean pagerAll
    • Constructor Detail

      • AlertHandler

        public AlertHandler()
    • Method Detail

      • processAction

        public boolean processAction()
                              throws java.io.IOException
        Description copied from class: JcmsFormHandler
        Method to be implemented to check/validate action to be performed and process them.

        Default implementation is to return false. No need to call super method.

        This method may NOT be invoked at all if security validation are not met.

        You must ensure your handler and JSP can work properly without any code invoked in this method.

        Overrides:
        processAction in class JcmsFormHandler
        Returns:
        false if no redirection is needed, true otherwise
        Throws:
        java.io.IOException - IO Exception
      • validateMember

        protected boolean validateMember()
        Returns:
        true if loggedMember is not null, false otherwise.
        Since:
        jcms-10.0.2
      • getMoreDateRestriction

        protected org.hibernate.criterion.SimpleExpression getMoreDateRestriction()
        Returns:
        date restriction for "More" button, with reverse param handled.
        Since:
        jcms-10.0.2
      • setAlertAuthor

        public void setAlertAuthor​(java.lang.String v)
      • getAvailableAlertAuthor

        public Member getAvailableAlertAuthor()
        Returns:
        the member to use as author filter
        Since:
        jcms-10.0.0
      • setAlertStartDate

        public void setAlertStartDate​(java.lang.String v)
      • getAvailableAlertStartDate

        public java.util.Date getAvailableAlertStartDate()
      • getAvailableAlertEndDate

        public java.util.Date getAvailableAlertEndDate()
      • setAlertEndDate

        public void setAlertEndDate​(java.lang.String v)
      • setAlertWorkspace

        public void setAlertWorkspace​(java.lang.String v)
      • getAvailableAlertWorkspace

        public Workspace getAvailableAlertWorkspace()
      • setAlertReadMode

        public void setAlertReadMode​(java.lang.String alertReadMode)
      • isReadModeRead

        public boolean isReadModeRead()
      • isReadModeUnread

        public boolean isReadModeUnread()
      • isReadAllMode

        public boolean isReadAllMode()
      • setAlertLevel

        public void setAlertLevel​(java.lang.String[] v)
      • getAvailableAlertLevels

        public Alert.Level[] getAvailableAlertLevels()
      • getAvailableAlertLevelList

        public java.util.List<Alert.Level> getAvailableAlertLevelList()
      • getAvailableAlertLevelListValues

        protected java.util.List<java.lang.String> getAvailableAlertLevelListValues()
        Internal. Used to fill the controlTag with user value(s).
        Returns:
        the VALUES of the alert level list
      • isLevelInfo

        public boolean isLevelInfo()
      • isLevelWarning

        public boolean isLevelWarning()
      • isLevelAction

        public boolean isLevelAction()
      • setAlertMoreDate

        public void setAlertMoreDate​(java.lang.String v)
      • hasMore

        public boolean hasMore()
        True if there are more Datas than the default results list.
        Returns:
        true ie More button should be displayed
      • getMoreDate

        protected java.util.Date getMoreDate()
        Returns:
        if there are result(s), the creation date of last result.
        Since:
        jcms-10.0.2
      • getMoreAlertParamsMap

        protected java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​?>> getMoreAlertParamsMap()
        Returns:
        params for More button
        Since:
        jcms-10.0.2
      • getMoreAlertParams

        public java.lang.String getMoreAlertParams()
        Compute the AJAX parameters for the AJAX "more" button
        Returns:
        a JSON map for data-jalios-options
        Since:
        jcms-10.0.0
      • setOpRead

        public void setOpRead​(java.lang.String v)
      • setOpUnread

        public void setOpUnread​(java.lang.String v)
      • setOpReadAll

        public void setOpReadAll​(java.lang.String v)
      • setAlerts

        public void setAlerts​(java.lang.String[] v)
      • getAvailableAlerts

        public java.util.Collection<Alert> getAvailableAlerts()
      • showResultList

        public boolean showResultList()
        Convenient method to indicate to the UI if results view will rendered.

        Return false to indicate APP Body is something else than results.

        Returns:
        weither result list is to be rendered (whatever results count). true by default
        Since:
        jcms-10.0.2
      • showMarkAllAsRead

        public boolean showMarkAllAsRead()
        Returns true when there are at least one unread alert.
        Returns:
        weither action "Mark all (alerts) as read" should be provided to the user
        Since:
        jcms-10.0.2
      • hasResults

        public boolean hasResults()
        Returns:
        true if there is at least one result and results list is to be displayed.
        Since:
        jcms-10.0.2
        See Also:
        showResultList()
      • setAlertAppPager_sort

        public void setAlertAppPager_sort​(java.lang.String v)
      • getSort

        public java.lang.String getSort()
      • setAlertAppPager_reverse

        @Deprecated
        public void setAlertAppPager_reverse​(java.lang.String v)
        Deprecated.
      • setAlertListReverse

        public void setAlertListReverse​(java.lang.String v)
        To change alert list order to be reverse or not.
        Parameters:
        v - reverse order to set
        Since:
        jcms-10.0.3
      • isReverse

        public boolean isReverse()
        Returns:
        weither alert list order must be reverse or not.

        If user reverse choice misses from HTTP parameters, loads member preference if any.

        Else, return default reverse.

        Since:
        jcms-10.0.3
      • setAlertAppPager_start

        public void setAlertAppPager_start​(java.lang.String v)
      • getStart

        public int getStart()
      • setAlertAppPager_pageSize

        public void setAlertAppPager_pageSize​(java.lang.String v)
      • getPageSize

        public int getPageSize()
      • setAlertAppPager_pagerAll

        public void setAlertAppPager_pagerAll​(java.lang.String v)
      • isPagerAll

        public boolean isPagerAll()
      • getAlertStatusResponse

        public final java.lang.String getAlertStatusResponse()
        Returns:
        the AlertStatus as a String for current logged member
      • getAlertParentDataId

        public static java.lang.String getAlertParentDataId​(Alert alert)
        Searches for the alert data (If available) parent
        Parameters:
        alert - Alert
        Returns:
        the alert Data parent id
        Since:
        jcms-10.0.2
      • isOpUnfollow

        public boolean isOpUnfollow()
      • setOpUnfollow

        public void setOpUnfollow​(boolean opUnfollow)
      • isOpUnfollowRead

        public boolean isOpUnfollowRead()
      • setOpUnfollowRead

        public void setOpUnfollowRead​(boolean opUnfollowRead)
      • isOpReadAllPub

        public boolean isOpReadAllPub()
      • setOpReadAllPub

        public void setOpReadAllPub​(boolean opReadAllPub)
      • isUnfollowableAlert

        public static boolean isUnfollowableAlert​(Alert alert,
                                                  Member mbr)
        Parameters:
        alert - the Alert
        mbr - the Member
        Returns:
        true if given Alert is unfollowable for given Member
        Since:
        jcms-10.0.2
      • isReadAllAlert

        public static boolean isReadAllAlert​(Alert alert)
        Parameters:
        alert - the Alert
        Returns:
        true if the Alert can provide read all action (All alerts on the same data will be marked as read)
        Since:
        jcms-10.0.2