[kune-commits] r961 - in trunk: . img/icons src/main/java/org/ourproject/kune/app/public/css src/main/java/org/ourproject/kune/platf/client/dto src/main/java/org/ourproject/kune/platf/client/rpc src/main/java/org/ourproject/kune/platf/client/services src/main/java/org/ourproject/kune/platf/client/ui src/main/java/org/ourproject/kune/platf/server/domain src/main/java/org/ourproject/kune/platf/server/rpc src/main/java/org/ourproject/kune/workspace/client/entitylogo src/main/java/org/ourproject/kune/workspace/client/i18n src/main/java/org/ourproject/kune/workspace/client/site/rpc src/main/java/org/ourproject/kune/workspace/client/socialnet src/main/resources

vjrj vjrj at ourproject.org
Sat Nov 22 05:29:38 CET 2008


Author: vjrj
Date: 2008-11-22 05:29:34 +0100 (Sat, 22 Nov 2008)
New Revision: 961

Added:
   trunk/src/main/java/org/ourproject/kune/platf/client/dto/SocialNetworkVisibilityDTO.java
   trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserBuddiesVisibilityDTO.java
   trunk/src/main/java/org/ourproject/kune/platf/server/domain/SocialNetworkVisibility.java
   trunk/src/main/java/org/ourproject/kune/platf/server/domain/UserBuddiesVisibility.java
Modified:
   trunk/img/icons/person.svg
   trunk/pom.xml
   trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
   trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
   trunk/src/main/java/org/ourproject/kune/platf/client/dto/SocialNetworkResultDTO.java
   trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserBuddiesDataDTO.java
   trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserSimpleDTO.java
   trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupService.java
   trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupServiceAsync.java
   trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractSearcherPanel.java
   trunk/src/main/java/org/ourproject/kune/platf/server/domain/SocialNetwork.java
   trunk/src/main/java/org/ourproject/kune/platf/server/domain/User.java
   trunk/src/main/java/org/ourproject/kune/platf/server/rpc/GroupRPC.java
   trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SocialNetworkRPC.java
   trunk/src/main/java/org/ourproject/kune/platf/server/rpc/UserRPC.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/site/rpc/UserService.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/site/rpc/UserServiceAsync.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryView.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
   trunk/src/main/resources/dozerBeanMapping.xml
Log:
Incomplete - task SocialNet visibility 

Incomplete - task Use of new ActionDescriptionClass in SocialNetwork 

Pagination bug in translator and searcher fixed

Modified: trunk/img/icons/person.svg
===================================================================
--- trunk/img/icons/person.svg	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/img/icons/person.svg	2008-11-22 04:29:34 UTC (rev 961)
@@ -687,5 +687,46 @@
          id="path2503"
          sodipodi:nodetypes="csssc" />
     </g>
+    <g
+       id="g2476"
+       transform="translate(12.331755,43.161141)">
+      <rect
+         transform="scale(-1,-1)"
+         y="-21.428276"
+         x="-645.06616"
+         height="55.132187"
+         width="45.132187"
+         id="rect2474"
+         style="opacity:0.8;fill:#f9f9f9;fill-opacity:1;fill-rule:nonzero;stroke:#e6e6e6;stroke-width:0.86781228;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+      <g
+         inkscape:export-ydpi="90"
+         inkscape:export-xdpi="90"
+         inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/persons/person2-32.png"
+         transform="matrix(0.3764923,0,0,0.3764923,460.38508,-48.779868)"
+         id="g2466">
+        <path
+           inkscape:export-ydpi="90"
+           inkscape:export-xdpi="90"
+           inkscape:export-filename="/home/vjrj/proyectos/ourproject.org/kune/svn/trunk/img/group-def-icon.png"
+           sodipodi:type="arc"
+           style="opacity:1;fill:#eeaaff;fill-opacity:1;fill-rule:nonzero;stroke:#954f2c;stroke-width:1.63299322;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           id="path2468"
+           sodipodi:cx="-55.5"
+           sodipodi:cy="242.36218"
+           sodipodi:rx="12.5"
+           sodipodi:ry="12"
+           d="M -43,242.36218 A 12.5,12 0 1 1 -68,242.36218 A 12.5,12 0 1 1 -43,242.36218 z"
+           transform="matrix(3.1844753,0,0,3.3202165,608.65933,-692.76155)" />
+        <path
+           id="path2470"
+           d="M 431.92095,72.158845 C 421.73175,72.158845 411.49371,76.003865 403.72508,83.779605 C 388.30176,99.217125 388.19614,124.14781 403.39336,139.72526 C 401.23073,130.24809 403.98472,119.87609 411.35455,112.49948 C 422.75019,101.09333 441.09171,101.09333 452.48735,112.49948 C 459.85713,119.87609 462.61117,130.24809 460.44854,139.72526 C 475.64581,124.14776 475.54025,99.217125 460.11683,83.779605 C 452.34825,76.003865 442.11016,72.158845 431.92095,72.158845 z"
+           style="fill:#dbdee3;fill-opacity:1;fill-rule:nonzero;stroke:#954f2c;stroke-width:5.30990267;stroke-linecap:butt;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+        <path
+           style="fill:#ff9955;fill-opacity:1;fill-rule:nonzero;stroke:#784421;stroke-width:5.30990171;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+           d="M 454.05116,106.46307 C 449.38897,113.33396 426.14686,121.7791 418.78848,114.45323 C 411.51844,107.21527 411.5378,95.415805 418.78848,88.158448 C 426.03916,80.901092 437.80837,80.901094 445.05905,88.158453 C 452.30973,95.415815 449.3126,98.760105 454.05116,106.46307 z"
+           id="path2472"
+           sodipodi:nodetypes="csssc" />
+      </g>
+    </g>
   </g>
 </svg>

Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/pom.xml	2008-11-22 04:29:34 UTC (rev 961)
@@ -379,8 +379,8 @@
         <version>2.0-beta23</version>
         <configuration>
           <logLevel>INFO</logLevel>
