|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectza.org.coefficient.core.BaseCoefficientContext
public abstract class BaseCoefficientContext
Project: coefficient
Description:
Copyright: Copyright (c) 2003
Company: CSIR
Field Summary | |
---|---|
static java.lang.String |
CURRENT_PROJECT
|
protected java.lang.String |
domain
|
protected java.util.Map |
fileUploadData
|
protected boolean |
invalidateSession
|
protected boolean |
inWorkflowAction
|
static java.lang.String |
LAST_NON_HELP_OP
|
protected MultipartRequest |
multipartRequest
|
protected Page |
page_
The page to handle this request |
protected java.lang.String |
redirectionURL
URL to redirect to if set |
protected java.util.ArrayList |
removedSessionKeys
|
protected java.util.Map |
requestAttributes
|
protected java.util.Map |
requestData
|
protected java.lang.String |
requestURL
|
protected org.apache.commons.httpclient.Cookie[] |
serializableExistingCookies
|
protected java.util.ArrayList |
serializableNewCookies
|
protected java.util.Map |
session
|
private CoefficientUser |
tempUser
|
protected static java.lang.String |
URL_PREFIX
|
private CoefficientUser |
workflowUser
|
Constructor Summary | |
---|---|
BaseCoefficientContext()
|
Method Summary | |
---|---|
void |
beginWorkflowAction()
This is used to do anything that needs doing for a workflow action to succeed |
java.lang.String |
clearModuleContent(java.lang.String name)
This method can be used to clear a modules set content from the page before it has been rendered. |
protected void |
clearPage()
|
protected void |
createPageObject()
|
void |
endWorkflowAction()
This should reset the state if need be |
private java.lang.String |
getCallerClassName()
|
org.apache.commons.httpclient.Cookie[] |
getCookies()
|
CoefficientUser |
getCurrentUser()
If a user is logged in this will return that user otherwise it will return null |
java.lang.String |
getLastNonHelpOp()
|
BaseMultipartRequest |
getMultipartRequest()
|
Page |
getPage()
|
java.lang.String |
getParameter(java.lang.String name)
Passthru method to the request object. |
java.lang.String |
getParameter(java.lang.String name,
java.lang.String defaultValue)
Passthru method to the request object. |
boolean |
getParameterAsBoolean(java.lang.String name)
|
java.util.Date |
getParameterAsDate(java.lang.String name)
|
java.lang.Double |
getParameterAsDouble(java.lang.String name)
|
java.lang.Double |
getParameterAsDouble(java.lang.String name,
double defaultValue)
|
double |
getParameterAsDoublePrimitive(java.lang.String name,
double defaultValue)
|
int |
getParameterAsInt(java.lang.String name,
int defaultValue)
|
java.lang.Integer |
getParameterAsInteger(java.lang.String name)
|
java.lang.Integer |
getParameterAsInteger(java.lang.String name,
int defaultValue)
|
java.lang.Long |
getParameterAsLong(java.lang.String name)
|
java.lang.Long |
getParameterAsLong(java.lang.String name,
long defaultValue)
|
long |
getParameterAsLongPrimitive(java.lang.String name,
long defaultValue)
|
java.lang.String[] |
getParametersValues(java.lang.String name)
|
java.lang.String[] |
getParameterValues(java.lang.String name)
Passthru method to the request object. |
java.lang.Long[] |
getParameterValuesLong(java.lang.String name)
Method to the request values as longs. |
Project |
getProject()
|
java.lang.Object |
getRequestAttribute(java.lang.String name)
|
java.util.Map |
getRequestAttributes()
|
java.util.Map |
getRequestData()
|
java.lang.String |
getRequestURL()
|
java.util.Map |
getSession()
|
java.lang.Object |
getSessionAttribute(java.lang.String name)
|
java.lang.String |
getTheme()
|
UploadedFile |
getUploadedFile(java.lang.String name)
|
void |
invalidateSession()
|
boolean |
isError()
|
void |
removeRequestAttribute(java.lang.String name)
|
void |
removeSessionAttribute(java.lang.String name)
|
void |
setCookie(org.apache.commons.httpclient.Cookie cookie)
|
void |
setError(java.lang.String html)
Passthru method to set the error content on the internal Page object |
void |
setForward(java.lang.String moduleName)
This will forward to the module and perform its main method |
void |
setForward(java.lang.String moduleName,
java.lang.String opName)
This will forward to the module and perform the method specified by op and will pass no other parameters |
void |
setForward(java.lang.String moduleName,
java.lang.String opName,
java.util.HashMap params)
This method is used to force a redirect after the current iteration of the interceptor chain has completed. |
void |
setModuleContent(java.lang.String html,
java.lang.String name)
Passthru method to set the module content on the internal Page object |
void |
setModuleContent(java.lang.String html,
java.lang.String name,
java.lang.String theme)
force a specific theme - used primarily for printing |
void |
setProject(Project project)
|
boolean |
setProperties(java.lang.Object bean)
Uses bean introspection to set writable properties of bean from the parameters, where a (case-insensitive) name match between the bean property and the parameter is looked for |
protected void |
setProperty(java.lang.Object bean,
java.beans.PropertyDescriptor prop)
Set the property 'prop' in the bean to the value of the corresponding parameters. |
void |
setRequestAttribute(java.lang.String name,
java.lang.Object value)
|
void |
setRequestAttributes(java.util.Map requestAttributes)
|
void |
setRequestData(java.util.Map requestData)
|
void |
setSession(java.util.Map session)
|
void |
setSessionAttribute(java.lang.String name,
java.lang.Object value)
|
void |
setTheme(java.lang.String theme)
|
void |
setWorkflowUser(CoefficientUser workflowUser)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CURRENT_PROJECT
public static final java.lang.String LAST_NON_HELP_OP
protected static final java.lang.String URL_PREFIX
protected Page page_
protected java.lang.String redirectionURL
protected java.lang.String domain
protected java.lang.String requestURL
protected boolean inWorkflowAction
protected boolean invalidateSession
private CoefficientUser tempUser
private CoefficientUser workflowUser
protected MultipartRequest multipartRequest
protected java.util.Map session
protected java.util.Map requestData
protected java.util.Map requestAttributes
protected java.util.Map fileUploadData
protected org.apache.commons.httpclient.Cookie[] serializableExistingCookies
protected java.util.ArrayList serializableNewCookies
protected java.util.ArrayList removedSessionKeys
Constructor Detail |
---|
public BaseCoefficientContext()
Method Detail |
---|
public void setError(java.lang.String html)
setError
in interface CoefficientContext
html
- a String containing the html content defining an error
displaypublic boolean isError()
isError
in interface CoefficientContext
public Page getPage()
getPage
in interface CoefficientContext
public java.lang.String getTheme()
getTheme
in interface CoefficientContext
public void setTheme(java.lang.String theme)
setTheme
in interface CoefficientContext
public void setForward(java.lang.String moduleName) throws ConfigurationException
setForward
in interface CoefficientContext
ConfigurationException
public void setForward(java.lang.String moduleName, java.lang.String opName) throws ConfigurationException
setForward
in interface CoefficientContext
ConfigurationException
public void setForward(java.lang.String moduleName, java.lang.String opName, java.util.HashMap params) throws ConfigurationException
setForward
in interface CoefficientContext
moduleName
- is the module to forward control to, this must not
be nullopName
- is the operation that the forwarded module should perform
if this value is null then it will use the MainMethodparams
- is a hashmap containing key-value pairs that will be
additional parameters included on the request line to the
specified module. If null no additional parameters will
be sent
configuationException
- is thrown if module name is empty
or null
ConfigurationException
public void setModuleContent(java.lang.String html, java.lang.String name) throws java.lang.RuntimeException
setModuleContent
in interface CoefficientContext
html
- a String containing the html content the module wants to
displayname
- is the result of the call to getModuleName on the module
setting the content
java.lang.RuntimeException
public void setModuleContent(java.lang.String html, java.lang.String name, java.lang.String theme) throws java.lang.RuntimeException
setModuleContent
in interface CoefficientContext
java.lang.RuntimeException
public java.lang.String clearModuleContent(java.lang.String name)
CoefficientContext
clearModuleContent
in interface CoefficientContext
public void setCookie(org.apache.commons.httpclient.Cookie cookie)
setCookie
in interface CoefficientContext
public org.apache.commons.httpclient.Cookie[] getCookies()
getCookies
in interface CoefficientContext
public BaseMultipartRequest getMultipartRequest() throws org.apache.commons.fileupload.FileUploadException
getMultipartRequest
in interface CoefficientContext
org.apache.commons.fileupload.FileUploadException
public java.lang.String getParameter(java.lang.String name)
getParameter
in interface CoefficientContext
name
- a String containing the paramameter name.
The getParameter() with a default value.
public java.lang.String[] getParameterValues(java.lang.String name)
getParameterValues
in interface CoefficientContext
name
- a String containing the parameter name.
public java.lang.String[] getParametersValues(java.lang.String name)
getParametersValues
in interface CoefficientContext
public boolean setProperties(java.lang.Object bean)
setProperties
in interface CoefficientContext
bean
- an object
public void setRequestAttribute(java.lang.String name, java.lang.Object value)
setRequestAttribute
in interface za.co.csir.icomtek.workflow.interfaces.WorkflowContext
public java.lang.Object getRequestAttribute(java.lang.String name)
getRequestAttribute
in interface CoefficientContext
public void setSessionAttribute(java.lang.String name, java.lang.Object value)
setSessionAttribute
in interface CoefficientContext
public java.lang.Object getSessionAttribute(java.lang.String name)
getSessionAttribute
in interface CoefficientContext
public void removeRequestAttribute(java.lang.String name)
removeRequestAttribute
in interface za.co.csir.icomtek.workflow.interfaces.WorkflowContext
public void removeSessionAttribute(java.lang.String name)
removeSessionAttribute
in interface CoefficientContext
public java.lang.String getParameter(java.lang.String name, java.lang.String defaultValue)
getParameter
in interface CoefficientContext
name
- a String with the name of the parameterdefaultValue
- if no parameter with that name is defined
the return value is the defaultValue
public boolean getParameterAsBoolean(java.lang.String name)
getParameterAsBoolean
in interface CoefficientContext
public java.util.Date getParameterAsDate(java.lang.String name)
getParameterAsDate
in interface CoefficientContext
public java.lang.Double getParameterAsDouble(java.lang.String name, double defaultValue)
getParameterAsDouble
in interface CoefficientContext
public java.lang.Double getParameterAsDouble(java.lang.String name)
getParameterAsDouble
in interface CoefficientContext
public double getParameterAsDoublePrimitive(java.lang.String name, double defaultValue)
getParameterAsDoublePrimitive
in interface CoefficientContext
public int getParameterAsInt(java.lang.String name, int defaultValue)
getParameterAsInt
in interface CoefficientContext
public java.lang.Integer getParameterAsInteger(java.lang.String name, int defaultValue)
getParameterAsInteger
in interface CoefficientContext
public java.lang.Integer getParameterAsInteger(java.lang.String name)
getParameterAsInteger
in interface CoefficientContext
public java.lang.Long getParameterAsLong(java.lang.String name, long defaultValue)
getParameterAsLong
in interface CoefficientContext
public java.lang.Long getParameterAsLong(java.lang.String name)
getParameterAsLong
in interface CoefficientContext
public long getParameterAsLongPrimitive(java.lang.String name, long defaultValue)
getParameterAsLongPrimitive
in interface CoefficientContext
public java.lang.Long[] getParameterValuesLong(java.lang.String name)
getParameterValuesLong
in interface CoefficientContext
name
- a String containing the parameter name.
public UploadedFile getUploadedFile(java.lang.String name) throws org.apache.commons.fileupload.FileUploadException
getUploadedFile
in interface CoefficientContext
org.apache.commons.fileupload.FileUploadException
public void setWorkflowUser(CoefficientUser workflowUser)
setWorkflowUser
in interface CoefficientContext
public void beginWorkflowAction()
beginWorkflowAction
in interface za.co.csir.icomtek.workflow.interfaces.WorkflowContext
public void endWorkflowAction()
endWorkflowAction
in interface za.co.csir.icomtek.workflow.interfaces.WorkflowContext
public java.lang.String getLastNonHelpOp()
getLastNonHelpOp
in interface CoefficientContext
public void setProject(Project project)
setProject
in interface CoefficientContext
public Project getProject()
getProject
in interface CoefficientContext
public void invalidateSession()
invalidateSession
in interface CoefficientContext
public CoefficientUser getCurrentUser()
getCurrentUser
in interface CoefficientContext
public java.lang.String getRequestURL()
getRequestURL
in interface CoefficientContext
protected void setProperty(java.lang.Object bean, java.beans.PropertyDescriptor prop) throws java.lang.Exception
bean
- An Object.prop
- A PropertyDescriptor.
java.lang.Exception
- a generic exception.protected void clearPage() throws java.io.IOException
java.io.IOException
protected void createPageObject() throws java.io.IOException
java.io.IOException
private java.lang.String getCallerClassName()
public java.util.Map getRequestAttributes()
public void setRequestAttributes(java.util.Map requestAttributes)
public java.util.Map getRequestData()
public void setRequestData(java.util.Map requestData)
public java.util.Map getSession()
public void setSession(java.util.Map session)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |