Changeset 257
- Timestamp:
- 03/03/06 15:02:22
- Files:
-
- trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/HibSession.java (modified) (1 diff)
- trunk/calendar3/webclient/src/org/bedework/webclient/BwGoToAction.java (modified) (3 diffs)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/BwAbstractAction.java (modified) (1 diff)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/TimeDateComponents.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/HibSession.java
r235 r257 80 80 * @author Mike Douglass douglm@rpi.edu 81 81 */ 82 public class HibSession {82 public class HibSession implements Serializable { 83 83 transient Logger log; 84 84 85 85 Session sess; 86 Transaction tx;87 88 Query q;89 Criteria crit;86 transient Transaction tx; 87 88 transient Query q; 89 transient Criteria crit; 90 90 91 91 /** Exception from this session. */ trunk/calendar3/webclient/src/org/bedework/webclient/BwGoToAction.java
r251 r257 146 146 Date jdt = CalFacadeUtil.fromISODate(date); 147 147 dt = new MyCalendarVO(jdt, loc); 148 if (!checkDateInRange(form, dt.getYear())) { 149 // Set it to today 150 jdt = new Date(System.currentTimeMillis()); 151 dt = new MyCalendarVO(jdt, loc); 152 } 148 153 newView = true; 149 154 } … … 168 173 If so we'll set a new view of the same period as the current. 169 174 */ 170 String vsdate = viewStart.getDateTime().getDtval().substring(0, 8); 171 if (debug) { 172 action.logIt("vsdate=" + vsdate); 173 } 174 175 if (!(vsdate.equals(form.getCurTimeView().getFirstDay().getDateDigits()))) { 176 newView = true; 177 newViewTypeI = form.getCurViewPeriod(); 178 Date jdt = CalFacadeUtil.fromISODate(vsdate); 179 dt = new MyCalendarVO(jdt, loc); 175 int year = viewStart.getCalYear(); 176 177 if (checkDateInRange(form, year)) { 178 String vsdate = viewStart.getDateTime().getDtval().substring(0, 8); 179 if (debug) { 180 action.logIt("vsdate=" + vsdate); 181 } 182 183 if (!(vsdate.equals(form.getCurTimeView().getFirstDay().getDateDigits()))) { 184 newView = true; 185 newViewTypeI = form.getCurViewPeriod(); 186 Date jdt = CalFacadeUtil.fromISODate(vsdate); 187 dt = new MyCalendarVO(jdt, loc); 188 } 180 189 } 181 190 } … … 202 211 form.getEventEndDate().setDateTime(tv.getCurDay().getTime()); 203 212 } 213 214 private static boolean checkDateInRange(BwActionForm form, 215 int year) throws Throwable { 216 // XXX make system parameters for allowable start/end year 217 int thisYear = form.getToday().getYear(); 218 219 if ((year < thisYear - 10) || (year > thisYear + 10)) { 220 form.getErr().emit("org.bedework.client.error.baddate"); 221 return false; 222 } 223 224 return true; 225 } 204 226 } trunk/calendar3/webcommon/src/org/bedework/webcommon/BwAbstractAction.java
r235 r257 339 339 } 340 340 341 /** Method to retrieve an event. 341 /** Method to retrieve an event. An event is identified by the calendar + 342 * guid + recurrence id. We also take the subscription id as a parameter so 343 * we can pass it along in the result for display purposes. 344 * 345 * <p>We cannot just take the calendar from the subscription, because the 346 * calendar has to be the actual collection containing the event. A 347 * subscription may be to higher up the tree (i.e. a folder). 348 * 349 * <p>We need to also allow the calendar path instead of the id. External 350 * calendars don't have an id. This means changing the api (again) and 351 * changing the urls (again). 352 * 353 * <p>It may be more appropriate to simply encode a url to the event. 354 * 342 355 * <p>Request parameters<ul> 343 356 * <li>"subid" subscription id for event. < 0 if there is none 344 357 * e.g. displayed directly from calendar.</li> 358 * <li>"calid" id of calendar to search.</li> 345 359 * <li>"guid" guid of event.</li> 346 360 * <li>"recurrenceId" recurrence-id of event instance - possibly null.</li> trunk/calendar3/webcommon/src/org/bedework/webcommon/TimeDateComponents.java
r172 r257 352 352 } 353 353 354 /** 355 * @return int year 356 */ 357 public int getCalYear() { 358 return getCal().get(Calendar.YEAR); 359 } 360 354 361 /* XXX 355 362 In the get methods below, we try to translate real values to the
