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.resolveSandBox(javax.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 requestvoidsetSandBoxPreviewEnabled(Boolean sandBoxPreviewEnabled)
-
Field Details
-
sandBoxPreviewEnabled
Property used to disable sandbox mode. Some implementations will want to turn off sandboxes in production. -
SANDBOX_VAR
Request attribute to store the current sandbox -
CLIENT_TIMEZONE
- See Also:
-
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 thegetSandBoxPreviewEnabled(), 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
-
getSandBoxPreviewEnabled
Sets whether or not the site can be viewed in preview mode.- Returns:
-
setSandBoxPreviewEnabled
-