Changeset 145

Show
Ignore:
Timestamp:
02/09/06 23:52:00
Author:
douglm
Message:

Fixed an exception

Admin client now limits retrieved events to group owner so you'll probably not see anything as the default user

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/calendar3/calFacade/src/org/bedework/calfacade/filter/BwEntityFilter.java

    r2 r145  
    4242  protected Collection entities; 
    4343 
    44   /** True if this is a single entity. Allows query generators todistinguish 
     44  /** True if this is a single entity. Allows query generators to distinguish 
    4545   * between "=" and "IN" 
    4646   * 
  • trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java

    r128 r145  
    14261426    TreeSet ts = new TreeSet(); 
    14271427 
    1428     if (pars.getPublicAdmin() || (sub != null)) { 
     1428//    if (pars.getPublicAdmin() || (sub != null)) { 
     1429    if (sub != null) { 
    14291430      BwCalendar cal = null; 
    14301431      if (sub != null) { 
  • trunk/calendar3/docs/todo.txt

    r84 r145  
    44-------------------------------------------------------------------------------- 
    55-------------------------------------------------------------------------------- 
    6 Views not sorted in selection list 
    7 -------------------------------------------------------------------------------- 
    8 Try a change and see if we get mailed. 
     6-------------------------------------------------------------------------------- 
     7When duplicating event - set creator 
    98-------------------------------------------------------------------------------- 
    109Web-client - ensure no unexpected data modifications. 
     
    1716Floating times should be as the result of an explicit user request. 
    1817-------------------------------------------------------------------------------- 
    19 eventIcal 
    20 Need to use action to deliver ical - not stylesheet 
    2118-------------------------------------------------------------------------------- 
    2219What was I trying to do with the default access stuff in the principal? 
     
    3431subclass for BwEventObj and BwEventAnnotation. 
    3532-------------------------------------------------------------------------------- 
    36 FiltersRule needs to add Inbox 
    37 CalintfImpl and FiltersRule should use some joint code to create users. 
    38 Try init of empty system then create users through Calintf? 
    3933-------------------------------------------------------------------------------- 
    4034lazy="false" is set on calendar objects. 
     
    5650-------------------------------------------------------------------------------- 
    5751Notes on annotations and overrides and fetching events. 
    58 Allowing users to annotate shared events introduces enormous complexity to the 
    59 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 user 
    62 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 add 
    65 references to events we don't own, either through subscription or adding a 
    66 reference, when we sync the target device will just see a set of events all 
    67 appearing to be owned by the user. They may go ahead and update such an event 
    68 and we have the choice of preserving those changes as annotations or losing them 
    69 on sync. 
    70  
    71 We don't need to CREATE annotations on fetch but we do need to FETCH any owned 
    72 by the current user. 
    73  
    74 I. Single event fetch 
    75 Assume fetch for read: 
    76  
    77 1. Fetch event. BUT see note about shared annotations. The event may have 
    78    appeared as the result of an annotation by another user. I don't think we 
    79    can always know that to be the case - especially if we use other access 
    80    methods (synchml, caldav) 
    81 2. If event owned by someone else look for an annotation and build proxy if 
    82    found. NOTE - the recurrence id is null for an annotation of a master event 
    83  
    84 NOTE - an  annotation of a master will not be reflected in any of the 
    85 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 with 
    90 annotation.master = master. Note that is not the annotation target but the 
    91 ultimate master event we are searching for. 
    92  
    93 The possibilities: 
    94 A. We're the owner 
    95   1. Fetch any overrides we own with 
    96         annotation.master = master and recurrence id not null 
    97   2. If there are no overrides we're done 
    98   3. Add proxied overrides to result and return. 
    99  
    100 B. We're not the owner 
    101   1. Fetch any overrides we own or owned by the master owner 
    102         annotation.master = master and recurrence id not null 
    103   2. If there are no overrides we're done 
    104   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 maybe 
    110 fetch via caldav?) 
    111  
    112 We should do the fetch above, then fetch all recurrence instances. Then 
    113  
    114 For each instance: 
    115   If there is an override create a proxy for the override and add to the result 
    116   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 events 
    123    for which we have read access. 
    124  
    125 2. Query for annotations we own in the range for which master is in 
    126    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 events 
    132  
    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 range 
    137  
    138 2. If we were asked for master only return unique master events for which we 
    139    have access 
    140  
    141 3. Fetch any overrides with appropriate ownership 
    142       a. in the same calendar 
    143       b. with a master in the set of recurring masters we retrieved in step 1 
    144  
    145 4. Iterate over instances creating dummies for non overridden and attaching 
    146    overrides where found. 
    147 -------------------------------------------------------------------------------- 
    148 Do we share annotations? 
    149 For example: 
    150 We have event A 
    151  
    152 User P has annotation on A in their calendar. Is that visible to others? I 
    153 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 access 
    158 Having fetched it it is up to the client side to create a proxy to an 
    159 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 then 
    161 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 is 
    168 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 to 
    170 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 may 
    181 want to allow annotations of events for which user has mod access anyway 
    18252-------------------------------------------------------------------------------- 
    18353Add an inbox calendar - do we want outbox? Put proxy in outbox? 
     
    293163user. 
    294164 
    295 The mechanism might also be seen as a way of visioning events. 
     165The mechanism might also be seen as a way of versioning events. 
    296166 
    297167The 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  
    5959import org.bedework.calfacade.CalFacadeDefs; 
    6060import org.bedework.calfacade.CalFacadeUtil; 
     61import org.bedework.calfacade.filter.BwCreatorFilter; 
    6162import org.bedework.calfacade.filter.BwFilter; 
    6263import org.bedework.webadmin.PEAbstractAction; 
     
    109110  private Collection getEvents(boolean alertEvent, PEActionForm form) 
    110111          throws Throwable { 
    111     BwFilter filter = null; 
    112  
    113112    if (alertEvent) { 
    114113      /* XXX create a filter which filters on the appropriate field - 
     
    123122    } 
    124123 
    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, 
    126128                                      CalFacadeDefs.retrieveRecurExpanded); 
    127129  } 
  • trunk/calendar3/webcommon/src/org/bedework/webcommon/BwAbstractAction.java

    r128 r145  
    5656 
    5757// I only need this because request.getInitParameterNames doesn't work 
     58import org.bedework.appcommon.BedeworkDefs; 
    5859import org.bedework.appcommon.UserAuthPar; 
    5960import org.bedework.calenv.CalEnv; 
     
    265266  } 
    266267 
     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 
    267295  /** Method to retrieve an event. 
    268296   * <p>Request parameters<ul> 
  • trunk/calendar3/webcommon/src/org/bedework/webcommon/BwActionFormBase.java

    r131 r145  
    17991799  public void setEditEvent(BwEvent val) { 
    18001800    try { 
    1801       editEvent = val; 
    1802  
    18031801      if (val == null) { 
     1802        val = new BwEventObj(); 
    18041803        getEventDates().setNewEvent(val, fetchSvci().getTimezones()); 
    18051804      } else { 
    18061805        getEventDates().setFromEvent(val, fetchSvci().getTimezones()); 
    18071806      } 
     1807      editEvent = val; 
    18081808    } catch (Throwable t) { 
    18091809      err.emit(t); 
  • trunk/calendar3/webcommon/src/org/bedework/webcommon/misc/SetSelectionAction.java

    r131 r145  
    160160  } 
    161161 
    162   /* Do the view thing. This is the default 
     162  /* Do the view thing. This is the default action 
    163163   */ 
    164164  private String doView(HttpServletRequest request, 
    165165                        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)) { 
    175167      return "noViewDef"; 
    176168    } 
    177169 
    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(); 
    185170    return "success"; 
    186171  }