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 PatchActionimportPatchActionprotected java.lang.StringpatchIdprotected java.lang.StringpatchNameprotected Releasereleaseprotected PatchActionsqlCommandPatchActionprotected StructureStatestructureState
-
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 voidexecuteUpdateOnDB(java.lang.String actionName, java.lang.String query)Executes direct SQL update for specified query.protected voidexecuteUpdateOnDB(java.lang.String actionName, java.lang.String query, ImportOrganisationUnit organisationUnit)Executes direct SQL update for specified query.java.lang.StringgetPatchDescription()Returns Patch description.java.lang.StringgetPatchId()Returns unique patch id (e.g PD_V_1.0.1).java.lang.StringgetPatchName()Returns Patch name.ReleasegetRelease()Gets release that patch is part of.StructureStategetStructureState()GetsStructureStatefrom this patchprotected voidimportData(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 voidimportGlobalData(java.lang.String fileName, java.util.Collection<ImportLanguage> languages, boolean runAgain)Imports global impex data for given languages.protected voidimportGlobalData(java.lang.String fileName, java.util.Collection<ImportLanguage> languages, boolean runAgain, ImpexImportUnitOption[] importOptions)Imports global impex data for given languages.voidsetImportPatchAction(PatchAction importPatchAction)voidsetSqlCommandPatchAction(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:PatchGetsStructureStatefrom this patch- Specified by:
getStructureStatein interfacePatch- Returns:
StructureStatefrom this patch
-
getPatchId
public java.lang.String getPatchId()
Description copied from interface:PatchReturns unique patch id (e.g PD_V_1.0.1).- Specified by:
getPatchIdin interfacePatch- Returns:
- patch id
-
getPatchName
public java.lang.String getPatchName()
Description copied from interface:PatchReturns Patch name.- Specified by:
getPatchNamein interfacePatch- Returns:
- patch name (visible in admin console)
-
getPatchDescription
public java.lang.String getPatchDescription()
Description copied from interface:PatchReturns Patch description.- Specified by:
getPatchDescriptionin interfacePatch- Returns:
- description what this patch is about
-
getRelease
public Release getRelease()
Description copied from interface:PatchGets release that patch is part of.- Specified by:
getReleasein interfacePatch- Returns:
- release that patch is part of
-
setImportPatchAction
public void setImportPatchAction(PatchAction importPatchAction)
-
setSqlCommandPatchAction
public void setSqlCommandPatchAction(PatchAction sqlCommandPatchAction)
-
-