Class AbstractCaddyProcess<T extends AbstractCaddyContext>

java.lang.Object
com.jalios.jcms.backgroundprocess.BackgroundProcess
com.jalios.jcms.caddy.AbstractCaddyProcess<T>
Type Parameters:
T - The type of caddy context associated to this process.
All Implemented Interfaces:
JcmsConstants, JaliosConstants
Direct Known Subclasses:
AbstractMemberCaddyProcess, CategoryCaddyProcess, GroupCaddyProcess, PublicationCaddyProcess, WorkspaceCaddyProcess

public abstract class AbstractCaddyProcess<T extends AbstractCaddyContext> extends BackgroundProcess
Super class of all Caddy RunningProcess
Since:
jcms-10.0.8
  • Constructor Details

    • AbstractCaddyProcess

      protected AbstractCaddyProcess(String domain, T context)
  • Method Details

    • runCaddyProcess

      protected void runCaddyProcess()
    • runProcess

      protected final void runProcess()
      Description copied from class: BackgroundProcess
      Override to implement the process.
      Specified by:
      runProcess in class BackgroundProcess
    • performUpdate

      protected abstract void performUpdate()
    • performDelete

      protected abstract void performDelete()
    • getControllerContext

      protected HashMap<String,Object> getControllerContext()
    • setWarningMessageIntro

      protected void setWarningMessageIntro(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(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(String msg)
    • searchAndReplace

      protected final String searchAndReplace(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(Supplier<String> titleGetter, Supplier<Map<String,String>> titleMLGetter, Consumer<String> titleSetter, Consumer<HashMap<String,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
    • setRunningMessageProp

      public void setRunningMessageProp(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