Context context,
RunData rundata )
{
try
{
Permission permission = null;
/*
* Grab the mode for the user 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 permissionname = rundata.getParameters().getString(SecurityConstants.PARAM_ENTITY_ID);
permission = JetspeedSecurity.getPermission(permissionname);
context.put(SecurityConstants.CONTEXT_PERMISSION, permission);
}
//
// 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
Permission tempPermission = (Permission)rundata.getUser().getTemp(TEMP_PERMISSION);
if (tempPermission != null)
context.put(SecurityConstants.CONTEXT_PERMISSION, tempPermission);
}
context.put(SecurityConstants.PARAM_MODE, mode);