Class AbstractUpgradeOperation
java.lang.Object
org.craftercms.commons.upgrade.impl.operations.AbstractUpgradeOperation<String>
org.craftercms.studio.impl.v2.upgrade.operations.AbstractUpgradeOperation
- All Implemented Interfaces:
org.craftercms.commons.upgrade.UpgradeOperation<String>
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
,org.springframework.web.context.ServletContextAware
- Direct Known Subclasses:
AbstractContentUpgradeOperation
,AbstractPluginDescriptorUpgradeOperation
,AbstractXsltFileUpgradeOperation
,AddFileUpgradeOperation
,AddSiteUuidOperation
,BlueprintsUpgradeOperation
,DbEncryptionUpgradeOperation
,DbScriptUpgradeOperation
,DeleteUpgradeOperation
,GlobalRepoUpgradeOperation
,RenameUpgradeOperation
public abstract class AbstractUpgradeOperation
extends org.craftercms.commons.upgrade.impl.operations.AbstractUpgradeOperation<String>
implements org.springframework.web.context.ServletContextAware
Provides access to system components for all upgrade operations.
Supported YAML properties:
- currentVersion: (required) the version number that will be upgraded
- nextVersion (required) the version number to use after the upgrade
- commitDetails(optional) any additional details to include in the commits if there are repository changes
- Author:
- joseross
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
Additional details for the commit message (optional)static final String
protected jakarta.servlet.ServletContext
The servlet context.protected StudioConfiguration
The Studio configuration.Fields inherited from class org.craftercms.commons.upgrade.impl.operations.AbstractUpgradeOperation
applicationContext, currentVersion, enabled, nextVersion
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
commitAllChanges
(StudioUpgradeContext context) protected void
protected abstract void
doExecute
(StudioUpgradeContext context) protected String
void
init
(String sourceVersion, String targetVersion, org.apache.commons.configuration2.HierarchicalConfiguration config) protected org.springframework.core.io.Resource
loadResource
(String path) void
setServletContext
(jakarta.servlet.ServletContext servletContext) protected void
trackChangedFiles
(String... files) protected void
trackDeletedFiles
(String... files) Methods inherited from class org.craftercms.commons.upgrade.impl.operations.AbstractUpgradeOperation
doInit, execute, setApplicationContext, setEnabled
-
Field Details
-
CONFIG_KEY_COMMIT_DETAILS
- See Also:
-
changedFiles
-
deletedFiles
-
commitDetails
Additional details for the commit message (optional) -
studioConfiguration
The Studio configuration. -
servletContext
protected jakarta.servlet.ServletContext servletContextThe servlet context.
-
-
Constructor Details
-
AbstractUpgradeOperation
@ConstructorProperties("studioConfiguration") public AbstractUpgradeOperation(StudioConfiguration studioConfiguration)
-
-
Method Details
-
setServletContext
public void setServletContext(jakarta.servlet.ServletContext servletContext) - Specified by:
setServletContext
in interfaceorg.springframework.web.context.ServletContextAware
-
init
-
doExecute
-
doExecute
- Throws:
Exception
-
getCommitMessage
-
loadResource
- Overrides:
loadResource
in classorg.craftercms.commons.upgrade.impl.operations.AbstractUpgradeOperation<String>
-
trackChangedFiles
-
trackDeletedFiles
-
commitAllChanges
- Throws:
Exception
-