public abstract class AbstractImpersonationController
extends DefaultWidgetController
ImpersonationService to allow controllers to call business
logic in the impersonation context suitable for the instore application. To do so, extend from this class and call
the facade methods within
#executeInContext(de.hybris.platform.commerceservices.impersonation.ImpersonationService.Executor) method.| Constructor and Description |
|---|
AbstractImpersonationController() |
| Modifier and Type | Method and Description |
|---|---|
protected ImpersonationContext |
createImpersonationContext()
Creates
ImpersonationContext suitable for instore application. |
protected <R,E extends Throwable> |
executeInContext(<any> executor)
Executes the given Executor in the context created by
createImpersonationContext(). |
protected CatalogVersionService |
getCatalogVersionService() |
protected Collection<CatalogVersionModel> |
getContextCatalogVersions(BaseStoreModel baseStore,
BaseSiteModel baseSite,
EmployeeModel employee)
Computes product catalogVersions for impersonated execution
|
protected CurrencyModel |
getContextCurrency(EmployeeModel employee,
BaseStoreModel baseStore)
Computes currency for impersonated execution
|
protected LanguageModel |
getContextLanguage(EmployeeModel employee,
BaseSiteModel baseSite,
BaseStoreModel baseStore)
Computes language for impersonated execution
|
protected ImpersonationService |
getImpersonationService() |
protected InStoreService |
getInStoreService() |
protected SearchRestrictionService |
getSearchRestrictionService() |
protected SessionService |
getSessionService() |
protected UserService |
getUserService() |
void |
setCatalogVersionService(CatalogVersionService catalogVersionService) |
void |
setImpersonationService(ImpersonationService impersonationService) |
void |
setInStoreService(InStoreService inStoreService) |
void |
setSearchRestrictionService(SearchRestrictionService searchRestrictionService) |
void |
setSessionService(SessionService sessionService) |
void |
setUserService(UserService userService) |
protected ImpersonationContext createImpersonationContext()
ImpersonationContext suitable for instore application. The context elements:
InStoreService logic (and with search restrictions disabled).ImpersonationContextprotected Collection<CatalogVersionModel> getContextCatalogVersions(BaseStoreModel baseStore, BaseSiteModel baseSite, EmployeeModel employee)
baseStore - baseSite - employee - Collection of CatalogVersionModelprotected LanguageModel getContextLanguage(EmployeeModel employee, BaseSiteModel baseSite, BaseStoreModel baseStore)
employee - baseSite - baseStore - LanguageModelprotected CurrencyModel getContextCurrency(EmployeeModel employee, BaseStoreModel baseStore)
employee - baseStore - CurrencyModelprotected <R,E extends Throwable> R executeInContext(<any> executor) throws E extends Throwable
createImpersonationContext().R - - Executor's return typeE - - Exception thrown by executor, if any (Use ImpersonationService.Nothing if your executor doesn't throw
a checked exception.)executor - - Executor to runEE extends Throwableprotected InStoreService getInStoreService()
public void setInStoreService(InStoreService inStoreService)
inStoreService - the inStoreService to setprotected ImpersonationService getImpersonationService()
public void setImpersonationService(ImpersonationService impersonationService)
impersonationService - the impersonationService to setprotected UserService getUserService()
public void setUserService(UserService userService)
userService - the userService to setprotected CatalogVersionService getCatalogVersionService()
public void setCatalogVersionService(CatalogVersionService catalogVersionService)
catalogVersionService - the catalogVersionService to setprotected SessionService getSessionService()
public void setSessionService(SessionService sessionService)
sessionService - the sessionService to setprotected SearchRestrictionService getSearchRestrictionService()
public void setSearchRestrictionService(SearchRestrictionService searchRestrictionService)
searchRestrictionService - the searchRestrictionService to setCopyright © 2017 SAP SE. All Rights Reserved.