BrightSide Workbench Full Report + Source Code
org.turro.elephant.context.IConstructor Interface Reference
Inheritance diagram for org.turro.elephant.context.IConstructor:

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 ()
 

Detailed Description

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.

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

Definition at line 42 of file IConstructor.java.

Member Function Documentation

◆ addCSS()

void org.turro.elephant.context.IConstructor.addCSS ( String  cssFile)
Parameters
cssFileCSS file path.

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ addHeader()

void org.turro.elephant.context.IConstructor.addHeader ( String  header)
Parameters
header

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ addJavaScript()

void org.turro.elephant.context.IConstructor.addJavaScript ( String  jsFile)
Parameters
jsFileJavaScript file path.

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

◆ addMeta()

void org.turro.elephant.context.IConstructor.addMeta ( String  meta)
Parameters
metastring

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ addOnLoadedJavaScript()

void org.turro.elephant.context.IConstructor.addOnLoadedJavaScript ( String  script)

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ canWebAdminister()

boolean org.turro.elephant.context.IConstructor.canWebAdminister ( )

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ changeCssHeaders()

void org.turro.elephant.context.IConstructor.changeCssHeaders ( String  from,
String  to 
)

◆ closeOut()

void org.turro.elephant.context.IConstructor.closeOut ( ) throws IOException

◆ currentRepository()

static String org.turro.elephant.context.IConstructor.currentRepository ( IConstructor  constructor)
static

Definition at line 327 of file IConstructor.java.

