Public Member Functions | |
DefaultConstructor () | |
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 () |
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 | startConstruction () throws IOException, ServletException |
void | setStopper (String stopper) |
boolean | fileExists (String filePath) |
void | startBody () |
void | endBody () |
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) |
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 newOut, String text) throws ServletException, IOException |
String | encodeURL (String url) |
String | decodeURL (String url) |
String | getParameter (String param) |
String | getParameter (String param, boolean decode) |
String[] | getParameterValues (String param) |
Parameters | getParameters () |
String | getActionParameter () |
String | getContextParameter () |
String | getIdelParameter () |
String | getValidUrl (String name) |
String | getValidFileName (String name) |
Localizer | getLocalizer () |
IContact | getUser () |
boolean | isOutsider () |
String | getUniqueId () |
boolean | isInRole (String role) |
boolean | hasAnyRoleKey (String role) |
void | setLastReferringContext (String context) |
String | getLastReferringContext () |
void | addHeader (String header) |
void | addCSS (String cssFile) |
void | addJavaScript (String jsFile) |
void | addMeta (String meta) |
String | urlToFile (String file) |
void | addOnLoadedJavaScript (String script) |
void | addRobots (ElContext context) |
void | invalidateSession () |
void | setMaxInactiveInterval (int interval) |
void | changeCssHeaders (String from, String to) |
boolean | canWebAdminister () |
boolean | isWebAdministering () |
void | setWebAdministering (boolean value) |
String | getTemplateRoot () |
Map | getString () |
Protected Attributes | |
HttpServletRequest | request |
HttpServletResponse | response |
ElContext | rendering = null |
Properties | bundle = null |
PrintWriter | out = null |
StringWriter | stringOutput = null |
ArrayList | metas = new ArrayList() |
boolean | isAContext = false |
String | stopper |
boolean | hasMootools = false |
Static Protected Attributes | |
static final String | BUNDLE_LOCATION = "/WEB-INF/classes/elephant.properties" |
Additional Inherited Members | |
Static Public Member Functions inherited from org.turro.elephant.context.IConstructor | |
static String | currentRepository (IConstructor constructor) |
static String | globalRepository () |
Definition at line 63 of file DefaultConstructor.java.
org.turro.elephant.impl.context.DefaultConstructor.DefaultConstructor | ( | ) |
Creates a new instance of DefaultConstructor
Definition at line 81 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.addCSS | ( | String | cssFile | ) |
cssFile | CSS file path. |
Implements org.turro.elephant.context.IConstructor.
Definition at line 688 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.addHeader | ( | String | header | ) |
header |
Implements org.turro.elephant.context.IConstructor.
Definition at line 682 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.addJavaScript | ( | String | jsFile | ) |
jsFile | JavaScript file path. |
Implements org.turro.elephant.context.IConstructor.
Definition at line 714 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.addMeta | ( | String | meta | ) |
meta | string |
Implements org.turro.elephant.context.IConstructor.
Definition at line 725 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.addOnLoadedJavaScript | ( | String | script | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 737 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.addRobots | ( | ElContext | context | ) |
Definition at line 743 of file DefaultConstructor.java.
boolean org.turro.elephant.impl.context.DefaultConstructor.canWebAdminister | ( | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 779 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.changeCssHeaders | ( | String | from, |
String | to | ||
) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 770 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.closeOut | ( | ) | throws IOException |
Implements org.turro.elephant.context.IConstructor.
Definition at line 473 of file DefaultConstructor.java.
String org.turro.elephant.impl.context.DefaultConstructor.decodeURL | ( | String | url | ) |
url | URL to be decoded. |
Implements org.turro.elephant.context.IConstructor.
Definition at line 522 of file DefaultConstructor.java.
String org.turro.elephant.impl.context.DefaultConstructor.encodeURL | ( | String | url | ) |
url | URL to be encoded. |
Implements org.turro.elephant.context.IConstructor.
Definition at line 512 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.endBody | ( | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 392 of file DefaultConstructor.java.
boolean org.turro.elephant.impl.context.DefaultConstructor.fileExists | ( | String | filePath | ) |
Check if file exists within web context
filePath | Relative path to file |
Implements org.turro.elephant.context.IConstructor.
Definition at line 364 of file DefaultConstructor.java.
Object org.turro.elephant.impl.context.DefaultConstructor.findAttribute | ( | String | key | ) |
findAttribute
looks sequentially in request, session and application scopes.
key | Attribute to find. |
Implements org.turro.elephant.context.IConstructor.
Definition at line 172 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.forceIsAContext | ( | ElContext | context | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 140 of file DefaultConstructor.java.
String org.turro.elephant.impl.context.DefaultConstructor.getActionParameter | ( | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 555 of file DefaultConstructor.java.
Object org.turro.elephant.impl.context.DefaultConstructor.getApplicationAttribute | ( | String | key | ) |
Applications attributes live as long as container lives.
key | Attribute to find. |
Implements org.turro.elephant.context.IConstructor.
Definition at line 180 of file DefaultConstructor.java.
String org.turro.elephant.impl.context.DefaultConstructor.getContextParameter | ( | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 572 of file DefaultConstructor.java.
ElContext org.turro.elephant.impl.context.DefaultConstructor.getCurrentContext | ( | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 122 of file DefaultConstructor.java.
String org.turro.elephant.impl.context.DefaultConstructor.getIdelParameter | ( | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 577 of file DefaultConstructor.java.
String org.turro.elephant.impl.context.DefaultConstructor.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.
Implements org.turro.elephant.context.IConstructor.
Definition at line 677 of file DefaultConstructor.java.
Localizer org.turro.elephant.impl.context.DefaultConstructor.getLocalizer | ( | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 607 of file DefaultConstructor.java.
PrintWriter org.turro.elephant.impl.context.DefaultConstructor.getOut | ( | ) | throws IOException |
java.io.IOException |
Implements org.turro.elephant.context.IConstructor.
Definition at line 457 of file DefaultConstructor.java.
String org.turro.elephant.impl.context.DefaultConstructor.getOutputString | ( | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 494 of file DefaultConstructor.java.
String org.turro.elephant.impl.context.DefaultConstructor.getParameter | ( | String | param | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 532 of file DefaultConstructor.java.
String org.turro.elephant.impl.context.DefaultConstructor.getParameter | ( | String | param, |
boolean | decode | ||
) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 537 of file DefaultConstructor.java.
Parameters org.turro.elephant.impl.context.DefaultConstructor.getParameters | ( | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 550 of file DefaultConstructor.java.
String [] org.turro.elephant.impl.context.DefaultConstructor.getParameterValues | ( | String | param | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 545 of file DefaultConstructor.java.
ElContext org.turro.elephant.impl.context.DefaultConstructor.getRenderingContext | ( | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 129 of file DefaultConstructor.java.
HttpServletRequest org.turro.elephant.impl.context.DefaultConstructor.getRequest | ( | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 112 of file DefaultConstructor.java.
Object org.turro.elephant.impl.context.DefaultConstructor.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 |
Implements org.turro.elephant.context.IConstructor.
Definition at line 217 of file DefaultConstructor.java.
HttpServletResponse org.turro.elephant.impl.context.DefaultConstructor.getResponse | ( | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 117 of file DefaultConstructor.java.
Object org.turro.elephant.impl.context.DefaultConstructor.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 |
Implements org.turro.elephant.context.IConstructor.
Definition at line 185 of file DefaultConstructor.java.
Map<String, Object> org.turro.elephant.impl.context.DefaultConstructor.getSessionAttributeMap | ( | String | prefix | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 197 of file DefaultConstructor.java.
Map org.turro.elephant.impl.context.DefaultConstructor.getString | ( | ) |
String org.turro.elephant.impl.context.DefaultConstructor.getTemplateRoot | ( | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 808 of file DefaultConstructor.java.
String org.turro.elephant.impl.context.DefaultConstructor.getUniqueId | ( | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 641 of file DefaultConstructor.java.
IContact org.turro.elephant.impl.context.DefaultConstructor.getUser | ( | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 627 of file DefaultConstructor.java.
String org.turro.elephant.impl.context.DefaultConstructor.getValidFileName | ( | String | name | ) |
Convenience method for ensuring file names will contain valid characters and no spaces.
name | File name. |
Implements org.turro.elephant.context.IConstructor.
Definition at line 602 of file DefaultConstructor.java.
String org.turro.elephant.impl.context.DefaultConstructor.getValidUrl | ( | String | name | ) |
Convenience method for ensuring paths will contain valid characters and no spaces.
name | URL to be converted. |
Implements org.turro.elephant.context.IConstructor.
Definition at line 597 of file DefaultConstructor.java.
boolean org.turro.elephant.impl.context.DefaultConstructor.hasAnyRoleKey | ( | String | role | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 661 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.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 |
Implements org.turro.elephant.context.IConstructor.
Definition at line 401 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.invalidateSession | ( | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 757 of file DefaultConstructor.java.
boolean org.turro.elephant.impl.context.DefaultConstructor.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. |
Implements org.turro.elephant.context.IConstructor.
Definition at line 151 of file DefaultConstructor.java.
boolean org.turro.elephant.impl.context.DefaultConstructor.isHeadless | ( | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 86 of file DefaultConstructor.java.
boolean org.turro.elephant.impl.context.DefaultConstructor.isInRole | ( | String | role | ) |
IConstructor implementations should return true when the role string gets validated against current user.
role | Role string. |
Implements org.turro.elephant.context.IConstructor.
Definition at line 646 of file DefaultConstructor.java.
boolean org.turro.elephant.impl.context.DefaultConstructor.isOriginal | ( | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 146 of file DefaultConstructor.java.
boolean org.turro.elephant.impl.context.DefaultConstructor.isOutsider | ( | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 632 of file DefaultConstructor.java.
boolean org.turro.elephant.impl.context.DefaultConstructor.isWebAdministering | ( | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 787 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.navigateBack | ( | ) | throws IOException |
Implements org.turro.elephant.context.IConstructor.
Definition at line 444 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.processOutput | ( | PrintWriter | newOut, |
String | text | ||
) | throws ServletException, IOException |
Implements org.turro.elephant.context.IConstructor.
Definition at line 507 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.processOutput | ( | String | text | ) | throws ServletException, IOException |
Implements org.turro.elephant.context.IConstructor.
Definition at line 502 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.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 |
Implements org.turro.elephant.context.IConstructor.
Definition at line 429 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.reload | ( | ) | throws IOException |
Implements org.turro.elephant.context.IConstructor.
Definition at line 449 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.removeApplicationAttribute | ( | String | key | ) |
Removes application attribute.
key |
Implements org.turro.elephant.context.IConstructor.
Definition at line 245 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.removeRequestAttribute | ( | String | key | ) |
Removes request attribute.
key |
Implements org.turro.elephant.context.IConstructor.
Definition at line 259 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.removeSessionAttribute | ( | String | key | ) |
Removes session attribute.
key |
Implements org.turro.elephant.context.IConstructor.
Definition at line 250 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.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 |
Implements org.turro.elephant.context.IConstructor.
Definition at line 415 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.setApplicationAttribute | ( | String | key, |
Object | value | ||
) |
Sets application attribute's value.
key | |
value |
Implements org.turro.elephant.context.IConstructor.
Definition at line 222 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.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. |
Implements org.turro.elephant.context.IConstructor.
Definition at line 671 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.setMaxInactiveInterval | ( | int | interval | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 762 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.setNullOutput | ( | boolean | value | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 483 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.setOut | ( | PrintWriter | out | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 468 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.setOutputToString | ( | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 488 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.setPageRendering | ( | boolean | value | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 478 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.setRenderingContext | ( | ElContext | context | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 135 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.setRequest | ( | ServletRequest | request | ) |
Called by ContextFactory during initialization.
request | Current HttpServletRequest. |
Implements org.turro.elephant.context.IConstructor.
Definition at line 91 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.setRequestAttribute | ( | String | key, |
Object | value | ||
) |
Sets request attribute's value.
key | |
value |
Implements org.turro.elephant.context.IConstructor.
Definition at line 236 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.setResponse | ( | ServletResponse | response | ) |
Called by ContextFactory during initialization.
response | Current HttpServletResponse. |
Implements org.turro.elephant.context.IConstructor.
Definition at line 105 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.setSessionAttribute | ( | String | key, |
Object | value | ||
) |
Sets session attribute's value.
key | |
value |
Implements org.turro.elephant.context.IConstructor.
Definition at line 227 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.setStopper | ( | String | stopper | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 359 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.setWebAdministering | ( | boolean | value | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 792 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.startBody | ( | ) |
Implements org.turro.elephant.context.IConstructor.
Definition at line 370 of file DefaultConstructor.java.
void org.turro.elephant.impl.context.DefaultConstructor.startConstruction | ( | ) | throws IOException, ServletException |
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 |
Implements org.turro.elephant.context.IConstructor.
Definition at line 268 of file DefaultConstructor.java.
String org.turro.elephant.impl.context.DefaultConstructor.urlToFile | ( | String | file | ) |
Definition at line 729 of file DefaultConstructor.java.
|
protected |
Definition at line 70 of file DefaultConstructor.java.
|
staticprotected |
Definition at line 66 of file DefaultConstructor.java.
|
protected |
Definition at line 76 of file DefaultConstructor.java.
|
protected |
Definition at line 74 of file DefaultConstructor.java.
|
protected |
Definition at line 73 of file DefaultConstructor.java.
|
protected |
Definition at line 71 of file DefaultConstructor.java.
|
protected |
Definition at line 69 of file DefaultConstructor.java.
|
protected |
Definition at line 67 of file DefaultConstructor.java.
|
protected |
Definition at line 68 of file DefaultConstructor.java.
|
protected |
Definition at line 75 of file DefaultConstructor.java.
|
protected |
Definition at line 72 of file DefaultConstructor.java.