Changeset 400
- Timestamp:
- 04/20/06 15:20:51
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/calendar3/webclient/src/org/bedework/webclient/BwAddEventAction.java
r395 r400 55 55 package org.bedework.webclient; 56 56 57 import org.bedework.calfacade.BwCalendar; 57 58 import org.bedework.calfacade.BwEvent; 58 59 import org.bedework.calfacade.BwLocation; … … 66 67 /** 67 68 * Action to add an Event. 68 * <p>No specific request parameters. Form should contain an initialised 69 * BwEvent object. 69 * <p>Form should contain an initialised BwEvent object. 70 * 71 * <p>Request parameters - all optional:<ul> 72 * <li> subname: Name of a subscription to an external calendar</li>. 73 * <li> calId: Id of a (writeable) calendar collection</li>. 74 * </ul> 75 * 70 76 * <p>Forwards to:<ul> 71 77 * <li>"doNothing" input error or we want to ignore the request.</li> … … 94 100 95 101 if (!findSubscribedCalendar(request, form, false)) { 96 // No subscription specified, set the default calendar 97 ev.setCalendar(svci.getPreferredCalendar()); 102 // No subscription specified. Was a calendar specified 103 int id = getIntReqPar(request, "calId", -1); 104 105 if (id < 0) { 106 ev.setCalendar(svci.getPreferredCalendar()); 107 } else { 108 BwCalendar calendar = svci.getCalendar(id); 109 110 if (calendar == null) { 111 form.getErr().emit("org.bedework.client.error.nosuchcalendar", id); 112 return "notFound"; 113 } 114 115 ev.setCalendar(calendar); 116 } 98 117 } else { 99 118 sub = form.getSubscription(); 100 if ((sub == null) || (sub.getCalendar() == null)) {119 if ((sub != null) && (!sub.getInternalSubscription())) { 101 120 // XXX more work for external subscriptions here 102 121 return "doNothing"; 122 } else { 123 // XXX disallow use of subscription. 124 return "doNothing"; 103 125 } 104 105 ev.setCalendar(sub.getCalendar());106 126 } 107 127
