org.pentaho.di.repository
Class RepositoryImporter

java.lang.Object
  extended by org.pentaho.di.repository.RepositoryImporter
All Implemented Interfaces:
ProgressMonitorListener, IRepositoryImporter, RepositoryElementReadListener, RepositoryImportFeedbackInterface

public class RepositoryImporter
extends Object
implements IRepositoryImporter


Constructor Summary
RepositoryImporter(Repository repository)
           
RepositoryImporter(Repository repository, ImportRules importRules, List<String> limitDirs)
           
 
Method Summary
 void addLog(String line)
           
 boolean askContinueOnErrorQuestion(String title, String message)
           
 void beginTask(String message, int nrWorks)
           
 void done()
           
 void fatalXmlErrorEncountered(SAXParseException e)
           
 List<Exception> getExceptions()
          Returns a list of exceptions that the implementation may maintain.
 ImportRules getImportRules()
           
 String getJobDirOverride()
           
 String getTransDirOverride()
           
 void importAll(RepositoryImportFeedbackInterface feedback, String fileDirectory, String[] filenames, RepositoryDirectoryInterface baseDirectory, boolean overwrite, boolean continueOnError, String versionComment)
          Import objects from an XML document to a repository.
 boolean isAskingOverwriteConfirmation()
           
 boolean isCanceled()
           
 boolean jobElementRead(String xml, RepositoryImportFeedbackInterface feedback)
           
 boolean jobOverwritePrompt(JobMeta jobMeta)
           
 void setImportRules(ImportRules importRules)
          Set the list of rules that need to be applied to every imported object.
 void setJobDirOverride(String jobDirOverride)
          Overrides repository directory for all imported jobs.
 void setLabel(String labelText)
           
 void setTaskName(String taskName)
           
 void setTransDirOverride(String transDirOverride)
          Overrides repository directory for all imported transformations.
 void showError(String title, String message, Exception e)
           
 void subTask(String message)
           
 boolean transformationElementRead(String xml, RepositoryImportFeedbackInterface feedback)
           
 boolean transOverwritePrompt(TransMeta transMeta)
           
 void updateDisplay()
           
static void validateImportedElement(ImportRules importRules, Object subject)
          Validates the repository element that is about to get imported against the list of import rules.
 void worked(int nrWorks)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepositoryImporter

public RepositoryImporter(Repository repository)

RepositoryImporter

public RepositoryImporter(Repository repository,
                          ImportRules importRules,
                          List<String> limitDirs)
Method Detail

importAll

public void importAll(RepositoryImportFeedbackInterface feedback,
                      String fileDirectory,
                      String[] filenames,
                      RepositoryDirectoryInterface baseDirectory,
                      boolean overwrite,
                      boolean continueOnError,
                      String versionComment)
Description copied from interface: IRepositoryImporter
Import objects from an XML document to a repository.

Specified by:
importAll in interface IRepositoryImporter
Parameters:
feedback - Required to provide feedback to the user.
fileDirectory - Base directory to load files (named filenames) from
filenames - Names of files found in fileDirectory to be imported.
baseDirectory - Base directory to load objects into.
overwrite - Should objects in the repository be overwritten with ones we're importing?
continueOnError - Should the import continue if there is an error importing an object?
versionComment - Comment to use when saving imported objects.

validateImportedElement

public static void validateImportedElement(ImportRules importRules,
                                           Object subject)
                                    throws KettleException
Validates the repository element that is about to get imported against the list of import rules.

Parameters:
the - import rules to validate against.
subject -
Throws:
KettleException

addLog

public void addLog(String line)
Specified by:
addLog in interface RepositoryImportFeedbackInterface

setLabel

public void setLabel(String labelText)
Specified by:
setLabel in interface RepositoryImportFeedbackInterface

transOverwritePrompt

public boolean transOverwritePrompt(TransMeta transMeta)
Specified by:
transOverwritePrompt in interface RepositoryImportFeedbackInterface

jobOverwritePrompt

public boolean jobOverwritePrompt(JobMeta jobMeta)
Specified by:
jobOverwritePrompt in interface RepositoryImportFeedbackInterface

updateDisplay

public void updateDisplay()
Specified by:
updateDisplay in interface RepositoryImportFeedbackInterface

showError

public void showError(String title,
                      String message,
                      Exception e)
Specified by:
showError in interface RepositoryImportFeedbackInterface

transformationElementRead

public boolean transformationElementRead(String xml,
                                         RepositoryImportFeedbackInterface feedback)
Specified by:
transformationElementRead in interface RepositoryElementReadListener

jobElementRead

public boolean jobElementRead(String xml,
                              RepositoryImportFeedbackInterface feedback)
Specified by:
jobElementRead in interface RepositoryElementReadListener

fatalXmlErrorEncountered

public void fatalXmlErrorEncountered(SAXParseException e)
Specified by:
fatalXmlErrorEncountered in interface RepositoryElementReadListener

askContinueOnErrorQuestion

public boolean askContinueOnErrorQuestion(String title,
                                          String message)
Specified by:
askContinueOnErrorQuestion in interface RepositoryImportFeedbackInterface

beginTask

public void beginTask(String message,
                      int nrWorks)
Specified by:
beginTask in interface ProgressMonitorListener

done

public void done()
Specified by:
done in interface ProgressMonitorListener

isCanceled

public boolean isCanceled()
Specified by:
isCanceled in interface ProgressMonitorListener

setTaskName

public void setTaskName(String taskName)
Specified by:
setTaskName in interface ProgressMonitorListener

subTask

public void subTask(String message)
Specified by:
subTask in interface ProgressMonitorListener

worked

public void worked(int nrWorks)
Specified by:
worked in interface ProgressMonitorListener

getTransDirOverride

public String getTransDirOverride()

setTransDirOverride

public void setTransDirOverride(String transDirOverride)
Description copied from interface: IRepositoryImporter
Overrides repository directory for all imported transformations.

Specified by:
setTransDirOverride in interface IRepositoryImporter

getJobDirOverride

public String getJobDirOverride()

setJobDirOverride

public void setJobDirOverride(String jobDirOverride)
Description copied from interface: IRepositoryImporter
Overrides repository directory for all imported jobs.

Specified by:
setJobDirOverride in interface IRepositoryImporter

setImportRules

public void setImportRules(ImportRules importRules)
Description copied from interface: IRepositoryImporter
Set the list of rules that need to be applied to every imported object.

Specified by:
setImportRules in interface IRepositoryImporter
Parameters:
importRules - The rules to use during import into the repository

getImportRules

public ImportRules getImportRules()

isAskingOverwriteConfirmation

public boolean isAskingOverwriteConfirmation()
Specified by:
isAskingOverwriteConfirmation in interface RepositoryImportFeedbackInterface

getExceptions

public List<Exception> getExceptions()
Description copied from interface: IRepositoryImporter
Returns a list of exceptions that the implementation may maintain.

Specified by:
getExceptions in interface IRepositoryImporter
Returns: