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
Fields Modifier and Type Field Description protected List<String>
changedFiles
protected String
commitDetails
Additional details for the commit message (optional)static String
CONFIG_KEY_COMMIT_DETAILS
protected List<String>
deletedFiles
protected javax.servlet.ServletContext
servletContext
The servlet context.protected StudioConfiguration
studioConfiguration
The Studio configuration.
-
Constructor Summary
Constructors Constructor Description AbstractUpgradeOperation(StudioConfiguration studioConfiguration)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
commitAllChanges(StudioUpgradeContext context)
protected void
doExecute(org.craftercms.commons.upgrade.impl.UpgradeContext<String> context)
protected abstract void
doExecute(StudioUpgradeContext context)
protected String
getCommitMessage()
void
init(String sourceVersion, String targetVersion, org.apache.commons.configuration2.HierarchicalConfiguration config)
protected org.springframework.core.io.Resource
loadResource(String path)
void
setServletContext(javax.servlet.ServletContext servletContext)
protected void
trackChangedFiles(String... files)
protected void
trackDeletedFiles(String... files)
-
-
-
Field Detail
-
CONFIG_KEY_COMMIT_DETAILS
public static final String CONFIG_KEY_COMMIT_DETAILS
- See Also:
- Constant Field Values
-
commitDetails
protected String commitDetails
Additional details for the commit message (optional)
-
studioConfiguration
protected StudioConfiguration studioConfiguration
The Studio configuration.
-
servletContext
protected javax.servlet.ServletContext servletContext
The servlet context.
-
-
Constructor Detail
-
AbstractUpgradeOperation
@ConstructorProperties("studioConfiguration") public AbstractUpgradeOperation(StudioConfiguration studioConfiguration)
-
-
Method Detail
-
setServletContext
public void setServletContext(javax.servlet.ServletContext servletContext)
- Specified by:
setServletContext
in interfaceorg.springframework.web.context.ServletContextAware
-
init
public void init(String sourceVersion, String targetVersion, org.apache.commons.configuration2.HierarchicalConfiguration config) throws org.craftercms.commons.config.ConfigurationException
-
doExecute
protected void doExecute(org.craftercms.commons.upgrade.impl.UpgradeContext<String> context) throws Exception
-
doExecute
protected abstract void doExecute(StudioUpgradeContext context) throws Exception
- Throws:
Exception
-
getCommitMessage
protected String getCommitMessage()
-
loadResource
protected org.springframework.core.io.Resource loadResource(String path)
- Overrides:
loadResource
in classorg.craftercms.commons.upgrade.impl.operations.AbstractUpgradeOperation<String>
-
trackChangedFiles
protected void trackChangedFiles(String... files)
-
trackDeletedFiles
protected void trackDeletedFiles(String... files)
-
commitAllChanges
protected void commitAllChanges(StudioUpgradeContext context) throws Exception
- Throws:
Exception
-
-