|
static Application | getApplication () |
|
static Application | getFromConstructor (IConstructor constructor) |
|
static boolean | loadResources (String path) |
|
static void | resetSettings () |
|
static void | resetSchemes () |
|
static IContact | getUser () |
|
static Cookie | getCookie (String name) |
|
static String | getCookieValue (String name) |
|
static void | setCookie (String name, String value, String path, int age) |
|
static void | encryptCookie (String name, String value, String path, int age) |
|
static String | decryptCookieValue (String name) |
|
static void | deleteCookie (String name, String path) |
|
static Locale | getUsedLocale () |
|
static Map | getStringMap () |
|
static Map | getStringMap (Locale locale, String configured) |
|
static String | getString (String key) |
|
static String | getString (String key, String locale) |
|
static String | getString (String key, Locale locale) |
|
static List< String > | getAllLocales (String key) |
|
static ResourceBundle | getBundle (String bundle, Locale locale, String configured) |
|
static HttpServletRequest | getResolverRequest () |
|
static HttpServletResponse | getResolverResponse () |
|
static HttpSession | getResolverSession (boolean create) |
|
- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 49 of file Application.java.
◆ Application()
org.turro.elephant.context.Application.Application |
( |
| ) |
|
Definition at line 120 of file Application.java.
123 if(!(
this instanceof HeadlessApplication)) {
static ThreadLocal< Application > app
◆ checkUser()
IContact org.turro.elephant.context.Application.checkUser |
( |
boolean |
doLogin | ) |
throws IOException |
Definition at line 168 of file Application.java.
170 IContact user = constructor.getUser();
171 if(user ==
null && doLogin) {
172 ElephantLogin.redirectToLogin(constructor);
IConstructor getConstructor()
◆ decryptCookieValue()
static String org.turro.elephant.context.Application.decryptCookieValue |
( |
String |
name | ) |
|
|
static |
Definition at line 271 of file Application.java.
275 byte[] v = CookieUtil.decryptCookieValue(cookie);
276 if(v !=
null)
return new String(ElephantContext.decrypt(v));
278 }
catch (Exception ex) {
279 Logger.getLogger(
Application.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
static Cookie getCookie(String name)
◆ deleteCookie()
static void org.turro.elephant.context.Application.deleteCookie |
( |
String |
name, |
|
|
String |
path |
|
) |
| |
|
static |
Definition at line 284 of file Application.java.
abstract HttpServletResponse getHttpServletResponse()
static Application getApplication()
◆ doConstructor()
abstract IConstructor org.turro.elephant.context.Application.doConstructor |
( |
| ) |
|
|
abstractprotected |
◆ encryptCookie()
static void org.turro.elephant.context.Application.encryptCookie |
( |
String |
name, |
|
|
String |
value, |
|
|
String |
path, |
|
|
int |
age |
|
) |
| |
|
static |
Definition at line 262 of file Application.java.
264 byte[] b = ElephantContext.encrypt(value.getBytes());
266 }
catch (Exception ex) {
267 Logger.getLogger(
Application.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
◆ getAllLocales()
static List<String> org.turro.elephant.context.Application.getAllLocales |
( |
String |
key | ) |
|
|
static |
Definition at line 314 of file Application.java.
315 return I_.compatibility().getInLocales(key);
◆ getApplication()
static Application org.turro.elephant.context.Application.getApplication |
( |
| ) |
|
|
static |
Definition at line 71 of file Application.java.
74 if(application ==
null) {
77 if(application ==
null) {
80 if(application ==
null) {
82 request.setAttribute(
"el_app", application);
86 if(application !=
null) {
90 return HeadlessApplication.getInstance();
92 }
catch(Exception ex) {
93 return HeadlessApplication.getInstance();
static HttpServletRequest getResolverRequest()
static HttpServletResponse getResolverResponse()
HttpServletRequest request
◆ getBundle()
static ResourceBundle org.turro.elephant.context.Application.getBundle |
( |
String |
bundle, |
|
|
Locale |
locale, |
|
|
String |
configured |
|
) |
| |
|
static |
Definition at line 318 of file Application.java.
319 return I_.compatibilityMap(locale).asBundle();
◆ getConstructor()
IConstructor org.turro.elephant.context.Application.getConstructor |
( |
| ) |
|
◆ getContext()
◆ getCookie()
static Cookie org.turro.elephant.context.Application.getCookie |
( |
String |
name | ) |
|
|
static |
◆ getCookieValue()
static String org.turro.elephant.context.Application.getCookieValue |
( |
String |
name | ) |
|
|
static |
◆ getFromConstructor()
◆ getHttpServletRequest()
abstract HttpServletRequest org.turro.elephant.context.Application.getHttpServletRequest |
( |
| ) |
|
|
abstract |
◆ getHttpServletResponse()
abstract HttpServletResponse org.turro.elephant.context.Application.getHttpServletResponse |
( |
| ) |
|
|
abstract |
◆ getHttpSession()
HttpSession org.turro.elephant.context.Application.getHttpSession |
( |
boolean |
create | ) |
|
◆ getImplementation()
IImplementation org.turro.elephant.context.Application.getImplementation |
( |
String |
name | ) |
|
◆ getImplementationNamesByType()
List org.turro.elephant.context.Application.getImplementationNamesByType |
( |
String |
type | ) |
|
Definition at line 237 of file Application.java.
238 return ContextFactory.getImplementationNamesByType(type);
◆ getPreference()
Object org.turro.elephant.context.Application.getPreference |
( |
String |
key | ) |
|
Definition at line 177 of file Application.java.
186 }
catch (IOException ex) {
187 Logger.getLogger(
Application.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
UserPreferences preferences
IContact checkUser(boolean doLogin)
static UserPreferences getInstance(String id)
boolean isEqual(String id)
◆ getResolverRequest()
static HttpServletRequest org.turro.elephant.context.Application.getResolverRequest |
( |
| ) |
|
|
static |
Definition at line 334 of file Application.java.
335 for(ISessionResolver iSessionResolver : Instances.cached().byAnnotation(ElephantSessionResolver.class, ISessionResolver.class)) {
336 HttpServletRequest
request = iSessionResolver.getRequest();
◆ getResolverResponse()
static HttpServletResponse org.turro.elephant.context.Application.getResolverResponse |
( |
| ) |
|
|
static |
Definition at line 344 of file Application.java.
345 for(ISessionResolver iSessionResolver : Instances.cached().byAnnotation(ElephantSessionResolver.class, ISessionResolver.class)) {
346 HttpServletResponse
response = iSessionResolver.getResponse();
HttpServletResponse response
◆ getResolverSession()
static HttpSession org.turro.elephant.context.Application.getResolverSession |
( |
boolean |
create | ) |
|
|
static |
Definition at line 354 of file Application.java.
355 for(ISessionResolver iSessionResolver : Instances.cached().byAnnotation(ElephantSessionResolver.class, ISessionResolver.class)) {
356 HttpSession session = iSessionResolver.getSession(create);
357 if(session !=
null) {
◆ getServerBase()
String org.turro.elephant.context.Application.getServerBase |
( |
| ) |
|
Definition at line 324 of file Application.java.
325 return ElephantContext.getServerBase(
"http");
◆ getServerUrl()
String org.turro.elephant.context.Application.getServerUrl |
( |
| ) |
|
Definition at line 328 of file Application.java.
329 return ElephantContext.getServerUrl(
"http");
◆ getString() [1/3]
static String org.turro.elephant.context.Application.getString |
( |
String |
key | ) |
|
|
static |
◆ getString() [2/3]
static String org.turro.elephant.context.Application.getString |
( |
String |
key, |
|
|
Locale |
locale |
|
) |
| |
|
static |
Definition at line 310 of file Application.java.
311 return I_.compatibility().get(locale, key);
◆ getString() [3/3]
static String org.turro.elephant.context.Application.getString |
( |
String |
key, |
|
|
String |
locale |
|
) |
| |
|
static |
Definition at line 306 of file Application.java.
307 return I_.compatibility().get(I18nLocales.createLocale(locale), key);
◆ getStringMap() [1/2]
static Map org.turro.elephant.context.Application.getStringMap |
( |
| ) |
|
|
static |
◆ getStringMap() [2/2]
static Map org.turro.elephant.context.Application.getStringMap |
( |
Locale |
locale, |
|
|
String |
configured |
|
) |
| |
|
static |
◆ getUsedLocale()
static Locale org.turro.elephant.context.Application.getUsedLocale |
( |
| ) |
|
|
static |
◆ getUser()
static IContact org.turro.elephant.context.Application.getUser |
( |
| ) |
|
|
static |
◆ hasAnyRoleKey()
boolean org.turro.elephant.context.Application.hasAnyRoleKey |
( |
String |
role | ) |
|
◆ invalidateSession()
void org.turro.elephant.context.Application.invalidateSession |
( |
| ) |
|
Definition at line 217 of file Application.java.
221 }
catch(Exception ex) {
static HttpSession getResolverSession(boolean create)
HttpSession getHttpSession(boolean create)
◆ isInRole() [1/2]
boolean org.turro.elephant.context.Application.isInRole |
( |
String |
role | ) |
|
Definition at line 139 of file Application.java.
142 }
catch (IOException ex) {
143 Logger.getLogger(
Application.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
boolean isInRole(String role)
◆ isInRole() [2/2]
boolean org.turro.elephant.context.Application.isInRole |
( |
String |
role, |
|
|
String |
redirect |
|
) |
| throws IOException |
Definition at line 148 of file Application.java.
150 boolean result, isWebAdministering = constructor.isWebAdministering();
151 if(!isWebAdministering) {
152 constructor.setWebAdministering(
true);
154 result = constructor.isInRole(role);
155 if(!isWebAdministering) {
156 constructor.setWebAdministering(
false);
158 if(!result && redirect !=
null) {
159 constructor.redirect(redirect);
◆ loadResources()
static boolean org.turro.elephant.context.Application.loadResources |
( |
String |
path | ) |
|
|
static |
◆ navigateBack()
abstract void org.turro.elephant.context.Application.navigateBack |
( |
| ) |
|
|
abstract |
◆ putPreference()
void org.turro.elephant.context.Application.putPreference |
( |
String |
key, |
|
|
Object |
value |
|
) |
| |
Definition at line 192 of file Application.java.
201 }
catch (IOException ex) {
202 Logger.getLogger(
Application.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
Object put(String key, Object value)
◆ resetSchemes()
static void org.turro.elephant.context.Application.resetSchemes |
( |
| ) |
|
|
static |
◆ resetSettings()
static void org.turro.elephant.context.Application.resetSettings |
( |
| ) |
|
|
static |
Definition at line 105 of file Application.java.
106 SecurityGroups.reset();
107 ContextFactory.resetImplementationsStartingWith(
"IMail");
108 ElephantContext.resetSite();
109 ElephantProperties.resetProperties();
112 ElContextMap.reset();
113 SitemapGenerator.generateSitemap();
◆ sendRedirect()
abstract void org.turro.elephant.context.Application.sendRedirect |
( |
String |
uri | ) |
|
|
abstract |
◆ setCookie()
static void org.turro.elephant.context.Application.setCookie |
( |
String |
name, |
|
|
String |
value, |
|
|
String |
path, |
|
|
int |
age |
|
) |
| |
|
static |
◆ app
ThreadLocal<Application> org.turro.elephant.context.Application.app = new ThreadLocal<>() |
|
staticprotected |
◆ BUNDLES
final String [] org.turro.elephant.context.Application.BUNDLES |
|
static |
Initial value:= {
"lang",
"elephant",
"labels",
"documentation",
"label-site"
}
Definition at line 51 of file Application.java.
◆ preferences
◆ REGEXP_NO_RESOURCES
final String org.turro.elephant.context.Application.REGEXP_NO_RESOURCES = "(\\/zkau.*|\\/app.*)" |
|
static |
◆ request
HttpServletRequest org.turro.elephant.context.Application.request |
|
protected |
◆ response
HttpServletResponse org.turro.elephant.context.Application.response |
|
protected |
The documentation for this class was generated from the following file: