|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.outerj.xreporter.report.instance.ReportImpl
This class represents a Report instance. Users must use the ReportManager.getReport(java.lang.String, org.outerj.xreporter.user.User)
method
to get access the instance.
Nested Class Summary | |
class |
ReportImpl.ReportExpressionContext
ExpressionContext that resolves variables to parameter values. |
Field Summary | |
protected Columns |
columns
|
protected DataSource |
dataSource
|
protected static java.lang.String |
DATASOURCE_ID_ATTR
|
protected static java.lang.String |
DATASOURCE_NAME_EL
|
protected DataSourceManager |
dataSourceManager
|
protected ExpressionContext |
expressionContext
|
protected java.lang.String |
id
|
protected static java.lang.String |
INFO_EL
|
protected long |
lastAccessed
|
protected static java.lang.String |
LISTENER_EL
|
protected static java.lang.String |
LISTENER_HOST_EL
|
protected static java.lang.String |
LISTENER_NAME_EL
|
protected static java.lang.String |
LISTENER_PORT_EL
|
protected org.apache.avalon.excalibur.concurrent.Mutex |
mutex
This mutex is used to check that no two parties can use the report instance at the same time. |
protected OrderBy |
orderBy
|
protected Qbe |
qbe
|
protected static java.lang.String |
REPORT_DEFINITION_ID_ATTR
|
protected static java.lang.String |
REPORT_DESCRIPTION_EL
|
protected static java.lang.String |
REPORT_EL
|
protected static java.lang.String |
REPORT_INSTANCE_ID_ATTR
|
protected static java.lang.String |
REPORT_NAME_EL
|
protected ReportDefinition |
reportDefinition
|
protected ResourceHandle |
resourceHandle
|
protected java.util.List |
steps
|
protected java.util.HashMap |
stepsByName
|
protected static java.lang.String |
SUPPORTS_ORDERBY_EL
|
protected static java.lang.String |
SUPPORTS_QBE_EL
|
protected static java.lang.String |
TIME_EL
|
protected User |
user
The user currently using this report |
protected UserEntryStore |
userEntryStore
|
Constructor Summary | |
ReportImpl(java.lang.String id,
ReportDefinition reportDefinition,
DataSource dataSource,
ResourceHandle resourceHandle)
Important: any Avalon interfaces implemented by this object should be respected. |
Method Summary | |
Report |
acquire(long msecs,
User user)
Acquire a lock on this report. |
Report |
acquire(User user)
Acquire a lock on this report. |
boolean |
allStepsComplete()
Returns true if all (interaction) steps have been completed. |
protected void |
autoRunSteps()
Checks if the current step only has an execute-part (and no interaction), and if so runs that execute part, and keeps doing this until it is at the last (non-interactive) step. |
void |
compose(org.apache.avalon.framework.component.ComponentManager componentManager)
|
void |
dispose()
Cleans up resources used by this report. |
void |
generateColumns(org.xml.sax.ContentHandler contentHandler)
|
void |
generateOrderByChoices(org.xml.sax.ContentHandler contentHandler)
|
void |
generateQbe(org.xml.sax.ContentHandler contentHandler)
|
protected void |
generateReportFooterSaxFragment(org.xml.sax.ContentHandler contentHandler)
Closes the xr:report element and ends the document started by generateReportHeaderStartSaxFragment(org.xml.sax.ContentHandler) . |
protected void |
generateReportHeaderStartSaxFragment(org.xml.sax.ContentHandler contentHandler)
Generate the beginning of a report header, this leaves the xr:report and xr:info elements open. |
protected void |
generateReportHeaderStopSaxFragment(org.xml.sax.ContentHandler contentHandler)
Closes the xr:info element started by generateReportHeaderStartSaxFragment(org.xml.sax.ContentHandler) . |
void |
generateSaxForOutput(org.xml.sax.ContentHandler contentHandler,
int chunkOffset,
int chunkLength)
|
void |
generateSaxForStep(org.xml.sax.ContentHandler contentHandler,
java.lang.String name)
Generates SAX events containing all information needed to display a form for completing the interaction of a step. |
protected void |
generateStepsInfoSaxFragment(org.xml.sax.ContentHandler contentHandler)
|
void |
generateUrl(org.xml.sax.ContentHandler contentHandler)
Generates some XML containing a /reports URL with all necessary parameters to recreate the report to its current state. |
Columns |
getColumns()
Provides access to the Columns configuration. |
protected Step |
getCurrentStep()
|
java.lang.String |
getCurrentStepName()
|
DataSource |
getDataSource()
Gets the data source of the report instance. |
DataSourceManager |
getDataSourceManager()
Gets the data source manager. |
ExpressionContext |
getExpressionContext()
Gets the context for evaluating expressions. |
java.lang.String |
getHostName()
Return the host name of the server instance this report is running on. |
java.lang.String |
getId()
|
InputField |
getInputField(java.lang.String name)
If the ExecutionContext is a Step, then this will only provide access to InputField's of the current or previous steps. |
long |
getLastAccessed()
|
java.lang.String |
getListenerName()
Return the logical name of the server instance this report is running on. |
java.lang.String |
getOrderBySql()
Returns the sql for the currently selected orderby choice, or null if no orderby is configured. |
int |
getPort()
Return the port number of the server instance this report is running on. |
Qbe |
getQbe()
Provides access to the QBE (Query By Example) configuration. |
ReportDefinition |
getReportDefinition()
|
java.lang.String |
getReportDefinitionId()
|
java.lang.String |
getReportId()
Returns the id of the report instance. |
ResourceHandle |
getResourceHandle()
|
ReportState |
getState()
Returns an object containing all user-specified state of the report. |
Step |
getStep(java.lang.String stepName)
|
java.lang.String |
getTemporaryTableName(java.lang.String name)
Constructs a temporary table name. |
User |
getUser()
Gets the user currently using this report. |
UserEntryStore |
getUserEntryStore()
|
void |
initialize()
|
void |
registerTemporaryTableName(java.lang.String name)
Registers a temporary table name for automatic cleanup. |
void |
release()
|
void |
resetColumns()
|
protected void |
resetFromStep(Step step)
Resets all report state starting from the given step |
void |
resetFromStep(java.lang.String stepName)
Resets all report state starting from (and including) the step whose name is giving as a parameter. |
void |
resetLastAccessed()
|
void |
resetQbe()
|
void |
restoreState(ReportState reportState)
Applies the state from the given reportState back to this report. |
void |
setCustomOrderBy(java.util.Map values,
ResourceHandle resourceHandle)
Defines custom orderby settings. |
void |
setHostName(java.lang.String name,
boolean disclose)
|
void |
setListenerName(java.lang.String name)
|
void |
setOrderBy(java.lang.String id)
Sets the current orderby configuration to a default defined in the report definition. |
void |
setPort(int port,
boolean disclose)
|
void |
setQbeOrientation(java.lang.String orientation)
|
void |
submitColumns(java.util.Map values)
|
boolean |
submitQbe(java.util.Map values)
|
boolean |
submitStep(java.lang.String stepName,
java.util.Map values)
Submit (user input) values to fill the parameters and conditions in this step. |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected ReportDefinition reportDefinition
protected java.util.List steps
protected java.util.HashMap stepsByName
protected java.lang.String id
protected DataSource dataSource
protected DataSourceManager dataSourceManager
protected UserEntryStore userEntryStore
protected org.apache.avalon.excalibur.concurrent.Mutex mutex
protected long lastAccessed
protected OrderBy orderBy
protected Qbe qbe
protected Columns columns
protected ResourceHandle resourceHandle
protected ExpressionContext expressionContext
protected User user
protected static final java.lang.String REPORT_EL
protected static final java.lang.String INFO_EL
protected static final java.lang.String LISTENER_EL
protected static final java.lang.String LISTENER_NAME_EL
protected static final java.lang.String LISTENER_HOST_EL
protected static final java.lang.String LISTENER_PORT_EL
protected static final java.lang.String DATASOURCE_NAME_EL
protected static final java.lang.String REPORT_NAME_EL
protected static final java.lang.String REPORT_DESCRIPTION_EL
protected static final java.lang.String TIME_EL
protected static final java.lang.String SUPPORTS_QBE_EL
protected static final java.lang.String SUPPORTS_ORDERBY_EL
protected static final java.lang.String REPORT_INSTANCE_ID_ATTR
protected static final java.lang.String REPORT_DEFINITION_ID_ATTR
protected static final java.lang.String DATASOURCE_ID_ATTR
Constructor Detail |
public ReportImpl(java.lang.String id, ReportDefinition reportDefinition, DataSource dataSource, ResourceHandle resourceHandle)
Method Detail |
public void compose(org.apache.avalon.framework.component.ComponentManager componentManager) throws org.apache.avalon.framework.component.ComponentException
compose
in interface org.apache.avalon.framework.component.Composable
org.apache.avalon.framework.component.ComponentException
public void setListenerName(java.lang.String name)
public void setHostName(java.lang.String name, boolean disclose)
public void setPort(int port, boolean disclose)
public java.lang.String getListenerName()
ExecutionContext
getListenerName
in interface ExecutionContext
public java.lang.String getHostName()
ExecutionContext
getHostName
in interface ExecutionContext
public int getPort()
ExecutionContext
getPort
in interface ExecutionContext
public java.lang.String getId()
getId
in interface Report
Report.getId()
public ReportDefinition getReportDefinition()
public void initialize() throws java.lang.Exception
initialize
in interface org.apache.avalon.framework.activity.Initializable
java.lang.Exception
public boolean submitStep(java.lang.String stepName, java.util.Map values) throws UnknownStepNameException, WrongStateException, ExecuteException, UserEntryStoreException
Report
Report.generateSaxForStep(org.xml.sax.ContentHandler, java.lang.String)
should be called to get
a list of all parameters and conditions with their validation errors.
If the report was already in a further state (i.e. some of the next steps were already completed, or the report was already in the output state), then all the state from this step on will be reset.
submitStep
in interface Report
values
- a Map containing string keys and values
UnknownStepNameException
WrongStateException
ExecuteException
UserEntryStoreException
Report.submitStep(java.lang.String, java.util.Map)
protected void autoRunSteps() throws ExecuteException, UserEntryStoreException
ExecuteException
UserEntryStoreException
public void resetFromStep(java.lang.String stepName) throws UnknownStepNameException, WrongStateException, ExecuteException, UserEntryStoreException
Report
Report.submitStep(java.lang.String, java.util.Map)
.
resetFromStep
in interface Report
UnknownStepNameException
WrongStateException
ExecuteException
UserEntryStoreException
Report.resetFromStep(java.lang.String)
protected void resetFromStep(Step step)
public void generateSaxForStep(org.xml.sax.ContentHandler contentHandler, java.lang.String name) throws UnknownStepNameException, org.xml.sax.SAXException, java.lang.Exception
Report
Report.getCurrentStepName()
.
generateSaxForStep
in interface Report
UnknownStepNameException
org.xml.sax.SAXException
java.lang.Exception
Report.generateSaxForStep(org.xml.sax.ContentHandler, java.lang.String)
public boolean allStepsComplete() throws ExecuteException, UserEntryStoreException
ExecuteException
UserEntryStoreException
public void generateSaxForOutput(org.xml.sax.ContentHandler contentHandler, int chunkOffset, int chunkLength) throws java.lang.Exception
generateSaxForOutput
in interface Report
java.lang.Exception
Report.generateSaxForOutput(org.xml.sax.ContentHandler, int, int)
public void setOrderBy(java.lang.String id) throws WrongStateException, UnknownOrderByIdException, ExecuteException, UnsupportedFeatureException, UserEntryStoreException
Report
setOrderBy
in interface Report
id
- the id of the orderby as defined in the report definition
UnknownOrderByIdException
- when the given orderById is invalid.
WrongStateException
ExecuteException
UnsupportedFeatureException
UserEntryStoreException
Report.setOrderBy(java.lang.String)
public void setCustomOrderBy(java.util.Map values, ResourceHandle resourceHandle) throws WrongStateException, ExecuteException, UnsupportedFeatureException, UserEntryStoreException
Report
setCustomOrderBy
in interface Report
values
- map containing keys like orderby.1, orderby.2, and so on with as value the
column name on which to be sorted (as it should appear in the sql query).
WrongStateException
ExecuteException
UnsupportedFeatureException
UserEntryStoreException
Report.setCustomOrderBy(java.util.Map, org.outerj.xreporter.resource.ResourceHandle)
public void generateOrderByChoices(org.xml.sax.ContentHandler contentHandler) throws org.xml.sax.SAXException, UnsupportedFeatureException, WrongStateException, ExecuteException, UserEntryStoreException
generateOrderByChoices
in interface Report
org.xml.sax.SAXException
UnsupportedFeatureException
WrongStateException
ExecuteException
UserEntryStoreException
Report.generateOrderByChoices(org.xml.sax.ContentHandler)
public void generateQbe(org.xml.sax.ContentHandler contentHandler) throws org.xml.sax.SAXException, UnsupportedFeatureException, ExecuteException, WrongStateException, java.lang.Exception
generateQbe
in interface Report
org.xml.sax.SAXException
UnsupportedFeatureException
ExecuteException
WrongStateException
java.lang.Exception
Report.generateQbe(org.xml.sax.ContentHandler)
public boolean submitQbe(java.util.Map values) throws WrongStateException, ExecuteException, UnsupportedFeatureException, UserEntryStoreException
submitQbe
in interface Report
WrongStateException
ExecuteException
UnsupportedFeatureException
UserEntryStoreException
Report.submitQbe(java.util.Map)
public void resetQbe() throws WrongStateException, ExecuteException, UnsupportedFeatureException, UserEntryStoreException
resetQbe
in interface Report
WrongStateException
ExecuteException
UnsupportedFeatureException
UserEntryStoreException
Report.resetQbe()
public void setQbeOrientation(java.lang.String orientation) throws WrongStateException, ExecuteException, UnsupportedFeatureException, UserEntryStoreException
setQbeOrientation
in interface Report
WrongStateException
ExecuteException
UnsupportedFeatureException
UserEntryStoreException
Report.setQbeOrientation(java.lang.String)
public void generateColumns(org.xml.sax.ContentHandler contentHandler) throws org.xml.sax.SAXException, UnsupportedFeatureException
generateColumns
in interface Report
org.xml.sax.SAXException
UnsupportedFeatureException
Report.generateColumns(org.xml.sax.ContentHandler)
public void submitColumns(java.util.Map values) throws ExecuteException, WrongStateException, UnsupportedFeatureException, UserEntryStoreException
submitColumns
in interface Report
ExecuteException
WrongStateException
UnsupportedFeatureException
UserEntryStoreException
Report.submitColumns(java.util.Map)
public void resetColumns() throws ExecuteException, WrongStateException, UnsupportedFeatureException, UserEntryStoreException
resetColumns
in interface Report
ExecuteException
WrongStateException
UnsupportedFeatureException
UserEntryStoreException
Report.resetColumns()
public java.lang.String getOrderBySql()
ExecutionContext
getOrderBySql
in interface ExecutionContext
ExecutionContext.getOrderBySql()
protected Step getCurrentStep() throws ExecuteException, UserEntryStoreException
ExecuteException
UserEntryStoreException
public java.lang.String getCurrentStepName() throws ExecuteException, UserEntryStoreException
getCurrentStepName
in interface Report
ExecuteException
UserEntryStoreException
Report.getCurrentStepName()
public Step getStep(java.lang.String stepName)
public InputField getInputField(java.lang.String name)
ExecutionContext
getInputField
in interface ExecutionContext
ExecutionContext.getInputField(java.lang.String)
public void registerTemporaryTableName(java.lang.String name)
ExecutionContext
registerTemporaryTableName
in interface ExecutionContext
ExecutionContext.registerTemporaryTableName(java.lang.String)
public java.lang.String getTemporaryTableName(java.lang.String name)
ExecutionContext
ExecutionContext.registerTemporaryTableName(java.lang.String)
if this table
should be cleaned up automatically by XReporter.
getTemporaryTableName
in interface ExecutionContext
ExecutionContext.getTemporaryTableName(java.lang.String)
public DataSource getDataSource()
ExecutionContext
getDataSource
in interface ExecutionContext
ExecutionContext.getDataSource()
public DataSourceManager getDataSourceManager()
ExecutionContext
getDataSourceManager
in interface ExecutionContext
ExecutionContext.getDataSourceManager()
public UserEntryStore getUserEntryStore()
public Qbe getQbe()
ExecutionContext
getQbe
in interface ExecutionContext
ExecutionContext.getQbe()
public ExpressionContext getExpressionContext()
ExecutionContext
getExpressionContext
in interface ExecutionContext
ExecutionContext.getExpressionContext()
public Columns getColumns()
ExecutionContext
getColumns
in interface ExecutionContext
ExecutionContext.getColumns()
public java.lang.String getReportId()
ExecutionContext
getReportId
in interface ExecutionContext
ExecutionContext.getReportId()
public java.lang.String getReportDefinitionId()
getReportDefinitionId
in interface ExecutionContext
ExecutionContext.getReportDefinitionId()
public Report acquire(User user) throws java.lang.InterruptedException
java.lang.InterruptedException
public Report acquire(long msecs, User user) throws java.lang.InterruptedException
java.lang.InterruptedException
public void release()
release
in interface Report
Report.release()
public void resetLastAccessed()
public long getLastAccessed()
public void dispose()
public ResourceHandle getResourceHandle()
getResourceHandle
in interface ExecutionContext
ExecutionContext.getResourceHandle()
public User getUser()
getUser
in interface ExecutionContext
ExecutionContext.getUser()
protected void generateReportHeaderStartSaxFragment(org.xml.sax.ContentHandler contentHandler) throws org.xml.sax.SAXException
generateReportHeaderStopSaxFragment(org.xml.sax.ContentHandler)
to close the xr:info
element and generateReportFooterSaxFragment(org.xml.sax.ContentHandler)
to close the xr:report element and
end the document.
org.xml.sax.SAXException
protected void generateReportHeaderStopSaxFragment(org.xml.sax.ContentHandler contentHandler) throws org.xml.sax.SAXException
generateReportHeaderStartSaxFragment(org.xml.sax.ContentHandler)
.
org.xml.sax.SAXException
protected void generateReportFooterSaxFragment(org.xml.sax.ContentHandler contentHandler) throws org.xml.sax.SAXException
generateReportHeaderStartSaxFragment(org.xml.sax.ContentHandler)
.
org.xml.sax.SAXException
protected void generateStepsInfoSaxFragment(org.xml.sax.ContentHandler contentHandler) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public ReportState getState() throws java.lang.Exception
Report
This method should only be called on reports for which the flow has been sucessfully completed.
getState
in interface Report
java.lang.Exception
public void restoreState(ReportState reportState) throws LoadReportStateException
Report
This method should only be called on newly created report instances, on which no other submit* method is called yet.
restoreState
in interface Report
LoadReportStateException
public void generateUrl(org.xml.sax.ContentHandler contentHandler) throws java.lang.Exception
Report
generateUrl
in interface Report
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |