kune-commits
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
August 2008
- 1 participants
- 21 discussions
Author: vjrj
Date: 2008-08-30 18:58:14 +0200 (Sat, 30 Aug 2008)
New Revision: 843
Modified:
trunk/INSTALL
trunk/pom.xml
trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml
Log:
gwt 1.5.2
Modified: trunk/INSTALL
===================================================================
--- trunk/INSTALL 2008-08-30 14:57:17 UTC (rev 842)
+++ trunk/INSTALL 2008-08-30 16:58:14 UTC (rev 843)
@@ -4,7 +4,7 @@
For development:
- Install java-jdk (>= 1.5), maven2, mysql (>= 5.0) and for example eclipse
-- Install gwt 1.5rc1 and follow Appendix A for maven+gwt configuration
+- Install gwt 1.5.2 and follow Appendix A for maven+gwt configuration
- Compile with maven:
# (in the trunk directory)
mvn compile
@@ -63,9 +63,9 @@
</properties>
</profile>
<profile>
- <id>gwt-0.0.2030</id>
+ <id>gwt-1.5.2</id>
<properties>
- <google.webtoolkit.home>/usr/local/lib/gwt/gwt-linux-0.0.2030</google.webtoolkit.home>
+ <google.webtoolkit.home>/usr/local/lib/gwt/gwt-linux-1.5.2</google.webtoolkit.home>
<!-- <google.webtoolkit.devjar>gwt-dev-linux</google.webtoolkit.devjar> -->
<!-- you only need this is you are on a mac -->
<google.webtoolkit.extrajvmargs>-Xmx256M</google.webtoolkit.extrajvmargs>
@@ -73,7 +73,7 @@
</profile>
</profiles>
<activeProfiles>
- <activeProfile>gwt-0.0.2030</activeProfile>
+ <activeProfile>gwt-1.5.2</activeProfile>
</activeProfiles>
</settings>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2008-08-30 14:57:17 UTC (rev 842)
+++ trunk/pom.xml 2008-08-30 16:58:14 UTC (rev 843)
@@ -31,13 +31,13 @@
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
- <version>1.5.0</version>
+ <version>1.5.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
- <version>1.5.0</version>
+ <version>1.5.2</version>
</dependency>
<!-- Use new repo -->
<!-- http://code.google.com/p/gwt-ext/issues/detail?id=180 -->
Modified: trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml 2008-08-30 14:57:17 UTC (rev 842)
+++ trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml 2008-08-30 16:58:14 UTC (rev 843)
@@ -1,6 +1,10 @@
<module>
<inherits name='com.google.gwt.i18n.I18N' />
<inherits name='com.google.gwt.user.User' />
+
+ <!-- http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/4d38… -->
+ <set-property name="gwt.suppressNonStaticFinalFieldWarnings" value="true" />
+
<inherits name="org.cafesip.gwtcomp.GWTComponents" />
<inherits name="com.calclab.suco.Suco" />
1
0
Author: vjrj
Date: 2008-08-30 16:57:17 +0200 (Sat, 30 Aug 2008)
New Revision: 842
Removed:
trunk/src/main/java/org/ourproject/kune/platf/client/dto/CustomPropertiesDTO.java
Modified:
trunk/pom.xml
trunk/src/main/java/org/ourproject/kune/app/server/AbstractExtendedModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/folder/FolderContextPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserInfoDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/Kune.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.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/CustomMenu.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/server/LoggerMethodInterceptor.java
trunk/src/main/java/org/ourproject/kune/platf/server/mapper/DozerMapper.java
trunk/src/main/java/org/ourproject/kune/platf/server/mapper/Mapper.java
trunk/src/main/java/org/ourproject/kune/platf/server/rpc/UserRPC.java
trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfo.java
trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfoServiceDefault.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/Site.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.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/tags/TagsSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPresenter.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/siteprogress/SiteProgressPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java
trunk/src/main/resources/dozerBeanMapping.xml
trunk/src/test/java/org/ourproject/kune/platf/server/manager/UserManagerTest.java
trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java
trunk/src/test/java/org/ourproject/kune/rack/filters/rest/TestRESTMethodFinder.java
trunk/src/test/java/org/ourproject/kune/rack/filters/rest/TestRESTServiceDefinition.java
trunk/src/test/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePresenterTest.java
trunk/src/test/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenterTest.java
Log:
suco 0.4.0. User's CustomProperties 1st approximation removed (Object in RPC calls is not recommended)
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/pom.xml 2008-08-30 14:57:17 UTC (rev 842)
@@ -271,12 +271,12 @@
<dependency>
<groupId>com.calclab.emite</groupId>
<artifactId>emite</artifactId>
- <version>0.3.2</version>
+ <version>0.3.3</version>
</dependency>
<dependency>
<groupId>com.calclab</groupId>
<artifactId>suco</artifactId>
- <version>0.3.2</version>
+ <version>0.4.0</version>
</dependency>
</dependencies>
<!-- http://gwt-maven.googlecode.com/svn/docs/maven-googlewebtoolkit2-plugin/ind… -->
Modified: trunk/src/main/java/org/ourproject/kune/app/server/AbstractExtendedModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/server/AbstractExtendedModule.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/app/server/AbstractExtendedModule.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -19,6 +19,8 @@
*/
package org.ourproject.kune.app.server;
+import static com.google.inject.name.Names.named;
+
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.HashSet;
@@ -32,8 +34,6 @@
import com.google.inject.Injector;
import com.google.inject.matcher.Matcher;
-import static com.google.inject.name.Names.named;
-
/**
* An extension of AbstractModule that provides support for member injection of
* instances constructed at bind-time; in particular, itself and
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -27,9 +27,9 @@
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
import com.calclab.emiteuimodule.client.EmiteUIDialog;
-import com.calclab.suco.client.modules.AbstractModule;
+import com.calclab.suco.client.module.AbstractModule;
import com.calclab.suco.client.provider.Factory;
-import com.calclab.suco.client.scopes.SingletonScope;
+import com.calclab.suco.client.scope.SingletonScope;
public class ChatClientModule extends AbstractModule {
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-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -40,7 +40,7 @@
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.emite.client.xmpp.stanzas.XmppURI;
import com.calclab.emiteuimodule.client.EmiteUIDialog;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
import com.calclab.suco.client.signal.Slot;
import com.calclab.suco.client.signal.Slot0;
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -30,7 +30,7 @@
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.emite.client.xmpp.stanzas.XmppURI;
import com.calclab.emiteuimodule.client.EmiteUIDialog;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
public class ChatContentPresenter implements ChatContent {
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -25,7 +25,7 @@
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.workspace.client.component.WorkspaceDeckView;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
public class ChatContextPresenter implements ChatContext {
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -35,7 +35,7 @@
import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItemsImages;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
import com.calclab.suco.client.signal.Slot;
public class RoomsAdminPresenter implements RoomsAdmin {
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -41,9 +41,9 @@
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
-import com.calclab.suco.client.modules.AbstractModule;
+import com.calclab.suco.client.module.AbstractModule;
import com.calclab.suco.client.provider.Factory;
-import com.calclab.suco.client.scopes.SingletonScope;
+import com.calclab.suco.client.scope.SingletonScope;
public class DocumentClientModule extends AbstractModule {
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -29,7 +29,7 @@
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
public class DocumentClientTool extends AbstractClientTool {
public static final String TYPE_ROOT = "docs.root";
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -39,7 +39,7 @@
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
import com.calclab.suco.client.signal.Signal0;
import com.calclab.suco.client.signal.Slot0;
import com.google.gwt.user.client.rpc.AsyncCallback;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -27,7 +27,7 @@
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.workspace.client.component.WorkspaceDeckView;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
public class DocumentContextPresenter implements DocumentContext {
private final WorkspaceDeckView view;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -38,7 +38,7 @@
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
public class AdminContextPresenter implements AdminContext {
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/folder/FolderContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/folder/FolderContextPresenter.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/folder/FolderContextPresenter.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -35,7 +35,7 @@
import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItemsImages;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
import com.calclab.suco.client.signal.Slot;
public class FolderContextPresenter implements FolderContext {
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/dto/CustomPropertiesDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/CustomPropertiesDTO.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/CustomPropertiesDTO.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -1,37 +0,0 @@
-package org.ourproject.kune.platf.client.dto;
-
-import java.util.HashMap;
-
-import com.google.gwt.user.client.rpc.IsSerializable;
-
-public class CustomPropertiesDTO implements IsSerializable {
-
- private HashMap<Class<?>, Object> data;
-
- public CustomPropertiesDTO() {
- data = new HashMap<Class<?>, Object>();
- }
-
- public HashMap<Class<?>, Object> getData() {
- return data;
- }
-
- @SuppressWarnings("unchecked")
- public <T> T getData(final Class<T> type) {
- return (T) data.get(type);
- }
-
- public <T> boolean hasPropertie(final Class<T> type) {
- return data.containsKey(type);
- }
-
- @SuppressWarnings("unchecked")
- public <T> T setData(final Class<T> type, final T value) {
- return (T) data.put(type, value);
- }
-
- public void setData(final HashMap<Class<?>, Object> data) {
- this.data = data;
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateDTO.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateDTO.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -23,7 +23,6 @@
import java.util.Date;
import java.util.List;
-
import com.google.gwt.user.client.rpc.IsSerializable;
public class StateDTO implements IsSerializable {
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-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserInfoDTO.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -34,7 +34,6 @@
private I18nCountryDTO country;
private List<GroupDTO> groupsIsAdmin;
private List<GroupDTO> groupsIsCollab;
- private CustomPropertiesDTO customProperties;
public String getChatName() {
return chatName;
@@ -48,10 +47,6 @@
return country;
}
- public CustomPropertiesDTO getCustomProperties() {
- return customProperties;
- }
-
public List<GroupDTO> getGroupsIsAdmin() {
return groupsIsAdmin;
}
@@ -93,10 +88,6 @@
this.country = country;
}
- public void setCustomProperties(final CustomPropertiesDTO customProperties) {
- this.customProperties = customProperties;
- }
-
public void setGroupsIsAdmin(final List<GroupDTO> groupsIsAdmin) {
this.groupsIsAdmin = groupsIsAdmin;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/Kune.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/Kune.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/Kune.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -23,8 +23,8 @@
import com.calclab.suco.client.Suco;
import com.calclab.suco.client.container.Container;
import com.calclab.suco.client.container.DelegatedContainer;
-import com.calclab.suco.client.modules.Module;
-import com.calclab.suco.client.modules.ModuleManager.ProviderRegisterStrategy;
+import com.calclab.suco.client.module.Module;
+import com.calclab.suco.client.module.ModuleManager.ProviderRegisterStrategy;
public class Kune extends DelegatedContainer {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -33,7 +33,7 @@
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import com.allen_sauer.gwt.log.client.Log;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
import com.calclab.suco.client.signal.Signal0;
import com.calclab.suco.client.signal.Slot0;
import com.google.gwt.core.client.GWT;
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-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -130,10 +130,10 @@
import com.calclab.emiteuimodule.client.EmiteUIModule;
import com.calclab.suco.client.container.Container;
-import com.calclab.suco.client.modules.AbstractModule;
-import com.calclab.suco.client.modules.ModuleManager.ProviderRegisterStrategy;
+import com.calclab.suco.client.module.AbstractModule;
+import com.calclab.suco.client.module.ModuleManager.ProviderRegisterStrategy;
import com.calclab.suco.client.provider.Factory;
-import com.calclab.suco.client.scopes.SingletonScope;
+import com.calclab.suco.client.scope.SingletonScope;
import com.calclab.suco.client.signal.Slot;
import com.calclab.suco.client.signal.Slot0;
import com.google.gwt.core.client.GWT;
@@ -579,7 +579,7 @@
public ContextItems create() {
final ContextItemsPresenter presenter = new ContextItemsPresenter(i18n, $(StateManager.class),
$(Session.class), $$(ContentServiceAsync.class));
- final ContextItemsPanel panel = new ContextItemsPanel(presenter, i18n, $(StateManager.class));
+ final ContextItemsPanel panel = new ContextItemsPanel(presenter, i18n, $(StateManager.class), 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-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -34,7 +34,7 @@
import org.ourproject.kune.workspace.client.sitebar.rpc.UserServiceAsync;
import com.allen_sauer.gwt.log.client.Log;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
import com.calclab.suco.client.signal.Signal;
import com.calclab.suco.client.signal.Signal0;
import com.calclab.suco.client.signal.Slot;
Modified: 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-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/CustomMenu.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -26,7 +26,6 @@
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;
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-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -3,11 +3,11 @@
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;
import com.gwtext.client.core.EventObject;
+import com.gwtext.client.core.Ext;
import com.gwtext.client.core.SortDir;
import com.gwtext.client.data.ArrayReader;
import com.gwtext.client.data.FieldDef;
@@ -306,6 +306,7 @@
private void createGrid(final String emptyText, final GridDragConfiguration gridDragConfiguration,
final GridDropConfiguration gridDropConfiguration) {
grid = new GridPanel();
+ grid.setId(Ext.generateId());
final FieldDef[] fieldDefs = new FieldDef[] { new StringFieldDef(GROUP),
new StringFieldDef(GROUP_TOOLTIP_TITLE), new StringFieldDef(GROUP_TOOLTIP),
new StringFieldDef(GROUP_ENDICON_HTML), new StringFieldDef(ID), new StringFieldDef(ICON_HTML),
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPresenter.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPresenter.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -27,7 +27,7 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
import com.calclab.suco.client.signal.Slot;
public class RateItPresenter implements RateIt {
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/LoggerMethodInterceptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/LoggerMethodInterceptor.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/LoggerMethodInterceptor.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -20,10 +20,10 @@
package org.ourproject.kune.platf.server;
-import org.aopalliance.intercept.MethodInterceptor;
-import org.aopalliance.intercept.MethodInvocation;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.aopalliance.intercept.MethodInterceptor;
+import org.aopalliance.intercept.MethodInvocation;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
public class LoggerMethodInterceptor implements MethodInterceptor {
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/mapper/DozerMapper.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/mapper/DozerMapper.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/mapper/DozerMapper.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -21,15 +21,12 @@
package org.ourproject.kune.platf.server.mapper;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
import net.sf.dozer.util.mapping.DozerBeanMapperSingletonWrapper;
import net.sf.dozer.util.mapping.MapperIF;
-import org.ourproject.kune.platf.client.dto.CustomPropertiesDTO;
import org.ourproject.kune.platf.client.dto.SearchResultDTO;
-import org.ourproject.kune.platf.server.domain.CustomProperties;
import org.ourproject.kune.platf.server.manager.impl.SearchResult;
import com.google.inject.Singleton;
@@ -56,20 +53,6 @@
return dest;
}
- public CustomPropertiesDTO mapProperties(final CustomProperties customProperties) throws ClassNotFoundException {
- final CustomPropertiesDTO customPropertiesDTO = new CustomPropertiesDTO();
- final HashMap<Class<?>, Object> dataMapped = new HashMap<Class<?>, Object>();
- for (final Class<?> c : customProperties.getData().keySet()) {
- final Object object = customProperties.getData(c);
- final Class<?> destClassName = Class.forName("org.ourproject.kune.platf.client.dto." + c.getSimpleName()
- + "DTO");
- final Object objectMapped = map(object, destClassName);
- dataMapped.put(destClassName, objectMapped);
- }
- customPropertiesDTO.setData(dataMapped);
- return customPropertiesDTO;
- }
-
@SuppressWarnings("unchecked")
public <K, T> SearchResultDTO<T> mapSearchResult(final SearchResult<K> result, final Class<T> type) {
final SearchResultDTO<T> resultDTO = new SearchResultDTO<T>();
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/mapper/Mapper.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/mapper/Mapper.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/mapper/Mapper.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -22,17 +22,15 @@
import java.util.List;
-import org.ourproject.kune.platf.client.dto.CustomPropertiesDTO;
import org.ourproject.kune.platf.client.dto.SearchResultDTO;
-import org.ourproject.kune.platf.server.domain.CustomProperties;
import org.ourproject.kune.platf.server.manager.impl.SearchResult;
public interface Mapper {
+
<T> T map(Object source, Class<T> type);
<T> List<T> mapList(List<?> list, Class<T> type);
- CustomPropertiesDTO mapProperties(CustomProperties customProperties) throws ClassNotFoundException;
-
<K, T> SearchResultDTO<T> mapSearchResult(SearchResult<K> result, Class<T> type);
+
}
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-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/UserRPC.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -112,12 +112,6 @@
private UserInfoDTO loadUserInfo(final User user) throws DefaultException {
final UserInfo userInfo = userInfoService.buildInfo(user, getUserSession().getHash());
final UserInfoDTO map = mapper.map(userInfo, UserInfoDTO.class);
- try {
- map.setCustomProperties(mapper.mapProperties(userInfo.getCustomProperties()));
- } catch (final ClassNotFoundException e) {
- e.printStackTrace();
- throw new DefaultException("Class not found during mapping userInfo");
- }
return map;
}
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-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfo.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -21,7 +21,6 @@
import java.util.List;
-import org.ourproject.kune.platf.server.domain.CustomProperties;
import org.ourproject.kune.platf.server.domain.Group;
import org.ourproject.kune.platf.server.domain.I18nCountry;
import org.ourproject.kune.platf.server.domain.I18nLanguage;
@@ -37,7 +36,6 @@
private String userHash;
private I18nLanguage language;
private I18nCountry country;
- private CustomProperties customProperties;
public String getChatName() {
return chatName;
@@ -51,10 +49,6 @@
return country;
}
- public CustomProperties getCustomProperties() {
- return customProperties;
- }
-
public List<Group> getGroupsIsAdmin() {
return groupsIsAdmin;
}
@@ -95,10 +89,6 @@
this.country = country;
}
- public void setCustomProperties(final CustomProperties customProperties) {
- this.customProperties = customProperties;
- }
-
public void setGroupsIsAdmin(final List<Group> groupsIsAdmin) {
this.groupsIsAdmin = groupsIsAdmin;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfoServiceDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfoServiceDefault.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfoServiceDefault.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -53,7 +53,6 @@
info.setLanguage(language);
info.setCountry(user.getCountry());
info.setUserHash(userHash);
- info.setCustomProperties(user.getCustomProperties());
final Group userGroup = user.getUserGroup();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPanel.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPanel.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -30,7 +30,7 @@
import org.ourproject.kune.workspace.client.licensechoose.LicenseChoosePanel;
import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessagePanel;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.DeckPanel;
import com.google.gwt.user.client.ui.HTML;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -33,7 +33,7 @@
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.sitebar.SiteToken;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
import com.calclab.suco.client.signal.Slot;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -26,7 +26,7 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
public class SiteSearcherPresenter implements SiteSearcher {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/Site.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/Site.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/Site.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -25,7 +25,7 @@
import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessage;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteprogress.SiteProgress;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
public class Site {
public static final String USERHASH = "userHash";
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-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -24,7 +24,7 @@
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
import com.calclab.suco.client.signal.Slot;
import com.calclab.suco.client.signal.Slot2;
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-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -34,7 +34,7 @@
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
import com.calclab.suco.client.signal.Slot;
import com.calclab.suco.client.signal.Slot2;
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-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -20,7 +20,7 @@
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
import com.calclab.suco.client.signal.Slot;
public class SocialNetworkPresenter {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -32,7 +32,7 @@
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
import com.calclab.suco.client.signal.Slot;
import com.calclab.suco.client.signal.Slot2;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPanel.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPanel.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -26,6 +26,7 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.HorizontalLine;
import org.ourproject.kune.platf.client.ui.IconLabel;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import com.calclab.suco.client.signal.Slot;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
@@ -43,7 +44,7 @@
private final I18nTranslationService i18n;
public ContextItemsPanel(final ContextItemsPresenter presenter, final I18nTranslationService i18n,
- final StateManager stateManager) {
+ final StateManager stateManager, final WorkspaceSkeleton ws) {
this.i18n = i18n;
topBar = new ContextTopBar(presenter, i18n, stateManager);
addTopBar(topBar);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPresenter.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPresenter.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -35,7 +35,7 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
import com.calclab.suco.client.signal.Slot;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
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-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteoptions/SiteOptionsPanel.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -4,7 +4,7 @@
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.calclab.suco.client.provider.Provider;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.PushButton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/SiteProgressPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/SiteProgressPanel.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/SiteProgressPanel.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -2,7 +2,7 @@
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitepublic.SitePublicSpaceLink;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.ui.RootPanel;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -3,7 +3,7 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.workspace.client.search.SiteSearcher;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
public class SiteSearchPresenter implements SiteSearch {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPresenter.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPresenter.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -11,7 +11,7 @@
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.sitebar.rpc.UserServiceAsync;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
import com.calclab.suco.client.signal.Slot;
import com.calclab.suco.client.signal.Slot0;
import com.google.gwt.core.client.GWT;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -8,7 +8,7 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
import com.calclab.suco.client.signal.Signal2;
import com.calclab.suco.client.signal.Slot;
import com.calclab.suco.client.signal.Slot2;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -31,7 +31,7 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
import com.calclab.suco.client.signal.Slot;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.user.client.rpc.AsyncCallback;
Modified: trunk/src/main/resources/dozerBeanMapping.xml
===================================================================
--- trunk/src/main/resources/dozerBeanMapping.xml 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/main/resources/dozerBeanMapping.xml 2008-08-30 14:57:17 UTC (rev 842)
@@ -292,14 +292,5 @@
<class-a>org.ourproject.kune.platf.client.dto.ChatUserParamsDTO</class-a>
<class-b>org.ourproject.kune.platf.server.domain.ChatUserParams</class-b>
</mapping>
-
- <mapping>
- <class-a>org.ourproject.kune.platf.client.dto.CustomPropertiesDTO</class-a>
- <class-b>org.ourproject.kune.platf.server.domain.CustomProperties</class-b>
- <field>
- <a>data</a>
- <b>data</b>
- </field>
- </mapping>
</mappings>
\ No newline at end of file
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/manager/UserManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/manager/UserManagerTest.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/manager/UserManagerTest.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -15,15 +15,12 @@
import org.junit.Test;
import org.ourproject.kune.platf.client.errors.I18nNotFoundException;
import org.ourproject.kune.platf.server.PersistenceTest;
-import org.ourproject.kune.platf.server.domain.ChatUserParams;
-import org.ourproject.kune.platf.server.domain.CustomProperties;
import org.ourproject.kune.platf.server.domain.Group;
import org.ourproject.kune.platf.server.domain.I18nCountry;
import org.ourproject.kune.platf.server.domain.I18nLanguage;
import org.ourproject.kune.platf.server.domain.User;
import org.ourproject.kune.platf.server.manager.impl.SearchResult;
-import com.calclab.emite.client.im.roster.RosterManager.SubscriptionMode;
import com.google.inject.Inject;
public class UserManagerTest extends PersistenceTest {
@@ -126,23 +123,6 @@
}
@Test
- public void userSaveAndGetCustomProperties() {
- final User user1 = userManager.createUser("test", "test 1 name", "test1(a)example.com", "some password", "en",
- "GB", "GMT");
- final ChatUserParams userChatParams = new ChatUserParams("avatar", true, SubscriptionMode.autoAcceptAll,
- "color");
- user1.getCustomProperties().setData(ChatUserParams.class, userChatParams);
- persist(user1);
- final User find = userManager.find(user1.getId());
- final CustomProperties customProperties = find.getCustomProperties();
- assertEquals("avatar", customProperties.getData(ChatUserParams.class).getAvatar());
- assertEquals("color", customProperties.getData(ChatUserParams.class).getChatColor());
- assertEquals(SubscriptionMode.autoAcceptAll, customProperties.getData(ChatUserParams.class)
- .getSubscriptionMode());
- assertEquals(true, customProperties.getData(ChatUserParams.class).isPublishRoster());
- }
-
- @Test
public void userSearch() throws Exception, ParseException {
userManager.reIndex();
final SearchResult<User> result = userManager.search(USER_SHORT_NAME);
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -10,26 +10,21 @@
import org.junit.Before;
import org.junit.Test;
-import org.ourproject.kune.platf.client.dto.ChatUserParamsDTO;
import org.ourproject.kune.platf.client.dto.CommentDTO;
import org.ourproject.kune.platf.client.dto.ContainerDTO;
import org.ourproject.kune.platf.client.dto.ContainerSimpleDTO;
import org.ourproject.kune.platf.client.dto.ContentDTO;
-import org.ourproject.kune.platf.client.dto.CustomPropertiesDTO;
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.GroupListDTO;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.dto.LinkDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.platf.client.dto.UserInfoDTO;
import org.ourproject.kune.platf.server.TestDomainHelper;
import org.ourproject.kune.platf.server.TestHelper;
import org.ourproject.kune.platf.server.access.AccessRights;
-import org.ourproject.kune.platf.server.domain.ChatUserParams;
import org.ourproject.kune.platf.server.domain.Comment;
import org.ourproject.kune.platf.server.domain.Container;
import org.ourproject.kune.platf.server.domain.Content;
-import org.ourproject.kune.platf.server.domain.CustomProperties;
import org.ourproject.kune.platf.server.domain.Group;
import org.ourproject.kune.platf.server.domain.GroupList;
import org.ourproject.kune.platf.server.domain.GroupListMode;
@@ -38,9 +33,7 @@
import org.ourproject.kune.platf.server.domain.User;
import org.ourproject.kune.platf.server.manager.GroupManager;
import org.ourproject.kune.platf.server.state.State;
-import org.ourproject.kune.platf.server.users.UserInfo;
-import com.calclab.emite.client.im.roster.RosterManager.SubscriptionMode;
import com.google.inject.Inject;
public class MapperTest {
@@ -49,33 +42,6 @@
@Inject
GroupManager groupManager;
- @Test
- public void customPropertiesInUserInfoMappping() {
- // Make a custom converter instead of mapper.mapProperties
- // http://dozer.sourceforge.net/documentation/customconverter.html
- final UserInfo userInfo = new UserInfo();
- final ChatUserParams userChatParams = new ChatUserParams("avatar", true, SubscriptionMode.autoAcceptAll,
- "color");
- final CustomProperties customProperties = new CustomProperties();
- customProperties.setData(ChatUserParams.class, userChatParams);
- userInfo.setCustomProperties(customProperties);
- final UserInfoDTO map = mapper.map(userInfo, UserInfoDTO.class);
- final ChatUserParamsDTO data = map.getCustomProperties().getData(ChatUserParamsDTO.class);
- assertEquals("avatar", data.getAvatar());
- }
-
- @Test
- public void customPropertiesMappping() throws ClassNotFoundException {
- // Make a custom converter instead of mapper.mapProperties
- final ChatUserParams userChatParams = new ChatUserParams("avatar", true, SubscriptionMode.autoAcceptAll,
- "color");
- final CustomProperties customProperties = new CustomProperties();
- customProperties.setData(ChatUserParams.class, userChatParams);
- final CustomPropertiesDTO map = mapper.mapProperties(customProperties);
- final ChatUserParamsDTO data = map.getData(ChatUserParamsDTO.class);
- assertEquals("avatar", data.getAvatar());
- }
-
@Before
public void inject() {
TestHelper.inject(this);
Modified: trunk/src/test/java/org/ourproject/kune/rack/filters/rest/TestRESTMethodFinder.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/rack/filters/rest/TestRESTMethodFinder.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/test/java/org/ourproject/kune/rack/filters/rest/TestRESTMethodFinder.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -9,11 +9,6 @@
import org.junit.Before;
import org.junit.Test;
-import org.ourproject.kune.rack.filters.rest.DefaultRESTMethodFinder;
-import org.ourproject.kune.rack.filters.rest.Parameters;
-import org.ourproject.kune.rack.filters.rest.REST;
-import org.ourproject.kune.rack.filters.rest.RESTMethod;
-import org.ourproject.kune.rack.filters.rest.RESTMethodFinder;
public class TestRESTMethodFinder {
private RESTMethodFinder finder;
Modified: trunk/src/test/java/org/ourproject/kune/rack/filters/rest/TestRESTServiceDefinition.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/rack/filters/rest/TestRESTServiceDefinition.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/test/java/org/ourproject/kune/rack/filters/rest/TestRESTServiceDefinition.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -4,8 +4,6 @@
import org.junit.Before;
import org.junit.Test;
-import org.ourproject.kune.rack.filters.rest.REST;
-import org.ourproject.kune.rack.filters.rest.RESTServiceDefinition;
public class TestRESTServiceDefinition {
Modified: trunk/src/test/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePresenterTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePresenterTest.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/test/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePresenterTest.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -4,8 +4,6 @@
import org.junit.Before;
import org.junit.Test;
import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
-import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessagePresenter;
-import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessageView;
public class SiteMessagePresenterTest {
Modified: trunk/src/test/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenterTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenterTest.java 2008-08-11 01:20:37 UTC (rev 841)
+++ trunk/src/test/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenterTest.java 2008-08-30 14:57:17 UTC (rev 842)
@@ -9,7 +9,7 @@
import org.ourproject.kune.workspace.client.search.SiteSearcher;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.provider.Provider;
public class TagsSummaryPresenterTest {
1
0
r841 - in trunk/src/main/java/org/ourproject/kune: chat/client docs/client platf/client/rpc platf/client/services platf/client/tool workspace/client/ui/newtmp/skel
by vjrj 11 Aug '08
by vjrj 11 Aug '08
11 Aug '08
Author: vjrj
Date: 2008-08-11 03:20:37 +0200 (Mon, 11 Aug 2008)
New Revision: 841
Added:
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
Removed:
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/rpc/MockedService.java
trunk/src/main/java/org/ourproject/kune/platf/client/rpc/SiteServiceMocked.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorView.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolTrigger.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolTriggerDefault.java
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java
Log:
Ws refactoring
Copied: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java (from rev 840, trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java 2008-08-10 04:29:30 UTC (rev 840)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2008-08-11 01:20:37 UTC (rev 841)
@@ -0,0 +1,102 @@
+package org.ourproject.kune.chat.client;
+
+import org.ourproject.kune.chat.client.cnt.ChatContent;
+import org.ourproject.kune.chat.client.cnt.ChatContentPresenter;
+import org.ourproject.kune.chat.client.cnt.info.ChatInfo;
+import org.ourproject.kune.chat.client.cnt.info.ui.ChatInfoPanel;
+import org.ourproject.kune.chat.client.cnt.room.ChatRoom;
+import org.ourproject.kune.chat.client.cnt.room.ChatRoomControl;
+import org.ourproject.kune.chat.client.cnt.room.ChatRoomControlPresenter;
+import org.ourproject.kune.chat.client.cnt.room.ChatRoomPresenter;
+import org.ourproject.kune.chat.client.cnt.room.ui.ChatRoomControlPanel;
+import org.ourproject.kune.chat.client.cnt.room.ui.ChatRoomPanel;
+import org.ourproject.kune.chat.client.ctx.ChatContext;
+import org.ourproject.kune.chat.client.ctx.ChatContextPresenter;
+import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdmin;
+import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdminPresenter;
+import org.ourproject.kune.platf.client.app.Application;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.tool.ToolSelector;
+import org.ourproject.kune.workspace.client.component.WorkspaceDeckPanel;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummary;
+import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+
+import com.calclab.emiteuimodule.client.EmiteUIDialog;
+import com.calclab.suco.client.modules.AbstractModule;
+import com.calclab.suco.client.provider.Factory;
+import com.calclab.suco.client.scopes.SingletonScope;
+
+public class ChatClientModule extends AbstractModule {
+
+ public ChatClientModule() {
+ }
+
+ @Override
+ public void onLoad() {
+
+ register(SingletonScope.class, new Factory<ChatInfo>(ChatInfo.class) {
+ public ChatInfo create() {
+ return new ChatInfoPanel();
+ }
+ });
+
+ register(SingletonScope.class, new Factory<ChatContent>(ChatContent.class) {
+ public ChatContent create() {
+ final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
+ final ChatContentPresenter presenter = new ChatContentPresenter($(EmiteUIDialog.class), panel,
+ $$(ChatInfo.class), $$(ChatRoom.class));
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<ChatContext>(ChatContext.class) {
+ public ChatContext create() {
+ final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
+ final ChatContextPresenter presenter = new ChatContextPresenter(panel, $$(RoomsAdmin.class));
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<ChatRoomControl>(ChatRoomControl.class) {
+ public ChatRoomControl create() {
+ final ChatRoomControlPresenter presenter = new ChatRoomControlPresenter();
+ final ChatRoomControlPanel panel = new ChatRoomControlPanel($(I18nUITranslationService.class),
+ presenter);
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<ChatRoom>(ChatRoom.class) {
+ public ChatRoom create() {
+ final ChatRoomPanel panel = new ChatRoomPanel($(WorkspaceSkeleton.class));
+ final ChatRoomPresenter presenter = new ChatRoomPresenter(panel);
+ return presenter;
+ }
+ });
+ register(SingletonScope.class, new Factory<RoomsAdmin>(RoomsAdmin.class) {
+ public RoomsAdmin create() {
+ final RoomsAdminPresenter presenter = new RoomsAdminPresenter($(ContextItems.class),
+ $(I18nUITranslationService.class), $$(StateManager.class), $(Session.class),
+ $$(ContentServiceAsync.class));
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<ChatClientTool>(ChatClientTool.class) {
+ public ChatClientTool create() {
+ return new ChatClientTool($(Session.class), $(Application.class), $(I18nUITranslationService.class),
+ $(EmiteUIDialog.class), $(WorkspaceSkeleton.class), $$(GroupMembersSummary.class),
+ $(ToolSelector.class), $(WsThemePresenter.class), $$(ChatContent.class), $$(ChatContext.class));
+ }
+ });
+
+ $(ChatClientTool.class);
+
+ }
+}
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java 2008-08-10 04:29:30 UTC (rev 840)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java 2008-08-11 01:20:37 UTC (rev 841)
@@ -1,102 +0,0 @@
-package org.ourproject.kune.chat.client;
-
-import org.ourproject.kune.chat.client.cnt.ChatContent;
-import org.ourproject.kune.chat.client.cnt.ChatContentPresenter;
-import org.ourproject.kune.chat.client.cnt.info.ChatInfo;
-import org.ourproject.kune.chat.client.cnt.info.ui.ChatInfoPanel;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoom;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomControl;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomControlPresenter;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomPresenter;
-import org.ourproject.kune.chat.client.cnt.room.ui.ChatRoomControlPanel;
-import org.ourproject.kune.chat.client.cnt.room.ui.ChatRoomPanel;
-import org.ourproject.kune.chat.client.ctx.ChatContext;
-import org.ourproject.kune.chat.client.ctx.ChatContextPresenter;
-import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdmin;
-import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdminPresenter;
-import org.ourproject.kune.platf.client.app.Application;
-import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.platf.client.tool.ToolSelector;
-import org.ourproject.kune.workspace.client.component.WorkspaceDeckPanel;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummary;
-import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-
-import com.calclab.emiteuimodule.client.EmiteUIDialog;
-import com.calclab.suco.client.modules.AbstractModule;
-import com.calclab.suco.client.provider.Factory;
-import com.calclab.suco.client.scopes.SingletonScope;
-
-public class ChatClientNewModule extends AbstractModule {
-
- public ChatClientNewModule() {
- }
-
- @Override
- public void onLoad() {
-
- register(SingletonScope.class, new Factory<ChatInfo>(ChatInfo.class) {
- public ChatInfo create() {
- return new ChatInfoPanel();
- }
- });
-
- register(SingletonScope.class, new Factory<ChatContent>(ChatContent.class) {
- public ChatContent create() {
- final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
- final ChatContentPresenter presenter = new ChatContentPresenter($(EmiteUIDialog.class), panel,
- $$(ChatInfo.class), $$(ChatRoom.class));
- return presenter;
- }
- });
-
- register(SingletonScope.class, new Factory<ChatContext>(ChatContext.class) {
- public ChatContext create() {
- final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
- final ChatContextPresenter presenter = new ChatContextPresenter(panel, $$(RoomsAdmin.class));
- return presenter;
- }
- });
-
- register(SingletonScope.class, new Factory<ChatRoomControl>(ChatRoomControl.class) {
- public ChatRoomControl create() {
- final ChatRoomControlPresenter presenter = new ChatRoomControlPresenter();
- final ChatRoomControlPanel panel = new ChatRoomControlPanel($(I18nUITranslationService.class),
- presenter);
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(SingletonScope.class, new Factory<ChatRoom>(ChatRoom.class) {
- public ChatRoom create() {
- final ChatRoomPanel panel = new ChatRoomPanel($(WorkspaceSkeleton.class));
- final ChatRoomPresenter presenter = new ChatRoomPresenter(panel);
- return presenter;
- }
- });
- register(SingletonScope.class, new Factory<RoomsAdmin>(RoomsAdmin.class) {
- public RoomsAdmin create() {
- final RoomsAdminPresenter presenter = new RoomsAdminPresenter($(ContextItems.class),
- $(I18nUITranslationService.class), $$(StateManager.class), $(Session.class),
- $$(ContentServiceAsync.class));
- return presenter;
- }
- });
-
- register(SingletonScope.class, new Factory<ChatClientTool>(ChatClientTool.class) {
- public ChatClientTool create() {
- return new ChatClientTool($(Session.class), $(Application.class), $(I18nUITranslationService.class),
- $(EmiteUIDialog.class), $(WorkspaceSkeleton.class), $$(GroupMembersSummary.class),
- $(ToolSelector.class), $(WsThemePresenter.class), $$(ChatContent.class), $$(ChatContext.class));
- }
- });
-
- $(ChatClientTool.class);
-
- }
-}
Copied: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java (from rev 840, trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-08-10 04:29:30 UTC (rev 840)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2008-08-11 01:20:37 UTC (rev 841)
@@ -0,0 +1,139 @@
+package org.ourproject.kune.docs.client;
+
+import org.ourproject.kune.docs.client.cnt.DocumentContent;
+import org.ourproject.kune.docs.client.cnt.DocumentContentPresenter;
+import org.ourproject.kune.docs.client.cnt.folder.FolderEditor;
+import org.ourproject.kune.docs.client.cnt.folder.FolderEditorPresenter;
+import org.ourproject.kune.docs.client.cnt.folder.ui.FolderEditorPanel;
+import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewer;
+import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerPresenter;
+import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerView;
+import org.ourproject.kune.docs.client.cnt.folder.viewer.ui.FolderViewerPanel;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentReader;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControl;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControlPresenter;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControlView;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderPresenter;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderView;
+import org.ourproject.kune.docs.client.cnt.reader.ui.DocumentReaderControlPanel;
+import org.ourproject.kune.docs.client.cnt.reader.ui.DocumentReaderPanel;
+import org.ourproject.kune.docs.client.ctx.DocumentContext;
+import org.ourproject.kune.docs.client.ctx.DocumentContextPresenter;
+import org.ourproject.kune.docs.client.ctx.admin.AdminContext;
+import org.ourproject.kune.docs.client.ctx.admin.AdminContextPresenter;
+import org.ourproject.kune.docs.client.ctx.admin.AdminContextView;
+import org.ourproject.kune.docs.client.ctx.admin.ui.AdminContextPanel;
+import org.ourproject.kune.docs.client.ctx.folder.FolderContext;
+import org.ourproject.kune.docs.client.ctx.folder.FolderContextPresenter;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
+import org.ourproject.kune.platf.client.services.KuneErrorHandler;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.tool.ToolSelector;
+import org.ourproject.kune.platf.client.ui.rate.RateIt;
+import org.ourproject.kune.workspace.client.component.WorkspaceDeckPanel;
+import org.ourproject.kune.workspace.client.editor.TextEditor;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.tags.TagsSummary;
+import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
+
+import com.calclab.suco.client.modules.AbstractModule;
+import com.calclab.suco.client.provider.Factory;
+import com.calclab.suco.client.scopes.SingletonScope;
+
+public class DocumentClientModule extends AbstractModule {
+
+ public DocumentClientModule() {
+ }
+
+ @Override
+ public void onLoad() {
+ final I18nUITranslationService i18n = $(I18nUITranslationService.class);
+ final WorkspaceSkeleton ws = $(WorkspaceSkeleton.class);
+
+ register(SingletonScope.class, new Factory<DocumentClientTool>(DocumentClientTool.class) {
+ public DocumentClientTool create() {
+ return new DocumentClientTool(i18n, $(ToolSelector.class), $(WsThemePresenter.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),
+ $(StateManager.class), $$(TagsSummary.class), $$(ContentServiceAsync.class),
+ $(EntityTitlePresenter.class), $(EntitySubTitlePresenter.class));
+ final AdminContextView view = new AdminContextPanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<DocumentContent>(DocumentContent.class) {
+ public DocumentContent create() {
+ final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
+ final DocumentContentPresenter presenter = new DocumentContentPresenter($(StateManager.class),
+ $(I18nUITranslationService.class), $(KuneErrorHandler.class), panel, $(Session.class),
+ $(RateIt.class), $$(DocumentReader.class), $$(DocumentReaderControl.class),
+ $$(TextEditor.class), $$(FolderViewer.class), $$(FolderEditor.class),
+ $$(ContentServiceAsync.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, $$(FolderContext.class),
+ $$(AdminContext.class));
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<DocumentReader>(DocumentReader.class) {
+ public DocumentReader create() {
+ final DocumentReaderView view = new DocumentReaderPanel(ws);
+ final DocumentReaderPresenter presenter = new DocumentReaderPresenter(view);
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<DocumentReaderControl>(DocumentReaderControl.class) {
+ public DocumentReaderControl create() {
+ final DocumentReaderControlPresenter presenter = new DocumentReaderControlPresenter();
+ final DocumentReaderControlView view = new DocumentReaderControlPanel(presenter, i18n, ws);
+ presenter.init(view);
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<FolderContext>(FolderContext.class) {
+ public FolderContext create() {
+ final FolderContextPresenter presenter = new FolderContextPresenter($(ContextItems.class),
+ $(StateManager.class), $(Session.class), i18n, $$(ContentServiceAsync.class));
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<FolderEditor>(FolderEditor.class) {
+ public FolderEditor create() {
+ final FolderEditorPanel view = new FolderEditorPanel();
+ final FolderEditorPresenter presenter = new FolderEditorPresenter(view);
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<FolderViewer>(FolderViewer.class) {
+ public FolderViewer create() {
+ final FolderViewerView view = new FolderViewerPanel(ws);
+ final FolderViewerPresenter presenter = new FolderViewerPresenter(view);
+ return presenter;
+ }
+ });
+
+ $(DocumentClientTool.class);
+ }
+}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-08-10 04:29:30 UTC (rev 840)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-08-11 01:20:37 UTC (rev 841)
@@ -1,139 +0,0 @@
-package org.ourproject.kune.docs.client;
-
-import org.ourproject.kune.docs.client.cnt.DocumentContent;
-import org.ourproject.kune.docs.client.cnt.DocumentContentPresenter;
-import org.ourproject.kune.docs.client.cnt.folder.FolderEditor;
-import org.ourproject.kune.docs.client.cnt.folder.FolderEditorPresenter;
-import org.ourproject.kune.docs.client.cnt.folder.ui.FolderEditorPanel;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewer;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerPresenter;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerView;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.ui.FolderViewerPanel;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReader;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControl;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControlPresenter;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControlView;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderPresenter;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderView;
-import org.ourproject.kune.docs.client.cnt.reader.ui.DocumentReaderControlPanel;
-import org.ourproject.kune.docs.client.cnt.reader.ui.DocumentReaderPanel;
-import org.ourproject.kune.docs.client.ctx.DocumentContext;
-import org.ourproject.kune.docs.client.ctx.DocumentContextPresenter;
-import org.ourproject.kune.docs.client.ctx.admin.AdminContext;
-import org.ourproject.kune.docs.client.ctx.admin.AdminContextPresenter;
-import org.ourproject.kune.docs.client.ctx.admin.AdminContextView;
-import org.ourproject.kune.docs.client.ctx.admin.ui.AdminContextPanel;
-import org.ourproject.kune.docs.client.ctx.folder.FolderContext;
-import org.ourproject.kune.docs.client.ctx.folder.FolderContextPresenter;
-import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
-import org.ourproject.kune.platf.client.services.KuneErrorHandler;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.platf.client.tool.ToolSelector;
-import org.ourproject.kune.platf.client.ui.rate.RateIt;
-import org.ourproject.kune.workspace.client.component.WorkspaceDeckPanel;
-import org.ourproject.kune.workspace.client.editor.TextEditor;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.tags.TagsSummary;
-import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
-
-import com.calclab.suco.client.modules.AbstractModule;
-import com.calclab.suco.client.provider.Factory;
-import com.calclab.suco.client.scopes.SingletonScope;
-
-public class DocumentClientNewModule extends AbstractModule {
-
- public DocumentClientNewModule() {
- }
-
- @Override
- public void onLoad() {
- final I18nUITranslationService i18n = $(I18nUITranslationService.class);
- final WorkspaceSkeleton ws = $(WorkspaceSkeleton.class);
-
- register(SingletonScope.class, new Factory<DocumentClientTool>(DocumentClientTool.class) {
- public DocumentClientTool create() {
- return new DocumentClientTool(i18n, $(ToolSelector.class), $(WsThemePresenter.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),
- $(StateManager.class), $$(TagsSummary.class), $$(ContentServiceAsync.class),
- $(EntityTitlePresenter.class), $(EntitySubTitlePresenter.class));
- final AdminContextView view = new AdminContextPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
- }
- });
-
- register(SingletonScope.class, new Factory<DocumentContent>(DocumentContent.class) {
- public DocumentContent create() {
- final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
- final DocumentContentPresenter presenter = new DocumentContentPresenter($(StateManager.class),
- $(I18nUITranslationService.class), $(KuneErrorHandler.class), panel, $(Session.class),
- $(RateIt.class), $$(DocumentReader.class), $$(DocumentReaderControl.class),
- $$(TextEditor.class), $$(FolderViewer.class), $$(FolderEditor.class),
- $$(ContentServiceAsync.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, $$(FolderContext.class),
- $$(AdminContext.class));
- return presenter;
- }
- });
-
- register(SingletonScope.class, new Factory<DocumentReader>(DocumentReader.class) {
- public DocumentReader create() {
- final DocumentReaderView view = new DocumentReaderPanel(ws);
- final DocumentReaderPresenter presenter = new DocumentReaderPresenter(view);
- return presenter;
- }
- });
-
- register(SingletonScope.class, new Factory<DocumentReaderControl>(DocumentReaderControl.class) {
- public DocumentReaderControl create() {
- final DocumentReaderControlPresenter presenter = new DocumentReaderControlPresenter();
- final DocumentReaderControlView view = new DocumentReaderControlPanel(presenter, i18n, ws);
- presenter.init(view);
- return presenter;
- }
- });
-
- register(SingletonScope.class, new Factory<FolderContext>(FolderContext.class) {
- public FolderContext create() {
- final FolderContextPresenter presenter = new FolderContextPresenter($(ContextItems.class),
- $(StateManager.class), $(Session.class), i18n, $$(ContentServiceAsync.class));
- return presenter;
- }
- });
-
- register(SingletonScope.class, new Factory<FolderEditor>(FolderEditor.class) {
- public FolderEditor create() {
- final FolderEditorPanel view = new FolderEditorPanel();
- final FolderEditorPresenter presenter = new FolderEditorPresenter(view);
- return presenter;
- }
- });
-
- register(SingletonScope.class, new Factory<FolderViewer>(FolderViewer.class) {
- public FolderViewer create() {
- final FolderViewerView view = new FolderViewerPanel(ws);
- final FolderViewerPresenter presenter = new FolderViewerPresenter(view);
- return presenter;
- }
- });
-
- $(DocumentClientTool.class);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/MockedService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/rpc/MockedService.java 2008-08-10 04:29:30 UTC (rev 840)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/MockedService.java 2008-08-11 01:20:37 UTC (rev 841)
@@ -1,59 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * 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.rpc;
-
-import com.google.gwt.user.client.Timer;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-public class MockedService {
- public static boolean isTest;
-
- public static interface Delayer {
- void run();
- }
-
- @SuppressWarnings("unchecked")
- protected void answer(final Object response, final AsyncCallback callback) {
- delay(new Delayer() {
- public void run() {
- callback.onSuccess(response);
- }
- });
- }
-
- protected void delay(final Delayer timer) {
- if (isTest) {
- timer.run();
- } else {
- schedule(timer);
- }
- }
-
- private void schedule(final Delayer delayer) {
- Timer timer = new Timer() {
- public void run() {
- delayer.run();
- }
- };
- timer.schedule(1500);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/SiteServiceMocked.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/rpc/SiteServiceMocked.java 2008-08-10 04:29:30 UTC (rev 840)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/SiteServiceMocked.java 2008-08-11 01:20:37 UTC (rev 841)
@@ -1,32 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * 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.rpc;
-
-import org.ourproject.kune.platf.client.dto.InitDataDTO;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-public class SiteServiceMocked extends MockedService implements SiteServiceAsync {
-
- public void getInitData(final String userHash, final AsyncCallback<InitDataDTO> callback) {
- }
-
-}
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-10 04:29:30 UTC (rev 840)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-08-11 01:20:37 UTC (rev 841)
@@ -1,7 +1,7 @@
package org.ourproject.kune.platf.client.services;
-import org.ourproject.kune.chat.client.ChatClientNewModule;
-import org.ourproject.kune.docs.client.DocumentClientNewModule;
+import org.ourproject.kune.chat.client.ChatClientModule;
+import org.ourproject.kune.docs.client.DocumentClientModule;
import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.app.ApplicationDefault;
import org.ourproject.kune.platf.client.app.HistoryWrapper;
@@ -23,7 +23,6 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.state.StateManagerDefault;
import org.ourproject.kune.platf.client.tool.ToolSelector;
-import org.ourproject.kune.platf.client.tool.ToolSelectorPanel;
import org.ourproject.kune.platf.client.tool.ToolSelectorPresenter;
import org.ourproject.kune.platf.client.ui.QuickTipsHelper;
import org.ourproject.kune.platf.client.ui.rate.RateIt;
@@ -554,8 +553,6 @@
public ToolSelector create() {
final ToolSelectorPresenter presenter = new ToolSelectorPresenter($(StateManager.class),
$(WsThemePresenter.class));
- final ToolSelectorPanel panel = new ToolSelectorPanel(presenter, ws);
- presenter.init(panel);
return presenter;
}
});
@@ -588,8 +585,8 @@
}
});
- install(ProviderRegisterStrategy.registerOnlyIfNotRegistered, new EmiteUIModule(),
- new DocumentClientNewModule(), new ChatClientNewModule());
+ install(ProviderRegisterStrategy.registerOnlyIfNotRegistered, new EmiteUIModule(), new DocumentClientModule(),
+ new ChatClientModule());
$(SitePublicSpaceLink.class);
$(SiteMessage.class);
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPanel.java 2008-08-10 04:29:30 UTC (rev 840)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPanel.java 2008-08-11 01:20:37 UTC (rev 841)
@@ -1,94 +0,0 @@
-package org.ourproject.kune.platf.client.tool;
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.ourproject.kune.platf.client.tool.ToolTrigger.TriggerListener;
-import org.ourproject.kune.platf.client.ui.HasColor;
-import org.ourproject.kune.platf.client.ui.RoundedBorderDecorator;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
-
-import com.google.gwt.user.client.ui.Hyperlink;
-import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-public class ToolSelectorPanel extends VerticalPanel implements ToolSelectorView {
-
- private static final String ITEM_SELECTED = "kune-GroupToolsBar-itemSelected";
- private static final String ITEM_NOT_SELECTED = "kune-GroupToolsBar-itemNotSelected";
- private Widget currentTab;
- private final HashMap<String, Widget> tabs;
-
- public ToolSelectorPanel(final ToolSelectorPresenter presenter, final WorkspaceSkeleton ws) {
- tabs = new HashMap<String, Widget>();
- currentTab = null;
- addStyleName("kune-GroupToolsBar");
- ws.getEntitySummary().addInTools(this);
- }
-
- public void addItem(final ToolTrigger trigger) {
- final int nextIndex = this.getWidgetCount();
- final Widget menuItem = createItem(nextIndex, trigger);
- setTabSelected(menuItem, false);
- tabs.put(trigger.getName(), menuItem);
- this.add(menuItem);
- }
-
- public void selectItem(final String toolName) {
- if (currentTab != null) {
- setTabSelected(currentTab, false);
- }
- currentTab = getWidget(toolName);
- setTabSelected(currentTab, true);
- }
-
- public void setTabsColors(final String selectedColor, final String unSelectedColor) {
- final Iterator<Widget> iter = tabs.values().iterator();
- while (iter.hasNext()) {
- final Widget w = iter.next();
- if (w == currentTab) {
- ((HasColor) w).setColor(selectedColor);
- } else {
- ((HasColor) w).setColor(unSelectedColor);
- }
- }
- }
-
- public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
- // TODO Auto-generated method stub
-
- }
-
- private Widget createItem(final int index, final ToolTrigger trigger) {
- final SimplePanel menuItem = new SimplePanel();
- addStyleName("Tab");
- final Hyperlink hl = new Hyperlink(trigger.getLabel(), "");
- trigger.setListener(new TriggerListener() {
- public void onStateChanged(final String encoded) {
- hl.setTargetHistoryToken(encoded);
- }
- });
- menuItem.add(hl);
- return new RoundedBorderDecorator(menuItem, RoundedBorderDecorator.RIGHT);
- }
-
- private Widget getWidget(final String toolName) {
- return tabs.get(toolName);
- }
-
- private void setTabSelected(final Widget tab, final boolean isSelected) {
- if (isSelected) {
- tab.removeStyleName(ITEM_NOT_SELECTED);
- tab.addStyleName(ITEM_SELECTED);
- } else {
- tab.removeStyleName(ITEM_SELECTED);
- tab.addStyleName(ITEM_NOT_SELECTED);
- }
- // tring color = isSelected ? colorTheme.getToolSelected() :
- // colorTheme.getToolUnselected();
- // ((HasColor) tab).setColor(color);
- }
-
-}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenter.java 2008-08-10 04:29:30 UTC (rev 840)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenter.java 2008-08-11 01:20:37 UTC (rev 841)
@@ -2,16 +2,13 @@
import java.util.HashMap;
-import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
import com.calclab.suco.client.signal.Slot2;
public class ToolSelectorPresenter implements ToolSelector {
- private ToolSelectorView view;
private final HashMap<String, ToolSelectorItem> tools;
public ToolSelectorPresenter(final StateManager stateManager, final WsThemePresenter wsThemePresenter) {
@@ -26,11 +23,6 @@
onToolChanged(oldTool, newTool);
}
});
- wsThemePresenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
- public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
- view.setTheme(oldTheme, newTheme);
- }
- });
}
public void addTool(final ToolSelectorItem item) {
@@ -45,14 +37,6 @@
item.setSelected(false);
}
- public View getView() {
- return view;
- }
-
- public void init(final ToolSelectorView view) {
- this.view = view;
- }
-
void onGroupChanged(final String newGroupName) {
for (final String name : tools.keySet()) {
tools.get(name).setGroupShortName(newGroupName);
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorView.java 2008-08-10 04:29:30 UTC (rev 840)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorView.java 2008-08-11 01:20:37 UTC (rev 841)
@@ -1,9 +0,0 @@
-package org.ourproject.kune.platf.client.tool;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
-
-public interface ToolSelectorView extends View {
-
- void setTheme(WsTheme oldTheme, WsTheme newTheme);
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolTrigger.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolTrigger.java 2008-08-10 04:29:30 UTC (rev 840)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolTrigger.java 2008-08-11 01:20:37 UTC (rev 841)
@@ -1,35 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * 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.tool;
-
-public interface ToolTrigger {
-
- public interface TriggerListener {
- void onStateChanged(String encoded);
- }
-
- String getName();
-
- String getLabel();
-
- void setListener(TriggerListener listener);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolTriggerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolTriggerDefault.java 2008-08-10 04:29:30 UTC (rev 840)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolTriggerDefault.java 2008-08-11 01:20:37 UTC (rev 841)
@@ -1,55 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * 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.tool;
-
-import org.ourproject.kune.platf.client.dto.StateToken;
-
-public class ToolTriggerDefault implements ToolTrigger {
- private final String toolName;
- private final String label;
- private TriggerListener listener;
-
- public ToolTriggerDefault(final String toolName, final String caption) {
- this.toolName = toolName;
- this.label = caption;
- }
-
- public String getLabel() {
- return label;
- }
-
- public String getName() {
- return toolName;
- }
-
- public void setListener(final TriggerListener listener) {
- this.listener = listener;
- }
-
- public void setState(final String encoded) {
- listener.onStateChanged(encoded);
- }
-
- public void setState(final StateToken stateToken) {
- setState(stateToken.getEncoded());
- }
-
-}
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-10 04:29:30 UTC (rev 840)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java 2008-08-11 01:20:37 UTC (rev 841)
@@ -2,6 +2,7 @@
import org.ourproject.kune.platf.client.ui.DefaultBorderLayout;
+import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.Toolbar;
@@ -13,12 +14,15 @@
private final Panel entitySummary;
private final DefaultBorderLayout mainPanel;
private final Toolbar trayBar;
+ private final VerticalPanel vpTools;
public EntitySummary() {
mainPanel = new DefaultBorderLayout();
entityTools = new Panel();
entityTools.setLayout(new FitLayout());
entityTools.setAutoHeight(true);
+ vpTools = new VerticalPanel();
+ entityTools.add(vpTools);
entitySummary = new Panel();
entityTools.setBorder(false);
entitySummary.setBorder(false);
@@ -38,10 +42,12 @@
}
public void addInTools(final Widget widget) {
- entityTools.add(widget);
- entityTools.render(widget.getElement());
+ vpTools.add(widget);
+ // entityTools.render(widget.getElement());
if (entityTools.isRendered()) {
+ entityTools.syncSize();
entityTools.doLayout(false);
+ mainPanel.doLayoutIfNeeded();
}
}
1
0
Author: vjrj
Date: 2008-08-10 06:29:30 +0200 (Sun, 10 Aug 2008)
New Revision: 840
Added:
trunk/src/test/java/org/ourproject/kune/workspace/client/sitebar/
trunk/src/test/java/org/ourproject/kune/workspace/client/sitebar/msg/
trunk/src/test/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePresenterTest.java
Removed:
trunk/src/main/java/org/ourproject/kune/chat/client/actions/
trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/actions/
trunk/src/main/java/org/ourproject/kune/docs/client/ui/
trunk/src/main/java/org/ourproject/kune/platf/client/KunePlatform.java
trunk/src/main/java/org/ourproject/kune/platf/client/PlatformEvents.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/
trunk/src/main/java/org/ourproject/kune/platf/client/dispatch/
trunk/src/main/java/org/ourproject/kune/platf/client/dto/SaveDocumentActionParams.java
trunk/src/main/java/org/ourproject/kune/platf/client/extend/
trunk/src/test/java/org/ourproject/kune/platf/client/dispatch/
trunk/src/test/java/org/ourproject/kune/platf/server/init/
trunk/src/test/java/org/ourproject/kune/platf/server/services/
trunk/src/test/java/org/ourproject/kune/sitebar/client/msg/
trunk/src/test/java/org/ourproject/kune/sitebar/client/ui/
trunk/src/test/java/org/ourproject/kune/workspace/client/actions/
Modified:
trunk/pom.xml
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/ctx/rooms/RoomsAdminPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/folder/FolderContextPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentService.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerDefault.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItems.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsView.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/title/EntityTitlePresenter.java
trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java
Log:
Dispacher removed
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2008-08-09 18:40:32 UTC (rev 839)
+++ trunk/pom.xml 2008-08-10 04:29:30 UTC (rev 840)
@@ -425,12 +425,6 @@
<includes>
<include>**/Kune-Platform.gwt.xml**</include>
<include>**/I18nTranslationService**</include>
- <include>**/Plugin.**</include>
- <include>**/PluginManager.**</include>
- <include>**/dispatch/**</include>
- <include>**/Extensi*</include>
- <include>**/PlatformEvents.**</include>
- <include>**/BottomTrayIcon.**</include>
<include>**/BasicDialog.**</include>
<include>**/HorizontalLine.**</include>
<include>**/AbstractLabel.**</include>
@@ -441,11 +435,8 @@
<include>**/IconHyperlink*.**</include>
<include>**/LabelWrapper*.**</include>
<include>**/KuneUiUtils.**</include>
- <include>**/RoundedBorderDecorator.**</include>
- <include>**/HasColor.**</include>
<include>**/View.**</include>
<!-- <include>**/platf/**</include>
- <include>**/AbstractPresenter**</include>
<include>**/platf/client/extend/**</include>
<include>**/platf/client/*java</include>
<include>**/platf/client/app/**</include>
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-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -14,7 +14,6 @@
import org.ourproject.kune.chat.client.ctx.ChatContextPresenter;
import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdmin;
import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdminPresenter;
-import org.ourproject.kune.platf.client.KunePlatform;
import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
@@ -97,7 +96,7 @@
}
});
- final ChatClientTool chatClientTool = $(ChatClientTool.class);
- $(KunePlatform.class).addTool(chatClientTool);
+ $(ChatClientTool.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-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -32,10 +32,12 @@
import org.ourproject.kune.platf.client.tool.AbstractClientTool;
import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.platf.client.ui.MenuItem;
+import org.ourproject.kune.platf.client.ui.WindowUtils;
import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummary;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+import com.allen_sauer.gwt.log.client.Log;
import com.calclab.emite.client.xmpp.stanzas.XmppURI;
import com.calclab.emiteuimodule.client.EmiteUIDialog;
import com.calclab.suco.client.container.Provider;
@@ -61,6 +63,7 @@
this.chatContextProvider = chatContextProvider;
session.onInitDataReceived(new Slot<InitDataDTO>() {
public void onEvent(final InitDataDTO initData) {
+ checkChatDomain(initData.getChatDomain());
final ChatOptions chatOptions = new ChatOptions(initData.getChatHttpBase(), initData.getChatDomain(),
initData.getChatRoomHost());
chat = new ChatEngineXmpp(emiteUIDialog, chatOptions, i18n, ws);
@@ -79,6 +82,15 @@
}
}), true);
}
+
+ private void checkChatDomain(final String chatDomain) {
+ final String httpDomain = WindowUtils.getLocation().getHostName();
+ if (!chatDomain.equals(httpDomain)) {
+ Log.error("Your http domain (" + httpDomain + ") is different from the chat domain (" + chatDomain
+ + "). This will produce problems with the chat functionality. "
+ + "Check kune.properties on the server.");
+ }
+ }
});
application.onApplicationStop(new Slot0() {
public void onEvent() {
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java 2008-08-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -49,7 +49,7 @@
contextItems.setParentTreeVisible(false);
contextItems.registerType(ChatClientTool.TYPE_CHAT, images.page());
contextItems.registerType(ChatClientTool.TYPE_ROOM, images.chatGreen());
- contextItems.canCreate(ChatClientTool.TYPE_ROOM, i18n.t("New chat room"), new Slot<String>() {
+ contextItems.canCreate(i18n.t("New chat room"), i18n.t("Add a chat room"), new Slot<String>() {
public void onEvent(final String name) {
Site.showProgressProcessing();
final String groupShortName = session.getCurrentState().getGroup().getShortName();
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java 2008-08-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -1,66 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * 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.docs.client;
-
-import org.ourproject.kune.docs.client.actions.AddDocumentAction;
-import org.ourproject.kune.docs.client.actions.AddFolderAction;
-import org.ourproject.kune.docs.client.actions.ContentAddAuthorAction;
-import org.ourproject.kune.docs.client.actions.ContentDelContentAction;
-import org.ourproject.kune.docs.client.actions.ContentRemoveAuthorAction;
-import org.ourproject.kune.docs.client.actions.ContentRenameAction;
-import org.ourproject.kune.docs.client.actions.ContentSetLanguageAction;
-import org.ourproject.kune.docs.client.actions.ContentSetPublishedOnAction;
-import org.ourproject.kune.docs.client.actions.DocsEvents;
-import org.ourproject.kune.docs.client.actions.GoParentFolderAction;
-import org.ourproject.kune.docs.client.actions.RenameTokenAction;
-import org.ourproject.kune.docs.client.actions.SaveDocumentAction;
-import org.ourproject.kune.platf.client.extend.ClientModule;
-import org.ourproject.kune.platf.client.extend.Register;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
-
-public class DocsClientModule implements ClientModule {
-
- private final Session session;
- private final StateManager stateManager;
- private final I18nTranslationService i18n;
-
- public DocsClientModule(final Session session, final StateManager stateManager, final I18nTranslationService i18n) {
- this.session = session;
- this.stateManager = stateManager;
- this.i18n = i18n;
- }
-
- public void configure(final Register register) {
- register.addAction(DocsEvents.SAVE_DOCUMENT, new SaveDocumentAction(session, i18n));
- register.addAction(DocsEvents.ADD_DOCUMENT, new AddDocumentAction(stateManager, session, i18n));
- register.addAction(DocsEvents.ADD_FOLDER, new AddFolderAction(stateManager, session, i18n));
- register.addAction(DocsEvents.GO_PARENT_FOLDER, new GoParentFolderAction(stateManager, session));
- register.addAction(DocsEvents.ADD_AUTHOR, new ContentAddAuthorAction(stateManager, session));
- register.addAction(DocsEvents.REMOVE_AUTHOR, new ContentRemoveAuthorAction(stateManager, session));
- register.addAction(DocsEvents.SET_LANGUAGE, new ContentSetLanguageAction(session));
- register.addAction(DocsEvents.SET_PUBLISHED_ON, new ContentSetPublishedOnAction(session));
- register.addAction(DocsEvents.RENAME_CONTENT, new ContentRenameAction(session));
- register.addAction(DocsEvents.DEL_CONTENT, new ContentDelContentAction(stateManager, session));
- register.addAction(DocsEvents.RENAME_TOKEN, new RenameTokenAction(session, stateManager));
- }
-}
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-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -25,7 +25,8 @@
import org.ourproject.kune.docs.client.ctx.admin.ui.AdminContextPanel;
import org.ourproject.kune.docs.client.ctx.folder.FolderContext;
import org.ourproject.kune.docs.client.ctx.folder.FolderContextPresenter;
-import org.ourproject.kune.platf.client.KunePlatform;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
+import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.tool.ToolSelector;
@@ -37,6 +38,8 @@
import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
import com.calclab.suco.client.modules.AbstractModule;
import com.calclab.suco.client.provider.Factory;
@@ -62,7 +65,8 @@
register(SingletonScope.class, new Factory<AdminContext>(AdminContext.class) {
public AdminContext create() {
final AdminContextPresenter presenter = new AdminContextPresenter($(Session.class),
- $$(TagsSummary.class));
+ $(StateManager.class), $$(TagsSummary.class), $$(ContentServiceAsync.class),
+ $(EntityTitlePresenter.class), $(EntitySubTitlePresenter.class));
final AdminContextView view = new AdminContextPanel(presenter, i18n);
presenter.init(view);
return presenter;
@@ -72,9 +76,11 @@
register(SingletonScope.class, new Factory<DocumentContent>(DocumentContent.class) {
public DocumentContent create() {
final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
- final DocumentContentPresenter presenter = new DocumentContentPresenter(panel, $(Session.class),
+ final DocumentContentPresenter presenter = new DocumentContentPresenter($(StateManager.class),
+ $(I18nUITranslationService.class), $(KuneErrorHandler.class), panel, $(Session.class),
$(RateIt.class), $$(DocumentReader.class), $$(DocumentReaderControl.class),
- $$(TextEditor.class), $$(FolderViewer.class), $$(FolderEditor.class));
+ $$(TextEditor.class), $$(FolderViewer.class), $$(FolderEditor.class),
+ $$(ContentServiceAsync.class));
return presenter;
}
});
@@ -106,7 +112,8 @@
register(SingletonScope.class, new Factory<FolderContext>(FolderContext.class) {
public FolderContext create() {
- final FolderContextPresenter presenter = new FolderContextPresenter($(ContextItems.class), i18n);
+ final FolderContextPresenter presenter = new FolderContextPresenter($(ContextItems.class),
+ $(StateManager.class), $(Session.class), i18n, $$(ContentServiceAsync.class));
return presenter;
}
});
@@ -127,13 +134,6 @@
}
});
- final KunePlatform platform = $(KunePlatform.class);
- final DocumentClientTool docClientTool = $(DocumentClientTool.class);
- platform.addTool(docClientTool);
-
- final Session session = $(Session.class);
- final StateManager stateManager = $(StateManager.class);
- platform.install(new DocsClientModule(session, stateManager, i18n));
+ $(DocumentClientTool.class);
}
-
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java 2008-08-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -20,28 +20,33 @@
package org.ourproject.kune.docs.client.cnt;
-import org.ourproject.kune.docs.client.actions.DocsEvents;
import org.ourproject.kune.docs.client.cnt.folder.FolderEditor;
import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewer;
import org.ourproject.kune.docs.client.cnt.reader.DocumentReader;
import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControl;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
-import org.ourproject.kune.platf.client.dto.SaveDocumentActionParams;
import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.errors.SessionExpiredException;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
+import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.rate.RateIt;
import org.ourproject.kune.workspace.client.component.WorkspaceDeckView;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.editor.TextEditorListener;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.sitebar.Site;
import com.calclab.suco.client.container.Provider;
import com.calclab.suco.client.signal.Signal0;
import com.calclab.suco.client.signal.Slot0;
+import com.google.gwt.user.client.rpc.AsyncCallback;
public class DocumentContentPresenter implements DocumentContent, TextEditorListener {
private final WorkspaceDeckView view;
+ private final StateManager stateManager;
private StateDTO content;
private final Session session;
private final RateIt rateIt;
@@ -52,12 +57,20 @@
private final Provider<FolderViewer> folderViewerProvider;
private final Signal0 onEdit;
private final Signal0 onCancel;
+ private final Provider<ContentServiceAsync> contentServiceProvider;
+ private final I18nUITranslationService i18n;
+ private final KuneErrorHandler errorHandler;
- public DocumentContentPresenter(final WorkspaceDeckView view, final Session session, final RateIt rateIt,
- final Provider<DocumentReader> docReaderProvider,
+ public DocumentContentPresenter(final StateManager stateManager, final I18nUITranslationService i18n,
+ final KuneErrorHandler errorHandler, final WorkspaceDeckView view, final Session session,
+ final RateIt rateIt, final Provider<DocumentReader> docReaderProvider,
final Provider<DocumentReaderControl> docReaderControlProvider,
final Provider<TextEditor> textEditorProvider, final Provider<FolderViewer> folderViewerProvider,
- final Provider<FolderEditor> folderEditorProvider) {
+ final Provider<FolderEditor> folderEditorProvider,
+ final Provider<ContentServiceAsync> contentServiceProvider) {
+ this.stateManager = stateManager;
+ this.i18n = i18n;
+ this.errorHandler = errorHandler;
this.view = view;
this.session = session;
this.rateIt = rateIt;
@@ -66,6 +79,7 @@
this.textEditorProvider = textEditorProvider;
this.folderViewerProvider = folderViewerProvider;
this.folderEditorProvider = folderEditorProvider;
+ this.contentServiceProvider = contentServiceProvider;
this.onEdit = new Signal0("onEdit");
this.onCancel = new Signal0("onCancel");
}
@@ -86,7 +100,15 @@
}
public void onDelete() {
- DefaultDispatcher.getInstance().fire(DocsEvents.DEL_CONTENT, content.getDocumentId());
+ Site.showProgressProcessing();
+ contentServiceProvider.get().delContent(session.getUserHash(),
+ session.getCurrentState().getGroup().getShortName(), content.getDocumentId(),
+ new AsyncCallbackSimple<Object>() {
+ public void onSuccess(final Object result) {
+ Site.hideProgress();
+ stateManager.reload();
+ }
+ });
}
public void onEdit() {
@@ -114,9 +136,27 @@
public void onSave(final String text) {
content.setContent(text);
- DefaultDispatcher.getInstance().fire(DocsEvents.SAVE_DOCUMENT, new SaveDocumentActionParams(content, this));
- // Re-enable rateIt widget
- rateIt.setVisible(true);
+ Site.showProgressSaving();
+ contentServiceProvider.get().save(session.getUserHash(), session.getCurrentState().getGroup().getShortName(),
+ content.getDocumentId(), content.getContent(), new AsyncCallback<Integer>() {
+ public void onFailure(final Throwable caught) {
+ Site.hideProgress();
+ try {
+ throw caught;
+ } catch (final SessionExpiredException e) {
+ errorHandler.doSessionExpired();
+ } catch (final Throwable e) {
+ Site.error(i18n.t("Error saving document. Retrying..."));
+ errorHandler.process(caught);
+ onSaveFailed();
+ }
+ }
+
+ public void onSuccess(final Integer result) {
+ Site.hideProgress();
+ onSaved();
+ }
+ });
}
public void onSaved() {
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-08-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -23,20 +23,20 @@
import java.util.Date;
import java.util.List;
-import org.ourproject.kune.docs.client.actions.DocsEvents;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
import org.ourproject.kune.platf.client.dto.AccessListsDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.TagResultDTO;
import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
-import org.ourproject.kune.platf.client.rpc.ContentService;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.tags.TagsSummary;
+import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
import com.calclab.suco.client.container.Provider;
@@ -45,14 +45,57 @@
private AdminContextView view;
private final Session session;
private final Provider<TagsSummary> tagsSummaryProvider;
+ private final Provider<ContentServiceAsync> contentServiceProvider;
+ private final EntitySubTitlePresenter entitySubTitlePresenter;
+ private final EntityTitlePresenter entityTitlePresenter;
+ private final StateManager stateManager;
- public AdminContextPresenter(final Session session, final Provider<TagsSummary> tagsSummaryProvider) {
+ public AdminContextPresenter(final Session session, final StateManager stateManager,
+ final Provider<TagsSummary> tagsSummaryProvider,
+ final Provider<ContentServiceAsync> contentServiceProvider,
+ final EntityTitlePresenter entityTitlePresenter, final EntitySubTitlePresenter entitySubTitlePresenter) {
this.session = session;
+ this.stateManager = stateManager;
this.tagsSummaryProvider = tagsSummaryProvider;
+ this.contentServiceProvider = contentServiceProvider;
+ this.entityTitlePresenter = entityTitlePresenter;
+ this.entitySubTitlePresenter = entitySubTitlePresenter;
}
+ public void addAuthor(final String authorShortName) {
+ Site.showProgressProcessing();
+ final StateDTO currentState = session.getCurrentState();
+ contentServiceProvider.get().addAuthor(session.getUserHash(), currentState.getGroup().getShortName(),
+ currentState.getDocumentId(), authorShortName, new AsyncCallbackSimple<Object>() {
+ public void onSuccess(final Object result) {
+ Site.hideProgress();
+ stateManager.reload();
+ }
+ });
+ }
+
+ public void delAuthor(final String authorShortName) {
+ Site.showProgressProcessing();
+ final StateDTO currentState = session.getCurrentState();
+ contentServiceProvider.get().removeAuthor(session.getUserHash(), currentState.getGroup().getShortName(),
+ currentState.getDocumentId(), authorShortName, new AsyncCallbackSimple<Object>() {
+ public void onSuccess(final Object result) {
+ Site.hideProgress();
+ stateManager.reload();
+ }
+ });
+ }
+
public void doChangeLanguage(final String langCode) {
- DefaultDispatcher.getInstance().fire(DocsEvents.SET_LANGUAGE, langCode);
+ Site.showProgressProcessing();
+ final StateDTO currentState = session.getCurrentState();
+ contentServiceProvider.get().setLanguage(session.getUserHash(), currentState.getGroup().getShortName(),
+ currentState.getDocumentId(), langCode, new AsyncCallbackSimple<I18nLanguageDTO>() {
+ public void onSuccess(final I18nLanguageDTO lang) {
+ Site.hideProgress();
+ entitySubTitlePresenter.setContentLanguage(lang.getEnglishName());
+ }
+ });
}
public View getView() {
@@ -63,8 +106,17 @@
this.view = view;
}
- public void setPublishedOn(final Date date) {
- DefaultDispatcher.getInstance().fire(DocsEvents.SET_PUBLISHED_ON, date);
+ public void setPublishedOn(final Date publishedOn) {
+ Site.showProgressProcessing();
+ final StateDTO currentState = session.getCurrentState();
+ contentServiceProvider.get().setPublishedOn(session.getUserHash(), currentState.getGroup().getShortName(),
+ currentState.getDocumentId(), publishedOn, new AsyncCallbackSimple<Object>() {
+ public void onSuccess(final Object result) {
+ Site.hideProgress();
+ entityTitlePresenter.setContentDate(publishedOn);
+ }
+ });
+
}
public void setState(final StateDTO content) {
@@ -106,10 +158,9 @@
public void setTags(final String tagsString) {
Site.showProgressProcessing();
- final ContentServiceAsync server = ContentService.App.getInstance();
final StateDTO currentState = session.getCurrentState();
- server.setTags(session.getUserHash(), currentState.getGroup().getShortName(), currentState.getDocumentId(),
- tagsString, new AsyncCallbackSimple<List<TagResultDTO>>() {
+ contentServiceProvider.get().setTags(session.getUserHash(), currentState.getGroup().getShortName(),
+ currentState.getDocumentId(), tagsString, new AsyncCallbackSimple<List<TagResultDTO>>() {
public void onSuccess(final List<TagResultDTO> result) {
tagsSummaryProvider.get().setGroupTags(result);
Site.hideProgress();
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/folder/FolderContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/folder/FolderContextPresenter.java 2008-08-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/folder/FolderContextPresenter.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -21,34 +21,72 @@
package org.ourproject.kune.docs.client.ctx.folder;
import org.ourproject.kune.docs.client.DocumentClientTool;
-import org.ourproject.kune.docs.client.actions.DocsEvents;
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
import org.ourproject.kune.platf.client.dto.ContainerDTO;
+import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
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.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItemsImages;
+import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.signal.Slot;
+
public class FolderContextPresenter implements FolderContext {
private final ContextItems contextItems;
- public FolderContextPresenter(final ContextItems contextItems, final I18nTranslationService i18n) {
- this.contextItems = contextItems;
- ContextItemsImages contextImages = ContextItemsImages.App.getInstance();
- contextItems.registerType(DocumentClientTool.TYPE_DOCUMENT, contextImages.pageWhite());
- contextItems.registerType(DocumentClientTool.TYPE_FOLDER, contextImages.folder());
- contextItems.canCreate(DocumentClientTool.TYPE_DOCUMENT, i18n.t("New document"), DocsEvents.ADD_DOCUMENT);
- contextItems.canCreate(DocumentClientTool.TYPE_FOLDER, i18n.t("New folder"), DocsEvents.ADD_FOLDER);
- contextItems.setParentTreeVisible(true);
+ public FolderContextPresenter(final ContextItems contextItems, final StateManager stateManager,
+ final Session session, final I18nTranslationService i18n,
+ final Provider<ContentServiceAsync> contentServiceProvider) {
+ this.contextItems = contextItems;
+ final ContextItemsImages contextImages = ContextItemsImages.App.getInstance();
+ contextItems.registerType(DocumentClientTool.TYPE_DOCUMENT, contextImages.pageWhite());
+ contextItems.registerType(DocumentClientTool.TYPE_FOLDER, contextImages.folder());
+ contextItems.canCreate(i18n.t("New document"), i18n.t("Add a document"), new Slot<String>() {
+ public void onEvent(final String name) {
+ Site.showProgressProcessing();
+ contentServiceProvider.get().addContent(session.getUserHash(),
+ session.getCurrentState().getGroup().getShortName(),
+ session.getCurrentState().getFolder().getId(), name, new AsyncCallbackSimple<StateDTO>() {
+ public void onSuccess(final StateDTO state) {
+ Site.info(i18n.t("Created, now you can edit the document"));
+ stateManager.setRetrievedState(state);
+ Site.hideProgress();
+ }
+ });
+ }
+ });
+ contextItems.canCreate(i18n.t("New folder"), i18n.t("Add a folder"), new Slot<String>() {
+ public void onEvent(final String name) {
+ Site.showProgressProcessing();
+ contentServiceProvider.get().addFolder(session.getUserHash(),
+ session.getCurrentState().getGroup().getShortName(),
+ session.getCurrentState().getFolder().getId(), name, new AsyncCallbackSimple<StateDTO>() {
+ public void onSuccess(final StateDTO state) {
+ Site.info(i18n.t("Folder created"));
+ stateManager.setRetrievedState(state);
+ // FIXME: Isn't using cache
+ stateManager.reloadContextAndTitles();
+ Site.hideProgress();
+ }
+ });
+ }
+ });
+ contextItems.setParentTreeVisible(true);
}
public View getView() {
- return contextItems.getView();
+ return contextItems.getView();
}
public void setContainer(final StateToken state, final ContainerDTO container, final AccessRightsDTO rights) {
- contextItems.showContainer(state, container, rights);
+ contextItems.showContainer(state, container, rights);
}
}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/KunePlatform.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/KunePlatform.java 2008-08-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/KunePlatform.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -1,71 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * 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;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.dispatch.ActionEvent;
-import org.ourproject.kune.platf.client.extend.ClientModule;
-import org.ourproject.kune.platf.client.extend.Register;
-import org.ourproject.kune.platf.client.tool.ClientTool;
-
-public class KunePlatform implements Register {
- private final ArrayList<ClientTool> tools;
- private final ArrayList<ActionEvent<?>> actions;
-
- public KunePlatform() {
- this.tools = new ArrayList<ClientTool>();
- this.actions = new ArrayList<ActionEvent<?>>();
- }
-
- @SuppressWarnings("unchecked")
- public void addAction(final String eventName, final Action<?> action) {
- actions.add(new ActionEvent(eventName, action));
- }
-
- public void addTool(final ClientTool clientTool) {
- tools.add(clientTool);
- }
-
- public ArrayList<ActionEvent<?>> getActions() {
- return actions;
- }
-
- public HashMap<String, ClientTool> getIndexedTools() {
- final HashMap<String, ClientTool> toolsIndexed = new HashMap<String, ClientTool>();
- for (ClientTool tool : this.tools) {
- toolsIndexed.put(tool.getName(), tool);
- }
- return toolsIndexed;
- }
-
- public List<ClientTool> getTools() {
- return tools;
- }
-
- public void install(final ClientModule module) {
- module.configure(this);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/PlatformEvents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/PlatformEvents.java 2008-08-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/PlatformEvents.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -1,26 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * 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;
-
-public interface PlatformEvents {
- public static final String ATTACH_TO_EXTENSIBLE_WIDGET = "ws.AttachToExtensibleWidget";
- public static final String DETACH_FROM_EXTENSIBLE_WIDGET = "ws.DetachToExtensibleWidget";
- public static final String CLEAR_EXTENSIBLE_WIDGET = "ws.ClearExtensionPoint";
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java 2008-08-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -20,28 +20,14 @@
package org.ourproject.kune.platf.client.app;
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import org.ourproject.kune.platf.client.dispatch.ActionEvent;
-import org.ourproject.kune.platf.client.tool.ClientTool;
-
import com.calclab.suco.client.signal.Slot0;
public interface Application {
- ClientTool getTool(String toolName);
-
- void init(HashMap<String, ClientTool> tools);
-
void onApplicationStart(Slot0 slot);
void onApplicationStop(Slot0 slot);
void start();
- void stop();
-
- void subscribeActions(ArrayList<ActionEvent<?>> actions);
-
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java 2008-08-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -20,23 +20,12 @@
package org.ourproject.kune.platf.client.app;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.ourproject.kune.platf.client.dispatch.ActionEvent;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
import org.ourproject.kune.platf.client.dto.InitDataDTO;
import org.ourproject.kune.platf.client.rpc.SiteService;
import org.ourproject.kune.platf.client.rpc.SiteServiceAsync;
-import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.tool.ClientTool;
-import org.ourproject.kune.platf.client.ui.WindowUtils;
import org.ourproject.kune.platf.client.utils.PrefetchUtilities;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.signal.Signal0;
@@ -48,15 +37,12 @@
import com.google.gwt.user.client.ui.RootPanel;
public class ApplicationDefault implements Application {
- // private final Workspace workspace;
- private Map<String, ClientTool> tools;
private final Session session;
private final Signal0 onApplicationStart;
private final Signal0 onApplicationStop;
- public ApplicationDefault(final Session session, final KuneErrorHandler errorHandler, final WorkspaceSkeleton ws) {
+ public ApplicationDefault(final Session session) {
this.session = session;
- tools = new HashMap<String, ClientTool>();
this.onApplicationStart = new Signal0("onApplicationStart");
this.onApplicationStop = new Signal0("onApplicationStop");
Window.addWindowCloseListener(new WindowCloseListener() {
@@ -70,14 +56,6 @@
});
}
- public ClientTool getTool(final String toolName) {
- return tools.get(toolName);
- }
-
- public void init(final HashMap<String, ClientTool> tools) {
- this.tools = tools;
- }
-
public void onApplicationStart(final Slot0 slot) {
onApplicationStart.add(slot);
}
@@ -98,19 +76,6 @@
prefetchTimer.schedule(20000);
}
- public void stop() {
- onApplicationStop.fire();
- }
-
- public void subscribeActions(final ArrayList<ActionEvent<?>> actions) {
- ActionEvent<?> actionEvent;
-
- for (final Iterator<ActionEvent<?>> it = actions.iterator(); it.hasNext();) {
- actionEvent = it.next();
- DefaultDispatcher.getInstance().subscribe(actionEvent.event, actionEvent.action);
- }
- }
-
private void getInitData() {
final SiteServiceAsync server = SiteService.App.getInstance();
server.getInitData(session.getUserHash(), new AsyncCallback<InitDataDTO>() {
@@ -121,20 +86,14 @@
}
public void onSuccess(final InitDataDTO initData) {
- checkChatDomain(initData.getChatDomain());
session.setInitData(initData);
session.setCurrentUserInfo(initData.getUserInfo());
RootPanel.get("kuneinitialcurtain").setVisible(false);
}
-
- private void checkChatDomain(final String chatDomain) {
- final String httpDomain = WindowUtils.getLocation().getHostName();
- if (!chatDomain.equals(httpDomain)) {
- Log.error("Your http domain (" + httpDomain + ") is different from the chat domain (" + chatDomain
- + "). This will produce problems with the chat functionality. "
- + "Check kune.properties on the server.");
- }
- }
});
}
+
+ private void stop() {
+ onApplicationStop.fire();
+ }
}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/dto/SaveDocumentActionParams.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/SaveDocumentActionParams.java 2008-08-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/SaveDocumentActionParams.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -1,41 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * 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.dto;
-
-import org.ourproject.kune.docs.client.cnt.DocumentContent;
-
-public class SaveDocumentActionParams {
- private final StateDTO stateDTO;
- private final DocumentContent documentContent;
-
- public SaveDocumentActionParams(final StateDTO stateDTO, final DocumentContent documentContent) {
- this.stateDTO = stateDTO;
- this.documentContent = documentContent;
- }
-
- public StateDTO getStateDTO() {
- return stateDTO;
- }
-
- public DocumentContent getDocumentContent() {
- return documentContent;
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentService.java 2008-08-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentService.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -30,33 +30,18 @@
import org.ourproject.kune.platf.client.dto.TagResultDTO;
import org.ourproject.kune.platf.client.errors.DefaultException;
-import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
-import com.google.gwt.user.client.rpc.ServiceDefTarget;
public interface ContentService extends RemoteService {
- public static class App {
- private static ContentServiceAsync instance;
-
- public static ContentServiceAsync getInstance() {
- if (instance == null) {
- instance = (ContentServiceAsync) GWT.create(ContentService.class);
- ((ServiceDefTarget) instance).setServiceEntryPoint(GWT.getModuleBaseURL() + "ContentService");
-
- }
- return instance;
- }
- }
-
void addAuthor(String userHash, String groupShortName, String documentId, String authorShortName)
- throws DefaultException;
+ throws DefaultException;
CommentDTO addComment(String userHash, String groupShortName, String documentId, Long parentCommentId,
- String commentText) throws DefaultException;
+ String commentText) throws DefaultException;
CommentDTO addComment(String userHash, String groupShortName, String documentId, String commentText)
- throws DefaultException;
+ throws DefaultException;
StateDTO addContent(String user, String groupShortName, Long parentFolderId, String name) throws DefaultException;
@@ -71,25 +56,25 @@
List<TagResultDTO> getSummaryTags(String userHash, String groupShortName) throws DefaultException;
CommentDTO markCommentAsAbuse(String userHash, String groupShortName, String documentId, Long commentId)
- throws DefaultException;
+ throws DefaultException;
void rateContent(String userHash, String groupShortName, String documentId, Double value) throws DefaultException;
void removeAuthor(String userHash, String groupShortName, String documentId, String authorShortName)
- throws DefaultException;
+ throws DefaultException;
String rename(String userHash, String groupShortName, String token, String newName) throws DefaultException;
Integer save(String user, String groupShortName, String documentId, String content) throws DefaultException;
I18nLanguageDTO setLanguage(String userHash, String groupShortName, String documentId, String languageCode)
- throws DefaultException;
+ throws DefaultException;
void setPublishedOn(String userHash, String groupShortName, String documentId, Date date) throws DefaultException;
List<TagResultDTO> setTags(String userHash, String groupShortName, String documentId, String tags)
- throws DefaultException;
+ throws DefaultException;
CommentDTO voteComment(String userHash, String groupShortName, String documentId, Long commentId,
- boolean votePositive) throws DefaultException;
+ boolean votePositive) throws DefaultException;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2008-08-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -55,6 +55,12 @@
this.onSessionExpired = new Signal0("onSessionExpired");
}
+ public void doSessionExpired() {
+ onSessionExpired.fire();
+ getWorkspaceSkeleton().showAlertMessage(i18n.t("Session expired"),
+ i18n.t("Your session has expired. Please login again."));
+ }
+
public WorkspaceSkeleton getWorkspaceSkeleton() {
return wsProvider.get();
}
@@ -109,12 +115,6 @@
}
}
- private void doSessionExpired() {
- onSessionExpired.fire();
- getWorkspaceSkeleton().showAlertMessage(i18n.t("Session expired"),
- i18n.t("Your session has expired. Please login again."));
- }
-
private void logException(final Throwable e) {
logException(e, false);
}
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-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -2,7 +2,6 @@
import org.ourproject.kune.chat.client.ChatClientNewModule;
import org.ourproject.kune.docs.client.DocumentClientNewModule;
-import org.ourproject.kune.platf.client.KunePlatform;
import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.app.ApplicationDefault;
import org.ourproject.kune.platf.client.app.HistoryWrapper;
@@ -185,8 +184,10 @@
}
}, new Factory<ContentServiceAsync>(ContentServiceAsync.class) {
public ContentServiceAsync create() {
- // FIXME
- return ContentService.App.getInstance();
+ final ContentServiceAsync contentServiceAsync = (ContentServiceAsync) GWT.create(ContentService.class);
+ ((ServiceDefTarget) contentServiceAsync)
+ .setServiceEntryPoint(GWT.getModuleBaseURL() + "ContentService");
+ return contentServiceAsync;
}
});
@@ -264,19 +265,12 @@
final KuneErrorHandler errorHandler = $(KuneErrorHandler.class);
AsyncCallbackSimple.init(errorHandler);
- register(SingletonScope.class, new Factory<KunePlatform>(KunePlatform.class) {
- public KunePlatform create() {
- return new KunePlatform();
- }
- });
-
final WorkspaceSkeleton ws = $(WorkspaceSkeleton.class);
final Images images = $(Images.class);
register(SingletonScope.class, new Factory<Application>(Application.class) {
public Application create() {
- final Session session = $(Session.class);
- return new ApplicationDefault(session, $(KuneErrorHandler.class), ws);
+ return new ApplicationDefault($(Session.class));
}
});
@@ -452,7 +446,7 @@
register(SingletonScope.class, new Factory<EntityTitlePresenter>(EntityTitlePresenter.class) {
public EntityTitlePresenter create() {
final EntityTitlePresenter presenter = new EntityTitlePresenter(i18n, $(KuneErrorHandler.class),
- $(StateManager.class));
+ $(StateManager.class), $(Session.class), $$(ContentServiceAsync.class));
final EntityTitlePanel panel = new EntityTitlePanel(ws, presenter);
presenter.init(panel);
return presenter;
@@ -586,7 +580,8 @@
register(SingletonScope.class, new Factory<ContextItems>(ContextItems.class) {
public ContextItems create() {
- final ContextItemsPresenter presenter = new ContextItemsPresenter(i18n, $(StateManager.class));
+ final ContextItemsPresenter presenter = new ContextItemsPresenter(i18n, $(StateManager.class),
+ $(Session.class), $$(ContentServiceAsync.class));
final ContextItemsPanel panel = new ContextItemsPanel(presenter, i18n, $(StateManager.class));
presenter.init(panel);
return presenter;
@@ -638,9 +633,6 @@
}
});
- final KunePlatform platform = $(KunePlatform.class);
- $(Application.class).init(platform.getIndexedTools());
- $(Application.class).subscribeActions(platform.getActions());
$(Application.class).start();
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java 2008-08-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -68,6 +68,8 @@
public void setInitData(InitDataDTO initData);
+ UserInfoDTO getCurrentUserInfo();
+
String getUserHash();
void onInitDataReceived(Slot<InitDataDTO> slot);
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-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerDefault.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -143,6 +143,8 @@
find(user, group); // check access
final Long groupId = group.getId();
final List<Group> adminInGroups = finder.findAdminInGroups(groupId);
+ // Don't show self user group
+ adminInGroups.remove(user.getUserGroup());
final List<Group> collabInGroups = finder.findCollabInGroups(groupId);
return new ParticipationData(adminInGroups, collabInGroups);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItems.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItems.java 2008-08-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItems.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -30,10 +30,8 @@
public interface ContextItems {
- public void canCreate(String typeName, String label, Slot<?> slot);
+ public void canCreate(String buttonTitle, String promptMessage, Slot<String> slot);
- public void canCreate(String typeName, String label, String eventName);
-
public View getView();
public void registerType(String typeName, AbstractImagePrototype pageWhite);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPanel.java 2008-08-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPanel.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -27,6 +27,7 @@
import org.ourproject.kune.platf.client.ui.HorizontalLine;
import org.ourproject.kune.platf.client.ui.IconLabel;
+import com.calclab.suco.client.signal.Slot;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.DockPanel;
@@ -39,14 +40,10 @@
private final VerticalPanel controls;
private final ItemsPanel items;
private final ContextTopBar topBar;
- private final ContextItemsPresenter presenter;
- private String currentEventName;
- private String workaroundTypeName;
private final I18nTranslationService i18n;
public ContextItemsPanel(final ContextItemsPresenter presenter, final I18nTranslationService i18n,
final StateManager stateManager) {
- this.presenter = presenter;
this.i18n = i18n;
topBar = new ContextTopBar(presenter, i18n, stateManager);
addTopBar(topBar);
@@ -70,17 +67,16 @@
horizontalLine.setWidth("100%");
}
- public void addCommand(final String typeName, final String label, final String eventName) {
- final String type = typeName;
- final IconLabel iconLabel = new IconLabel(Images.App.getInstance().addGreen(), label);
+ public void addCommand(final String buttonText, final String promptMessage, final Slot<String> slot) {
+ final IconLabel iconLabel = new IconLabel(Images.App.getInstance().addGreen(), buttonText);
iconLabel.addClickListener(new ClickListener() {
public void onClick(final Widget sender) {
- currentEventName = eventName;
- presenter.onNew(type);
+ promptName(promptMessage, slot);
}
});
iconLabel.addStyleName("kune-ContextItemsPanel-LabelLink");
controls.add(iconLabel);
+
}
public void addItem(final String name, final String type, final String event, final boolean editable) {
@@ -91,6 +87,14 @@
items.clear();
}
+ public void promptName(final String title, final Slot<String> slot) {
+ MessageBox.prompt(title, i18n.t("Please enter a name:"), new MessageBox.PromptCallback() {
+ public void execute(final String btnID, final String text) {
+ slot.onEvent(text);
+ }
+ });
+ }
+
public void registerType(final String typeName, final AbstractImagePrototype image) {
items.registerType(typeName, image);
}
@@ -119,28 +123,6 @@
topBar.firstRow.setVisible(visible);
}
- public void showCreationField(final String typeName) {
- String title;
- // Workaround: gwt-ext bug, I cannot use typeName directly
- workaroundTypeName = typeName;
-
- // FIXME use constants!!!!
- if (typeName.equals("docs.doc")) {
- title = i18n.t("Add a document");
- } else if (typeName.equals("docs.folder")) {
- title = i18n.t("Add a folder");
- } else if (typeName.equals("chat.room")) {
- title = i18n.t("Add a chat room");
- } else {
- title = i18n.t("Add a new [%s]", typeName);
- }
- MessageBox.prompt(title, i18n.t("Please enter a name:"), new MessageBox.PromptCallback() {
- public void execute(final String btnID, final String text) {
- presenter.create(workaroundTypeName, text, currentEventName);
- }
- });
- }
-
private void addTopBar(final Widget widget) {
add(topBar, DockPanel.NORTH);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPresenter.java 2008-08-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPresenter.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -22,20 +22,20 @@
import java.util.List;
-import org.ourproject.kune.docs.client.actions.DocsEvents;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
-import org.ourproject.kune.platf.client.dispatch.Dispatcher;
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
import org.ourproject.kune.platf.client.dto.ContainerDTO;
import org.ourproject.kune.platf.client.dto.ContentDTO;
+import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
-import org.ourproject.kune.platf.client.rpc.ParamCallback;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
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.workspace.client.sitebar.Site;
+import com.calclab.suco.client.container.Provider;
import com.calclab.suco.client.signal.Slot;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
@@ -43,27 +43,21 @@
protected ContextItemsView view;
private final I18nTranslationService i18n;
private final StateManager stateManager;
+ private final Session session;
+ private final Provider<ContentServiceAsync> contentServiceProvider;
- public ContextItemsPresenter(final I18nTranslationService i18n, final StateManager stateManager) {
+ public ContextItemsPresenter(final I18nTranslationService i18n, final StateManager stateManager,
+ final Session session, final Provider<ContentServiceAsync> contentServiceProvider) {
this.i18n = i18n;
this.stateManager = stateManager;
+ this.session = session;
+ this.contentServiceProvider = contentServiceProvider;
}
- public void canCreate(final String typeName, final String label, final Slot<?> slot) {
- // TODO
+ public void canCreate(final String buttonText, final String promptMessage, final Slot<String> slot) {
+ view.addCommand(buttonText, promptMessage, slot);
}
- public void canCreate(final String typeName, final String label, final String eventName) {
- view.addCommand(typeName, label, eventName);
- }
-
- public void create(final String typeName, final String value, final String eventName) {
- if (value != null) {
- final Dispatcher dispatcher = DefaultDispatcher.getInstance();
- dispatcher.fire(eventName, value);
- }
- }
-
public View getView() {
return view;
}
@@ -73,22 +67,23 @@
}
public void onGoUp() {
- DefaultDispatcher.getInstance().fire(DocsEvents.GO_PARENT_FOLDER, null);
+ final StateDTO state = session.getCurrentState();
+ final StateToken token = state.getStateToken();
+ token.setDocument(null);
+ token.setFolder(state.getFolder().getParentFolderId().toString());
+ stateManager.setState(token);
}
- public void onNew(final String typeName) {
- view.showCreationField(typeName);
- }
-
- public void onTitleRename(final String text, final String token) {
+ public void onTitleRename(final String newName, final String token) {
Site.showProgressSaving();
- DefaultDispatcher.getInstance().fire(DocsEvents.RENAME_CONTENT,
- new ParamCallback<String, Object>(text, new AsyncCallbackSimple<Object>() {
- public void onSuccess(final Object result) {
+ final StateDTO currentState = session.getCurrentState();
+ contentServiceProvider.get().rename(session.getUserHash(), currentState.getGroup().getShortName(), token,
+ newName, new AsyncCallbackSimple<String>() {
+ public void onSuccess(final String result) {
stateManager.reloadContextAndTitles();
Site.hideProgress();
}
- }));
+ });
}
public void registerType(final String typeName, final AbstractImagePrototype image) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsView.java 2008-08-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsView.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -23,15 +23,23 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.ContainerSimpleDTO;
+import com.calclab.suco.client.signal.Slot;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
public interface ContextItemsView extends View {
- void clear();
+ void addCommand(String buttonTitle, String promptMessage, Slot<String> slot);
+
void addItem(String name, String type, String event, boolean editable);
+ void clear();
+
+ void registerType(String typeName, AbstractImagePrototype image);
+
void selectItem(int index);
+ void setAbsolutePath(ContainerSimpleDTO[] absolutePath);
+
void setControlsVisible(boolean isVisible);
void setCurrentName(String name);
@@ -40,12 +48,4 @@
void setParentTreeVisible(boolean b);
- void registerType(String typeName, AbstractImagePrototype image);
-
- void addCommand(String typeName, String label, String eventName);
-
- void showCreationField(String typeName);
-
- void setAbsolutePath(ContainerSimpleDTO[] absolutePath);
-
}
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-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPanel.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -34,6 +34,16 @@
userMenu.showAt(sender.getAbsoluteLeft(), sender.getAbsoluteTop() + 10);
}
});
+ final Item userHomePage = new Item(i18n.t("Your homepage"));
+ userHomePage.setIcon("images/group-home.gif");
+ userHomePage.addListener(new BaseItemListenerAdapter() {
+ @Override
+ public void onClick(final BaseItem item, final EventObject e) {
+ super.onClick(item, e);
+ presenter.onUserHomePage();
+ }
+ });
+ userMenu.addItem(userHomePage);
final Item userPreferences = new Item(i18n.t("Your preferences"));
userPreferences.setIcon("images/kune-preferences.gif");
userPreferences.addListener(new BaseItemListenerAdapter() {
@@ -55,8 +65,8 @@
}
public void setParticipation(final MenuItemCollection<GroupDTO> participateInGroups) {
+ userParticipation.removeAll();
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) {
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-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPresenter.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -16,8 +16,10 @@
private SiteUserMenuView view;
private final MenuItemCollection<GroupDTO> participateInGroups;
private final StateManager stateManager;
+ private final Session session;
public SiteUserMenuPresenter(final Session session, final StateManager stateManager) {
+ this.session = session;
this.stateManager = stateManager;
participateInGroups = new MenuItemCollection<GroupDTO>();
session.onUserSignIn(new Slot<UserInfoDTO>() {
@@ -42,6 +44,10 @@
this.view = view;
}
+ public void onUserHomePage() {
+ stateManager.gotoToken(session.getCurrentUserInfo().getShortName());
+ }
+
public void onUserPreferences() {
// TODO Auto-generated method stub
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java 2008-08-09 18:40:32 UTC (rev 839)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -22,16 +22,16 @@
import java.util.Date;
-import org.ourproject.kune.docs.client.actions.DocsEvents;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.platf.client.rpc.ParamCallback;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
+import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.sitebar.Site;
+import com.calclab.suco.client.container.Provider;
import com.calclab.suco.client.signal.Slot;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -42,12 +42,17 @@
private final I18nTranslationService i18n;
private final KuneErrorHandler errorHandler;
private final StateManager stateManager;
+ private final Provider<ContentServiceAsync> contentServiceProvider;
+ private final Session session;
public EntityTitlePresenter(final I18nTranslationService i18n, final KuneErrorHandler errorHandler,
- final StateManager stateManager) {
+ final StateManager stateManager, final Session session,
+ final Provider<ContentServiceAsync> contentServiceProvider) {
this.i18n = i18n;
this.errorHandler = errorHandler;
this.stateManager = stateManager;
+ this.session = session;
+ this.contentServiceProvider = contentServiceProvider;
stateManager.onStateChanged(new Slot<StateDTO>() {
public void onEvent(final StateDTO state) {
setState(state);
@@ -63,25 +68,26 @@
this.view = view;
}
- public void onTitleRename(final String text) {
+ public void onTitleRename(final String newName) {
Site.showProgressSaving();
- final AsyncCallback<String> callback = new AsyncCallback<String>() {
- public void onFailure(final Throwable caught) {
- view.restoreOldTitle();
- errorHandler.process(caught);
- }
+ final StateDTO currentState = session.getCurrentState();
+ contentServiceProvider.get().rename(session.getUserHash(), currentState.getGroup().getShortName(),
+ currentState.getStateToken().getEncoded(), newName, new AsyncCallback<String>() {
+ public void onFailure(final Throwable caught) {
+ view.restoreOldTitle();
+ errorHandler.process(caught);
+ }
- public void onSuccess(final String result) {
- Site.hideProgress();
- view.setContentTitle(result);
- stateManager.reloadContextAndTitles();
- }
- };
- DefaultDispatcher.getInstance().fire(DocsEvents.RENAME_CONTENT,
- new ParamCallback<String, String>(text, callback));
+ public void onSuccess(final String result) {
+ Site.hideProgress();
+ view.setContentTitle(result);
+ stateManager.reloadContextAndTitles();
+ }
+ });
+ Site.hideProgress();
}
- private void setContentDate(final Date publishedOn) {
+ public void setContentDate(final Date publishedOn) {
final DateTimeFormat fmt = DateTimeFormat.getFormat("MM/dd/yyyy, Z");
view.setContentDate(i18n.t("Published on: [%s]", fmt.format(publishedOn)));
}
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java 2008-08-09 18:40:32 UTC (rev 839)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -51,6 +51,8 @@
@Test
public void customPropertiesInUserInfoMappping() {
+ // Make a custom converter instead of mapper.mapProperties
+ // http://dozer.sourceforge.net/documentation/customconverter.html
final UserInfo userInfo = new UserInfo();
final ChatUserParams userChatParams = new ChatUserParams("avatar", true, SubscriptionMode.autoAcceptAll,
"color");
@@ -64,6 +66,7 @@
@Test
public void customPropertiesMappping() throws ClassNotFoundException {
+ // Make a custom converter instead of mapper.mapProperties
final ChatUserParams userChatParams = new ChatUserParams("avatar", true, SubscriptionMode.autoAcceptAll,
"color");
final CustomProperties customProperties = new CustomProperties();
Copied: trunk/src/test/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePresenterTest.java (from rev 828, trunk/src/test/java/org/ourproject/kune/sitebar/client/msg/SiteMessagePresenterTest.java)
===================================================================
--- trunk/src/test/java/org/ourproject/kune/sitebar/client/msg/SiteMessagePresenterTest.java 2008-08-05 01:29:31 UTC (rev 828)
+++ trunk/src/test/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePresenterTest.java 2008-08-10 04:29:30 UTC (rev 840)
@@ -0,0 +1,68 @@
+package org.ourproject.kune.workspace.client.sitebar.msg;
+
+import org.easymock.EasyMock;
+import org.junit.Before;
+import org.junit.Test;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessagePresenter;
+import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessageView;
+
+public class SiteMessagePresenterTest {
+
+ private SiteMessagePresenter presenter;
+ private SiteMessageView view;
+
+ @Before
+ public void createObjects() {
+ view = EasyMock.createStrictMock(SiteMessageView.class);
+ presenter = new SiteMessagePresenter();
+ }
+
+ @Test
+ public void testMessage() {
+ view.hide();
+ view.setMessage("test 1", SiteErrorType.info, SiteErrorType.error);
+ view.show();
+ EasyMock.replay(view);
+ presenter.init(view);
+ presenter.setMessage("test 1", SiteErrorType.error);
+ EasyMock.verify(view);
+ }
+
+ @Test
+ public void testTwoMessagesDifTypes() {
+ view.hide();
+ view.setMessage("test 1", SiteErrorType.info, SiteErrorType.veryimp);
+ view.show();
+ view.setMessage("test 1<br>test 2", SiteErrorType.veryimp, SiteErrorType.error);
+ view.show();
+ EasyMock.replay(view);
+ presenter.init(view);
+ presenter.setMessage("test 1", SiteErrorType.veryimp);
+ presenter.setMessage("test 2", SiteErrorType.error);
+ EasyMock.verify(view);
+ }
+
+ @Test
+ public void testTwoMessagesSameType() {
+ view.hide();
+ view.setMessage("test 1", SiteErrorType.info, SiteErrorType.error);
+ view.show();
+ view.setMessage("test 1<br>test 2");
+ view.show();
+ EasyMock.replay(view);
+ presenter.init(view);
+ presenter.setMessage("test 1", SiteErrorType.error);
+ presenter.setMessage("test 2", SiteErrorType.error);
+ EasyMock.verify(view);
+ }
+
+ @Test
+ public void testViewInitialization() {
+ view.hide();
+ EasyMock.replay(view);
+ presenter.init(view);
+ EasyMock.verify(view);
+ }
+
+}
1
0
Author: vjrj
Date: 2008-08-09 20:40:32 +0200 (Sat, 09 Aug 2008)
New Revision: 839
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/dto/ChatUserParamsDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/CustomPropertiesDTO.java
Modified:
trunk/src/main/java/org/ourproject/kune/app/public/Kune.html
trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css
trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserInfoDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
trunk/src/main/java/org/ourproject/kune/platf/server/domain/CustomProperties.java
trunk/src/main/java/org/ourproject/kune/platf/server/mapper/DozerMapper.java
trunk/src/main/java/org/ourproject/kune/platf/server/mapper/Mapper.java
trunk/src/main/java/org/ourproject/kune/platf/server/rpc/UserRPC.java
trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfo.java
trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfoServiceDefault.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java
trunk/src/main/resources/dozerBeanMapping.xml
trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java
Log:
Complete - task 1: User parameters Server
Modified: trunk/src/main/java/org/ourproject/kune/app/public/Kune.html
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/Kune.html 2008-08-09 14:49:34 UTC (rev 838)
+++ trunk/src/main/java/org/ourproject/kune/app/public/Kune.html 2008-08-09 18:40:32 UTC (rev 839)
@@ -18,7 +18,24 @@
<link rel="shortcut icon" href="images/favicon.ico" />
<title>Kune</title>
+<style type="text/css">
+#kuneprogresspanel {
+ position: absolute;
+ top: 2px;
+ left: 2px;
+ z-index: 30000;
+}
+
+.kune-Progress {
+ background: #E5FF80;
+ border: 1px solid #E5FF80;
+ white-space: nowrap;
+ height: 16px;
+ padding: 0 3px;
+}
+
+</style>
</head>
<body>
<script type="text/javascript" language="javascript"
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-08-09 14:49:34 UTC (rev 838)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2008-08-09 18:40:32 UTC (rev 839)
@@ -1908,21 +1908,6 @@
/* Sitebar */
-#kuneprogresspanel {
- position: absolute;
- top: 2px;
- left: 2px;
- z-index: 30000;
-}
-
-.kune-Progress {
- background: #E5FF80;
- border: 1px solid #E5FF80;
- white-space: nowrap;
- height: 16px;
- padding: 0 3px;
-}
-
.kune-SiteBarPanel .kune-IconHyperlink {
white-space: nowrap;
}
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css 2008-08-09 14:49:34 UTC (rev 838)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css 2008-08-09 18:40:32 UTC (rev 839)
@@ -1,20 +1,5 @@
/* Sitebar */
-#kuneprogresspanel {
- position: absolute;
- top: 2px;
- left: 2px;
- z-index: 30000;
-}
-
-.kune-Progress {
- background: #E5FF80;
- border: 1px solid #E5FF80;
- white-space: nowrap;
- height: 16px;
- padding: 0 3px;
-}
-
.kune-SiteBarPanel .kune-IconHyperlink {
white-space: nowrap;
}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/dto/ChatUserParamsDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/ChatUserParamsDTO.java 2008-08-09 14:49:34 UTC (rev 838)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/ChatUserParamsDTO.java 2008-08-09 18:40:32 UTC (rev 839)
@@ -0,0 +1,61 @@
+package org.ourproject.kune.platf.client.dto;
+
+import com.calclab.emite.client.im.roster.RosterManager;
+import com.calclab.emite.client.im.roster.RosterManager.SubscriptionMode;
+import com.google.gwt.user.client.rpc.IsSerializable;
+
+public class ChatUserParamsDTO implements IsSerializable {
+
+ private String avatar;
+
+ private boolean publishRoster;
+
+ private SubscriptionMode subscriptionMode;
+
+ private String chatColor;
+
+ public ChatUserParamsDTO() {
+ this(null, false, SubscriptionMode.autoAcceptAll, null);
+ };
+
+ public ChatUserParamsDTO(final String avatar, final boolean publishRoster, final SubscriptionMode subscriptionMode,
+ final String chatColor) {
+ this.avatar = avatar;
+ this.publishRoster = publishRoster;
+ this.subscriptionMode = subscriptionMode;
+ this.chatColor = chatColor;
+ }
+
+ public String getAvatar() {
+ return avatar;
+ }
+
+ public String getChatColor() {
+ return chatColor;
+ }
+
+ public RosterManager.SubscriptionMode getSubscriptionMode() {
+ return subscriptionMode;
+ }
+
+ public boolean isPublishRoster() {
+ return publishRoster;
+ }
+
+ public void setAvatar(final String avatar) {
+ this.avatar = avatar;
+ }
+
+ public void setChatColor(final String chatColor) {
+ this.chatColor = chatColor;
+ }
+
+ public void setPublishRoster(final boolean publishRoster) {
+ this.publishRoster = publishRoster;
+ }
+
+ public void setSubscriptionMode(final RosterManager.SubscriptionMode subscriptionMode) {
+ this.subscriptionMode = subscriptionMode;
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/dto/CustomPropertiesDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/CustomPropertiesDTO.java 2008-08-09 14:49:34 UTC (rev 838)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/CustomPropertiesDTO.java 2008-08-09 18:40:32 UTC (rev 839)
@@ -0,0 +1,37 @@
+package org.ourproject.kune.platf.client.dto;
+
+import java.util.HashMap;
+
+import com.google.gwt.user.client.rpc.IsSerializable;
+
+public class CustomPropertiesDTO implements IsSerializable {
+
+ private HashMap<Class<?>, Object> data;
+
+ public CustomPropertiesDTO() {
+ data = new HashMap<Class<?>, Object>();
+ }
+
+ public HashMap<Class<?>, Object> getData() {
+ return data;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T getData(final Class<T> type) {
+ return (T) data.get(type);
+ }
+
+ public <T> boolean hasPropertie(final Class<T> type) {
+ return data.containsKey(type);
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T setData(final Class<T> type, final T value) {
+ return (T) data.put(type, value);
+ }
+
+ public void setData(final HashMap<Class<?>, Object> data) {
+ this.data = data;
+ }
+
+}
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-09 14:49:34 UTC (rev 838)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserInfoDTO.java 2008-08-09 18:40:32 UTC (rev 839)
@@ -34,6 +34,7 @@
private I18nCountryDTO country;
private List<GroupDTO> groupsIsAdmin;
private List<GroupDTO> groupsIsCollab;
+ private CustomPropertiesDTO customProperties;
public String getChatName() {
return chatName;
@@ -47,6 +48,10 @@
return country;
}
+ public CustomPropertiesDTO getCustomProperties() {
+ return customProperties;
+ }
+
public List<GroupDTO> getGroupsIsAdmin() {
return groupsIsAdmin;
}
@@ -88,6 +93,10 @@
this.country = country;
}
+ public void setCustomProperties(final CustomPropertiesDTO customProperties) {
+ this.customProperties = customProperties;
+ }
+
public void setGroupsIsAdmin(final List<GroupDTO> groupsIsAdmin) {
this.groupsIsAdmin = groupsIsAdmin;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2008-08-09 14:49:34 UTC (rev 838)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2008-08-09 18:40:32 UTC (rev 839)
@@ -71,7 +71,7 @@
logException(e);
Site.error(i18n.t("You don't have rights to do that"));
} catch (final SessionExpiredException e) {
- logException(e, true);
+ logException(e);
doSessionExpired();
} catch (final UserMustBeLoggedException e) {
logException(e);
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/domain/CustomProperties.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/CustomProperties.java 2008-08-09 14:49:34 UTC (rev 838)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/CustomProperties.java 2008-08-09 18:40:32 UTC (rev 839)
@@ -22,12 +22,16 @@
private Long id;
@Lob
- private final HashMap<Class<?>, Object> data;
+ private HashMap<Class<?>, Object> data;
public CustomProperties() {
data = new HashMap<Class<?>, Object>();
}
+ public HashMap<Class<?>, Object> getData() {
+ return data;
+ }
+
@SuppressWarnings("unchecked")
public <T> T getData(final Class<T> type) {
return (T) data.get(type);
@@ -46,6 +50,10 @@
return (T) data.put(type, value);
}
+ public void setData(final HashMap<Class<?>, Object> data) {
+ this.data = data;
+ }
+
public void setId(final Long id) {
this.id = id;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/mapper/DozerMapper.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/mapper/DozerMapper.java 2008-08-09 14:49:34 UTC (rev 838)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/mapper/DozerMapper.java 2008-08-09 18:40:32 UTC (rev 839)
@@ -21,12 +21,15 @@
package org.ourproject.kune.platf.server.mapper;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import net.sf.dozer.util.mapping.DozerBeanMapperSingletonWrapper;
import net.sf.dozer.util.mapping.MapperIF;
+import org.ourproject.kune.platf.client.dto.CustomPropertiesDTO;
import org.ourproject.kune.platf.client.dto.SearchResultDTO;
+import org.ourproject.kune.platf.server.domain.CustomProperties;
import org.ourproject.kune.platf.server.manager.impl.SearchResult;
import com.google.inject.Singleton;
@@ -53,6 +56,20 @@
return dest;
}
+ public CustomPropertiesDTO mapProperties(final CustomProperties customProperties) throws ClassNotFoundException {
+ final CustomPropertiesDTO customPropertiesDTO = new CustomPropertiesDTO();
+ final HashMap<Class<?>, Object> dataMapped = new HashMap<Class<?>, Object>();
+ for (final Class<?> c : customProperties.getData().keySet()) {
+ final Object object = customProperties.getData(c);
+ final Class<?> destClassName = Class.forName("org.ourproject.kune.platf.client.dto." + c.getSimpleName()
+ + "DTO");
+ final Object objectMapped = map(object, destClassName);
+ dataMapped.put(destClassName, objectMapped);
+ }
+ customPropertiesDTO.setData(dataMapped);
+ return customPropertiesDTO;
+ }
+
@SuppressWarnings("unchecked")
public <K, T> SearchResultDTO<T> mapSearchResult(final SearchResult<K> result, final Class<T> type) {
final SearchResultDTO<T> resultDTO = new SearchResultDTO<T>();
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/mapper/Mapper.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/mapper/Mapper.java 2008-08-09 14:49:34 UTC (rev 838)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/mapper/Mapper.java 2008-08-09 18:40:32 UTC (rev 839)
@@ -22,7 +22,9 @@
import java.util.List;
+import org.ourproject.kune.platf.client.dto.CustomPropertiesDTO;
import org.ourproject.kune.platf.client.dto.SearchResultDTO;
+import org.ourproject.kune.platf.server.domain.CustomProperties;
import org.ourproject.kune.platf.server.manager.impl.SearchResult;
public interface Mapper {
@@ -30,5 +32,7 @@
<T> List<T> mapList(List<?> list, Class<T> type);
+ CustomPropertiesDTO mapProperties(CustomProperties customProperties) throws ClassNotFoundException;
+
<K, T> SearchResultDTO<T> mapSearchResult(SearchResult<K> result, Class<T> type);
}
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-08-09 14:49:34 UTC (rev 838)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/UserRPC.java 2008-08-09 18:40:32 UTC (rev 839)
@@ -111,7 +111,14 @@
private UserInfoDTO loadUserInfo(final User user) throws DefaultException {
final UserInfo userInfo = userInfoService.buildInfo(user, getUserSession().getHash());
- return mapper.map(userInfo, UserInfoDTO.class);
+ final UserInfoDTO map = mapper.map(userInfo, UserInfoDTO.class);
+ try {
+ map.setCustomProperties(mapper.mapProperties(userInfo.getCustomProperties()));
+ } catch (final ClassNotFoundException e) {
+ e.printStackTrace();
+ throw new DefaultException("Class not found during mapping userInfo");
+ }
+ return map;
}
private UserInfoDTO loginUser(final User user) 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-09 14:49:34 UTC (rev 838)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfo.java 2008-08-09 18:40:32 UTC (rev 839)
@@ -21,6 +21,7 @@
import java.util.List;
+import org.ourproject.kune.platf.server.domain.CustomProperties;
import org.ourproject.kune.platf.server.domain.Group;
import org.ourproject.kune.platf.server.domain.I18nCountry;
import org.ourproject.kune.platf.server.domain.I18nLanguage;
@@ -36,6 +37,7 @@
private String userHash;
private I18nLanguage language;
private I18nCountry country;
+ private CustomProperties customProperties;
public String getChatName() {
return chatName;
@@ -49,6 +51,10 @@
return country;
}
+ public CustomProperties getCustomProperties() {
+ return customProperties;
+ }
+
public List<Group> getGroupsIsAdmin() {
return groupsIsAdmin;
}
@@ -89,6 +95,10 @@
this.country = country;
}
+ public void setCustomProperties(final CustomProperties customProperties) {
+ this.customProperties = customProperties;
+ }
+
public void setGroupsIsAdmin(final List<Group> groupsIsAdmin) {
this.groupsIsAdmin = groupsIsAdmin;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfoServiceDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfoServiceDefault.java 2008-08-09 14:49:34 UTC (rev 838)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfoServiceDefault.java 2008-08-09 18:40:32 UTC (rev 839)
@@ -53,6 +53,7 @@
info.setLanguage(language);
info.setCountry(user.getCountry());
info.setUserHash(userHash);
+ info.setCustomProperties(user.getCustomProperties());
final Group userGroup = user.getUserGroup();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java 2008-08-09 14:49:34 UTC (rev 838)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java 2008-08-09 18:40:32 UTC (rev 839)
@@ -143,7 +143,7 @@
groupsPanel.addListener(new PanelListenerAdapter() {
public void onActivate(final Panel panel) {
- dialog.setTitle(i18n.t("Search users & groups"));
+ dialog.setTitle(i18n.t("Search users and groups"));
presenter.doSearch(SiteSearcherType.group_user);
}
});
Modified: trunk/src/main/resources/dozerBeanMapping.xml
===================================================================
--- trunk/src/main/resources/dozerBeanMapping.xml 2008-08-09 14:49:34 UTC (rev 838)
+++ trunk/src/main/resources/dozerBeanMapping.xml 2008-08-09 18:40:32 UTC (rev 839)
@@ -287,5 +287,19 @@
<b>name</b>
</field>
</mapping>
+
+ <mapping>
+ <class-a>org.ourproject.kune.platf.client.dto.ChatUserParamsDTO</class-a>
+ <class-b>org.ourproject.kune.platf.server.domain.ChatUserParams</class-b>
+ </mapping>
+ <mapping>
+ <class-a>org.ourproject.kune.platf.client.dto.CustomPropertiesDTO</class-a>
+ <class-b>org.ourproject.kune.platf.server.domain.CustomProperties</class-b>
+ <field>
+ <a>data</a>
+ <b>data</b>
+ </field>
+ </mapping>
+
</mappings>
\ No newline at end of file
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java 2008-08-09 14:49:34 UTC (rev 838)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java 2008-08-09 18:40:32 UTC (rev 839)
@@ -10,21 +10,26 @@
import org.junit.Before;
import org.junit.Test;
+import org.ourproject.kune.platf.client.dto.ChatUserParamsDTO;
import org.ourproject.kune.platf.client.dto.CommentDTO;
import org.ourproject.kune.platf.client.dto.ContainerDTO;
import org.ourproject.kune.platf.client.dto.ContainerSimpleDTO;
import org.ourproject.kune.platf.client.dto.ContentDTO;
+import org.ourproject.kune.platf.client.dto.CustomPropertiesDTO;
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.GroupListDTO;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.dto.LinkDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.dto.UserInfoDTO;
import org.ourproject.kune.platf.server.TestDomainHelper;
import org.ourproject.kune.platf.server.TestHelper;
import org.ourproject.kune.platf.server.access.AccessRights;
+import org.ourproject.kune.platf.server.domain.ChatUserParams;
import org.ourproject.kune.platf.server.domain.Comment;
import org.ourproject.kune.platf.server.domain.Container;
import org.ourproject.kune.platf.server.domain.Content;
+import org.ourproject.kune.platf.server.domain.CustomProperties;
import org.ourproject.kune.platf.server.domain.Group;
import org.ourproject.kune.platf.server.domain.GroupList;
import org.ourproject.kune.platf.server.domain.GroupListMode;
@@ -33,7 +38,9 @@
import org.ourproject.kune.platf.server.domain.User;
import org.ourproject.kune.platf.server.manager.GroupManager;
import org.ourproject.kune.platf.server.state.State;
+import org.ourproject.kune.platf.server.users.UserInfo;
+import com.calclab.emite.client.im.roster.RosterManager.SubscriptionMode;
import com.google.inject.Inject;
public class MapperTest {
@@ -42,6 +49,30 @@
@Inject
GroupManager groupManager;
+ @Test
+ public void customPropertiesInUserInfoMappping() {
+ final UserInfo userInfo = new UserInfo();
+ final ChatUserParams userChatParams = new ChatUserParams("avatar", true, SubscriptionMode.autoAcceptAll,
+ "color");
+ final CustomProperties customProperties = new CustomProperties();
+ customProperties.setData(ChatUserParams.class, userChatParams);
+ userInfo.setCustomProperties(customProperties);
+ final UserInfoDTO map = mapper.map(userInfo, UserInfoDTO.class);
+ final ChatUserParamsDTO data = map.getCustomProperties().getData(ChatUserParamsDTO.class);
+ assertEquals("avatar", data.getAvatar());
+ }
+
+ @Test
+ public void customPropertiesMappping() throws ClassNotFoundException {
+ final ChatUserParams userChatParams = new ChatUserParams("avatar", true, SubscriptionMode.autoAcceptAll,
+ "color");
+ final CustomProperties customProperties = new CustomProperties();
+ customProperties.setData(ChatUserParams.class, userChatParams);
+ final CustomPropertiesDTO map = mapper.mapProperties(customProperties);
+ final ChatUserParamsDTO data = map.getData(ChatUserParamsDTO.class);
+ assertEquals("avatar", data.getAvatar());
+ }
+
@Before
public void inject() {
TestHelper.inject(this);
1
0
r838 - in trunk/src: main/java/org/ourproject/kune/platf/server/domain test/java/org/ourproject/kune/platf/server/manager
by vjrj 09 Aug '08
by vjrj 09 Aug '08
09 Aug '08
Author: vjrj
Date: 2008-08-09 16:49:34 +0200 (Sat, 09 Aug 2008)
New Revision: 838
Added:
trunk/src/main/java/org/ourproject/kune/platf/server/domain/ChatUserParams.java
trunk/src/main/java/org/ourproject/kune/platf/server/domain/CustomProperties.java
Removed:
trunk/src/main/java/org/ourproject/kune/platf/server/domain/UserParams.java
Modified:
trunk/src/main/java/org/ourproject/kune/platf/server/domain/User.java
trunk/src/test/java/org/ourproject/kune/platf/server/manager/UserManagerTest.java
Log:
Incomplete - task 1: User parameters Server
Added: trunk/src/main/java/org/ourproject/kune/platf/server/domain/ChatUserParams.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/ChatUserParams.java 2008-08-08 23:52:38 UTC (rev 837)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/ChatUserParams.java 2008-08-09 14:49:34 UTC (rev 838)
@@ -0,0 +1,64 @@
+package org.ourproject.kune.platf.server.domain;
+
+import java.io.Serializable;
+
+import com.calclab.emite.client.im.roster.RosterManager;
+import com.calclab.emite.client.im.roster.RosterManager.SubscriptionMode;
+
+public class ChatUserParams implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private String avatar;
+
+ private boolean publishRoster;
+
+ private SubscriptionMode subscriptionMode;
+
+ private String chatColor;
+
+ public ChatUserParams() {
+ this(null, false, SubscriptionMode.autoAcceptAll, null);
+ };
+
+ public ChatUserParams(final String avatar, final boolean publishRoster, final SubscriptionMode subscriptionMode,
+ final String chatColor) {
+ this.avatar = avatar;
+ this.publishRoster = publishRoster;
+ this.subscriptionMode = subscriptionMode;
+ this.chatColor = chatColor;
+ }
+
+ public String getAvatar() {
+ return avatar;
+ }
+
+ public String getChatColor() {
+ return chatColor;
+ }
+
+ public RosterManager.SubscriptionMode getSubscriptionMode() {
+ return subscriptionMode;
+ }
+
+ public boolean isPublishRoster() {
+ return publishRoster;
+ }
+
+ public void setAvatar(final String avatar) {
+ this.avatar = avatar;
+ }
+
+ public void setChatColor(final String chatColor) {
+ this.chatColor = chatColor;
+ }
+
+ public void setPublishRoster(final boolean publishRoster) {
+ this.publishRoster = publishRoster;
+ }
+
+ public void setSubscriptionMode(final RosterManager.SubscriptionMode subscriptionMode) {
+ this.subscriptionMode = subscriptionMode;
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/server/domain/CustomProperties.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/CustomProperties.java 2008-08-08 23:52:38 UTC (rev 837)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/CustomProperties.java 2008-08-09 14:49:34 UTC (rev 838)
@@ -0,0 +1,52 @@
+package org.ourproject.kune.platf.server.domain;
+
+import java.util.HashMap;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Lob;
+import javax.persistence.Table;
+
+import org.hibernate.search.annotations.DocumentId;
+import org.hibernate.search.annotations.Indexed;
+
+@Entity
+@Indexed
+@Table(name = "customproperties")
+public class CustomProperties implements HasId {
+
+ @Id
+ @DocumentId
+ @GeneratedValue
+ private Long id;
+
+ @Lob
+ private final HashMap<Class<?>, Object> data;
+
+ public CustomProperties() {
+ data = new HashMap<Class<?>, Object>();
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T getData(final Class<T> type) {
+ return (T) data.get(type);
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public <T> boolean hasPropertie(final Class<T> type) {
+ return data.containsKey(type);
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T setData(final Class<T> type, final T value) {
+ return (T) data.put(type, value);
+ }
+
+ public void setId(final Long id) {
+ this.id = id;
+ }
+}
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-08-08 23:52:38 UTC (rev 837)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/User.java 2008-08-09 14:49:34 UTC (rev 838)
@@ -98,6 +98,9 @@
@NotNull
private TimeZone timezone;
+ @OneToOne(cascade = CascadeType.ALL)
+ private final CustomProperties customProperties;
+
public User() {
this(null, null, null, null, null, null, null);
}
@@ -112,6 +115,7 @@
this.language = language;
this.country = country;
this.timezone = timezone;
+ customProperties = new CustomProperties();
}
@Finder(query = "from User")
@@ -135,6 +139,10 @@
return country;
}
+ public CustomProperties getCustomProperties() {
+ return customProperties;
+ }
+
public String getEmail() {
return email;
}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/server/domain/UserParams.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/UserParams.java 2008-08-08 23:52:38 UTC (rev 837)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/UserParams.java 2008-08-09 14:49:34 UTC (rev 838)
@@ -1,80 +0,0 @@
-package org.ourproject.kune.platf.server.domain;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import org.hibernate.search.annotations.DocumentId;
-import org.hibernate.search.annotations.Indexed;
-import org.hibernate.validator.NotNull;
-
-import com.calclab.emite.client.im.roster.RosterManager;
-import com.calclab.emite.client.im.roster.RosterManager.SubscriptionMode;
-
-@Entity
-@Indexed
-@Table(name = "usersparams")
-public class UserParams {
-
- @Id
- @DocumentId
- @GeneratedValue
- private Long id;
-
- private String avatar;
-
- @NotNull
- private boolean publishRoster;
-
- @NotNull
- private SubscriptionMode subscriptionMode;
-
- @NotNull
- private String chatColor;
-
- public UserParams(final String avatar, final boolean publishRoster, final SubscriptionMode subscriptionMode,
- final String chatColor) {
- this.avatar = avatar;
- this.publishRoster = publishRoster;
- this.subscriptionMode = subscriptionMode;
- this.chatColor = chatColor;
- }
-
- public String getAvatar() {
- return avatar;
- }
-
- public String getChatColor() {
- return chatColor;
- }
-
- public Long getId() {
- return id;
- }
-
- public RosterManager.SubscriptionMode getSubscriptionMode() {
- return subscriptionMode;
- }
-
- public boolean isPublishRoster() {
- return publishRoster;
- }
-
- public void setAvatar(final String avatar) {
- this.avatar = avatar;
- }
-
- public void setChatColor(final String chatColor) {
- this.chatColor = chatColor;
- }
-
- public void setPublishRoster(final boolean publishRoster) {
- this.publishRoster = publishRoster;
- }
-
- public void setSubscriptionMode(final RosterManager.SubscriptionMode subscriptionMode) {
- this.subscriptionMode = subscriptionMode;
- }
-
-}
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/manager/UserManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/manager/UserManagerTest.java 2008-08-08 23:52:38 UTC (rev 837)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/manager/UserManagerTest.java 2008-08-09 14:49:34 UTC (rev 838)
@@ -15,12 +15,15 @@
import org.junit.Test;
import org.ourproject.kune.platf.client.errors.I18nNotFoundException;
import org.ourproject.kune.platf.server.PersistenceTest;
+import org.ourproject.kune.platf.server.domain.ChatUserParams;
+import org.ourproject.kune.platf.server.domain.CustomProperties;
import org.ourproject.kune.platf.server.domain.Group;
import org.ourproject.kune.platf.server.domain.I18nCountry;
import org.ourproject.kune.platf.server.domain.I18nLanguage;
import org.ourproject.kune.platf.server.domain.User;
import org.ourproject.kune.platf.server.manager.impl.SearchResult;
+import com.calclab.emite.client.im.roster.RosterManager.SubscriptionMode;
import com.google.inject.Inject;
public class UserManagerTest extends PersistenceTest {
@@ -46,99 +49,116 @@
@After
public void close() {
- if (getTransaction().isActive()) {
- getTransaction().rollback();
- }
+ if (getTransaction().isActive()) {
+ getTransaction().rollback();
+ }
}
@Test
public void emailCorrect() {
- user = new User("test1", "test1 name", "test(a)example.com", "some passwd", english, gb, getTimeZone());
- persist(user);
+ user = new User("test1", "test1 name", "test(a)example.com", "some passwd", english, gb, getTimeZone());
+ persist(user);
}
@Test(expected = InvalidStateException.class)
public void emailEmpty() {
- user = new User("test1", "test1 name", "", "some passwd", english, gb, getTimeZone());
- persist(user);
+ user = new User("test1", "test1 name", "", "some passwd", english, gb, getTimeZone());
+ persist(user);
}
@Test(expected = InvalidStateException.class)
public void emailIncorrect() {
- user = new User("test1", "test1 name", "falseEmail@", "some passwd", english, gb, getTimeZone());
- persist(user);
+ user = new User("test1", "test1 name", "falseEmail@", "some passwd", english, gb, getTimeZone());
+ persist(user);
}
@Before
public void insertData() throws Exception {
- openTransaction();
- assertEquals(0, userFinder.getAll().size());
- assertEquals(0, groupFinder.getAll().size());
- english = new I18nLanguage(new Long(1819), "English", "English", "en");
- languageManager.persist(english);
- gb = new I18nCountry(new Long(75), "GB", "GBP", ".", "£%n", "", ".", "United Kingdom", "western", ",");
- countryManager.persist(gb);
- user = new User(USER_SHORT_NAME, USER_LONG_NAME, USER_EMAIL, USER_PASSWORD, english, gb, getTimeZone());
- persist(user);
+ openTransaction();
+ assertEquals(0, userFinder.getAll().size());
+ assertEquals(0, groupFinder.getAll().size());
+ english = new I18nLanguage(new Long(1819), "English", "English", "en");
+ languageManager.persist(english);
+ gb = new I18nCountry(new Long(75), "GB", "GBP", ".", "£%n", "", ".", "United Kingdom", "western", ",");
+ countryManager.persist(gb);
+ user = new User(USER_SHORT_NAME, USER_LONG_NAME, USER_EMAIL, USER_PASSWORD, english, gb, getTimeZone());
+ persist(user);
}
@Test
public void loginIncorrect() {
- final User result = userManager.login("test", "test");
- assertNull(result);
+ final User result = userManager.login("test", "test");
+ assertNull(result);
}
@Test
public void loginWithEmailCorrect() {
- final User result = userManager.login(USER_EMAIL, USER_PASSWORD);
- assertNotNull(result.getId());
+ final User result = userManager.login(USER_EMAIL, USER_PASSWORD);
+ assertNotNull(result.getId());
}
@Test
public void loginWithNickCorrect() {
- final User result = userManager.login(USER_SHORT_NAME, USER_PASSWORD);
- assertNotNull(result.getId());
+ final User result = userManager.login(USER_SHORT_NAME, USER_PASSWORD);
+ assertNotNull(result.getId());
}
@Test(expected = InvalidStateException.class)
public void passwdLengthIncorrect() {
- user = new User("test1", "test1 name", "test(a)example.com", "pass", english, gb, getTimeZone());
- persist(user);
+ user = new User("test1", "test1 name", "test(a)example.com", "pass", english, gb, getTimeZone());
+ persist(user);
}
@Test(expected = EntityExistsException.class)
public void testUserExist() throws I18nNotFoundException {
- final User user1 = userManager.createUser("test", "test 1 name", "test1(a)example.com", "some password", "en",
- "GB", "GMT");
- persist(user1);
- final User user2 = userManager.createUser("test", "test 1 name", "test1(a)example.com", "some password", "en",
- "GB", "GMT");
- persist(user2);
+ final User user1 = userManager.createUser("test", "test 1 name", "test1(a)example.com", "some password", "en",
+ "GB", "GMT");
+ persist(user1);
+ final User user2 = userManager.createUser("test", "test 1 name", "test1(a)example.com", "some password", "en",
+ "GB", "GMT");
+ persist(user2);
}
@Test(expected = InvalidStateException.class)
public void userNameLengthIncorrect() {
- user = new User("test1", "te", "test(a)example.com", "some passwd", english, gb, getTimeZone());
- persist(user);
+ user = new User("test1", "te", "test(a)example.com", "some passwd", english, gb, getTimeZone());
+ persist(user);
}
@Test
+ public void userSaveAndGetCustomProperties() {
+ final User user1 = userManager.createUser("test", "test 1 name", "test1(a)example.com", "some password", "en",
+ "GB", "GMT");
+ final ChatUserParams userChatParams = new ChatUserParams("avatar", true, SubscriptionMode.autoAcceptAll,
+ "color");
+ user1.getCustomProperties().setData(ChatUserParams.class, userChatParams);
+ persist(user1);
+ final User find = userManager.find(user1.getId());
+ final CustomProperties customProperties = find.getCustomProperties();
+ assertEquals("avatar", customProperties.getData(ChatUserParams.class).getAvatar());
+ assertEquals("color", customProperties.getData(ChatUserParams.class).getChatColor());
+ assertEquals(SubscriptionMode.autoAcceptAll, customProperties.getData(ChatUserParams.class)
+ .getSubscriptionMode());
+ assertEquals(true, customProperties.getData(ChatUserParams.class).isPublishRoster());
+ }
+
+ @Test
public void userSearch() throws Exception, ParseException {
- userManager.reIndex();
- final SearchResult<User> result = userManager.search(USER_SHORT_NAME);
- assertEquals(1, (long) result.getSize());
- assertEquals(USER_SHORT_NAME, result.getList().get(0).getShortName());
- rollbackTransaction();
+ userManager.reIndex();
+ final SearchResult<User> result = userManager.search(USER_SHORT_NAME);
+ assertEquals(1, (long) result.getSize());
+ assertEquals(USER_SHORT_NAME, result.getList().get(0).getShortName());
+ rollbackTransaction();
}
@Test(expected = InvalidStateException.class)
public void userShortNameIncorrect() {
- user = new User("test1A", "test1 name", "test(a)example.com", "some passwd", english, gb, getTimeZone());
- persist(user);
+ user = new User("test1A", "test1 name", "test(a)example.com", "some passwd", english, gb, getTimeZone());
+ persist(user);
}
private TimeZone getTimeZone() {
- return TimeZone.getDefault();
+ return TimeZone.getDefault();
}
}
1
0
r837 - in trunk/src/main/java/org/ourproject/kune: platf/client/services workspace/client/ui/newtmp/sitebar/siteoptions workspace/client/ui/newtmp/sitebar/siteusermenu
by vjrj 08 Aug '08
by vjrj 08 Aug '08
08 Aug '08
Author: vjrj
Date: 2008-08-09 01:52:38 +0200 (Sat, 09 Aug 2008)
New Revision: 837
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/services/Images.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/siteusermenu/SiteUserMenuPanel.java
Log:
Complete - task 23: SiteBar Menus (options, user menu)
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/Images.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/Images.java 2008-08-08 23:16:06 UTC (rev 836)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/Images.java 2008-08-08 23:52:38 UTC (rev 837)
@@ -232,7 +232,7 @@
@Resource("org/ourproject/kune/platf/public/images/button-help-light.png")
AbstractImagePrototype buttonHelpLight();
- @Resource("org/ourproject/kune/platf/public/images/button-sitebar-arrow-down.gif")
+ @Resource("org/ourproject/kune/platf/public/images/arrowdown.gif")
AbstractImagePrototype buttonSitebarArrowDown();
@Resource("org/ourproject/kune/platf/public/images/by80x15.png")
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 23:16:06 UTC (rev 836)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteoptions/SiteOptionsPanel.java 2008-08-08 23:52:38 UTC (rev 837)
@@ -21,8 +21,8 @@
final I18nUITranslationService i18n, final Provider<I18nTranslator> translatorProvider) {
final PushButton optionsButton = new PushButton("");
// optionsButton.setText(i18n.t("Options"));
- optionsButton.setHTML("<div style=\"text-align: center;\">" + i18n.t("Options")
- + "<img style=\"vertical-align: middle;\" src=\"images/arrowdown.png\" /></div>");
+ optionsButton.setHTML(i18n.t("Options")
+ + "<img style=\"vertical-align: middle;\" src=\"images/arrowdown.png\" />");
optionsButton.setStyleName("k-sitebar-labellink");
ws.getSiteBar().addSeparator();
ws.getSiteBar().add(optionsButton);
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 23:16:06 UTC (rev 836)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPanel.java 2008-08-08 23:52:38 UTC (rev 837)
@@ -51,8 +51,7 @@
}
public void setLoggedUserName(final String name) {
- loggedUserMenu.setHTML("<div style=\"text-align: center;\">" + name
- + "<img style=\"vertical-align: middle;\" src=\"images/arrowdown.png\" /></div>");
+ loggedUserMenu.setHTML(name + "<img style=\"vertical-align: middle;\" src=\"images/arrowdown.png\" />");
}
public void setParticipation(final MenuItemCollection<GroupDTO> participateInGroups) {
1
0
Author: vjrj
Date: 2008-08-09 01:16:06 +0200 (Sat, 09 Aug 2008)
New Revision: 836
Added:
trunk/src/main/java/org/ourproject/kune/platf/public/images/arrowdown.gif
trunk/src/main/java/org/ourproject/kune/platf/public/images/arrowdown.png
trunk/src/main/java/org/ourproject/kune/platf/public/images/group-def-icon.gif
trunk/src/main/java/org/ourproject/kune/platf/public/images/kune-preferences.gif
trunk/src/main/java/org/ourproject/kune/platf/public/images/kuneicon16.gif
Removed:
trunk/src/main/java/org/ourproject/kune/platf/public/images/button-sitebar-arrow-down.gif
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/ui/I18nTranslatorPanel.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/sitenewgroup/SiteNewGroupLinkPanel.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/sitesign/SiteSignInLinkPanel.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/skel/EntitySummary.java
trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTestHelper.java
Log:
Complete - task 23: SiteBar Menus (options, user menu)
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 17:48:55 UTC (rev 835)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-08-08 23:16:06 UTC (rev 836)
@@ -632,6 +632,12 @@
}
});
+ $(StateManager.class).addSiteToken(SiteToken.translate.toString(), new Slot<StateToken>() {
+ public void onEvent(final StateToken previousStateToken) {
+ $(I18nTranslator.class).doShowTranslator();
+ }
+ });
+
final KunePlatform platform = $(KunePlatform.class);
$(Application.class).init(platform.getIndexedTools());
$(Application.class).subscribeActions(platform.getActions());
Copied: trunk/src/main/java/org/ourproject/kune/platf/public/images/arrowdown.gif (from rev 827, trunk/src/main/java/org/ourproject/kune/platf/public/images/button-sitebar-arrow-down.gif)
===================================================================
(Binary files differ)
Added: trunk/src/main/java/org/ourproject/kune/platf/public/images/arrowdown.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/public/images/arrowdown.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: trunk/src/main/java/org/ourproject/kune/platf/public/images/button-sitebar-arrow-down.gif
===================================================================
(Binary files differ)
Added: trunk/src/main/java/org/ourproject/kune/platf/public/images/group-def-icon.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/public/images/group-def-icon.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/public/images/kune-preferences.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/public/images/kune-preferences.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/public/images/kuneicon16.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/public/images/kuneicon16.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
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 17:48:55 UTC (rev 835)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/ui/I18nTranslatorPanel.java 2008-08-08 23:16:06 UTC (rev 836)
@@ -171,7 +171,7 @@
unTransCenterPanel.add(unTransGrid);
transCenterPanel.add(transGrid);
final Frame recommFrame = new Frame("html/i18n-recom.html");
- // recommFrame.setHeight("220");
+ recommFrame.setHeight("auto");
recommendationPanel.add(recommFrame);
center.add(unTransCenterPanel);
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 17:48:55 UTC (rev 835)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2008-08-08 23:16:06 UTC (rev 836)
@@ -136,20 +136,23 @@
private GridItem<GroupDTO> createDefMemberMenu(final GroupDTO group, final GridGroup gridGroup) {
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());
- final GridItem<GroupDTO> gridItem = new GridItem<GroupDTO>(group, gridGroup, group.getShortName(), imageUtils
- .getImageHtml(ImageDescriptor.groupDefIcon), longName, longName, " ", longName, toolTip, menu);
- if (!group.getType().equals(GroupType.PERSONAL)) {
+ boolean isPersonal = group.getType().equals(GroupType.PERSONAL);
+ final String toolTip = i18n.t(isPersonal ? "User nickname: [%s]" : "Group short name: [%s]", group
+ .getShortName());
+ final String imageHtml = isPersonal ? imageUtils.getImageHtml(ImageDescriptor.personDef) : imageUtils
+ .getImageHtml(ImageDescriptor.groupDefIcon);
+ final GridItem<GroupDTO> gridItem = new GridItem<GroupDTO>(group, gridGroup, group.getShortName(), imageHtml,
+ longName, longName, " ", longName, toolTip, menu);
+ if (!isPersonal) {
menu.addMenuItemList(otherOperations);
}
- if (session.isLogged() && !group.getType().equals(GroupType.PERSONAL)) {
+ if (session.isLogged() && !isPersonal) {
menu.addMenuItemList(otherLoggedOperations);
}
- if (group.getType().equals(GroupType.PERSONAL)) {
+ if (isPersonal) {
menu.addMenuItemList(otherOperationsUsers);
}
- if (session.isLogged() && group.getType().equals(GroupType.PERSONAL)) {
+ if (session.isLogged() && isPersonal) {
menu.addMenuItemList(otherLoggedOperationsUsers);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java 2008-08-08 17:48:55 UTC (rev 835)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java 2008-08-08 23:16:06 UTC (rev 836)
@@ -16,6 +16,5 @@
ws.getSiteBar().addSeparator();
ws.getSiteBar().add(newGroupHyperlink);
ws.getSiteBar().addSpacer();
- ws.getSiteBar().addSpacer();
}
}
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 17:48:55 UTC (rev 835)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteoptions/SiteOptionsPanel.java 2008-08-08 23:16:06 UTC (rev 836)
@@ -20,10 +20,14 @@
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.setText(i18n.t("Options"));
+ optionsButton.setHTML("<div style=\"text-align: center;\">" + i18n.t("Options")
+ + "<img style=\"vertical-align: middle;\" src=\"images/arrowdown.png\" /></div>");
optionsButton.setStyleName("k-sitebar-labellink");
ws.getSiteBar().addSeparator();
ws.getSiteBar().add(optionsButton);
+ ws.getSiteBar().addSpacer();
+ ws.getSiteBar().addSpacer();
final Menu optionsMenu = new Menu();
optionsButton.addClickListener(new ClickListener() {
public void onClick(final Widget sender) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPanel.java 2008-08-08 17:48:55 UTC (rev 835)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPanel.java 2008-08-08 23:16:06 UTC (rev 836)
@@ -15,6 +15,7 @@
signInHyperlink.setText(i18n.t("Sign in to collaborate"));
signInHyperlink.setTargetHistoryToken(SiteToken.signin.toString());
ws.getSiteBar().add(signInHyperlink);
+ ws.getSiteBar().addSpacer();
}
public void setVisible(final boolean visible) {
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 17:48:55 UTC (rev 835)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPanel.java 2008-08-08 23:16:06 UTC (rev 836)
@@ -35,7 +35,7 @@
}
});
final Item userPreferences = new Item(i18n.t("Your preferences"));
- userPreferences.setIcon("");
+ userPreferences.setIcon("images/kune-preferences.gif");
userPreferences.addListener(new BaseItemListenerAdapter() {
@Override
public void onClick(final BaseItem item, final EventObject e) {
@@ -51,7 +51,8 @@
}
public void setLoggedUserName(final String name) {
- loggedUserMenu.setText(name);
+ loggedUserMenu.setHTML("<div style=\"text-align: center;\">" + name
+ + "<img style=\"vertical-align: middle;\" src=\"images/arrowdown.png\" /></div>");
}
public void setParticipation(final MenuItemCollection<GroupDTO> participateInGroups) {
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 17:48:55 UTC (rev 835)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPresenter.java 2008-08-08 23:16:06 UTC (rev 836)
@@ -47,11 +47,12 @@
}
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());
- }
- }));
+ participateInGroups.add(new MenuItem<GroupDTO>("images/group-def-icon.gif", group.getShortName(),
+ new Slot<GroupDTO>() {
+ public void onEvent(final GroupDTO param) {
+ stateManager.gotoToken(group.getShortName());
+ }
+ }));
}
private void onUserSignIn(final UserInfoDTO userInfoDTO) {
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 17:48:55 UTC (rev 835)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java 2008-08-08 23:16:06 UTC (rev 836)
@@ -39,9 +39,7 @@
public void addInTools(final Widget widget) {
entityTools.add(widget);
- entityTools.expand();
- // entitySummary.expand();
- mainPanel.syncSize();
+ entityTools.render(widget.getElement());
if (entityTools.isRendered()) {
entityTools.doLayout(false);
}
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTestHelper.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTestHelper.java 2008-08-08 17:48:55 UTC (rev 835)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTestHelper.java 2008-08-08 23:16:06 UTC (rev 836)
@@ -25,7 +25,7 @@
bindScope(SessionScoped.class, Scopes.SINGLETON);
// test: use memory
// test_db: use mysql
- bindConstant().annotatedWith(JpaUnit.class).to("test_db");
+ bindConstant().annotatedWith(JpaUnit.class).to("test");
bindConstant().annotatedWith(PropertiesFileName.class).to("kune.properties");
bind(HttpServletRequest.class).to(HttpServletRequestMocked.class);
}
1
0
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(a)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(a)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());
+ }
}
}
1
0
Author: vjrj
Date: 2008-08-08 06:20:12 +0200 (Fri, 08 Aug 2008)
New Revision: 834
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupType.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/SocialNetworkRequestResult.java
trunk/src/main/java/org/ourproject/kune/platf/server/auth/ContentAuthorizated.java
trunk/src/main/java/org/ourproject/kune/platf/server/auth/ContentAuthorizatedMethodInterceptor.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherType.java
trunk/src/test/java/org/ourproject/kune/platf/server/auth/AuthorizatedMethodInterceptorTest.java
Removed:
trunk/img/emite-groups-logo.svg
trunk/img/emite-groups.png
trunk/src/main/java/org/ourproject/kune/platf/server/domain/GroupType.java
trunk/src/main/java/org/ourproject/kune/platf/server/mapper/GroupTypeConverter.java
Modified:
trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java
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/app/public/css/workspace.css
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/app/Application.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/SocialNetworkDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/rpc/SocialNetworkService.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/Kune.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java
trunk/src/main/java/org/ourproject/kune/platf/server/domain/Group.java
trunk/src/main/java/org/ourproject/kune/platf/server/init/DatabaseInitializer.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/SocialNetworkManager.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/GroupManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SocialNetworkRPC.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearchPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcherPanel.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
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogoPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Entity.java
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/WorkspaceSkeleton.java
trunk/src/main/resources/dozerBeanMapping.xml
trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTestHelper.java
trunk/src/test/java/org/ourproject/kune/platf/integration/kuneservice/GroupServiceTest.java
trunk/src/test/java/org/ourproject/kune/platf/server/manager/GroupManagerTest.java
trunk/src/test/java/org/ourproject/kune/platf/server/manager/SocialNetworkManagerTest.java
trunk/src/test/java/org/ourproject/kune/testhelper/ctx/DomainContext.java
Log:
Complete - task 37: Resolve SN Rights problems
Enums use in UI. Some SN adjusts.
Deleted: trunk/img/emite-groups-logo.svg
===================================================================
--- trunk/img/emite-groups-logo.svg 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/img/emite-groups-logo.svg 2008-08-08 04:20:12 UTC (rev 834)
@@ -1,125 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://web.resource.org/cc/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="42"
- height="42"
- id="svg2533"
- sodipodi:version="0.32"
- inkscape:version="0.45.1"
- version="1.0"
- inkscape:export-filename="/Users/vjrj/Desktop/emite-groups.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90"
- sodipodi:docbase="/Users/vjrj/Desktop"
- sodipodi:docname="emite-groups-logo.svg"
- inkscape:output_extension="org.inkscape.output.svg.inkscape">
- <defs
- id="defs2535" />
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="9.45"
- inkscape:cx="29.482892"
- inkscape:cy="20"
- inkscape:current-layer="layer1"
- showgrid="true"
- inkscape:grid-bbox="true"
- inkscape:document-units="px"
- width="42px"
- height="42px"
- inkscape:window-width="756"
- inkscape:window-height="581"
- inkscape:window-x="354"
- inkscape:window-y="104" />
- <metadata
- id="metadata2538">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- id="layer1"
- inkscape:label="Layer 1"
- inkscape:groupmode="layer">
- <text
- xml:space="preserve"
- style="font-size:23.88686371px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:125%;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke-width:2;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;font-family:Emblem"
- x="-0.14885554"
- y="28.014141"
- id="text2516"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- id="tspan2518"
- x="-0.14885554"
- y="28.014141"
- dy="0 0 -0.57697296"><tspan
- style="fill:#ff6600"
- id="tspan2520">((</tspan>e<tspan
- style="fill:#ff6600"
- id="tspan2522"
- dy="0.57697296">))</tspan></tspan></text>
- <g
- id="g2551"
- transform="matrix(0.126788,0,0,0.126788,107.24045,44.350445)">
- <g
- transform="matrix(1.7831728,0,0,1.7831728,-79.227654,-1724.5839)"
- id="g2524">
- <text
- xml:space="preserve"
- style="font-size:49.60492325px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:89.99999762%;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;opacity:1;fill:#784421;fill-opacity:1;fill-rule:nonzero;stroke-width:2;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;font-family:Emblem"
- x="-219.35106"
- y="817.05505"
- id="text2526"
- sodipodi:linespacing="89.999998%"
- transform="scale(0.9684286,1.0326006)"><tspan
- sodipodi:role="line"
- x="-219.35106"
- y="817.05505"
- id="tspan2528">emite</tspan></text>
- <text
- xml:space="preserve"
- style="font-size:23.32044411px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:89.99999762%;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;opacity:1;fill:#784421;fill-opacity:1;fill-rule:nonzero;stroke-width:2;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;font-family:Emblem"
- x="-217.47432"
- y="839.24841"
- id="text2530"
- sodipodi:linespacing="89.999998%"
- transform="scale(0.9684286,1.0326006)"><tspan
- sodipodi:role="line"
- x="-217.47432"
- y="839.24841"
- id="tspan2532">xmpp & gwt</tspan></text>
- </g>
- <text
- inkscape:export-ydpi="32.508678"
- inkscape:export-xdpi="32.508678"
- inkscape:export-filename="/home/vjrj/proyectos/ourproject.org/kune/dev/emite/emite/img/emite-ui.png"
- transform="scale(0.9684286,1.0326006)"
- sodipodi:linespacing="89.999998%"
- id="text2534"
- y="-133.38048"
- x="-471.8595"
- style="font-size:34.96242523px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:89.99999762%;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;opacity:1;fill:#666666;fill-opacity:1;fill-rule:nonzero;stroke-width:2;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;font-family:Emblem"
- xml:space="preserve"><tspan
- id="tspan2536"
- y="-133.38048"
- x="-471.8595"
- sodipodi:role="line">ui application</tspan></text>
- </g>
- </g>
-</svg>
Deleted: trunk/img/emite-groups.png
===================================================================
(Binary files differ)
Modified: trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -46,6 +46,5 @@
public void onModuleLoadCont() {
Kune.create();
- // RootPanel.getBodyElement().setClassName("kunebody");
}
}
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-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2008-08-08 04:20:12 UTC (rev 834)
@@ -2699,25 +2699,9 @@
background-image: url(img/language.gif) !important;
}
-.chat-icon {
- background-image: url(img/chat.gif) !important;
-}
-.group-icon {
- background-image: url(img/group.gif) !important;
-}
-.user-icon {
- background-image: url(img/user.gif) !important;
-}
-.userf-icon {
- background-image: url(img/userf.gif) !important;
-}
-
-
-
-
/* RTE Text editor */
.kune-TexEditorPanel-TextArea {
margin: 3px;
@@ -3484,13 +3468,13 @@
}
.k-toolselectoritem-notsel a {
- color: blue;
+ color: #0000FF;
padding: 0 9px;
text-decoration: none;
}
.k-toolselectoritem-notsel a:hover {
- text-decoration: none;
+ text-decoration: underline;
}
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-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-08-08 04:20:12 UTC (rev 834)
@@ -618,11 +618,11 @@
}
.k-toolselectoritem-notsel a {
- color: blue;
+ color: #0000FF;
padding: 0 9px;
text-decoration: none;
}
.k-toolselectoritem-notsel a:hover {
- text-decoration: none;
+ text-decoration: underline;
}
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css 2008-08-08 04:20:12 UTC (rev 834)
@@ -790,19 +790,3 @@
.i18n-icon {
background-image: url(img/language.gif) !important;
}
-
-.chat-icon {
- background-image: url(img/chat.gif) !important;
-}
-
-.group-icon {
- background-image: url(img/group.gif) !important;
-}
-
-.user-icon {
- background-image: url(img/user.gif) !important;
-}
-
-.userf-icon {
- background-image: url(img/userf.gif) !important;
-}
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-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -35,7 +35,6 @@
public class ChatClientNewModule extends AbstractModule {
public ChatClientNewModule() {
- super(ChatClientNewModule.class);
}
@Override
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-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -65,7 +65,7 @@
initData.getChatRoomHost());
chat = new ChatEngineXmpp(emiteUIDialog, chatOptions, i18n, ws);
groupMembersSummaryProvider.get().addUserOperation(
- new MenuItem<GroupDTO>("images/chat-basic.gif", i18n.t("Start a chat with this member"),
+ new MenuItem<GroupDTO>("images/new-chat.gif", i18n.t("Start a chat with this member"),
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO group) {
emiteUIDialog.show();
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-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -82,7 +82,8 @@
if (traybarButton == null) {
traybarButton = new ToolbarButton();
traybarButton.setTooltip(i18n.t("Show/hide the chat window"));
- traybarButton.setIcon("images/emite-chat.gif");
+ // traybarButton.setIcon("images/emite-chat.gif");
+ traybarButton.setIcon("images/e-icon.gif");
traybarButton.addListener(new ButtonListenerAdapter() {
@Override
public void onClick(final Button button, final EventObject e) {
@@ -92,9 +93,18 @@
emiteDialog.show();
}
}
-
});
ws.getSiteTraybar().addButton(traybarButton);
+ emiteDialog.onChatAttended(new Slot<String>() {
+ public void onEvent(final String parameter) {
+ traybarButton.setIcon("images/e-icon.gif");
+ }
+ });
+ emiteDialog.onChatUnattendedWithActivity(new Slot<String>() {
+ public void onEvent(final String parameter) {
+ traybarButton.setIcon("images/e-icon-a.gif");
+ }
+ });
}
emiteDialog.setEnableStatusUI(true);
emiteDialog.hide();
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-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -45,7 +45,6 @@
public class DocumentClientNewModule extends AbstractModule {
public DocumentClientNewModule() {
- super(DocumentClientNewModule.class);
}
@Override
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -24,7 +24,6 @@
import java.util.HashMap;
import org.ourproject.kune.platf.client.dispatch.ActionEvent;
-import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.tool.ClientTool;
import com.calclab.suco.client.signal.Slot0;
@@ -33,7 +32,7 @@
ClientTool getTool(String toolName);
- void init(StateManager stateManager, HashMap<String, ClientTool> tools);
+ void init(HashMap<String, ClientTool> tools);
void onApplicationStart(Slot0 slot);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -32,7 +32,6 @@
import org.ourproject.kune.platf.client.rpc.SiteServiceAsync;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.tool.ClientTool;
import org.ourproject.kune.platf.client.ui.WindowUtils;
import org.ourproject.kune.platf.client.utils.PrefetchUtilities;
@@ -54,7 +53,6 @@
private final Session session;
private final Signal0 onApplicationStart;
private final Signal0 onApplicationStop;
- private StateManager stateManager;
public ApplicationDefault(final Session session, final KuneErrorHandler errorHandler, final WorkspaceSkeleton ws) {
this.session = session;
@@ -76,8 +74,7 @@
return tools.get(toolName);
}
- public void init(final StateManager stateManager, final HashMap<String, ClientTool> tools) {
- this.stateManager = stateManager;
+ public void init(final HashMap<String, ClientTool> tools) {
this.tools = tools;
}
@@ -127,7 +124,6 @@
checkChatDomain(initData.getChatDomain());
session.setInitData(initData);
session.setCurrentUserInfo(initData.getUserInfo());
- stateManager.reload();
RootPanel.get("kuneinitialcurtain").setVisible(false);
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupDTO.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupDTO.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -20,20 +20,16 @@
package org.ourproject.kune.platf.client.dto;
+
import com.google.gwt.user.client.rpc.IsSerializable;
public class GroupDTO implements IsSerializable {
- public static final String ORGANIZATION = "ORGANIZATION";
- public static final String COMMUNITY = "COMMUNITY";
- public static final String PROJECT = "PROJECT";
- public static final String ORPHANED_PROJECT = "ORPHANED_PROJECT";
- public static final String PERSONAL = "PERSONAL";
private Long id;
private String shortName;
private String longName;
private String publicDesc;
- private String type;
+ private GroupType type;
private String defaultToolName;
private Long defaultFolderId;
private Long defaultContentId;
@@ -42,10 +38,10 @@
private String tags;
public GroupDTO() {
- this(null, null, null, ORGANIZATION);
+ this(null, null, null, GroupType.ORGANIZATION);
}
- public GroupDTO(final String shortName, final String longName, final String publicDesc, final String type) {
+ public GroupDTO(final String shortName, final String longName, final String publicDesc, final GroupType type) {
this.shortName = shortName;
this.longName = longName;
this.publicDesc = publicDesc;
@@ -158,7 +154,7 @@
return tags;
}
- public String getType() {
+ public GroupType getType() {
return type;
}
@@ -217,7 +213,7 @@
this.tags = tags;
}
- public void setType(final String type) {
+ public void setType(final GroupType type) {
this.type = type;
}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupType.java (from rev 827, trunk/src/main/java/org/ourproject/kune/platf/server/domain/GroupType.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/GroupType.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupType.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -0,0 +1,26 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * 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.dto;
+
+import com.google.gwt.user.client.rpc.IsSerializable;
+
+public enum GroupType implements IsSerializable {
+ ORGANIZATION, COMMUNITY, PROJECT, ORPHANED_PROJECT, PERSONAL
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/SocialNetworkDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/SocialNetworkDTO.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/SocialNetworkDTO.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -23,10 +23,6 @@
public class SocialNetworkDTO implements IsSerializable {
- public static final String REQ_JOIN_WAITING_MODERATION = "MODERATED";
- public static final String REQ_JOIN_ACEPTED = "ACEPTED";
- public static final String REQ_JOIN_DENIED = "DENIED";
-
AccessListsDTO accessLists;
GroupListDTO pendingCollaborators;
@@ -40,14 +36,14 @@
return accessLists;
}
- public void setAccessLists(final AccessListsDTO accessLists) {
- this.accessLists = accessLists;
- }
-
public GroupListDTO getPendingCollaborators() {
return pendingCollaborators;
}
+ public void setAccessLists(final AccessListsDTO accessLists) {
+ this.accessLists = accessLists;
+ }
+
public void setPendingCollaborators(final GroupListDTO pendingCollaborators) {
this.pendingCollaborators = pendingCollaborators;
}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/dto/SocialNetworkRequestResult.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/SocialNetworkRequestResult.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/SocialNetworkRequestResult.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.platf.client.dto;
+
+import com.google.gwt.user.client.rpc.IsSerializable;
+
+public enum SocialNetworkRequestResult implements IsSerializable {
+ accepted, denied, moderated
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/SocialNetworkService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/rpc/SocialNetworkService.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/SocialNetworkService.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -21,6 +21,7 @@
import org.ourproject.kune.platf.client.dto.ParticipationDataDTO;
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.errors.DefaultException;
@@ -50,7 +51,7 @@
ParticipationDataDTO getParticipation(String hash, String groupShortName) throws DefaultException;
- String requestJoinGroup(String hash, String groupShortName) throws DefaultException;
+ SocialNetworkRequestResult requestJoinGroup(String hash, String groupShortName) throws DefaultException;
SocialNetworkResultDTO setAdminAsCollab(String hash, String groupShortName, String groupToSetCollabShortName)
throws DefaultException;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/Kune.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/Kune.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/Kune.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -24,12 +24,13 @@
import com.calclab.suco.client.container.Container;
import com.calclab.suco.client.container.DelegatedContainer;
import com.calclab.suco.client.modules.Module;
+import com.calclab.suco.client.modules.ModuleManager.ProviderRegisterStrategy;
public class Kune extends DelegatedContainer {
public static Kune create(final Module... modules) {
final Container container = Suco.create(modules);
- Suco.add(container, new KuneModule());
+ Suco.install(container, ProviderRegisterStrategy.registerOnlyIfNotRegistered, new KuneModule());
return container.getInstance(Kune.class);
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -37,6 +37,7 @@
import com.calclab.suco.client.signal.Signal0;
import com.calclab.suco.client.signal.Slot0;
import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException;
public class KuneErrorHandler {
private final Session session;
@@ -83,6 +84,8 @@
logException(e);
Site.error(i18n.t("Group not found"));
stateManagerProvider.get().gotoToken("");
+ } catch (final IncompatibleRemoteServiceException e) {
+ Site.error(i18n.t("Your browser is outdated from the server software. Please reload this page."));
} catch (final ContentNotFoundException e) {
logException(e);
Site.error(i18n.t("Content not found"));
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-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -133,6 +133,7 @@
import com.calclab.emiteuimodule.client.EmiteUIModule;
import com.calclab.suco.client.container.Container;
import com.calclab.suco.client.modules.AbstractModule;
+import com.calclab.suco.client.modules.ModuleManager.ProviderRegisterStrategy;
import com.calclab.suco.client.provider.Factory;
import com.calclab.suco.client.scopes.SingletonScope;
import com.calclab.suco.client.signal.Slot;
@@ -143,9 +144,6 @@
import com.google.gwt.user.client.rpc.ServiceDefTarget;
public class KuneModule extends AbstractModule {
- public KuneModule() {
- super(KuneModule.class);
- }
@Override
public void onLoad() {
@@ -594,7 +592,8 @@
}
});
- load(new EmiteUIModule(), new DocumentClientNewModule(), new ChatClientNewModule());
+ install(ProviderRegisterStrategy.registerOnlyIfNotRegistered, new EmiteUIModule(),
+ new DocumentClientNewModule(), new ChatClientNewModule());
$(SitePublicSpaceLink.class);
$(SiteMessage.class);
@@ -632,7 +631,7 @@
});
final KunePlatform platform = $(KunePlatform.class);
- $(Application.class).init($(StateManager.class), platform.getIndexedTools());
+ $(Application.class).init(platform.getIndexedTools());
$(Application.class).subscribeActions(platform.getActions());
$(Application.class).start();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -67,7 +67,7 @@
panel.add(widget);
if (panel.isRendered()) {
panel.syncSize();
- panel.doLayout();
+ panel.doLayout(false);
}
doLayoutIfNeeded();
}
@@ -127,4 +127,8 @@
add(panel, widget);
doLayoutIfNeeded();
}
+
+ public void syncSize() {
+ mainPanel.syncSize();
+ }
}
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-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -22,8 +22,10 @@
import com.gwtext.client.dd.DropTarget;
import com.gwtext.client.dd.DropTargetConfig;
import com.gwtext.client.util.Format;
+import com.gwtext.client.widgets.Component;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.Toolbar;
+import com.gwtext.client.widgets.event.BoxComponentListenerAdapter;
import com.gwtext.client.widgets.grid.CellMetadata;
import com.gwtext.client.widgets.grid.ColumnConfig;
import com.gwtext.client.widgets.grid.ColumnModel;
@@ -107,6 +109,12 @@
}
menuMap = new HashMap<String, GridMenu<T>>();
recordMap = new HashMap<T, Record>();
+ super.addListener(new BoxComponentListenerAdapter() {
+ @Override
+ public void onRender(final Component component) {
+ // Log.warn("Render grid -------------------");
+ }
+ });
createGrid(emptyText, gridDragConfiguration, gridDropConfiguration);
}
@@ -168,6 +176,7 @@
public void doLayout(final boolean shallow) {
// Grid rendered problems with shallow false
super.doLayout();
+ grid.doLayout();
}
public void doLayoutIfNeeded() {
@@ -195,9 +204,7 @@
}
public void removeAll() {
- if (grid != null) {
- store.removeAll();
- }
+ store.removeAll();
recordMap.clear();
menuMap.clear();
}
@@ -223,12 +230,10 @@
@Override
public void setWidth(final int width) {
- if (grid != null) {
- // grid.setWidth(width - 27);
- grid.setWidth(width - 27);
- // super.setWidth(width - 11);
- doLayoutIfNeeded();
- }
+ // grid.setWidth(width - 27);
+ grid.setWidth(width - 27);
+ // super.setWidth(width - 11);
+ doLayoutIfNeeded();
}
public void sort() {
@@ -455,4 +460,5 @@
final Record record = store.getRecordAt(rowIndex);
onDoubleClick.fire(record.getAsString(ID));
}
+
}
Added: trunk/src/main/java/org/ourproject/kune/platf/server/auth/ContentAuthorizated.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/auth/ContentAuthorizated.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/auth/ContentAuthorizated.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -0,0 +1,44 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * 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.server.auth;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+import org.ourproject.kune.platf.server.access.AccessType;
+
+import com.google.inject.BindingAnnotation;
+
+/**
+ * Use in RPC methods, for instance: <code>
+ * Authorizated(authLevelRequired = AuthLevelRequired.COLLAB, checkContent = true) </code>
+ *
+ * The first parameter in the method must be the userHash, the second parameter
+ * must be a content token
+ *
+ */
+@BindingAnnotation
+(a)Retention(RetentionPolicy.RUNTIME)
+public @interface ContentAuthorizated {
+
+ AccessType accessTypeRequired() default AccessType.READ;
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/server/auth/ContentAuthorizatedMethodInterceptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/auth/ContentAuthorizatedMethodInterceptor.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/auth/ContentAuthorizatedMethodInterceptor.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -0,0 +1,85 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * 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.server.auth;
+
+import javax.persistence.NoResultException;
+
+import org.aopalliance.intercept.MethodInterceptor;
+import org.aopalliance.intercept.MethodInvocation;
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.errors.AccessViolationException;
+import org.ourproject.kune.platf.client.errors.ContentNotFoundException;
+import org.ourproject.kune.platf.server.UserSession;
+import org.ourproject.kune.platf.server.access.AccessService;
+import org.ourproject.kune.platf.server.access.AccessType;
+import org.ourproject.kune.platf.server.domain.Content;
+import org.ourproject.kune.platf.server.domain.Group;
+import org.ourproject.kune.platf.server.domain.User;
+import org.ourproject.kune.platf.server.manager.GroupManager;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class ContentAuthorizatedMethodInterceptor implements MethodInterceptor {
+
+ @Inject
+ Provider<UserSession> userSessionProvider;
+ @Inject
+ Provider<GroupManager> groupManagerProvider;
+ @Inject
+ Provider<AccessService> accessServiceProvider;
+
+ public Object invoke(final MethodInvocation invocation) throws Throwable {
+ final Object[] arguments = invocation.getArguments();
+ final String groupShortName = (String) arguments[1];
+
+ final UserSession userSession = userSessionProvider.get();
+ final GroupManager groupManager = groupManagerProvider.get();
+ final AccessService accessService = accessServiceProvider.get();
+
+ final ContentAuthorizated authoAnnotation = invocation.getStaticPart().getAnnotation(ContentAuthorizated.class);
+ final AccessType accessType = authoAnnotation.accessTypeRequired();
+
+ final User user = userSession.getUser();
+ Group group = Group.NO_GROUP;
+ try {
+ group = groupManager.findByShortName(groupShortName);
+ } catch (final NoResultException e) {
+ // continue, and check later
+ }
+ final StateToken contentToken = (StateToken) arguments[2];
+ final Long contentId = parseId(contentToken.getDocument());
+
+ final Content content = accessService.accessToContent(contentId, user, accessType);
+ if (!content.getContainer().getOwner().equals(group)) {
+ throw new AccessViolationException();
+ }
+ final Object result = invocation.proceed();
+ return result;
+ }
+
+ private Long parseId(final String documentId) throws ContentNotFoundException {
+ try {
+ return new Long(documentId);
+ } catch (final NumberFormatException e) {
+ throw new ContentNotFoundException();
+ }
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/domain/Group.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/Group.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/Group.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -42,6 +42,7 @@
import org.hibernate.search.annotations.Store;
import org.hibernate.validator.Length;
import org.hibernate.validator.Pattern;
+import org.ourproject.kune.platf.client.dto.GroupType;
import com.google.inject.name.Named;
import com.wideplay.warp.persist.dao.Finder;
Deleted: trunk/src/main/java/org/ourproject/kune/platf/server/domain/GroupType.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/GroupType.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/GroupType.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * 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.server.domain;
-
-public enum GroupType {
- ORGANIZATION, COMMUNITY, PROJECT, ORPHANED_PROJECT, PERSONAL
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/init/DatabaseInitializer.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/init/DatabaseInitializer.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/init/DatabaseInitializer.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -24,11 +24,11 @@
import javax.persistence.NoResultException;
+import org.ourproject.kune.platf.client.dto.GroupType;
import org.ourproject.kune.platf.client.errors.UserMustBeLoggedException;
import org.ourproject.kune.platf.server.content.ContentManager;
import org.ourproject.kune.platf.server.domain.Content;
import org.ourproject.kune.platf.server.domain.Group;
-import org.ourproject.kune.platf.server.domain.GroupType;
import org.ourproject.kune.platf.server.domain.I18nCountry;
import org.ourproject.kune.platf.server.domain.I18nLanguage;
import org.ourproject.kune.platf.server.domain.I18nTranslation;
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/SocialNetworkManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/SocialNetworkManager.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/SocialNetworkManager.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -20,6 +20,7 @@
package org.ourproject.kune.platf.server.manager;
+import org.ourproject.kune.platf.client.dto.SocialNetworkRequestResult;
import org.ourproject.kune.platf.client.errors.AccessViolationException;
import org.ourproject.kune.platf.client.errors.DefaultException;
import org.ourproject.kune.platf.server.ParticipationData;
@@ -47,7 +48,7 @@
ParticipationData findParticipation(User user, Group group) throws DefaultException;
- String requestToJoin(User user, Group inGroup) throws DefaultException;
+ SocialNetworkRequestResult requestToJoin(User user, Group inGroup) throws DefaultException;
void setAdminAsCollab(User userLogged, Group group, Group inGroup) throws DefaultException;
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/GroupManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/GroupManagerDefault.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/GroupManagerDefault.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -30,6 +30,7 @@
import org.apache.lucene.queryParser.MultiFieldQueryParser;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.search.Query;
+import org.ourproject.kune.platf.client.dto.GroupType;
import org.ourproject.kune.platf.client.errors.AccessViolationException;
import org.ourproject.kune.platf.client.errors.EmailAddressInUseException;
import org.ourproject.kune.platf.client.errors.GroupNameInUseException;
@@ -38,7 +39,6 @@
import org.ourproject.kune.platf.server.domain.AdmissionType;
import org.ourproject.kune.platf.server.domain.Group;
import org.ourproject.kune.platf.server.domain.GroupListMode;
-import org.ourproject.kune.platf.server.domain.GroupType;
import org.ourproject.kune.platf.server.domain.License;
import org.ourproject.kune.platf.server.domain.SocialNetwork;
import org.ourproject.kune.platf.server.domain.User;
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-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerDefault.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -26,7 +26,8 @@
import javax.persistence.EntityManager;
-import org.ourproject.kune.platf.client.dto.SocialNetworkDTO;
+import org.ourproject.kune.platf.client.dto.GroupType;
+import org.ourproject.kune.platf.client.dto.SocialNetworkRequestResult;
import org.ourproject.kune.platf.client.errors.AccessViolationException;
import org.ourproject.kune.platf.client.errors.AlreadyGroupMemberException;
import org.ourproject.kune.platf.client.errors.AlreadyUserMemberException;
@@ -38,7 +39,6 @@
import org.ourproject.kune.platf.server.domain.AdmissionType;
import org.ourproject.kune.platf.server.domain.Group;
import org.ourproject.kune.platf.server.domain.GroupListMode;
-import org.ourproject.kune.platf.server.domain.GroupType;
import org.ourproject.kune.platf.server.domain.SocialNetwork;
import org.ourproject.kune.platf.server.domain.User;
import org.ourproject.kune.platf.server.manager.SocialNetworkManager;
@@ -171,7 +171,7 @@
return new ParticipationData(groupsIsAdmin, groupsIsCollab);
}
- public String requestToJoin(final User user, final Group inGroup) throws DefaultException,
+ public SocialNetworkRequestResult requestToJoin(final User user, final Group inGroup) throws DefaultException,
UserMustBeLoggedException {
final SocialNetwork sn = inGroup.getSocialNetwork();
if (!User.isKnownUser(user)) {
@@ -185,7 +185,7 @@
checkGroupIsNotAlreadyAMember(userGroup, sn);
if (isModerated(admissionType)) {
sn.addPendingCollaborator(userGroup);
- return SocialNetworkDTO.REQ_JOIN_WAITING_MODERATION;
+ return SocialNetworkRequestResult.moderated;
} else if (isOpen(admissionType)) {
if (inGroup.getType().equals(GroupType.ORPHANED_PROJECT)) {
sn.addAdmin(userGroup);
@@ -195,9 +195,9 @@
} else {
sn.addCollaborator(userGroup);
}
- return SocialNetworkDTO.REQ_JOIN_ACEPTED;
+ return SocialNetworkRequestResult.accepted;
} else if (isClosed(admissionType)) {
- return SocialNetworkDTO.REQ_JOIN_DENIED;
+ return SocialNetworkRequestResult.denied;
} else {
throw new DefaultException("State not expected in SocialNetworkManagerDefault class");
}
@@ -233,7 +233,12 @@
if (sn.isAdmin(groupToUnJoin)) {
if (sn.getAccessLists().getAdmins().getList().size() == 1) {
- throw new LastAdminInGroupException();
+ if (sn.getAccessLists().getEditors().getList().size() > 0) {
+ throw new LastAdminInGroupException();
+ } else {
+ inGroup.setType(GroupType.ORPHANED_PROJECT);
+ inGroup.setAdmissionType(AdmissionType.Open);
+ }
}
sn.removeAdmin(groupToUnJoin);
} else if (sn.isCollab(groupToUnJoin)) {
Deleted: trunk/src/main/java/org/ourproject/kune/platf/server/mapper/GroupTypeConverter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/mapper/GroupTypeConverter.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/mapper/GroupTypeConverter.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -1,66 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * 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.server.mapper;
-
-import java.text.MessageFormat;
-import java.util.HashMap;
-
-import net.sf.dozer.util.mapping.MappingException;
-import net.sf.dozer.util.mapping.converters.CustomConverter;
-
-import org.ourproject.kune.platf.server.domain.GroupType;
-
-public class GroupTypeConverter implements CustomConverter {
- private final HashMap<String, GroupType> stringToEnum;
- private final HashMap<GroupType, String> enumToString;
-
- public GroupTypeConverter() {
- this.stringToEnum = new HashMap<String, GroupType>();
- this.enumToString = new HashMap<GroupType, String>();
- add(GroupType.PERSONAL);
- add(GroupType.PROJECT);
- add(GroupType.COMMUNITY);
- add(GroupType.ORGANIZATION);
- add(GroupType.ORPHANED_PROJECT);
- }
-
- @SuppressWarnings("unchecked")
- public Object convert(final Object destination, final Object source, final Class destinationClass,
- final Class sourceClass) {
- if (source == null) {
- return null;
- } else if (sourceClass.equals(String.class) && destinationClass.equals(GroupType.class)) {
- return stringToEnum.get(source);
- } else if (sourceClass.equals(GroupType.class) && destinationClass.equals(String.class)) {
- return enumToString.get(source);
- } else {
- final String msg = MessageFormat.format("couldn't map {0} ({1}) to {2} ({3})", source, sourceClass,
- destination, destinationClass);
- throw new MappingException(msg);
- }
-
- }
-
- private void add(final GroupType mode) {
- enumToString.put(mode, mode.toString());
- stringToEnum.put(mode.toString(), mode);
- }
-
-}
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-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SocialNetworkRPC.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -21,6 +21,7 @@
import org.ourproject.kune.platf.client.dto.ParticipationDataDTO;
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.errors.DefaultException;
import org.ourproject.kune.platf.client.rpc.SocialNetworkService;
@@ -160,7 +161,8 @@
@Authenticated
@Transactional(type = TransactionType.READ_WRITE)
- public String requestJoinGroup(final String hash, final String groupShortName) throws DefaultException {
+ public SocialNetworkRequestResult requestJoinGroup(final String hash, final String groupShortName)
+ throws DefaultException {
final UserSession userSession = getUserSession();
final User user = userSession.getUser();
final Group group = groupManager.findByShortName(groupShortName);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -21,6 +21,7 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.dto.GroupType;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.errors.GroupNameInUseException;
@@ -151,15 +152,15 @@
view.setMessage(message, type);
}
- private String getTypeOfGroup() {
+ private GroupType getTypeOfGroup() {
if (view.isProject()) {
- return GroupDTO.PROJECT;
+ return GroupType.PROJECT;
} else if (view.isOrphanedProject()) {
- return GroupDTO.ORPHANED_PROJECT;
+ return GroupType.ORPHANED_PROJECT;
} else if (view.isOrganization()) {
- return GroupDTO.ORGANIZATION;
+ return GroupType.ORGANIZATION;
} else {
- return GroupDTO.COMMUNITY;
+ return GroupType.COMMUNITY;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherPanel.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherPanel.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -49,12 +49,12 @@
private static final int PAGINATION_SIZE = 10;
private final EntityLiveSearcherPresenter presenter;
private BasicDialog dialog;
- private final int searchType;
+ private final EntityLiveSearcherType searchType;
private FormPanel searchForm;
private final I18nTranslationService i18n;
- public EntityLiveSearcherPanel(final EntityLiveSearcherPresenter presenter, final int searchType,
- final I18nTranslationService i18n) {
+ public EntityLiveSearcherPanel(final EntityLiveSearcherPresenter presenter,
+ final EntityLiveSearcherType searchType, final I18nTranslationService i18n) {
this.presenter = presenter;
this.searchType = searchType;
this.i18n = i18n;
@@ -77,9 +77,9 @@
dialog.center();
}
- private void createGroupSearchDialog(final int searchType) {
+ private void createGroupSearchDialog(final EntityLiveSearcherType searchType) {
String title;
- if (searchType == EntityLiveSearcherView.SEARCH_GROUPS) {
+ if (searchType.equals(EntityLiveSearcherType.groups)) {
title = i18n.t("Search existing users and groups");
} else {
title = i18n.t("Search existing users");
@@ -90,10 +90,10 @@
DataProxy dataProxy = null;
switch (searchType) {
- case EntityLiveSearcherView.SEARCH_GROUPS:
+ case groups:
dataProxy = new HttpProxy("/kune/json/GroupJSONService/search", Connection.POST);
break;
- case EntityLiveSearcherView.SEARCH_USERS:
+ case users:
dataProxy = new HttpProxy("/kune/json/UserJSONService/search", Connection.POST);
break;
default:
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherType.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherType.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherType.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.search;
+
+public enum EntityLiveSearcherType {
+ groups, users
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherView.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherView.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -23,13 +23,10 @@
public interface EntityLiveSearcherView extends View {
- final public static int SEARCH_GROUPS = 1;
- final public static int SEARCH_USERS = 2;
+ void center();
- void show();
-
void hide();
- void center();
+ void show();
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearchPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearchPanel.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearchPanel.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -24,7 +24,7 @@
public class GroupLiveSearchPanel extends EntityLiveSearcherPanel {
public GroupLiveSearchPanel(final EntityLiveSearcherPresenter presenter, final I18nTranslationService i18n) {
- super(presenter, EntityLiveSearcherView.SEARCH_GROUPS, i18n);
+ super(presenter, EntityLiveSearcherType.groups, i18n);
}
}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcherPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcherPanel.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcherPanel.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -24,7 +24,7 @@
public class UserLiveSearcherPanel extends EntityLiveSearcherPanel {
public UserLiveSearcherPanel(final EntityLiveSearcherPresenter presenter, final I18nTranslationService i18n) {
- super(presenter, EntityLiveSearcherView.SEARCH_USERS, i18n);
+ super(presenter, EntityLiveSearcherType.users, i18n);
}
}
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-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -5,6 +5,7 @@
import org.ourproject.kune.platf.client.dto.AccessListsDTO;
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.dto.GroupType;
import org.ourproject.kune.platf.client.dto.LinkDTO;
import org.ourproject.kune.platf.client.dto.SocialNetworkDTO;
import org.ourproject.kune.platf.client.dto.SocialNetworkResultDTO;
@@ -173,7 +174,7 @@
}
private void setState(final StateDTO state) {
- if (state.getGroup().getType().equals(GroupDTO.PERSONAL)) {
+ if (state.getGroup().getType().equals(GroupType.PERSONAL)) {
view.setVisible(false);
} else {
setGroupMembers(state.getGroupMembers(), state.getGroupRights());
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-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -2,7 +2,8 @@
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
import org.ourproject.kune.platf.client.dto.GroupDTO;
-import org.ourproject.kune.platf.client.dto.SocialNetworkDTO;
+import org.ourproject.kune.platf.client.dto.GroupType;
+import org.ourproject.kune.platf.client.dto.SocialNetworkRequestResult;
import org.ourproject.kune.platf.client.dto.SocialNetworkResultDTO;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
@@ -106,16 +107,18 @@
session.getCurrentState().getGroup().getShortName(), new AsyncCallbackSimple<Object>() {
public void onSuccess(final Object result) {
Site.hideProgress();
- final String resultType = (String) result;
- if (resultType == SocialNetworkDTO.REQ_JOIN_ACEPTED) {
+ final SocialNetworkRequestResult resultType = (SocialNetworkRequestResult) result;
+ switch (resultType) {
+ case accepted:
Site.info(i18n.t("You are now member of this group"));
stateManager.reload();
- }
- if (resultType == SocialNetworkDTO.REQ_JOIN_DENIED) {
+ break;
+ case denied:
Site.important(i18n.t("Sorry this is a closed group"));
- }
- if (resultType == SocialNetworkDTO.REQ_JOIN_WAITING_MODERATION) {
+ break;
+ case moderated:
Site.info(i18n.t("Requested. Waiting for admins decision"));
+ break;
}
}
});
@@ -133,20 +136,20 @@
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]"
+ final String toolTip = i18n.t(group.getType().equals(GroupType.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, toolTip, menu);
- if (!group.getType().equals(GroupDTO.PERSONAL)) {
+ if (!group.getType().equals(GroupType.PERSONAL)) {
menu.addMenuItemList(otherOperations);
}
- if (session.isLogged() && !group.getType().equals(GroupDTO.PERSONAL)) {
+ if (session.isLogged() && !group.getType().equals(GroupType.PERSONAL)) {
menu.addMenuItemList(otherLoggedOperations);
}
- if (group.getType().equals(GroupDTO.PERSONAL)) {
+ if (group.getType().equals(GroupType.PERSONAL)) {
menu.addMenuItemList(otherOperationsUsers);
}
- if (session.isLogged() && group.getType().equals(GroupDTO.PERSONAL)) {
+ if (session.isLogged() && group.getType().equals(GroupType.PERSONAL)) {
menu.addMenuItemList(otherLoggedOperationsUsers);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogoPanel.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogoPanel.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -88,7 +88,7 @@
public EntityLogoPanel(final I18nTranslationService i18n, final WorkspaceSkeleton ws) {
this.i18n = i18n;
- ws.getEntityMainHeader().add(this);
+ ws.addToEntityMainHeader(this);
}
public void setLogo(final Image image) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Entity.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Entity.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Entity.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -3,7 +3,9 @@
import org.ourproject.kune.platf.client.ui.DefaultBorderLayout;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+import com.google.gwt.user.client.ui.Widget;
import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.layout.FitLayout;
public class Entity extends DefaultBorderLayout {
@@ -14,6 +16,7 @@
public Entity() {
entityMainHeader = new Panel();
entityMainHeader.setBorder(false);
+ entityMainHeader.setLayout(new FitLayout());
entitySummary = new EntitySummary();
entityWorkspace = new EntityWorkspace();
add(entityMainHeader, DefaultBorderLayout.Position.NORTH, 65);
@@ -21,8 +24,9 @@
add(entitySummary.getPanel(), DefaultBorderLayout.Position.EAST, true, 150);
}
- public Panel getEntityMainHeader() {
- return entityMainHeader;
+ public void addToEntityMainHeader(final Widget widget) {
+ entityMainHeader.add(widget);
+ doLayoutIfNeeded();
}
public EntitySummary getEntitySummary() {
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-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -6,6 +6,7 @@
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.Toolbar;
import com.gwtext.client.widgets.event.ContainerListener;
+import com.gwtext.client.widgets.layout.FitLayout;
public class EntitySummary {
private final Panel entityTools;
@@ -16,13 +17,14 @@
public EntitySummary() {
mainPanel = new DefaultBorderLayout();
entityTools = new Panel();
+ entityTools.setLayout(new FitLayout());
entityTools.setAutoHeight(true);
entitySummary = new Panel();
- entitySummary.setCls("k-entity-summary");
entityTools.setBorder(false);
entitySummary.setBorder(false);
entityTools.setAutoScroll(false);
entitySummary.setAutoScroll(true);
+ entitySummary.setCls("k-entity-summary");
trayBar = mainPanel.createBottomBar(entitySummary, "k-site-traybar");
mainPanel.add(entityTools, DefaultBorderLayout.Position.NORTH);
mainPanel.add(entitySummary, DefaultBorderLayout.Position.CENTER);
@@ -31,15 +33,16 @@
public void addInSummary(final Widget widget) {
entitySummary.add(widget);
+ entitySummary.syncSize();
mainPanel.doLayoutIfNeeded();
}
public void addInTools(final Widget widget) {
entityTools.add(widget);
+ mainPanel.syncSize();
if (entityTools.isRendered()) {
entityTools.doLayout(false);
}
- mainPanel.doLayoutIfNeeded();
}
public void addListener(final ContainerListener listener) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -5,6 +5,7 @@
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
+import com.google.gwt.user.client.ui.Widget;
import com.gwtext.client.core.ExtElement;
import com.gwtext.client.widgets.MessageBox;
import com.gwtext.client.widgets.Panel;
@@ -35,8 +36,8 @@
new Viewport(container);
}
- public Panel getEntityMainHeader() {
- return entity.getEntityMainHeader();
+ public void addToEntityMainHeader(final Widget widget) {
+ entity.addToEntityMainHeader(widget);
}
public EntitySummary getEntitySummary() {
Modified: trunk/src/main/resources/dozerBeanMapping.xml
===================================================================
--- trunk/src/main/resources/dozerBeanMapping.xml 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/main/resources/dozerBeanMapping.xml 2008-08-08 04:20:12 UTC (rev 834)
@@ -41,12 +41,7 @@
<mapping>
<class-a>org.ourproject.kune.platf.client.dto.GroupDTO</class-a>
- <class-b>org.ourproject.kune.platf.server.domain.Group</class-b>
- <field
- custom-converter="org.ourproject.kune.platf.server.mapper.GroupTypeConverter">
- <a>type</a>
- <b>type</b>
- </field>
+ <class-b>org.ourproject.kune.platf.server.domain.Group</class-b>
</mapping>
<mapping>
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTestHelper.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTestHelper.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTestHelper.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -25,7 +25,7 @@
bindScope(SessionScoped.class, Scopes.SINGLETON);
// test: use memory
// test_db: use mysql
- bindConstant().annotatedWith(JpaUnit.class).to("test");
+ bindConstant().annotatedWith(JpaUnit.class).to("test_db");
bindConstant().annotatedWith(PropertiesFileName.class).to("kune.properties");
bind(HttpServletRequest.class).to(HttpServletRequestMocked.class);
}
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/kuneservice/GroupServiceTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/kuneservice/GroupServiceTest.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/kuneservice/GroupServiceTest.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -5,6 +5,7 @@
import org.junit.Before;
import org.junit.Test;
import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.dto.GroupType;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.errors.UserMustBeLoggedException;
import org.ourproject.kune.platf.client.rpc.GroupService;
@@ -13,7 +14,6 @@
import org.ourproject.kune.platf.server.UserSession;
import org.ourproject.kune.platf.server.domain.AdmissionType;
import org.ourproject.kune.platf.server.domain.Group;
-import org.ourproject.kune.platf.server.domain.GroupType;
import com.google.inject.Inject;
@@ -33,7 +33,7 @@
doLogin();
final GroupDTO group = new GroupDTO("ysei", "Yellow Submarine Environmental Initiative", "Public Desc",
- GroupDTO.COMMUNITY);
+ GroupType.COMMUNITY);
final LicenseDTO license = new LicenseDTO();
license.setShortName("by-sa");
@@ -51,7 +51,7 @@
@Test(expected = Exception.class)
public void createGroupNotLogged() throws Exception {
final GroupDTO group = new GroupDTO("ysei", "Yellow Submarine Environmental Initiative", "Public Desc",
- GroupDTO.PROJECT);
+ GroupType.PROJECT);
service.createNewGroup(session.getHash(), group);
}
@@ -59,7 +59,7 @@
public void createGroupNullUserHash() throws Exception {
doLogin();
final GroupDTO group = new GroupDTO("ysei", "Yellow Submarine Environmental Initiative", "Public Desc",
- GroupDTO.PROJECT);
+ GroupType.PROJECT);
service.createNewGroup(null, group);
}
@@ -68,7 +68,7 @@
doLogin();
final GroupDTO group = new GroupDTO("ysei", "Yellow Submarine Environmental Initiative", "Public Desc",
- GroupDTO.PROJECT);
+ GroupType.PROJECT);
final LicenseDTO license = new LicenseDTO();
license.setShortName("by-sa");
@@ -88,7 +88,7 @@
doLogin();
final GroupDTO group = new GroupDTO("ysei", "Yellow Submarine Environmental Initiative", "Public Desc",
- GroupDTO.ORGANIZATION);
+ GroupType.ORGANIZATION);
final LicenseDTO license = new LicenseDTO();
license.setShortName("by-sa");
@@ -108,7 +108,7 @@
doLogin();
final GroupDTO group = new GroupDTO("ysei", "Yellow Submarine Environmental Initiative", "Public Desc",
- GroupDTO.ORPHANED_PROJECT);
+ GroupType.ORPHANED_PROJECT);
final LicenseDTO license = new LicenseDTO();
license.setShortName("by-sa");
Added: trunk/src/test/java/org/ourproject/kune/platf/server/auth/AuthorizatedMethodInterceptorTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/auth/AuthorizatedMethodInterceptorTest.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/auth/AuthorizatedMethodInterceptorTest.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -0,0 +1,31 @@
+package org.ourproject.kune.platf.server.auth;
+
+import java.lang.reflect.AccessibleObject;
+
+import org.aopalliance.intercept.MethodInvocation;
+import org.junit.Before;
+import org.mockito.Mockito;
+import org.ourproject.kune.platf.integration.IntegrationTest;
+import org.ourproject.kune.platf.integration.IntegrationTestHelper;
+
+public class AuthorizatedMethodInterceptorTest extends IntegrationTest {
+
+ private AuthorizatedMethodInterceptor auth;
+ private MethodInvocation invocation;
+ private Authorizated authAnnotation;
+
+ @Before
+ public void before() {
+ auth = new AuthorizatedMethodInterceptor();
+ new IntegrationTestHelper(auth, this);
+ invocation = Mockito.mock(MethodInvocation.class);
+ final AccessibleObject accessibleObject = Mockito.mock(AccessibleObject.class);
+ Mockito.stub(invocation.getMethod()).toReturn(this.getClass().getMethods()[0]);
+ Mockito.stub(invocation.getStaticPart()).toReturn(accessibleObject);
+ authAnnotation = Mockito.mock(Authorizated.class);
+ Mockito.stub(accessibleObject.getAnnotation(Authorizated.class)).toReturn(authAnnotation);
+ // AccessType accessType = authoAnnotation.accessTypeRequired();
+ // boolean checkContent = authoAnnotation.checkContent();
+ }
+
+}
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/manager/GroupManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/manager/GroupManagerTest.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/manager/GroupManagerTest.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -9,13 +9,13 @@
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import org.ourproject.kune.platf.client.dto.GroupType;
import org.ourproject.kune.platf.client.errors.EmailAddressInUseException;
import org.ourproject.kune.platf.client.errors.GroupNameInUseException;
import org.ourproject.kune.platf.client.errors.I18nNotFoundException;
import org.ourproject.kune.platf.server.PersistenceTest;
import org.ourproject.kune.platf.server.domain.AccessLists;
import org.ourproject.kune.platf.server.domain.Group;
-import org.ourproject.kune.platf.server.domain.GroupType;
import org.ourproject.kune.platf.server.domain.I18nCountry;
import org.ourproject.kune.platf.server.domain.I18nLanguage;
import org.ourproject.kune.platf.server.domain.License;
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/manager/SocialNetworkManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/manager/SocialNetworkManagerTest.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/manager/SocialNetworkManagerTest.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -7,7 +7,8 @@
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.ourproject.kune.platf.client.dto.SocialNetworkDTO;
+import org.ourproject.kune.platf.client.dto.GroupType;
+import org.ourproject.kune.platf.client.dto.SocialNetworkRequestResult;
import org.ourproject.kune.platf.client.errors.AccessViolationException;
import org.ourproject.kune.platf.client.errors.AlreadyGroupMemberException;
import org.ourproject.kune.platf.client.errors.LastAdminInGroupException;
@@ -180,11 +181,22 @@
}
@Test(expected = LastAdminInGroupException.class)
- public void lastAdminUnjoinGroupFails() throws Exception {
+ public void lastAdminUnjoinGroupWithCollabsFails() throws Exception {
socialNetworkManager.addAdmin(admin, group);
+ socialNetworkManager.requestToJoin(user, group);
+ socialNetworkManager.acceptJoinGroup(admin, userGroup, group);
socialNetworkManager.unJoinGroup(admin.getUserGroup(), group);
}
+ @Test
+ public void lastAdminUnjoinGroupWithoutCollabsOrphaned() throws Exception {
+ socialNetworkManager.addAdmin(admin, group);
+ socialNetworkManager.unJoinGroup(admin.getUserGroup(), group);
+ assertEquals(GroupType.ORPHANED_PROJECT, group.getType());
+ assertEquals(0, group.getSocialNetwork().getAccessLists().getAdmins().getList().size());
+ assertEquals(0, group.getSocialNetwork().getAccessLists().getEditors().getList().size());
+ }
+
@Test(expected = AccessViolationException.class)
public void notAdminTryDeleteMember() throws Exception {
socialNetworkManager.requestToJoin(user, group);
@@ -197,8 +209,8 @@
public void requestJoinAClosedGroupDeny() throws Exception {
group.setAdmissionType(AdmissionType.Closed);
- final String result = socialNetworkManager.requestToJoin(user, group);
- assertEquals(result, SocialNetworkDTO.REQ_JOIN_DENIED);
+ final SocialNetworkRequestResult result = socialNetworkManager.requestToJoin(user, group);
+ assertEquals(result, SocialNetworkRequestResult.denied);
closeTransaction();
}
@@ -206,8 +218,8 @@
public void requestJoinAModeratedGroupAddUserGroupToPending() throws Exception {
group.setAdmissionType(AdmissionType.Moderated);
- final String result = socialNetworkManager.requestToJoin(user, group);
- assertEquals(result, SocialNetworkDTO.REQ_JOIN_WAITING_MODERATION);
+ final SocialNetworkRequestResult result = socialNetworkManager.requestToJoin(user, group);
+ assertEquals(result, SocialNetworkRequestResult.moderated);
assertTrue(group.getSocialNetwork().getPendingCollaborators().getList().contains(userGroup));
closeTransaction();
}
@@ -216,8 +228,8 @@
public void requestJoinAOpenGroupAddUserGroupToEditors() throws Exception {
group.setAdmissionType(AdmissionType.Open);
- final String result = socialNetworkManager.requestToJoin(user, group);
- assertEquals(result, SocialNetworkDTO.REQ_JOIN_ACEPTED);
+ final SocialNetworkRequestResult result = socialNetworkManager.requestToJoin(user, group);
+ assertEquals(result, SocialNetworkRequestResult.accepted);
assertTrue(group.getSocialNetwork().getAccessLists().getEditors().getList().contains(userGroup));
assertEquals(group.getSocialNetwork().getAccessLists().getEditors().getMode(), GroupListMode.NORMAL);
closeTransaction();
@@ -227,8 +239,8 @@
public void requestJoinAOrphanedGroupAddUserGroupToAdmins() throws Exception {
orphanedGroup.setAdmissionType(AdmissionType.Open);
- final String result = socialNetworkManager.requestToJoin(user, orphanedGroup);
- assertEquals(result, SocialNetworkDTO.REQ_JOIN_ACEPTED);
+ final SocialNetworkRequestResult result = socialNetworkManager.requestToJoin(user, orphanedGroup);
+ assertEquals(result, SocialNetworkRequestResult.accepted);
assertTrue(orphanedGroup.getSocialNetwork().getAccessLists().getAdmins().getList().contains(userGroup));
assertEquals(orphanedGroup.getSocialNetwork().getAccessLists().getAdmins().getMode(), GroupListMode.NORMAL);
@@ -240,8 +252,8 @@
public void requestJoinTwiceAOrphanedGroupAddUserGroupToAdmins() throws Exception {
orphanedGroup.setAdmissionType(AdmissionType.Open);
- final String result = socialNetworkManager.requestToJoin(user, orphanedGroup);
- assertEquals(SocialNetworkDTO.REQ_JOIN_ACEPTED, result);
+ final SocialNetworkRequestResult result = socialNetworkManager.requestToJoin(user, orphanedGroup);
+ assertEquals(SocialNetworkRequestResult.accepted, result);
socialNetworkManager.requestToJoin(user, orphanedGroup);
}
Modified: trunk/src/test/java/org/ourproject/kune/testhelper/ctx/DomainContext.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/testhelper/ctx/DomainContext.java 2008-08-07 12:07:05 UTC (rev 833)
+++ trunk/src/test/java/org/ourproject/kune/testhelper/ctx/DomainContext.java 2008-08-08 04:20:12 UTC (rev 834)
@@ -3,9 +3,9 @@
import java.util.HashMap;
import java.util.TimeZone;
+import org.ourproject.kune.platf.client.dto.GroupType;
import org.ourproject.kune.platf.server.domain.AccessLists;
import org.ourproject.kune.platf.server.domain.Group;
-import org.ourproject.kune.platf.server.domain.GroupType;
import org.ourproject.kune.platf.server.domain.I18nCountry;
import org.ourproject.kune.platf.server.domain.I18nLanguage;
import org.ourproject.kune.platf.server.domain.SocialNetwork;
1
0