public class BroadleafRequestContext extends Object
BroadleafRequestProcessor}
Constructor and Description |
---|
BroadleafRequestContext() |
Modifier and Type | Method and Description |
---|---|
protected Locale |
convertLocaleToJavaLocale() |
static Locale |
convertLocaleToJavaLocale(Locale broadleafLocale) |
BroadleafRequestContext |
createLightWeightClone()
In some cases, it is useful to utilize a clone of the context that does not include the actual container request
and response information.
|
static BroadleafRequestContext |
createLightWeightCloneFromJson(String Json,
javax.persistence.EntityManager em)
Resurrect the BroadleafRequestContext state based on a JSON representation.
|
String |
createLightWeightCloneJson()
In some cases, it is useful to create a JSON representation of the context that does not include the actual container
request and response information.
|
Map<String,Object> |
getAdditionalProperties() |
Boolean |
getAdmin() |
Long |
getAdminUserId() |
BroadleafCurrency |
getBroadleafCurrency() |
static BroadleafRequestContext |
getBroadleafRequestContext() |
static BroadleafCurrency |
getCurrency() |
Catalog |
getCurrentCatalog() |
Site |
getCurrentProfile() |
DeployBehavior |
getDeployBehavior() |
DeployState |
getDeployState() |
EnforceEnterpriseCollectionBehaviorState |
getEnforceEnterpriseCollectionBehaviorState()
Defines the state in which sandboxable collections in the Enterprise module should adhere to Broadleaf defined behavior.
|
List<Long> |
getExplicitCatalogs() |
Boolean |
getIgnoreSite() |
Boolean |
getInternalIgnoreFilters()
Intended for internal use only
|
Boolean |
getInternalValidateFind() |
Currency |
getJavaCurrency()
Returns the java.util.Currency constructed from the org.broadleafcommerce.common.currency.domain.BroadleafCurrency.
|
Locale |
getJavaLocale()
Returns the java.util.Locale constructed from the org.broadleafcommerce.common.locale.domain.Locale.
|
Locale |
getLocale() |
org.springframework.context.MessageSource |
getMessageSource() |
Site |
getNonPersistentSite() |
javax.servlet.http.HttpServletRequest |
getRequest()
Gets the current request on the context
|
Object |
getRequestAttribute(String name)
Provide easy access to Request Attributes without introducing a tight dependency on the HttpRequest.
|
RequestDTO |
getRequestDTO() |
BroadleafCurrency |
getRequestedBroadleafCurrency() |
static Map<String,String[]> |
getRequestParameterMap() |
String |
getRequestURIWithoutContext() |
javax.servlet.http.HttpServletResponse |
getResponse()
Returns the response for the context
|
SandBox |
getSandBox() |
Long |
getSandBoxId() |
Site |
getSite()
Deprecated.
this has been changed to
getNonPersistentSite() to explicitly indicate that the site
being returned is not attached to a Hibernate session |
Theme |
getTheme() |
TimeZone |
getTimeZone() |
ValidateProductionChangesState |
getValidateProductionChangesState() |
org.springframework.web.context.request.WebRequest |
getWebRequest()
Returns the generic request for use outside of servlets (like in Portlets).
|
static boolean |
hasCurrency() |
static boolean |
hasLocale() |
boolean |
isProductionSandBox() |
boolean |
isSecure() |
void |
setAdditionalProperties(Map<String,Object> additionalProperties) |
void |
setAdmin(Boolean admin) |
void |
setAdminUserId(Long adminUserId) |
void |
setBroadleafCurrency(BroadleafCurrency broadleafCurrency) |
static void |
setBroadleafRequestContext(BroadleafRequestContext broadleafRequestContext) |
void |
setCurrentCatalog(Catalog currentCatalog) |
void |
setCurrentProfile(Site currentProfile) |
void |
setDeployBehavior(DeployBehavior deployBehavior) |
void |
setDeployState(DeployState deployState) |
void |
setEnforceEnterpriseCollectionBehaviorState(EnforceEnterpriseCollectionBehaviorState enforceEnterpriseCollectionBehaviorState)
Returns the state in which sandboxable collections in the Enterprise module should adhere to Broadleaf defined behavior.
|
void |
setExplicitCatalogs(List<Long> explicitCatalogs) |
void |
setIgnoreSite(Boolean ignoreSite) |
void |
setInternalIgnoreFilters(Boolean internalIgnoreFilters)
Used to ignore all of the underlying automatic Hibernate filters applied by Broadleaf (e.g.
|
void |
setInternalValidateFind(Boolean internalValidateFind)
Only relevant in multi-tenant scenarios with site-level overrides in a catalog or profile, and only when querying by primary key
(e.g.
|
void |
setLocale(Locale locale) |
void |
setMessageSource(org.springframework.context.MessageSource messageSource) |
void |
setNonPersistentSite(Site site) |
void |
setRequest(javax.servlet.http.HttpServletRequest request)
Sets the current request on the context.
|
void |
setRequestDTO(RequestDTO requestDTO) |
void |
setRequestedBroadleafCurrency(BroadleafCurrency requestedCurrency) |
void |
setResponse(javax.servlet.http.HttpServletResponse response)
Sets the response on the context
|
void |
setSandBox(SandBox sandBox) |
void |
setSite(Site site)
Deprecated.
this has been changed to
#setNonPersistentSite() to explicitly indicate that the site being set
is not attached to an active Hibernate session |
void |
setTheme(Theme theme) |
void |
setTimeZone(TimeZone timeZone) |
void |
setValidateProductionChangesState(ValidateProductionChangesState validateProductionChangesState) |
void |
setWebRequest(org.springframework.web.context.request.WebRequest webRequest)
Sets the generic request on the context.
|
protected static final org.apache.commons.logging.Log LOG
protected javax.servlet.http.HttpServletRequest request
protected javax.servlet.http.HttpServletResponse response
protected org.springframework.web.context.request.WebRequest webRequest
protected SandBox sandBox
protected Locale locale
protected TimeZone timeZone
protected BroadleafCurrency broadleafCurrency
protected BroadleafCurrency requestedCurrency
protected Site site
protected Theme theme
protected Locale javaLocale
protected Currency javaCurrency
protected Catalog currentCatalog
protected Site currentProfile
protected Boolean ignoreSite
protected org.springframework.context.MessageSource messageSource
protected RequestDTO requestDTO
protected Boolean isAdmin
protected Long adminUserId
protected DeployState deployState
protected DeployBehavior deployBehavior
protected Boolean internalIgnoreFilters
protected ValidateProductionChangesState validateProductionChangesState
protected EnforceEnterpriseCollectionBehaviorState enforceEnterpriseCollectionBehaviorState
protected Boolean internalValidateFind
public static BroadleafRequestContext getBroadleafRequestContext()
public static void setBroadleafRequestContext(BroadleafRequestContext broadleafRequestContext)
public static boolean hasLocale()
public static boolean hasCurrency()
public static BroadleafCurrency getCurrency()
public javax.servlet.http.HttpServletRequest getRequest()
public Object getRequestAttribute(String name)
public void setRequest(javax.servlet.http.HttpServletRequest request)
setWebRequest(WebRequest)
by wrapping
request in a ServletWebRequest
.request
- public javax.servlet.http.HttpServletResponse getResponse()
public void setResponse(javax.servlet.http.HttpServletResponse response)
response
- public void setWebRequest(org.springframework.web.context.request.WebRequest webRequest)
ServletWebRequest
then
setRequest(HttpServletRequest)
will be invoked as well with the native underlying HttpServletRequest
passed as a parameter.
ServletWebRequest
then an attempt is made to set the response
(note that this could be null if the ServletWebRequest was not instantiated with both the HttpServletRequest
and HttpServletResponse
webRequest
- public org.springframework.web.context.request.WebRequest getWebRequest()
setRequest(HttpServletRequest)
#setWebRequest(WebRequest)}
@Deprecated public Site getSite()
getNonPersistentSite()
to explicitly indicate that the site
being returned is not attached to a Hibernate session@Deprecated public void setSite(Site site)
#setNonPersistentSite()
to explicitly indicate that the site being set
is not attached to an active Hibernate sessionpublic Site getNonPersistentSite()
Site
, they should be manually cloned by overriding the clone() method.public void setNonPersistentSite(Site site)
public SandBox getSandBox()
public Long getSandBoxId()
public boolean isProductionSandBox()
public void setSandBox(SandBox sandBox)
public Locale getLocale()
public Locale getJavaLocale()
public Currency getJavaCurrency()
public void setLocale(Locale locale)
public String getRequestURIWithoutContext()
protected Locale convertLocaleToJavaLocale()
public boolean isSecure()
public Theme getTheme()
public void setTheme(Theme theme)
public BroadleafCurrency getBroadleafCurrency()
public void setBroadleafCurrency(BroadleafCurrency broadleafCurrency)
public BroadleafCurrency getRequestedBroadleafCurrency()
public void setRequestedBroadleafCurrency(BroadleafCurrency requestedCurrency)
public Catalog getCurrentCatalog()
public void setCurrentCatalog(Catalog currentCatalog)
public Site getCurrentProfile()
public void setCurrentProfile(Site currentProfile)
public Boolean getIgnoreSite()
public void setIgnoreSite(Boolean ignoreSite)
public void setAdditionalProperties(Map<String,Object> additionalProperties)
public org.springframework.context.MessageSource getMessageSource()
public void setMessageSource(org.springframework.context.MessageSource messageSource)
public TimeZone getTimeZone()
public void setTimeZone(TimeZone timeZone)
public RequestDTO getRequestDTO()
public void setRequestDTO(RequestDTO requestDTO)
public Boolean getAdmin()
public void setAdmin(Boolean admin)
public Long getAdminUserId()
public void setAdminUserId(Long adminUserId)
public Boolean getInternalIgnoreFilters()
public void setInternalIgnoreFilters(Boolean internalIgnoreFilters)
public Boolean getInternalValidateFind()
setInternalValidateFind(Boolean)}
public void setInternalValidateFind(Boolean internalValidateFind)
public DeployState getDeployState()
public void setDeployState(DeployState deployState)
public DeployBehavior getDeployBehavior()
public void setDeployBehavior(DeployBehavior deployBehavior)
public ValidateProductionChangesState getValidateProductionChangesState()
public void setValidateProductionChangesState(ValidateProductionChangesState validateProductionChangesState)
public EnforceEnterpriseCollectionBehaviorState getEnforceEnterpriseCollectionBehaviorState()
PersistentCollection
extensions in the Enterprise module will delegate
to the standard Hibernate behavior. This is useful when the desire is to build and persist entity object structures (that
the Enterprise module would otherwise interpret as sandboxable) without interference from the Enterprise module
on the collection persistence behavior. When the Enterprise module is loaded, the behavior is enforced by default.public void setEnforceEnterpriseCollectionBehaviorState(EnforceEnterpriseCollectionBehaviorState enforceEnterpriseCollectionBehaviorState)
PersistentCollection
extensions in the Enterprise module will delegate
to the standard Hibernate behavior. This is useful when the desire is to build and persist entity object structures (that
the Enterprise module would otherwise interpret as sandboxable) without interference from the Enterprise module
on the collection persistence behavior. When the Enterprise module is loaded, the behavior is enforced by default.enforceEnterpriseCollectionBehaviorState
- public BroadleafRequestContext createLightWeightClone()
public String createLightWeightCloneJson()
public static BroadleafRequestContext createLightWeightCloneFromJson(String Json, javax.persistence.EntityManager em)
Json
- em
- Copyright © 2019. All rights reserved.