Class DefaultUIConfigurationService
- java.lang.Object
-
- de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
-
- de.hybris.platform.cockpit.services.config.impl.DefaultUIConfigurationService
-
- All Implemented Interfaces:
UIConfigurationService,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
public class DefaultUIConfigurationService extends AbstractServiceImpl implements UIConfigurationService, org.springframework.context.ApplicationContextAware
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classDefaultUIConfigurationService.MyEnumerationInvalidationListener
-
Field Summary
-
Fields inherited from class de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
modelService, typeService
-
-
Constructor Summary
Constructors Constructor Description DefaultUIConfigurationService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()protected CockpitConfigurationServicegetCockpitConfigurationService()<T extends UIComponentConfiguration>
TgetComponentConfiguration(ObjectTemplate template, java.lang.String code, java.lang.Class<T> expectedClass)Returns a UI component configuration for the given parameters and usesthe session roleas role.<T extends UIComponentConfiguration>
TgetComponentConfiguration(UIRole role, ObjectTemplate objectTemplate, java.lang.String code, java.lang.Class<T> expectedClass)Returns a UI component configuration for the given role, object template code and type.ConfigurationPersistingStrategygetDefaultPersistingStrategy()UIRolegetFallbackRole()The ultimate role for ui configuration lookupsMediaServicegetMediaService()java.util.List<UIRole>getPossibleRoles()Returns all roles of the session user for which there are ui components available.java.util.List<UIRole>getPossibleRoles(UserModel user)Returns all roles of the given user for which there are ui components available.UIRolegetSessionRole()The role to look up ui configurations by default (if no role is given).protected SessionServicegetSessionService()protected java.util.List<ObjectType>getTypePath(ObjectTemplate template)protected UserServicegetUserService()voidinit()voidinitPersistingStrategies()voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)voidsetCockpitConfigurationService(CockpitConfigurationService cockpitConfigurationService)voidsetDefaultPersistingStrategy(ConfigurationPersistingStrategy defaultPersistingStrategy)voidsetFallbackRoleName(java.lang.String roleName)<T extends UIComponentConfiguration>
voidsetLocalComponentConfiguration(T configuration, UserModel user, ObjectTemplate objectTemplate, java.lang.String code, java.lang.Class<T> expectedClass)Stores given UI configuration for given user and given parameters.voidsetLoginService(LoginService loginService)voidsetMediaService(MediaService mediaService)voidsetSessionRole(UIRole role)Set the current session's rolevoidsetSessionRole(java.lang.String role)Set the current session's role by namevoidsetSessionService(SessionService sessionService)voidsetUiComponentCache(UIComponentCache componentCache)voidsetUserService(UserService userService)-
Methods inherited from class de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
getEnum, getEnums, getLocalizedLabel, getLocalizedLabel, getModelService, getTypeService, setCockpitTypeService, setLabelResolver, setModelService
-
-
-
-
Method Detail
-
getFallbackRole
public UIRole getFallbackRole()
Description copied from interface:UIConfigurationServiceThe ultimate role for ui configuration lookups- Specified by:
getFallbackRolein interfaceUIConfigurationService- Returns:
- The fallback role for ui configuration lookups
- See Also:
UIConfigurationService.getComponentConfiguration(UIRole, ObjectTemplate, String, Class)
-
getSessionRole
public UIRole getSessionRole()
Description copied from interface:UIConfigurationServiceThe role to look up ui configurations by default (if no role is given).- Specified by:
getSessionRolein interfaceUIConfigurationService- Returns:
- the session role
- See Also:
UIConfigurationService.getComponentConfiguration(ObjectTemplate, String, Class)
-
setSessionRole
public void setSessionRole(UIRole role)
Description copied from interface:UIConfigurationServiceSet the current session's role- Specified by:
setSessionRolein interfaceUIConfigurationService- Parameters:
role- the role
-
setSessionRole
public void setSessionRole(java.lang.String role)
Description copied from interface:UIConfigurationServiceSet the current session's role by name- Specified by:
setSessionRolein interfaceUIConfigurationService- Parameters:
role- the name of the role
-
getComponentConfiguration
public <T extends UIComponentConfiguration> T getComponentConfiguration(UIRole role, ObjectTemplate objectTemplate, java.lang.String code, java.lang.Class<T> expectedClass)
Description copied from interface:UIConfigurationServiceReturns a UI component configuration for the given role, object template code and type. To search for the component it performs the following steps:- Look up a component for the given role, object tempate and code
- If nothing found look up a component for the fallback role as returned by
UIConfigurationService.getFallbackRole() - If nothing found ask the
UIComponentConfigurationFactoryregistered for the expexted class to create a default configuration
- Specified by:
getComponentConfigurationin interfaceUIConfigurationService
-
getTypePath
protected java.util.List<ObjectType> getTypePath(ObjectTemplate template)
-
getComponentConfiguration
public <T extends UIComponentConfiguration> T getComponentConfiguration(ObjectTemplate template, java.lang.String code, java.lang.Class<T> expectedClass)
Description copied from interface:UIConfigurationServiceReturns a UI component configuration for the given parameters and usesthe session roleas role. SeeUIConfigurationService.getComponentConfiguration(UIRole, ObjectTemplate, String, Class)for details.- Specified by:
getComponentConfigurationin interfaceUIConfigurationService- Type Parameters:
T- the type of the ui component configuration- Parameters:
template- the- See Also:
UIConfigurationService.getComponentConfiguration(UIRole, ObjectTemplate, String, Class)
-
getPossibleRoles
public java.util.List<UIRole> getPossibleRoles()
Description copied from interface:UIConfigurationServiceReturns all roles of the session user for which there are ui components available. If the user belongs to hybris UserGroups G1, G2 and G3 and there are configurations for G1 and G3 this method will return only G1 and G3.- Specified by:
getPossibleRolesin interfaceUIConfigurationService- Returns:
- all roles for which there are ui components available
-
getPossibleRoles
public java.util.List<UIRole> getPossibleRoles(UserModel user)
Description copied from interface:UIConfigurationServiceReturns all roles of the given user for which there are ui components available. If the user belongs to hybris UserGroups G1, G2 and G3 and there are configurations for G1 and G3 this method will return only G1 and G3.- Specified by:
getPossibleRolesin interfaceUIConfigurationService- Parameters:
user- the user to search roles for- Returns:
- all roles for which there are ui components available
-
setLoginService
public void setLoginService(LoginService loginService)
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
setFallbackRoleName
public void setFallbackRoleName(java.lang.String roleName)
-
setUiComponentCache
public void setUiComponentCache(UIComponentCache componentCache)
-
setLocalComponentConfiguration
public <T extends UIComponentConfiguration> void setLocalComponentConfiguration(T configuration, UserModel user, ObjectTemplate objectTemplate, java.lang.String code, java.lang.Class<T> expectedClass)
Description copied from interface:UIConfigurationServiceStores given UI configuration for given user and given parameters.- Specified by:
setLocalComponentConfigurationin interfaceUIConfigurationService- Parameters:
configuration- the configuration to be storeduser- user to set the local configuration forobjectTemplate- the template this configuration is related tocode- the code this configuration is related toexpectedClass- the expected class
-
initPersistingStrategies
public void initPersistingStrategies()
-
setDefaultPersistingStrategy
public void setDefaultPersistingStrategy(ConfigurationPersistingStrategy defaultPersistingStrategy)
-
getDefaultPersistingStrategy
public ConfigurationPersistingStrategy getDefaultPersistingStrategy()
-
init
public void init()
-
clear
public void clear()
-
getCockpitConfigurationService
protected CockpitConfigurationService getCockpitConfigurationService()
-
setCockpitConfigurationService
public void setCockpitConfigurationService(CockpitConfigurationService cockpitConfigurationService)
-
getUserService
protected UserService getUserService()
-
setUserService
public void setUserService(UserService userService)
-
getSessionService
protected SessionService getSessionService()
-
setSessionService
public void setSessionService(SessionService sessionService)
-
getMediaService
public MediaService getMediaService()
-
setMediaService
public void setMediaService(MediaService mediaService)
-
-