-          <style>OBF</style>
-          <!-- <style>PRETTY</style> -->
+          <style>PRETTY</style>
+          <!-- <style>OBF</style> -->
           <runTarget>
             org.ourproject.kune.app.Kune/Kune.html
           </runTarget>

Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/all.css	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css	2008-11-22 04:29:34 UTC (rev 961)
@@ -41,4 +41,4 @@
     padding: 1px 0px 1px 1px;
     text-decoration:none;
 }
-*/.k-textlinethrough{text-decoration:line-through;color:red;}.k-textnormal{text-decoration:inherit;color:green;}.k-textunderline{text-decoration:underline;color:gray;}.x-tool-kmenu{background-position:0 -75px;}.x-tool-kmenu-over{background-position:-15px -75px;}.k-border-openbox{border-bottom:1px #D0D0D0 solid;border-right:1px #D0D0D0 solid;border-left:1px #D0D0D0 solid;}/* SiteToastMessages */.k-stm-info-icon{background-image:url(img/info.gif)!important;}.k-stm-imp-icon{background-image:url(img/alert.gif)!important;}.k-stm-verimp-icon{background-image:url(img/important.gif)!important;}.k-stm-error-icon{background-image:url(img/error.gif)!important;}.k-error-tb{background:#FFB380 none repeat scroll 0 50%;color:#250;}.k-infod-head{font-size:108%;margin-bottom:10px;}.gwt-DisclosurePanel{}.gwt-DisclosurePanel-open{}.gwt-DisclosurePanel-closed{}.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td{text-decoration:none;/* Remove underline from header */color:#000;cursor:pointer;cursor:hand;}.gwt-DisclosurePanel .content{border-left:3px solid #e8eef7;padding:4px 0 4px 8px;margin-left:6px;}
\ No newline at end of file
+*/.k-textlinethrough{text-decoration:line-through;color:red;}.k-textnormal{text-decoration:inherit;color:green;}.k-textunderline{text-decoration:underline;color:gray;}.x-tool-kmenu{background-position:0 -75px;}.x-tool-kmenu-over{background-position:-15px -75px;}.k-border-openbox{border-bottom:1px #D0D0D0 solid;border-right:1px #D0D0D0 solid;border-left:1px #D0D0D0 solid;}/* SiteToastMessages */.k-stm-info-icon{background-image:url(img/info.gif)!important;}.k-stm-imp-icon{background-image:url(img/alert.gif)!important;}.k-stm-verimp-icon{background-image:url(img/important.gif)!important;}.k-stm-error-icon{background-image:url(img/error.gif)!important;}.k-error-tb{background:#FFB380 none repeat scroll 0 50%;color:#250;}.k-infod-head{font-size:108%;margin-bottom:10px;}.gwt-DisclosurePanel{}.gwt-DisclosurePanel-open{}.gwt-DisclosurePanel-closed{}.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td{text-decoration:none;/* Remove underline from header */color:#000;cursor:pointer;cursor:hand;}.gwt-DisclosurePanel .content{border-left:3px solid #e8eef7;padding:4px 0 4px 8px;margin-left:6px;}.k-bsp-buddie{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-bsp-buddie td{padding:2px 3px;}
\ No newline at end of file

Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css	2008-11-22 04:29:34 UTC (rev 961)
@@ -784,3 +784,13 @@
   margin-left: 6px;
 }
 
+.k-bsp-buddie {
+    background: #FAFAFA none repeat scroll 0% 50%;
+    border: 1px solid #EBEBEB;
+    padding: 3px;
+    margin: 3px;
+}
+
+.k-bsp-buddie td {
+  padding: 2px 3px 2px 3px;
+}
\ No newline at end of file

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/SocialNetworkResultDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/SocialNetworkResultDTO.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/SocialNetworkResultDTO.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -24,10 +24,12 @@
 public class SocialNetworkResultDTO implements IsSerializable {
 
     SocialNetworkDTO groupMembers;
+    SocialNetworkVisibilityDTO socialNetworkVisibilityDTO;
 
     ParticipationDataDTO userParticipation;
 
     UserBuddiesDataDTO userBuddies;
+    UserBuddiesVisibilityDTO userBuddiesVisibilityDTO;
 
     AccessRightsDTO groupRights;
 
@@ -51,10 +53,18 @@
         return groupRights;
     }
 
+    public SocialNetworkVisibilityDTO getSocialNetworkVisibilityDTO() {
+        return socialNetworkVisibilityDTO;
+    }
+
     public UserBuddiesDataDTO getUserBuddies() {
         return userBuddies;
     }
 
+    public UserBuddiesVisibilityDTO getUserBuddiesVisibilityDTO() {
+        return userBuddiesVisibilityDTO;
+    }
+
     public ParticipationDataDTO getUserParticipation() {
         return userParticipation;
     }
@@ -67,10 +77,18 @@
         this.groupRights = groupRights;
     }
 
+    public void setSocialNetworkVisibilityDTO(SocialNetworkVisibilityDTO socialNetworkVisibilityDTO) {
+        this.socialNetworkVisibilityDTO = socialNetworkVisibilityDTO;
+    }
+
     public void setUserBuddies(UserBuddiesDataDTO userBuddies) {
         this.userBuddies = userBuddies;
     }
 
+    public void setUserBuddiesVisibilityDTO(UserBuddiesVisibilityDTO userBuddiesVisibilityDTO) {
+        this.userBuddiesVisibilityDTO = userBuddiesVisibilityDTO;
+    }
+
     public void setUserParticipation(final ParticipationDataDTO userParticipation) {
         this.userParticipation = userParticipation;
     }

Added: trunk/src/main/java/org/ourproject/kune/platf/client/dto/SocialNetworkVisibilityDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/SocialNetworkVisibilityDTO.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/SocialNetworkVisibilityDTO.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.platf.client.dto;
+
+public enum SocialNetworkVisibilityDTO {
+    anyone, onlymembers, onlyadmins
+}

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserBuddiesDataDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserBuddiesDataDTO.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserBuddiesDataDTO.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -35,6 +35,15 @@
         otherExternalBuddies = 0;
     }
 
