Class DataSupplierFlowActionHandler

java.lang.Object
com.hybris.hybrisdatasupplierbackoffice.DataSupplierFlowActionHandler
All Implemented Interfaces:
com.hybris.cockpitng.widgets.configurableflow.FlowActionHandler

public class DataSupplierFlowActionHandler extends Object implements com.hybris.cockpitng.widgets.configurableflow.FlowActionHandler
Action Handler of pressing the button from the GenericDataSupplierGenerationWizard widget. Verifies the systemId field, prepares parameters for generating the genericdatasupplier.war file and forwards it to DataSupplier. The generated file attaches to the appropriate field
  • Constructor Details

    • DataSupplierFlowActionHandler

      public DataSupplierFlowActionHandler()
  • Method Details

    • perform

      public void perform(com.hybris.cockpitng.config.jaxb.wizard.CustomType customType, com.hybris.cockpitng.widgets.configurableflow.FlowActionHandlerAdapter adapter, Map<String,String> parameters)
      (non-Javadoc)
      Specified by:
      perform in interface com.hybris.cockpitng.widgets.configurableflow.FlowActionHandler
      See Also:
      • FlowActionHandler.perform(com.hybris.cockpitng.config.jaxb.wizard.CustomType, com.hybris.cockpitng.widgets.configurableflow.FlowActionHandlerAdapter, Map<String, String>)
    • checkSystemId

      protected void checkSystemId(com.hybris.cockpitng.core.model.WidgetModel widgetModel)
      Validates entered System ID.
      Parameters:
      widgetModel - - The widget model from which the systemID will be retrieved.
      Throws:
      javax.validation.ValidationException - - If the System Id does not meet the requirements.
    • generateWarFile

      protected File generateWarFile(com.hybris.cockpitng.core.model.WidgetModel model)
      Stores entered properties and generate the war file
      Parameters:
      model - - the WidgetModel from which the field values will be taken.
      Returns:
      generated File
    • createMedia

      protected MediaModel createMedia(File generatedWar) throws JaloBusinessException
      Creates a media file and gets MediaModel
      Parameters:
      generatedWar - - Generated data supplier file
      Returns:
      created MediaModel
      Throws:
      JaloBusinessException - if the file does not exist
    • putFieldValue

      protected void putFieldValue(Properties additionalProperties, String key, String fieldName, com.hybris.cockpitng.core.model.WidgetModel model)
      Parameters:
      additionalProperties - - configuration used to generate the war file.
      key - - Data Supplier value key.
      fieldName - - field name from which the value will be taken.
      model - - the WidgetModel from which the field values will be taken.
    • getGenerationService

      public DataSupplierGenerationService getGenerationService()
      Returns:
      the GenerationService
    • getMediaService

      protected MediaService getMediaService()
      Returns:
      the MediaService
    • setMediaService

      public void setMediaService(MediaService mediaService)
      Parameters:
      mediaService - - sets MediaService
    • getModelService

      public ModelService getModelService()
    • setModelService

      public void setModelService(ModelService modelService)
      Parameters:
      modelService - - sets the ModelService