public class FindAndReplaceUpgradeOperation extends AbstractContentUpgradeOperation
UpgradeOperation that replaces text in the content repository.
Supported YAML properties:
AbstractContentUpgradeOperation.ListFileVisitor| Modifier and Type | Field and Description |
|---|---|
static String |
CONFIG_KEY_PATTERN |
static String |
CONFIG_KEY_REPLACEMENT |
protected String |
pattern
The pattern to search in the files
|
protected String |
replacement
The expression to replace in the files
|
CONFIG_KEY_INCLUDED_PATHS, includedPathsapplicationContext, commitDetails, CONFIG_KEY_COMMIT_DETAILS, contentRepository, currentVersion, dataSource, nextVersion, servletContext, studioConfiguration| Constructor and Description |
|---|
FindAndReplaceUpgradeOperation() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doInit(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> config) |
protected boolean |
shouldBeUpdated(String site,
Path file)
Indicates if the given file should be updated by this class
|
protected void |
updateFile(String site,
Path path)
Performs any needed updates on the content of the given file
|
execute, filterPaths, findIncludedPaths, readFile, writeFilecommitAllChanges, getCommitMessage, getConnection, getContentRepository, getProperty, getRepositoryPath, init, loadResource, setApplicationContext, setContentRepository, setDataSource, setServletContext, setStudioConfiguration, writeToRepopublic static final String CONFIG_KEY_PATTERN
public static final String CONFIG_KEY_REPLACEMENT
protected String pattern
protected String replacement
protected void doInit(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> config)
doInit in class AbstractContentUpgradeOperationprotected boolean shouldBeUpdated(String site, Path file)
AbstractContentUpgradeOperationshouldBeUpdated in class AbstractContentUpgradeOperationsite - the site idfile - the file to checkprotected void updateFile(String site, Path path) throws UpgradeException
AbstractContentUpgradeOperationupdateFile in class AbstractContentUpgradeOperationsite - the site idpath - the file to updateUpgradeException - if there is any error updating the fileCopyright © 2020 CrafterCMS. All rights reserved.