Package de.hybris.platform.patches
Class AbstractPatch
- java.lang.Object
-
- de.hybris.platform.patches.AbstractPatch
-
- All Implemented Interfaces:
Patch
- Direct Known Subclasses:
AbstractDemoPatch
public abstract class AbstractPatch extends java.lang.Object implements Patch
Base class for all new patches.
-
-
Field Summary
Fields Modifier and Type Field Description protected PatchAction
importPatchAction
protected java.lang.String
patchId
protected java.lang.String
patchName
protected Release
release
protected PatchAction
sqlCommandPatchAction
protected StructureState
structureState
-
Constructor Summary
Constructors Constructor Description AbstractPatch(java.lang.String patchId, java.lang.String patchName, Release release, StructureState structureState)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
executeUpdateOnDB(java.lang.String actionName, java.lang.String query)
Executes direct SQL update for specified query.protected void
executeUpdateOnDB(java.lang.String actionName, java.lang.String query, ImportOrganisationUnit organisationUnit)
Executes direct SQL update for specified query.java.lang.String
getPatchDescription()
Returns Patch description.java.lang.String
getPatchId()
Returns unique patch id (e.g PD_V_1.0.1).java.lang.String
getPatchName()
Returns Patch name.Release
getRelease()
Gets release that patch is part of.StructureState
getStructureState()
GetsStructureState
from this patchprotected void
importData(java.lang.String fileName, ImportOrganisationUnit organisationUnit, java.util.Collection<ImportLanguage> languages, boolean runAgain, ImpexImportUnitOption[] importOptions, ImpexHeaderOption[][] headerOptions)
Imports impex data for given organisation and languages.protected void
importGlobalData(java.lang.String fileName, java.util.Collection<ImportLanguage> languages, boolean runAgain)
Imports global impex data for given languages.protected void
importGlobalData(java.lang.String fileName, java.util.Collection<ImportLanguage> languages, boolean runAgain, ImpexImportUnitOption[] importOptions)
Imports global impex data for given languages.void
setImportPatchAction(PatchAction importPatchAction)
void
setSqlCommandPatchAction(PatchAction sqlCommandPatchAction)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.patches.Patch
createEssentialData, createProjectData
-
-
-
-
Field Detail
-
patchId
protected java.lang.String patchId
-
patchName
protected java.lang.String patchName
-
release
protected Release release
-
structureState
protected StructureState structureState
-
importPatchAction
protected PatchAction importPatchAction
-
sqlCommandPatchAction
protected PatchAction sqlCommandPatchAction
-
-
Constructor Detail
-
AbstractPatch
public AbstractPatch(java.lang.String patchId, java.lang.String patchName, Release release, StructureState structureState)
-
-
Method Detail
-
importGlobalData
protected void importGlobalData(java.lang.String fileName, java.util.Collection<ImportLanguage> languages, boolean runAgain)
Imports global impex data for given languages.- Parameters:
fileName
- of impex to be importedlanguages
- for which data should be importedrunAgain
- if patch should be executed again
-
importGlobalData
protected void importGlobalData(java.lang.String fileName, java.util.Collection<ImportLanguage> languages, boolean runAgain, ImpexImportUnitOption[] importOptions)
Imports global impex data for given languages.- Parameters:
fileName
- of impex to be importedlanguages
- for which data should be importedrunAgain
- if patch should be executed againimportOptions
- optional set of options that define how impex should be executed
-
importData
protected void importData(java.lang.String fileName, ImportOrganisationUnit organisationUnit, java.util.Collection<ImportLanguage> languages, boolean runAgain, ImpexImportUnitOption[] importOptions, ImpexHeaderOption[][] headerOptions)
Imports impex data for given organisation and languages.- Parameters:
fileName
- of impex to be importedorganisationUnit
- for which data should be importedlanguages
- for which data should be importedrunAgain
- if patch should be executed againimportOptions
- optional set of options that define how impex should be executedheaderOptions
- additional header options
-
executeUpdateOnDB
protected void executeUpdateOnDB(java.lang.String actionName, java.lang.String query)
Executes direct SQL update for specified query.- Parameters:
actionName
- a human-readable name of the action.query
- to be executed on DB (directly, not through hybris ORM)
-
executeUpdateOnDB
protected void executeUpdateOnDB(java.lang.String actionName, java.lang.String query, ImportOrganisationUnit organisationUnit)
Executes direct SQL update for specified query.- Parameters:
actionName
- a human-readable name of the action.query
- to be executed on DB (directly, not through hybris ORM)organisationUnit
- organisation unit
-
getStructureState
public StructureState getStructureState()
Description copied from interface:Patch
GetsStructureState
from this patch- Specified by:
getStructureState
in interfacePatch
- Returns:
StructureState
from this patch
-
getPatchId
public java.lang.String getPatchId()
Description copied from interface:Patch
Returns unique patch id (e.g PD_V_1.0.1).- Specified by:
getPatchId
in interfacePatch
- Returns:
- patch id
-
getPatchName
public java.lang.String getPatchName()
Description copied from interface:Patch
Returns Patch name.- Specified by:
getPatchName
in interfacePatch
- Returns:
- patch name (visible in admin console)
-
getPatchDescription
public java.lang.String getPatchDescription()
Description copied from interface:Patch
Returns Patch description.- Specified by:
getPatchDescription
in interfacePatch
- Returns:
- description what this patch is about
-
getRelease
public Release getRelease()
Description copied from interface:Patch
Gets release that patch is part of.- Specified by:
getRelease
in interfacePatch
- Returns:
- release that patch is part of
-
setImportPatchAction
public void setImportPatchAction(PatchAction importPatchAction)
-
setSqlCommandPatchAction
public void setSqlCommandPatchAction(PatchAction sqlCommandPatchAction)
-
-