Interface UIConfigurationService
-
- All Known Implementing Classes:
DefaultUIConfigurationService
public interface UIConfigurationServiceService to obtainUIComponentConfigurations and to manage UI roles. A ui component configuration is a description of a ui component such as list view, editor etc. For each of these components a user can have different configurations. The currently active configuration is determined through his UI role. A UI role is equal to a hybris principal, most often a UserGroup, but may also be a user himself.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <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 template, java.lang.String code, java.lang.Class<T> expectedClass)Returns a UI component configuration for the given role, object template code and type.UIRolegetFallbackRole()The ultimate role for ui configuration lookupsjava.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).<T extends UIComponentConfiguration>
voidsetLocalComponentConfiguration(T configuration, UserModel user, ObjectTemplate template, java.lang.String code, java.lang.Class<T> expectedClass)Stores given UI configuration for given user and given parameters.voidsetSessionRole(UIRole role)Set the current session's rolevoidsetSessionRole(java.lang.String roleName)Set the current session's role by name
-
-
-
Method Detail
-
getPossibleRoles
java.util.List<UIRole> getPossibleRoles()
Returns 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.- Returns:
- all roles for which there are ui components available
-
getPossibleRoles
java.util.List<UIRole> getPossibleRoles(UserModel user)
Returns 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.- Parameters:
user- the user to search roles for- Returns:
- all roles for which there are ui components available
-
getFallbackRole
UIRole getFallbackRole()
The ultimate role for ui configuration lookups- Returns:
- The fallback role for ui configuration lookups
- See Also:
getComponentConfiguration(UIRole, ObjectTemplate, String, Class)
-
getSessionRole
UIRole getSessionRole()
The role to look up ui configurations by default (if no role is given).- Returns:
- the session role
- See Also:
getComponentConfiguration(ObjectTemplate, String, Class)
-
setSessionRole
void setSessionRole(UIRole role)
Set the current session's role- Parameters:
role- the role
-
setSessionRole
void setSessionRole(java.lang.String roleName)
Set the current session's role by name- Parameters:
roleName- the name of the role
-
getComponentConfiguration
<T extends UIComponentConfiguration> T getComponentConfiguration(UIRole role, ObjectTemplate template, java.lang.String code, java.lang.Class<T> expectedClass)
Returns 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
getFallbackRole() - If nothing found ask the
UIComponentConfigurationFactoryregistered for the expexted class to create a default configuration
- Type Parameters:
T-- Parameters:
role-template-code-expectedClass-
-
getComponentConfiguration
<T extends UIComponentConfiguration> T getComponentConfiguration(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. SeegetComponentConfiguration(UIRole, ObjectTemplate, String, Class)for details.- Type Parameters:
T- the type of the ui component configuration- Parameters:
template- thecode-expectedClass-- See Also:
getComponentConfiguration(UIRole, ObjectTemplate, String, Class)
-
setLocalComponentConfiguration
<T extends UIComponentConfiguration> void setLocalComponentConfiguration(T configuration, UserModel user, ObjectTemplate template, java.lang.String code, java.lang.Class<T> expectedClass)
Stores given UI configuration for given user and given parameters.- Parameters:
configuration- the configuration to be storeduser- user to set the local configuration fortemplate- the template this configuration is related tocode- the code this configuration is related toexpectedClass- the expected class
-
-