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 ClassesModifier and TypeClassDescriptionprotected static class -
Field Summary
Fields inherited from class de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
modelService, typeService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()protected CockpitConfigurationService<T extends UIComponentConfiguration>
TgetComponentConfiguration(ObjectTemplate template, String code, 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, String code, Class<T> expectedClass) Returns a UI component configuration for the given role, object template code and type.The ultimate role for ui configuration lookupsReturns all roles of the session user for which there are ui components available.getPossibleRoles(UserModel user) Returns all roles of the given user for which there are ui components available.The role to look up ui configurations by default (if no role is given).protected SessionServiceprotected List<ObjectType>getTypePath(ObjectTemplate template) protected UserServicevoidinit()voidvoidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetCockpitConfigurationService(CockpitConfigurationService cockpitConfigurationService) voidsetDefaultPersistingStrategy(ConfigurationPersistingStrategy defaultPersistingStrategy) voidsetFallbackRoleName(String roleName) <T extends UIComponentConfiguration>
voidsetLocalComponentConfiguration(T configuration, UserModel user, ObjectTemplate objectTemplate, String code, 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(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
-
Constructor Details
-
DefaultUIConfigurationService
public DefaultUIConfigurationService()
-
-
Method Details
-
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:
-
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:
-
setSessionRole
Description copied from interface:UIConfigurationServiceSet the current session's role- Specified by:
setSessionRolein interfaceUIConfigurationService- Parameters:
role- the role
-
setSessionRole
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, String code, 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
-
getComponentConfiguration
public <T extends UIComponentConfiguration> T getComponentConfiguration(ObjectTemplate template, String code, 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:
-
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
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
-
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
-
setUiComponentCache
-
setLocalComponentConfiguration
public <T extends UIComponentConfiguration> void setLocalComponentConfiguration(T configuration, UserModel user, ObjectTemplate objectTemplate, String code, 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
-
getDefaultPersistingStrategy
-
init
public void init() -
clear
public void clear() -
getCockpitConfigurationService
-
setCockpitConfigurationService
-
getUserService
-
setUserService
-
getSessionService
-
setSessionService
-
getMediaService
-
setMediaService
-