org.outerj.xreporter.reportstore
Class ReportStoreImpl

java.lang.Object
  extended byorg.outerj.xreporter.reportstore.ReportStoreImpl
All Implemented Interfaces:
org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.activity.Initializable, ReportStore, org.apache.avalon.framework.thread.ThreadSafe

public class ReportStoreImpl
extends java.lang.Object
implements ReportStore, org.apache.avalon.framework.thread.ThreadSafe, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.activity.Initializable

Default implementation of the ReportStore interface. It stores the reports to database tables. See the documentation for more information on the structure of these tables.


Field Summary
protected  java.util.Properties connectionProperties
           
protected  ConnectionProvider connectionProvider
           
protected  ConnectionProviderManager connectionProviderManager
           
protected static java.lang.String DATASOURCE_NAME_EL
           
protected  java.lang.String dropReportDetailStatement
           
protected  java.lang.String dropReportStatement
           
protected  IdGenerator idGenerator
           
protected static java.lang.String INFO_EL
           
protected  java.lang.String insertReportDetailStatement
           
protected  java.lang.String insertReportStatement
           
protected  java.lang.String nameExistsStatement
           
protected  ReportManager reportManager
           
protected  java.lang.String selectAllReportsForUserStatement
           
protected  java.lang.String selectReportDetailStatement
           
protected  java.lang.String selectReportStatement
           
protected static java.lang.String TIME_EL
           
 
Fields inherited from interface org.outerj.xreporter.reportstore.ReportStore
ROLE
 
Constructor Summary
ReportStoreImpl()
           
 
Method Summary
 void compose(org.apache.avalon.framework.component.ComponentManager componentManager)
           
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
           
 void delete(java.lang.String name, User user)
          Deletes a stored report.
 void generateStoredReportList(User user, org.xml.sax.ContentHandler contentHandler, ResourceHandle resourceHandle)
          Generates a list of all stored reports for a user to a SAX ContentHandler.
 void initialize()
           
 Report makeInstance(java.lang.String name, User user, ResourceHandle resourceHandle)
          Makes an instance of the report stored under the given name.
 void store(java.lang.String name, Report report, User user, boolean overwrite)
          Stores a report.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connectionProperties

protected java.util.Properties connectionProperties

connectionProviderManager

protected ConnectionProviderManager connectionProviderManager

connectionProvider

protected ConnectionProvider connectionProvider

idGenerator

protected IdGenerator idGenerator

reportManager

protected ReportManager reportManager

insertReportStatement

protected java.lang.String insertReportStatement

insertReportDetailStatement

protected java.lang.String insertReportDetailStatement

nameExistsStatement

protected java.lang.String nameExistsStatement

dropReportStatement

protected java.lang.String dropReportStatement

dropReportDetailStatement

protected java.lang.String dropReportDetailStatement

selectReportStatement

protected java.lang.String selectReportStatement

selectReportDetailStatement

protected java.lang.String selectReportDetailStatement

selectAllReportsForUserStatement

protected java.lang.String selectAllReportsForUserStatement

TIME_EL

protected static final java.lang.String TIME_EL
See Also:
Constant Field Values

DATASOURCE_NAME_EL

protected static final java.lang.String DATASOURCE_NAME_EL
See Also:
Constant Field Values

INFO_EL

protected static final java.lang.String INFO_EL
See Also:
Constant Field Values
Constructor Detail

ReportStoreImpl

public ReportStoreImpl()
Method Detail

compose

public void compose(org.apache.avalon.framework.component.ComponentManager componentManager)
             throws org.apache.avalon.framework.component.ComponentException
Specified by:
compose in interface org.apache.avalon.framework.component.Composable
Throws:
org.apache.avalon.framework.component.ComponentException

initialize

public void initialize()
                throws java.lang.Exception
Specified by:
initialize in interface org.apache.avalon.framework.activity.Initializable
Throws:
java.lang.Exception

configure

public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

store

public void store(java.lang.String name,
                  Report report,
                  User user,
                  boolean overwrite)
           throws ReportNameExistsException,
                  ReportStoreException
Description copied from interface: ReportStore
Stores a report.

Specified by:
store in interface ReportStore
Parameters:
overwrite - if true and there exists already a report with the given name (for the given user), then it will be overwitten. Otherwise a ReportNameExistsException will be thrown.
Throws:
ReportNameExistsException
ReportStoreException

makeInstance

public Report makeInstance(java.lang.String name,
                           User user,
                           ResourceHandle resourceHandle)
                    throws NonExistingStoredReport,
                           ReportStoreException
Description copied from interface: ReportStore
Makes an instance of the report stored under the given name.

The returned report will be locked, so it must be released by the caller when no longer needed.

Specified by:
makeInstance in interface ReportStore
Throws:
NonExistingStoredReport
ReportStoreException

generateStoredReportList

public void generateStoredReportList(User user,
                                     org.xml.sax.ContentHandler contentHandler,
                                     ResourceHandle resourceHandle)
                              throws org.xml.sax.SAXException,
                                     ReportStoreException
Description copied from interface: ReportStore
Generates a list of all stored reports for a user to a SAX ContentHandler. The reports will be sorted on their name.

Specified by:
generateStoredReportList in interface ReportStore
Throws:
org.xml.sax.SAXException
ReportStoreException

delete

public void delete(java.lang.String name,
                   User user)
            throws ReportStoreException
Description copied from interface: ReportStore
Deletes a stored report.

Specified by:
delete in interface ReportStore
Throws:
ReportStoreException