use of org.pentaho.di.ui.repository.repositoryexplorer.model.UIObjectCreationException in project pentaho-kettle by pentaho.
the class BrowseController method init.
// end PDI-3326 hack
@SuppressWarnings("deprecation")
public void init(Repository repository) throws ControllerInitializationException {
try {
this.repository = repository;
mainController = (MainController) this.getXulDomContainer().getEventHandler("mainController");
RepositoryDirectoryInterface root;
try {
if (repository instanceof RepositoryExtended) {
root = ((RepositoryExtended) repository).loadRepositoryDirectoryTree("/", "*.ktr|*.kjb", -1, BooleanUtils.isTrue(repository.getUserInfo().isAdmin()), true, true);
} else {
root = repository.loadRepositoryDirectoryTree();
}
this.repositoryDirectory = UIObjectRegistry.getInstance().constructUIRepositoryDirectory(root, null, repository);
} catch (UIObjectCreationException uoe) {
this.repositoryDirectory = new UIRepositoryDirectory(repository.loadRepositoryDirectoryTree(), null, repository);
}
dirMap = new HashMap<ObjectId, UIRepositoryDirectory>();
populateDirMap(repositoryDirectory);
bf = new SwtBindingFactory();
bf.setDocument(this.getXulDomContainer().getDocumentRoot());
messageBox = (XulMessageBox) document.createElement("messagebox");
createBindings();
} catch (Exception e) {
throw new ControllerInitializationException(e);
}
}
use of org.pentaho.di.ui.repository.repositoryexplorer.model.UIObjectCreationException in project pentaho-kettle by pentaho.
the class ConnectionsController method refreshConnectionList.
// package-local visibility for testing purposes
void refreshConnectionList() {
final List<UIDatabaseConnection> tmpList = new ArrayList<UIDatabaseConnection>();
Runnable r = new Runnable() {
@Override
public void run() {
try {
ObjectId[] dbIdList = repository.getDatabaseIDs(false);
for (ObjectId dbId : dbIdList) {
DatabaseMeta dbMeta = repository.loadDatabaseMeta(dbId, null);
RepositoryElementMetaInterface repoMeta = repository.getObjectInformation(dbId, RepositoryObjectType.DATABASE);
UIDatabaseConnection conn = null;
try {
conn = UIObjectRegistry.getInstance().constructUIDatabaseConnection(dbMeta, repository);
} catch (UIObjectCreationException uoe) {
conn = new UIDatabaseConnection(dbMeta, repository);
}
if (conn != null) {
conn.setRepositoryElementMetaInterface(repoMeta);
tmpList.add(conn);
}
}
} catch (KettleException e) {
if (mainController == null || !mainController.handleLostRepository(e)) {
// convert to runtime exception so it bubbles up through the UI
throw new RuntimeException(e);
}
}
}
};
doWithBusyIndicator(r);
dbConnectionList.setChildren(tmpList);
}
Aggregations