Changeset 585

Show
Ignore:
Timestamp:
06/14/06 09:29:21
Author:
douglm
Message:

We were picking up the wrong preferences when manipulating subscriptions and view in the admin client.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java

    r576 r585  
    10721072  } 
    10731073 
     1074  public Collection getSubscriptions(BwUser user) throws CalFacadeException { 
     1075    Collection c = getUserPrefs(user).getSubscriptions(); 
     1076 
     1077    Iterator it = c.iterator(); 
     1078    while (it.hasNext()) { 
     1079      BwSubscription sub = (BwSubscription)it.next(); 
     1080 
     1081      getSubCalendar(sub); 
     1082    } 
     1083 
     1084    return c; 
     1085  } 
     1086 
    10741087  public BwSubscription getSubscription(int id) throws CalFacadeException { 
    10751088    return dbi.getSubscription(id); 
     
    24472460         */ 
    24482461        dbi.close(); 
    2449         BwUser user = cali.getUser(pars.getUser()); 
     2462 
     2463        BwUser user; 
     2464 
     2465        if (currentCalSuite != null) { 
     2466          // Use this user 
     2467          user = currentCalSuite.getGroup().getOwner(); 
     2468        } else { 
     2469          user = cali.getUser(pars.getUser()); 
     2470        } 
    24502471        dbi = new CalSvcDb(this, user); 
    24512472      } 
  • trunk/calendar3/calsvci/src/org/bedework/calsvci/CalSvcI.java

    r520 r585  
    855855  public abstract Collection getSubscriptions() throws CalFacadeException; 
    856856 
     857  /** Get the given users subscription. 
     858   * 
     859   * @param user     BwUser 
     860   * @return Collection of subscriptions 
     861   * @throws CalFacadeException 
     862   */ 
     863  public abstract Collection getSubscriptions(BwUser user) throws CalFacadeException; 
     864 
    857865  /** Fetch the subscription from the db given an id 
    858866   * 
  • trunk/calendar3/webcommon/src/org/bedework/webcommon/BwAbstractAction.java

    r551 r585  
    5454package org.bedework.webcommon; 
    5555 
    56 // I only need this because request.getInitParameterNames doesn't work 
    5756import org.bedework.appcommon.BedeworkDefs; 
    5857import org.bedework.calenv.CalEnv; 
     
    231230    } 
    232231 
    233     /* Set up or refresh frequently used information, 
    234      */ 
    235     CalSvcI svc = form.fetchSvci(); 
    236  
    237     form.setSubscriptions(svc.getSubscriptions()); 
     232    if (!getPublicAdmin(form)) { 
     233      /* Set up or refresh frequently used information, 
     234       */ 
     235      getSubscriptions(form); 
     236    } 
    238237 
    239238    try { 
     
    246245    } catch (CalFacadeAccessException cfae) { 
    247246      form.getErr().emit("org.bedework.client.error.noaccess", "for that action"); 
    248       forward="noaccess"; 
     247      forward="noAccess"; 
    249248    } catch (Throwable t) { 
    250249      form.getErr().emit("org.bedework.client.error.exc", t.getMessage()); 
     
    573572    } 
    574573 
    575     form.setSubscriptions(svc.getSubscriptions()); 
     574    getSubscriptions(form); 
    576575 
    577576    return result; 
     577  } 
     578 
     579  /** Implant current subscriptions in the form. 
     580   * 
     581   * @param form 
     582   * @throws Throwable 
     583   */ 
     584  public void getSubscriptions(BwActionFormBase form) throws Throwable { 
     585    CalSvcI svc = form.fetchSvci(); 
     586    Collection subs = svc.getSubscriptions(); 
     587    form.setSubscriptions(subs); 
    578588  } 
    579589 
  • trunk/calendar3/webcommon/src/org/bedework/webcommon/subs/EndSubscribeAction.java

    r550 r585  
    169169 
    170170    /* Refetch to tidy up */ 
    171     form.setSubscriptions(svc.getSubscriptions()); 
     171    getSubscriptions(form); 
    172172 
    173173    return forwardSuccess; 
  • trunk/calendar3/webcommon/src/org/bedework/webcommon/subs/GetSubscriptionsAction.java

    r436 r585  
    6868 * 
    6969 * @author Mike Douglass   douglm@rpi.edu 
    70  * 
    71  * @deprecated  Probably don't need this. Abstract action always sets the subscriptions. 
    7270 */ 
    7371public class GetSubscriptionsAction extends BwAbstractAction { 
     
    7977                         BwSession sess, 
    8078                         BwActionFormBase form) throws Throwable { 
    81     //CalSvcI svc = form.fetchSvci(); 
    82  
    83     //form.setSubscriptions(svc.getSubscriptions()); 
     79    getSubscriptions(form); 
    8480 
    8581    return "success";