+    public boolean contains(String shortName) {
+        for (UserSimpleDTO buddie : buddies) {
+            if (buddie.getShortName().equals(shortName)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
     public List<UserSimpleDTO> getBuddies() {
         return buddies;
     }

Added: trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserBuddiesVisibilityDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserBuddiesVisibilityDTO.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserBuddiesVisibilityDTO.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.platf.client.dto;
+
+public enum UserBuddiesVisibilityDTO {
+    anyone, yourbuddies, onlyyou
+}

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserSimpleDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserSimpleDTO.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserSimpleDTO.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -28,6 +28,8 @@
     private I18nLanguageDTO language;
     private I18nCountryDTO country;
     private TimeZoneDTO timezone;
+    private boolean hasLogo;
+    private StateToken stateToken;
 
     public UserSimpleDTO() {
         this(null, null, null, null, null);
@@ -72,6 +74,10 @@
         return country;
     }
 
+    public boolean getHasLogo() {
+        return hasLogo;
+    }
+
     public Long getId() {
         return id;
     }
@@ -88,6 +94,10 @@
         return shortName;
     }
 
+    public StateToken getStateToken() {
+        return stateToken;
+    }
+
     public TimeZoneDTO getTimezone() {
         return timezone;
     }
@@ -101,10 +111,18 @@
         return result;
     }
 
+    public boolean hasLogo() {
+        return hasLogo;
+    }
+
     public void setCountry(final I18nCountryDTO country) {
         this.country = country;
     }
 
+    public void setHasLogo(boolean hasLogo) {
+        this.hasLogo = hasLogo;
+    }
+
     public void setId(final Long id) {
         this.id = id;
     }
@@ -121,10 +139,15 @@
         this.shortName = shortName;
     }
 
+    public void setStateToken(StateToken stateToken) {
+        this.stateToken = stateToken;
+    }
+
     public void setTimezone(final TimeZoneDTO timezone) {
         this.timezone = timezone;
     }
 
+    @Override
     public String toString() {
         return "UserSimpleDTO(" + shortName + ")";
     }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupService.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupService.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -20,6 +20,7 @@
 package org.ourproject.kune.platf.client.rpc;
 
 import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.dto.SocialNetworkVisibilityDTO;
 import org.ourproject.kune.platf.client.dto.StateToken;
 import org.ourproject.kune.platf.client.errors.DefaultException;
 
@@ -36,4 +37,6 @@
 
     GroupDTO setGroupFullLogo(String userHash, StateToken token);
 
+    void setSocialNetworkVisibility(String userHash, StateToken groupToken, SocialNetworkVisibilityDTO visibility);
+
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupServiceAsync.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupServiceAsync.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupServiceAsync.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -20,6 +20,7 @@
 package org.ourproject.kune.platf.client.rpc;
 
 import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.dto.SocialNetworkVisibilityDTO;
 import org.ourproject.kune.platf.client.dto.StateToken;
 
 import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -35,4 +36,7 @@
 
     void setGroupFullLogo(String userHash, StateToken token, AsyncCallback<GroupDTO> asyncCallback);
 
+    void setSocialNetworkVisibility(String userHash, StateToken token, SocialNetworkVisibilityDTO visibility,
+            AsyncCallback<?> asyncCallback);
+
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -335,9 +335,9 @@
             public GroupMembersSummary create() {
                 final GroupMembersSummaryPresenter presenter = new GroupMembersSummaryPresenter(
                         $(I18nUITranslationService.class), $(StateManager.class), $(ImageUtils.class),
-                        $(Session.class), $$(SocialNetworkServiceAsync.class), $$(GroupLiveSearcher.class),
-                        $(WsThemePresenter.class), $$(ChatEngine.class), $(GroupActionRegistry.class),
-                        $(ActionGroupSummaryToolbar.class));
+                        $(Session.class), $$(SocialNetworkServiceAsync.class), $$(GroupServiceAsync.class),
+                        $$(GroupLiveSearcher.class), $(WsThemePresenter.class), $$(ChatEngine.class),
+                        $(GroupActionRegistry.class), $(ActionGroupSummaryToolbar.class));
                 final GroupMembersSummaryView view = new GroupMembersSummaryPanel(presenter,
                         $(I18nUITranslationService.class), $(WorkspaceSkeleton.class), $(
                                 ActionGroupSummaryToolbar.class).getView());
@@ -362,8 +362,9 @@
             @Override
             public BuddiesSummary create() {
                 final BuddiesSummaryPresenter presenter = new BuddiesSummaryPresenter($(StateManager.class),
-                        $(Session.class), $(UserActionRegistry.class), $(I18nTranslationService.class),
-                        $$(ChatEngine.class), $(ActionBuddiesSummaryToolbar.class));
+                        $(Session.class), $$(UserServiceAsync.class), $(UserActionRegistry.class),
+                        $(I18nTranslationService.class), $$(ChatEngine.class), $(ActionBuddiesSummaryToolbar.class),
+                        $$(FileDownloadUtils.class));
                 final BuddiesSummaryPanel panel = new BuddiesSummaryPanel(presenter, $(WorkspaceSkeleton.class),
                         $(I18nTranslationService.class), $(ActionManager.class),
                         $(ActionBuddiesSummaryToolbar.class).getView());

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractSearcherPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractSearcherPanel.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractSearcherPanel.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -64,34 +64,6 @@
         grid.setStripeRows(true);
     }
 
-    // protected void createPagingToolbar(final Store store, final GridPanel
-    // grid) {
-    // final PagingToolbar pag = new PagingToolbar(store);
-    // pag.setPageSize(PAGINATION_SIZE);
-    // pag.setDisplayInfo(true);
-    // pag.setDisplayMsg(i18n.tWithNT("Displaying results {0} - {1} of
-    // {2}",
-    // "Respect {} values in translations, "
-    // + "these will produce: 'Displaying results 1 - 25 of 95465' for
-    // instance"));
-    // pag.setEmptyMsg(i18n.t("No results to display"));
-    // pag.setAfterPageText(i18n.tWithNT("of {0}", "Used to show multiple
-    // results: '1 of 30'"));
-    // pag.setBeforePageText(i18n.t("Page"));
-    // pag.setFirstText(i18n.t("First Page"));
-    // pag.setLastText(i18n.t("Last Page"));
-    // pag.setNextText(i18n.t("Next Page"));
-    // pag.setPrevText(i18n.t("Previous Page"));
-    // pag.setRefreshText(i18n.t("Refresh"));
-    // grid.setBottomToolbar(pag);
-    //
-    // grid.addListener(new PanelListenerAdapter() {
-    // public void onRender(final Component component) {
-    // store.load(0, PAGINATION_SIZE);
-    // }
-    // });
-    // }
-
     protected Store createStore(final FieldDef[] fieldDefs, final String url, final String id) {
         final JsonReader reader = new JsonReader(new RecordDef(fieldDefs));
         reader.setRoot("list");
@@ -102,8 +74,7 @@
     }
 
     protected void query(final Store store, final GridPanel grid, final String query) {
-        final UrlParam[] newParams = new UrlParam[] { new UrlParam("query", query), new UrlParam("start", 0),
-                new UrlParam("limit", PAGINATION_SIZE) };
+        final UrlParam[] newParams = new UrlParam[] { new UrlParam("query", query) };
         store.setBaseParams(newParams);
         store.load(0, PAGINATION_SIZE);
         // see bind/unbind in:

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/domain/SocialNetwork.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/SocialNetwork.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/SocialNetwork.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -39,9 +39,12 @@
     @OneToOne(cascade = CascadeType.ALL)
     GroupList pendingCollaborators;
 
+    SocialNetworkVisibility visibility;
+
     public SocialNetwork() {
         accessLists = new AccessLists();
         pendingCollaborators = new GroupList();
+        visibility = SocialNetworkVisibility.anyone;
     }
 
     public void addAdmin(final Group group) {
@@ -72,6 +75,10 @@
         return pendingCollaborators;
     }
 
+    public SocialNetworkVisibility getVisibility() {
+        return visibility;
+    }
+
     public boolean isAdmin(final Group group) {
         return accessLists.getAdmins().includes(group);
     }
@@ -116,6 +123,11 @@
         this.pendingCollaborators = pendingCollaborators;
     }
 
+    public void setVisibility(SocialNetworkVisibility visibility) {
+        this.visibility = visibility;
+    }
+
+    @Override
     public String toString() {
         return "SocialNetwork[accessList: " + accessLists + "; pendingsCollabs: " + pendingCollaborators + "]";
     }

Added: trunk/src/main/java/org/ourproject/kune/platf/server/domain/SocialNetworkVisibility.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/SocialNetworkVisibility.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/SocialNetworkVisibility.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.platf.server.domain;
+
+public enum SocialNetworkVisibility {
+    anyone, onlymembers, onlyadmins
+}

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/domain/User.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/User.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/User.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -30,6 +30,7 @@
 import javax.persistence.ManyToOne;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
+import javax.persistence.Transient;
 
 import org.hibernate.search.annotations.DocumentId;
 import org.hibernate.search.annotations.Field;
@@ -40,6 +41,7 @@
 import org.hibernate.validator.Length;
 import org.hibernate.validator.NotNull;
 import org.hibernate.validator.Pattern;
+import org.ourproject.kune.platf.client.dto.StateToken;
 
 import com.google.inject.name.Named;
 import com.wideplay.warp.persist.dao.Finder;
@@ -100,6 +102,8 @@
     @OneToOne(cascade = CascadeType.ALL)
     private final CustomProperties customProperties;
 
+    private UserBuddiesVisibility buddiesVisibility;
+
     public User() {
         this(null, null, null, null, null, null, null);
     }
@@ -115,6 +119,7 @@
         this.country = country;
         this.timezone = timezone;
         customProperties = new CustomProperties();
+        buddiesVisibility = UserBuddiesVisibility.anyone;
     }
 
     @Finder(query = "from User")
@@ -122,6 +127,10 @@
         return null;
     }
 
+    public UserBuddiesVisibility getBuddiesVisibility() {
+        return buddiesVisibility;
+    }
+
     @Finder(query = "from User where email = :email")
     public User getByEmail(@Named("email") final String email) {
         return null;
@@ -144,6 +153,10 @@
         return email;
     }
 
+    public boolean getHasLogo() {
+        return hasLogo();
+    }
+
     public Long getId() {
         return id;
     }
@@ -164,6 +177,11 @@
         return shortName;
     }
 
+    @Transient
+    public StateToken getStateToken() {
+        return userGroup.getStateToken();
+    }
+
     public TimeZone getTimezone() {
         return timezone;
     }
@@ -172,6 +190,15 @@
         return userGroup;
     }
 
+    @Transient
+    public boolean hasLogo() {
+        return getUserGroup().hasLogo();
+    }
+
+    public void setBuddiesVisibility(UserBuddiesVisibility buddiesVisibility) {
+        this.buddiesVisibility = buddiesVisibility;
+    }
+
     public void setCountry(final I18nCountry country) {
         this.country = country;
     }

Added: trunk/src/main/java/org/ourproject/kune/platf/server/domain/UserBuddiesVisibility.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/UserBuddiesVisibility.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/UserBuddiesVisibility.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.platf.server.domain;
+
+public enum UserBuddiesVisibility {
+    anyone, yourbuddies, onlyyou
+}

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/rpc/GroupRPC.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/rpc/GroupRPC.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/GroupRPC.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -20,6 +20,7 @@
 package org.ourproject.kune.platf.server.rpc;
 
 import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.dto.SocialNetworkVisibilityDTO;
 import org.ourproject.kune.platf.client.dto.StateToken;
 import org.ourproject.kune.platf.client.errors.DefaultException;
 import org.ourproject.kune.platf.client.rpc.GroupService;
@@ -32,6 +33,7 @@
 import org.ourproject.kune.platf.server.content.ContentUtils;
 import org.ourproject.kune.platf.server.domain.Content;
 import org.ourproject.kune.platf.server.domain.Group;
+import org.ourproject.kune.platf.server.domain.SocialNetworkVisibility;
 import org.ourproject.kune.platf.server.domain.User;
 import org.ourproject.kune.platf.server.manager.GroupManager;
 import org.ourproject.kune.platf.server.mapper.Mapper;
