Class BackgroundProcessHandler

    • Constructor Detail

      • BackgroundProcessHandler

        public BackgroundProcessHandler()
    • Method Detail

      • 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 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
      • validateNotifyMe

        protected boolean validateNotifyMe()
      • validateDelete

        protected boolean validateDelete()
      • getJsonProgress

        public java.lang.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 java.lang.String progressToJson()
      • showRemainingTime

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

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

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

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

        public java.lang.String getEllapsedFriendlyTime()
        Returns:
        ellapsed time, formated as localized duration
        Since:
        jcms-10.0.8
      • getRemainingFriendlyTime

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

        public java.util.List<BackgroundProcessInfo> getAvailableProcessList()
        Returns:
        all background and completed process
      • setBackgroundProcessInfoId

        public void setBackgroundProcessInfoId​(java.lang.String v)
      • getAvailableProcessLabel

        public java.lang.String getAvailableProcessLabel()
      • setProcessLabel

        public void setProcessLabel​(java.lang.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​(java.lang.String v)
      • setOpDelete

        public void setOpDelete​(java.lang.String v)
      • isModal

        public boolean isModal()
      • getBackgroundProcessDataAttr

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

        public java.lang.String getAvailableDomain()
      • setDomain

        public void setDomain​(java.lang.String v)
      • deleteInfo

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

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