public class SQLDriver extends java.lang.Object implements XBRLLoaderInterface
This driver loads data in an SQL repository responding to load events generated by the loader engine.
The configuration file is read when init() method is called.
The configuration file provides initial data to open a connection to the database.
The connection to the database is created at the time the loader
calls createNewResult(DTSContainer) method.
A new transaction is started when the loader calls startOfDocument(XBRLInstance)
The configuration file must have one SQL statement per identifier. The SQL statement may have parts that will be replaced by the result of XPath expressions. The XPath expressions will be evaluated at the time the event is produced and in order to complete the SQL expression. The XPath expression will contain some environmental variables that facilitates access to parts of the DTS.
The transaction is closed when the loader calls endOfDocument()
| Modifier and Type | Class and Description |
|---|---|
static class |
SQLDriver.SQLIdentifier
This class is the object that contains the identifier and the SQL text with
XPath sentences to parameterize the final SQL statement.
|
static class |
SQLDriver.SQLTransformationResult
This is the result of the execution of the SQL procedures.
|
| Constructor and Description |
|---|
SQLDriver() |
| Modifier and Type | Method and Description |
|---|---|
void |
addMap(java.lang.String mapIdentifier,
java.lang.Object info,
XBRLDataSource source)
Used to programmatically add an entry on this XBRLLoaderInterface.
|
XBRLTransformationResult |
createNewResult(DTSContainer dts)
Creates a new document container.
|
void |
endOfDocument()
Called by the transformation processor to indicate the end of a document processing
Usually a document footer is produced.
|
java.net.URI |
getConfigFile()
Returns back the URI of the configuration file.
|
XBRLFilterContext |
getFilterContext()
Returns an instance of the XBRLFilterContext class that will be used to pick up the
appropriate context.
|
void |
init()
This method is called by the loader just after object has been created and
if a configuration file is set (which is an optional step only if configuration
file is indicated as a parameter)
This method should read the configuration file and set values for
constants and things like that.
|
void |
processContexts(java.util.Iterator<XBRLContext> contexts)
Called by the transformation processor to provide the contexts for the data
that will be found later during the processing of facts
the default process updates the content of some variables. or calculates
number of columns, rows.
|
void |
processFact(java.lang.String identifier,
XBRLFact fact)
Called by the processor to inform about a new fact that requires processing.
|
void |
setConfigFile(java.net.URI uriConfigFile)
This method is called by the loader when a new loader is just created and for each
one of the drivers that exist on the loader configuration file and only if the
driver has a parameter indicating the URL of the configuration file
Next call is
XBRLLoaderInterface.init(). |
void |
setLoaderContext(LoaderContext lc)
Temporally sets a loader context during the transformation of an XBRL report to
the destination target.
|
void |
startOfDocument(XBRLInstance instance)
Called by the transformation processor to indicate the start of a new document.
|
void |
writeConfigFile(DTSContainer dts)
Serializes the configuration file back to the URI assigned in the configuration file
from the internal data model.
|
public void init()
throws LoaderConfigurationFileException
XBRLLoaderInterfaceXBRLLoaderInterface.createNewResult(DTSContainer)init in interface XBRLLoaderInterfaceLoaderConfigurationFileException - the loader configuration file exceptionpublic void setConfigFile(java.net.URI uriConfigFile)
XBRLLoaderInterfaceXBRLLoaderInterface.init().setConfigFile in interface XBRLLoaderInterfaceuriConfigFile - the new config filepublic XBRLTransformationResult createNewResult(DTSContainer dts) throws FactHandlerException
XBRLLoaderInterfaceXBRLLoaderInterface.startOfDocument(XBRLInstance)createNewResult in interface XBRLLoaderInterfacedts - the dtsFactHandlerException - if anything goes wrong.public void startOfDocument(XBRLInstance instance) throws FactHandlerException
XBRLLoaderInterfaceXBRLLoaderInterface.processContexts(Iterator)startOfDocument in interface XBRLLoaderInterfaceinstance - the instanceFactHandlerException - the fact handler exceptionpublic void processContexts(java.util.Iterator<XBRLContext> contexts)
XBRLLoaderInterfaceXBRLLoaderInterface.processFact(String, XBRLFact) for facts that passes
the filters established by the loader engine and are the true loading events.processContexts in interface XBRLLoaderInterfacecontexts - Iterator<XBRLContext>public void processFact(java.lang.String identifier,
XBRLFact fact)
throws FactHandlerException
XBRLLoaderInterfaceXBRLLoaderInterface.endOfDocument() when the instance document is finished and no more
events needs to be generatedprocessFact in interface XBRLLoaderInterfaceidentifier - as String which is the identifier code in the loader configuration file.fact - XBRLFact the loaded factFactHandlerException - if something goes wrong.public void endOfDocument()
throws FactHandlerException
XBRLLoaderInterfaceendOfDocument in interface XBRLLoaderInterfaceFactHandlerException - if something goes wrongpublic java.net.URI getConfigFile()
XBRLLoaderInterfacegetConfigFile in interface XBRLLoaderInterfacepublic XBRLFilterContext getFilterContext()
XBRLLoaderInterfacegetFilterContext in interface XBRLLoaderInterfacepublic void addMap(java.lang.String mapIdentifier,
java.lang.Object info,
XBRLDataSource source)
XBRLLoaderInterfaceaddMap in interface XBRLLoaderInterfacemapIdentifier - the map identifierinfo - the infosource - the XBRLDataSource if any exists. This argument may be null.public void writeConfigFile(DTSContainer dts) throws LoaderException
XBRLLoaderInterfacewriteConfigFile in interface XBRLLoaderInterfacedts - the dtsLoaderException - the loader exceptionpublic void setLoaderContext(LoaderContext lc)
XBRLLoaderInterfacesetLoaderContext in interface XBRLLoaderInterfacelc - the instance of the LoaderContext or null to resetCopyright 2006-2015 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa