[kune-commits] r835 - in trunk/src:
main/java/org/ourproject/kune/platf/client/dto
main/java/org/ourproject/kune/platf/client/services
main/java/org/ourproject/kune/platf/client/ui
main/java/org/ourproject/kune/platf/client/ui/gridmenu
main/java/org/ourproject/kune/platf/server
main/java/org/ourproject/kune/platf/server/manager/impl
main/java/org/ourproject/kune/platf/server/users
main/java/org/ourproject/kune/workspace/client/i18n
main/java/org/ourproject/kune/workspace/client/i18n/ui
main/java/org/ourproject/kune/workspace/client/search
main/java/org/ourproject/kune/workspace/client/sitebar/bar
main/java/org/ourproject/kune/workspace/client/socialnet
main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteoptions
main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu
main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel
main/resources test/java/org/ourproject/kune/platf/integration/site
vjrj
vjrj at ourproject.org
Fri Aug 8 19:49:09 CEST 2008
Author: vjrj
Date: 2008-08-08 19:48:55 +0200 (Fri, 08 Aug 2008)
New Revision: 835
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItemCollection.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/CustomMenu.java
Removed:
trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenu.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuItemCollection.java
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/dto/ParticipationDataDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserInfoDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridItem.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java
trunk/src/main/java/org/ourproject/kune/platf/server/ParticipationData.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfo.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslator.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/ui/I18nTranslatorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteBottomTrayButton.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteoptions/SiteOptionsPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteoptions/SiteOptionsPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java
trunk/src/main/resources/dozerBeanMapping.xml
trunk/src/test/java/org/ourproject/kune/platf/integration/site/UserServiceTest.java
Log:
Incomplete - task 23: SiteBar Menus (options, user menu)
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/ParticipationDataDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/ParticipationDataDTO.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/ParticipationDataDTO.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -25,32 +25,32 @@
public class ParticipationDataDTO implements IsSerializable {
- private List<LinkDTO> groupsIsAdmin;
- private List<LinkDTO> groupsIsCollab;
+ private List<GroupDTO> groupsIsAdmin;
+ private List<GroupDTO> groupsIsCollab;
public ParticipationDataDTO() {
- this(null, null);
+ this(null, null);
}
- public ParticipationDataDTO(final List<LinkDTO> groupsIsAdmin, final List<LinkDTO> groupsIsCollab) {
- this.groupsIsAdmin = groupsIsAdmin;
- this.groupsIsCollab = groupsIsCollab;
+ public ParticipationDataDTO(final List<GroupDTO> groupsIsAdmin, final List<GroupDTO> groupsIsCollab) {
+ this.groupsIsAdmin = groupsIsAdmin;
+ this.groupsIsCollab = groupsIsCollab;
}
- public List<LinkDTO> getGroupsIsAdmin() {
- return groupsIsAdmin;
+ public List<GroupDTO> getGroupsIsAdmin() {
+ return groupsIsAdmin;
}
- public void setGroupsIsAdmin(final List<LinkDTO> groupsIsAdmin) {
- this.groupsIsAdmin = groupsIsAdmin;
+ public List<GroupDTO> getGroupsIsCollab() {
+ return groupsIsCollab;
}
- public List<LinkDTO> getGroupsIsCollab() {
- return groupsIsCollab;
+ public void setGroupsIsAdmin(final List<GroupDTO> groupsIsAdmin) {
+ this.groupsIsAdmin = groupsIsAdmin;
}
- public void setGroupsIsCollab(final List<LinkDTO> groupsIsCollab) {
- this.groupsIsCollab = groupsIsCollab;
+ public void setGroupsIsCollab(final List<GroupDTO> groupsIsCollab) {
+ this.groupsIsCollab = groupsIsCollab;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserInfoDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserInfoDTO.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserInfoDTO.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -32,88 +32,88 @@
private String userHash;
private I18nLanguageDTO language;
private I18nCountryDTO country;
- private List<LinkDTO> groupsIsAdmin;
- private List<LinkDTO> groupsIsCollab;
+ private List<GroupDTO> groupsIsAdmin;
+ private List<GroupDTO> groupsIsCollab;
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
public String getChatName() {
- return chatName;
+ return chatName;
}
public String getChatPassword() {
- return chatPassword;
+ return chatPassword;
}
- public void setChatPassword(final String password) {
- this.chatPassword = password;
+ public I18nCountryDTO getCountry() {
+ return country;
+ }
+ public List<GroupDTO> getGroupsIsAdmin() {
+ return groupsIsAdmin;
}
- public void setChatName(final String chatName) {
- this.chatName = chatName;
+ public List<GroupDTO> getGroupsIsCollab() {
+ return groupsIsCollab;
}
- public List<LinkDTO> getGroupsIsAdmin() {
- return groupsIsAdmin;
+ public String getHomePage() {
+ return homePage;
}
- public void setGroupsIsAdmin(final List<LinkDTO> groupsIsAdmin) {
- this.groupsIsAdmin = groupsIsAdmin;
+ public I18nLanguageDTO getLanguage() {
+ return language;
}
- public List<LinkDTO> getGroupsIsCollab() {
- return groupsIsCollab;
+ public String getName() {
+ return name;
}
- public void setGroupsIsCollab(final List<LinkDTO> groupsIsCollab) {
- this.groupsIsCollab = groupsIsCollab;
+ public String getShortName() {
+ return shortName;
}
- public String getHomePage() {
- return homePage;
+ public String getUserHash() {
+ return userHash;
}
- public void setHomePage(final String homePage) {
- this.homePage = homePage;
+ public void setChatName(final String chatName) {
+ this.chatName = chatName;
}
- public String getShortName() {
- return shortName;
+ public void setChatPassword(final String password) {
+ this.chatPassword = password;
+
}
- public void setShortName(final String shortName) {
- this.shortName = shortName;
+ public void setCountry(final I18nCountryDTO country) {
+ this.country = country;
}
- public String getUserHash() {
- return userHash;
+ public void setGroupsIsAdmin(final List<GroupDTO> groupsIsAdmin) {
+ this.groupsIsAdmin = groupsIsAdmin;
}
- public void setUserHash(final String userHash) {
- this.userHash = userHash;
+ public void setGroupsIsCollab(final List<GroupDTO> groupsIsCollab) {
+ this.groupsIsCollab = groupsIsCollab;
}
- public I18nLanguageDTO getLanguage() {
- return language;
+ public void setHomePage(final String homePage) {
+ this.homePage = homePage;
}
public void setLanguage(final I18nLanguageDTO language) {
- this.language = language;
+ this.language = language;
}
- public I18nCountryDTO getCountry() {
- return country;
+ public void setName(final String name) {
+ this.name = name;
}
- public void setCountry(final I18nCountryDTO country) {
- this.country = country;
+ public void setShortName(final String shortName) {
+ this.shortName = shortName;
}
+ public void setUserHash(final String userHash) {
+ this.userHash = userHash;
+ }
+
}
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-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -327,8 +327,9 @@
register(SingletonScope.class, new Factory<SiteUserMenu>(SiteUserMenu.class) {
public SiteUserMenu create() {
- final SiteUserMenuPresenter presenter = new SiteUserMenuPresenter($(Session.class));
- final SiteUserMenuPanel panel = new SiteUserMenuPanel(presenter, ws);
+ final SiteUserMenuPresenter presenter = new SiteUserMenuPresenter($(Session.class),
+ $(StateManager.class));
+ final SiteUserMenuPanel panel = new SiteUserMenuPanel(presenter, ws, i18n);
presenter.init(panel);
return presenter;
}
@@ -356,7 +357,7 @@
register(SingletonScope.class, new Factory<SiteOptions>(SiteOptions.class) {
public SiteOptions create() {
final SiteOptionsPresenter presenter = new SiteOptionsPresenter();
- final SiteOptionsPanel panel = new SiteOptionsPanel(presenter, ws);
+ final SiteOptionsPanel panel = new SiteOptionsPanel(presenter, ws, i18n, $$(I18nTranslator.class));
presenter.init(panel);
return presenter;
}
@@ -601,6 +602,7 @@
$(SiteSignInLink.class);
$(SiteSignOutLink.class);
$(SiteNewGroupLink.class);
+ $(SiteOptions.class);
$(SiteSearch.class);
$(SiteLogo.class);
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItemCollection.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItemCollection.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItemCollection.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -0,0 +1,31 @@
+/*
+ *
+ * ((e)) emite: A pure gwt (Google Web Toolkit) xmpp (jabber) library
+ *
+ * (c) 2008 The emite development team (see CREDITS for details)
+ * This file is part of emite.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.platf.client.ui;
+
+import java.util.ArrayList;
+
+
+public class MenuItemCollection<T> extends ArrayList<MenuItem<T>> {
+
+ private static final long serialVersionUID = 1L;
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/CustomMenu.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/CustomMenu.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/CustomMenu.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -0,0 +1,83 @@
+/*
+ *
+ * ((e)) emite: A pure gwt (Google Web Toolkit) xmpp (jabber) library
+ *
+ * (c) 2008 The emite development team (see CREDITS for details)
+ * This file is part of emite.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.platf.client.ui.gridmenu;
+
+import java.util.Iterator;
+
+import org.ourproject.kune.platf.client.ui.MenuItem;
+import org.ourproject.kune.platf.client.ui.MenuItemCollection;
+
+
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.menu.BaseItem;
+import com.gwtext.client.widgets.menu.Item;
+import com.gwtext.client.widgets.menu.Menu;
+import com.gwtext.client.widgets.menu.event.BaseItemListenerAdapter;
+
+public class CustomMenu<T> {
+ private final T param;
+ private final Menu menu;
+
+ /**
+ *
+ * @param param
+ * the uniq id (for instance a group short name, a xmpp uri
+ * of the object asociated with this menu
+ *
+ */
+ public CustomMenu(final T param) {
+ this.param = param;
+ menu = new Menu();
+ }
+
+ public void addMenuItem(final MenuItem<T> menuItem) {
+ final Item item = new Item(menuItem.getTitle());
+ item.setIcon(menuItem.getIcon());
+ menu.addItem(item);
+ item.addListener(new BaseItemListenerAdapter() {
+ public void onClick(final BaseItem item, final EventObject e) {
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ menuItem.fire(param);
+ }
+ });
+ }
+ });
+ }
+
+ @SuppressWarnings("unchecked")
+ public void addMenuItemList(final MenuItemCollection list) {
+ for (final Iterator iterator = list.iterator(); iterator.hasNext();) {
+ final MenuItem item = (MenuItem) iterator.next();
+ addMenuItem(item);
+ }
+ }
+
+ public void showMenu(final EventObject e) {
+ if (menu.getItems().length > 0) {
+ menu.showAt(e.getXY());
+ }
+ }
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridItem.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridItem.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridItem.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -1,5 +1,6 @@
package org.ourproject.kune.platf.client.ui.gridmenu;
+
public class GridItem<T> {
private GridGroup group;
@@ -11,11 +12,11 @@
private String tooltip;
private String tooltipTitle;
private T item;
- private GridMenu<T> menu;
+ private CustomMenu<T> menu;
public GridItem(final T item, final GridGroup group, final String id, final String iconHtml, final String title,
final String titleHtml, final String endIconHtml, final String tooltipTitle, final String tooltip,
- final GridMenu<T> menu) {
+ final CustomMenu<T> menu) {
this.item = item;
this.group = group;
this.id = id;
@@ -48,7 +49,7 @@
return item;
}
- public GridMenu<T> getMenu() {
+ public CustomMenu<T> getMenu() {
return menu;
}
@@ -88,7 +89,7 @@
this.item = item;
}
- public void setMenu(final GridMenu<T> menu) {
+ public void setMenu(final CustomMenu<T> menu) {
this.menu = menu;
}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenu.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenu.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenu.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -1,81 +0,0 @@
-/*
- *
- * ((e)) emite: A pure gwt (Google Web Toolkit) xmpp (jabber) library
- *
- * (c) 2008 The emite development team (see CREDITS for details)
- * This file is part of emite.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.gridmenu;
-
-import java.util.Iterator;
-
-import org.ourproject.kune.platf.client.ui.MenuItem;
-
-import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.DeferredCommand;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.menu.BaseItem;
-import com.gwtext.client.widgets.menu.Item;
-import com.gwtext.client.widgets.menu.Menu;
-import com.gwtext.client.widgets.menu.event.BaseItemListenerAdapter;
-
-public class GridMenu<T> {
- private final T param;
- private final Menu menu;
-
- /**
- *
- * @param param
- * the uniq id (for instance a group short name, a xmpp uri
- * of the object asociated with this menu
- *
- */
- public GridMenu(final T param) {
- this.param = param;
- menu = new Menu();
- }
-
- public void addMenuItem(final MenuItem<T> menuItem) {
- final Item item = new Item(menuItem.getTitle());
- item.setIcon(menuItem.getIcon());
- menu.addItem(item);
- item.addListener(new BaseItemListenerAdapter() {
- public void onClick(final BaseItem item, final EventObject e) {
- DeferredCommand.addCommand(new Command() {
- public void execute() {
- menuItem.fire(param);
- }
- });
- }
- });
- }
-
- @SuppressWarnings("unchecked")
- public void addMenuItemList(final GridMenuItemCollection list) {
- for (final Iterator iterator = list.iterator(); iterator.hasNext();) {
- final MenuItem item = (MenuItem) iterator.next();
- addMenuItem(item);
- }
- }
-
- public void showMenu(final EventObject e) {
- if (menu.getItems().length > 0) {
- menu.showAt(e.getXY());
- }
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuItemCollection.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuItemCollection.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuItemCollection.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -1,32 +0,0 @@
-/*
- *
- * ((e)) emite: A pure gwt (Google Web Toolkit) xmpp (jabber) library
- *
- * (c) 2008 The emite development team (see CREDITS for details)
- * This file is part of emite.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.gridmenu;
-
-import java.util.ArrayList;
-
-import org.ourproject.kune.platf.client.ui.MenuItem;
-
-public class GridMenuItemCollection<T> extends ArrayList<MenuItem<T>> {
-
- private static final long serialVersionUID = 1L;
-
-}
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-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -3,6 +3,7 @@
import java.util.ArrayList;
import java.util.HashMap;
+
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.signal.Signal;
import com.calclab.suco.client.signal.Slot;
@@ -52,7 +53,7 @@
private static final String END_ICON_HTML = "endIconHtmlField";
private static final String TOOLTIP = "tooltipField";
private static final String TOOLTIPTITLE = "tooltipTitleField";
- private final HashMap<String, GridMenu<T>> menuMap;
+ private final HashMap<String, CustomMenu<T>> menuMap;
private final HashMap<T, Record> recordMap;
private RecordDef recordDef;
private GroupingStore store;
@@ -107,7 +108,7 @@
bottomBar = new Toolbar();
super.setBottomToolbar(bottomBar);
}
- menuMap = new HashMap<String, GridMenu<T>>();
+ menuMap = new HashMap<String, CustomMenu<T>>();
recordMap = new HashMap<T, Record>();
super.addListener(new BoxComponentListenerAdapter() {
@Override
@@ -391,7 +392,7 @@
private void showMenu(final int rowIndex, final EventObject e) {
final Record record = store.getRecordAt(rowIndex);
- final GridMenu<T> menu = menuMap.get(record.getAsString(ID));
+ final CustomMenu<T> menu = menuMap.get(record.getAsString(ID));
if (menu != null) {
menu.showMenu(e);
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/ParticipationData.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/ParticipationData.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/ParticipationData.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -21,34 +21,34 @@
import java.util.List;
-import org.ourproject.kune.platf.server.users.Link;
+import org.ourproject.kune.platf.server.domain.Group;
public class ParticipationData {
- private List<Link> groupsIsAdmin;
- private List<Link> groupsIsCollab;
+ private List<Group> groupsIsAdmin;
+ private List<Group> groupsIsCollab;
public ParticipationData() {
this(null, null);
}
- public ParticipationData(final List<Link> groupsIsAdmin, final List<Link> groupsIsCollab) {
+ public ParticipationData(final List<Group> groupsIsAdmin, final List<Group> groupsIsCollab) {
this.groupsIsAdmin = groupsIsAdmin;
this.groupsIsCollab = groupsIsCollab;
}
- public List<Link> getGroupsIsAdmin() {
+ public List<Group> getGroupsIsAdmin() {
return groupsIsAdmin;
}
- public void setGroupsIsAdmin(final List<Link> groupsIsAdmin) {
- this.groupsIsAdmin = groupsIsAdmin;
+ public List<Group> getGroupsIsCollab() {
+ return groupsIsCollab;
}
- public List<Link> getGroupsIsCollab() {
- return groupsIsCollab;
+ public void setGroupsIsAdmin(final List<Group> groupsIsAdmin) {
+ this.groupsIsAdmin = groupsIsAdmin;
}
- public void setGroupsIsCollab(final List<Link> groupsIsCollab) {
+ public void setGroupsIsCollab(final List<Group> groupsIsCollab) {
this.groupsIsCollab = groupsIsCollab;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerDefault.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerDefault.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -20,8 +20,6 @@
package org.ourproject.kune.platf.server.manager.impl;
-import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import javax.persistence.EntityManager;
@@ -42,7 +40,6 @@
import org.ourproject.kune.platf.server.domain.SocialNetwork;
import org.ourproject.kune.platf.server.domain.User;
import org.ourproject.kune.platf.server.manager.SocialNetworkManager;
-import org.ourproject.kune.platf.server.users.Link;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -147,28 +144,7 @@
final Long groupId = group.getId();
final List<Group> adminInGroups = finder.findAdminInGroups(groupId);
final List<Group> collabInGroups = finder.findCollabInGroups(groupId);
- final List<Link> groupsIsAdmin = new ArrayList<Link>();
- final List<Link> groupsIsCollab = new ArrayList<Link>();
- Iterator<Group> iter = adminInGroups.iterator();
- while (iter.hasNext()) {
- final Group g = iter.next();
- if (group.getId() != g.getId()) {
- // Don't self participation of group in same group
- groupsIsAdmin
- .add(new Link(g.getShortName(), g.getLongName(), "", g.getDefaultContent().getStateToken()));
- }
-
- }
- iter = collabInGroups.iterator();
- while (iter.hasNext()) {
- final Group g = iter.next();
- if (group.getId() != g.getId()) {
- groupsIsCollab.add(new Link(g.getShortName(), g.getLongName(), "", g.getDefaultContent()
- .getStateToken()));
- }
- }
-
- return new ParticipationData(groupsIsAdmin, groupsIsCollab);
+ return new ParticipationData(adminInGroups, collabInGroups);
}
public SocialNetworkRequestResult requestToJoin(final User user, final Group inGroup) throws DefaultException,
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfo.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfo.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -21,6 +21,7 @@
import java.util.List;
+import org.ourproject.kune.platf.server.domain.Group;
import org.ourproject.kune.platf.server.domain.I18nCountry;
import org.ourproject.kune.platf.server.domain.I18nLanguage;
@@ -30,90 +31,90 @@
private String chatName;
private String chatPassword;
private String homePage;
- private List<Link> groupsIsAdmin;
- private List<Link> groupsIsCollab;
+ private List<Group> groupsIsAdmin;
+ private List<Group> groupsIsCollab;
private String userHash;
private I18nLanguage language;
private I18nCountry country;
- public String getHomePage() {
- return homePage;
+ public String getChatName() {
+ return chatName;
}
- public void setHomePage(final String homePage) {
- this.homePage = homePage;
+ public String getChatPassword() {
+ return chatPassword;
}
- public String getName() {
- return name;
+ public I18nCountry getCountry() {
+ return country;
}
- public void setName(final String name) {
- this.name = name;
+ public List<Group> getGroupsIsAdmin() {
+ return groupsIsAdmin;
}
- public String getChatName() {
- return chatName;
+ public List<Group> getGroupsIsCollab() {
+ return groupsIsCollab;
}
- public void setChatName(final String chatName) {
- this.chatName = chatName;
+ public String getHomePage() {
+ return homePage;
}
- public String getChatPassword() {
- return chatPassword;
+ public I18nLanguage getLanguage() {
+ return language;
}
- public void setChatPassword(final String chatPassword) {
- this.chatPassword = chatPassword;
+ public String getName() {
+ return name;
}
- public List<Link> getGroupsIsCollab() {
- return groupsIsCollab;
+ public String getShortName() {
+ return shortName;
}
- public void setGroupsIsCollab(final List<Link> groupsIsCollab) {
- this.groupsIsCollab = groupsIsCollab;
+ public String getUserHash() {
+ return userHash;
}
- public List<Link> getGroupsIsAdmin() {
- return groupsIsAdmin;
+ public void setChatName(final String chatName) {
+ this.chatName = chatName;
}
- public void setGroupsIsAdmin(final List<Link> groupsIsAdmin) {
- this.groupsIsAdmin = groupsIsAdmin;
+ public void setChatPassword(final String chatPassword) {
+ this.chatPassword = chatPassword;
}
- public String getShortName() {
- return shortName;
+ public void setCountry(final I18nCountry country) {
+ this.country = country;
}
- public void setShortName(final String shortName) {
- this.shortName = shortName;
+ public void setGroupsIsAdmin(final List<Group> groupsIsAdmin) {
+ this.groupsIsAdmin = groupsIsAdmin;
}
- public void setUserHash(final String userHash) {
- this.userHash = userHash;
+ public void setGroupsIsCollab(final List<Group> groupsIsCollab) {
+ this.groupsIsCollab = groupsIsCollab;
}
- public String getUserHash() {
- return userHash;
+ public void setHomePage(final String homePage) {
+ this.homePage = homePage;
}
- public I18nLanguage getLanguage() {
- return language;
+ public void setLanguage(final I18nLanguage language) {
+ this.language = language;
}
- public void setLanguage(final I18nLanguage language) {
- this.language = language;
+ public void setName(final String name) {
+ this.name = name;
}
- public I18nCountry getCountry() {
- return country;
+ public void setShortName(final String shortName) {
+ this.shortName = shortName;
}
- public void setCountry(final I18nCountry country) {
- this.country = country;
+ public void setUserHash(final String userHash) {
+ this.userHash = userHash;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslator.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslator.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslator.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -21,6 +21,6 @@
public interface I18nTranslator {
- void show();
+ void doShowTranslator();
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -25,6 +25,7 @@
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.workspace.client.sitebar.Site;
+import com.calclab.suco.client.signal.Slot0;
import com.google.gwt.user.client.rpc.AsyncCallback;
public class I18nTranslatorPresenter implements I18nTranslator {
@@ -38,6 +39,11 @@
this.session = session;
this.i18nService = i18nService;
this.i18n = i18n;
+ session.onUserSignOut(new Slot0() {
+ public void onEvent() {
+ view.hideTranslatorAndIcon();
+ }
+ });
}
public void doClose() {
@@ -89,8 +95,4 @@
this.view = view;
}
- public void show() {
- view.show();
- }
-
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorView.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorView.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -23,10 +23,12 @@
public interface I18nTranslatorView extends View {
- void show();
+ void close();
void hide();
- void close();
+ void hideTranslatorAndIcon();
+ void show();
+
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/ui/I18nTranslatorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/ui/I18nTranslatorPanel.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/ui/I18nTranslatorPanel.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -92,6 +92,16 @@
dialog.hide();
}
+ public void hideTranslatorAndIcon() {
+ if (dialog.isRendered()) {
+ dialog.hide();
+ }
+ if (traybarButton != null) {
+ traybarButton.destroy();
+ traybarButton = null;
+ }
+ }
+
public void show() {
if (dialog == null) {
dialog = createDialog();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteBottomTrayButton.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteBottomTrayButton.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteBottomTrayButton.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -30,4 +30,8 @@
ws.getSiteTraybar().addButton(traybarButton);
}
+ public void destroy() {
+ traybarButton.destroy();
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -193,7 +193,8 @@
} else {
view.showLoggedUserName(user.getShortName(), user.getHomePage());
view.setLogoutLinkVisible(true);
- view.setGroupsIsMember(user.getGroupsIsAdmin(), user.getGroupsIsCollab());
+ // view.setGroupsIsMember(user.getGroupsIsAdmin(),
+ // user.getGroupsIsCollab());
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -23,7 +23,6 @@
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
import org.ourproject.kune.platf.client.dto.GroupDTO;
-import org.ourproject.kune.platf.client.dto.LinkDTO;
import org.ourproject.kune.platf.client.dto.ParticipationDataDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
@@ -84,25 +83,17 @@
final ParticipationDataDTO participation = state.getParticipation();
final AccessRightsDTO rights = state.getGroupRights();
view.clear();
- final List<LinkDTO> groupsIsAdmin = participation.getGroupsIsAdmin();
- final List<LinkDTO> groupsIsCollab = participation.getGroupsIsCollab();
+ final List<GroupDTO> groupsIsAdmin = participation.getGroupsIsAdmin();
+ final List<GroupDTO> groupsIsCollab = participation.getGroupsIsCollab();
final int numAdmins = groupsIsAdmin.size();
final int numCollaborators = groupsIsCollab.size();
if (numAdmins == 0) {
collabCategory = collabOnlyCategory;
}
- for (final LinkDTO link : groupsIsAdmin) {
- // FIXME: return GroupDTO not LinkDTO from server
- final GroupDTO group = new GroupDTO();
- group.setShortName(link.getShortName());
- group.setLongName(link.getLongName());
+ for (final GroupDTO group : groupsIsAdmin) {
view.addItem(createGridItem(adminCategory, group, rights, unJoinMenuItem));
}
- for (final LinkDTO link : groupsIsCollab) {
- // FIXME: return GroupDTO not LinkDTO from server
- final GroupDTO group = new GroupDTO();
- group.setShortName(link.getShortName());
- group.setLongName(link.getLongName());
+ for (final GroupDTO group : groupsIsCollab) {
view.addItem(createGridItem(collabCategory, group, rights, unJoinMenuItem));
}
if (numAdmins > 0 || numCollaborators > 0) {
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-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -12,11 +12,11 @@
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.MenuItem;
+import org.ourproject.kune.platf.client.ui.MenuItemCollection;
+import org.ourproject.kune.platf.client.ui.gridmenu.CustomMenu;
import org.ourproject.kune.platf.client.ui.gridmenu.GridButton;
import org.ourproject.kune.platf.client.ui.gridmenu.GridGroup;
import org.ourproject.kune.platf.client.ui.gridmenu.GridItem;
-import org.ourproject.kune.platf.client.ui.gridmenu.GridMenu;
-import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuItemCollection;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.Site;
@@ -39,11 +39,11 @@
private final StateManager stateManager;
private final Provider<SocialNetworkServiceAsync> snServiceProvider;
private final Session session;
- private final GridMenuItemCollection<GroupDTO> otherOperations;
- private final GridMenuItemCollection<GroupDTO> otherLoggedOperations;
+ private final MenuItemCollection<GroupDTO> otherOperations;
+ private final MenuItemCollection<GroupDTO> otherLoggedOperations;
private final ImageUtils imageUtils;
- private final GridMenuItemCollection<GroupDTO> otherOperationsUsers;
- private final GridMenuItemCollection<GroupDTO> otherLoggedOperationsUsers;
+ private final MenuItemCollection<GroupDTO> otherOperationsUsers;
+ private final MenuItemCollection<GroupDTO> otherLoggedOperationsUsers;
public SocialNetworkPresenter(final I18nUITranslationService i18n, final StateManager stateManager,
final ImageUtils imageUtils, final Session session,
@@ -55,33 +55,33 @@
this.snServiceProvider = snServiceProvider;
createButtons();
createMenuActions();
- otherOperationsUsers = new GridMenuItemCollection<GroupDTO>();
- otherLoggedOperationsUsers = new GridMenuItemCollection<GroupDTO>();
- otherOperations = new GridMenuItemCollection<GroupDTO>();
- otherLoggedOperations = new GridMenuItemCollection<GroupDTO>();
+ otherOperationsUsers = new MenuItemCollection<GroupDTO>();
+ otherLoggedOperationsUsers = new MenuItemCollection<GroupDTO>();
+ otherOperations = new MenuItemCollection<GroupDTO>();
+ otherLoggedOperations = new MenuItemCollection<GroupDTO>();
}
public void addGroupOperation(final MenuItem<GroupDTO> operation, final boolean mustBeLogged) {
- GridMenuItemCollection<GroupDTO> collection;
+ MenuItemCollection<GroupDTO> collection;
collection = mustBeLogged ? otherLoggedOperations : otherOperations;
collection.add(operation);
}
public void addUserOperation(final MenuItem<GroupDTO> operation, final boolean mustBeLogged) {
- GridMenuItemCollection<GroupDTO> collection;
+ MenuItemCollection<GroupDTO> collection;
collection = mustBeLogged ? otherLoggedOperationsUsers : otherOperationsUsers;
collection.add(operation);
}
public void removeGroupOperation(final MenuItem<GroupDTO> operation, final boolean mustBeLogged) {
- GridMenuItemCollection<GroupDTO> collection;
+ MenuItemCollection<GroupDTO> collection;
collection = mustBeLogged ? otherLoggedOperations : otherOperations;
collection.remove(operation);
}
public void removeUserOperation(final MenuItem<GroupDTO> operation, final boolean mustBeLogged) {
- GridMenuItemCollection<GroupDTO> collection;
+ MenuItemCollection<GroupDTO> collection;
collection = mustBeLogged ? otherLoggedOperationsUsers : otherOperationsUsers;
collection.remove(operation);
}
@@ -89,7 +89,7 @@
protected GridItem<GroupDTO> createGridItem(final GridGroup groupCategory, final GroupDTO group,
final AccessRightsDTO rights, final MenuItem<GroupDTO>... gridMenuItems) {
final GridItem<GroupDTO> gridItem = createDefMemberMenu(group, groupCategory);
- final GridMenu<GroupDTO> menu = gridItem.getMenu();
+ final CustomMenu<GroupDTO> menu = gridItem.getMenu();
if (rights.isAdministrable()) {
for (final MenuItem<GroupDTO> item : gridMenuItems) {
menu.addMenuItem(item);
@@ -134,7 +134,7 @@
}
private GridItem<GroupDTO> createDefMemberMenu(final GroupDTO group, final GridGroup gridGroup) {
- final GridMenu<GroupDTO> menu = new GridMenu<GroupDTO>(group);
+ final CustomMenu<GroupDTO> menu = new CustomMenu<GroupDTO>(group);
final String longName = group.getLongName();
final String toolTip = i18n.t(group.getType().equals(GroupType.PERSONAL) ? "User nickname: [%s]"
: "Group short name: [%s]", group.getShortName());
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteoptions/SiteOptionsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteoptions/SiteOptionsPanel.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteoptions/SiteOptionsPanel.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -1,9 +1,52 @@
package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteoptions;
+import org.ourproject.kune.workspace.client.i18n.I18nTranslator;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import com.calclab.suco.client.container.Provider;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.PushButton;
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.menu.BaseItem;
+import com.gwtext.client.widgets.menu.Item;
+import com.gwtext.client.widgets.menu.Menu;
+import com.gwtext.client.widgets.menu.event.BaseItemListenerAdapter;
+
public class SiteOptionsPanel implements SiteOptionsView {
- public SiteOptionsPanel(final SiteOptionsPresenter presenter, final WorkspaceSkeleton ws) {
+ public SiteOptionsPanel(final SiteOptionsPresenter presenter, final WorkspaceSkeleton ws,
+ final I18nUITranslationService i18n, final Provider<I18nTranslator> translatorProvider) {
+ final PushButton optionsButton = new PushButton("");
+ optionsButton.setText(i18n.t("Options"));
+ optionsButton.setStyleName("k-sitebar-labellink");
+ ws.getSiteBar().addSeparator();
+ ws.getSiteBar().add(optionsButton);
+ final Menu optionsMenu = new Menu();
+ optionsButton.addClickListener(new ClickListener() {
+ public void onClick(final Widget sender) {
+ optionsMenu.showAt(sender.getAbsoluteLeft(), sender.getAbsoluteTop() + 10);
+ }
+ });
+ final Item linkHelpInTrans = new Item(i18n.t("Help with the translation"), new BaseItemListenerAdapter() {
+ @Override
+ public void onClick(BaseItem item, EventObject e) {
+ super.onClick(item, e);
+ translatorProvider.get().doShowTranslator();
+ }
+ }, "images/language.gif");
+
+ final Item linkKuneBugs = new Item(i18n.t("Report kune bugs"), new BaseItemListenerAdapter() {
+ @Override
+ public void onClick(BaseItem item, EventObject e) {
+ super.onClick(item, e);
+ Window.open("http://code.google.com/p/kune/issues/list", "_blank", null);
+ }
+ }, "images/kuneicon16.gif");
+ optionsMenu.addItem(linkHelpInTrans);
+ optionsMenu.addItem(linkKuneBugs);
+
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteoptions/SiteOptionsPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteoptions/SiteOptionsPresenter.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteoptions/SiteOptionsPresenter.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -4,19 +4,17 @@
public class SiteOptionsPresenter implements SiteOptions {
-private SiteOptionsView view;
+ private SiteOptionsView view;
-public SiteOptionsPresenter() {
-}
+ public SiteOptionsPresenter() {
+ }
-public void init(SiteOptionsView view) {
-this.view = view;
-}
-
-
public View getView() {
- return view;
+ return view;
}
-}
+ public void init(final SiteOptionsView view) {
+ this.view = view;
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPanel.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPanel.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -1,39 +1,72 @@
package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteusermenu;
-import java.util.List;
-
-import org.ourproject.kune.platf.client.dto.LinkDTO;
+import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.ui.MenuItemCollection;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.PushButton;
import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.menu.BaseItem;
+import com.gwtext.client.widgets.menu.Item;
import com.gwtext.client.widgets.menu.Menu;
+import com.gwtext.client.widgets.menu.MenuItem;
+import com.gwtext.client.widgets.menu.event.BaseItemListenerAdapter;
public class SiteUserMenuPanel implements SiteUserMenuView {
private final PushButton loggedUserMenu;
private final Widget separator;
private final Menu userMenu;
+ private final Menu userParticipation;
- public SiteUserMenuPanel(final SiteUserMenuPresenter presenter, final WorkspaceSkeleton ws) {
+ public SiteUserMenuPanel(final SiteUserMenuPresenter presenter, final WorkspaceSkeleton ws,
+ final I18nUITranslationService i18n) {
loggedUserMenu = new PushButton("");
+ loggedUserMenu.setStyleName("k-sitebar-labellink");
ws.getSiteBar().add(loggedUserMenu);
separator = ws.getSiteBar().addSeparator();
userMenu = new Menu();
loggedUserMenu.addClickListener(new ClickListener() {
public void onClick(final Widget sender) {
- userMenu.showAt(sender.getAbsoluteLeft(), sender.getAbsoluteTop());
+ userMenu.showAt(sender.getAbsoluteLeft(), sender.getAbsoluteTop() + 10);
}
});
+ final Item userPreferences = new Item(i18n.t("Your preferences"));
+ userPreferences.setIcon("");
+ userPreferences.addListener(new BaseItemListenerAdapter() {
+ @Override
+ public void onClick(final BaseItem item, final EventObject e) {
+ super.onClick(item, e);
+ presenter.onUserPreferences();
+ }
+ });
+ userMenu.addItem(userPreferences);
+ userParticipation = new Menu();
+ final MenuItem userParticipationItem = new MenuItem(i18n.t("Your groups"), userParticipation);
+ userParticipationItem.setIcon("");
+ userMenu.addItem(userParticipationItem);
}
public void setLoggedUserName(final String name) {
loggedUserMenu.setText(name);
}
- public void setUseGroupsIsMember(final List<LinkDTO> groupsIsAdmin, final List<LinkDTO> groupsIsCollab) {
- // TODO Auto-generated method stub
+ public void setParticipation(final MenuItemCollection<GroupDTO> participateInGroups) {
+ for (final org.ourproject.kune.platf.client.ui.MenuItem<GroupDTO> groupItem : participateInGroups) {
+ userParticipation.removeAll();
+ final Item item = new Item(groupItem.getTitle(), new BaseItemListenerAdapter() {
+ @Override
+ public void onClick(BaseItem item, EventObject e) {
+ super.onClick(item, e);
+ groupItem.fire(null);
+ }
+ });
+ item.setIcon(groupItem.getIcon());
+ userParticipation.addItem(item);
+ }
}
public void setVisible(final boolean visible) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPresenter.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPresenter.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -1,8 +1,12 @@
package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteusermenu;
import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.ui.MenuItem;
+import org.ourproject.kune.platf.client.ui.MenuItemCollection;
import com.calclab.suco.client.signal.Slot;
import com.calclab.suco.client.signal.Slot0;
@@ -10,14 +14,17 @@
public class SiteUserMenuPresenter implements SiteUserMenu {
private SiteUserMenuView view;
+ private final MenuItemCollection<GroupDTO> participateInGroups;
+ private final StateManager stateManager;
- public SiteUserMenuPresenter(final Session session) {
+ public SiteUserMenuPresenter(final Session session, final StateManager stateManager) {
+ this.stateManager = stateManager;
+ participateInGroups = new MenuItemCollection<GroupDTO>();
session.onUserSignIn(new Slot<UserInfoDTO>() {
public void onEvent(final UserInfoDTO userInfoDTO) {
- view.setVisible(true);
- view.setLoggedUserName(userInfoDTO.getShortName());
- view.setUseGroupsIsMember(userInfoDTO.getGroupsIsAdmin(), userInfoDTO.getGroupsIsCollab());
+ onUserSignIn(userInfoDTO);
}
+
});
session.onUserSignOut(new Slot0() {
public void onEvent() {
@@ -35,4 +42,29 @@
this.view = view;
}
+ public void onUserPreferences() {
+ // TODO Auto-generated method stub
+ }
+
+ private void addPartipation(final GroupDTO group) {
+ participateInGroups.add(new MenuItem<GroupDTO>("", group.getShortName(), new Slot<GroupDTO>() {
+ public void onEvent(final GroupDTO param) {
+ stateManager.gotoToken(group.getShortName());
+ }
+ }));
+ }
+
+ private void onUserSignIn(final UserInfoDTO userInfoDTO) {
+ view.setVisible(true);
+ view.setLoggedUserName(userInfoDTO.getShortName());
+ participateInGroups.clear();
+ for (final GroupDTO group : userInfoDTO.getGroupsIsAdmin()) {
+ addPartipation(group);
+ }
+ for (final GroupDTO group : userInfoDTO.getGroupsIsCollab()) {
+ addPartipation(group);
+ }
+ view.setParticipation(participateInGroups);
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuView.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuView.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -1,15 +1,14 @@
package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteusermenu;
-import java.util.List;
-
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.LinkDTO;
+import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.ui.MenuItemCollection;
public interface SiteUserMenuView extends View {
void setLoggedUserName(String name);
- void setUseGroupsIsMember(List<LinkDTO> groupsIsAdmin, List<LinkDTO> groupsIsCollab);
+ void setParticipation(MenuItemCollection<GroupDTO> participateInGroups);
void setVisible(boolean visible);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -39,6 +39,8 @@
public void addInTools(final Widget widget) {
entityTools.add(widget);
+ entityTools.expand();
+ // entitySummary.expand();
mainPanel.syncSize();
if (entityTools.isRendered()) {
entityTools.doLayout(false);
Modified: trunk/src/main/resources/dozerBeanMapping.xml
===================================================================
--- trunk/src/main/resources/dozerBeanMapping.xml 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/main/resources/dozerBeanMapping.xml 2008-08-08 17:48:55 UTC (rev 835)
@@ -179,18 +179,6 @@
<class-a>org.ourproject.kune.platf.client.dto.UserInfoDTO</class-a>
<class-b>org.ourproject.kune.platf.server.users.UserInfo</class-b>
<field>
- <a>groupsIsAdmin</a>
- <b>groupsIsAdmin</b>
- <a-hint>org.ourproject.kune.platf.client.dto.LinkDTO</a-hint>
- <b-hint>org.ourproject.kune.platf.server.users.Link</b-hint>
- </field>
- <field>
- <a>groupsIsCollab</a>
- <b>groupsIsCollab</b>
- <a-hint>org.ourproject.kune.platf.client.dto.LinkDTO</a-hint>
- <b-hint>org.ourproject.kune.platf.server.users.Link</b-hint>
- </field>
- <field>
<a>language</a>
<b>language</b>
<a-hint>
@@ -219,18 +207,6 @@
<class-b>
org.ourproject.kune.platf.server.ParticipationData
</class-b>
- <field>
- <a>groupsIsAdmin</a>
- <b>groupsIsAdmin</b>
- <a-hint>org.ourproject.kune.platf.client.dto.LinkDTO</a-hint>
- <b-hint>org.ourproject.kune.platf.server.users.Link</b-hint>
- </field>
- <field>
- <a>groupsIsCollab</a>
- <b>groupsIsCollab</b>
- <a-hint>org.ourproject.kune.platf.client.dto.LinkDTO</a-hint>
- <b-hint>org.ourproject.kune.platf.server.users.Link</b-hint>
- </field>
</mapping>
<mapping>
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/site/UserServiceTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/site/UserServiceTest.java 2008-08-08 04:20:12 UTC (rev 834)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/site/UserServiceTest.java 2008-08-08 17:48:55 UTC (rev 835)
@@ -8,9 +8,9 @@
import org.junit.Before;
import org.junit.Test;
+import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.I18nCountryDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
-import org.ourproject.kune.platf.client.dto.LinkDTO;
import org.ourproject.kune.platf.client.dto.TimeZoneDTO;
import org.ourproject.kune.platf.client.dto.UserDTO;
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
@@ -20,10 +20,10 @@
import org.ourproject.kune.platf.integration.IntegrationTest;
import org.ourproject.kune.platf.integration.IntegrationTestHelper;
import org.ourproject.kune.platf.server.UserSession;
+import org.ourproject.kune.platf.server.domain.Group;
import org.ourproject.kune.platf.server.manager.I18nLanguageManager;
import org.ourproject.kune.platf.server.mapper.Mapper;
import org.ourproject.kune.platf.server.properties.DatabaseProperties;
-import org.ourproject.kune.platf.server.users.Link;
import org.ourproject.kune.platf.server.users.UserInfo;
import org.ourproject.kune.platf.server.users.UserInfoService;
import org.ourproject.kune.workspace.client.sitebar.rpc.UserService;
@@ -50,78 +50,77 @@
@Test(expected = EmailAddressInUseException.class)
public void createUserExistingEmailFails() throws Exception {
- assertNull(session.getUser().getId());
- final UserDTO user = new UserDTO("test", "test", "123456", properties.getAdminEmail(), lang, country, timezone,
- null, true, SubscriptionMode.manual, "blue");
- userService.createUser(user);
+ assertNull(session.getUser().getId());
+ final UserDTO user = new UserDTO("test", "test", "123456", properties.getAdminEmail(), lang, country, timezone,
+ null, true, SubscriptionMode.manual, "blue");
+ userService.createUser(user);
}
@Test(expected = GroupNameInUseException.class)
public void createUserExistingNameFails() throws Exception {
- assertNull(session.getUser().getId());
- final UserDTO user = new UserDTO("test", properties.getAdminShortName(), "123456", "example at example.com", lang,
- country, timezone, null, true, SubscriptionMode.manual, "blue");
- userService.createUser(user);
+ assertNull(session.getUser().getId());
+ final UserDTO user = new UserDTO("test", properties.getAdminShortName(), "123456", "example at example.com", lang,
+ country, timezone, null, true, SubscriptionMode.manual, "blue");
+ userService.createUser(user);
}
@Before
public void init() {
- new IntegrationTestHelper(this);
- lang = new I18nLanguageDTO();
- country = new I18nCountryDTO();
- timezone = new TimeZoneDTO();
- lang.setCode("en");
- country.setCode("GB");
- timezone.setId("GMT");
+ new IntegrationTestHelper(this);
+ lang = new I18nLanguageDTO();
+ country = new I18nCountryDTO();
+ timezone = new TimeZoneDTO();
+ lang.setCode("en");
+ country.setCode("GB");
+ timezone.setId("GMT");
}
@Test(expected = SessionExpiredException.class)
public void testReloadUserInfoNotLogged() throws Exception {
- assertNull(session.getUser().getId());
- userService.reloadUserInfo("AndOldUserHash");
+ assertNull(session.getUser().getId());
+ userService.reloadUserInfo("AndOldUserHash");
}
@Test
public void testSiteEmailLogin() throws Exception {
- assertNull(session.getUser().getId());
- userService.login(properties.getAdminEmail(), properties.getAdminPassword());
- assertNotNull(session.getUser().getId());
+ assertNull(session.getUser().getId());
+ userService.login(properties.getAdminEmail(), properties.getAdminPassword());
+ assertNotNull(session.getUser().getId());
}
@Test
public void testSiteNameLogin() throws Exception {
- assertNull(session.getUser().getId());
- userService.login(properties.getAdminShortName(), properties.getAdminPassword());
- assertNotNull(session.getUser().getId());
+ assertNull(session.getUser().getId());
+ userService.login(properties.getAdminShortName(), properties.getAdminPassword());
+ assertNotNull(session.getUser().getId());
}
@Test
public void testUserInfo() throws Exception {
- doLogin();
- final UserInfo userInfo = userInfoService.buildInfo(session.getUser(), session.getHash());
+ doLogin();
+ final UserInfo userInfo = userInfoService.buildInfo(session.getUser(), session.getHash());
- final UserInfoDTO userInfoDTO = mapper.map(userInfo, UserInfoDTO.class);
- assertEquals(userInfo.getName(), userInfoDTO.getName());
- assertEquals(userInfo.getChatName(), userInfoDTO.getChatName());
- assertEquals(userInfo.getChatPassword(), userInfoDTO.getChatPassword());
- final List<Link> adminsGroup = userInfo.getGroupsIsAdmin();
- final List<LinkDTO> adminsGroupDTO = userInfoDTO.getGroupsIsAdmin();
- assertEqualListsLink(adminsGroupDTO, adminsGroup);
+ final UserInfoDTO userInfoDTO = mapper.map(userInfo, UserInfoDTO.class);
+ assertEquals(userInfo.getName(), userInfoDTO.getName());
+ assertEquals(userInfo.getChatName(), userInfoDTO.getChatName());
+ assertEquals(userInfo.getChatPassword(), userInfoDTO.getChatPassword());
+ final List<Group> adminsGroup = userInfo.getGroupsIsAdmin();
+ final List<GroupDTO> adminsGroupDTO = userInfoDTO.getGroupsIsAdmin();
+ assertEqualGroupLists(adminsGroupDTO, adminsGroup);
}
- private void assertEqualListsLink(final List<LinkDTO> listDTO, final List<Link> list) {
- assertEquals(listDTO.size(), list.size());
- for (int i = 0; i < listDTO.size(); i++) {
- final Object object = listDTO.get(i);
- assertEquals(LinkDTO.class, object.getClass());
- final LinkDTO d = (LinkDTO) object;
- final Link l = list.get(i);
- assertNotNull(d);
- assertNotNull(l);
- final LinkDTO map = mapper.map(l, LinkDTO.class);
- assertEquals(map.getShortName(), d.getShortName());
- assertEquals(map.getLink(), d.getLink());
- }
+ private void assertEqualGroupLists(final List<GroupDTO> listDTO, final List<Group> list) {
+ assertEquals(listDTO.size(), list.size());
+ for (int i = 0; i < listDTO.size(); i++) {
+ final Object object = listDTO.get(i);
+ assertEquals(GroupDTO.class, object.getClass());
+ final GroupDTO d = (GroupDTO) object;
+ final Group l = list.get(i);
+ assertNotNull(d);
+ assertNotNull(l);
+ final GroupDTO map = mapper.map(l, GroupDTO.class);
+ assertEquals(map.getShortName(), d.getShortName());
+ }
}
}
More information about the kune-commits
mailing list