Expresso 5-6

com.jcorporate.expresso.ext.controller
Class ReportServer

java.lang.Object
  extended byorg.apache.struts.action.Action
      extended bycom.jcorporate.expresso.core.controller.Controller
          extended bycom.jcorporate.expresso.core.controller.DBController
              extended bycom.jcorporate.expresso.ext.controller.ReportServer
All Implemented Interfaces:
Serializable

public class ReportServer
extends DBController

Report server is a generic controller for dishing up reports. It does not have inherant Report security other than controller security. For additional features such as built-in JasperReports capabilities (and thus the ability to send output in CSV, XML, Excel, Html, or PDF formats], built in Report-by-report security and save on server features, consider JCorporate's eContent commercial content management framework. See http://www.jcorporate.com/econtent.html for details.

Todo items include saving the report to a file and then sending that file instead so that we can set the content length so items like the pdf files work work properly in IE.

Author:
Michael Rimov
See Also:
Serialized Form

Field Summary
static org.apache.log4j.Logger log
          The Log4j Logger
 
Fields inherited from class com.jcorporate.expresso.core.controller.Controller
CONTROLLER_PARAM_KEY, CTL_SUCC_CTL, CTL_SUCC_STATE, CTL_SUCC_TRAN, mLog, NEWSTATE_EXCEPTION_KEY, ORIGINAL_URL_KEY, REQUEST_KEY, RESPONSE_KEY, RETURN_TO_SENDER_TRAN, STATE_ERR_CTL, STATE_ERR_STATE, STATE_ERR_TRAN, STATE_PARAM_KEY, STATE_SUCC_CTL, STATE_SUCC_STATE, STATE_SUCC_TRAN
 
Fields inherited from class org.apache.struts.action.Action
ACTION_SERVLET_KEY, APPLICATION_KEY, DATA_SOURCE_KEY, defaultLocale, ERROR_KEY, EXCEPTION_KEY, FORM_BEANS_KEY, FORWARDS_KEY, LOCALE_KEY, MAPPING_KEY, MAPPINGS_KEY, MESSAGE_KEY, MESSAGES_KEY, MULTIPART_KEY, PLUG_INS_KEY, REQUEST_PROCESSOR_KEY, servlet, SERVLET_KEY, TRANSACTION_TOKEN_KEY
 
Constructor Summary
ReportServer()
          Creates an instance of ReportServer.
 
Method Summary
 String getTitle()
          Override of Controller.getTitle() to provide a meaningful name to this controller
protected  ExpressoReport instantiateReport(ControllerRequest request)
          Instantiate an Expresso report based upon the 'ReportClass' parameter given in the ControllerRequest object
protected  void runProcessReportState(ControllerRequest request, ControllerResponse response)
          Process the actual report.
protected  void runPromptState(ControllerRequest request, ControllerResponse response)
          Runs the Prompt state
protected  void runSelectReportState(ControllerRequest request, ControllerResponse response)
          Runs the Prompt state
protected  void runSetParametersState(ControllerRequest request, ControllerResponse response)
          Selects the report output format, if it is a MultiFormatted Report, and if not, provide a few parameters.
 
Methods inherited from class com.jcorporate.expresso.core.controller.DBController
getString, isAllowed, stateAllowed
 
Methods inherited from class com.jcorporate.expresso.core.controller.Controller
addFinalState, addPromptTransitions, addRegDomainParamtoSession, addRequestedURLtoSession, addState, addStatePairing, endTimer, execute, findControllerForm, generateToken, getActionForward, getControllerChainingTransition, getControllerSecurityTransition, getFinalState, getInitialState, getLogger, getParamValues, getRequestURL, getSchema, getSchemaHierarchy, getSchemaInstance, getSchemaStack, getState, getStates, getString, getString, handleException, instantiate, isFinalState, isHandleState, isPromptState, isTokenValid, loadStateForm, newState, nextHandleState, nextPromptState, populateStateForm, postPerform, prePerform, previousPromptState, processRequestTransitions, processTransitions, redirectRequest, redirectRequest, remapFromExtension, resetToken, saveToken, setControllerChainingTransition, setControllerSecurityTransition, setCurrentState, setInitialState, setSchema, setSchema, setupDefaultValues, setupReturnToSender, setupSubclassLog, transition, transition, transition, unloadStateForm
 
Methods inherited from class org.apache.struts.action.Action
execute, generateToken, getDataSource, getDataSource, getLocale, getResources, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, perform, perform, resetToken, saveErrors, saveMessages, saveToken, setLocale, setServlet, toHex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final transient org.apache.log4j.Logger log
The Log4j Logger

Constructor Detail

ReportServer

public ReportServer()
             throws ControllerException
Creates an instance of ReportServer. Call setRequestingUid() and setDataContext() before using.

Throws:
ControllerException - upon initialization Exception
See Also:
SecuredDBObject.SecuredDBObject(java.lang.String, int)
Method Detail

getTitle

public String getTitle()
Override of Controller.getTitle() to provide a meaningful name to this controller

Overrides:
getTitle in class Controller
Returns:
java.lang.String

instantiateReport

protected ExpressoReport instantiateReport(ControllerRequest request)
                                    throws ControllerException,
                                           ClassNotFoundException
Instantiate an Expresso report based upon the 'ReportClass' parameter given in the ControllerRequest object

Parameters:
request - a ControllerRequest object with the 'ReportClass' parameter included.
Returns:
An ExpressoReport object fully instantiated
Throws:
ControllerException - upon instantiation exception
ClassNotFoundException - for special handling by the calling object if the class was not found.

runProcessReportState

protected void runProcessReportState(ControllerRequest request,
                                     ControllerResponse response)
                              throws ControllerException,
                                     NonHandleableException
Process the actual report.

Parameters:
request - The ControllerRequest object handed to us by the framework.
response - The ControllerResponse object handed to us by the framework.
Throws:
ControllerException - upon error
NonHandleableException - upon fatal error

runPromptState

protected void runPromptState(ControllerRequest request,
                              ControllerResponse response)
                       throws ControllerException,
                              NonHandleableException
Runs the Prompt state

Parameters:
request - The ControllerRequest object handed to us by the framework.
response - The ControllerResponse object handed to us by the framework.
Throws:
ControllerException - upon error
NonHandleableException - upon fatal error

runSelectReportState

protected void runSelectReportState(ControllerRequest request,
                                    ControllerResponse response)
                             throws ControllerException,
                                    NonHandleableException
Runs the Prompt state

Parameters:
request - The ControllerRequest object handed to us by the framework.
response - The ControllerResponse object handed to us by the framework.
Throws:
ControllerException - upon error
NonHandleableException - upon fatal error

runSetParametersState

protected void runSetParametersState(ControllerRequest request,
                                     ControllerResponse response)
                              throws ControllerException,
                                     NonHandleableException
Selects the report output format, if it is a MultiFormatted Report, and if not, provide a few parameters.

Parameters:
request - The ControllerRequest object handed to us by the framework.
response - The ControllerResponse object handed to us by the framework.
Throws:
ControllerException - upon error
NonHandleableException - upon fatal error

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.