Class DataSupplierFlowActionHandler

  • All Implemented Interfaces:
    com.hybris.cockpitng.widgets.configurableflow.FlowActionHandler

    public class DataSupplierFlowActionHandler
    extends java.lang.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 Detail

      • DataSupplierFlowActionHandler

        public DataSupplierFlowActionHandler()
    • Method Detail

      • perform

        public void perform​(com.hybris.cockpitng.config.jaxb.wizard.CustomType customType,
                            com.hybris.cockpitng.widgets.configurableflow.FlowActionHandlerAdapter adapter,
                            java.util.Map<java.lang.String,​java.lang.String> parameters)
        (non-Javadoc)
        Specified by:
        perform in interface com.hybris.cockpitng.widgets.configurableflow.FlowActionHandler
        See Also:
        com.hybris.cockpitng.widgets.configurableflow.FlowActionHandler#perform(com.hybris.cockpitng.config.jaxb. wizard. CustomType, com.hybris.cockpitng.widgets.configurableflow.FlowActionHandlerAdapter, Map)
      • 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 java.io.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​(java.io.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​(java.util.Properties additionalProperties,
                                     java.lang.String key,
                                     java.lang.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.
      • getMediaService

        protected MediaService getMediaService()
        Returns:
        the MediaService
      • setMediaService

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

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