@@ -67,7 +69,7 @@
         final User user = userSession.getUser();
         final Group group = groupManager.findByShortName(groupToken.getGroup());
         groupManager.changeWsTheme(user, group, theme);
-    }
+    };
 
     @Authenticated
     @Transactional(type = TransactionType.READ_WRITE, rollbackOn = DefaultException.class)
@@ -100,6 +102,15 @@
         return mapper.map(group, GroupDTO.class);
     }
 
+    @Authenticated(mandatory = true)
+    @Authorizated(accessRolRequired = AccessRol.Administrator, actionLevel = ActionLevel.group)
+    @Transactional(type = TransactionType.READ_WRITE)
+    public void setSocialNetworkVisibility(final String userHash, StateToken token,
+            SocialNetworkVisibilityDTO visibility) {
+        final Group group = groupManager.findByShortName(token.getGroup());
+        group.getSocialNetwork().setVisibility(SocialNetworkVisibility.valueOf(visibility.toString()));
+    }
+
     private UserSession getUserSession() {
         return userSessionProvider.get();
     }

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SocialNetworkRPC.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SocialNetworkRPC.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SocialNetworkRPC.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -25,8 +25,10 @@
 import org.ourproject.kune.platf.client.dto.SocialNetworkDTO;
 import org.ourproject.kune.platf.client.dto.SocialNetworkRequestResult;
 import org.ourproject.kune.platf.client.dto.SocialNetworkResultDTO;
+import org.ourproject.kune.platf.client.dto.SocialNetworkVisibilityDTO;
 import org.ourproject.kune.platf.client.dto.StateToken;
 import org.ourproject.kune.platf.client.dto.UserBuddiesDataDTO;
+import org.ourproject.kune.platf.client.dto.UserBuddiesVisibilityDTO;
 import org.ourproject.kune.platf.client.errors.DefaultException;
 import org.ourproject.kune.platf.client.rpc.SocialNetworkService;
 import org.ourproject.kune.platf.server.UserSession;
@@ -37,7 +39,9 @@
 import org.ourproject.kune.platf.server.auth.Authenticated;
 import org.ourproject.kune.platf.server.auth.Authorizated;
 import org.ourproject.kune.platf.server.domain.Group;
+import org.ourproject.kune.platf.server.domain.SocialNetworkVisibility;
 import org.ourproject.kune.platf.server.domain.User;
+import org.ourproject.kune.platf.server.domain.UserBuddiesVisibility;
 import org.ourproject.kune.platf.server.manager.GroupManager;
 import org.ourproject.kune.platf.server.manager.SocialNetworkManager;
 import org.ourproject.kune.platf.server.manager.UserManager;
@@ -210,11 +214,47 @@
     private SocialNetworkResultDTO generateResponse(final User userLogged, final Group group) {
         AccessRights groupRights = accessRightsService.get(userLogged, group.getSocialNetwork().getAccessLists());
         if (group.getGroupType().equals(GroupType.PERSONAL)) {
-            return new SocialNetworkResultDTO(getGroupMembers(userLogged, group), getParticipation(userLogged, group),
-                    getUserBuddies(group), mapper.map(groupRights, AccessRightsDTO.class));
+            UserBuddiesDataDTO userBuddies = getUserBuddies(group);
+            SocialNetworkResultDTO result = new SocialNetworkResultDTO(getGroupMembers(userLogged, group),
+                    getParticipation(userLogged, group), userBuddies, mapper.map(groupRights, AccessRightsDTO.class));
+            UserBuddiesVisibility buddiesVisibility = userLogged.getBuddiesVisibility();
+            switch (buddiesVisibility) {
+            case anyone:
+                break;
+            case onlyyou:
+                if (userLogged == null || !userLogged.getUserGroup().equals(group)) {
+                    result.setUserBuddies(null);
+                }
+                break;
+            case yourbuddies:
+                if (!userBuddies.contains(userLogged.getShortName())) {
+                    result.setUserBuddies(null);
+                }
+                break;
+            }
+            result.setUserBuddiesVisibilityDTO(mapper.map(buddiesVisibility, UserBuddiesVisibilityDTO.class));
+            return result;
         } else {
-            return new SocialNetworkResultDTO(getGroupMembers(userLogged, group), getParticipation(userLogged, group),
-                    UserBuddiesDataDTO.NO_BUDDIES, mapper.map(groupRights, AccessRightsDTO.class));
+            SocialNetworkResultDTO result = new SocialNetworkResultDTO(getGroupMembers(userLogged, group),
+                    getParticipation(userLogged, group), UserBuddiesDataDTO.NO_BUDDIES, mapper.map(groupRights,
+                            AccessRightsDTO.class));
+            SocialNetworkVisibility visibility = group.getSocialNetwork().getVisibility();
+            switch (visibility) {
+            case anyone:
+                break;
+            case onlyadmins:
+                if (!groupRights.isAdministrable()) {
+                    result.setGroupMembers(null);
+                }
+                break;
+            case onlymembers:
+                if (!groupRights.isEditable()) {
+                    result.setGroupMembers(null);
+                }
+                break;
+            }
+            result.setSocialNetworkVisibilityDTO(mapper.map(visibility, SocialNetworkVisibilityDTO.class));
+            return result;
         }
     }
 

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/rpc/UserRPC.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/rpc/UserRPC.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/UserRPC.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -21,14 +21,21 @@
 
 import java.util.UUID;
 
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.dto.UserBuddiesVisibilityDTO;
 import org.ourproject.kune.platf.client.dto.UserDTO;
 import org.ourproject.kune.platf.client.dto.UserInfoDTO;
+import org.ourproject.kune.platf.client.errors.AccessViolationException;
 import org.ourproject.kune.platf.client.errors.DefaultException;
 import org.ourproject.kune.platf.client.errors.UserAuthException;
 import org.ourproject.kune.platf.server.UserSession;
+import org.ourproject.kune.platf.server.access.AccessRol;
+import org.ourproject.kune.platf.server.auth.ActionLevel;
 import org.ourproject.kune.platf.server.auth.Authenticated;
