Class AbstractUserProfileBean
java.lang.Object
org.keycloak.forms.login.freemarker.model.AbstractUserProfileBean
- Direct Known Subclasses:
EmailBean
,IdpReviewProfileBean
,RegisterBean
,VerifyProfileBean
Abstract base for Freemarker context bean providing informations about user profile to render dynamic or crafted forms.
- Author:
- Vlastimil Elias <velias@redhat.com>
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Info about user profile attribute available in Freemarker template.class
-
Field Summary
Modifier and TypeFieldDescriptionprotected List<AbstractUserProfileBean.Attribute>
protected Map<String,
AbstractUserProfileBean.Attribute> protected UserProfile
-
Constructor Summary
ConstructorDescriptionAbstractUserProfileBean
(jakarta.ws.rs.core.MultivaluedMap<String, String> formData) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract UserProfile
createUserProfile
(UserProfileProvider provider) Create UserProfile instance of the relevant type.Get attribute default values to be pre-filled into the form on first show.All attributes to be shown in form sorted by the configured GUI order.Get map of all attributes where attribute name is key.abstract String
Get context the template is used for, so view can be customized for distinct contexts.protected void
init
(KeycloakSession session, boolean writeableOnly) Subclass have to call this method at the end of constructor to init user profile data.
-
Field Details
-
formData
-
profile
-
attributes
-
attributesByName
-
-
Constructor Details
-
AbstractUserProfileBean
-
-
Method Details
-
init
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
-
createUserProfile
Create UserProfile instance of the relevant type. Is called frominit(KeycloakSession, boolean)
.- Parameters:
provider
- to create UserProfile from- Returns:
- user profile instance
-
getAttributeDefaultValues
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
Get context the template is used for, so view can be customized for distinct contexts.- Returns:
- name of the context
-
getAttributes
All attributes to be shown in form sorted by the configured GUI order. Useful to render dynamic form.- Returns:
- list of attributes
-
getHtml5DataAnnotations
-
getAttributesByName
Get map of all attributes where attribute name is key. Useful to render crafted form.- Returns:
- map of attributes by name
-