|
|||||||||
| Home >> All >> org >> apache >> turbine >> [ util overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.turbine.util
Interface RunData

- public interface RunData
RunData is an interface to run-time information that is passed within Turbine. This provides the threading mechanism for the entire system because multiple requests can potentially come in at the same time. Thus, there is only one RunData implementation for each request that is being serviced.
- Version:
- $Id: RunData.java 264148 2005-08-29 14:21:04Z henning $
| Method Summary | |
void |
addMessage(org.apache.ecs.Element msg)
Adds the ECS element to message. |
void |
addMessage(java.lang.String msg)
Adds the string to message. |
void |
declareDirectResponse()
Declares that output will be direct to the response stream, even though getOut() may never be called. |
org.apache.turbine.util.security.AccessControlList |
getACL()
Gets the access control list. |
java.lang.String |
getAction()
Gets the action. |
java.lang.String |
getCharSet()
Gets the charset. |
java.lang.String |
getContentType()
Gets the HTTP content type to return. |
java.lang.String |
getContextPath()
Gets the cached context path. |
org.apache.turbine.util.parser.CookieParser |
getCookies()
Gets the cookies. |
java.util.Map |
getDebugVariables()
Gets a Map of debug variables. |
java.util.Map |
getJNDIContexts()
Gets JNDI Contexts. |
java.lang.String |
getLayout()
If the Layout has not been defined by the screen then set the layout to be "DefaultLayout". |
java.lang.String |
getLayoutTemplate()
Convenience method for a template info that returns the layout template being used. |
java.util.Locale |
getLocale()
Gets the locale. |
java.lang.String |
getMessage()
Gets the results of an action or another message to be displayed as a string. |
org.apache.ecs.StringElement |
getMessageAsHTML()
Gets the results of an action or another message to be displayed as an ECS string element. |
FormMessages |
getMessages()
Gets a FormMessages object where all the messages to the user should be stored. |
java.io.PrintWriter |
getOut()
Deprecated. no replacement planned, response writer will not be cached |
org.apache.ecs.Document |
getPage()
Deprecated. no replacement planned, ECS is no longer a requirement |
org.apache.turbine.util.parser.ParameterParser |
getParameters()
Gets the parameters. |
java.lang.String |
getRedirectURI()
Gets the redirect URI. |
java.lang.String |
getRemoteAddr()
Gets the IP address of the client that sent the request. |
java.lang.String |
getRemoteHost()
Gets the qualified name of the client that sent the request. |
javax.servlet.http.HttpServletRequest |
getRequest()
Gets the servlet request. |
javax.servlet.http.HttpServletResponse |
getResponse()
Gets the servlet response. |
java.lang.String |
getScreen()
Gets the screen to execute. |
java.lang.String |
getScreenTemplate()
Convenience method for a template info that returns the name of the template being used. |
java.lang.String |
getScriptName()
Gets the cached script name. |
ServerData |
getServerData()
Gets the server data used by the request. |
java.lang.String |
getServerName()
Gets the cached server name. |
int |
getServerPort()
Gets the cached server port. |
java.lang.String |
getServerScheme()
Gets the cached server scheme. |
javax.servlet.ServletConfig |
getServletConfig()
Gets the servlet configuration used during servlet init. |
javax.servlet.ServletContext |
getServletContext()
Gets the servlet context used during servlet init. |
javax.servlet.http.HttpSession |
getSession()
Gets the servlet session information. |
java.lang.String |
getStackTrace()
Gets the stack trace if set. |
java.lang.Throwable |
getStackTraceException()
Gets the stack trace exception if set. |
int |
getStatusCode()
Gets the HTTP status code to return. |
SystemError[] |
getSystemErrors()
Gets an array of system errors. |
java.lang.String |
getTemplateEncoding()
Gets the character encoding to use for reading template files. |
org.apache.turbine.util.template.TemplateInfo |
getTemplateInfo()
Gets the template info. |
java.lang.String |
getTitle()
Gets the title of the page. |
org.apache.turbine.om.security.User |
getUser()
Gets the user. |
java.lang.String |
getUserAgent()
Get the user agent for the request. |
org.apache.turbine.om.security.User |
getUserFromSession()
Attempts to get the user from the session. |
java.util.Map |
getVarDebug()
Deprecated. use getDebugVariables() 55 instead |
boolean |
hasAction()
Whether or not an action has been defined. |
boolean |
hasMessage()
Whether or not a message has been defined. |
boolean |
hasScreen()
Whether or not a screen has been defined. |
boolean |
isOutSet()
Deprecated. no replacement planned, response writer will not be cached |
boolean |
isPageSet()
Deprecated. no replacement planned, ECS is no longer a requirement |
void |
populate()
Pulls a user object from the session and increments the access counter and sets the last access date for the object. |
boolean |
removeUserFromSession()
Allows one to invalidate the user in the default session. |
void |
save()
Saves a user object into the session. |
void |
setACL(org.apache.turbine.util.security.AccessControlList acl)
Sets the access control list. |
void |
setAction(java.lang.String action)
Sets the action for the request. |
void |
setCharSet(java.lang.String charset)
Sets the charset. |
void |
setContentType(java.lang.String ct)
Sets the HTTP content type to return. |
void |
setDebugVariable(java.lang.String name,
java.lang.Object value)
Sets a name/value pair in an internal Map that is accessible from the Error screen. |
void |
setJNDIContexts(java.util.Map contexts)
Sets JNDI Contexts. |
void |
setLayout(java.lang.String layout)
Set the layout for the request. |
void |
setLayoutTemplate(java.lang.String layout)
Modifies the layout template for the screen. |
void |
setLocale(java.util.Locale locale)
Sets the locale. |
void |
setMessage(org.apache.ecs.Element msg)
Sets the message for the request as an ECS element. |
void |
setMessage(java.lang.String msg)
Sets the message for the request as a string. |
void |
setMessages(FormMessages msgs)
Sets the FormMessages object for the request. |
void |
setRedirectURI(java.lang.String ruri)
Sets the redirect uri. |
void |
setScreen(java.lang.String screen)
Sets the screen for the request. |
void |
setScreenTemplate(java.lang.String screen)
Sets the screen template for the request. |
void |
setStackTrace(java.lang.String trace,
java.lang.Throwable exp)
Sets the stack trace. |
void |
setStatusCode(int sc)
Sets the HTTP status code to return. |
void |
setSystemError(SystemError err)
Adds a critical system error. |
void |
setTemplateEncoding(java.lang.String encoding)
Sets the character encoding to use for reading template files. |
void |
setTitle(java.lang.String title)
Sets the title of the page. |
void |
setUser(org.apache.turbine.om.security.User user)
Sets the user. |
void |
unsetMessage()
Unsets the message for the request. |
boolean |
userExists()
Checks if a user exists in this session. |
| Method Detail |
getParameters
public org.apache.turbine.util.parser.ParameterParser getParameters()
- Gets the parameters.
getCookies
public org.apache.turbine.util.parser.CookieParser getCookies()
- Gets the cookies.
getRequest
public javax.servlet.http.HttpServletRequest getRequest()
- Gets the servlet request.
getResponse
public javax.servlet.http.HttpServletResponse getResponse()
- Gets the servlet response.
getSession
public javax.servlet.http.HttpSession getSession()
- Gets the servlet session information.
getServletConfig
public javax.servlet.ServletConfig getServletConfig()
- Gets the servlet configuration used during servlet init.
getServletContext
public javax.servlet.ServletContext getServletContext()
- Gets the servlet context used during servlet init.
getACL
public org.apache.turbine.util.security.AccessControlList getACL()
- Gets the access control list.
setACL
public void setACL(org.apache.turbine.util.security.AccessControlList acl)
- Sets the access control list.
isPageSet
public boolean isPageSet()
- Deprecated. no replacement planned, ECS is no longer a requirement
- Checks to see if the page is set.
- Checks to see if the page is set.
getPage
public org.apache.ecs.Document getPage()
- Deprecated. no replacement planned, ECS is no longer a requirement
- Gets the page.
- Gets the page.
hasAction
public boolean hasAction()
- Whether or not an action has been defined.
getAction
public java.lang.String getAction()
- Gets the action. It returns an empty string if null so
that it is easy to do conditionals on it based on the
equalsIgnoreCase() method.
setAction
public void setAction(java.lang.String action)
- Sets the action for the request.
getLayout
public java.lang.String getLayout()
- If the Layout has not been defined by the screen then set the
layout to be "DefaultLayout". The screen object can also
override this method to provide intelligent determination of
the Layout to execute. You can also define that logic here as
well if you want it to apply on a global scale. For example,
if you wanted to allow someone to define layout "preferences"
where they could dynamicially change the layout for the entire
site.
setLayout
public void setLayout(java.lang.String layout)
- Set the layout for the request.
getLayoutTemplate
public java.lang.String getLayoutTemplate()
- Convenience method for a template info that
returns the layout template being used.
setLayoutTemplate
public void setLayoutTemplate(java.lang.String layout)
- Modifies the layout template for the screen. This convenience
method allows for a layout to be modified from within a
template. For example;
$data.setLayoutTemplate("NewLayout.vm")
hasScreen
public boolean hasScreen()
- Whether or not a screen has been defined.
getScreen
public java.lang.String getScreen()
- Gets the screen to execute.
setScreen
public void setScreen(java.lang.String screen)
- Sets the screen for the request.
getScreenTemplate
public java.lang.String getScreenTemplate()
- Convenience method for a template info that
returns the name of the template being used.
setScreenTemplate
public void setScreenTemplate(java.lang.String screen)
- Sets the screen template for the request. For
example;
$data.setScreenTemplate("NewScreen.vm")
getTemplateEncoding
public java.lang.String getTemplateEncoding()
- Gets the character encoding to use for reading template files.
setTemplateEncoding
public void setTemplateEncoding(java.lang.String encoding)
- Sets the character encoding to use for reading template files.
getTemplateInfo
public org.apache.turbine.util.template.TemplateInfo getTemplateInfo()
- Gets the template info. Creates a new one if needed.
hasMessage
public boolean hasMessage()
- Whether or not a message has been defined.
getMessage
public java.lang.String getMessage()
- Gets the results of an action or another message
to be displayed as a string.
setMessage
public void setMessage(java.lang.String msg)
- Sets the message for the request as a string.
addMessage
public void addMessage(java.lang.String msg)
- Adds the string to message. If message has prior messages from
other actions or screens, this method can be used to chain them.
getMessageAsHTML
public org.apache.ecs.StringElement getMessageAsHTML()
- Gets the results of an action or another message
to be displayed as an ECS string element.
setMessage
public void setMessage(org.apache.ecs.Element msg)
- Sets the message for the request as an ECS element.
addMessage
public void addMessage(org.apache.ecs.Element msg)
- Adds the ECS element to message. If message has prior messages from
other actions or screens, this method can be used to chain them.
unsetMessage
public void unsetMessage()
- Unsets the message for the request.
getMessages
public FormMessages getMessages()
- Gets a FormMessages object where all the messages to the
user should be stored.
setMessages
public void setMessages(FormMessages msgs)
- Sets the FormMessages object for the request.
getTitle
public java.lang.String getTitle()
- Gets the title of the page.
setTitle
public void setTitle(java.lang.String title)
- Sets the title of the page.
userExists
public boolean userExists()
- Checks if a user exists in this session.
getUser
public org.apache.turbine.om.security.User getUser()
- Gets the user.
setUser
public void setUser(org.apache.turbine.om.security.User user)
- Sets the user.
getUserFromSession
public org.apache.turbine.om.security.User getUserFromSession()
- Attempts to get the user from the session. If it does
not exist, it returns null.
removeUserFromSession
public boolean removeUserFromSession()
- Allows one to invalidate the user in the default session.
isOutSet
public boolean isOutSet()
- Deprecated. no replacement planned, response writer will not be cached
- Checks to see if out is set.
- Checks to see if out is set.
getOut
public java.io.PrintWriter getOut() throws java.io.IOException
- Deprecated. no replacement planned, response writer will not be cached
- Gets the print writer. First time calling this will set the print writer via the response.
- Gets the print writer. First time calling this will set the print writer via the response.
declareDirectResponse
public void declareDirectResponse()
- Declares that output will be direct to the response stream,
even though getOut() may never be called. Useful for response
mechanisms that may call res.getWriter() themselves
(such as JSP.)
getLocale
public java.util.Locale getLocale()
- Gets the locale. If it has not already been defined with
setLocale(), then properties named "locale.default.lang"
and "locale.default.country" are checked from the Resource
Service and the corresponding locale is returned. If these
properties are undefined, JVM's default locale is returned.
setLocale
public void setLocale(java.util.Locale locale)
- Sets the locale.
getCharSet
public java.lang.String getCharSet()
- Gets the charset. If it has not already been defined with
setCharSet(), then a property named "locale.default.charset"
is checked from the Resource Service and returned. If this
property is undefined, the default charset of the locale
is returned. If the locale is undefined, null is returned.
setCharSet
public void setCharSet(java.lang.String charset)
- Sets the charset.
getContentType
public java.lang.String getContentType()
- Gets the HTTP content type to return. If a charset
has been specified, it is included in the content type.
If the charset has not been specified and the main type
of the content type is "text", the default charset is
included. If the default charset is undefined, but the
default locale is defined and it is not the US locale,
a locale specific charset is included.
setContentType
public void setContentType(java.lang.String ct)
- Sets the HTTP content type to return.
getRedirectURI
public java.lang.String getRedirectURI()
- Gets the redirect URI. If this is set, also make sure to set
the status code to 302.
setRedirectURI
public void setRedirectURI(java.lang.String ruri)
- Sets the redirect uri. If this is set, also make sure to set
the status code to 302.
getStatusCode
public int getStatusCode()
- Gets the HTTP status code to return.
setStatusCode
public void setStatusCode(int sc)
- Sets the HTTP status code to return.
getSystemErrors
public SystemError[] getSystemErrors()
- Gets an array of system errors.
setSystemError
public void setSystemError(SystemError err)
- Adds a critical system error.
getJNDIContexts
public java.util.Map getJNDIContexts()
- Gets JNDI Contexts.
setJNDIContexts
public void setJNDIContexts(java.util.Map contexts)
- Sets JNDI Contexts.
getServerScheme
public java.lang.String getServerScheme()
- Gets the cached server scheme.
getServerName
public java.lang.String getServerName()
- Gets the cached server name.
getServerPort
public int getServerPort()
- Gets the cached server port.
getContextPath
public java.lang.String getContextPath()
- Gets the cached context path.
getScriptName
public java.lang.String getScriptName()
- Gets the cached script name.
getServerData
public ServerData getServerData()
- Gets the server data used by the request.
getRemoteAddr
public java.lang.String getRemoteAddr()
- Gets the IP address of the client that sent the request.
getRemoteHost
public java.lang.String getRemoteHost()
- Gets the qualified name of the client that sent the request.
getUserAgent
public java.lang.String getUserAgent()
- Get the user agent for the request.
populate
public void populate()
- Pulls a user object from the session and increments the access
counter and sets the last access date for the object.
save
public void save()
- Saves a user object into the session.
getStackTrace
public java.lang.String getStackTrace()
- Gets the stack trace if set.
getStackTraceException
public java.lang.Throwable getStackTraceException()
- Gets the stack trace exception if set.
setStackTrace
public void setStackTrace(java.lang.String trace, java.lang.Throwable exp)
- Sets the stack trace.
getVarDebug
public java.util.Map getVarDebug()
- Deprecated. use
getDebugVariables()55 instead- Gets a table of debug variables.
- Gets a table of debug variables.
setDebugVariable
public void setDebugVariable(java.lang.String name, java.lang.Object value)
- Sets a name/value pair in an internal Map that is accessible from the
Error screen. This is a good way to get debugging information
when an exception is thrown.
getDebugVariables
public java.util.Map getDebugVariables()
- Gets a Map of debug variables.
|
|||||||||
| Home >> All >> org >> apache >> turbine >> [ util overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC