Setup Classes

Patches use the concept of the setup classes.

The default de.hybris.platform.commerceservices.setup.AbstractSystemSetup class offers methods to:
  • generate options for the Initialization or Update tabs in Administration Console

  • perform an import of the essential data

  • perform an import of the project data

  • display in Administration Console information or errors during an initialization or an update

  • use some additional utility methods

In standard projects, these classes are extended in different extensions with a project-specific logic. The Patches feature provides an extended idea of the AbstractSystemSetup class in the de.hybris.platform.patches.AbstractPatchesSystemSetup class. Besides new functionalities, AbstractPatchesSystemSetup also takes care of splitting concerns. The logic related to importing data or performing SQL updates is located in Patch classes. A Setup class itself is responsible for high level management of what should happen during an initialization or an update process.

AbstractPatchesSystemSetup enables you to:
  • generate options in Administration Console for initialization and update. While generating these options, a previous execution is taken into consideration (some Patches should be executed only once), and project properties.

  • perform an import of the essential data (based on the previous execution and project properties for Administration Console and ant)

  • perform import of the project data (based on the previous execution and project properties for Administration Console and ant)

  • pass a reference to Administration Console (SystemSetupContext) to a dedicated utility class (JspContextHolder). You can now ask the utility class for this context from any place in code. It allows you to print out information related to initialization or update processes in Administration Console in a much more convenient way.

With this new approach, a Setup class should not be used for uploading direct ImpExes.