[kune-commits] r832 - in trunk/src/main/java/org/ourproject/kune: chat/client docs/client platf/client/services platf/client/state platf/client/ui/gridmenu platf/server/manager/impl workspace/client/socialnet

vjrj vjrj at ourproject.org
Wed Aug 6 06:21:41 CEST 2008


Author: vjrj
Date: 2008-08-06 06:21:36 +0200 (Wed, 06 Aug 2008)
New Revision: 832

Modified:
   trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java
   trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
   trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java
   trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
   trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
   trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java
   trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/DefaultManager.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummary.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
Log:
Some adjusts in SN and chat. Search fixed.

Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java	2008-08-06 02:36:00 UTC (rev 831)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java	2008-08-06 04:21:36 UTC (rev 832)
@@ -51,7 +51,7 @@
 	    public ChatContent create() {
 		final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
 		final ChatContentPresenter presenter = new ChatContentPresenter($(EmiteUIDialog.class), panel,
-			$p(ChatInfo.class), $p(ChatRoom.class));
+			$$(ChatInfo.class), $$(ChatRoom.class));
 		return presenter;
 	    }
 	});
@@ -59,7 +59,7 @@
 	register(SingletonScope.class, new Factory<ChatContext>(ChatContext.class) {
 	    public ChatContext create() {
 		final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
-		final ChatContextPresenter presenter = new ChatContextPresenter(panel, $p(RoomsAdmin.class));
+		final ChatContextPresenter presenter = new ChatContextPresenter(panel, $$(RoomsAdmin.class));
 		return presenter;
 	    }
 	});
@@ -84,8 +84,8 @@
 	register(SingletonScope.class, new Factory<RoomsAdmin>(RoomsAdmin.class) {
 	    public RoomsAdmin create() {
 		final RoomsAdminPresenter presenter = new RoomsAdminPresenter($(ContextItems.class),
-			$(I18nUITranslationService.class), $p(StateManager.class), $(Session.class),
-			$p(ContentServiceAsync.class));
+			$(I18nUITranslationService.class), $$(StateManager.class), $(Session.class),
+			$$(ContentServiceAsync.class));
 		return presenter;
 	    }
 	});
@@ -93,8 +93,8 @@
 	register(SingletonScope.class, new Factory<ChatClientTool>(ChatClientTool.class) {
 	    public ChatClientTool create() {
 		return new ChatClientTool($(Session.class), $(Application.class), $(I18nUITranslationService.class),
-			$(EmiteUIDialog.class), $(WorkspaceSkeleton.class), $p(GroupMembersSummary.class),
-			$(ToolSelector.class), $(WsThemePresenter.class), $p(ChatContent.class), $p(ChatContext.class));
+			$(EmiteUIDialog.class), $(WorkspaceSkeleton.class), $$(GroupMembersSummary.class),
+			$(ToolSelector.class), $(WsThemePresenter.class), $$(ChatContent.class), $$(ChatContext.class));
 	    }
 	});
 

Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java	2008-08-06 02:36:00 UTC (rev 831)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java	2008-08-06 04:21:36 UTC (rev 832)
@@ -64,13 +64,18 @@
 		final ChatOptions chatOptions = new ChatOptions(initData.getChatHttpBase(), initData.getChatDomain(),
 			initData.getChatRoomHost());
 		chat = new ChatEngineXmpp(emiteUIDialog, chatOptions, i18n, ws);
-		groupMembersSummaryProvider.get().addGroupOperation(
+		groupMembersSummaryProvider.get().addUserOperation(
 			new MenuItem<GroupDTO>("images/chat-basic.gif", i18n.t("Start a chat with this member"),
 				new Slot<GroupDTO>() {
 				    public void onEvent(final GroupDTO group) {
-					emiteUIDialog.chat(XmppURI.jid(group.getShortName() + "@"
-						+ initData.getChatDomain()));
 					emiteUIDialog.show();
+					if (emiteUIDialog.isLoggedIn()) {
+					    emiteUIDialog.chat(XmppURI.jid(group.getShortName() + "@"
+						    + initData.getChatDomain()));
+					} else {
+					    ws.showAlertMessage(i18n.t("Error"), i18n
+						    .t("To start a chat you need to be 'online'."));
+					}
 				    }
 				}), true);
 	    }

Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java	2008-08-06 02:36:00 UTC (rev 831)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java	2008-08-06 04:21:36 UTC (rev 832)
@@ -57,9 +57,13 @@
     }
 
     public void joinRoom(final String roomName, final String userAlias) {
-	final XmppURI roomURI = XmppURI.uri(roomName + "@" + chatOptions.roomHost + "/"
-		+ chatOptions.userOptions.getUserJid().getNode());
-	emiteDialog.joinRoom(roomURI);
+	if (emiteDialog.isLoggedIn()) {
+	    final XmppURI roomURI = XmppURI.uri(roomName + "@" + chatOptions.roomHost + "/"
+		    + chatOptions.userOptions.getUserJid().getNode());
+	    emiteDialog.joinRoom(roomURI);
+	} else {
+	    ws.showAlertMessage(i18n.t("Error"), i18n.t("To join a chatroom you need to be 'online'."));
+	}
     }
 
     public void login(final String jid, final String passwd) {
@@ -92,6 +96,7 @@
 	    });
 	    ws.getSiteTraybar().addButton(traybarButton);
 	}
