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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckSystemId(com.hybris.cockpitng.core.model.WidgetModel widgetModel) Validates entered System ID.protected MediaModelcreateMedia(File generatedWar) Creates a media file and gets MediaModelprotected FilegenerateWarFile(com.hybris.cockpitng.core.model.WidgetModel model) Stores entered properties and generate the war fileprotected MediaServicevoidperform(com.hybris.cockpitng.config.jaxb.wizard.CustomType customType, com.hybris.cockpitng.widgets.configurableflow.FlowActionHandlerAdapter adapter, Map<String, String> parameters) (non-Javadoc)protected voidputFieldValue(Properties additionalProperties, String key, String fieldName, com.hybris.cockpitng.core.model.WidgetModel model) voidsetMediaService(MediaService mediaService) voidsetModelService(ModelService modelService)
-
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:
performin interfacecom.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
Stores entered properties and generate the war file- Parameters:
model- - the WidgetModel from which the field values will be taken.- Returns:
- generated File
-
createMedia
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
- Returns:
- the GenerationService
-
getMediaService
- Returns:
- the MediaService
-
setMediaService
- Parameters:
mediaService- - sets MediaService
-
getModelService
-
setModelService
- Parameters:
modelService- - sets the ModelService
-