Class 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 Detail

      • patchId

        protected java.lang.String patchId
      • patchName

        protected java.lang.String patchName
      • release

        protected Release release
      • 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 imported
        languages - for which data should be imported
        runAgain - 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 imported
        languages - for which data should be imported
        runAgain - if patch should be executed again
        importOptions - 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 imported
        organisationUnit - for which data should be imported
        languages - for which data should be imported
        runAgain - if patch should be executed again
        importOptions - optional set of options that define how impex should be executed
        headerOptions - 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
      • 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 interface Patch
        Returns:
        patch id
      • getPatchName

        public java.lang.String getPatchName()
        Description copied from interface: Patch
        Returns Patch name.
        Specified by:
        getPatchName in interface Patch
        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 interface Patch
        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 interface Patch
        Returns:
        release that patch is part of
      • setImportPatchAction

        public void setImportPatchAction​(PatchAction importPatchAction)
      • setSqlCommandPatchAction

        public void setSqlCommandPatchAction​(PatchAction sqlCommandPatchAction)