org.archiviststoolkit.importer
Class EADImportHandler

java.lang.Object
  extended by org.archiviststoolkit.importer.ImportHandler
      extended by org.archiviststoolkit.importer.EADImportHandler
All Implemented Interfaces:
java.lang.Runnable

public class EADImportHandler
extends ImportHandler


Field Summary
static Resources resourceRecord
           
 
Fields inherited from class org.archiviststoolkit.importer.ImportHandler
file, importController
 
Constructor Summary
EADImportHandler(ImportOptionsEAD importOptions)
          Constructor.
 
Method Summary
static void addToTruncations(java.lang.String text)
           
 boolean canImportFile(java.io.File file)
          Can we import this file.
static Resources getResourceRecord()
           
 Resources getResourceToSave(java.lang.String unitIdString, Repositories repository)
           
static java.lang.String getTruncations()
           
 java.lang.String getUnitIdFromEad(Ead ead)
           
 boolean importFile(java.io.File file, DomainImportController domainController, InfiniteProgressPanel progressPanel)
          Import the file.
 boolean importFileNew(java.io.File file, InfiniteProgressPanel progressPanel)
           
 void saveResource(Resources resource, int method, InfiniteProgressPanel progressPanel)
           
static void setTruncations(java.lang.String truncations)
           
 void showBatchImportLog(java.lang.StringBuffer detail, int passed, int failed, java.lang.String timeToImport)
           
 int validate(java.io.File file)
           
 java.lang.String validateResource(Resources resource)
           
 
Methods inherited from class org.archiviststoolkit.importer.ImportHandler
getFile, getImportController, getInitialChunk, run, startImportThread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resourceRecord

public static Resources resourceRecord
Constructor Detail

EADImportHandler

public EADImportHandler(ImportOptionsEAD importOptions)
Constructor.

Method Detail

canImportFile

public boolean canImportFile(java.io.File file)
Description copied from class: ImportHandler
Can we import this file.

Specified by:
canImportFile in class ImportHandler
Parameters:
file - the file to import.
Returns:
can we.

importFile

public boolean importFile(java.io.File file,
                          DomainImportController domainController,
                          InfiniteProgressPanel progressPanel)
                   throws ImportException
Description copied from class: ImportHandler
Import the file.

Specified by:
importFile in class ImportHandler
Parameters:
file - the file to import.
domainController - the controller to use.
Returns:
if we succeded
Throws:
ImportException

importFileNew

public boolean importFileNew(java.io.File file,
                             InfiniteProgressPanel progressPanel)
                      throws javax.xml.bind.JAXBException,
                             PersistenceException,
                             ImportException,
                             DuplicateRecordException,
                             org.xml.sax.SAXException,
                             javax.xml.parsers.ParserConfigurationException,
                             java.io.IOException
Throws:
javax.xml.bind.JAXBException
PersistenceException
ImportException
DuplicateRecordException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException

validate

public int validate(java.io.File file)
             throws org.xml.sax.SAXException,
                    javax.xml.parsers.ParserConfigurationException,
                    java.io.IOException,
                    ImportException
Throws:
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
ImportException

validateResource

public java.lang.String validateResource(Resources resource)

saveResource

public void saveResource(Resources resource,
                         int method,
                         InfiniteProgressPanel progressPanel)
                  throws PersistenceException
Throws:
PersistenceException

getResourceToSave

public Resources getResourceToSave(java.lang.String unitIdString,
                                   Repositories repository)
                            throws ImportException
Throws:
ImportException

getUnitIdFromEad

public java.lang.String getUnitIdFromEad(Ead ead)

showBatchImportLog

public void showBatchImportLog(java.lang.StringBuffer detail,
                               int passed,
                               int failed,
                               java.lang.String timeToImport)

getResourceRecord

public static Resources getResourceRecord()

getTruncations

public static java.lang.String getTruncations()

setTruncations

public static void setTruncations(java.lang.String truncations)

addToTruncations

public static void addToTruncations(java.lang.String text)