Class AbstractUserProfileBean

  • Direct Known Subclasses:
    IdpReviewProfileBean, RegisterBean, VerifyProfileBean

    public abstract class AbstractUserProfileBean
    extends Object
    Abstract base for Freemarker context bean providing informations about user profile to render dynamic or crafted forms.
    Author:
    Vlastimil Elias
    • Constructor Detail

      • AbstractUserProfileBean

        public AbstractUserProfileBean​(javax.ws.rs.core.MultivaluedMap<String,​String> formData)
    • Method Detail

      • init

        protected void init​(KeycloakSession session,
                            boolean writeableOnly)
        Subclass have to call this method at the end of constructor to init user profile data.
        Parameters:
        session -
        writeableOnly - if true then only writeable (no read-only) attributes are put into template, if false then all readable attributes are there
      • getAttributeDefaultValues

        protected abstract Stream<String> getAttributeDefaultValues​(String name)
        Get attribute default values to be pre-filled into the form on first show.
        Parameters:
        name - of the attribute
        Returns:
        attribute default value (can be null)
      • getContext

        public abstract String getContext()
        Get context the template is used for, so view can be customized for distinct contexts.
        Returns:
        name of the context
      • getAttributes

        public List<AbstractUserProfileBean.Attribute> getAttributes()
        All attributes to be shown in form sorted by the configured GUI order. Useful to render dynamic form.
        Returns:
        list of attributes
      • getAttributesByName

        public Map<String,​AbstractUserProfileBean.Attribute> getAttributesByName()
        Get map of all attributes where attribute name is key. Useful to render crafted form.
        Returns:
        map of attributes by name