Interface UIConfigurationService

All Known Implementing Classes:
DefaultUIConfigurationService

public interface UIConfigurationService
Service to obtain UIComponentConfigurations 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 Details

    • getPossibleRoles

      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

      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:
    • getSessionRole

      UIRole getSessionRole()
      The role to look up ui configurations by default (if no role is given).
      Returns:
      the session role
      See Also:
    • setSessionRole

      void setSessionRole(UIRole role)
      Set the current session's role
      Parameters:
      role - the role
    • setSessionRole

      void setSessionRole(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, String code, 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:
      1. Look up a component for the given role, object tempate and code
      2. If nothing found look up a component for the fallback role as returned by getFallbackRole()
      3. If nothing found ask the UIComponentConfigurationFactory registered 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, String code, Class<T> expectedClass)
      Returns a UI component configuration for the given parameters and uses the session role as role. See getComponentConfiguration(UIRole, ObjectTemplate, String, Class) for details.
      Type Parameters:
      T - the type of the ui component configuration
      Parameters:
      template - the
      code -
      expectedClass -
      See Also:
    • setLocalComponentConfiguration

      <T extends UIComponentConfiguration> void setLocalComponentConfiguration(T configuration, UserModel user, ObjectTemplate template, String code, Class<T> expectedClass)
      Stores given UI configuration for given user and given parameters.
      Parameters:
      configuration - the configuration to be stored
      user - user to set the local configuration for
      template - the template this configuration is related to
      code - the code this configuration is related to
      expectedClass - the expected class