try
{
RollerRequest rreq = RollerRequest.getRollerRequest(request);
if (RollerSession.getRollerSession(request).isGlobalAdminUser())
{
PlanetGroupForm form = (PlanetGroupForm)actionForm;
Roller roller = RollerFactory.getRoller();
PlanetManager planet = roller.getPlanetManager();
ActionErrors errors = validate(planet, form);
if (errors.isEmpty())
{
PlanetGroupData group = null;
if (form.getId() == null || form.getId().trim().length() == 0)
{
group = new PlanetGroupData();
}
else
{
group = planet.getGroupById(form.getId());
}
form.copyTo(group, request.getLocale());
planet.saveGroup(group);
roller.flush();
ActionMessages messages = new ActionMessages();
messages.add(null,
new ActionMessage("planetGroups.success.saved"));
saveMessages(request, messages);
form.doReset(mapping, request);
request.setAttribute("model",
new GroupsPageModel(request, response, mapping));
}
else