wrappedCandidate.setHasChildren(false);
toViews.add(wrappedCandidate);
}
private final XView createXView(String id, String name, Cube cube,
String accountId, AuthUser user) {
XView view = new XView(id, name);
view.setCubeId(cube.getId());
view.setDatabaseId(cube.getDatabase().getId());
view.setAccountId(accountId);
ViewService vService = ServiceProvider.getViewService(user);
View v = vService.getView(id);
if (v != null && v.getOwner() != null) {
view.setOwnerId(v.getOwner().getId());
}
if (v != null) {
List <String> ids = new ArrayList<String>();
List <String> names = new ArrayList <String>();
for (Role r: v.getRoles()) {
ids.add(r.getId());
names.add(r.getName());
}
view.setRoleIds(ids);
view.setRoleNames(names);
}
return view;
}