327  {
328  String repository = WebContext.relativeRepository();
329  if(constructor != null) {
330  ElContext ctx = constructor.getRenderingContext();
331  if(ctx != null) {
332  repository = ctx.getRepositoryPath();
333  }
334  }
335  return ElephantContext.getRootWebPath() + repository;
336  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ decodeURL()

String org.turro.elephant.context.IConstructor.decodeURL ( String  url)
Parameters
urlURL to be decoded.
Returns
The decoded URL.

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

◆ encodeURL()

String org.turro.elephant.context.IConstructor.encodeURL ( String  url)
Parameters
urlURL to be encoded.
Returns
The encoded URL.

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

◆ endBody()

void org.turro.elephant.context.IConstructor.endBody ( )

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ fileExists()

boolean org.turro.elephant.context.IConstructor.fileExists ( String  filePath)

Check if file exists within web context

Parameters
filePathRelative path to file

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

◆ findAttribute()

Object org.turro.elephant.context.IConstructor.findAttribute ( String  key)

findAttribute looks sequentially in request, session and application scopes.

Parameters
keyAttribute to find.
Returns
Attribute's value or null.

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ forceIsAContext()

void org.turro.elephant.context.IConstructor.forceIsAContext ( ElContext  context)

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ getActionParameter()

String org.turro.elephant.context.IConstructor.getActionParameter ( )

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ getApplicationAttribute()

Object org.turro.elephant.context.IConstructor.getApplicationAttribute ( String  key)

Applications attributes live as long as container lives.

Parameters
keyAttribute to find.
Returns
Application attribute's value.

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

◆ getContextParameter()

String org.turro.elephant.context.IConstructor.getContextParameter ( )

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ getCurrentContext()

ElContext org.turro.elephant.context.IConstructor.getCurrentContext ( )
Returns
Current IContext.

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ getIdelParameter()

String org.turro.elephant.context.IConstructor.getIdelParameter ( )

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ getLastReferringContext()

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.

Returns
Last constructed context.

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ getLocalizer()

Localizer org.turro.elephant.context.IConstructor.getLocalizer ( )
Returns
A Localizer for current locale.
See also
org.turro.elephant.impl.util.Localizer

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ getOut()

PrintWriter org.turro.elephant.context.IConstructor.getOut ( ) throws IOException
Returns
Current PrintWriter in use.
Exceptions
java.io.IOException

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ getOutputString()

String org.turro.elephant.context.IConstructor.getOutputString ( )

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ getParameter() [1/2]

String org.turro.elephant.context.IConstructor.getParameter ( String  param)

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ getParameter() [2/2]

String org.turro.elephant.context.IConstructor.getParameter ( String  param,
boolean  decode 
)

◆ getParameters()

Parameters org.turro.elephant.context.IConstructor.getParameters ( )

◆ getParameterValues()

String [] org.turro.elephant.context.IConstructor.getParameterValues ( String  param)

◆ getRenderingContext()

ElContext org.turro.elephant.context.IConstructor.getRenderingContext ( )

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ getRequest()

HttpServletRequest org.turro.elephant.context.IConstructor.getRequest ( )
Returns
Current HttpServletRequest.

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ getRequestAttribute()

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.

Parameters
keyAttribute to find
Returns
Request attribute's value.

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

◆ getResponse()

HttpServletResponse org.turro.elephant.context.IConstructor.getResponse ( )
Returns
Current HttpServletResponse.

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ getSessionAttribute()

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.

Parameters
keyAttribute to find
Returns
Session attribute's value.

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ getSessionAttributeMap()

Map<String, Object> org.turro.elephant.context.IConstructor.getSessionAttributeMap ( String  prefix)

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ getTemplateRoot()

String org.turro.elephant.context.IConstructor.getTemplateRoot ( )

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ getUniqueId()

String org.turro.elephant.context.IConstructor.getUniqueId ( )

◆ getUser()

IContact org.turro.elephant.context.IConstructor.getUser ( )
Returns
A validated IUser or null if no user was validated.

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ getValidFileName()

String org.turro.elephant.context.IConstructor.getValidFileName ( String  name)

Convenience method for ensuring file names will contain valid characters and no spaces.

Parameters
nameFile name.
Returns
A valid file name.

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

◆ getValidUrl()

String org.turro.elephant.context.IConstructor.getValidUrl ( String  name)

Convenience method for ensuring paths will contain valid characters and no spaces.

Parameters
nameURL to be converted.
Returns
A valid URL.

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

◆ globalRepository()

static String org.turro.elephant.context.IConstructor.globalRepository ( )
static

Definition at line 338 of file IConstructor.java.

338  {
339  return ElephantContext.getRootWebPath() + WebContext.relativeRepository();
340  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasAnyRoleKey()

boolean org.turro.elephant.context.IConstructor.hasAnyRoleKey ( String  role)

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ includeContent()

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().

Parameters
pathRelative path to file.
Exceptions
javax.servlet.ServletException
java.io.IOException

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ invalidateSession()

void org.turro.elephant.context.IConstructor.invalidateSession ( )

◆ isFileInternal()

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.

Parameters
fileFile to query.
Returns
returns True if file is stored in internal folder structures.

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

◆ isHeadless()

boolean org.turro.elephant.context.IConstructor.isHeadless ( )

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ isInRole()

boolean org.turro.elephant.context.IConstructor.isInRole ( String  role)

IConstructor implementations should return true when the role string gets validated against current user.

Parameters
roleRole string.
Returns
True if current validated user is in role.

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ isOriginal()

boolean org.turro.elephant.context.IConstructor.isOriginal ( )

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ isOutsider()

boolean org.turro.elephant.context.IConstructor.isOutsider ( )

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ isWebAdministering()

boolean org.turro.elephant.context.IConstructor.isWebAdministering ( )

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ navigateBack()

void org.turro.elephant.context.IConstructor.navigateBack ( ) throws IOException

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ processOutput() [1/2]

void org.turro.elephant.context.IConstructor.processOutput ( PrintWriter  out,
String  text 
) throws ServletException, IOException

◆ processOutput() [2/2]

void org.turro.elephant.context.IConstructor.processOutput ( String  text) throws ServletException, IOException

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ redirect()

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.

Parameters
pathRelative path.
Exceptions
java.io.IOException

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ reload()

void org.turro.elephant.context.IConstructor.reload ( ) throws IOException

◆ removeApplicationAttribute()

void org.turro.elephant.context.IConstructor.removeApplicationAttribute ( String  key)

Removes application attribute.

Parameters
key

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

◆ removeRequestAttribute()

void org.turro.elephant.context.IConstructor.removeRequestAttribute ( String  key)

Removes request attribute.

Parameters
key

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

◆ removeSessionAttribute()

void org.turro.elephant.context.IConstructor.removeSessionAttribute ( String  key)

Removes session attribute.

Parameters
key

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ renderContext()

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.

Parameters
pathRelative path to file.
stopperString stopper, defaults to "<end/>"
Exceptions
javax.servlet.ServletException
java.io.IOException

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ setApplicationAttribute()

void org.turro.elephant.context.IConstructor.setApplicationAttribute ( String  key,
Object  value 
)

Sets application attribute's value.

Parameters
key
value

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

◆ setLastReferringContext()

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.

Parameters
contextLast constructed context.

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

◆ setMaxInactiveInterval()

void org.turro.elephant.context.IConstructor.setMaxInactiveInterval ( int  i)

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ setNullOutput()

void org.turro.elephant.context.IConstructor.setNullOutput ( boolean  value)

◆ setOut()

void org.turro.elephant.context.IConstructor.setOut ( PrintWriter  out) throws IOException

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ setOutputToString()

void org.turro.elephant.context.IConstructor.setOutputToString ( )

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ setPageRendering()

void org.turro.elephant.context.IConstructor.setPageRendering ( boolean  value)

◆ setRenderingContext()

void org.turro.elephant.context.IConstructor.setRenderingContext ( ElContext  context)

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ setRequest()

void org.turro.elephant.context.IConstructor.setRequest ( ServletRequest  request)

Called by ContextFactory during initialization.

Parameters
requestCurrent HttpServletRequest.

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ setRequestAttribute()

void org.turro.elephant.context.IConstructor.setRequestAttribute ( String  key,
Object  value 
)

Sets request attribute's value.

Parameters
key
value

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ setResponse()

void org.turro.elephant.context.IConstructor.setResponse ( ServletResponse  response)

Called by ContextFactory during initialization.

Parameters
responseCurrent HttpServletResponse.

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ setSessionAttribute()

void org.turro.elephant.context.IConstructor.setSessionAttribute ( String  key,
Object  value 
)

Sets session attribute's value.

Parameters
key
value

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ setStopper()

void org.turro.elephant.context.IConstructor.setStopper ( String  stopper)

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ setWebAdministering()

void org.turro.elephant.context.IConstructor.setWebAdministering ( boolean  value)

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ startBody()

void org.turro.elephant.context.IConstructor.startBody ( )

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

◆ startConstruction()

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.

Exceptions
javax.servlet.ServletException
java.io.IOException

Implemented in org.turro.elephant.impl.context.DefaultConstructor.

Here is the caller graph for this function:

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