Class AbstractCaddyProcess<T extends AbstractCaddyContext>

    • Constructor Detail

      • AbstractCaddyProcess

        protected AbstractCaddyProcess​(java.lang.String domain,
                                       T context)
    • Method Detail

      • runCaddyProcess

        protected void runCaddyProcess()
      • performUpdate

        protected abstract void performUpdate()
      • performDelete

        protected abstract void performDelete()
      • getControllerContext

        protected java.util.HashMap<java.lang.String,​java.lang.Object> getControllerContext()
      • setWarningMessageIntro

        protected void setWarningMessageIntro​(java.lang.String msg)
        Set the warning message to use as an introduction of all statuses warning encountered during processing (if any).
        Parameters:
        msg - the message to set
        Since:
        jcms-10.0.8
      • setEndMessage

        protected void setEndMessage​(java.lang.String msg)
        Set the message to displayed on process end.
        Parameters:
        msg - the message to set
        Since:
        jcms-10.0.8
      • processMultipleStatus

        protected final boolean processMultipleStatus​(Data data,
                                                      ControllerStatus status)
        Process the ControllerStatus: do nothing if OK, or send on forbidden, or accumulate warning message with the previous ones in the request.
        Parameters:
        data - the Data that is being manipulated
        status - the ControllerStatus to be processed
        Returns:
        final status of all process
        Since:
        jcms-10.0.8
      • addWarningMsg

        protected void addWarningMsg​(java.lang.String msg)
      • searchAndReplace

        protected final java.lang.String searchAndReplace​(java.lang.String input)
        Do a search and replace using previously specifed patterns (if specified and validated). Take into account the too option "apply in empty field" and "use regexp".
        Parameters:
        input - the string to be modified
        Returns:
        the string modified
        Since:
        jcms-10.0.8
      • doSearchAndReplace

        protected void doSearchAndReplace​(java.util.function.Supplier<java.lang.String> titleGetter,
                                          java.util.function.Supplier<java.util.Map<java.lang.String,​java.lang.String>> titleMLGetter,
                                          java.util.function.Consumer<java.lang.String> titleSetter,
                                          java.util.function.Consumer<java.util.HashMap<java.lang.String,​java.lang.String>> titleMLSetter)
        Do a search and replace on using specified getter/setter.
        Parameters:
        titleGetter - a Supplier for the data name/title in the main site language
        titleMLGetter - a Supplier for the data ML map in other languages
        titleSetter - a Consummer to set the modified data name/title in the main site language
        titleMLSetter - a Consummer to set the modified data ML map in other languages
        Since:
        jcms-10.0.8
      • deleteDataExtension

        protected final boolean deleteDataExtension​(Data data,
                                                    java.util.HashMap<java.lang.String,​java.lang.Object> controllerContext)
        Delete the data extension of the given data, if asked.
        Parameters:
        data - the data of which extension will be removed.
        controllerContext - the controller context used for checkDelete and performDelete method.
        Returns:
        true if extension was deleted, false otherwise.
        Since:
        jcms-10.0.8
      • setRunningMessageProp

        public void setRunningMessageProp​(java.lang.String runningMessageProp)
      • setCurrentStep

        public void setCurrentStep​(int stepNbr)
        Description copied from class: BackgroundProcess
        Set the current step number of this processing.

        Implementation detail : If this step changes the progress percentage, it triggers an update in database of the BackgroundProcessInfo used to track the process progress

        Overrides:
        setCurrentStep in class BackgroundProcess
        Parameters:
        stepNbr - the step number to set