@SessionScoped public class SessionBean extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
static String |
LANGUAGE_COOKIE |
static String |
THEME_COOKIE |
| Constructor and Description |
|---|
SessionBean() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addLanguage(String name,
String code,
String region) |
protected SessionBean |
addTheme(String theme) |
String |
getCurrentTheme() |
String |
getLanguage()
The current choice
|
List<String> |
getLanguages()
use this for user choice (dropdown)
|
Locale |
getLocale()
the current locale, use this in @locale in f:view
|
List<String> |
getThemes()
list available themes.
|
String |
getUser() |
protected void |
initFromCookies()
Called from @Postconstruct, sets current language and theme from a cookie
or to a default
|
protected void |
initLanguages()
Called from @Postconstruct, initializes frisian, ducth and english.
|
void |
languageChanged(javax.faces.event.ValueChangeEvent e)
Call this when user chooses other language
|
void |
logout()
assumes "/login.xhtml"
|
boolean |
mayEdit()
|
boolean |
mayEdit(String role) |
void |
setCurrentTheme(String currentTheme) |
void |
setLanguage(String language) |
void |
themeChanged(javax.faces.event.ValueChangeEvent event) |
public static final String LANGUAGE_COOKIE
public static final String THEME_COOKIE
protected SessionBean addTheme(String theme)
public final List<String> getThemes()
addTheme(java.lang.String) from for example the constructor of
a subclass.public String getCurrentTheme()
public final void setCurrentTheme(String currentTheme)
public void themeChanged(javax.faces.event.ValueChangeEvent event)
protected void initFromCookies()
CookieHelperprotected void initLanguages()
public String getLanguage()
public void setLanguage(String language)
public Locale getLocale()
public boolean mayEdit(String role)
public boolean mayEdit()
public void languageChanged(javax.faces.event.ValueChangeEvent e)
e - public String getUser()
public void logout()
Copyright © 2018 Fryske Akademy. All rights reserved.