public void addGroup(Group group)
throws JetspeedSecurityException
{
if(groupExists(group.getName()))
{
throw new GroupException("The group '" +
group.getName() + "' already exists");
}
try
{
TurbineGroup tgroup = new TurbineGroup();
tgroup.setGroupName(group.getName());
Criteria criteria = TurbineGroupPeer.buildCriteria(tgroup);
NumberKey key = (NumberKey)TurbineGroupPeer.doInsert(criteria);
group.setId(key.toString());
}
catch(Exception e)
{
throw new GroupException("Failed to create group '" +
group.getName() + "'", e);
}
try
{
addDefaultGroupPSML(group);
}
catch (Exception e)
{
try
{
removeGroup(group.getName());
}
catch (Exception e2)
{
}
throw new GroupException("failed to add default PSML for Group resource", e);
}
}