Class AlertAppHandler

  • All Implemented Interfaces:
    JcmsConstants, JaliosConstants

    public class AlertAppHandler
    extends AlertHandler
    Handler to display alerts, and recommendations in an APP.
    Since:
    jcms-10.0.0
    Version:
    $Revision: 130843 $
    Author:
    Sylvain Devaux
    • Constructor Detail

      • AlertAppHandler

        public AlertAppHandler()
    • Method Detail

      • setEditMemberHandler

        public void setEditMemberHandler​(EditMemberHandler memberH)
      • 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 AlertHandler
        Returns:
        false if no redirection is needed, true otherwise
        Throws:
        java.io.IOException - IO Exception
      • setEditAlertRules

        public void setEditAlertRules​(java.lang.String v)
      • showCutomizeAlertRules

        public boolean showCutomizeAlertRules()
        Returns:
        true if "alert rules editor" link should be available.
      • showAlertRulesEditor

        public boolean showAlertRulesEditor()
        Returns:
        true when the alert rules editor must be displayed
      • setOpUpdateAlertRules

        public void setOpUpdateAlertRules​(java.lang.String v)
      • isEditAlertRulesValidated

        public boolean isEditAlertRulesValidated()
      • getAlertAppStatusResponse

        public java.lang.String getAlertAppStatusResponse()
        Returns:
        the total alerts unread count taking in account current filters
        Since:
        jcms-10.0.1
      • getAlertAuthorSettings

        public ControlSettings<?> getAlertAuthorSettings()
      • getAvailableAlertAuthor

        public Member getAvailableAlertAuthor()
        In recommendations case, when SendMode is sent, returns loggedMember as forced author filter.
        Overrides:
        getAvailableAlertAuthor in class AlertHandler
        Returns:
        the member to use as Alerts recipient filter
        Since:
        jcms-10.0.2
      • getAlertStartSettings

        public DateSettings getAlertStartSettings()
      • getAlertEndSettings

        public DateSettings getAlertEndSettings()
      • getAlertWorkspaceSettings

        public ControlSettings<?> getAlertWorkspaceSettings()
      • isActive

        public boolean isActive​(AlertAppHandler.ReadModeFilter readModeFilter)
        Check if given ReadState filter is active.
        Parameters:
        readModeFilter - the filter value to test
        Returns:
        boolean
      • isActive

        public boolean isActive​(AlertAppHandler.AlertLevelFilter levelFilter)
        Check if given Alert level filter is active.
        Parameters:
        levelFilter - the filter value to test
        Returns:
        boolean
      • showResultList

        public boolean showResultList()
        Description copied from class: AlertHandler
        Convenient method to indicate to the UI if results view will rendered.

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

        Overrides:
        showResultList in class AlertHandler
        Returns:
        false if Alert rules editor is asked, default choice otherwise.
      • setRecoSendMode

        public void setRecoSendMode​(java.lang.String recoSendMode)
      • isSentSendMode

        public boolean isSentSendMode()
      • isReceivedSendMode

        public boolean isReceivedSendMode()
      • setRecoRecipient

        public void setRecoRecipient​(java.lang.String v)
      • getAvailableRecoRecipient

        public Member getAvailableRecoRecipient()
        In recommendations case, when SendMode is received, then forces recipient filter to be loggedMember.
        Returns:
        the member to use as recommendation recipient filter
        Since:
        jcms-10.0.2
      • getRecoRecipientSettings

        public ControlSettings<?> getRecoRecipientSettings()
      • hasMore

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

        protected java.util.Date getMoreDate()
        Overrides:
        getMoreDate in class AlertHandler
        Returns:
        if there are result(s), the creation date of last result.
      • getMoreAlertParamsMap

        protected java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​?>> getMoreAlertParamsMap()
        Compute the AJAX parameters for the AJAX "more" button, depending on view, and compliant filters
        Overrides:
        getMoreAlertParamsMap in class AlertHandler
        Returns:
        a map to be converted into JSON for data-jalios-options attribute
        Since:
        jcms-10.0.2
      • getAppJsp

        public static java.lang.String getAppJsp()
        Returns:
        the unique APP JSP entry point
      • getAppInnerJsp

        public static java.lang.String getAppInnerJsp()
        Returns:
        the unique APP JSP entry point
      • getAppHeaderTitle

        public java.lang.String getAppHeaderTitle​(java.lang.String userLang)
        Parameters:
        userLang - the user lang
        Returns:
        app header title depending on the current tab.
      • getAppBodyJsp

        public java.lang.String getAppBodyJsp()
      • getAppSidebarJsp

        public java.lang.String getAppSidebarJsp()
      • getNoResultsIcon

        public java.lang.String getNoResultsIcon()
        Returns:
        the right "APP No results" icon to use when there's no results, depending on the query.
        Since:
        jcms-10.0.2
      • getNoResultsMessage

        public java.lang.String getNoResultsMessage()
        Returns:
        the right message when there's no Alerts or no Recommendations
      • isListView

        public boolean isListView()
      • isCardView

        public boolean isCardView()
      • isReadModeUnread

        public boolean isReadModeUnread()
        Override for it to return false when displaying recommendations.
        Overrides:
        isReadModeUnread in class AlertHandler
      • isReadModeRead

        public boolean isReadModeRead()
        Override for it to return false when displaying recommendations.
        Overrides:
        isReadModeRead in class AlertHandler
      • isReadAllMode

        public boolean isReadAllMode()
        Override for it to return false when displaying recommendations.
        Overrides:
        isReadAllMode in class AlertHandler
      • setAlertTab

        public void setAlertTab​(java.lang.String v)
      • getAvailableUITab

        public AlertAppHandler.UITab getAvailableUITab()
        Returns:
        the current / active tab in the app. Never returns null.
      • getTabs

        public java.util.Collection<AlertAppHandler.UITab> getTabs()
        Returns:
        the (ordered) tabs to display
      • isAlertDisplay

        public boolean isAlertDisplay()
      • isRecommendationDisplay

        public boolean isRecommendationDisplay()
      • isActive

        public boolean isActive​(AlertAppHandler.UITab uiTab)
        Parameters:
        uiTab - the ui tab to test if it is active
        Returns:
        true if given UITab is currently selected / active.