* @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
public ActionForward list(ActionMapping mapping, ActionForm form,
HttpServletRequest req, HttpServletResponse resp) {
SendTaskDetailForm detailForm = (SendTaskDetailForm)form;
UserManagerBase userManager = new UserManager(locale,session);
User user = userManager.getUserDetails(req.getUserPrincipal().getName().toLowerCase());
String idParam = req.getParameter("id");
if (idParam == null) {
throw new BugException("missing id parameter");
}
long id = Long.parseLong(idParam);
detailForm.setId(id);
SendTaskManager sendTaskMgm = new SendTaskManager(locale, session);
SendTask sendTask = sendTaskMgm.getSendTask(id);
if (sendTask == null || !accessAllowed(user, sendTask)) {
throw new InputException(getResources(req).getMessage(locale, "smssvc.sendTaskNotAvailable"));
}
SendTaskReceiver[] receivers = sendTaskMgm.getReceivers(sendTask, detailForm.getShowFailed(), detailForm.getShowPending(), detailForm.getShowRelayed(), detailForm.getShowSending());
req.setAttribute("task", sendTask);
req.setAttribute("task_content", sendTask.getContent().replace("\n", "<br />"));
req.setAttribute("receivers", receivers);
return mapping.findForward("list");
}