+import org.ourproject.kune.platf.server.auth.Authorizated;
 import org.ourproject.kune.platf.server.auth.SessionService;
 import org.ourproject.kune.platf.server.domain.User;
+import org.ourproject.kune.platf.server.domain.UserBuddiesVisibility;
 import org.ourproject.kune.platf.server.manager.GroupManager;
 import org.ourproject.kune.platf.server.manager.UserManager;
 import org.ourproject.kune.platf.server.mapper.Mapper;
@@ -102,6 +109,18 @@
         final UserSession userSession = getUserSession();
         final User user = userSession.getUser();
         return loadUserInfo(user);
+    }
+
+    @Authenticated(mandatory = true)
+    @Authorizated(accessRolRequired = AccessRol.Administrator, actionLevel = ActionLevel.group)
+    @Transactional(type = TransactionType.READ_WRITE)
+    public void setBuddiesVisibility(final String userHash, StateToken groupToken, UserBuddiesVisibilityDTO visibility) {
+        final UserSession userSession = getUserSession();
+        final User user = userSession.getUser();
+        if (groupToken.getGroup() != user.getShortName()) {
+            new AccessViolationException();
+        }
+        user.setBuddiesVisibility(UserBuddiesVisibility.valueOf(visibility.toString()));
     };
 
     private UserSession getUserSession() {

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPanel.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPanel.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -194,7 +194,6 @@
 
     public void setChangeYourLogoText() {
         getEntityTextLogo().setChangeYourLogo();
-
     }
 
     public void setFullLogo(final StateToken stateToken, final boolean clipped) {

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -246,30 +246,7 @@
                 180, store, columnModel);
         createPagingToolbar(store, grid);
 
-        // final PagingToolbar pag = new PagingToolbar(store);
-        // pag.setPageSize(PAGINATION_SIZE);
-        // pag.setDisplayInfo(true);
-        // pag.setDisplayMsg(i18n.tWithNT("Displaying results {0} - {1} of
-        // {2}",
-        // "Respect {} values in translations, "
-        // + "these will produce: 'Displaying results 1 - 25 of 95465' for
-        // instance"));
-        // pag.setEmptyMsg(i18n.t("No results to display"));
-        // pag.setAfterPageText(i18n.tWithNT("of {0}", "Used to show
-        // multiple results: '1 of 30'"));
-        // pag.setBeforePageText(i18n.t("Page"));
-        // pag.setFirstText(i18n.t("First Page"));
-        // pag.setLastText(i18n.t("Last Page"));
-        // pag.setNextText(i18n.t("Next Page"));
-        // pag.setPrevText(i18n.t("Previous Page"));
-        // pag.setRefreshText(i18n.t("Refresh"));
-        // grid.setBottomToolbar(pag);
-        // grid.setLoadMask(true);
-        // grid.setLoadMask(i18n.t("Loading"));
         grid.setClicksToEdit(1);
-        // grid.setStripeRows(true);
-        // grid.setFrame(true);
-        // grid.setSelectionModel(new RowSelectionModel());
 
         grid.addEditorGridListener(new EditorGridListenerAdapter() {
             @Override

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/site/rpc/UserService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/rpc/UserService.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/rpc/UserService.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -19,6 +19,8 @@
  */
 package org.ourproject.kune.workspace.client.site.rpc;
 
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.dto.UserBuddiesVisibilityDTO;
 import org.ourproject.kune.platf.client.dto.UserDTO;
 import org.ourproject.kune.platf.client.dto.UserInfoDTO;
 import org.ourproject.kune.platf.client.errors.DefaultException;
@@ -36,4 +38,7 @@
     void onlyCheckSession(String userHash) throws DefaultException;
 
     UserInfoDTO reloadUserInfo(String userHash) throws DefaultException;
+
+    void setBuddiesVisibility(String userHash, StateToken groupToken, UserBuddiesVisibilityDTO visibility);
+
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/site/rpc/UserServiceAsync.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/rpc/UserServiceAsync.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/rpc/UserServiceAsync.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -19,6 +19,8 @@
  */
 package org.ourproject.kune.workspace.client.site.rpc;
 
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.dto.UserBuddiesVisibilityDTO;
 import org.ourproject.kune.platf.client.dto.UserDTO;
 import org.ourproject.kune.platf.client.dto.UserInfoDTO;
 
@@ -28,12 +30,15 @@
 
     void createUser(UserDTO user, boolean wantPersonalHomepage, AsyncCallback<UserInfoDTO> asyncCallback);
 
-    void login(String nickOrEmail, String passwd, AsyncCallback<UserInfoDTO> callback);
+    void login(String nickOrEmail, String passwd, AsyncCallback<UserInfoDTO> asyncCallback);
 
-    void logout(String userHash, AsyncCallback<?> callback);
+    void logout(String userHash, AsyncCallback<?> asyncCallback);
 
     void onlyCheckSession(String userHash, AsyncCallback<?> asyncCallback);
 
     void reloadUserInfo(String userHash, AsyncCallback<UserInfoDTO> asyncCallback);
 
+    void setBuddiesVisibility(String userHash, StateToken groupToken, UserBuddiesVisibilityDTO visibility,
+            AsyncCallback<?> asyncCallback);
+
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPanel.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPanel.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -27,6 +27,7 @@
 import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarView;
 import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
 import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.Images;
 import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
 import org.ourproject.kune.workspace.client.skel.SummaryPanel;
 import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
@@ -44,27 +45,35 @@
 public class BuddiesSummaryPanel extends SummaryPanel implements BuddiesSummaryView {
 
     public class BuddieWidget extends Composite {
-        private final Image icon;
+        private final Image avatar;
         private final Label nick;
 
-        public BuddieWidget(String nickName, ClickListener clickListener) {
+        public BuddieWidget(String nickName, String avatarUrl, ClickListener clickListener) {
             // For Drag& drop, see gwt-ext-ux image:
             // http://www.gwt-ext.com:8080/demo-ux/#imageDDSample
             VerticalPanel vp = new VerticalPanel();
-            icon = new Image("images/persons/person2-32.png");
+            avatar = new Image();
+            if (avatarUrl.equals(NOAVATAR)) {
+                Images.App.getInstance().personAvatarDef().applyTo(avatar);
+            } else {
+                avatar.setUrl(avatarUrl);
+            }
+            avatar.setPixelSize(AVATARSIZE, AVATARSIZE);
             nick = new Label(nickName);
-            vp.add(icon);
+            vp.add(avatar);
             vp.add(nick);
+            vp.addStyleName("k-bsp-buddie");
             vp.addStyleName("kune-Margin-Small-trbl");
             vp.addStyleName("kune-pointer");
             vp.addStyleName("kune-floatleft");
             nick.addClickListener(clickListener);
-            icon.addClickListener(clickListener);
+            vp.setCellHorizontalAlignment(nick, VerticalPanel.ALIGN_CENTER);
+            avatar.addClickListener(clickListener);
             initWidget(vp);
         }
 
-        public void setIcon(String url) {
-            icon.setUrl(url);
+        public void setAvatarUrl(String url) {
+            avatar.setUrl(url);
         }
 
         public void setNick(String nickName) {
@@ -97,7 +106,8 @@
         addInSummary();
     }
 
-    public void addBuddie(final UserSimpleDTO user, ActionItemCollection<UserSimpleDTO> actionCollection) {
+    public void addBuddie(final UserSimpleDTO user, ActionItemCollection<UserSimpleDTO> actionCollection,
+            String avatarUrl) {
         ClickListener listener = new ClickListener() {
             public void onClick(Widget sender) {
                 Menu menu = menuItemsContainer.get(user.getShortName());
@@ -112,7 +122,8 @@
                         doAction(actionItem);
                     }
                 });
-        flowPanel.add(new BuddieWidget(user.getShortName(), listener));
+
+        flowPanel.add(new BuddieWidget(user.getShortName(), avatarUrl, listener));
     }
 
     @Override

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -34,11 +34,15 @@
 import org.ourproject.kune.platf.client.dto.GroupType;
 import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
 import org.ourproject.kune.platf.client.dto.UserBuddiesDataDTO;
+import org.ourproject.kune.platf.client.dto.UserBuddiesVisibilityDTO;
 import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
+import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
 import org.ourproject.kune.platf.client.services.I18nTranslationService;
 import org.ourproject.kune.platf.client.state.Session;
 import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
 import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.workspace.client.site.rpc.UserServiceAsync;
 
 import com.calclab.suco.client.ioc.Provider;
 import com.calclab.suco.client.listener.Listener;
@@ -52,16 +56,21 @@
     private final Provider<ChatEngine> chatEngineProvider;
     private final Session session;
     private final ActionBuddiesSummaryToolbar toolbar;
+    private final Provider<UserServiceAsync> userServiceAsync;
+    private final Provider<FileDownloadUtils> fileDownUtilsProvider;
 
-    public BuddiesSummaryPresenter(StateManager stateManager, final Session session, UserActionRegistry actionRegistry,
+    public BuddiesSummaryPresenter(StateManager stateManager, final Session session,
+            Provider<UserServiceAsync> userServiceAsync, UserActionRegistry actionRegistry,
             I18nTranslationService i18n, final Provider<ChatEngine> chatEngineProvider,
-            final ActionBuddiesSummaryToolbar toolbar) {
+            final ActionBuddiesSummaryToolbar toolbar, Provider<FileDownloadUtils> fileDownUtilsProvider) {
         this.stateManager = stateManager;
         this.session = session;
+        this.userServiceAsync = userServiceAsync;
         this.actionRegistry = actionRegistry;
         this.i18n = i18n;
         this.chatEngineProvider = chatEngineProvider;
         this.toolbar = toolbar;
+        this.fileDownUtilsProvider = fileDownUtilsProvider;
         stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
             public void onEvent(StateAbstractDTO state) {
                 setState(state);
@@ -90,8 +99,10 @@
             if (userBuddies != UserBuddiesDataDTO.NO_BUDDIES) {
                 List<UserSimpleDTO> buddies = userBuddies.getBuddies();
                 for (UserSimpleDTO user : buddies) {
+                    String avatarUrl = user.hasLogo() ? fileDownUtilsProvider.get().getLogoImageUrl(
+                            user.getStateToken()) : BuddiesSummaryView.NOAVATAR;
                     view.addBuddie(user, actionRegistry.getCurrentActions(user, session.isLogged(),
-                            new AccessRightsDTO(true, true, true), false));
+                            new AccessRightsDTO(true, true, true), false), avatarUrl);
                 }
                 boolean hasLocalBuddies = buddies.size() > 0;
                 int numExtBuddies = userBuddies.getOtherExternalBuddies();
@@ -124,11 +135,17 @@
         }
     }
 
-    private void createShowAction(String textDescription) {
+    private void createSetBuddiesVisibilityAction(String textDescription, final UserBuddiesVisibilityDTO visibility) {
         ActionToolbarMenuDescriptor<UserSimpleDTO> showBuddies = new ActionToolbarMenuDescriptor<UserSimpleDTO>(
                 AccessRolDTO.Administrator, ActionToolbarPosition.bottombar, new Listener<UserSimpleDTO>() {
                     public void onEvent(UserSimpleDTO parameter) {
-                        Site.info("In development");
+                        userServiceAsync.get().setBuddiesVisibility(session.getUserHash(),
+                                session.getCurrentState().getGroup().getStateToken(), visibility,
+                                new AsyncCallbackSimple<Object>() {
+                                    public void onSuccess(Object result) {
+                                        Site.info(i18n.t("Buddies visibility changed"));
+                                    }
+                                });
                     }
                 });
         showBuddies.setTextDescription(textDescription);
@@ -165,9 +182,9 @@
         go.setIconUrl("images/group-home.gif");
         actionRegistry.addAction(go);
 
-        createShowAction(i18n.t("anyone"));
-        createShowAction(i18n.t("only your buddies"));
-        createShowAction(i18n.t("only you"));
+        createSetBuddiesVisibilityAction(i18n.t("anyone"), UserBuddiesVisibilityDTO.anyone);
+        createSetBuddiesVisibilityAction(i18n.t("only your buddies"), UserBuddiesVisibilityDTO.yourbuddies);
+        createSetBuddiesVisibilityAction(i18n.t("only you"), UserBuddiesVisibilityDTO.onlyyou);
     }
 
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryView.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryView.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -24,8 +24,11 @@
 
 public interface BuddiesSummaryView extends View {
 
-    void addBuddie(UserSimpleDTO user, ActionItemCollection<UserSimpleDTO> actionCollection);
+    String NOAVATAR = "";
+    int AVATARSIZE = 32;
 
+    void addBuddie(UserSimpleDTO user, ActionItemCollection<UserSimpleDTO> actionCollection, String avatarUrl);
+
     void clear();
 
     void clearOtherUsers();

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java	2008-11-22 04:29:34 UTC (rev 961)
@@ -34,9 +34,11 @@
 import org.ourproject.kune.platf.client.dto.LinkDTO;
 import org.ourproject.kune.platf.client.dto.SocialNetworkDTO;
 import org.ourproject.kune.platf.client.dto.SocialNetworkResultDTO;
+import org.ourproject.kune.platf.client.dto.SocialNetworkVisibilityDTO;
 import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
 import org.ourproject.kune.platf.client.dto.StateToken;
 import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
+import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
 import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
 import org.ourproject.kune.platf.client.services.ImageDescriptor;
 import org.ourproject.kune.platf.client.services.ImageUtils;
@@ -67,10 +69,12 @@
     private final StateManager stateManager;
     private final GroupActionRegistry groupActionRegistry;
     private final Provider<GroupLiveSearcher> liveSearcherProvider;
+    private final Provider<GroupServiceAsync> groupServiceProvider;
 
     public GroupMembersSummaryPresenter(final I18nUITranslationService i18n, final StateManager stateManager,
             final ImageUtils imageUtils, final Session session,
             final Provider<SocialNetworkServiceAsync> snServiceProvider,
+            final Provider<GroupServiceAsync> groupServiceProvider,
             final Provider<GroupLiveSearcher> liveSearcherProvider, final WsThemePresenter wsThemePresenter,
             final Provider<ChatEngine> chatEngineProvider, final GroupActionRegistry groupActionRegistry,
             final ActionGroupSummaryToolbar toolbar) {
@@ -79,6 +83,7 @@
         this.stateManager = stateManager;
         this.session = session;
         this.snServiceProvider = snServiceProvider;
+        this.groupServiceProvider = groupServiceProvider;
         this.liveSearcherProvider = liveSearcherProvider;
         this.groupActionRegistry = groupActionRegistry;
         final Listener<StateAbstractDTO> setStateListener = new Listener<StateAbstractDTO>() {
@@ -165,16 +170,22 @@
         groupActionRegistry.addAction(unJoin);
 
         groupActionRegistry.addAction(participate);
-        createShowAction(i18n.t("anyone"));
-        createShowAction(i18n.t("only members"));
-        createShowAction(i18n.t("only admins"));
+        createSetMembersVisibilityAction(i18n.t("anyone"), SocialNetworkVisibilityDTO.anyone);
+        createSetMembersVisibilityAction(i18n.t("only members"), SocialNetworkVisibilityDTO.onlymembers);
+        createSetMembersVisibilityAction(i18n.t("only admins"), SocialNetworkVisibilityDTO.onlyadmins);
     }
 
-    private void createShowAction(String textDescription) {
+    private void createSetMembersVisibilityAction(String textDescription, final SocialNetworkVisibilityDTO visibility) {
         ActionToolbarMenuDescriptor<StateToken> showMembers = new ActionToolbarMenuDescriptor<StateToken>(
                 AccessRolDTO.Administrator, ActionToolbarPosition.bottombar, new Listener<StateToken>() {
                     public void onEvent(StateToken parameter) {
-                        Site.info("In development");
+                        groupServiceProvider.get().setSocialNetworkVisibility(session.getUserHash(),
+                                session.getCurrentState().getGroup().getStateToken(), visibility,
+                                new AsyncCallbackSimple<Object>() {
+                                    public void onSuccess(Object result) {
+                                        Site.info(i18n.t("Members visibility changed"));
+                                    }
+                                });
                     }
                 });
         showMembers.setTextDescription(textDescription);

Modified: trunk/src/main/resources/dozerBeanMapping.xml
===================================================================
--- trunk/src/main/resources/dozerBeanMapping.xml	2008-11-21 23:14:32 UTC (rev 960)
+++ trunk/src/main/resources/dozerBeanMapping.xml	2008-11-22 04:29:34 UTC (rev 961)
@@ -334,10 +334,16 @@
   </mapping>
 
   <mapping>
-    <class-a>
-      org.ourproject.kune.platf.client.dto.UserSimpleDTO
-    </class-a>
-    <class-b>org.ourproject.kune.platf.server.domain.User</class-b>
+    <class-a>org.ourproject.kune.platf.server.domain.User</class-a>
+    <class-b>org.ourproject.kune.platf.client.dto.UserSimpleDTO</class-b>
+    <field type="one-way">
+      <a>hasLogo</a>
+      <b>hasLogo</b>
+    </field>
+    <field>
+      <a get-method="getStateToken">stateToken</a>
+      <b>stateToken</b>
+    </field>
   </mapping>
 
   <mapping>
@@ -443,6 +449,24 @@
 
   <mapping>
     <class-a>
+      org.ourproject.kune.platf.client.dto.SocialNetworkVisibilityDTO
+    </class-a>
+    <class-b>
+      org.ourproject.kune.platf.server.domain.SocialNetworkVisibility
+    </class-b>
+  </mapping>
+
+  <mapping>
+    <class-a>
+      org.ourproject.kune.platf.client.dto.UserBuddiesVisibilityDTO
+    </class-a>
+    <class-b>
+      org.ourproject.kune.platf.server.domain.UserBuddiesVisibility
+    </class-b>
+  </mapping>
+
+  <mapping>
+    <class-a>
       org.ourproject.kune.platf.client.dto.ContentStatusDTO
     </class-a>
     <class-b>




More information about the kune-commits mailing list