if (request.getPortletMode() == PortletMode.VIEW)
{
String selected = request.getParameter("group");
if (selected != null)
{
Group group = lookupGroup(selected);
if (group != null)
{
PortletMessaging.publish(request, "group", "selected", selected);
PortletMessaging.publish(request, "group", "change", selected);
}
}
String refresh = request.getParameter("group.refresh");
String save = request.getParameter("group.save");
String neue = request.getParameter("group.new");
String delete = request.getParameter("groupDelete");
if (refresh != null)
{
this.clearBrowserIterator(request);
}
else if (neue != null)
{
PortletMessaging.cancel(request, "group", "selected");
}
else if (delete != null && (!(isEmpty(delete))))
{
try
{
Group group = lookupGroup(delete);
if (group != null)
{
groupManager.removeGroup(delete);
this.clearBrowserIterator(request);
PortletMessaging.cancel(request, "group", "selected");
PortletMessaging.publish(request, SecurityResources.USER_BROWSER, "groups", "refresh");
}
}
catch (Exception e)
{
publishStatusMessage(request, "GroupBrowser", "status", e, "Could not remove group");
}
}
else if (save != null)
{
String groupName = request.getParameter("group.name");
if (!(isEmpty(groupName)))
{
try
{
Group group = null;
String old = (String)PortletMessaging.receive(request, "group", "selected");
if (old != null)
{
group = lookupGroup(old);
}