Package org.pentaho.di.repository
Class RepositoryImporter
java.lang.Object
org.pentaho.di.repository.RepositoryImporter
- All Implemented Interfaces:
org.pentaho.di.core.ProgressMonitorListener
,CanLimitDirs
,IRepositoryImporter
,RepositoryElementReadListener
,RepositoryImportFeedbackInterface
-
Field Summary
-
Constructor Summary
ConstructorDescriptionRepositoryImporter
(Repository repository) RepositoryImporter
(Repository repository, org.pentaho.di.core.logging.LogChannelInterface log) RepositoryImporter
(Repository repository, ImportRules importRules, List<String> limitDirs) RepositoryImporter
(Repository repository, ImportRules importRules, List<String> limitDirs, org.pentaho.di.core.logging.LogChannelInterface log) -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
askContinueOnErrorQuestion
(String title, String message) void
void
done()
protected boolean
equals
(ClusterSchema clusterSchema, ClusterSchema clusterSchema2) protected boolean
equals
(SlaveServer slaveServer, SlaveServer slaveServer2) protected boolean
equals
(org.pentaho.di.core.database.DatabaseMeta databaseMeta, org.pentaho.di.core.database.DatabaseMeta databaseMeta2) Adapted from KettleDatabaseRepositoryDatabaseDelegate.saveDatabaseMetaprotected boolean
equals
(PartitionSchema partitionSchema, PartitionSchema partitionSchema2) void
Returns a list of exceptions that the implementation may maintain.protected <T extends org.pentaho.di.shared.SharedObjectInterface>
List<T>getSharedObjects
(Class<T> clazz) void
importAll
(RepositoryImportFeedbackInterface feedback, String fileDirectory, String[] filenames, org.pentaho.di.repository.RepositoryDirectoryInterface baseDirectory, boolean overwrite, boolean continueOnError, String versionComment) Import objects from an XML document to a repository.protected boolean
importJob
(Node jobnode, RepositoryImportFeedbackInterface feedback) protected boolean
importTransformation
(Node transnode, RepositoryImportFeedbackInterface feedback) boolean
boolean
boolean
jobElementRead
(String xml, RepositoryImportFeedbackInterface feedback) boolean
jobOverwritePrompt
(JobMeta jobMeta) protected void
Load the shared objects up front, replace them in the xforms/jobs loaded from XML.protected void
replaceSharedObjects
(JobMeta transMeta) protected void
replaceSharedObjects
(TransMeta transMeta) protected void
saveJobMeta
(JobMeta jobMeta) protected void
saveTransMeta
(TransMeta transMeta) protected void
setBaseDirectory
(org.pentaho.di.repository.RepositoryDirectoryInterface baseDirectory) 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
void
setLimitDirs
(List<String> limitDirs) void
setOverwrite
(boolean overwrite) void
setTaskName
(String taskName) void
setTransDirOverride
(String transDirOverride) Overrides repository directory for all imported transformations.void
void
boolean
transformationElementRead
(String xml, RepositoryImportFeedbackInterface feedback) boolean
transOverwritePrompt
(TransMeta transMeta) void
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)
-
Field Details
-
IMPORT_ASK_ABOUT_REPLACE_DB
- See Also:
-
IMPORT_ASK_ABOUT_REPLACE_SS
- See Also:
-
IMPORT_ASK_ABOUT_REPLACE_CS
- See Also:
-
IMPORT_ASK_ABOUT_REPLACE_PS
- See Also:
-
-
Constructor Details
-
RepositoryImporter
-
RepositoryImporter
public RepositoryImporter(Repository repository, org.pentaho.di.core.logging.LogChannelInterface log) -
RepositoryImporter
-
RepositoryImporter
public RepositoryImporter(Repository repository, ImportRules importRules, List<String> limitDirs, org.pentaho.di.core.logging.LogChannelInterface log)
-
-
Method Details
-
importAll
public void importAll(RepositoryImportFeedbackInterface feedback, String fileDirectory, String[] filenames, org.pentaho.di.repository.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 interfaceIRepositoryImporter
- Parameters:
feedback
- Required to provide feedback to the user.fileDirectory
- Base directory to load files (namedfilenames
) fromfilenames
- Names of files found infileDirectory
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 org.pentaho.di.core.exception.KettleException Validates the repository element that is about to get imported against the list of import rules.- Parameters:
importRules
- import rules to validate against.subject
-- Throws:
org.pentaho.di.core.exception.KettleException
-
addLog
- Specified by:
addLog
in interfaceRepositoryImportFeedbackInterface
-
setLabel
- Specified by:
setLabel
in interfaceRepositoryImportFeedbackInterface
-
transOverwritePrompt
- Specified by:
transOverwritePrompt
in interfaceRepositoryImportFeedbackInterface
-
jobOverwritePrompt
- Specified by:
jobOverwritePrompt
in interfaceRepositoryImportFeedbackInterface
-
updateDisplay
public void updateDisplay()- Specified by:
updateDisplay
in interfaceRepositoryImportFeedbackInterface
-
showError
- Specified by:
showError
in interfaceRepositoryImportFeedbackInterface
-
equals
protected boolean equals(org.pentaho.di.core.database.DatabaseMeta databaseMeta, org.pentaho.di.core.database.DatabaseMeta databaseMeta2) Adapted from KettleDatabaseRepositoryDatabaseDelegate.saveDatabaseMeta -
equals
-
equals
-
equals
-
saveTransMeta
protected void saveTransMeta(TransMeta transMeta) throws org.pentaho.di.core.exception.KettleException - Throws:
org.pentaho.di.core.exception.KettleException
-
importTransformation
protected boolean importTransformation(Node transnode, RepositoryImportFeedbackInterface feedback) throws org.pentaho.di.core.exception.KettleException - Parameters:
transnode
- The XML DOM node to read the transformation from- Returns:
- false if the import should be canceled.
- Throws:
org.pentaho.di.core.exception.KettleException
- in case there is an unexpected error
-
saveJobMeta
- Throws:
org.pentaho.di.core.exception.KettleException
-
importJob
protected boolean importJob(Node jobnode, RepositoryImportFeedbackInterface feedback) throws org.pentaho.di.core.exception.KettleException - Throws:
org.pentaho.di.core.exception.KettleException
-
transformationElementRead
- Specified by:
transformationElementRead
in interfaceRepositoryElementReadListener
-
jobElementRead
- Specified by:
jobElementRead
in interfaceRepositoryElementReadListener
-
fatalXmlErrorEncountered
- Specified by:
fatalXmlErrorEncountered
in interfaceRepositoryElementReadListener
-
askContinueOnErrorQuestion
- Specified by:
askContinueOnErrorQuestion
in interfaceRepositoryImportFeedbackInterface
-
beginTask
- Specified by:
beginTask
in interfaceorg.pentaho.di.core.ProgressMonitorListener
-
done
public void done()- Specified by:
done
in interfaceorg.pentaho.di.core.ProgressMonitorListener
-
isCanceled
public boolean isCanceled()- Specified by:
isCanceled
in interfaceorg.pentaho.di.core.ProgressMonitorListener
-
setTaskName
- Specified by:
setTaskName
in interfaceorg.pentaho.di.core.ProgressMonitorListener
-
subTask
- Specified by:
subTask
in interfaceorg.pentaho.di.core.ProgressMonitorListener
-
worked
public void worked(int nrWorks) - Specified by:
worked
in interfaceorg.pentaho.di.core.ProgressMonitorListener
-
getTransDirOverride
-
setTransDirOverride
Description copied from interface:IRepositoryImporter
Overrides repository directory for all imported transformations.- Specified by:
setTransDirOverride
in interfaceIRepositoryImporter
-
getJobDirOverride
-
setJobDirOverride
Description copied from interface:IRepositoryImporter
Overrides repository directory for all imported jobs.- Specified by:
setJobDirOverride
in interfaceIRepositoryImporter
-
setImportRules
Description copied from interface:IRepositoryImporter
Set the list of rules that need to be applied to every imported object.- Specified by:
setImportRules
in interfaceIRepositoryImporter
- Parameters:
importRules
- The rules to use during import into the repository
-
getImportRules
-
isAskingOverwriteConfirmation
public boolean isAskingOverwriteConfirmation()- Specified by:
isAskingOverwriteConfirmation
in interfaceRepositoryImportFeedbackInterface
-
getExceptions
Description copied from interface:IRepositoryImporter
Returns a list of exceptions that the implementation may maintain.- Specified by:
getExceptions
in interfaceIRepositoryImporter
- Returns:
-
setLimitDirs
- Specified by:
setLimitDirs
in interfaceCanLimitDirs
-
setBaseDirectory
protected void setBaseDirectory(org.pentaho.di.repository.RepositoryDirectoryInterface baseDirectory) -
setOverwrite
public void setOverwrite(boolean overwrite) -
getVersionComment
-