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