View Javadoc

1   /*
2    * Created on 21.07.2004
3    *
4    * © 2004 Stoffwechsel Development GbR
5    * 
6    * */
7   package net.stff.ical.gui.struts.actions;
8   
9   import java.io.IOException;
10  
11  import javax.servlet.ServletException;
12  import javax.servlet.http.HttpServletResponse;
13  
14  import net.stff.ical.CalendarManager;
15  import net.stff.ical.beans.CalendarData;
16  import net.stff.ical.beans.IEvent;
17  import net.stff.ical.gui.struts.formbeans.CommFormBean;
18  import net.stff.ical.gui.struts.formbeans.EventFormBean;
19  import net.stff.util.SessionObject;
20  
21  import org.apache.struts.action.Action;
22  import org.apache.struts.action.ActionForm;
23  import org.apache.struts.action.ActionForward;
24  import org.apache.struts.action.ActionMapping;
25  
26  /***
27   * @author buntekuh
28   *
29   */
30  public class ViewEventAction extends Action {
31  	
32      public ActionForward execute(ActionMapping mapping, ActionForm form, javax.servlet.http.HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
33  		CommFormBean f= (CommFormBean)form;
34  
35  		SessionObject so = SessionObject.get(request);
36  		CalendarData data = (CalendarData)so.getObject("icalData", request);
37  		data.setUser(request.getRemoteUser());
38  		data.setEventMode(CalendarData.EVENTMODE);
39  		CalendarManager cm= data.getManager();
40  		IEvent event= cm.getEvent(f.getBean().getEvent());
41  		EventFormBean bean= new EventFormBean(event, event.getCalendar());
42  		bean.setMethod("edit");
43  		request.getSession().setAttribute("eventformbean", bean);
44  	    
45  	    return mapping.findForward("success");
46  	}
47  
48  }