za.org.coefficient.interfaces
Interface CoefficientContext

All Superinterfaces:
za.co.csir.icomtek.workflow.interfaces.WorkflowContext
All Known Implementing Classes:
BaseCoefficientContext, CoefficientTestingContext, CoefficientWebContext

public interface CoefficientContext
extends za.co.csir.icomtek.workflow.interfaces.WorkflowContext

DOCUMENT ME!

Version:
$Revision: 1.7 $
Author:
$author$

Method Summary
 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.
 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)
          Passthru method to the request object.
 Project getProject()
           
 java.lang.Object getRequestAttribute(java.lang.String name)
           
 java.lang.String getRequestURL()
           
 java.lang.Object getSessionAttribute(java.lang.String name)
           
 java.lang.String getTheme()
           
 UploadedFile getUploadedFile(java.lang.String name)
           
 void invalidateSession()
           
 boolean isError()
           
 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
 void setSessionAttribute(java.lang.String name, java.lang.Object value)
           
 void setTheme(java.lang.String theme)
           
 void setWorkflowUser(CoefficientUser workflowUser)
           
 
Methods inherited from interface za.co.csir.icomtek.workflow.interfaces.WorkflowContext
beginWorkflowAction, endWorkflowAction, removeRequestAttribute, setRequestAttribute
 

Method Detail

setCookie

void setCookie(org.apache.commons.httpclient.Cookie cookie)

getCookies

org.apache.commons.httpclient.Cookie[] getCookies()

getCurrentUser

CoefficientUser getCurrentUser()
If a user is logged in this will return that user otherwise it will return null

Returns:
the logged in user or null if not logged in

setError

void setError(java.lang.String html)
Passthru method to set the error content on the internal Page object

Parameters:
html - a String containing the html content defining an error display

isError

boolean isError()

setForward

void setForward(java.lang.String moduleName)
                throws ConfigurationException
This will forward to the module and perform its main method

Throws:
ConfigurationException

setForward

void setForward(java.lang.String moduleName,
                java.lang.String opName)
                throws ConfigurationException
This will forward to the module and perform the method specified by op and will pass no other parameters

Throws:
ConfigurationException

setForward

void setForward(java.lang.String moduleName,
                java.lang.String opName,
                java.util.HashMap params)
                throws ConfigurationException
This method is used to force a redirect after the current iteration of the interceptor chain has completed.

Parameters:
moduleName - is the module to forward control to, this must not be null
opName - is the operation that the forwarded module should perform if this value is null then it will use the MainMethod
params - 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
Throws:
configuationException - is thrown if module name is empty or null
ConfigurationException

setModuleContent

void setModuleContent(java.lang.String html,
                      java.lang.String name)
                      throws java.lang.RuntimeException
Passthru method to set the module content on the internal Page object

Parameters:
html - a String containing the html content the module wants to display
name - is the result of the call to getModuleName on the module setting the content
Throws:
java.lang.RuntimeException

setModuleContent

void setModuleContent(java.lang.String html,
                      java.lang.String name,
                      java.lang.String theme)
                      throws java.lang.RuntimeException
force a specific theme - used primarily for printing

Throws:
java.lang.RuntimeException

clearModuleContent

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. The content is returned so you can do what you would like with the content but it will not show up in the page unless placed there manually.

Parameters:
moduleName - is the name of the modules content to clear.
Returns:
is the content html string if content has been set for the module, null otherwise.

getMultipartRequest

BaseMultipartRequest getMultipartRequest()
                                         throws org.apache.commons.fileupload.FileUploadException
Throws:
org.apache.commons.fileupload.FileUploadException

getPage

Page getPage()

getTheme

java.lang.String getTheme()

setTheme

void setTheme(java.lang.String theme)

getParameter

java.lang.String getParameter(java.lang.String name)
Passthru method to the request object.

Parameters:
name - a String containing the paramameter name.
Returns:
a String containing the parameter value.
See Also:
The getParameter() with a default value.

getParameter

java.lang.String getParameter(java.lang.String name,
                              java.lang.String defaultValue)
Passthru method to the request object.

Parameters:
name - a String with the name of the parameter
defaultValue - if no parameter with that name is defined the return value is the defaultValue
Returns:
a String with the parameter value or the default value.

getParameterAsBoolean

boolean getParameterAsBoolean(java.lang.String name)

getParameterAsDate

java.util.Date getParameterAsDate(java.lang.String name)

getParameterAsDouble

java.lang.Double getParameterAsDouble(java.lang.String name,
                                      double defaultValue)

getParameterAsDouble

java.lang.Double getParameterAsDouble(java.lang.String name)

getParameterAsDoublePrimitive

double getParameterAsDoublePrimitive(java.lang.String name,
                                     double defaultValue)

getParameterAsInt

int getParameterAsInt(java.lang.String name,
                      int defaultValue)

getParameterAsInteger

java.lang.Integer getParameterAsInteger(java.lang.String name,
                                        int defaultValue)

getParameterAsInteger

java.lang.Integer getParameterAsInteger(java.lang.String name)

getParameterAsLong

java.lang.Long getParameterAsLong(java.lang.String name,
                                  long defaultValue)

getParameterAsLong

java.lang.Long getParameterAsLong(java.lang.String name)

getParameterAsLongPrimitive

long getParameterAsLongPrimitive(java.lang.String name,
                                 long defaultValue)

getParameterValues

java.lang.String[] getParameterValues(java.lang.String name)
Passthru method to the request object. If request is null, return an empty array of String.

Parameters:
name - a String containing the parameter name.
Returns:
an array of Strings with all values associated

getParameterValuesLong

java.lang.Long[] getParameterValuesLong(java.lang.String name)
Passthru method to the request object. If request is null, return an empty array of String.

Parameters:
name - a String containing the parameter name.
Returns:
an array of Strings with all values associated

getParametersValues

java.lang.String[] getParametersValues(java.lang.String name)

setProject

void setProject(Project project)

getProject

Project getProject()

setProperties

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

Parameters:
bean - an object
Returns:
if true then all properties were successfully set, else some were not

getRequestAttribute

java.lang.Object getRequestAttribute(java.lang.String name)

getRequestURL

java.lang.String getRequestURL()

getLastNonHelpOp

java.lang.String getLastNonHelpOp()

setSessionAttribute

void setSessionAttribute(java.lang.String name,
                         java.lang.Object value)

getSessionAttribute

java.lang.Object getSessionAttribute(java.lang.String name)

getUploadedFile

UploadedFile getUploadedFile(java.lang.String name)
                             throws org.apache.commons.fileupload.FileUploadException
Throws:
org.apache.commons.fileupload.FileUploadException

setWorkflowUser

void setWorkflowUser(CoefficientUser workflowUser)

invalidateSession

void invalidateSession()

removeSessionAttribute

void removeSessionAttribute(java.lang.String name)


Copyright CSIR. All Rights Reserved.