+	emiteDialog.setEnableStatusUI(true);
 	emiteDialog.hide();
 	emiteDialog.onChatAttended(new Slot<String>() {
 	    public void onEvent(final String parameter) {
@@ -111,6 +116,7 @@
 	    final UserChatOptions userChatOptions = getUserChatOptions("reset at example.com", "");
 	    emiteDialog.refreshUserInfo(userChatOptions);
 	    chatOptions.userOptions = userChatOptions;
+	    emiteDialog.setEnableStatusUI(false);
 	}
     }
 

Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java	2008-08-06 02:36:00 UTC (rev 831)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java	2008-08-06 04:21:36 UTC (rev 832)
@@ -56,14 +56,14 @@
 	register(SingletonScope.class, new Factory<DocumentClientTool>(DocumentClientTool.class) {
 	    public DocumentClientTool create() {
 		return new DocumentClientTool(i18n, $(ToolSelector.class), $(WsThemePresenter.class),
-			$(WorkspaceSkeleton.class), $p(DocumentContent.class), $p(DocumentContext.class));
+			$(WorkspaceSkeleton.class), $$(DocumentContent.class), $$(DocumentContext.class));
 	    }
 	});
 
 	register(SingletonScope.class, new Factory<AdminContext>(AdminContext.class) {
 	    public AdminContext create() {
 		final AdminContextPresenter presenter = new AdminContextPresenter($(Session.class),
-			$p(TagsSummary.class));
+			$$(TagsSummary.class));
 		final AdminContextView view = new AdminContextPanel(presenter, i18n);
 		presenter.init(view);
 		return presenter;
@@ -74,16 +74,16 @@
 	    public DocumentContent create() {
 		final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
 		final DocumentContentPresenter presenter = new DocumentContentPresenter(panel, $(Session.class),
-			$(RateIt.class), $p(DocumentReader.class), $p(DocumentReaderControl.class),
-			$p(TextEditor.class), $p(FolderViewer.class), $p(FolderEditor.class));
+			$(RateIt.class), $$(DocumentReader.class), $$(DocumentReaderControl.class),
+			$$(TextEditor.class), $$(FolderViewer.class), $$(FolderEditor.class));
 		return presenter;
 	    }
 	});
 	register(SingletonScope.class, new Factory<DocumentContext>(DocumentContext.class) {
 	    public DocumentContext create() {
 		final WorkspaceDeckPanel view = new WorkspaceDeckPanel();
-		final DocumentContextPresenter presenter = new DocumentContextPresenter(view, $p(FolderContext.class),
-			$p(AdminContext.class));
+		final DocumentContextPresenter presenter = new DocumentContextPresenter(view, $$(FolderContext.class),
+			$$(AdminContext.class));
 		return presenter;
 	    }
 	});

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java	2008-08-06 02:36:00 UTC (rev 831)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java	2008-08-06 04:21:36 UTC (rev 832)
@@ -157,7 +157,7 @@
 
 	register(SingletonScope.class, new Factory<Session>(Session.class) {
 	    public Session create() {
-		return new SessionDefault(Cookies.getCookie(Site.USERHASH), $p(UserServiceAsync.class));
+		return new SessionDefault(Cookies.getCookie(Site.USERHASH), $$(UserServiceAsync.class));
 	    }
 	}, new Factory<I18nServiceAsync>(I18nServiceAsync.class) {
 	    public I18nServiceAsync create() {
@@ -243,7 +243,7 @@
 
 	register(SingletonScope.class, new Factory<KuneErrorHandler>(KuneErrorHandler.class) {
 	    public KuneErrorHandler create() {
-		return new KuneErrorHandler($(Session.class), i18n, $p(WorkspaceSkeleton.class), $p(StateManager.class));
+		return new KuneErrorHandler($(Session.class), i18n, $$(WorkspaceSkeleton.class), $$(StateManager.class));
 	    }
 	});
 
@@ -294,7 +294,7 @@
 	register(SingletonScope.class, new Factory<SiteProgress>(SiteProgress.class) {
 	    public SiteProgress create() {
 		final SiteProgressPresenter presenter = new SiteProgressPresenter();
-		final SiteProgressPanel panel = new SiteProgressPanel(presenter, $p(SitePublicSpaceLink.class));
+		final SiteProgressPanel panel = new SiteProgressPanel(presenter, $$(SitePublicSpaceLink.class));
 		presenter.init(panel);
 		return presenter;
 	    }
@@ -302,7 +302,7 @@
 
 	register(SingletonScope.class, new Factory<Site>(Site.class) {
 	    public Site create() {
-		return new Site(i18n, $(SiteProgress.class), $p(SiteMessage.class));
+		return new Site(i18n, $(SiteProgress.class), $$(SiteMessage.class));
 	    }
 	});
 
@@ -339,7 +339,7 @@
 	register(SingletonScope.class, new Factory<SiteSignOutLink>(SiteSignOutLink.class) {
 	    public SiteSignOutLink create() {
 		final SiteSignOutLinkPresenter presenter = new SiteSignOutLinkPresenter($(Session.class),
-			$p(UserServiceAsync.class), $p(KuneErrorHandler.class));
+			$$(UserServiceAsync.class), $$(KuneErrorHandler.class));
 		final SiteSignOutLinkPanel panel = new SiteSignOutLinkPanel(presenter, i18n, ws);
 		presenter.init(panel);
 		return presenter;
@@ -375,7 +375,7 @@
 
 	register(SingletonScope.class, new Factory<SiteSearcher>(SiteSearcher.class) {
 	    public SiteSearcher create() {
-		final SiteSearcherPresenter presenter = new SiteSearcherPresenter($p(StateManager.class));
+		final SiteSearcherPresenter presenter = new SiteSearcherPresenter($$(StateManager.class));
 		final SiteSearcherView view = new SiteSearcherPanel(presenter, i18n, ws);
 		presenter.init(view);
 		return presenter;
@@ -394,7 +394,7 @@
 
 	register(SingletonScope.class, new Factory<SiteSearch>(SiteSearch.class) {
 	    public SiteSearch create() {
-		final SiteSearchPresenter presenter = new SiteSearchPresenter($p(SiteSearcher.class));
+		final SiteSearchPresenter presenter = new SiteSearchPresenter($$(SiteSearcher.class));
 		final SiteSearchPanel panel = new SiteSearchPanel(presenter, ws, i18n);
 		presenter.init(panel);
 		return presenter;
@@ -423,8 +423,8 @@
 	register(SingletonScope.class, new Factory<NewGroup>(NewGroup.class) {
 	    public NewGroup create() {
 		final NewGroupPresenter presenter = new NewGroupPresenter(i18n, $(Session.class),
-			$(StateManager.class), $p(GroupServiceAsync.class));
-		final NewGroupPanel view = new NewGroupPanel(presenter, i18n, $p(LicenseChoose.class));
+			$(StateManager.class), $$(GroupServiceAsync.class));
+		final NewGroupPanel view = new NewGroupPanel(presenter, i18n, $$(LicenseChoose.class));
 		presenter.init(view);
 		return presenter;
 	    }
@@ -442,7 +442,7 @@
 
 	register(SingletonScope.class, new Factory<WsThemePresenter>(WsThemePresenter.class) {
 	    public WsThemePresenter create() {
-		final WsThemePresenter presenter = new WsThemePresenter($(Session.class), $p(GroupServiceAsync.class),
+		final WsThemePresenter presenter = new WsThemePresenter($(Session.class), $$(GroupServiceAsync.class),
 			$(StateManager.class));
 		final WsThemePanel panel = new WsThemePanel(ws, presenter, i18n);
 		presenter.init(panel);
@@ -490,7 +490,7 @@
 	register(SingletonScope.class, new Factory<RateIt>(RateIt.class) {
 	    public RateIt create() {
 		final RateItPresenter presenter = new RateItPresenter(i18n, $(Session.class),
-			$p(ContentServiceAsync.class), $(StateManager.class));
+			$$(ContentServiceAsync.class), $(StateManager.class));
 		final RateItPanel panel = new RateItPanel(presenter, i18n, ws);
 		presenter.init(panel);
 		return presenter;
@@ -501,7 +501,7 @@
 	    public GroupMembersSummary create() {
 		final GroupMembersSummaryPresenter presenter = new GroupMembersSummaryPresenter(i18n,
 			$(StateManager.class), $(ImageUtils.class), $(Session.class),
-			$p(SocialNetworkServiceAsync.class), $p(UserLiveSearcher.class), $(WsThemePresenter.class));
+			$$(SocialNetworkServiceAsync.class), $$(UserLiveSearcher.class), $(WsThemePresenter.class));
 		final GroupMembersSummaryView view = new GroupMembersSummaryPanel(presenter, i18n, ws);
 		presenter.init(view);
 		return presenter;
@@ -522,7 +522,7 @@
 	    public ParticipationSummary create() {
 		final ParticipationSummaryPresenter presenter = new ParticipationSummaryPresenter(i18n,
 			$(StateManager.class), $(ImageUtils.class), $(Session.class),
-			$p(SocialNetworkServiceAsync.class), $(WsThemePresenter.class));
+			$$(SocialNetworkServiceAsync.class), $(WsThemePresenter.class));
 		final ParticipationSummaryView view = new ParticipationSummaryPanel(presenter, i18n, ws);
 		presenter.init(view);
 		return presenter;
@@ -532,7 +532,7 @@
 	register(SingletonScope.class, new Factory<TagsSummary>(TagsSummary.class) {
 	    public TagsSummary create() {
 		final TagsSummaryPresenter presenter = new TagsSummaryPresenter($(Session.class),
-			$p(SiteSearcher.class), $(StateManager.class), $(WsThemePresenter.class));
+			$$(SiteSearcher.class), $(StateManager.class), $(WsThemePresenter.class));
 		final TagsSummaryPanel panel = new TagsSummaryPanel(presenter, i18n, ws);
 		presenter.init(panel);
 		return presenter;

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java	2008-08-06 02:36:00 UTC (rev 831)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java	2008-08-06 04:21:36 UTC (rev 832)
@@ -55,7 +55,7 @@
     private final Provider<UserServiceAsync> userServiceProvider;
 
     public SessionDefault(final String userHash, final Provider<UserServiceAsync> userServiceProvider) {
-	this.userHash = userHash;
+	this.userHash = userHash == null || userHash.equals("null") ? null : userHash;
 	this.userServiceProvider = userServiceProvider;
 	languagesArray = null;
 	this.onInitDataReceived = new Signal<InitDataDTO>("initDataReceived");

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java	2008-08-06 02:36:00 UTC (rev 831)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java	2008-08-06 04:21:36 UTC (rev 832)
@@ -232,7 +232,7 @@
     }
 
     public void sort() {
-	store.sort(GROUP);
+	store.sort(GROUP, SortDir.ASC);
     }
 
     public void updateItem(final GridItem<T> gridItem) {
@@ -311,7 +311,7 @@
 
 	final ArrayReader reader = new ArrayReader(1, recordDef);
 	store = new GroupingStore(proxy, reader);
-	store.setSortInfo(new SortState(GROUP, SortDir.DESC));
+	store.setSortInfo(new SortState(GROUP, SortDir.ASC));
 	store.setGroupField(GROUP);
 	store.setGroupOnSort(true);
 	store.load();

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/DefaultManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/DefaultManager.java	2008-08-06 02:36:00 UTC (rev 831)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/DefaultManager.java	2008-08-06 04:21:36 UTC (rev 832)
@@ -33,22 +33,11 @@
 
 public abstract class DefaultManager<T, K> {
     private final Provider<EntityManager> provider;
-    private final Provider<FullTextEntityManager> fullTextEntityManagerProvider;
     private final Class<T> entityClass;
 
     public DefaultManager(final Provider<EntityManager> provider, final Class<T> entityClass) {
 	this.provider = provider;
 	this.entityClass = entityClass;
-	fullTextEntityManagerProvider = new Provider<FullTextEntityManager>() {
-	    private FullTextEntityManager searchManager;
-
-	    public FullTextEntityManager get() {
-		if (searchManager == null) {
-		    searchManager = Search.createFullTextEntityManager(getEntityManager());
-		}
-		return searchManager;
-	    }
-	};
     }
 
     public T find(final Long primaryKey) {
@@ -75,7 +64,8 @@
 
     @SuppressWarnings("unchecked")
     public void reIndex() {
-	final FullTextEntityManager fullTextEm = fullTextEntityManagerProvider.get();
+	// Inject this?
+	final FullTextEntityManager fullTextEm = Search.createFullTextEntityManager(getEntityManager());
 	fullTextEm.purgeAll(entityClass);
 	fullTextEm.getTransaction().commit();
 	fullTextEm.getTransaction().begin();
@@ -93,7 +83,8 @@
 
     @SuppressWarnings("unchecked")
     public SearchResult<T> search(final Query query, final Integer firstResult, final Integer maxResults) {
-	final FullTextQuery emQuery = fullTextEntityManagerProvider.get().createFullTextQuery(query, entityClass);
+	final FullTextQuery emQuery = Search.createFullTextEntityManager(getEntityManager()).createFullTextQuery(query,
+		entityClass);
 	if (firstResult != null && maxResults != null) {
 	    emQuery.setFirstResult(firstResult);
 	    emQuery.setMaxResults(maxResults);

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummary.java	2008-08-06 02:36:00 UTC (rev 831)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummary.java	2008-08-06 04:21:36 UTC (rev 832)
@@ -27,6 +27,10 @@
 
     void addGroupOperation(MenuItem<GroupDTO> operation, boolean mustBeLogged);
 
+    void addUserOperation(MenuItem<GroupDTO> operation, boolean mustBeLogged);
+
     void removeGroupOperation(MenuItem<GroupDTO> operation, boolean mustBeLogged);
 
+    void removeUserOperation(MenuItem<GroupDTO> operation, boolean mustBeLogged);
+
 }

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-08-06 02:36:00 UTC (rev 831)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java	2008-08-06 04:21:36 UTC (rev 832)
@@ -81,7 +81,8 @@
 		userLiveSearcherProvider.get().show();
 	    }
 	});
-	super.addGroupOperation(gotoMemberMenuItem, false);
+	super.addGroupOperation(gotoGroupMenuItem, false);
+	super.addUserOperation(gotoMemberMenuItem, false);
     }
 
     public void addCollab(final String groupShortName) {
@@ -102,6 +103,10 @@
 	this.view = view;
     }
 
+    public void onDoubleClick(final String groupShortName) {
+	stateManager.gotoToken(groupShortName);
+    }
+
     private boolean isMember(final boolean userIsAdmin, final boolean userIsCollab) {
 	return userIsAdmin || userIsCollab;
     }
@@ -175,8 +180,4 @@
 	}
     }
 
-    public void onDoubleClick(String groupShortName) {
-	stateManager.gotoToken(groupShortName);	
-    }
-
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java	2008-08-06 02:36:00 UTC (rev 831)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java	2008-08-06 04:21:36 UTC (rev 832)
@@ -41,6 +41,8 @@
     private final GridMenuItemCollection<GroupDTO> otherOperations;
     private final GridMenuItemCollection<GroupDTO> otherLoggedOperations;
     private final ImageUtils imageUtils;
+    private final GridMenuItemCollection<GroupDTO> otherOperationsUsers;
+    private final GridMenuItemCollection<GroupDTO> otherLoggedOperationsUsers;
 
     public SocialNetworkPresenter(final I18nUITranslationService i18n, final StateManager stateManager,
 	    final ImageUtils imageUtils, final Session session,
@@ -52,8 +54,11 @@
 	this.snServiceProvider = snServiceProvider;
 	createButtons();
 	createMenuActions();
+	otherOperationsUsers = new GridMenuItemCollection<GroupDTO>();
+	otherLoggedOperationsUsers = new GridMenuItemCollection<GroupDTO>();
 	otherOperations = new GridMenuItemCollection<GroupDTO>();
 	otherLoggedOperations = new GridMenuItemCollection<GroupDTO>();
+
     }
 
     public void addGroupOperation(final MenuItem<GroupDTO> operation, final boolean mustBeLogged) {
@@ -62,12 +67,24 @@
 	collection.add(operation);
     }
 
+    public void addUserOperation(final MenuItem<GroupDTO> operation, final boolean mustBeLogged) {
+	GridMenuItemCollection<GroupDTO> collection;
+	collection = mustBeLogged ? otherLoggedOperationsUsers : otherOperationsUsers;
+	collection.add(operation);
+    }
+
     public void removeGroupOperation(final MenuItem<GroupDTO> operation, final boolean mustBeLogged) {
 	GridMenuItemCollection<GroupDTO> collection;
 	collection = mustBeLogged ? otherLoggedOperations : otherOperations;
 	collection.remove(operation);
     }
 
+    public void removeUserOperation(final MenuItem<GroupDTO> operation, final boolean mustBeLogged) {
+	GridMenuItemCollection<GroupDTO> collection;
+	collection = mustBeLogged ? otherLoggedOperationsUsers : otherOperationsUsers;
+	collection.remove(operation);
+    }
+
     protected GridItem<GroupDTO> createGridItem(final GridGroup groupCategory, final GroupDTO group,
 	    final AccessRightsDTO rights, final MenuItem<GroupDTO>... gridMenuItems) {
 	final GridItem<GroupDTO> gridItem = createDefMemberMenu(group, groupCategory);
@@ -116,15 +133,23 @@
     private GridItem<GroupDTO> createDefMemberMenu(final GroupDTO group, final GridGroup gridGroup) {
 	final GridMenu<GroupDTO> menu = new GridMenu<GroupDTO>(group);
 	final String longName = group.getLongName();
+	final String toolTip = i18n.t(group.getType().equals(GroupDTO.PERSONAL) ? "User nickname: [%s]"
+		: "Group short name: [%s]", group.getShortName());
 	final GridItem<GroupDTO> gridItem = new GridItem<GroupDTO>(group, gridGroup, group.getShortName(), imageUtils
-		.getImageHtml(ImageDescriptor.groupDefIcon), longName, longName, " ", longName, i18n.t(
-		"User name: [%s]", group.getShortName()), menu);
-	if (otherOperations != null) {
+		.getImageHtml(ImageDescriptor.groupDefIcon), longName, longName, " ", longName, toolTip, menu);
+	if (!group.getType().equals(GroupDTO.PERSONAL)) {
 	    menu.addMenuItemList(otherOperations);
 	}
-	if (session.isLogged() && otherOperations != null) {
+	if (session.isLogged() && !group.getType().equals(GroupDTO.PERSONAL)) {
 	    menu.addMenuItemList(otherLoggedOperations);
 	}
+	if (group.getType().equals(GroupDTO.PERSONAL)) {
+	    menu.addMenuItemList(otherOperationsUsers);
+	}
+	if (session.isLogged() && group.getType().equals(GroupDTO.PERSONAL)) {
+	    menu.addMenuItemList(otherLoggedOperationsUsers);
+	}
+
 	return gridItem;
     }
 
@@ -147,21 +172,21 @@
 		removeMemberAction(groupDTO);
 	    }
 	});
-	changeToCollabMenuItem = new MenuItem<GroupDTO>("images/arrow-down-green.gif", i18n
-		.t("Change to collaborator"), new Slot<GroupDTO>() {
-	    public void onEvent(final GroupDTO group) {
-		Site.showProgressProcessing();
-		snServiceProvider.get().setAdminAsCollab(session.getUserHash(),
-			session.getCurrentState().getGroup().getShortName(), group.getShortName(),
-			new AsyncCallbackSimple<SocialNetworkResultDTO>() {
-			    public void onSuccess(final SocialNetworkResultDTO result) {
-				Site.hideProgress();
-				Site.info(i18n.t("Type of member changed"));
-				stateManager.setSocialNetwork(result);
-			    }
-			});
-	    }
-	});
+	changeToCollabMenuItem = new MenuItem<GroupDTO>("images/arrow-down-green.gif",
+		i18n.t("Change to collaborator"), new Slot<GroupDTO>() {
+		    public void onEvent(final GroupDTO group) {
+			Site.showProgressProcessing();
+			snServiceProvider.get().setAdminAsCollab(session.getUserHash(),
+				session.getCurrentState().getGroup().getShortName(), group.getShortName(),
+				new AsyncCallbackSimple<SocialNetworkResultDTO>() {
+				    public void onSuccess(final SocialNetworkResultDTO result) {
+					Site.hideProgress();
+					Site.info(i18n.t("Type of member changed"));
+					stateManager.setSocialNetwork(result);
+				    }
+				});
+		    }
+		});
 	removeMemberMenuItem = new MenuItem<GroupDTO>("images/del.gif", i18n.t("Remove this member"),
 		new Slot<GroupDTO>() {
 		    public void onEvent(final GroupDTO group) {




More information about the kune-commits mailing list