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.beans.CalendarData;
15  import net.stff.ical.beans.ICal;
16  import net.stff.ical.beans.IEvent;
17  import net.stff.ical.gui.struts.formbeans.CommFormBean;
18  import net.stff.ical.gui.struts.formbeans.RecurrenceFormBean;
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 ViewRecurrenceAction extends Action {
31  	public ActionForward execute(ActionMapping mapping, ActionForm form, javax.servlet.http.HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
32  		
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.RECURRENCEMODE);
39  		
40  		ICal cal= data.getManager().getCalendar(f.getBean().getCalendar(), request.getRemoteUser());
41  		IEvent e= cal.getEvent(f.getBean().getEvent());
42  
43  
44  		RecurrenceFormBean bean= new RecurrenceFormBean(e, data.getLocale());
45  		bean.setMethod("edit");
46  		request.getSession().setAttribute("recurrenceformbean", bean);
47  	    
48  	    return mapping.findForward("view");
49  	}
50  	
51  
52  }