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
Author:
Sylvain Devaux
  • Field Details

  • Constructor Details

    • AlertAppHandler

      public AlertAppHandler()
  • Method Details

    • addFrontendDependencies

      public void addFrontendDependencies()
    • setEditMemberHandler

      public void setEditMemberHandler(EditMemberHandler memberH)
    • getEditMemberHandler

      public EditMemberHandler getEditMemberHandler()
    • processAction

      public boolean processAction() throws 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:
      IOException - IO Exception
    • setEditAlertRules

      public void setEditAlertRules(String v)
    • showCustomizeAlertRules

      public boolean showCustomizeAlertRules()
      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(String v)
    • isEditAlertRulesValidated

      public boolean isEditAlertRulesValidated()
    • getAlertAppStatusResponse

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

      protected void initSort()
      Overrides:
      initSort in class AlertHandler
    • getResultsCount

      public int getResultsCount()
      Overrides:
      getResultsCount in class AlertHandler
      Returns:
      results count for current user filters
      See Also:
    • getRecommendationsPageResult

      public PageResult<Recommendation> getRecommendationsPageResult()
    • 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()
    • getReadModeSettings

      public ControlSettings<?> getReadModeSettings()
    • getReadModeFilters

      public Collection<AlertAppHandler.ReadModeFilter> getReadModeFilters()
    • isActive

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

      public ControlSettings<?> getSortSettings()
    • getAlertLevelSettings

      public ControlSettings<?> getAlertLevelSettings()
    • getLevelFilters

      public Collection<AlertAppHandler.AlertLevelFilter> getLevelFilters()
    • isActive

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

      public List<BreadcrumbItem> getBreadcrumbItems()
    • 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(String recoSendMode)
    • getAvailableRecoSendMode

      public RecommendationQueryBuilder.SendMode getAvailableRecoSendMode()
    • isSentSendMode

      public boolean isSentSendMode()
    • isReceivedSendMode

      public boolean isReceivedSendMode()
    • getRecoSendModeSettings

      public ControlSettings<?> getRecoSendModeSettings()
    • getSendModeFilters

      public Collection<AlertAppHandler.SendModeFilter> getSendModeFilters()
    • isActive

      public boolean isActive(AlertAppHandler.SendModeFilter sendModeFilter)
    • setRecoRecipient

      public void setRecoRecipient(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 Date getMoreDate()
      Overrides:
      getMoreDate in class AlertHandler
      Returns:
      if there are result(s), the creation date of last result.
    • getMoreAlertParamsMap

      protected Map<String,Map<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 String getAppJsp()
      Returns:
      the unique APP JSP entry point
    • getAppInnerJsp

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

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

      public String getAppBodyJsp()
    • getAppSidebarJsp

      public String getAppSidebarJsp()
    • getNoResultsIcon

      public 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 String getNoResultsMessage()
      Returns:
      the right message when there's no Alerts or no Recommendations
    • setAlertViewMode

      public void setAlertViewMode(AlertAppHandler.ViewMode alertViewMode)
    • getAvailableAlertViewMode

      public AlertAppHandler.ViewMode getAvailableAlertViewMode()
    • 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(String v)
    • getAvailableUITab

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

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

      public List<AppSidebarSectionMenuItem> getViewItems()
    • getReadModeItems

      public List<AppSidebarSectionMenuItem> getReadModeItems()
    • getRecommendationSendModeItems

      public List<AppSidebarSectionMenuItem> getRecommendationSendModeItems()
    • getAlertLevelItems

      public List<AppSidebarSectionMenuItem> getAlertLevelItems()
    • 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.
    • getUITabSettings

      public ControlSettings<?> getUITabSettings(AlertAppHandler.UITab uiTab)
      Parameters:
      uiTab - the current UITab
      Returns:
      the ControlSettings to use for Tabs navigation.
    • setAlertSort

      public void setAlertSort(String v)
    • setPrevReadMode

      public void setPrevReadMode(String v)
    • getPrevReadModeSettings

      public ControlSettings<?> getPrevReadModeSettings()