org.outerj.xreporter.report.instance
Interface Report

All Known Implementing Classes:
ReportImpl

public interface Report

This is the public interface of report instances towards the outside world. You obtain access to these Reports using the services of a block implementing ReportManager.


Method Summary
 void generateColumns(org.xml.sax.ContentHandler contentHandler)
           
 void generateOrderByChoices(org.xml.sax.ContentHandler contentHandler)
           
 void generateQbe(org.xml.sax.ContentHandler contentHandler)
           
 void generateSaxForOutput(org.xml.sax.ContentHandler resultHandler, int chunkOffset, int chunkLength)
           
 void generateSaxForStep(org.xml.sax.ContentHandler contentHandler, java.lang.String stepName)
          Generates SAX events containing all information needed to display a form for completing the interaction of a step.
 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.
 java.lang.String getCurrentStepName()
           
 java.lang.String getId()
           
 ReportState getState()
          Returns an object containing all user-specified state of the report.
 void release()
           
 void resetColumns()
           
 void resetFromStep(java.lang.String stepName)
          Resets all report state starting from (and including) the step whose name is giving as a parameter.
 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 setOrderBy(java.lang.String orderById)
          Sets the current orderby configuration to a default defined in the report definition.
 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.
 

Method Detail

getId

public java.lang.String getId()

submitStep

public boolean submitStep(java.lang.String stepName,
                          java.util.Map values)
                   throws UnknownStepNameException,
                          WrongStateException,
                          ExecuteException,
                          UserEntryStoreException
Submit (user input) values to fill the parameters and conditions in this step. If all parameters and condities are filled in correctly, the execution-part of this step will be executed and true will be returned. Otherwise false will be returned, in which case 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.

Parameters:
values - a Map containing string keys and values
Throws:
UnknownStepNameException
WrongStateException
ExecuteException
UserEntryStoreException

resetFromStep

public void resetFromStep(java.lang.String stepName)
                   throws UnknownStepNameException,
                          WrongStateException,
                          ExecuteException,
                          UserEntryStoreException
Resets all report state starting from (and including) the step whose name is giving as a parameter. This is also done as part of submitStep(java.lang.String, java.util.Map).

Throws:
UnknownStepNameException
WrongStateException
ExecuteException
UserEntryStoreException

generateSaxForStep

public void generateSaxForStep(org.xml.sax.ContentHandler contentHandler,
                               java.lang.String stepName)
                        throws UnknownStepNameException,
                               org.xml.sax.SAXException,
                               java.lang.Exception
Generates SAX events containing all information needed to display a form for completing the interaction of a step. This method does not check if all previous steps are already completed, or if the given step does have interaction. This method will usually be called after getCurrentStepName().

Throws:
UnknownStepNameException
org.xml.sax.SAXException
java.lang.Exception

generateSaxForOutput

public void generateSaxForOutput(org.xml.sax.ContentHandler resultHandler,
                                 int chunkOffset,
                                 int chunkLength)
                          throws java.lang.Exception
Throws:
java.lang.Exception

setOrderBy

public void setOrderBy(java.lang.String orderById)
                throws UnknownOrderByIdException,
                       WrongStateException,
                       ExecuteException,
                       UnsupportedFeatureException,
                       UserEntryStoreException
Sets the current orderby configuration to a default defined in the report definition.

Parameters:
orderById - the id of the orderby as defined in the report definition
Throws:
UnknownOrderByIdException - when the given orderById is invalid.
WrongStateException
ExecuteException
UnsupportedFeatureException
UserEntryStoreException

setCustomOrderBy

public void setCustomOrderBy(java.util.Map values,
                             ResourceHandle resourceHandle)
                      throws WrongStateException,
                             ExecuteException,
                             UnsupportedFeatureException,
                             UserEntryStoreException
Defines custom orderby settings. This method assumes that the input is correct, meaning that the map should contain valid values.

Parameters:
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).
Throws:
WrongStateException
ExecuteException
UnsupportedFeatureException
UserEntryStoreException

generateOrderByChoices

public void generateOrderByChoices(org.xml.sax.ContentHandler contentHandler)
                            throws org.xml.sax.SAXException,
                                   UnsupportedFeatureException,
                                   WrongStateException,
                                   ExecuteException,
                                   UserEntryStoreException
Throws:
org.xml.sax.SAXException
UnsupportedFeatureException
WrongStateException
ExecuteException
UserEntryStoreException

getCurrentStepName

public java.lang.String getCurrentStepName()
                                    throws ExecuteException,
                                           UserEntryStoreException
Returns:
the name of the current step to complete. If there is no such step, null is returned.
Throws:
ExecuteException
UserEntryStoreException

generateQbe

public void generateQbe(org.xml.sax.ContentHandler contentHandler)
                 throws org.xml.sax.SAXException,
                        UnsupportedFeatureException,
                        ExecuteException,
                        WrongStateException,
                        java.lang.Exception
Throws:
org.xml.sax.SAXException
UnsupportedFeatureException
ExecuteException
WrongStateException
java.lang.Exception

submitQbe

public boolean submitQbe(java.util.Map values)
                  throws WrongStateException,
                         ExecuteException,
                         UnsupportedFeatureException,
                         UserEntryStoreException
Returns:
true if succesfull
Throws:
WrongStateException
ExecuteException
UnsupportedFeatureException
UserEntryStoreException

resetQbe

public void resetQbe()
              throws WrongStateException,
                     ExecuteException,
                     UnsupportedFeatureException,
                     UserEntryStoreException
Throws:
WrongStateException
ExecuteException
UnsupportedFeatureException
UserEntryStoreException

setQbeOrientation

public void setQbeOrientation(java.lang.String orientation)
                       throws WrongStateException,
                              ExecuteException,
                              UnsupportedFeatureException,
                              UserEntryStoreException
Throws:
WrongStateException
ExecuteException
UnsupportedFeatureException
UserEntryStoreException

generateColumns

public void generateColumns(org.xml.sax.ContentHandler contentHandler)
                     throws org.xml.sax.SAXException,
                            UnsupportedFeatureException
Throws:
org.xml.sax.SAXException
UnsupportedFeatureException

generateUrl

public void generateUrl(org.xml.sax.ContentHandler contentHandler)
                 throws java.lang.Exception
Generates some XML containing a /reports URL with all necessary parameters to recreate the report to its current state.

Throws:
java.lang.Exception

submitColumns

public void submitColumns(java.util.Map values)
                   throws ExecuteException,
                          WrongStateException,
                          UnsupportedFeatureException,
                          UserEntryStoreException
Throws:
ExecuteException
WrongStateException
UnsupportedFeatureException
UserEntryStoreException

resetColumns

public void resetColumns()
                  throws ExecuteException,
                         WrongStateException,
                         UnsupportedFeatureException,
                         UserEntryStoreException
Throws:
ExecuteException
WrongStateException
UnsupportedFeatureException
UserEntryStoreException

getState

public ReportState getState()
                     throws java.lang.Exception
Returns an object containing all user-specified state of the report.

This method should only be called on reports for which the flow has been sucessfully completed.

Throws:
java.lang.Exception

restoreState

public void restoreState(ReportState reportState)
                  throws LoadReportStateException
Applies the state from the given reportState back to this report.

This method should only be called on newly created report instances, on which no other submit* method is called yet.

Throws:
LoadReportStateException

release

public void release()