Changeset 145
- Timestamp:
- 02/09/06 23:52:00
- Files:
-
- trunk/calendar3/calFacade/src/org/bedework/calfacade/filter/BwEntityFilter.java (modified) (1 diff)
- trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java (modified) (1 diff)
- trunk/calendar3/docs/todo.txt (modified) (5 diffs)
- trunk/calendar3/webadmin/src/org/bedework/webadmin/event/PEGetFormattedEventsAction.java (modified) (3 diffs)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/BwAbstractAction.java (modified) (2 diffs)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/BwActionFormBase.java (modified) (1 diff)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/misc/SetSelectionAction.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/calendar3/calFacade/src/org/bedework/calfacade/filter/BwEntityFilter.java
r2 r145 42 42 protected Collection entities; 43 43 44 /** True if this is a single entity. Allows query generators to distinguish44 /** True if this is a single entity. Allows query generators to distinguish 45 45 * between "=" and "IN" 46 46 * trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java
r128 r145 1426 1426 TreeSet ts = new TreeSet(); 1427 1427 1428 if (pars.getPublicAdmin() || (sub != null)) { 1428 // if (pars.getPublicAdmin() || (sub != null)) { 1429 if (sub != null) { 1429 1430 BwCalendar cal = null; 1430 1431 if (sub != null) { trunk/calendar3/docs/todo.txt
r84 r145 4 4 -------------------------------------------------------------------------------- 5 5 -------------------------------------------------------------------------------- 6 Views not sorted in selection list 7 -------------------------------------------------------------------------------- 8 Try a change and see if we get mailed. 6 -------------------------------------------------------------------------------- 7 When duplicating event - set creator 9 8 -------------------------------------------------------------------------------- 10 9 Web-client - ensure no unexpected data modifications. … … 17 16 Floating times should be as the result of an explicit user request. 18 17 -------------------------------------------------------------------------------- 19 eventIcal20 Need to use action to deliver ical - not stylesheet21 18 -------------------------------------------------------------------------------- 22 19 What was I trying to do with the default access stuff in the principal? … … 34 31 subclass for BwEventObj and BwEventAnnotation. 35 32 -------------------------------------------------------------------------------- 36 FiltersRule needs to add Inbox37 CalintfImpl and FiltersRule should use some joint code to create users.38 Try init of empty system then create users through Calintf?39 33 -------------------------------------------------------------------------------- 40 34 lazy="false" is set on calendar objects. … … 56 50 -------------------------------------------------------------------------------- 57 51 Notes on annotations and overrides and fetching events. 58 Allowing users to annotate shared events introduces enormous complexity to the59 fetching and updating process but seems to be a feature of enterprise systems.60 61 Until we feel this is workable we may want to suppress annotations in the user62 interface. HOWEVER, synchml and caldav sort of make this a requirement.63 64 Those protocols have no concept of ownership. If we create a calendar then add65 references to events we don't own, either through subscription or adding a66 reference, when we sync the target device will just see a set of events all67 appearing to be owned by the user. They may go ahead and update such an event68 and we have the choice of preserving those changes as annotations or losing them69 on sync.70 71 We don't need to CREATE annotations on fetch but we do need to FETCH any owned72 by the current user.73 74 I. Single event fetch75 Assume fetch for read:76 77 1. Fetch event. BUT see note about shared annotations. The event may have78 appeared as the result of an annotation by another user. I don't think we79 can always know that to be the case - especially if we use other access80 methods (synchml, caldav)81 2. If event owned by someone else look for an annotation and build proxy if82 found. NOTE - the recurrence id is null for an annotation of a master event83 84 NOTE - an annotation of a master will not be reflected in any of the85 instances at this stage.86 87 If it's non recurring or we want master only we're done.88 89 If we're asked to retrieve overrides only we fetch all annotations with90 annotation.master = master. Note that is not the annotation target but the91 ultimate master event we are searching for.92 93 The possibilities:94 A. We're the owner95 1. Fetch any overrides we own with96 annotation.master = master and recurrence id not null97 2. If there are no overrides we're done98 3. Add proxied overrides to result and return.99 100 B. We're not the owner101 1. Fetch any overrides we own or owned by the master owner102 annotation.master = master and recurrence id not null103 2. If there are no overrides we're done104 3. Reconstruct proxies for each override and add to result.105 106 It appears the only difference is in the ownership clause.107 108 A third case is we are asked to return all instances associated with an event.109 This may be the case for export of an expanded recurring event. (or maybe110 fetch via caldav?)111 112 We should do the fetch above, then fetch all recurrence instances. Then113 114 For each instance:115 If there is an override create a proxy for the override and add to the result116 If there is no override, create a dummy annotation and proxy and add.117 118 Return the final result.119 120 II Fetching events (date range)121 122 1. Query for events which satisfy the requirements and filter down to events123 for which we have read access.124 125 2. Query for annotations we own in the range for which master is in126 the set of retrieved events which we don't own.127 128 What does this mean? We queried /public/Arts for events none of which we own.129 We query annotations for the same time range in the same calendar.130 131 3. Build proxies for overridden events132 133 If we got no recurring events in the set we're done so return.134 135 Otherwise:136 1. Fetch any instances in the date range137 138 2. If we were asked for master only return unique master events for which we139 have access140 141 3. Fetch any overrides with appropriate ownership142 a. in the same calendar143 b. with a master in the set of recurring masters we retrieved in step 1144 145 4. Iterate over instances creating dummies for non overridden and attaching146 overrides where found.147 --------------------------------------------------------------------------------148 Do we share annotations?149 For example:150 We have event A151 152 User P has annotation on A in their calendar. Is that visible to others? I153 believe so - though the referenced event may not be.154 155 User Q sees P:annotation(A) and annotates.156 --------------------------------------------------------------------------------157 Updating an event for which user has read access158 Having fetched it it is up to the client side to create a proxy to an159 unannotated event if the user wants to modify it. So the client does a fetch,160 if we have write access just update the event, if we have read access then161 add an annotation and proxy.162 163 Note that this turns the update into an addition of an annotation at first write.164 --------------------------------------------------------------------------------165 Updates to annotated events by the owner.166 167 Further complications arise if an annotated instance without an override is168 overridden by a user with write access. The original annotation is now invalid.169 First problem is to locate those annotations, second is to figure out what to170 do.171 172 We could add a status to the annotation indicating the underlying object changed.173 Should we retarget the annotation?174 175 In the web client we can warn the user. Send email?176 --------------------------------------------------------------------------------177 Access changed on event.178 If access changed to none the annotated event becomes invisible.179 180 If access changed to write there may still be an annotation attached. We may181 want to allow annotations of events for which user has mod access anyway182 52 -------------------------------------------------------------------------------- 183 53 Add an inbox calendar - do we want outbox? Put proxy in outbox? … … 293 163 user. 294 164 295 The mechanism might also be seen as a way of v isioning events.165 The mechanism might also be seen as a way of versioning events. 296 166 297 167 The approach is to create an event object which is empty and point it at the trunk/calendar3/webadmin/src/org/bedework/webadmin/event/PEGetFormattedEventsAction.java
r128 r145 59 59 import org.bedework.calfacade.CalFacadeDefs; 60 60 import org.bedework.calfacade.CalFacadeUtil; 61 import org.bedework.calfacade.filter.BwCreatorFilter; 61 62 import org.bedework.calfacade.filter.BwFilter; 62 63 import org.bedework.webadmin.PEAbstractAction; … … 109 110 private Collection getEvents(boolean alertEvent, PEActionForm form) 110 111 throws Throwable { 111 BwFilter filter = null;112 113 112 if (alertEvent) { 114 113 /* XXX create a filter which filters on the appropriate field - … … 123 122 } 124 123 125 return form.fetchSvci().getEvents(null, filter, fromDate, null, 124 BwCreatorFilter crefilter = new BwCreatorFilter(); 125 crefilter.setCreator(form.fetchSvci().getUser()); 126 127 return form.fetchSvci().getEvents(null, crefilter, fromDate, null, 126 128 CalFacadeDefs.retrieveRecurExpanded); 127 129 } trunk/calendar3/webcommon/src/org/bedework/webcommon/BwAbstractAction.java
r128 r145 56 56 57 57 // I only need this because request.getInitParameterNames doesn't work 58 import org.bedework.appcommon.BedeworkDefs; 58 59 import org.bedework.appcommon.UserAuthPar; 59 60 import org.bedework.calenv.CalEnv; … … 265 266 } 266 267 268 /* Set the view to the given name or the default if null. 269 * 270 * @return false for not found 271 */ 272 protected boolean setView(String name, 273 BwActionFormBase form) throws CalFacadeException { 274 CalSvcI svci = form.fetchSvci(); 275 276 if (name == null) { 277 name = svci.getUserPrefs().getPreferredView(); 278 } 279 280 if (name == null) { 281 form.getErr().emit("org.bedework.client.error.nodefaultview"); 282 return false; 283 } 284 285 if (!svci.setCurrentView(name)) { 286 form.getErr().emit("org.bedework.client.error.unknownview"); 287 return false; 288 } 289 290 form.setSelectionType(BedeworkDefs.selectionTypeView); 291 form.refreshIsNeeded(); 292 return true; 293 } 294 267 295 /** Method to retrieve an event. 268 296 * <p>Request parameters<ul> trunk/calendar3/webcommon/src/org/bedework/webcommon/BwActionFormBase.java
r131 r145 1799 1799 public void setEditEvent(BwEvent val) { 1800 1800 try { 1801 editEvent = val;1802 1803 1801 if (val == null) { 1802 val = new BwEventObj(); 1804 1803 getEventDates().setNewEvent(val, fetchSvci().getTimezones()); 1805 1804 } else { 1806 1805 getEventDates().setFromEvent(val, fetchSvci().getTimezones()); 1807 1806 } 1807 editEvent = val; 1808 1808 } catch (Throwable t) { 1809 1809 err.emit(t); trunk/calendar3/webcommon/src/org/bedework/webcommon/misc/SetSelectionAction.java
r131 r145 160 160 } 161 161 162 /* Do the view thing. This is the default 162 /* Do the view thing. This is the default action 163 163 */ 164 164 private String doView(HttpServletRequest request, 165 165 BwActionFormBase form) throws Throwable { 166 CalSvcI svci = form.fetchSvci(); 167 String name = getReqPar(request, "viewName"); 168 169 if (name == null) { 170 name = svci.getUserPrefs().getPreferredView(); 171 } 172 173 if (name == null) { 174 form.getErr().emit("org.bedework.client.error.nodefaultview"); 166 if (!setView(getReqPar(request, "viewName"), form)) { 175 167 return "noViewDef"; 176 168 } 177 169 178 if (!svci.setCurrentView(name)) {179 form.getErr().emit("org.bedework.client.error.unknownview");180 return "noViewDef";181 }182 183 form.setSelectionType(BedeworkDefs.selectionTypeView);184 form.refreshIsNeeded();185 170 return "success"; 186 171 }
