Class RepositoryImporter

    • Constructor Detail

      • RepositoryImporter

        public RepositoryImporter​(Repository repository)
      • RepositoryImporter

        public RepositoryImporter​(Repository repository,
                                  org.pentaho.di.core.logging.LogChannelInterface log)
      • RepositoryImporter

        public RepositoryImporter​(Repository repository,
                                  ImportRules importRules,
                                  List<String> limitDirs,
                                  org.pentaho.di.core.logging.LogChannelInterface log)
    • Method Detail

      • 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 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.
      • loadSharedObjects

        protected void loadSharedObjects()
                                  throws org.pentaho.di.core.exception.KettleException
        Load the shared objects up front, replace them in the xforms/jobs loaded from XML. We do this for performance reasons.
        Throws:
        org.pentaho.di.core.exception.KettleException
      • 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
      • getSharedObjects

        protected <T extends org.pentaho.di.shared.SharedObjectInterface> List<T> getSharedObjects​(Class<T> clazz)
      • equals

        protected boolean equals​(org.pentaho.di.core.database.DatabaseMeta databaseMeta,
                                 org.pentaho.di.core.database.DatabaseMeta databaseMeta2)
        Adapted from KettleDatabaseRepositoryDatabaseDelegate.saveDatabaseMeta
      • replaceSharedObjects

        protected void replaceSharedObjects​(TransMeta transMeta)
                                     throws org.pentaho.di.core.exception.KettleException
        Throws:
        org.pentaho.di.core.exception.KettleException
      • replaceSharedObjects

        protected void replaceSharedObjects​(JobMeta transMeta)
                                     throws org.pentaho.di.core.exception.KettleException
        Throws:
        org.pentaho.di.core.exception.KettleException
      • 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

        protected void saveJobMeta​(JobMeta jobMeta)
                            throws org.pentaho.di.core.exception.KettleException
        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
      • beginTask

        public void beginTask​(String message,
                              int nrWorks)
        Specified by:
        beginTask in interface org.pentaho.di.core.ProgressMonitorListener
      • done

        public void done()
        Specified by:
        done in interface org.pentaho.di.core.ProgressMonitorListener
      • isCanceled

        public boolean isCanceled()
        Specified by:
        isCanceled in interface org.pentaho.di.core.ProgressMonitorListener
      • setTaskName

        public void setTaskName​(String taskName)
        Specified by:
        setTaskName in interface org.pentaho.di.core.ProgressMonitorListener
      • subTask

        public void subTask​(String message)
        Specified by:
        subTask in interface org.pentaho.di.core.ProgressMonitorListener
      • worked

        public void worked​(int nrWorks)
        Specified by:
        worked in interface org.pentaho.di.core.ProgressMonitorListener
      • getTransDirOverride

        public String getTransDirOverride()
      • getJobDirOverride

        public String getJobDirOverride()
      • 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
      • setBaseDirectory

        protected void setBaseDirectory​(org.pentaho.di.repository.RepositoryDirectoryInterface baseDirectory)
      • setOverwrite

        public void setOverwrite​(boolean overwrite)
      • getVersionComment

        public String getVersionComment()