0,0 → 1,63 |
package ak.kickup.core.action; |
|
import java.util.List; |
import java.util.Collections; |
import java.util.ArrayList; |
|
import javax.servlet.http.HttpServletRequest; |
import javax.servlet.http.HttpServletResponse; |
|
import org.apache.struts.action.Action; |
import org.apache.struts.action.ActionMapping; |
import org.apache.struts.action.ActionForm; |
import org.apache.struts.action.DynaActionForm; |
import org.apache.struts.action.ActionForward; |
import org.apache.struts.action.ActionMessages; |
import org.apache.struts.action.ActionErrors; |
import org.apache.struts.action.ActionError; |
|
import ak.strutsx.RequestUtilsX; |
import ak.strutsx.ErrorHandlerX; |
import ak.backpath.BackPath; |
|
import ak.kickup.util.StringConverter; |
import ak.kickup.util.UserException; |
import ak.kickup.util.ModelSecurityException; |
import ak.kickup.core.model.Participant; |
import ak.kickup.core.model.ParticipantManager; |
import ak.kickup.core.model.Event; |
import ak.kickup.core.model.EventManager; |
import ak.kickup.core.model.ParticipantAct; |
import ak.kickup.core.model.EventAct; |
import ak.kickup.core.mail.Messages; |
|
public final class ActAction |
extends Action |
{ |
public ActionForward execute(ActionMapping mapping, ActionForm form, |
HttpServletRequest request, HttpServletResponse response) |
throws Exception |
{ |
if("list".equals(mapping.getParameter())) { |
DynaActionForm theForm = (DynaActionForm)form; |
Long eventId = StringConverter.parseLong(theForm.get("event")); |
Event event = EventManager.getInstance().get(eventId, true); |
Long actId = StringConverter.parseLong(theForm.get("act")); |
EventAct act = event.getAct(actId); |
List list; |
|
if(act == null) throw new UserException("ak.kickup.core.act.edit.id.wrong"); |
|
list = new ArrayList(ParticipantManager.getInstance().listForAct(act)); |
Collections.sort(list, ParticipantManager.ACT_NICK_COMPARATOR); |
request.setAttribute("list", list); |
request.setAttribute("event", event); |
request.setAttribute("act", act); |
|
return mapping.findForward("default"); |
} |
else { |
throw new Exception("unknown mapping parameter"); |
} |
} |
} |