BrightSide Workbench Full Report + Source Code
org.turro.elephant.zkoss.ZkossElephant Class Reference
Inheritance diagram for org.turro.elephant.zkoss.ZkossElephant:
Collaboration diagram for org.turro.elephant.zkoss.ZkossElephant:

Public Member Functions

 ZkossElephant (HttpServletRequest request, HttpServletResponse response)
 
HttpServletRequest getHttpServletRequest ()
 
HttpServletResponse getHttpServletResponse ()
 
HttpSession getHttpSession (boolean create)
 
void sendRedirect (String uri)
 
void navigateBack ()
 
- Public Member Functions inherited from org.turro.elephant.context.Application
 Application ()
 
ApplicationContext getContext ()
 
boolean hasAnyRoleKey (String role)
 
boolean isInRole (String role)
 
boolean isInRole (String role, String redirect) throws IOException
 
IContact checkUser (boolean doLogin) throws IOException
 
Object getPreference (String key)
 
void putPreference (String key, Object value)
 
IConstructor getConstructor ()
 
void invalidateSession ()
 
IImplementation getImplementation (String name)
 
List getImplementationNamesByType (String type)
 
String getServerBase ()
 
String getServerUrl ()
 

Static Public Member Functions

static Application getCurrent ()
 
static void doWebAdmin (boolean value, String redir) throws IOException
 
static boolean doSendReminder (String login) throws IOException
 
static ZkossElephant instance (HttpServletRequest request, HttpServletResponse response)
 
- Static Public Member Functions inherited from org.turro.elephant.context.Application
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)
 

Protected Member Functions

IConstructor doConstructor ()
 

Additional Inherited Members

- Static Public Attributes inherited from org.turro.elephant.context.Application
static final String[] BUNDLES
 
static final String REGEXP_NO_RESOURCES = "(\\/zkau.*|\\/app.*)"
 
- Protected Attributes inherited from org.turro.elephant.context.Application
UserPreferences preferences
 
HttpServletRequest request
 
HttpServletResponse response
 
- Static Protected Attributes inherited from org.turro.elephant.context.Application
static ThreadLocal< Applicationapp = new ThreadLocal<>()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 47 of file ZkossElephant.java.

Constructor & Destructor Documentation

◆ ZkossElephant()

org.turro.elephant.zkoss.ZkossElephant.ZkossElephant ( HttpServletRequest  request,
HttpServletResponse  response 
)

Definition at line 51 of file ZkossElephant.java.

51  {
52  super();
53  this.request = request;
54  this.response = response;
55  request.setAttribute("el_app", this);
56  ApplicationFramework.setLocale((HttpServletRequest) request);
57  }
Here is the call graph for this function:

Member Function Documentation

◆ doConstructor()

IConstructor org.turro.elephant.zkoss.ZkossElephant.doConstructor ( )
protected

Reimplemented from org.turro.elephant.context.Application.

Definition at line 77 of file ZkossElephant.java.

