Class BackgroundProcessHandler

All Implemented Interfaces:
JcmsConstants, JaliosConstants
Direct Known Subclasses:
BackgroundProcessManagerHandler, BackgroundProcessTagHandler, BackgroundProcessTopbarHandler

public class BackgroundProcessHandler extends JcmsFormHandler
Since:
jcms-10.0.8 / JCMS-9179
  • Field Details

  • Constructor Details

    • BackgroundProcessHandler

      public BackgroundProcessHandler()
  • Method Details

    • init

      protected void init()
      Description copied from class: JcmsFormHandler
      Method to implement if you need to initialize your handler from parameter received, prior to all security validation.

      You must absolutely not perform any action which modify data or site configuration.

      Therefore it is strongly recommend NOT TO implement this method, or use very wisely.

      Overrides:
      init in class JcmsFormHandler
    • 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 JcmsFormHandler
      Returns:
      false if no redirection is needed, true otherwise
      Throws:
      IOException - IO Exception
    • validateNotifyMe

      protected boolean validateNotifyMe()
    • validateDelete

      protected boolean validateDelete()
    • getJsonProgress

      public String getJsonProgress()
      Note that it marks an undefined or maybe deleted process as completed.
      Returns:
      json representation of the process for client-side UI updates
    • progressToJson

      public String progressToJson()
    • showRemainingTime

      public boolean showRemainingTime()
      Returns:
      true if process started more than 5s ago
      Since:
      jcms-10.0.8
    • getStatusHtml

      public String getStatusHtml()
      Returns:
      HTML that describes the process current status.
      Since:
      jcms-10.0.8
    • getCompletedMessage

      public String getCompletedMessage()
      Returns:
      the process completedMessage or empty String
      Since:
      jcms-10.0.8
    • getRunningMessage

      public String getRunningMessage()
      Returns:
      the process runningMessage or empty String
      Since:
      jcms-10.0.8
    • getEllapsedFriendlyTime

      public String getEllapsedFriendlyTime()
      Returns:
      ellapsed time, formated as localized duration
      Since:
      jcms-10.0.8
    • getRemainingTime

      public Long getRemainingTime()
      Returns:
      BackgroundProcessInfo.getRemainingTime()
      Since:
      jcms-10.0.8
    • getRemainingFriendlyTime

      public String getRemainingFriendlyTime()
      Returns:
      estimated remaining time, formated as localized duration
      Since:
      jcms-10.0.8
    • getAvailableProcessList

      public List<BackgroundProcessInfo> getAvailableProcessList()
      Returns:
      all background and completed process
    • getAvailableInfo

      public BackgroundProcessInfo getAvailableInfo()
    • setBackgroundProcessInfoId

      public void setBackgroundProcessInfoId(String v)
    • getAvailableProcessLabel

      public String getAvailableProcessLabel()
    • setProcessLabel

      public void setProcessLabel(String processLabel)
      For periodical xhr to be able to access a completed and delete process.
      Parameters:
      processLabel - the label a get JSON progress request will post.
    • setOpNotifyMe

      public void setOpNotifyMe(String v)
    • setOpDelete

      public void setOpDelete(String v)
    • isModal

      public boolean isModal()
    • getBackgroundProcessDataAttr

      public String getBackgroundProcessDataAttr()
    • getPendingProcessCount

      public long getPendingProcessCount()
      Returns:
      currently background process count of all users
    • getUserPendingProcessCount

      public long getUserPendingProcessCount()
      Returns:
      background process count of loggedMember
    • getAvailableUnique

      public boolean getAvailableUnique()
    • setUnique

      public void setUnique(String v)
    • getAvailableDomain

      public String getAvailableDomain()
    • setDomain

      public void setDomain(String v)
    • deleteInfo

      public void deleteInfo(String infoId)
    • canBeNotified

      public boolean canBeNotified()
    • showNotifyBtn

      public boolean showNotifyBtn()
      Returns:
      true only after a 3sec delay.

      See property "background-process.topbar.created-before-delay".

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public String toString(org.apache.commons.lang3.builder.ToStringStyle style)