Package org.broadleafcommerce.common.web
Class BroadleafSandBoxResolverImpl
java.lang.Object
org.broadleafcommerce.common.web.BroadleafSandBoxResolverImpl
- All Implemented Interfaces:
BroadleafSandBoxResolver
@Component("blSandBoxResolver")
public class BroadleafSandBoxResolverImpl
extends Object
implements BroadleafSandBoxResolver
Responsible for determining the SandBox to use for the current request.
SandBox's are used to store a user's changes to products, content-items, etc.
until they are ready to be pushed to production.
If a request is being served with a SandBox parameter, it indicates that the user wants to see the site as if their changes were applied.
- Author:
- bpolster
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected CrossAppAuthServicestatic StringRequest attribute to store the current sandboxprotected BooleanProperty used to disable sandbox mode.Fields inherited from interface org.broadleafcommerce.common.web.BroadleafSandBoxResolver
SANDBOX_ID_VAR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets whether or not the site can be viewed in preview mode.protected LonglookupSandboxId(org.springframework.web.context.request.WebRequest request) If another filter has already set the language as a request attribute, that will be honored.protected DatereadDateFromRequest(org.springframework.web.context.request.WebRequest request) resolveSandBox(jakarta.servlet.http.HttpServletRequest request, Site site) Determines the current sandbox based on other parameters on the request such as the blSandBoxId parameters.resolveSandBox(org.springframework.web.context.request.WebRequest request, Site site) Resolve the sandbox for the given site and requestprotected voidsetContentTime(org.springframework.web.context.request.WebRequest request) Allows a user in SandBox mode to override the current time and date being used by the system.voidsetSandBoxPreviewEnabled(Boolean sandBoxPreviewEnabled)
-
Field Details
-
CLIENT_TIMEZONE
- See Also:
-
SANDBOX_VAR
Request attribute to store the current sandbox -
sandBoxPreviewEnabled
Property used to disable sandbox mode. Some implementations will want to turn off sandboxes in production. -
crossAppAuthService
@Autowired(required=false) @Qualifier("blCrossAppAuthService") protected CrossAppAuthService crossAppAuthService
-
-
Constructor Details
-
BroadleafSandBoxResolverImpl
public BroadleafSandBoxResolverImpl()
-
-
Method Details
-
resolveSandBox
Determines the current sandbox based on other parameters on the request such as the blSandBoxId parameters.If the
getSandBoxPreviewEnabled(), then this method will not return a user SandBox.- Specified by:
resolveSandBoxin interfaceBroadleafSandBoxResolver
-
resolveSandBox
public SandBox resolveSandBox(org.springframework.web.context.request.WebRequest request, Site site) Description copied from interface:BroadleafSandBoxResolverResolve the sandbox for the given site and request- Specified by:
resolveSandBoxin interfaceBroadleafSandBoxResolver- Returns:
- the sandbox for the current request
-
lookupSandboxId
If another filter has already set the language as a request attribute, that will be honored. Otherwise, the request parameter is checked followed by the session attribute.- Parameters:
request-- Returns:
-
setContentTime
protected void setContentTime(org.springframework.web.context.request.WebRequest request) Allows a user in SandBox mode to override the current time and date being used by the system.- Parameters:
request-
-
readDateFromRequest
protected Date readDateFromRequest(org.springframework.web.context.request.WebRequest request) throws ParseException - Throws:
ParseException
-
getSandBoxPreviewEnabled
Sets whether or not the site can be viewed in preview mode.- Returns:
-
setSandBoxPreviewEnabled
-