77  {
78  IConstructor constructor = ElephantContext.getConstructor(
81  constructor.setRequestAttribute("el_cons", constructor);
82  return constructor;
83  }
HttpServletResponse getHttpServletResponse()
HttpServletRequest getHttpServletRequest()
Here is the call graph for this function:

◆ doSendReminder()

static boolean org.turro.elephant.zkoss.ZkossElephant.doSendReminder ( String  login) throws IOException
static

Definition at line 123 of file ZkossElephant.java.

123  {
124  IConstructor constructor = getCurrent().getConstructor();
125  IContact user = Contacts.getEmpty();
126  if(user.impersonate(login)) {
127  return Authentication.sendReminder(constructor, user.getName(), user.getProperty(IUser.CONNECTOR_EMAIL));
128  } else if(user.impersonateByEmail(login)) {
129  return Authentication.sendReminder(constructor, user.getName(), user.getProperty(IUser.CONNECTOR_EMAIL));
130  }
131  return false;
132  }
Here is the call graph for this function:

◆ doWebAdmin()

static void org.turro.elephant.zkoss.ZkossElephant.doWebAdmin ( boolean  value,
String  redir 
) throws IOException
static

Definition at line 114 of file ZkossElephant.java.

114  {
116  getCurrent().getHttpSession(false).setMaxInactiveInterval(3 * 60 * 60);
117  if(value) {
118  SystemLogger.getInstance().doLog(SystemLogType.LOG_INFO, "/log/webadmin", null, null);
119  }
120  Executions.sendRedirect(redir == null ? "" : redir);
121  }
HttpSession getHttpSession(boolean create)
Here is the call graph for this function:

◆ getCurrent()

static Application org.turro.elephant.zkoss.ZkossElephant.getCurrent ( )
static

Definition at line 59 of file ZkossElephant.java.

59  {
60  Application application = app.get();
61  if(application == null) {
62  try {
63  application = (Application) ServletFns.getCurrentRequest().getAttribute("el_app");
64  if(application == null) {
65  application = new ZkossElephant((HttpServletRequest) ServletFns.getCurrentRequest(), (HttpServletResponse) ServletFns.getCurrentResponse());
66  ServletFns.getCurrentRequest().setAttribute("el_app", application);
67  }
68  app.set(application);
69  } catch(Exception ex) {
70  return null;
71  }
72  }
73  return application;
74  }
static ThreadLocal< Application > app
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getHttpServletRequest()

HttpServletRequest org.turro.elephant.zkoss.ZkossElephant.getHttpServletRequest ( )

Reimplemented from org.turro.elephant.context.Application.

Definition at line 86 of file ZkossElephant.java.

86  {
87  Execution execution = Executions.getCurrent();
88  if(execution != null) {
89  return (HttpServletRequest) execution.getNativeRequest(); //ServletFns.getCurrentRequest();
90  } else {
91  return request;
92  }
93  }
Here is the caller graph for this function:

◆ getHttpServletResponse()

HttpServletResponse org.turro.elephant.zkoss.ZkossElephant.getHttpServletResponse ( )

Reimplemented from org.turro.elephant.context.Application.

Definition at line 96 of file ZkossElephant.java.

96  {
97  Execution execution = Executions.getCurrent();
98  if(execution != null) {
99  return (HttpServletResponse) execution.getNativeResponse(); //ServletFns.getCurrentResponse();
100  } else {
101  return response;
102  }
103  }
Here is the caller graph for this function:

◆ getHttpSession()

HttpSession org.turro.elephant.zkoss.ZkossElephant.getHttpSession ( boolean  create)

Reimplemented from org.turro.elephant.context.Application.

Definition at line 106 of file ZkossElephant.java.

106  {
107  HttpSession ses = super.getHttpSession(create);
108  if(ses == null) {
109  ses = (HttpSession) Sessions.getCurrent(create).getNativeSession();
110  }
111  return ses;
112  }

◆ instance()

static ZkossElephant org.turro.elephant.zkoss.ZkossElephant.instance ( HttpServletRequest  request,
HttpServletResponse  response 
)
static

Definition at line 165 of file ZkossElephant.java.

165  {
166  return new ZkossElephant(request, response);
167  }
Here is the caller graph for this function:

◆ navigateBack()

void org.turro.elephant.zkoss.ZkossElephant.navigateBack ( )

Reimplemented from org.turro.elephant.context.Application.

Definition at line 148 of file ZkossElephant.java.

148  {
149  IConstructor constructor = getConstructor();
150  if(constructor != null) {
151  if(Executions.getCurrent() != null) {
152  Executions.sendRedirect(Strings.isBlank(History.back(constructor), "/"));
153  } else {
154  try {
155  constructor.redirect(Strings.isBlank(History.back(constructor), "/"));
156  } catch (IOException ex) {
157  Logger.getLogger(ZkossElephant.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
158  }
159  }
160  }
161  }
Here is the call graph for this function:

◆ sendRedirect()

void org.turro.elephant.zkoss.ZkossElephant.sendRedirect ( String  uri)

Reimplemented from org.turro.elephant.context.Application.

Definition at line 135 of file ZkossElephant.java.

135  {
136  if(Executions.getCurrent() != null) {
137  Executions.sendRedirect(uri);
138  } else {
139  try {
140  getConstructor().redirect(uri);
141  } catch (IOException ex) {
142  Logger.getLogger(ZkossElephant.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
143  }
144  }
145  }
Here is the call graph for this function:

The documentation for this class was generated from the following file: