Changeset 42
- Timestamp:
- 01/26/06 16:08:11
- Files:
-
- trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/UserAuthUWDbImpl.java (modified) (1 diff)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/BwPrincipal.java (modified) (3 diffs)
- trunk/calendar3/deployment/webadmin/webapp/resources/en_US/default/errors.xsl (modified) (1 diff)
- trunk/calendar3/docs/todo.txt (modified) (4 diffs)
- trunk/calendar3/tools/dumprestore/build.xml (modified) (1 diff)
- trunk/calendar3/webadmin/src/org/bedework/webadmin/PEActionForm.java (modified) (8 diffs)
- trunk/calendar3/webadmin/src/org/bedework/webadmin/event/PEUpdateEventAction.java (modified) (3 diffs)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/BwWebUtil.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/UserAuthUWDbImpl.java
r2 r42 69 69 import org.apache.log4j.Logger; 70 70 71 /** Implementation of UserAuth that handles UWDB tables for authorisation.71 /** Implementation of UserAuth that handles Bedwork DB tables for authorisation. 72 72 * 73 73 * @author Mike Douglass douglm@rpi.edu trunk/calendar3/calFacade/src/org/bedework/calfacade/BwPrincipal.java
r2 r42 84 84 public abstract class BwPrincipal extends BwDbentity 85 85 implements AccessPrincipal, Comparator { 86 /** The kind of Principal returned by getKind() */87 88 /** user */89 public static final int principalUser = 0;90 91 /** group */92 public static final int principalGroup = 1;93 94 /** host */95 public static final int principalHost = 2;96 97 /** Used for db version checks98 */99 protected int seq;100 101 86 /** The internal name by which this principal is identified, unique within 102 87 * its class … … 170 155 */ 171 156 public abstract int getKind(); 172 173 /** Set the db version174 *175 * @param val db version number176 */177 public void setSeq(int val) {178 seq = val;179 }180 181 /** Get the db version182 *183 * @return int the db version184 */185 public int getSeq() {186 return seq;187 }188 157 189 158 /** Set the unauthenticated state. … … 466 435 BwPrincipal p2 = (BwPrincipal)o2; 467 436 468 if (p1.account == null) { 469 // Should not happen 470 throw new RuntimeException("Null account for UserVO object id=" + 471 p1.getId()); 472 } 473 474 if (p2.account == null) { 475 // Should not happen 476 throw new RuntimeException("Null account for UserVO object id=" + 477 p2.getId()); 478 } 479 480 return p1.account.compareTo(p2.account); 437 if (p1.getKind() < p2.getKind()) { 438 return -1; 439 } 440 441 if (p1.getKind() > p2.getKind()) { 442 return 1; 443 } 444 445 return CalFacadeUtil.compareStrings(p1.getAccount(), p2.getAccount()); 481 446 } 482 447 trunk/calendar3/deployment/webadmin/webapp/resources/en_US/default/errors.xsl
r40 r42 71 71 You must supply a title<br/> 72 72 </xsl:when> 73 <xsl:when test="id='org.bedework.validation.error.nocalendar'"> 74 You must supply the calendar<br/> 75 </xsl:when> 73 76 <xsl:when test="id='org.bedework.validation.error.nodescription'"> 74 77 You must supply a description<br/> trunk/calendar3/docs/todo.txt
r36 r42 3 3 -------------------------------------------------------------------------------- 4 4 -------------------------------------------------------------------------------- 5 -------------------------------------------------------------------------------- 5 Unremovable subscriptions 6 -------------------------------------------------------------------------------- 7 Personal users need default subscriptions and views 6 8 -------------------------------------------------------------------------------- 7 9 Finish off moving calendar labelling stuff out of TimeDateComponents … … 101 103 Fix the add event link in calendar gui 102 104 -------------------------------------------------------------------------------- 103 Remove target from BwEvent?104 105 -------------------------------------------------------------------------------- 105 106 We probably need the equivalent of an event info object at the Calintf level to … … 322 323 Delete in user calendar doesn't work 323 324 -------------------------------------------------------------------------------- 324 Caused by: java.io.NotSerializableException: org.apache.log4j.Logger325 325 -------------------------------------------------------------------------------- 326 326 Event_Attendees table has wrong column name … … 420 420 Manage calendars. 421 421 422 Use /calendar/initAdd to specify parent423 http://localhost:8080/caladmin/calendar/initAdd.do?calId=123424 425 Then426 http://localhost:8080/caladmin/calendar/update.do?...427 with calendar fields.428 429 To update go to430 http://localhost:8080/caladmin/calendar/fetchForUpdate.do?calId=123431 then on to update432 433 Deletion should start off as update then on to434 http://localhost:8080/caladmin/calendar/delete.do?...435 436 **********************************437 422 Check that access is limited to calendars to which auth user has at least 438 423 write-content access trunk/calendar3/tools/dumprestore/build.xml
r18 r42 238 238 <arg line="${org.bedework.restore.arg.admingroupsClass}" /> 239 239 <arg line="${org.bedework.restore.arg.usergroupsClass}" /> 240 <!-- 240 241 <jvmarg value="-Xrunyjpagent:cpu=times,onexit=cpu" /> 242 --> 241 243 <!-- 242 244 <arg value="-Djava.endorsed.dir=${org.bedework.default.lib}/endorsed"/>--> trunk/calendar3/webadmin/src/org/bedework/webadmin/PEActionForm.java
r24 r42 145 145 /** Set if we appear to be changing the event category. 146 146 */ 147 // private CategoryVO oldCategory; 148 149 private IntSelectId keyId; 147 148 private IntSelectId categoryId; 150 149 151 150 /* .................................................................... … … 397 396 398 397 /* A is the All box, B is the user preferred values. */ 399 keyId = new IntSelectId(id, IntSelectId.AHasPrecedence);398 categoryId = new IntSelectId(id, IntSelectId.AHasPrecedence); 400 399 401 400 BwSponsor s = event.getSponsor(); … … 526 525 public void setCategoryId(int val) { 527 526 if (val >= 0) { 528 keyId.setA(val);527 categoryId.setA(val); 529 528 } 530 529 } … … 538 537 */ 539 538 public int getOriginalCategoryId() { 540 if ( keyId == null) {539 if (categoryId == null) { 541 540 return 0; 542 541 } 543 542 544 return keyId.getOriginalVal();543 return categoryId.getOriginalVal(); 545 544 } 546 545 … … 550 549 public void setPrefCategoryId(int val) { 551 550 if (val >= 0) { 552 keyId.setB(val);551 categoryId.setB(val); 553 552 } 554 553 } … … 1089 1088 * ==================================================================== */ 1090 1089 1091 /** Ensure the event has all required fields and all are valid.1092 *1093 * <p>This method will retrieve any selected contacts, locations and1094 * categories and embed them in the form and event.1095 *1096 * @return boolean true event looks OK1097 * @throws Throwable1098 */1099 public boolean validateEvent() throws Throwable {1100 boolean ok = validateEventCategory();1101 BwEvent ev = getEvent();1102 1103 if (!validateEventSponsor()) {1104 ok = false;1105 }1106 1107 if (!validateEventLocation()) {1108 ok = false;1109 }1110 1111 if (!validateEventCalendar()) {1112 ok = false;1113 }1114 1115 if (!getEventDates().updateEvent(ev, getCalSvcI().getTimezones())) {1116 ok = false;1117 } else {1118 ok = BwWebUtil.validateEvent(this.getCalSvcI(), ev, true, // descriptionRequired1119 err);1120 }1121 1122 return ok;1123 }1124 1125 1090 /** 1126 1091 * … … 1129 1094 */ 1130 1095 public boolean validateEventCategory() throws Throwable { 1131 int id = keyId.getVal();1096 int id = categoryId.getVal(); 1132 1097 1133 1098 if (id <= 0) { … … 1148 1113 } 1149 1114 1150 if (! keyId.getChanged()) {1115 if (!categoryId.getChanged()) { 1151 1116 return true; 1152 1117 } trunk/calendar3/webadmin/src/org/bedework/webadmin/event/PEUpdateEventAction.java
r24 r42 62 62 import org.bedework.webadmin.PEActionForm; 63 63 import org.bedework.webcommon.BwSession; 64 import org.bedework.webcommon.BwWebUtil; 64 65 65 66 … … 121 122 122 123 CalSvcI svci = form.getCalSvcI(); 123 if (! form.validateEvent()) {124 if (!validateEvent(form)) { 124 125 return "retry"; 125 126 } … … 155 156 return "continue"; 156 157 } 158 159 /* Ensure the event has all required fields and all are valid. 160 * 161 * <p>This method will retrieve any selected contacts, locations and 162 * categories and embed them in the form and event. 163 */ 164 private boolean validateEvent(PEActionForm form) throws Throwable { 165 boolean ok = form.validateEventCategory(); 166 BwEvent ev = form.getEvent(); 167 CalSvcI svci = form.getCalSvcI(); 168 169 if (!form.validateEventSponsor()) { 170 ok = false; 171 } 172 173 if (!form.validateEventLocation()) { 174 ok = false; 175 } 176 177 if (!form.validateEventCalendar()) { 178 ok = false; 179 } 180 181 if (!form.getEventDates().updateEvent(ev, svci.getTimezones())) { 182 ok = false; 183 } else { 184 ok = BwWebUtil.validateEvent(svci, ev, true, // descriptionRequired 185 form.getErr()); 186 } 187 188 return ok; 189 } 157 190 } 158 191 trunk/calendar3/webcommon/src/org/bedework/webcommon/BwWebUtil.java
r2 r42 178 178 ev.setDescription(checkNull(ev.getDescription())); 179 179 180 if (ev.getCalendar() == null) { 181 err.emit("org.bedework.validation.error.nocalendar"); 182 ok = false; 183 } 184 180 185 if (ev.getSummary() == null) { 181 186 err.emit("org.bedework.validation.error.notitle");
