Search in sources :

Example 1 with RepositoryTree

use of org.pentaho.repo.model.RepositoryTree in project pentaho-kettle by pentaho.

the class RepositoryBrowserController method loadDirectoryTree.

public RepositoryTree loadDirectoryTree(String filter) {
    if (getRepository() != null) {
        try {
            if (getRepository() instanceof RepositoryExtended) {
                rootDirectory = ((RepositoryExtended) getRepository()).loadRepositoryDirectoryTree(false);
            } else {
                rootDirectory = getRepository().loadRepositoryDirectoryTree();
            }
            RepositoryTree repositoryTree = new RepositoryTree();
            RepositoryDirectory repositoryDirectory = RepositoryDirectory.build(null, rootDirectory);
            populateFolders(repositoryDirectory, rootDirectory);
            boolean isPentahoRepository = getRepository().getRepositoryMeta().getId().equals(PENTAHO_ENTERPRISE_REPOSITORY);
            repositoryTree.setIncludeRoot(!isPentahoRepository);
            repositoryTree.addChild(repositoryDirectory);
            return repositoryTree;
        } catch (Exception e) {
            return null;
        }
    }
    return null;
}
Also used : RepositoryDirectory(org.pentaho.repo.model.RepositoryDirectory) RepositoryExtended(org.pentaho.di.repository.RepositoryExtended) RepositoryTree(org.pentaho.repo.model.RepositoryTree) KettleException(org.pentaho.di.core.exception.KettleException) KettleObjectExistsException(org.pentaho.di.core.exception.KettleObjectExistsException) KettleTransException(org.pentaho.di.core.exception.KettleTransException) KettleJobException(org.pentaho.di.core.exception.KettleJobException)

Aggregations

KettleException (org.pentaho.di.core.exception.KettleException)1 KettleJobException (org.pentaho.di.core.exception.KettleJobException)1 KettleObjectExistsException (org.pentaho.di.core.exception.KettleObjectExistsException)1 KettleTransException (org.pentaho.di.core.exception.KettleTransException)1 RepositoryExtended (org.pentaho.di.repository.RepositoryExtended)1 RepositoryDirectory (org.pentaho.repo.model.RepositoryDirectory)1 RepositoryTree (org.pentaho.repo.model.RepositoryTree)1