Public Member Functions | |
boolean | isHeadless () |
void | setRequest (ServletRequest request) |
void | setResponse (ServletResponse response) |
HttpServletRequest | getRequest () |
HttpServletResponse | getResponse () |
ElContext | getCurrentContext () |
ElContext | getRenderingContext () |
void | setRenderingContext (ElContext context) |
void | forceIsAContext (ElContext context) |
boolean | isOriginal () |
String | getUniqueId () |
boolean | isFileInternal (File file) |
Object | findAttribute (String key) |
Object | getApplicationAttribute (String key) |
Object | getSessionAttribute (String key) |
Map< String, Object > | getSessionAttributeMap (String prefix) |
Object | getRequestAttribute (String key) |
void | setApplicationAttribute (String key, Object value) |
void | setSessionAttribute (String key, Object value) |
void | setRequestAttribute (String key, Object value) |
void | removeApplicationAttribute (String key) |
void | removeSessionAttribute (String key) |
void | removeRequestAttribute (String key) |
void | setLastReferringContext (String context) |
String | getLastReferringContext () |
void | addHeader (String header) |
void | addCSS (String cssFile) |
void | addMeta (String meta) |
void | addJavaScript (String jsFile) |
void | addOnLoadedJavaScript (String script) |
void | startConstruction () throws ServletException, IOException |
void | startBody () |
void | endBody () |
void | setStopper (String stopper) |
void | includeContent (String path) throws ServletException, IOException |
void | renderContext (String path, String stopper) throws ServletException, IOException |
void | redirect (String path) throws IOException |
void | navigateBack () throws IOException |
void | reload () throws IOException |
PrintWriter | getOut () throws IOException |
void | setOut (PrintWriter out) throws IOException |
void | closeOut () throws IOException |
void | setPageRendering (boolean value) |
void | setNullOutput (boolean value) |
void | setOutputToString () |
String | getOutputString () |
void | processOutput (String text) throws ServletException, IOException |
void | processOutput (PrintWriter out, String text) throws ServletException, IOException |
void | changeCssHeaders (String from, String to) |
String | encodeURL (String url) |
String | decodeURL (String url) |
String | getValidUrl (String name) |
String | getValidFileName (String name) |
Localizer | getLocalizer () |
IContact | getUser () |
boolean | isOutsider () |
boolean | isInRole (String role) |
boolean | hasAnyRoleKey (String role) |
String | getParameter (String param) |
String | getParameter (String param, boolean decode) |
String[] | getParameterValues (String param) |
Parameters | getParameters () |
String | getContextParameter () |
String | getIdelParameter () |
String | getActionParameter () |
void | invalidateSession () |
void | setMaxInactiveInterval (int i) |
boolean | canWebAdminister () |
boolean | isWebAdministering () |
void | setWebAdministering (boolean value) |
boolean | fileExists (String filePath) |
String | getTemplateRoot () |
Static Public Member Functions | |
static String | currentRepository (IConstructor constructor) |
static String | globalRepository () |
IConstructor
gets instantiated by ContextServlet
in order to start page's construction. IConstructor
provides useful information to rendered elements and keeps available request and response information.
Definition at line 42 of file IConstructor.java.
void org.turro.elephant.context.IConstructor.addCSS | ( | String | cssFile | ) |
cssFile | CSS file path. |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.addHeader | ( | String | header | ) |
header |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.addJavaScript | ( | String | jsFile | ) |
jsFile | JavaScript file path. |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.addMeta | ( | String | meta | ) |
meta | string |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.addOnLoadedJavaScript | ( | String | script | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
boolean org.turro.elephant.context.IConstructor.canWebAdminister | ( | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.changeCssHeaders | ( | String | from, |
String | to | ||
) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.closeOut | ( | ) | throws IOException |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
|
static |
Definition at line 327 of file IConstructor.java.
String org.turro.elephant.context.IConstructor.decodeURL | ( | String | url | ) |
url | URL to be decoded. |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
String org.turro.elephant.context.IConstructor.encodeURL | ( | String | url | ) |
url | URL to be encoded. |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.endBody | ( | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
boolean org.turro.elephant.context.IConstructor.fileExists | ( | String | filePath | ) |
Check if file exists within web context
filePath | Relative path to file |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
Object org.turro.elephant.context.IConstructor.findAttribute | ( | String | key | ) |
findAttribute
looks sequentially in request, session and application scopes.
key | Attribute to find. |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.forceIsAContext | ( | ElContext | context | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
String org.turro.elephant.context.IConstructor.getActionParameter | ( | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
Object org.turro.elephant.context.IConstructor.getApplicationAttribute | ( | String | key | ) |
Applications attributes live as long as container lives.
key | Attribute to find. |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
String org.turro.elephant.context.IConstructor.getContextParameter | ( | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
ElContext org.turro.elephant.context.IConstructor.getCurrentContext | ( | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
String org.turro.elephant.context.IConstructor.getIdelParameter | ( | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
String org.turro.elephant.context.IConstructor.getLastReferringContext | ( | ) |
Administration pages will use this value to know which context was selected before they were called. Here we understand that a context was selected if constructor rendered.
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
Localizer org.turro.elephant.context.IConstructor.getLocalizer | ( | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
PrintWriter org.turro.elephant.context.IConstructor.getOut | ( | ) | throws IOException |
java.io.IOException |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
String org.turro.elephant.context.IConstructor.getOutputString | ( | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
String org.turro.elephant.context.IConstructor.getParameter | ( | String | param | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
String org.turro.elephant.context.IConstructor.getParameter | ( | String | param, |
boolean | decode | ||
) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
Parameters org.turro.elephant.context.IConstructor.getParameters | ( | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
String [] org.turro.elephant.context.IConstructor.getParameterValues | ( | String | param | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
ElContext org.turro.elephant.context.IConstructor.getRenderingContext | ( | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
HttpServletRequest org.turro.elephant.context.IConstructor.getRequest | ( | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
Object org.turro.elephant.context.IConstructor.getRequestAttribute | ( | String | key | ) |
Request attributes are visible through a single request. Once the request has given the response they are removed.
key | Attribute to find |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
HttpServletResponse org.turro.elephant.context.IConstructor.getResponse | ( | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
Object org.turro.elephant.context.IConstructor.getSessionAttribute | ( | String | key | ) |
Session attributes are stored in visitor sessions, meaning that their value will be available only by current visitor.
key | Attribute to find |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
Map<String, Object> org.turro.elephant.context.IConstructor.getSessionAttributeMap | ( | String | prefix | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
String org.turro.elephant.context.IConstructor.getTemplateRoot | ( | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
String org.turro.elephant.context.IConstructor.getUniqueId | ( | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
IContact org.turro.elephant.context.IConstructor.getUser | ( | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
String org.turro.elephant.context.IConstructor.getValidFileName | ( | String | name | ) |
Convenience method for ensuring file names will contain valid characters and no spaces.
name | File name. |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
String org.turro.elephant.context.IConstructor.getValidUrl | ( | String | name | ) |
Convenience method for ensuring paths will contain valid characters and no spaces.
name | URL to be converted. |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
|
static |
Definition at line 338 of file IConstructor.java.
boolean org.turro.elephant.context.IConstructor.hasAnyRoleKey | ( | String | role | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.includeContent | ( | String | path | ) | throws ServletException, IOException |
This method should act differently depending on which file is to be included:
HTML files. Read file content, process macros and write to output stream. Text files. Read file context and write to output enclosed with PRE tags. Rest of files. Call ServletContext.getRequestDispatcher()
.
path | Relative path to file. |
javax.servlet.ServletException | |
java.io.IOException |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.invalidateSession | ( | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
boolean org.turro.elephant.context.IConstructor.isFileInternal | ( | File | file | ) |
This method intends to protect internal files. Since almost everything allocated within web application context will be visible by root context, asking whether a file is internal may prevent showing some folders.
file | File to query. |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
boolean org.turro.elephant.context.IConstructor.isHeadless | ( | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
boolean org.turro.elephant.context.IConstructor.isInRole | ( | String | role | ) |
IConstructor implementations should return true when the role string gets validated against current user.
role | Role string. |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
boolean org.turro.elephant.context.IConstructor.isOriginal | ( | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
boolean org.turro.elephant.context.IConstructor.isOutsider | ( | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
boolean org.turro.elephant.context.IConstructor.isWebAdministering | ( | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.navigateBack | ( | ) | throws IOException |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.processOutput | ( | PrintWriter | out, |
String | text | ||
) | throws ServletException, IOException |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.processOutput | ( | String | text | ) | throws ServletException, IOException |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.redirect | ( | String | path | ) | throws IOException |
Convenience method for redirections within the same context. IConstructor implementations should ensure a call to redirect("/")
will redirect to current web application's root.
path | Relative path. |
java.io.IOException |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.reload | ( | ) | throws IOException |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.removeApplicationAttribute | ( | String | key | ) |
Removes application attribute.
key |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.removeRequestAttribute | ( | String | key | ) |
Removes request attribute.
key |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.removeSessionAttribute | ( | String | key | ) |
Removes session attribute.
key |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.renderContext | ( | String | path, |
String | stopper | ||
) | throws ServletException, IOException |
This method includes context's default element content. Instead of calling page construction, as does includeContent, includeContext only renders context content.
path | Relative path to file. |
stopper | String stopper, defaults to "<end/>" |
javax.servlet.ServletException | |
java.io.IOException |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.setApplicationAttribute | ( | String | key, |
Object | value | ||
) |
Sets application attribute's value.
key | |
value |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.setLastReferringContext | ( | String | context | ) |
IConstructor implementations should set this value when starting a context construction. Context value refers to IContext's path.
context | Last constructed context. |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.setMaxInactiveInterval | ( | int | i | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.setNullOutput | ( | boolean | value | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.setOut | ( | PrintWriter | out | ) | throws IOException |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.setOutputToString | ( | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.setPageRendering | ( | boolean | value | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.setRenderingContext | ( | ElContext | context | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.setRequest | ( | ServletRequest | request | ) |
Called by ContextFactory during initialization.
request | Current HttpServletRequest. |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.setRequestAttribute | ( | String | key, |
Object | value | ||
) |
Sets request attribute's value.
key | |
value |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.setResponse | ( | ServletResponse | response | ) |
Called by ContextFactory during initialization.
response | Current HttpServletResponse. |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.setSessionAttribute | ( | String | key, |
Object | value | ||
) |
Sets session attribute's value.
key | |
value |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.setStopper | ( | String | stopper | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.setWebAdministering | ( | boolean | value | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.startBody | ( | ) |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.
void org.turro.elephant.context.IConstructor.startConstruction | ( | ) | throws ServletException, IOException |
Starts a page construction. First will locate which headers, including encoding, CSS, JavaScript, etc., are to be inserted. Then will collect all the elements configured to render in current context, instantiate ILayoutManager, ILayout and start rendering.
javax.servlet.ServletException | |
java.io.IOException |
Implemented in org.turro.elephant.impl.context.DefaultConstructor.