Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Working with a PDI repository

...

Code Block
RepositoriesMeta repositoriesMeta = new RepositoriesMeta();
repositoriesMeta.readData();
RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( repositoryName );
PluginRegistry registry = PluginRegistry.getInstance();
Repository repository = registry.loadClass(
       RepositoryPluginType.class,
       repositoryMeta,
       Repository.class
  );
repository.init(repositoryMeta);

Once you have a handle on the repository, you can connect to it like this:

Code Block
repository.connect(username, password);

Using the repository

The repository interface contains a lot of interesting methods that you can use ranging from security related interfaces to methods to load and save objects.  Below are a few examples.

...

Code Block
TransMeta transMeta = repository.loadTransformation("Example", fooBar, null, true, null);

Load a job

Code Block
  /**
   * Load a job from the repository
   * @param jobname the name
   * @param repdir the directory
   * @param monitor the progress monitor or null
   * @param revision the revision to load.  Specify null to load the last version.
   */
  public JobMeta loadJob(
    String jobname,
    RepositoryDirectoryInterface repdir,
    ProgressMonitorListener monitor,
    String revision
  ) throws KettleException;

...