Context context,
RunData rundata )
{
try
{
Group group = null;
/*
* Grab the mode for the form.
*/
String mode = rundata.getParameters().getString(SecurityConstants.PARAM_MODE);
// if we are updating or deleting - put the name in the context
//
if (mode != null && (mode.equals(SecurityConstants.PARAM_MODE_UPDATE) ||
mode.equals(SecurityConstants.PARAM_MODE_DELETE)))
{
// get the primary key and put the object in the context
String groupname = rundata.getParameters().getString(SecurityConstants.PARAM_ENTITY_ID);
group = JetspeedSecurity.getGroup(groupname);
context.put(SecurityConstants.CONTEXT_GROUP, group);
}
//
// if there was an error, display the message
//
String msgid = rundata.getParameters().getString(SecurityConstants.PARAM_MSGID);
if (msgid != null)
{
int id = Integer.parseInt(msgid);
if (id < SecurityConstants.MESSAGES.length)
context.put(SecurityConstants.PARAM_MSG, SecurityConstants.MESSAGES[id]);
// get the bad entered data and put it back for convenient update
Group tempGroup = (Group)rundata.getUser().getTemp(TEMP_GROUP);
if (tempGroup != null)
context.put(SecurityConstants.CONTEXT_GROUP, tempGroup);
}
context.put(SecurityConstants.PARAM_MODE, mode);