Class DataSupplierFlowActionHandler
- java.lang.Object
-
- com.hybris.hybrisdatasupplierbackoffice.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 Summary
Constructors Constructor Description DataSupplierFlowActionHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkSystemId(com.hybris.cockpitng.core.model.WidgetModel widgetModel)
Validates entered System ID.protected MediaModel
createMedia(java.io.File generatedWar)
Creates a media file and gets MediaModelprotected java.io.File
generateWarFile(com.hybris.cockpitng.core.model.WidgetModel model)
Stores entered properties and generate the war fileDataSupplierGenerationService
getGenerationService()
protected MediaService
getMediaService()
ModelService
getModelService()
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)protected void
putFieldValue(java.util.Properties additionalProperties, java.lang.String key, java.lang.String fieldName, com.hybris.cockpitng.core.model.WidgetModel model)
void
setMediaService(MediaService mediaService)
void
setModelService(ModelService modelService)
-
-
-
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 interfacecom.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.
-
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
-
-