Changeset 402
- Timestamp:
- 04/20/06 16:00:56
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/calendar3/webclient/src/org/bedework/webclient/BwAddEventAction.java
r400 r402 52 52 to the maximum extent the law permits. 53 53 */ 54 55 54 package org.bedework.webclient; 56 55 57 import org.bedework.calfacade.BwCalendar;58 56 import org.bedework.calfacade.BwEvent; 59 57 import org.bedework.calfacade.BwLocation; 60 58 import org.bedework.calfacade.CalFacadeDefs; 61 import org.bedework.calfacade.svc.BwSubscription;62 59 import org.bedework.calsvci.CalSvcI; 63 60 import org.bedework.webcommon.BwWebUtil; … … 97 94 98 95 CalSvcI svci = form.fetchSvci(); 99 BwSubscription sub = null;100 96 101 if (!findSubscribedCalendar(request, form, false)) { 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 } 117 } else { 118 sub = form.getSubscription(); 119 if ((sub != null) && (!sub.getInternalSubscription())) { 120 // XXX more work for external subscriptions here 121 return "doNothing"; 122 } else { 123 // XXX disallow use of subscription. 124 return "doNothing"; 125 } 97 String fwd = setEventCalendar(request, form, ev); 98 if (fwd != null) { 99 return fwd; 126 100 } 127 101 trunk/calendar3/webclient/src/org/bedework/webclient/BwEditEventAction.java
r55 r402 156 156 BwEvent ev = form.getEditEvent(); 157 157 158 String fwd = setEventCalendar(request, form, ev); 159 if (fwd != null) { 160 return fwd; 161 } 162 158 163 if (!form.getEventDates().updateEvent(ev, svci.getTimezones()) || 159 164 !BwWebUtil.validateEvent(svci, ev, false, // descriptionRequired trunk/calendar3/webcommon/src/org/bedework/webcommon/BwAbstractAction.java
r395 r402 381 381 } 382 382 383 protected String setEventCalendar(HttpServletRequest request, 384 BwActionFormBase form, 385 BwEvent ev) throws Throwable { 386 CalSvcI svci = form.fetchSvci(); 387 BwSubscription sub = null; 388 389 if (!findSubscribedCalendar(request, form, false)) { 390 // No subscription specified. Was a calendar specified 391 int id = getIntReqPar(request, "calId", -1); 392 393 if (id < 0) { 394 ev.setCalendar(svci.getPreferredCalendar()); 395 } else { 396 BwCalendar calendar = svci.getCalendar(id); 397 398 if (calendar == null) { 399 form.getErr().emit("org.bedework.client.error.nosuchcalendar", id); 400 return "notFound"; 401 } 402 403 ev.setCalendar(calendar); 404 } 405 } else { 406 sub = form.getSubscription(); 407 if ((sub != null) && (!sub.getInternalSubscription())) { 408 // XXX more work for external subscriptions here 409 return "doNothing"; 410 } else { 411 // XXX disallow use of subscription. 412 return "doNothing"; 413 } 414 } 415 416 return null; // OK return 417 } 418 383 419 /** Method to retrieve an event. An event is identified by the calendar + 384 420 * guid + recurrence id. We also take the subscription id as a parameter so
