Class MultiFindAndReplaceUpgradeOperation

java.lang.Object
org.craftercms.commons.upgrade.impl.operations.AbstractUpgradeOperation<String>
All Implemented Interfaces:
org.craftercms.commons.upgrade.UpgradeOperation<String>, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware

public class MultiFindAndReplaceUpgradeOperation extends AbstractContentUpgradeOperation
Implementation of UpgradeOperation that replaces text in the content repository according to multiple 'pattern/replacement' rules.

Supported YAML properties:

  • rules: (required) the list of rules to find and replace text. Each rule should contain the properties:
    • pattern: (required) the pattern to search in the files, can be a regular expression
    • replacement: (required) the expression to replace in the files, can use matched groups from the regular expression in the pattern
Author:
jmendeza
  • Field Details

    • CONFIG_KEY_RULES

      public static final String CONFIG_KEY_RULES
      See Also:
    • CONFIG_KEY_PATTERN

      public static final String CONFIG_KEY_PATTERN
      See Also:
    • CONFIG_KEY_REPLACEMENT

      public static final String CONFIG_KEY_REPLACEMENT
      See Also:
    • rules

      protected List<org.craftercms.studio.impl.v2.upgrade.operations.site.MultiFindAndReplaceUpgradeOperation.Rule> rules
      The list of find-replace rules
  • Constructor Details

    • MultiFindAndReplaceUpgradeOperation

      public MultiFindAndReplaceUpgradeOperation(StudioConfiguration studioConfiguration)
  • Method Details