From 3f6b8488498e04cec02a1b26366d66e0b2a24932 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Mon, 18 Jan 2016 14:42:08 +0100 Subject: [PATCH] KEYCLOAK-2313 Add getName, getDisplayName, getDisplayNameHtml to account RealmBean --- .../account/freemarker/model/RealmBean.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/forms/account-freemarker/src/main/java/org/keycloak/forms/account/freemarker/model/RealmBean.java b/forms/account-freemarker/src/main/java/org/keycloak/forms/account/freemarker/model/RealmBean.java index 68c7b78943..a926a0515c 100755 --- a/forms/account-freemarker/src/main/java/org/keycloak/forms/account/freemarker/model/RealmBean.java +++ b/forms/account-freemarker/src/main/java/org/keycloak/forms/account/freemarker/model/RealmBean.java @@ -36,6 +36,28 @@ public class RealmBean { realm = realmModel; } + public String getName() { + return realm.getName(); + } + + public String getDisplayName() { + String displayName = realm.getDisplayName(); + if (displayName != null && displayName.length() > 0) { + return displayName; + } else { + return getName(); + } + } + + public String getDisplayNameHtml() { + String displayNameHtml = realm.getDisplayNameHtml(); + if (displayNameHtml != null && displayNameHtml.length() > 0) { + return displayNameHtml; + } else { + return getDisplayName(); + } + } + public boolean isInternationalizationEnabled() { return realm.isInternationalizationEnabled(); }