Changeset 54
- Timestamp:
- 01/31/06 09:50:28
- Files:
-
- trunk/calendar3/calCore/resources/hbms/Subscription.hbm.xml (modified) (2 diffs)
- trunk/calendar3/calCore/resources/hbms/System.hbm.xml (modified) (2 diffs)
- trunk/calendar3/calCore/resources/hbms/User.hbm.xml (modified) (1 diff)
- trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/CalintfImpl.java (modified) (1 diff)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/BwSystem.java (modified) (5 diffs)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/BwUser.java (modified) (2 diffs)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/svc/BwSubscription.java (modified) (3 diffs)
- trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java (modified) (1 diff)
- trunk/calendar3/docs/todo.txt (modified) (1 diff)
- trunk/calendar3/dumprestore/build.xml (modified) (1 diff)
- trunk/calendar3/dumprestore/properties/dumprestore.properties (modified) (2 diffs)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/dumpling/DumpSyspars.java (modified) (2 diffs)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/dumpling/DumpUserPrefs.java (modified) (1 diff)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/dumpling/DumpUsers.java (modified) (1 diff)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/Restore.java (modified) (3 diffs)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/RestoreGlobals.java (modified) (1 diff)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/rules/CalendarRule.java (modified) (1 diff)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/rules/SysparsFieldRule.java (modified) (2 diffs)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/rules/UserFieldRule.java (modified) (1 diff)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/rules/UserPrefsFieldRule.java (modified) (1 diff)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/rules/UserRule.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/calendar3/calCore/resources/hbms/Subscription.hbm.xml
r2 r54 5 5 6 6 <!-- =================================================================== 7 Subscription S7 Subscriptions 8 8 =================================================================== --> 9 9 … … 38 38 <property name="calendarDeleted" type="true_false" 39 39 column="calendar_deleted" not-null="true" /> 40 41 <property name="unremoveable" type="true_false" 42 column="unremoveable" not-null="true" /> 40 43 </class> 41 44 trunk/calendar3/calCore/resources/hbms/System.hbm.xml
r19 r54 27 27 <property name="userInbox" column="userInbox" type="text" /> 28 28 <property name="userOutbox" column="userOutbox" type="text" /> 29 <property name="defaultUserViewName" column="defaultUserViewName" type="text" /> 29 30 30 31 <property name="publicUser" column="public_user" type="text" /> … … 37 38 <property name="httpConnectionsPerHost" column="http_connections_per_host" type="integer" /> 38 39 <property name="httpConnections" column="http_connections" type="integer" /> 40 41 <property name="maxPublicDescriptionLength" column="maxPublicDescriptionLength" type="integer" /> 42 <property name="maxUserDescriptionLength" column="maxUserDescriptionLength" type="integer" /> 43 <property name="maxUserEntitySize" column="maxUserEntitySize" type="integer" /> 44 <property name="defaultUserQuota" column="defaultUserQuota" type="long" /> 39 45 40 46 <property name="userauthClass" column="userauth_class" type="text" /> trunk/calendar3/calCore/resources/hbms/User.hbm.xml
r2 r54 44 44 <property name="locationAccess" 45 45 column="location_access" type="text"/> 46 47 <property name="quota" type="long"/> 46 48 </class> 47 49 </hibernate-mapping> trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/CalintfImpl.java
r36 r54 617 617 user.setSponsorAccess(access.getDefaultPersonalAccess()); 618 618 619 user.setQuota(getSyspars().getDefaultUserQuota()); 620 619 621 sess.save(user); 620 622 trunk/calendar3/calFacade/src/org/bedework/calfacade/BwSystem.java
r18 r54 75 75 private String systemid; 76 76 77 /* Default calendar anames */77 /* Default calendar names */ 78 78 private String publicCalendarRoot; 79 79 private String userCalendarRoot; … … 82 82 private String userInbox; 83 83 private String userOutbox; 84 private String defaultUserViewName; 84 85 85 86 private String publicUser; … … 90 91 private int httpConnectionsPerHost; 91 92 private int httpConnections; 93 94 /* Limits */ 95 private int maxPublicDescriptionLength = 500; 96 private int maxUserDescriptionLength = 1000; 97 private int maxUserEntitySize = 100000; 98 private long defaultUserQuota = 1000000 * 10; // 10 Meg OK? 92 99 93 100 private String userauthClass; … … 240 247 } 241 248 249 /** Set the user default view name 250 * 251 * @param val String 252 */ 253 public void setDefaultUserViewName(String val) { 254 defaultUserViewName = val; 255 } 256 257 /** Get the userCalendar 258 * 259 * @return String userTrashCalendar 260 */ 261 public String getDefaultUserViewName() { 262 return defaultUserViewName; 263 } 264 242 265 /** Set the public user 243 266 * … … 318 341 public int getHttpConnections() { 319 342 return httpConnections; 343 } 344 345 /** Set the max description length for public events 346 * 347 * @param val int max 348 */ 349 public void setMaxPublicDescriptionLength(int val) { 350 maxPublicDescriptionLength = val; 351 } 352 353 /** 354 * 355 * @return int 356 */ 357 public int getMaxPublicDescriptionLength() { 358 return maxPublicDescriptionLength; 359 } 360 361 /** Set the max description length for user events 362 * 363 * @param val int max 364 */ 365 public void setMaxUserDescriptionLength(int val) { 366 maxUserDescriptionLength = val; 367 } 368 369 /** 370 * 371 * @return int 372 */ 373 public int getMaxUserDescriptionLength() { 374 return maxUserDescriptionLength; 375 } 376 377 /** Set the max entity length for users. Probably an estimate 378 * 379 * @param val int max 380 */ 381 public void setMaxUserEntitySize(int val) { 382 maxUserEntitySize = val; 383 } 384 385 /** 386 * 387 * @return int 388 */ 389 public int getMaxUserEntitySize() { 390 return maxUserEntitySize; 391 } 392 393 /** Set the default quota for users. Probably an estimate 394 * 395 * @param val long default 396 */ 397 public void setDefaultUserQuota(long val) { 398 defaultUserQuota = val; 399 } 400 401 /** 402 * 403 * @return long 404 */ 405 public long getDefaultUserQuota() { 406 return defaultUserQuota; 320 407 } 321 408 trunk/calendar3/calFacade/src/org/bedework/calfacade/BwUser.java
r2 r54 60 60 */ 61 61 public class BwUser extends BwPrincipal { 62 private long quota; 63 62 64 private boolean instanceOwner; 63 65 … … 82 84 public int getKind() { 83 85 return principalUser; 86 } 87 88 /** Quota for this user. This will have to be an estimate I imagine. 89 * 90 * @param val 91 */ 92 public void setQuota(long val) { 93 quota = val; 94 } 95 96 /** 97 * @return long 98 */ 99 public long getQuota() { 100 return quota; 84 101 } 85 102 trunk/calendar3/calFacade/src/org/bedework/calfacade/svc/BwSubscription.java
r50 r54 79 79 private boolean calendarDeleted; 80 80 81 /** Mark this subscription as unremovable by the user. 82 */ 83 private boolean unremoveable; 84 81 85 /* Non-db fields */ 82 86 … … 221 225 public boolean getCalendarDeleted() { 222 226 return calendarDeleted; 227 } 228 229 /** Is the subscription unremoveable? 230 * 231 * @param val boolean true if the subscription is unremoveable 232 */ 233 public void setUnremoveable(boolean val) { 234 unremoveable = val; 235 } 236 237 /** Is the subscription unremoveable? 238 * 239 * @return boolean true if the subscription is unremoveable 240 */ 241 public boolean getUnremoveable() { 242 return unremoveable; 223 243 } 224 244 … … 364 384 sb.append(", uri="); 365 385 sb.append(String.valueOf(getUri())); 386 sb.append(", unremoveable="); 387 sb.append(getUnremoveable()); 366 388 sb.append(")"); 367 389 trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java
r48 r54 1832 1832 1833 1833 // Add default subscription for default calendar. 1834 BwSubscription sub = BwSubscription.makeSubscription(cal, cal.getName(), true, true, false); 1834 BwSubscription defSub = BwSubscription.makeSubscription(cal, 1835 cal.getName(), true, true, false); 1836 setupOwnedEntity(defSub); 1837 1838 prefs.addSubscription(defSub); 1839 1840 // Add default subscription for trash calendar. 1841 1842 cal = cali.getTrashCalendar(); 1843 BwSubscription sub = BwSubscription.makeSubscription(cal, cal.getName(), 1844 false, false, false); 1835 1845 setupOwnedEntity(sub); 1836 1846 1837 1847 prefs.addSubscription(sub); 1838 1848 1839 // Add default subscription for trash calendar. 1840 1841 cal = cali.getTrashCalendar(); 1842 sub = BwSubscription.makeSubscription(cal, cal.getName(), false, false, false); 1843 setupOwnedEntity(sub); 1844 1845 prefs.addSubscription(sub); 1849 // Add a default view for the default calendar subscription 1850 1851 BwView view = new BwView(); 1852 1853 view.setName(getSyspars().getDefaultUserViewName()); 1854 view.addSubscription(defSub); 1855 view.setOwner(auth); 1856 1857 prefs.addView(view); 1846 1858 1847 1859 dbi.updatePreferences(prefs); trunk/calendar3/docs/todo.txt
r50 r54 2 2 3 3 -------------------------------------------------------------------------------- 4 Web-client - ensure no unexpeected data modifications.5 --------------------------------------------------------------------------------6 4 maxDescriptionLength out of BwEvent - into syspars? 7 5 -------------------------------------------------------------------------------- 6 Unremovable subscriptions 7 -------------------------------------------------------------------------------- 8 Personal users need default subscriptions and views 9 -------------------------------------------------------------------------------- 10 Web-client - ensure no unexpected data modifications. 11 -------------------------------------------------------------------------------- 8 12 Check all day events are correct in all clients. 9 --------------------------------------------------------------------------------10 Unremovable subscriptions11 --------------------------------------------------------------------------------12 Personal users need default subscriptions and views13 13 -------------------------------------------------------------------------------- 14 14 Finish off moving calendar labelling stuff out of TimeDateComponents trunk/calendar3/dumprestore/build.xml
r50 r54 264 264 <arg value="-defoutbox" /> 265 265 <arg value="${org.bedework.env.default.user.outbox}" /> 266 <arg value="-defuview" /> 267 <arg line="${org.bedework.env.default.user.view}" /> 266 268 267 269 <arg line="${org.bedework.restore.arg.public.user}" /> trunk/calendar3/dumprestore/properties/dumprestore.properties
r50 r54 57 57 org.bedework.restore.arg.timezones= 58 58 59 # ----------------- --- System parameters ----------------------------59 # ----------------- System parameters for 2.3.2 conversion ------------------- 60 60 org.bedework.restore.arg.sysname=bedework 61 61 org.bedework.restore.arg.tzid=America/New_York … … 68 68 org.bedework.env.default.user.inbox=Inbox 69 69 org.bedework.env.default.user.outbox=Outbox 70 org.bedework.env.default.user.view=All 70 71 71 72 org.bedework.restore.arg.public.user=-pu public-user trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/dumpling/DumpSyspars.java
r49 r54 83 83 taggedVal("userInbox", s.getUserInbox()); 84 84 taggedVal("userOutbox", s.getUserOutbox()); 85 taggedVal("defaultUserViewName", s.getDefaultUserViewName()); 85 86 86 87 taggedVal("publicUser", s.getPublicUser()); … … 91 92 taggedVal("httpConnectionsPerHost", s.getHttpConnectionsPerHost()); 92 93 taggedVal("httpConnections", s.getHttpConnections()); 94 95 taggedVal("maxPublicDescriptionLength", s.getMaxPublicDescriptionLength()); 96 taggedVal("maxUserDescriptionLength", s.getMaxUserDescriptionLength()); 97 taggedVal("maxUserEntitySize", s.getMaxUserEntitySize()); 98 taggedVal("defaultUserQuota", s.getDefaultUserQuota()); 93 99 94 100 taggedVal("userauthClass", s.getUserauthClass()); trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/dumpling/DumpUserPrefs.java
r50 r54 94 94 taggedVal("sub-emailNotifications", sub.getEmailNotifications()); 95 95 taggedVal("sub-calendarDeleted", sub.getCalendarDeleted()); 96 taggedVal("sub-unremoveable=", sub.getUnremoveable()); 96 97 97 98 tagEnd("subscription"); trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/dumpling/DumpUsers.java
r50 r54 67 67 68 68 principalTags(u); 69 taggedVal("instanceOwner", u.getInstanceOwner()); 70 taggedVal("quota", u.getQuota()); 69 71 70 72 tagEnd(objectUser); trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/Restore.java
r50 r54 334 334 i++; 335 335 globals.syspars.setUserOutbox(args[i]); 336 } else if (argpar("-defuview", args, i)) { 337 i++; 338 globals.syspars.setDefaultUserViewName(args[i]); 336 339 337 340 } else if (argpar("-pu", args, i)) { … … 352 355 i++; 353 356 globals.syspars.setHttpConnections(intPar(args[i])); 357 358 } else if (argpar("-defuquota", args, i)) { 359 i++; 360 globals.syspars.setDefaultUserQuota(longPar(args[i])); 354 361 355 362 } else if (argpar("-userauthClass", args, i)) { … … 377 384 private int intPar(String par) throws Throwable { 378 385 return Integer.parseInt(par); 386 } 387 388 private long longPar(String par) throws Throwable { 389 return Long.parseLong(par); 379 390 } 380 391 trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/RestoreGlobals.java
r50 r54 116 116 public BwSystem syspars = new BwSystem(); 117 117 118 /** * /119 public String publicCalendarRoot;120 /** * /121 public String userCalendarRoot;122 /** * /123 public String userDefaultCalendar;124 /** * /125 public String defaultTrashCalendar;126 127 /** Account name for owner of public entities* /128 public String publicUserAccount;129 130 /** * /131 public String systemId; // required for fixing guids132 133 */134 135 118 /* Used when processing timezones */ 136 119 private CalTimezones tzcache; trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/rules/CalendarRule.java
r50 r54 80 80 globals.rintf.restoreCalendar(entity); 81 81 } 82 globals.calendarsTbl.put(new Integer(entity.getId()), entity); 82 83 } catch (Throwable t) { 83 84 throw new Exception(t); trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/rules/SysparsFieldRule.java
r50 r54 91 91 } else if (name.equals("userOutbox")) { 92 92 ent.setUserOutbox(stringFld()); 93 } else if (name.equals("defaultUserViewName")) { 94 ent.setDefaultUserViewName(stringFld()); 93 95 94 96 } else if (name.equals("publicUser")) { … … 105 107 ent.setHttpConnections(intFld()); 106 108 109 } else if (name.equals("maxPublicDescriptionLength")) { 110 ent.setMaxPublicDescriptionLength(intFld()); 111 } else if (name.equals("maxUserDescriptionLength")) { 112 ent.setMaxUserDescriptionLength(intFld()); 113 } else if (name.equals("maxUserEntitySize")) { 114 ent.setMaxUserEntitySize(intFld()); 115 } else if (name.equals("defaultUserQuota")) { 116 ent.setDefaultUserQuota(longFld()); 117 107 118 } else if (name.equals("userauthClass")) { 108 119 ent.setUserauthClass(stringFld()); trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/rules/UserFieldRule.java
r50 r54 73 73 } 74 74 75 if (name.equals("calendarid")) { // 2.3.2 75 if (name.equals("instanceOwner")) { 76 u.setInstanceOwner(booleanFld()); 77 } else if (name.equals("quota")) { 78 u.setQuota(longFld()); 79 } else if (name.equals("calendarid")) { // 2.3.2 76 80 // Fix it later 77 81 globals.subscriptionsTbl.put(u, intFld()); trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/rules/UserPrefsFieldRule.java
r50 r54 127 127 } else if (name.equals("sub-calendarDeleted")) { 128 128 globals.curSub.setCalendarDeleted(booleanFld()); 129 } else if (name.equals("sub-unremoveable")) { 130 globals.curSub.setUnremoveable(booleanFld()); 129 131 130 132 // view fields trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/rules/UserRule.java
r49 r54 78 78 entity.setLocationAccess(globals.getDefaultPersonalAccess()); 79 79 entity.setSponsorAccess(globals.getDefaultPersonalAccess()); 80 entity.setQuota(globals.syspars.getDefaultUserQuota()); 80 81 } 81 82
