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 Details

    • CLIENT_TIMEZONE

      public static final String CLIENT_TIMEZONE
      See Also:
    • SANDBOX_VAR

      public static String SANDBOX_VAR
      Request attribute to store the current sandbox
    • sandBoxPreviewEnabled

      protected Boolean 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

      public SandBox resolveSandBox(jakarta.servlet.http.HttpServletRequest request, Site site)
      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:
      resolveSandBox in interface BroadleafSandBoxResolver
    • resolveSandBox

      public SandBox resolveSandBox(org.springframework.web.context.request.WebRequest request, Site site)
      Description copied from interface: BroadleafSandBoxResolver
      Resolve the sandbox for the given site and request
      Specified by:
      resolveSandBox in interface BroadleafSandBoxResolver
      Returns:
      the sandbox for the current request
    • lookupSandboxId

      protected Long lookupSandboxId(org.springframework.web.context.request.WebRequest request)
      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

      public Boolean getSandBoxPreviewEnabled()
      Sets whether or not the site can be viewed in preview mode.
      Returns:
    • setSandBoxPreviewEnabled

      public void setSandBoxPreviewEnabled(Boolean sandBoxPreviewEnabled)