Class DynamicRegionalFormProcessor
java.lang.Object
org.broadleafcommerce.presentation.dialect.AbstractBroadleafModelModifierProcessor
org.broadleafcommerce.common.web.processor.FormProcessor
com.broadleafcommerce.i18n.enterprise.web.processor.DynamicRegionalFormProcessor
- All Implemented Interfaces:
org.broadleafcommerce.presentation.dialect.BroadleafModelModifierProcessor,org.broadleafcommerce.presentation.dialect.BroadleafProcessor
@Component("blDynamicRegionalFormProcessor")
@ConditionalOnTemplating
public class DynamicRegionalFormProcessor
extends org.broadleafcommerce.common.web.processor.FormProcessor
The following Thymeleaf processor will place the appropriate Dynamic Form
Fields given a valid
ISOCountry that is passed in
through
RedirectAttributes from a
controller. If one cannot be found, it will default to the override
ISOCountry passed in, or the Default Locale on the request if available.
This billing form should also add the CSRF token as a hidden param to the end of the form
Here is an example:
<blc:dynamic_regional_form th:object="${billingInfoForm}"
th:action="@{/checkout/billing}"
th:country="${billingInfoForm.address.isoCountryAlpha2?.alpha2}"
name="BILLING_FORM"
method="post" id="billing_info"
novalidate="novalidate">
...
...
</blc:dynamic_regional_form>
- Author:
- Elbert Bautista (elbertbautista), reginaldccole
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.broadleafcommerce.profile.core.service.CountryServiceprotected DynamicRegionalFormServiceprotected org.broadleafcommerce.common.security.service.ExploitProtectionServiceprotected org.broadleafcommerce.common.i18n.service.ISOServiceprotected org.broadleafcommerce.common.security.service.StaleStateProtectionServiceFields inherited from interface org.broadleafcommerce.presentation.dialect.BroadleafProcessor
DEFAULT_PRECEDENCE, DEFAULT_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetCountryFromLocale(Locale defaultLocale) org.broadleafcommerce.presentation.model.BroadleafTemplateModelModifierDTOgetInjectedModelAndTagAttributes(String rootTagName, Map<String, String> rootTagAttributes, org.broadleafcommerce.presentation.model.BroadleafTemplateContext context) getName()protected voidpopulateElementCountryVarialbe(Map<String, Object> localVariables) Create a variable 'countries' for the element that contains a list of all the available countriesprotected voidpopulateFormElement(Map<String, Object> localVariables, org.broadleafcommerce.common.i18n.domain.ISOCountry country, org.broadleafcommerce.common.web.form.BroadleafFormType formType) Methods inherited from class org.broadleafcommerce.common.web.processor.FormProcessor
getPrecedence, reprocessModelMethods inherited from class org.broadleafcommerce.presentation.dialect.AbstractBroadleafModelModifierProcessor
getPrefix, useSingleQuotes
-
Field Details
-
eps
protected org.broadleafcommerce.common.security.service.ExploitProtectionService eps -
spps
protected org.broadleafcommerce.common.security.service.StaleStateProtectionService spps -
dynamicRegionalFormService
-
isoService
protected org.broadleafcommerce.common.i18n.service.ISOService isoService -
countryService
protected org.broadleafcommerce.profile.core.service.CountryService countryService
-
-
Constructor Details
-
DynamicRegionalFormProcessor
public DynamicRegionalFormProcessor()
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceorg.broadleafcommerce.presentation.dialect.BroadleafProcessor- Overrides:
getNamein classorg.broadleafcommerce.common.web.processor.FormProcessor
-
getInjectedModelAndTagAttributes
public org.broadleafcommerce.presentation.model.BroadleafTemplateModelModifierDTO getInjectedModelAndTagAttributes(String rootTagName, Map<String, String> rootTagAttributes, org.broadleafcommerce.presentation.model.BroadleafTemplateContext context) - Specified by:
getInjectedModelAndTagAttributesin interfaceorg.broadleafcommerce.presentation.dialect.BroadleafModelModifierProcessor- Overrides:
getInjectedModelAndTagAttributesin classorg.broadleafcommerce.common.web.processor.FormProcessor
-
populateElementCountryVarialbe
Create a variable 'countries' for the element that contains a list of all the available countries- Parameters:
localVariables-
-
populateFormElement
protected void populateFormElement(Map<String, Object> localVariables, org.broadleafcommerce.common.i18n.domain.ISOCountry country, org.broadleafcommerce.common.web.form.BroadleafFormType formType) - Parameters:
localVariables-country-formType-
-
getCountryFromLocale
- Parameters:
defaultLocale-- Returns:
-