Class TransformerYFormPreprocessorStrategy
java.lang.Object
de.hybris.platform.xyformsfacades.strategy.preprocessor.TransformerYFormPreprocessorStrategy
- All Implemented Interfaces:
YFormPreprocessorStrategy
- Direct Known Subclasses:
EmptyTransformerYFormPreprocessorStrategy,ReferenceIdTransformerYFormPreprocessorStrategy,XsltTransformerYFormPreprocessorStrategy
public abstract class TransformerYFormPreprocessorStrategy
extends Object
implements YFormPreprocessorStrategy
Before a form is sent to the browser a transformation can be applied to it.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetFormDataContent(String applicationId, String formId, String formDataId, Map<String, Object> params) voidprocess(String applicationId, String formId, YFormDataActionEnum action, String formDataId) The algorithm is as follows: It gets the content for a given formDataId Applies the transformation Creates a DRAFT record for the given formDataId If action is NEW, the formDataId should not exist.voidprocess(String applicationId, String formId, YFormDataActionEnum action, String formDataId, Map<String, Object> params) The algorithm is as follows: It gets the content for a given formDataId Applies the transformation Creates a DRAFT record for the given formDataId If action is NEW, the formDataId should not exist.protected voidsave(String applicationId, String formId, String formDataId, String content, Map<String, Object> params) voidsetYFormFacade(YFormFacade yformFacade) protected abstract StringApplies the actual transformation to a formDataprotected voidvalidate(String applicationId, String formId, YFormDataActionEnum action, String formDataId, Map<String, Object> params)
-
Constructor Details
-
TransformerYFormPreprocessorStrategy
public TransformerYFormPreprocessorStrategy()
-
-
Method Details
-
transform
protected abstract String transform(String xmlContent, Map<String, Object> params) throws YFormProcessorExceptionApplies the actual transformation to a formData- Parameters:
xmlContent-params-- Throws:
YFormProcessorException
-
process
public void process(String applicationId, String formId, YFormDataActionEnum action, String formDataId) throws YFormServiceException, YFormProcessorException The algorithm is as follows:- It gets the content for a given formDataId
- Applies the transformation
- Creates a DRAFT record for the given formDataId
- If action is NEW, the formDataId should not exist.
- Specified by:
processin interfaceYFormPreprocessorStrategy- Throws:
YFormServiceExceptionYFormProcessorException
-
process
public void process(String applicationId, String formId, YFormDataActionEnum action, String formDataId, Map<String, Object> params) throws YFormServiceException, YFormProcessorExceptionThe algorithm is as follows:- It gets the content for a given formDataId
- Applies the transformation
- Creates a DRAFT record for the given formDataId
- If action is NEW, the formDataId should not exist.
- Specified by:
processin interfaceYFormPreprocessorStrategy- Throws:
YFormServiceExceptionYFormProcessorException
-
validate
protected void validate(String applicationId, String formId, YFormDataActionEnum action, String formDataId, Map<String, Object> params) throws YFormServiceException- Throws:
YFormServiceException
-
getFormDataContent
protected String getFormDataContent(String applicationId, String formId, String formDataId, Map<String, Object> params) throws YFormServiceException- Throws:
YFormServiceException
-
save
protected void save(String applicationId, String formId, String formDataId, String content, Map<String, Object> params) throws YFormServiceException- Throws:
YFormServiceException
-
getYFormFacade
- Returns:
- the yformFacade
-
setYFormFacade
- Parameters:
yformFacade- the yformFacade to set
-