(2);
- if (group != null)
- {
- // calculate action group metadata
- properties.setActionGroupName(properties.getAuthService().getShortName(group));
- int count = properties.getAuthService().getContainedAuthorities(AuthorityType.GROUP, group, false).size();
- count += properties.getAuthService().getContainedAuthorities(AuthorityType.USER, group, false).size();
- properties.setActionGroupItems(count);
- }
- else
- {
- properties.setActionGroupName(null);
- properties.setActionGroupItems(0);
- }
+ UIListItem item1 = new UIListItem();
+ item1.setValue(VIEW_ICONS);
+ item1.setLabel(Application.getMessage(context, LABEL_VIEW_ICONS));
+ items.add(item1);
- // clear value used by Create Group form
- properties.setName(null);
+ UIListItem item2 = new UIListItem();
+ item2.setValue(VIEW_DETAILS);
+ item2.setLabel(Application.getMessage(context, LABEL_VIEW_DETAILS));
+ items.add(item2);
+
+ return items;
}
- /**
- * Set the current Group Authority.
- *
- * Setting this value causes the UI to update and display the specified node as current.
- *
- * @param group The current group authority.
- */
- public void setCurrentGroup(String group, String groupName)
+ public void viewModeChanged(ActionEvent event)
{
- if (logger.isDebugEnabled())
- logger.debug("Setting current group: " + group);
+ UIModeList viewList = (UIModeList)event.getComponent();
- // set the current Group Authority for our UI context operations
- properties.setGroup(group);
- properties.setGroupName(groupName);
-
- // inform that the UI needs updating after this change
- contextUpdated();
+ // update view mode from user selection
+ setViewMode(viewList.getValue().toString());
+ }
+
+ public String getViewMode()
+ {
+ return this.viewMode;
+ }
+
+ public void setViewMode(String viewMode)
+ {
+ this.viewMode = viewMode;
+ }
+
+ // ------------------------------------------------------------------------------
+ // Bean property getters and setters
+
+ public String getGroup()
+ {
+ return this.group;
+ }
+
+ public String getGroupName()
+ {
+ return this.groupName;
+ }
+
+ public void setAuthService(AuthorityService authService)
+ {
+ this.authService = authService;
+ }
+
+ public void setPersonService(PersonService personService)
+ {
+ this.personService = personService;
+ }
+
+ public UIRichList getGroupsRichList()
+ {
+ return groupsRichList;
+ }
+
+ public void setGroupsRichList(UIRichList groupsRichList)
+ {
+ this.groupsRichList = groupsRichList;
+ }
+
+ public UIRichList getUsersRichList()
+ {
+ return usersRichList;
+ }
+
+ public void setUsersRichList(UIRichList usersRichList)
+ {
+ this.usersRichList = usersRichList;
}
/**
@@ -147,16 +300,16 @@ public class GroupsDialog extends BaseDialogBean implements IContextListener
*/
public List getLocation()
{
- if (properties.getLocation() == null)
+ if (this.location == null)
{
List loc = new ArrayList(8);
loc.add(new GroupBreadcrumbHandler(null,
- Application.getMessage(FacesContext.getCurrentInstance(), MSG_GROUPS)));
+ Application.getMessage(FacesContext.getCurrentInstance(), MSG_ROOT_GROUPS)));
- properties.setLocation(loc);
+ this.location = loc;
}
- return properties.getLocation();
+ return this.location;
}
/**
@@ -175,32 +328,34 @@ public class GroupsDialog extends BaseDialogBean implements IContextListener
tx.begin();
Set authorities;
- boolean immediate = (properties.getFilterMode().equals(FILTER_CHILDREN));
- if (properties.getGroup() == null)
+ boolean immediate = (this.filterMode.equals(FILTER_CHILDREN));
+ if (this.group == null)
{
// root groups
if (immediate == true)
{
- authorities = properties.getAuthService().getAllRootAuthorities(AuthorityType.GROUP);
+ authorities = this.authService.getAllRootAuthorities(AuthorityType.GROUP);
}
else
{
- authorities = properties.getAuthService().getAllAuthorities(AuthorityType.GROUP);
+ authorities = this.authService.getAllAuthorities(AuthorityType.GROUP);
}
}
else
{
// sub-group of an existing group
- authorities = properties.getAuthService().getContainedAuthorities(AuthorityType.GROUP, properties.getGroup(), immediate);
+ authorities = this.authService.getContainedAuthorities(AuthorityType.GROUP, this.group, immediate);
}
groups = new ArrayList