Class InitialDataSystemSetup

java.lang.Object
de.hybris.platform.commerceservices.setup.AbstractSystemSetup
de.hybris.platform.yacceleratorinitialdata.setup.InitialDataSystemSetup

@SystemSetup(extension="yacceleratorinitialdata") public class InitialDataSystemSetup extends AbstractSystemSetup
This class provides hooks into the system's initialization and update processes.
  • Constructor Details

    • InitialDataSystemSetup

      public InitialDataSystemSetup()
  • Method Details

    • getInitializationOptions

      @SystemSetupParameterMethod public List<SystemSetupParameter> getInitializationOptions()
      Generates the Dropdown and Multi-select boxes for the project data import
      Specified by:
      getInitializationOptions in class AbstractSystemSetup
      Returns:
      the list of SystemSetupParameters for the SystemSetup class.
    • createEssentialData

      @SystemSetup(type=ESSENTIAL, process=ALL) public void createEssentialData(SystemSetupContext context)
      Implement this method to create initial objects. This method will be called by system creator during initialization and system update. Be sure that this method can be called repeatedly.
      Parameters:
      context - the context provides the selected parameters and values
    • createProjectData

      @SystemSetup(type=PROJECT, process=ALL) public void createProjectData(SystemSetupContext context)
      Implement this method to create data that is used in your project. This method will be called during the system initialization.
      Add import data for each site you have configured
       final List importData = new ArrayList();
      
       final ImportData sampleImportData = new ImportData();
       sampleImportData.setProductCatalogName(SAMPLE_PRODUCT_CATALOG_NAME);
       sampleImportData.setContentCatalogNames(Arrays.asList(SAMPLE_CONTENT_CATALOG_NAME));
       sampleImportData.setStoreNames(Arrays.asList(SAMPLE_STORE_NAME));
       importData.add(sampleImportData);
      
       getCoreDataImportService().execute(this, context, importData);
       getEventService().publishEvent(new CoreDataImportedEvent(context, importData));
      
       getSampleDataImportService().execute(this, context, importData);
       getEventService().publishEvent(new SampleDataImportedEvent(context, importData));
       
      Parameters:
      context - the context provides the selected parameters and values
    • getCoreDataImportService

      public CoreDataImportService getCoreDataImportService()
    • setCoreDataImportService

      public void setCoreDataImportService(CoreDataImportService coreDataImportService)
    • getSampleDataImportService

      public SampleDataImportService getSampleDataImportService()
    • setSampleDataImportService

      public void setSampleDataImportService(SampleDataImportService sampleDataImportService)