Changeset 298
- Timestamp:
- 03/23/06 00:17:08
- Files:
-
- trunk/calendar3/calFacade/src/org/bedework/calfacade/CalFacadeBadDateException.java (modified) (2 diffs)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/CalFacadeException.java (modified) (3 diffs)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/ifs/CalTimezones.java (modified) (4 diffs)
- trunk/calendar3/deployment/webuser/webapp/resources/demoskins/default/default/errors.xsl (modified) (1 diff)
- trunk/calendar3/icalendar/src/org/bedework/icalendar/BwEventUtil.java (modified) (2 diffs)
- trunk/calendar3/icalendar/src/org/bedework/icalendar/IcalTranslator.java (modified) (8 diffs)
- trunk/calendar3/lib/ical4j-0.9.18x.jar (deleted)
- trunk/calendar3/lib/source/ical4j-0.9.18x-src.zip (deleted)
- trunk/calendar3/lib/source/ical4j-0.9.19-pre-src.zip (added)
- trunk/calendar3/webclient/war/WEB-INF/struts-config.xml (modified) (1 diff)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/misc/UploadAction.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/calendar3/calFacade/src/org/bedework/calfacade/CalFacadeBadDateException.java
r2 r298 63 63 */ 64 64 public CalFacadeBadDateException() { 65 super( );65 super(badDate); 66 66 } 67 67 … … 79 79 */ 80 80 public CalFacadeBadDateException(String s) { 81 super( s);81 super(badDate, s); 82 82 } 83 83 } trunk/calendar3/calFacade/src/org/bedework/calfacade/CalFacadeException.java
r285 r298 62 62 * retrieve a localized message and can also be used to identify the 63 63 * cause of the exception. 64 * 65 * Every CalFacadeException should have one of these as the getMessage() 66 * value. 64 67 */ 65 68 … … 117 120 public static final String timezonesReadError = 118 121 "org.bedework.error.timezones.readerror"; 122 123 /** Unknown timezones */ 124 public static final String unknownTimezone = 125 "org.bedework.error.unknown.timezone"; 126 127 /** Bad date */ 128 public static final String badDate = 129 "org.bedework.error.bad.date"; 119 130 120 131 /* ****************** Misc ****************************** */ … … 126 137 private String extra; 127 138 128 /** Constr ictor139 /** Constructor 129 140 * 130 141 */ trunk/calendar3/calFacade/src/org/bedework/calfacade/ifs/CalTimezones.java
r278 r298 300 300 HashMap cache = null; 301 301 302 if ( CalFacadeUtil.isISODate(time)) {302 if ((time.length() == 8) && CalFacadeUtil.isISODate(time)) { 303 303 /* See if we have it cached */ 304 304 … … 328 328 time += "T000000"; 329 329 } else if (!CalFacadeUtil.isISODateTime(time)) { 330 throw new CalFacadeBadDateException( );330 throw new CalFacadeBadDateException(time); 331 331 } 332 332 … … 359 359 if (lasttz == null) { 360 360 lasttzid = null; 361 throw new CalFacade BadDateException();361 throw new CalFacadeException(CalFacadeException.unknownTimezone, tzid); 362 362 } 363 363 tzchanged = true; … … 406 406 407 407 return utc; 408 } catch (CalFacadeException cfe) { 409 throw cfe; 408 410 } catch (Throwable t) { 409 411 t.printStackTrace(); 410 throw new CalFacadeBadDateException( );412 throw new CalFacadeBadDateException(time); 411 413 } 412 414 } trunk/calendar3/deployment/webuser/webapp/resources/demoskins/default/default/errors.xsl
r2 r298 27 27 You must supply a recipient. 28 28 </xsl:when> 29 <xsl:when test="id='org.bedework.error.unknown.timezone'"> 30 Unknown timezone <xsl:value-of select="param"/> 31 </xsl:when> 29 32 <xsl:otherwise> 30 33 <xsl:value-of select="id"/> = <xsl:value-of select="param"/> trunk/calendar3/icalendar/src/org/bedework/icalendar/BwEventUtil.java
r207 r298 99 99 import net.fortuna.ical4j.model.property.Status; 100 100 import net.fortuna.ical4j.model.property.Summary; 101 import net.fortuna.ical4j.model.property.Transp; 101 102 import net.fortuna.ical4j.model.property.Uid; 102 103 import net.fortuna.ical4j.model.property.Url; … … 498 499 499 500 ev.setSummary(pval); 501 } else if (prop instanceof Transp) { 502 /* ------------------- Transp -------------------- */ 503 504 ev.setTransparency(pval); 500 505 } else if (prop instanceof Uid) { 501 506 /* ------------------- Uid -------------------- */ trunk/calendar3/icalendar/src/org/bedework/icalendar/IcalTranslator.java
r295 r298 271 271 */ 272 272 public Collection fromIcal(BwCalendar cal, String val) throws CalFacadeException { 273 return fromIcal(cal, new StringReader(val)); 274 /* 273 275 try { 274 276 CalendarBuilder bldr = new CalendarBuilder(new CalendarParserImpl()); … … 287 289 } catch (Throwable t) { 288 290 throw new CalFacadeException(t); 289 } 291 }*/ 290 292 } 291 293 … … 299 301 public Collection fromIcal(BwCalendar cal, Reader rdr) throws CalFacadeException { 300 302 try { 301 //System.setProperty("ical4j.unfolding.relaxed", "true");303 setSystemProperties(); 302 304 CalendarBuilder bldr = new CalendarBuilder(new CalendarParserImpl()); 303 305 … … 360 362 public static Calendar getCalendar(String val) throws CalFacadeException { 361 363 try { 364 setSystemProperties(); 362 365 CalendarBuilder bldr = new CalendarBuilder(new CalendarParserImpl()); 363 366 … … 365 368 366 369 return bldr.build(ufrdr); 370 } catch (CalFacadeException cfe) { 371 throw cfe; 367 372 } catch (Throwable t) { 368 373 throw new CalFacadeException(t); … … 382 387 public Collection toVEvent(String val) throws CalFacadeException { 383 388 try { 389 setSystemProperties(); 384 390 CalendarBuilder bldr = new CalendarBuilder(new CalendarParserImpl()); 385 391 … … 406 412 407 413 return evs; 414 } catch (CalFacadeException cfe) { 415 throw cfe; 408 416 } catch (Throwable t) { 409 417 throw new CalFacadeException(t); … … 538 546 added.put(tzid, null); 539 547 } 548 549 private static void setSystemProperties() throws CalFacadeException { 550 try { 551 System.setProperty("ical4j.unfolding.relaxed", "true"); 552 System.setProperty("ical4j.parsing.relaxed", "true"); 553 System.setProperty("ical4j.compatibility.outlook", "true"); 554 } catch (Throwable t) { 555 throw new CalFacadeException(t); 556 } 557 } 540 558 541 559 private Logger getLog() { trunk/calendar3/webclient/war/WEB-INF/struts-config.xml
r272 r298 276 276 scope="session" 277 277 validate="false"> 278 <forward name="baddata" path="/showMain.rdo" redirect="true" /> 278 279 </action> 279 280 trunk/calendar3/webcommon/src/org/bedework/webcommon/misc/UploadAction.java
r261 r298 57 57 import org.bedework.calfacade.BwCalendar; 58 58 import org.bedework.calfacade.BwEvent; 59 import org.bedework.calfacade.CalFacadeException; 59 60 import org.bedework.calfacade.svc.EventInfo; 60 61 import org.bedework.calsvci.CalSvcI; … … 123 124 } 124 125 125 InputStream is = upFile.getInputStream(); 126 try { 127 // To catch some of the parser errors 126 128 127 IcalTranslator trans = new IcalTranslator(svci.getIcalCallback(), debug); 128 129 Collection objs = trans.fromIcal(cal, new InputStreamReader(is)); 130 131 Iterator it = objs.iterator(); 132 133 while (it.hasNext()) { 134 Object o = it.next(); 135 136 if (o instanceof EventInfo) { 137 EventInfo ei = (EventInfo)o; 138 BwEvent ev = ei.getEvent(); 139 140 if (ei.getNewEvent()) { 141 svci.addEvent(cal, ev, ei.getOverrides()); 142 } else { 143 svci.updateEvent(ev); 129 InputStream is = upFile.getInputStream(); 130 131 IcalTranslator trans = new IcalTranslator(svci.getIcalCallback(), debug); 132 133 Collection objs = trans.fromIcal(cal, new InputStreamReader(is)); 134 135 Iterator it = objs.iterator(); 136 137 while (it.hasNext()) { 138 Object o = it.next(); 139 140 if (o instanceof EventInfo) { 141 EventInfo ei = (EventInfo)o; 142 BwEvent ev = ei.getEvent(); 143 144 if (ei.getNewEvent()) { 145 svci.addEvent(cal, ev, ei.getOverrides()); 146 } else { 147 svci.updateEvent(ev); 148 } 144 149 } 145 150 } 151 } catch (CalFacadeException cfe) { 152 form.getErr().emit(cfe.getMessage(), cfe.getExtra()); 153 return "baddata"; 146 154 } 147 155 148 form.getMsg().emit("org.bedework. client.message.event.added");156 form.getMsg().emit("org.bedework.message.added.events", 1); 149 157 150 158 return "success";
