public void setSelectedGroup(Group group) {
selectedGroup = group;
}
public void changeGroup(String groupId) throws Exception {
OrganizationService service = getApplicationComponent(OrganizationService.class);
UIBreadcumbs uiBreadcumb = getChild(UIBreadcumbs.class);
uiBreadcumb.setPath(getPath(null, groupId));
UITree tree = getChild(UITree.class);
Collection sibblingGroup;
if (groupId == null) {
sibblingGroup = service.getGroupHandler().findGroups(null);
tree.setSibbling((List) sibblingGroup);
tree.setChildren(null);
tree.setSelected(null);
selectedGroup = null;
return;
}
selectedGroup = service.getGroupHandler().findGroupById(groupId);
String parentGroupId = null;
if (selectedGroup != null)
parentGroupId = selectedGroup.getParentId();
Group parentGroup = null;
if (parentGroupId != null)
parentGroup = service.getGroupHandler().findGroupById(parentGroupId);
Collection childrenGroup = service.getGroupHandler().findGroups(selectedGroup);
sibblingGroup = service.getGroupHandler().findGroups(parentGroup);
tree.setSibbling((List) sibblingGroup);
tree.setChildren((List) childrenGroup);
tree.setSelected(selectedGroup);
tree.setParentSelected(parentGroup);