Changeset 585
- Timestamp:
- 06/14/06 09:29:21
- Files:
-
- trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java (modified) (2 diffs)
- trunk/calendar3/calsvci/src/org/bedework/calsvci/CalSvcI.java (modified) (1 diff)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/BwAbstractAction.java (modified) (4 diffs)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/subs/EndSubscribeAction.java (modified) (1 diff)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/subs/GetSubscriptionsAction.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java
r576 r585 1072 1072 } 1073 1073 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 1074 1087 public BwSubscription getSubscription(int id) throws CalFacadeException { 1075 1088 return dbi.getSubscription(id); … … 2447 2460 */ 2448 2461 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 } 2450 2471 dbi = new CalSvcDb(this, user); 2451 2472 } trunk/calendar3/calsvci/src/org/bedework/calsvci/CalSvcI.java
r520 r585 855 855 public abstract Collection getSubscriptions() throws CalFacadeException; 856 856 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 857 865 /** Fetch the subscription from the db given an id 858 866 * trunk/calendar3/webcommon/src/org/bedework/webcommon/BwAbstractAction.java
r551 r585 54 54 package org.bedework.webcommon; 55 55 56 // I only need this because request.getInitParameterNames doesn't work57 56 import org.bedework.appcommon.BedeworkDefs; 58 57 import org.bedework.calenv.CalEnv; … … 231 230 } 232 231 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 } 238 237 239 238 try { … … 246 245 } catch (CalFacadeAccessException cfae) { 247 246 form.getErr().emit("org.bedework.client.error.noaccess", "for that action"); 248 forward="no access";247 forward="noAccess"; 249 248 } catch (Throwable t) { 250 249 form.getErr().emit("org.bedework.client.error.exc", t.getMessage()); … … 573 572 } 574 573 575 form.setSubscriptions(svc.getSubscriptions());574 getSubscriptions(form); 576 575 577 576 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); 578 588 } 579 589 trunk/calendar3/webcommon/src/org/bedework/webcommon/subs/EndSubscribeAction.java
r550 r585 169 169 170 170 /* Refetch to tidy up */ 171 form.setSubscriptions(svc.getSubscriptions());171 getSubscriptions(form); 172 172 173 173 return forwardSuccess; trunk/calendar3/webcommon/src/org/bedework/webcommon/subs/GetSubscriptionsAction.java
r436 r585 68 68 * 69 69 * @author Mike Douglass douglm@rpi.edu 70 *71 * @deprecated Probably don't need this. Abstract action always sets the subscriptions.72 70 */ 73 71 public class GetSubscriptionsAction extends BwAbstractAction { … … 79 77 BwSession sess, 80 78 BwActionFormBase form) throws Throwable { 81 //CalSvcI svc = form.fetchSvci(); 82 83 //form.setSubscriptions(svc.getSubscriptions()); 79 getSubscriptions(form); 84 80 85 81 return "success";
