org.gswing.components.input.importer
Class XmlToDb

java.lang.Object
  extended by org.gswing.components.input.importer.XmlToDb

public class XmlToDb
extends Object

Purpose: Imports EML standard XML files into the database.


Field Summary
protected static String CSV
           
protected static String XML
           
 
Constructor Summary
XmlToDb(IFramework framework, String path)
          Constructor.
 
Method Summary
 void doImport(Object[] fileList)
          Start importing the XML files into the database.
protected  Constituency getConstituency(AliasKey constituencyAlias)
          Get the constituency details from the database.
protected  Constituency getConstituencyFromDb(AliasKey constituencyAlias)
          Get the constituency from the database.
protected  String getCouncilName()
           
protected  String getCsvDir()
          Get the directory containing CSV files.
protected  String getCsvProcessedDir()
          Get the directory of CSV processed files.
protected  IDbWriteAccess getDbAccess()
          Get the insert database access object.
protected  Election getElection()
           
protected  IFramework getFramework()
          Allow derived objects access the framework object.
protected  IMessageHandling getLogger()
          Allow derived objects access the logger.
protected  String getXmlDir()
          Get the directory containing XML files.
protected  String getXmlProcessedDir()
          Get the directory of XML processed files.
protected  void setCouncilName(String council)
          Set the council name the result belong to - if this is a local result.
protected  void setElection(Election election)
          Set the election the result belongs to.
 void startImport()
          Choose from a list if xml files to import into database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CSV

protected static final String CSV
See Also:
Constant Field Values

XML

protected static final String XML
See Also:
Constant Field Values
Constructor Detail

XmlToDb

public XmlToDb(IFramework framework,
               String path)
Constructor.

Parameters:
framework - Framework object.
path - The path to gswing home.
Method Detail

startImport

public void startImport()
Choose from a list if xml files to import into database.


doImport

public void doImport(Object[] fileList)
Start importing the XML files into the database.


getConstituency

protected Constituency getConstituency(AliasKey constituencyAlias)
Get the constituency details from the database.

Parameters:
constituencyAlias - The constituency alias object.
Returns:
The constituency object.

getConstituencyFromDb

protected Constituency getConstituencyFromDb(AliasKey constituencyAlias)
Get the constituency from the database.

Parameters:
constituencyAlias - Constituency details.
Returns:
The constituency reference. This will be null if the region is invalid.

getCsvDir

protected String getCsvDir()
Get the directory containing CSV files.

Returns:
The CSV files directory.

getCsvProcessedDir

protected String getCsvProcessedDir()
Get the directory of CSV processed files.

Returns:
The processed CSV directory string.

getXmlDir

protected String getXmlDir()
Get the directory containing XML files.

Returns:
The XML files directory.

getXmlProcessedDir

protected String getXmlProcessedDir()
Get the directory of XML processed files.

Returns:
The processed XML directory string.

getDbAccess

protected IDbWriteAccess getDbAccess()
Get the insert database access object.

Returns:
The insert database access object.

getFramework

protected IFramework getFramework()
Allow derived objects access the framework object.

Returns:
The main framework object.

getLogger

protected IMessageHandling getLogger()
Allow derived objects access the logger.

Returns:
The main framework object.

setElection

protected void setElection(Election election)
Set the election the result belongs to.

Parameters:
election - The election object.

setCouncilName

protected void setCouncilName(String council)
Set the council name the result belong to - if this is a local result.

Parameters:
council - The council name.

getElection

protected Election getElection()
Returns:
The election object.

getCouncilName

protected String getCouncilName()
Returns:
The council name.


Copyright © 2008. All Rights Reserved.