Changeset 756
- Timestamp:
- 07/12/06 16:13:24
- Files:
-
- freebusy/trunk/fbclient/src/org/bedework/fbclient/CalDavClient.java (modified) (1 diff)
- freebusy/trunk/fbclient/src/org/bedework/fbclient/FBUserInfo.java (modified) (8 diffs)
- freebusy/trunk/webclient/src/org/bedework/fbaggregator/AddUser.java (modified) (2 diffs)
- freebusy/trunk/webclient/src/org/bedework/fbaggregator/AllUsers.java (added)
- freebusy/trunk/webclient/src/org/bedework/fbaggregator/EditUser.java (modified) (1 diff)
- freebusy/trunk/webclient/src/org/bedework/fbaggregator/FBAggAction.java (modified) (4 diffs)
- freebusy/trunk/webclient/src/org/bedework/fbaggregator/FBAttendeeSet.java (modified) (2 diffs)
- freebusy/trunk/webclient/src/org/bedework/fbaggregator/FreeBusyAggregator.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freebusy/trunk/fbclient/src/org/bedework/fbclient/CalDavClient.java
r747 r756 98 98 resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), 99 99 r.getUser(), r.getPw(), 100 r.getHeaders(), 0,100 r.getHeaders(), r.getDepth(), 101 101 r.getContentType(), 102 102 r.getContentLength(), r.getContentBytes()); 103 103 } else { 104 104 resp.responseCode = cio.sendRequest(r.getMethod(), r.getUrl(), 105 r.getHeaders(), 0,105 r.getHeaders(), r.getDepth(), 106 106 r.getContentType(), r.getContentLength(), 107 107 r.getContentBytes()); freebusy/trunk/fbclient/src/org/bedework/fbclient/FBUserInfo.java
r730 r756 40 40 */ 41 41 public class FBUserInfo implements Comparable, Serializable { 42 /* Whose free busy? */ 43 private String account; 44 42 45 /* user id for server authentication. May be null if anon ok */ 43 46 private String authUser; 44 47 private String authPw; 45 48 46 /* Whose free busy? */47 private String account;48 49 49 private String host; 50 50 private int port; … … 53 53 54 54 private String url; 55 56 private String depth; // "0", "1", "infinity" 55 57 56 58 /** Constructor … … 63 65 * @param secure 64 66 * @param url 67 * @param depth 68 * @throws Throwable 65 69 */ 66 70 public FBUserInfo(String account, … … 70 74 int port, 71 75 boolean secure, 72 String url) { 76 String url, 77 String depth) throws Throwable { 73 78 this.account = account; 74 79 this.authUser = authUser; … … 78 83 this.secure = secure; 79 84 this.url = url; 85 setDepth(depth); 80 86 } 81 87 … … 186 192 } 187 193 194 /** 195 * @param val 196 * @throws Throwable 197 */ 198 public void setDepth(String val) throws Throwable { 199 if ("0".equals(val) || 200 "1".equals(val) || 201 "infinity".equals(val)) { 202 depth = val; 203 } else { 204 throw new Exception("Illegal value for depth"); 205 } 206 } 207 208 /** 209 * @return String 210 */ 211 public String getDepth() { 212 return depth; 213 } 214 188 215 /* ==================================================================== 189 216 * Object methods … … 219 246 220 247 public Object clone() { 221 FBUserInfo nfbui = new FBUserInfo(getAccount(), 222 getAuthUser(), 223 getAuthPw(), 224 getHost(), 225 getPort(), 226 getSecure(), 227 getUrl()); 228 229 return nfbui; 248 try { 249 FBUserInfo nfbui = new FBUserInfo(getAccount(), 250 getAuthUser(), 251 getAuthPw(), 252 getHost(), 253 getPort(), 254 getSecure(), 255 getUrl(), 256 getDepth()); 257 258 return nfbui; 259 } catch (Throwable t) { 260 throw new RuntimeException(t); 261 } 230 262 } 231 263 … … 247 279 sb.append(", url="); 248 280 sb.append(getUrl()); 281 sb.append(", depth="); 282 sb.append(getDepth()); 249 283 250 284 sb.append("]"); freebusy/trunk/webclient/src/org/bedework/fbaggregator/AddUser.java
r753 r756 24 24 } 25 25 26 int port = getIntReqPar(request, "port", 80); 27 28 boolean secure = false; 29 Boolean secureB = getBooleanReqPar(request, "secure"); 30 if (secureB != null) { 31 secure = secureB.booleanValue(); 26 String depth = getReqPar(request, "depth"); 27 if (depth == null) { 28 depth = "0"; 32 29 } 33 30 … … 36 33 getReqPar(request, "authPw"), 37 34 getReqPar(request, "host"), 38 port, 39 secure, 40 getReqPar(request, "url")); 35 getIntReqPar(request, "port", 80), 36 getBooleanReqPar(request, "secure", false), 37 getReqPar(request, "url"), 38 depth); 41 39 42 40 sess.getAllUsers().addInfo(ui); freebusy/trunk/webclient/src/org/bedework/fbaggregator/EditUser.java
r732 r756 80 80 ui.setSecure(getBooleanReqPar(request, "secure", ui.getSecure())); 81 81 82 sess.getAllUsers().updateInfo(ai); 83 82 84 return forwardSuccess; 83 85 } freebusy/trunk/webclient/src/org/bedework/fbaggregator/FBAggAction.java
r754 r756 27 27 28 28 import org.bedework.calenv.CalOptions; 29 import org.bedework.fbclient.FBUserInfo;30 29 31 30 import edu.rpi.sss.util.jsp.UtilAbstractAction; … … 246 245 private void initAttendees(FbAggSession s, 247 246 FbAggForm form) throws Throwable { 248 FBAttendeeSet all = new FBAttendeeSet(); 249 250 /* Fake up list of users */ 251 252 all.setName("all"); 247 FBAttendeeSet all = new AllUsers(); 248 253 249 254 250 /* … … 265 261 "/ucaldav/user/testuser02")); 266 262 */ 263 /* 267 264 all.addInfo(new FBUserInfo("douglm@rpi.edu", 268 265 "douglm", "bedework", … … 293 290 "www.bedework.org", 80, false, 294 291 "/ucaldav/user/boeing01")); 292 */ 295 293 /* 296 294 addInfo(new FBUserInfo("testuser02", "testuser02", "bedework", freebusy/trunk/webclient/src/org/bedework/fbaggregator/FBAttendeeSet.java
r735 r756 160 160 161 161 /** 162 * @param val FBAttendeeInfo 163 * @throws Throwable 164 */ 165 public void updateInfo(FBAttendeeInfo val) throws Throwable { 166 if (val == null) { 167 return; 168 } 169 170 removeInfo(val.getAttendee().getAccount()); 171 addInfo(val); 172 } 173 174 /** 162 175 * @param account - String account to remove 163 176 * @throws Throwable … … 165 178 public void removeInfo(String account) throws Throwable { 166 179 attendeeSet.remove(new FBAttendeeInfo(new FBUserInfo(account))); 180 } 181 182 /* ==================================================================== 183 * Protected methods 184 * ==================================================================== */ 185 186 /** Called by superclasses to add an entry to the internal set 187 * 188 * @param val FBUserInfo 189 * @throws Throwable 190 */ 191 protected void addUser(FBUserInfo val) throws Throwable { 192 if (val == null) { 193 return; 194 } 195 196 attendeeSet.add(new FBAttendeeInfo(val)); 167 197 } 168 198 freebusy/trunk/webclient/src/org/bedework/fbaggregator/FreeBusyAggregator.java
r752 r756 411 411 req.setContentType("text/xml"); 412 412 req.setMethod("REPORT"); 413 req. addHeader("Depth", "0");413 req.setDepth(ui.getDepth()); 414 414 415 415 req.addContentLine("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");
