r7477 - dumbhippo/trunk/server/src/com/dumbhippo/server/dm



Author: otaylor
Date: 2008-05-12 12:55:08 -0500 (Mon, 12 May 2008)
New Revision: 7477

Modified:
   dumbhippo/trunk/server/src/com/dumbhippo/server/dm/GroupRevisionBlockDMO.java
Log:
- Make GroupRevisionBlockDMO.chatId override the parent so we can unconditionally
  return the chat ID rather than having it depend on the membership status
  of the viewer
- Add GroupRevisionBlockDMO.editLink property


Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/dm/GroupRevisionBlockDMO.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/dm/GroupRevisionBlockDMO.java	2008-05-12 17:12:51 UTC (rev 7476)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/dm/GroupRevisionBlockDMO.java	2008-05-12 17:55:08 UTC (rev 7477)
@@ -2,6 +2,7 @@
 
 import com.dumbhippo.dm.annotations.DMO;
 import com.dumbhippo.dm.annotations.DMProperty;
+import com.dumbhippo.dm.annotations.PropertyType;
 import com.dumbhippo.dm.store.StoreKey;
 import com.dumbhippo.server.blocks.GroupRevisionBlockView;
 
@@ -25,4 +26,17 @@
 	public StoreKey<?,?> getVisibilityDelegate() {
 		return getGroup().getStoreKey();
 	}
+	
+	@Override
+	public String getChatId() {
+		// GroupBlockView.getChatId() is viewer dependent. Rather than adding
+		// an uncached property here, we'll just sort out whether the viewer 
+		// can chat in the client
+		return ((GroupRevisionBlockView)blockView).getBlock().getId();
+	}
+	
+	@DMProperty(defaultInclude=true, type=PropertyType.URL)
+	public String getEditLink() {
+		return "/group-account?group=" + ((GroupRevisionBlockView)blockView).getGroupView().getGroup().getId();
+	}
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]