use of org.pentaho.repo.model.RepositoryDirectory in project pentaho-kettle by pentaho.
the class RepositoryBrowserController method loadFolders.
public RepositoryDirectory loadFolders(String path) {
RepositoryDirectoryInterface repositoryDirectoryInterface = findDirectory(path);
RepositoryDirectory repositoryDirectory = RepositoryDirectory.build(null, repositoryDirectoryInterface);
populateFolders(repositoryDirectory, repositoryDirectoryInterface);
return repositoryDirectory;
}
use of org.pentaho.repo.model.RepositoryDirectory in project pentaho-kettle by pentaho.
the class RepositoryBrowserController method create.
public RepositoryDirectory create(String parent, String name) {
if (hasDupeFolder(parent, name)) {
return null;
}
try {
RepositoryDirectoryInterface repositoryDirectoryInterface = getRepository().createRepositoryDirectory(findDirectory(parent), name);
RepositoryDirectory repositoryDirectory = new RepositoryDirectory();
repositoryDirectory.setName(repositoryDirectoryInterface.getName());
repositoryDirectory.setPath(repositoryDirectoryInterface.getPath());
repositoryDirectory.setObjectId(repositoryDirectoryInterface.getObjectId());
repositoryDirectory.setParent(parent);
return repositoryDirectory;
} catch (Exception e) {
return null;
}
}
use of org.pentaho.repo.model.RepositoryDirectory in project pentaho-kettle by pentaho.
the class RepositoryBrowserController method search.
public List<org.pentaho.repo.model.RepositoryObject> search(String path, String filter) {
RepositoryDirectoryInterface repositoryDirectoryInterface = findDirectory(path);
List<org.pentaho.repo.model.RepositoryObject> repositoryObjects = new ArrayList<>();
List<RepositoryObjectInterface> repositoryObjects1 = ((RepositoryExtended) getRepository()).getChildren(repositoryDirectoryInterface.getObjectId().getId(), filter);
for (RepositoryObjectInterface repositoryObject : repositoryObjects1) {
if (repositoryObject instanceof RepositoryDirectoryInterface) {
RepositoryDirectory repositoryDirectory = new RepositoryDirectory();
repositoryDirectory.setPath(path + "/" + repositoryObject.getName());
repositoryDirectory.setName(repositoryObject.getName());
repositoryDirectory.setObjectId(repositoryObject.getObjectId());
repositoryObjects.add(repositoryDirectory);
} else {
RepositoryFile repositoryFile = new RepositoryFile();
repositoryFile.setPath(path + "/" + repositoryObject.getName());
repositoryFile.setName(repositoryObject.getName());
repositoryFile.setType(((RepositoryObject) repositoryObject).getObjectType() == RepositoryObjectType.TRANSFORMATION ? TRANSFORMATION : JOB);
repositoryFile.setObjectId(repositoryObject.getObjectId());
repositoryObjects.add(repositoryFile);
}
}
return repositoryObjects;
}
use of org.pentaho.repo.model.RepositoryDirectory 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;
}
use of org.pentaho.repo.model.RepositoryDirectory in project pentaho-kettle by pentaho.
the class RepositoryBrowserController method loadFiles.
public RepositoryDirectory loadFiles(String path) {
RepositoryDirectoryInterface repositoryDirectoryInterface = findDirectory(path);
RepositoryDirectory repositoryDirectory = RepositoryDirectory.build(null, repositoryDirectoryInterface);
try {
populateFiles(repositoryDirectory, repositoryDirectoryInterface, FILTER);
} catch (KettleException ke) {
ke.printStackTrace();
}
return repositoryDirectory;
}
Aggregations