[kune-commits] r1267 - in trunk: . src/main/java/cc/kune/chat/client src/main/java/cc/kune/chat/public src/main/java/cc/kune/client src/main/java/cc/kune/core/client src/main/java/cc/kune/core/client/auth src/main/java/cc/kune/core/client/groups/newgroup src/main/java/cc/kune/core/client/rpcservices src/main/java/cc/kune/core/client/sitebar/spaces src/main/java/cc/kune/core/client/sn src/main/java/cc/kune/core/client/sn/actions src/main/java/cc/kune/core/client/sn/actions/conditions src/main/java/cc/kune/core/client/sn/actions/registry src/main/java/cc/kune/core/client/state src/main/java/cc/kune/core/client/ws/entheader src/main/java/cc/kune/core/shared/dto src/main/java/cc/kune/wave/client src/main/java/org/ourproject/kune/platf/server/auth src/main/java/org/ourproject/kune/platf/server/rpc src/main/java/org/ourproject/kune/workspace/client src/test/java/org/ourproject/kune/platf/integration src/test/java/org/ourproject/kune/platf/integration/site src/test/java/org/ourproject/kune/platf/server src/test/java/org/ourproject/kune/platf/server/manager/impl
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Wed Mar 2 02:14:28 CET 2011
Author: vjrj_
Date: 2011-03-02 02:14:27 +0100 (Wed, 02 Mar 2011)
New Revision: 1267
Added:
trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.java
trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.ui.xml
trunk/src/main/java/cc/kune/core/client/sn/BuddiesAndParticipationPanel.java
trunk/src/main/java/cc/kune/core/client/sn/BuddiesAndParticipationPresenter.java
trunk/src/main/java/cc/kune/core/client/sn/actions/GotoYourHomePageAction.java
trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsLoggedCondition.java
trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsMeCondition.java
Removed:
trunk/src/main/java/cc/kune/core/client/sn/GroupMembersPanel.ui.xml
Modified:
trunk/.project
trunk/src/main/java/cc/kune/chat/client/AddAsBuddieHeaderButton.java
trunk/src/main/java/cc/kune/chat/client/ChatParts.java
trunk/src/main/java/cc/kune/chat/client/ChatSitebarActions.java
trunk/src/main/java/cc/kune/chat/public/kune-chat.css
trunk/src/main/java/cc/kune/client/KuneGinjector.java
trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
trunk/src/main/java/cc/kune/core/client/CoreParts.java
trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java
trunk/src/main/java/cc/kune/core/client/auth/SignIn.java
trunk/src/main/java/cc/kune/core/client/auth/SignInPresenter.java
trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java
trunk/src/main/java/cc/kune/core/client/rpcservices/UserService.java
trunk/src/main/java/cc/kune/core/client/rpcservices/UserServiceAsync.java
trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java
trunk/src/main/java/cc/kune/core/client/sn/GroupMembersPanel.java
trunk/src/main/java/cc/kune/core/client/sn/GroupMembersPresenter.java
trunk/src/main/java/cc/kune/core/client/sn/actions/GroupMembersConfActions.java
trunk/src/main/java/cc/kune/core/client/sn/actions/RolAction.java
trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsNotMeCondition.java
trunk/src/main/java/cc/kune/core/client/sn/actions/registry/SNAdminsMenuItemsRegistry.java
trunk/src/main/java/cc/kune/core/client/sn/actions/registry/SNCollabsMenuItemsRegistry.java
trunk/src/main/java/cc/kune/core/client/state/AccessRightsClientManager.java
trunk/src/main/java/cc/kune/core/client/state/SiteTokenListeners.java
trunk/src/main/java/cc/kune/core/client/state/StateManager.java
trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java
trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPresenter.java
trunk/src/main/java/cc/kune/core/shared/dto/GroupDTO.java
trunk/src/main/java/cc/kune/wave/client/WaveClientSimpleAuthenticator.java
trunk/src/main/java/org/ourproject/kune/platf/server/auth/AuthenticatedMethodInterceptor.java
trunk/src/main/java/org/ourproject/kune/platf/server/auth/SessionServiceDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/rpc/UserRPC.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTest.java
trunk/src/test/java/org/ourproject/kune/platf/integration/site/UserServiceTest.java
trunk/src/test/java/org/ourproject/kune/platf/server/PersistenceTest.java
trunk/src/test/java/org/ourproject/kune/platf/server/manager/impl/AbstractSocialNetworkManagerTest.java
trunk/src/test/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerMoreTest.java
trunk/src/test/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerTest.java
Log:
Wiab auth, more SN refactor and some bug fixes
Modified: trunk/.project
===================================================================
--- trunk/.project 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/.project 2011-03-02 01:14:27 UTC (rev 1267)
@@ -1,74 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>kune</name>
- <comment>kune free/open/libre collaboration platform. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
- <projects/>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
- <triggers>full,incremental,</triggers>
- <arguments>
- <dictionary>
- <key>LaunchConfigHandle</key>
- <value><project>/.externalToolBuilders/org.eclipse.wst.common.project.facet.core.builder (2).launch</value>
- </dictionary>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
- <triggers>full,incremental,</triggers>
- <arguments>
- <dictionary>
- <key>LaunchConfigHandle</key>
- <value><project>/.externalToolBuilders/org.eclipse.wst.validation.validationbuilder (3).launch</value>
- </dictionary>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
- <triggers>full,incremental,</triggers>
- <arguments>
- <dictionary>
- <key>LaunchConfigHandle</key>
- <value><project>/.externalToolBuilders/com.google.gwt.eclipse.core.gwtProjectValidator (2).launch</value>
- </dictionary>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
- </buildCommand>
- <buildCommand>
- <name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.common.project.facet.core.builder</name>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
- <triggers>full,incremental,</triggers>
- <arguments>
- <dictionary>
- <key>LaunchConfigHandle</key>
- <value><project>/.externalToolBuilders/org.eclipse.wst.validation.validationbuilder (4).launch</value>
- </dictionary>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.validation.validationbuilder</name>
- </buildCommand>
- <buildCommand>
- <name>edu.umd.cs.findbugs.plugin.eclipse.findbugsBuilder</name>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
- <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
- <nature>org.eclipse.ajdt.ui.ajnature</nature>
- <nature>com.google.gwt.eclipse.core.gwtNature</nature>
- <nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature>
- </natures>
-</projectDescription>
\ No newline at end of file
+ <name>kune</name>
+ <comment>kune free/open/libre collaboration platform. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>edu.umd.cs.findbugs.plugin.eclipse.findbugsBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.ajdt.ui.ajnature</nature>
+ <nature>com.google.gwt.eclipse.core.gwtNature</nature>
+ <nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature>
+ </natures>
+</projectDescription>
Modified: trunk/src/main/java/cc/kune/chat/client/AddAsBuddieHeaderButton.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/AddAsBuddieHeaderButton.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/chat/client/AddAsBuddieHeaderButton.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -102,6 +102,7 @@
public AddAsBuddieHeaderButton(final AddAsBuddieAction buddieAction, final EntityHeader entityHeader) {
final ButtonDescriptor button = new ButtonDescriptor(buddieAction);
button.setVisible(false);
+ button.setStyles("k-chat-add-as-buddie");
buddieAction.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
Modified: trunk/src/main/java/cc/kune/chat/client/ChatParts.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatParts.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/chat/client/ChatParts.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -3,6 +3,7 @@
import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
import cc.kune.core.client.init.AppStartEvent;
import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
+import cc.kune.core.client.sn.actions.conditions.IsLoggedCondition;
import cc.kune.core.client.sn.actions.conditions.IsNotMeCondition;
import cc.kune.core.client.sn.actions.conditions.IsPersonCondition;
import cc.kune.core.client.sn.actions.registry.SNAdminsMenuItemsRegistry;
@@ -22,7 +23,7 @@
final Provider<SNCollabsMenuItemsRegistry> snCollabsItemsRegistry,
final Provider<SNPendingsMenuItemsRegistry> snPendingItemsRegistry, final IsNotMeCondition isNotMe,
final IsPersonCondition isPersonCondition,
- final Provider<StartChatWithMemberAction> startChatWithMemberAction,
+ final Provider<StartChatWithMemberAction> startChatWithMemberAction, final IsLoggedCondition isLogged,
final Provider<StartChatWithUserAction> startChatWithUserAction) {
session.onInitDataReceived(true, new AppStartHandler() {
@Override
@@ -34,6 +35,7 @@
final MenuItemDescriptor item = new MenuItemDescriptor(startChatWithMemberAction.get());
item.add(isNotMe);
item.add(isPersonCondition);
+ item.add(isLogged);
return item;
}
};
@@ -42,6 +44,7 @@
public MenuItemDescriptor get() {
final MenuItemDescriptor item = new MenuItemDescriptor(startChatWithUserAction.get());
item.add(isNotMe);
+ item.add(isLogged);
item.add(isPersonCondition);
return item;
}
Modified: trunk/src/main/java/cc/kune/chat/client/ChatSitebarActions.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatSitebarActions.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/chat/client/ChatSitebarActions.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -10,8 +10,6 @@
import cc.kune.core.client.sitebar.SiteUserOptions;
import cc.kune.core.client.sitebar.SiteUserOptionsPresenter;
import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.UserSignInEvent;
-import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
import cc.kune.core.shared.i18n.I18nTranslationService;
import com.calclab.emite.core.client.events.StateChangedEvent;
@@ -108,32 +106,46 @@
SiteUserOptionsPresenter.LOGGED_USER_MENU, i18n.t("Set your chat status"));
userOptions.addAction(new MenuSeparatorDescriptor(SiteUserOptionsPresenter.LOGGED_USER_MENU));
userOptions.addAction(chatActionsTitle);
- userOptions.addAction(createChatStatusAction(res.online(), i18n.t("Available"),
- onlineAction(NO_STATUS, Show.notSpecified, res.online())));
- userOptions.addAction(createChatStatusAction(res.xa(), i18n.t("Available for chat"),
- onlineAction(NO_STATUS, Show.chat, res.xa())));
- userOptions.addAction(createChatStatusAction(res.away(), i18n.t("Away"),
- onlineAction(NO_STATUS, Show.away, res.away())));
- userOptions.addAction(createChatStatusAction(res.busy(), i18n.t("Busy"),
- onlineAction(NO_STATUS, Show.dnd, res.busy())));
- userOptions.addAction(createChatStatusAction(res.offline(), i18n.t("Sign out of chat"),
- new ChangeOfflineStatusAction(res.offline())));
+ final MenuRadioItemDescriptor onlineItem = createChatStatusAction(res.online(), i18n.t("Available"),
+ onlineAction(NO_STATUS, Show.notSpecified, res.online()));
+ final MenuRadioItemDescriptor availableItem = createChatStatusAction(res.xa(), i18n.t("Available for chat"),
+ onlineAction(NO_STATUS, Show.chat, res.xa()));
+ final MenuRadioItemDescriptor awayItem = createChatStatusAction(res.away(), i18n.t("Away"),
+ onlineAction(NO_STATUS, Show.away, res.away()));
+ final MenuRadioItemDescriptor busyItem = createChatStatusAction(res.busy(), i18n.t("Busy"),
+ onlineAction(NO_STATUS, Show.dnd, res.busy()));
+ final MenuRadioItemDescriptor offlineItem = createChatStatusAction(res.offline(), i18n.t("Sign out of chat"),
+ new ChangeOfflineStatusAction(res.offline()));
+ userOptions.addAction(onlineItem);
+ userOptions.addAction(availableItem);
+ userOptions.addAction(awayItem);
+ userOptions.addAction(busyItem);
+ userOptions.addAction(offlineItem);
xmppSession.addSessionStateChangedHandler(false, new StateChangedHandler() {
@Override
public void onStateChanged(final StateChangedEvent event) {
if (xmppSession.isReady()) {
presenceManager.changeOwnPresence(nextPresence);
+ switch (nextPresence.getShow()) {
+ case notSpecified:
+ onlineItem.setChecked(true);
+ break;
+ case dnd:
+ busyItem.setChecked(true);
+ break;
+ case chat:
+ availableItem.setChecked(true);
+ break;
+ case away:
+ awayItem.setChecked(true);
+ break;
+ }
+ } else {
+ offlineItem.setChecked(true);
}
}
});
- session.onUserSignIn(false, new UserSignInHandler() {
- @Override
- public void onUserSignIn(final UserSignInEvent event) {
- //
- }
- });
-
}
private MenuRadioItemDescriptor createChatStatusAction(final ImageResource icon, final String text,
Modified: trunk/src/main/java/cc/kune/chat/public/kune-chat.css
===================================================================
--- trunk/src/main/java/cc/kune/chat/public/kune-chat.css 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/chat/public/kune-chat.css 2011-03-02 01:14:27 UTC (rev 1267)
@@ -146,4 +146,12 @@
-ms-text-overflow: ellipsis;
-moz-binding: url('/ws/ellipsis.xml#ellipsis');
width: 100%
+}
+
+button.k-chat-add-as-buddie {
+ margin: 10px !important;
+}
+
+.k-chat-add-as-buddie * {
+ font-size: 13px !important;
}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/client/KuneGinjector.java
===================================================================
--- trunk/src/main/java/cc/kune/client/KuneGinjector.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/client/KuneGinjector.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -40,6 +40,7 @@
import cc.kune.core.client.sitebar.SitebarActionsPresenter;
import cc.kune.core.client.sitebar.logo.SiteLogoPresenter;
import cc.kune.core.client.sitebar.spaces.SpaceSelectorPresenter;
+import cc.kune.core.client.sn.BuddiesAndParticipationPresenter;
import cc.kune.core.client.sn.GroupMembersPresenter;
import cc.kune.core.client.state.SiteTokenListeners;
import cc.kune.core.client.state.StateManager;
@@ -65,6 +66,8 @@
* see the GWTPlatform doc
*/
+ AsyncProvider<BuddiesAndParticipationPresenter> getBuddiesAndParticipationPresenter();
+
ChatClient getChatClient();
ChatParts getChatParts();
Modified: trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreGinModule.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/core/client/CoreGinModule.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -68,6 +68,8 @@
import cc.kune.core.client.sitebar.logo.SiteLogoViewImpl;
import cc.kune.core.client.sitebar.spaces.SpaceSelectorPresenter;
import cc.kune.core.client.sitebar.spaces.SpaceSelectorViewImpl;
+import cc.kune.core.client.sn.BuddiesAndParticipationPanel;
+import cc.kune.core.client.sn.BuddiesAndParticipationPresenter;
import cc.kune.core.client.sn.GroupMembersPanel;
import cc.kune.core.client.sn.GroupMembersPresenter;
import cc.kune.core.client.sn.actions.registry.GroupMembersActionsRegistry;
@@ -141,6 +143,9 @@
NewGroupPresenter.NewGroupProxy.class);
bindPresenter(GroupMembersPresenter.class, GroupMembersPresenter.GroupMembersView.class,
GroupMembersPanel.class, GroupMembersPresenter.GroupMembersProxy.class);
+ bindPresenter(BuddiesAndParticipationPresenter.class,
+ BuddiesAndParticipationPresenter.BuddiesAndParticipationView.class, BuddiesAndParticipationPanel.class,
+ BuddiesAndParticipationPresenter.BuddiesAndParticipationProxy.class);
bindPresenter(EntityLicensePresenter.class, EntityLicensePresenter.EntityLicenseView.class,
EntityLicensePanel.class, EntityLicensePresenter.EntityLicenseProxy.class);
bindPresenter(EntityHeaderPresenter.class, EntityHeaderPresenter.EntityHeaderView.class,
Modified: trunk/src/main/java/cc/kune/core/client/CoreParts.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreParts.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/core/client/CoreParts.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -3,6 +3,7 @@
import cc.kune.core.client.init.AppStartEvent;
import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
import cc.kune.core.client.sitebar.SiteUserOptionsPresenter;
+import cc.kune.core.client.sn.BuddiesAndParticipationPresenter;
import cc.kune.core.client.sn.GroupMembersPresenter;
import cc.kune.core.client.sn.actions.GroupMembersConfActions;
import cc.kune.core.client.state.Session;
@@ -14,14 +15,16 @@
public class CoreParts {
@Inject
- public CoreParts(final Session session, final Provider<GroupMembersPresenter> grouMembersPresenter,
+ public CoreParts(final Session session, final Provider<GroupMembersPresenter> groupMembersPresenter,
+ final Provider<BuddiesAndParticipationPresenter> buddiesAndParticipationPresenter,
final Provider<GroupMembersConfActions> groupMembersConfActions,
final Provider<SiteUserOptionsPresenter> userOptions, final Provider<EntityLicensePresenter> licenseFooter) {
session.onInitDataReceived(true, new AppStartHandler() {
@Override
public void onAppStart(final AppStartEvent event) {
groupMembersConfActions.get();
- grouMembersPresenter.get();
+ groupMembersPresenter.get();
+ buddiesAndParticipationPresenter.get();
userOptions.get();
licenseFooter.get();
}
Modified: trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -38,7 +38,6 @@
import cc.kune.core.shared.dto.SubscriptionMode;
import cc.kune.core.shared.dto.TimeZoneDTO;
import cc.kune.core.shared.dto.UserDTO;
-import cc.kune.core.shared.dto.UserInfoDTO;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
@@ -139,34 +138,35 @@
getView().getRegisterPassword(), getView().getEmail(), language, country, timezone, null, true,
SubscriptionMode.manual, "blue");
super.saveAutocompleteLoginData(getView().getShortName(), getView().getRegisterPassword());
- final AsyncCallback<UserInfoDTO> callback = new AsyncCallback<UserInfoDTO>() {
+ final AsyncCallback<Void> callback = new AsyncCallback<Void>() {
@Override
public void onFailure(final Throwable caught) {
- getView().unMask();
- if (caught instanceof EmailAddressInUseException) {
- getView().setErrorMessage(i18n.t(CoreMessages.EMAIL_IN_USE), NotifyLevel.error);
- } else if (caught instanceof GroupNameInUseException) {
- getView().setErrorMessage(i18n.t(CoreMessages.NAME_IN_USE), NotifyLevel.error);
- } else if (caught instanceof UserRegistrationException) {
- getView().setErrorMessage(i18n.t("Error during registration. " + caught.getMessage()),
- NotifyLevel.error);
- } else {
- getView().setErrorMessage(i18n.t("Error during registration."), NotifyLevel.error);
- throw new UIException("Other kind of exception in user registration", caught);
- }
+ onRegistrationFailure(caught);
}
@Override
- public void onSuccess(final UserInfoDTO userInfoDTO) {
- onSignIn(userInfoDTO);
- stateManager.gotoToken(userInfoDTO.getHomePage());
- getView().hide();
- getView().unMask();
- if (wantHomepage) {
- showWelcolmeDialog();
- } else {
- showWelcolmeDialogNoHomepage();
- }
+ public void onSuccess(final Void arg0) {
+ signInProvider.get().doSignIn(getView().getShortName(), getView().getRegisterPassword(),
+ new AsyncCallback<Void>() {
+
+ @Override
+ public void onFailure(final Throwable caught) {
+ onRegistrationFailure(caught);
+ }
+
+ @Override
+ public void onSuccess(final Void result) {
+ // onSignIn(userInfoDTO);
+ stateManager.gotoToken(session.getCurrentUserInfo().getHomePage());
+ getView().hide();
+ getView().unMask();
+ if (wantHomepage) {
+ showWelcolmeDialog();
+ } else {
+ showWelcolmeDialogNoHomepage();
+ }
+ }
+ });
}
private void showWelcolmeDialog() {
@@ -196,6 +196,20 @@
}
}
+ private void onRegistrationFailure(final Throwable caught) {
+ getView().unMask();
+ if (caught instanceof EmailAddressInUseException) {
+ getView().setErrorMessage(i18n.t(CoreMessages.EMAIL_IN_USE), NotifyLevel.error);
+ } else if (caught instanceof GroupNameInUseException) {
+ getView().setErrorMessage(i18n.t(CoreMessages.NAME_IN_USE), NotifyLevel.error);
+ } else if (caught instanceof UserRegistrationException) {
+ getView().setErrorMessage(i18n.t("Error during registration. " + caught.getMessage()), NotifyLevel.error);
+ } else {
+ getView().setErrorMessage(i18n.t("Error during registration."), NotifyLevel.error);
+ throw new UIException("Other kind of exception in user registration", caught);
+ }
+ }
+
@Override
protected void revealInParent() {
RevealRootContentEvent.fire(this, this);
Modified: trunk/src/main/java/cc/kune/core/client/auth/SignIn.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/SignIn.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/core/client/auth/SignIn.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -19,11 +19,14 @@
*/
package cc.kune.core.client.auth;
+import com.google.gwt.user.client.rpc.AsyncCallback;
public interface SignIn {
- void doSignIn();
+ void doSignIn(String nickOrEmail, String passwd, AsyncCallback<Void> callback);
void hide();
+ void showSignInDialog();
+
}
Modified: trunk/src/main/java/cc/kune/core/client/auth/SignInPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/SignInPresenter.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/core/client/auth/SignInPresenter.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -21,7 +21,6 @@
import cc.kune.common.client.log.Log;
import cc.kune.common.client.noti.NotifyLevel;
-import cc.kune.common.client.utils.SimpleCallback;
import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.client.utils.TimerWrapper;
import cc.kune.common.client.utils.TimerWrapper.Executer;
@@ -61,47 +60,54 @@
private final Provider<Register> registerProvider;
private final TimerWrapper timer;
private final UserServiceAsync userService;
- private final WaveClientSimpleAuthenticator waveClientTester;
+ private final WaveClientSimpleAuthenticator waveClientAuthenticator;
@Inject
public SignInPresenter(final EventBus eventBus, final SignInView view, final SignInProxy proxy,
final Session session, final StateManager stateManager, final I18nUITranslationService i18n,
final UserServiceAsync userService, final Provider<Register> registerProvider,
final CookiesManager cookiesManager, final UserPassAutocompleteManager autocomplete,
- final TimerWrapper timeWrapper, final WaveClientSimpleAuthenticator waveClientTester) {
+ final TimerWrapper timeWrapper, final WaveClientSimpleAuthenticator waveClientAuthenticator) {
super(eventBus, view, proxy, session, stateManager, i18n, cookiesManager, autocomplete);
this.eventBus = eventBus;
this.userService = userService;
this.registerProvider = registerProvider;
this.timer = timeWrapper;
- this.waveClientTester = waveClientTester;
+ this.waveClientAuthenticator = waveClientAuthenticator;
}
@Override
- public void doSignIn() {
- registerProvider.get().hide();
- if (session.isLogged()) {
- stateManager.restorePreviousToken();
- } else {
- eventBus.fireEvent(new ProgressShowEvent());
- getView().show();
- // getView().center();
- eventBus.fireEvent(new ProgressHideEvent());
- getView().focusOnNickname();
- timer.configure(new Executer() {
- @Override
- public void execute() {
- final String savedLogin = autocomplete.getNickOrEmail();
- final String savedPasswd = autocomplete.getPassword();
- if (TextUtils.notEmpty(savedLogin)) {
- getView().setNickOrEmail(savedLogin);
- getView().setLoginPassword(savedPasswd);
- getView().focusOnPassword();
+ public void doSignIn(final String nickOrEmail, final String passwd, final AsyncCallback<Void> extCallback) {
+ final UserDTO user = new UserDTO();
+ user.setShortName(nickOrEmail);
+ user.setPassword(passwd);
+ saveAutocompleteLoginData(nickOrEmail, passwd);
+ waveClientAuthenticator.doLogin(nickOrEmail, passwd, new AsyncCallback<Void>() {
+ @Override
+ public void onFailure(final Throwable caught) {
+ Log.error("SignInPresenter/doLogin fails in Wave auth");
+ extCallback.onFailure(caught);
+ }
+
+ @Override
+ public void onSuccess(final Void arg) {
+
+ final AsyncCallback<UserInfoDTO> callback = new AsyncCallback<UserInfoDTO>() {
+ @Override
+ public void onFailure(final Throwable caught) {
+ extCallback.onFailure(caught);
}
- }
- });
- timer.schedule(500);
- }
+
+ @Override
+ public void onSuccess(final UserInfoDTO userInfoDTO) {
+ onSignIn(userInfoDTO);
+ extCallback.onSuccess(null);
+ }
+ };
+ userService.login(user.getShortName(), user.getPassword(),
+ waveClientAuthenticator.getCookieTokenValue(), callback);
+ }
+ });
}
@Override
@@ -156,52 +162,64 @@
final String nickOrEmail = getView().getNickOrEmail();
final String passwd = getView().getLoginPassword();
+ doSignIn(nickOrEmail, passwd, new AsyncCallback<Void>() {
- final UserDTO user = new UserDTO();
- user.setShortName(nickOrEmail);
- user.setPassword(passwd);
- saveAutocompleteLoginData(nickOrEmail, passwd);
- waveClientTester.doLogin(nickOrEmail, passwd, new SimpleCallback() {
@Override
- public void onSuccess() {
- final AsyncCallback<UserInfoDTO> callback = new AsyncCallback<UserInfoDTO>() {
- @Override
- public void onFailure(final Throwable caught) {
- getView().unMask();
- eventBus.fireEvent(new ProgressHideEvent());
- if (caught instanceof UserAuthException) {
- getView().setErrorMessage(i18n.t(CoreMessages.INCORRECT_NICKNAME_EMAIL_OR_PASSWORD),
- NotifyLevel.error);
- } else {
- getView().setErrorMessage("Error in login", NotifyLevel.error);
- Log.error("Other kind of exception in SignInPresenter/doLogin");
- }
- }
-
- @Override
- public void onSuccess(final UserInfoDTO userInfoDTO) {
- onSignIn(userInfoDTO);
- stateManager.restorePreviousToken();
- getView().hide();
- getView().unMask();
-
- }
- };
- userService.login(user.getShortName(), user.getPassword(), callback);
+ public void onFailure(final Throwable caught) {
+ onSingInFailed(caught);
}
@Override
- public void onCancel() {
- getView().setErrorMessage("Error in login", NotifyLevel.error);
- Log.error("SignInPresenter/doLogin fails in Wave auth");
+ public void onSuccess(final Void result) {
+ stateManager.restorePreviousToken();
+ getView().hide();
+ getView().unMask();
}
});
}
}
+ private void onSingInFailed(final Throwable caught) {
+ getView().unMask();
+ eventBus.fireEvent(new ProgressHideEvent());
+ if (caught instanceof UserAuthException) {
+ getView().setErrorMessage(i18n.t(CoreMessages.INCORRECT_NICKNAME_EMAIL_OR_PASSWORD), NotifyLevel.error);
+ } else {
+ getView().setErrorMessage("Error in login", NotifyLevel.error);
+ Log.error("Other kind of exception in SignInPresenter/doLogin");
+ }
+ }
+
@Override
protected void revealInParent() {
RevealRootContentEvent.fire(this, this);
}
+ @Override
+ public void showSignInDialog() {
+ registerProvider.get().hide();
+ if (session.isLogged()) {
+ stateManager.restorePreviousToken();
+ } else {
+ eventBus.fireEvent(new ProgressShowEvent());
+ getView().show();
+ // getView().center();
+ eventBus.fireEvent(new ProgressHideEvent());
+ getView().focusOnNickname();
+ timer.configure(new Executer() {
+ @Override
+ public void execute() {
+ final String savedLogin = autocomplete.getNickOrEmail();
+ final String savedPasswd = autocomplete.getPassword();
+ if (TextUtils.notEmpty(savedLogin)) {
+ getView().setNickOrEmail(savedLogin);
+ getView().setLoginPassword(savedPasswd);
+ getView().focusOnPassword();
+ }
+ }
+ });
+ timer.schedule(500);
+ }
+ }
+
}
Modified: trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -100,7 +100,7 @@
} else {
// stateManager.restorePreviousToken();
NotifyUser.info(i18n.t(CoreMessages.REGISTER_TO_CREATE_A_GROUP));
- signIn.get().doSignIn();
+ signIn.get().showSignInDialog();
}
}
});
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/UserService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/UserService.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/UserService.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -31,11 +31,11 @@
@RemoteServiceRelativePath("UserService")
public interface UserService extends RemoteService {
- UserInfoDTO createUser(UserDTO user, boolean wantPersonalHomepage) throws DefaultException;
+ void createUser(UserDTO user, boolean wantPersonalHomepage) throws DefaultException;
String getUserAvatarBaser64(String userHash, StateToken userToken) throws DefaultException;
- UserInfoDTO login(String nickOrEmail, String passwd) throws DefaultException;
+ UserInfoDTO login(String nickOrEmail, String passwd, String waveToken) throws DefaultException;
void logout(String userHash) throws DefaultException;
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/UserServiceAsync.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/UserServiceAsync.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/UserServiceAsync.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -28,11 +28,11 @@
public interface UserServiceAsync {
- void createUser(UserDTO user, boolean wantPersonalHomepage, AsyncCallback<UserInfoDTO> asyncCallback);
+ void createUser(UserDTO user, boolean wantPersonalHomepage, AsyncCallback<Void> asyncCallback);
void getUserAvatarBaser64(String userHash, StateToken userToken, AsyncCallback<String> asyncCallback);
- void login(String nickOrEmail, String passwd, AsyncCallback<UserInfoDTO> asyncCallback);
+ void login(String nickOrEmail, String passwd, String waveCookieValue, AsyncCallback<UserInfoDTO> asyncCallback);
void logout(String userHash, AsyncCallback<Void> asyncCallback);
Modified: trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -118,7 +118,7 @@
getView().setGroupBtnDown(false);
getView().setPublicBtnDown(false);
} else {
- signIn.get().doSignIn();
+ signIn.get().showSignInDialog();
getView().setUserBtnDown(false);
NotifyUser.info(i18n.t("Sign in to access to your workspace"));
}
Added: trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -0,0 +1,126 @@
+package cc.kune.core.client.sn;
+
+import cc.kune.common.client.actions.gxtui.AbstractGxtMenuGui;
+import cc.kune.common.client.actions.ui.ActionFlowPanel;
+import cc.kune.common.client.actions.ui.ActionSimplePanel;
+import cc.kune.common.client.actions.ui.IsActionExtensible;
+import cc.kune.common.client.actions.ui.bind.GuiProvider;
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
+import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
+import cc.kune.common.client.ui.BasicThumb;
+import cc.kune.core.shared.dto.GroupDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.WsArmor;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.client.ui.DeckPanel;
+import com.google.gwt.user.client.ui.DockLayoutPanel;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.ScrollPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtplatform.mvp.client.ViewImpl;
+
+public class AbstractSNPanel extends ViewImpl {
+
+ interface AbstractSNPanelUiBinder extends UiBinder<Widget, AbstractSNPanel> {
+ }
+
+ private static AbstractSNPanelUiBinder uiBinder = GWT.create(AbstractSNPanelUiBinder.class);
+ protected final ActionSimplePanel actions;
+ int AVATARLABELMAXSIZE = 4;
+
+ int AVATARSIZE = 22;
+ ActionFlowPanel bottomActionsToolbar;
+ @UiField
+ FlowPanel bottomPanel;
+ @UiField
+ FlowPanel categoriesFlow;
+ @UiField
+ DeckPanel deck;
+ @UiField
+ Label firstCategoryCount;
+ @UiField
+ FlowPanel firstCategoryFlow;
+ @UiField
+ Label firstCategoryLabel;
+ @UiField
+ Label firstDeckLabel;
+ @UiField
+ FlowPanel mainPanel;
+ @UiField
+ Label mainTitle;
+ String NOAVATAR = "";
+ @UiField
+ Label sndCategoryCount;
+ @UiField
+ FlowPanel sndCategoryFlow;
+ @UiField
+ Label sndCategoryLabel;
+ @UiField
+ DockLayoutPanel sndCategoryPanel;
+ @UiField
+ ScrollPanel sndCategoryScroll;
+ @UiField
+ Label sndDeckLabel;
+ @UiField
+ Label trdCategoryCount;
+ @UiField
+ FlowPanel trdCategoryFlow;
+ @UiField
+ Label trdCategoryLabel;
+ @UiField
+ DockLayoutPanel trdCategoryPanel;
+ @UiField
+ ScrollPanel trdCategoryScroll;
+ protected final Widget widget;
+
+ public AbstractSNPanel(final I18nTranslationService i18n, final GuiProvider guiProvider, final WsArmor armor) {
+ widget = uiBinder.createAndBindUi(this);
+ actions = new ActionSimplePanel(guiProvider);
+ }
+
+ @Override
+ public Widget asWidget() {
+ return widget;
+ }
+
+ public void clear() {
+ trdCategoryFlow.clear();
+ firstCategoryFlow.clear();
+ sndCategoryFlow.clear();
+ actions.clear();
+ }
+
+ public BasicThumb createThumb(final GroupDTO group, final String avatarUrl, final String tooltip,
+ final String tooltipTitle, final GuiActionDescCollection menuitems) {
+ final BasicThumb thumb = new BasicThumb(avatarUrl, AVATARSIZE, group.getShortName(), AVATARLABELMAXSIZE, false);
+ final MenuDescriptor menu = new MenuDescriptor();
+ menu.setStandalone(true);
+ menu.putValue(AbstractGxtMenuGui.MENU_POSITION, AbstractGxtMenuGui.MenuPosition.bl);
+ for (final GuiActionDescrip item : menuitems) {
+ item.setParent(menu);
+ }
+ final ClickHandler clickHand = new ClickHandler() {
+ @Override
+ public void onClick(final ClickEvent event) {
+ menu.show(thumb);
+ }
+ };
+ thumb.addClickHandler(clickHand);
+ actions.add(menu);
+ actions.add(menuitems);
+ thumb.setTooltip(tooltipTitle, tooltip);
+ thumb.setLabelVisible(false);
+ return thumb;
+ }
+
+ public IsActionExtensible getBottomToolbar() {
+ return bottomActionsToolbar;
+ }
+}
Copied: trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.ui.xml (from rev 1262, trunk/src/main/java/cc/kune/core/client/sn/GroupMembersPanel.ui.xml)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.ui.xml (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.ui.xml 2011-03-02 01:14:27 UTC (rev 1267)
@@ -0,0 +1,73 @@
+<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
+<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
+ xmlns:g="urn:import:com.google.gwt.user.client.ui">
+ <ui:style>
+ .important {
+ font-weight: bold;
+ }
+ </ui:style>
+
+ <g:FlowPanel width="100%" ui:field="mainPanel"
+ addStyleNames="k-sn-mainpanel">
+ <g:Label ui:field="mainTitle" addStyleNames="k-sn-maintitle" />
+ <g:DeckPanel ui:field="deck" addStyleNames="k-sn-deck">
+ <g:Label ui:field="firstDeckLabel" addStyleNames="k-sn-novisible-label" />
+ <g:Label ui:field="sndDeckLabel" addStyleNames="k-sn-orphan-label" />
+ <g:FlowPanel width="100%" ui:field="categoriesFlow">
+ <g:DockLayoutPanel unit="EM" width="100%"
+ addStyleNames="k-sn-adminspanel" height="80px">
+ <g:north size="1.2">
+ <g:FlowPanel>
+ <g:Label text="Admins" ui:field="firstCategoryLabel"
+ addStyleNames="k-sn-adminslabel" />
+ <g:Label ui:field="firstCategoryCount" addStyleNames="k-sn-adminsCountlabel" />
+ </g:FlowPanel>
+ </g:north>
+ <g:center>
+ <g:ScrollPanel width="100%" addStyleNames="k-sn-adminsscroll">
+ <g:FlowPanel addStyleNames="k-sn-adminsflow"
+ ui:field="firstCategoryFlow" />
+ </g:ScrollPanel>
+ </g:center>
+ </g:DockLayoutPanel>
+ <g:DockLayoutPanel unit="EM" width="100%"
+ ui:field="sndCategoryPanel" addStyleNames="k-sn-collabspanel"
+ height="80px">
+ <g:north size="1.2">
+ <g:FlowPanel>
+ <g:Label text="Collabs" ui:field="sndCategoryLabel"
+ addStyleNames="k-sn-collabslabel" />
+ <g:Label ui:field="sndCategoryCount" addStyleNames="k-sn-collabsCountlabel" />
+ </g:FlowPanel>
+ </g:north>
+ <g:center>
+ <g:ScrollPanel ui:field="sndCategoryScroll" width="100%"
+ addStyleNames="k-sn-collabsscroll">
+ <g:FlowPanel ui:field="sndCategoryFlow"
+ addStyleNames="k-sn-collabsflow" />
+ </g:ScrollPanel>
+ </g:center>
+ </g:DockLayoutPanel>
+ <g:DockLayoutPanel unit="EM" width="100%"
+ ui:field="trdCategoryPanel" addStyleNames="k-sn-pendingspanel"
+ height="80px">
+ <g:north size="1.2">
+ <g:FlowPanel>
+ <g:Label text="Pendings" ui:field="trdCategoryLabel"
+ addStyleNames="k-sn-pendingslabel" />
+ <g:Label ui:field="trdCategoryCount" addStyleNames="k-sn-pendingsCountlabel" />
+ </g:FlowPanel>
+ </g:north>
+ <g:center>
+ <g:ScrollPanel ui:field="trdCategoryScroll"
+ addStyleNames="k-sn-pendingsscroll" width="100%">
+ <g:FlowPanel addStyleNames="k-sn-pendingsflow"
+ ui:field="trdCategoryFlow" />
+ </g:ScrollPanel>
+ </g:center>
+ </g:DockLayoutPanel>
+ </g:FlowPanel>
+ </g:DeckPanel>
+ <g:FlowPanel ui:field="bottomPanel" addStyleNames="k-sn-bottomPanel" />
+ </g:FlowPanel>
+</ui:UiBinder>
\ No newline at end of file
Property changes on: trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.ui.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/core/client/sn/BuddiesAndParticipationPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/BuddiesAndParticipationPanel.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sn/BuddiesAndParticipationPanel.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -0,0 +1,84 @@
+package cc.kune.core.client.sn;
+
+import cc.kune.common.client.actions.ui.ActionFlowPanel;
+import cc.kune.common.client.actions.ui.bind.GuiProvider;
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
+import cc.kune.common.client.ui.BasicThumb;
+import cc.kune.core.client.resources.CoreMessages;
+import cc.kune.core.client.sn.BuddiesAndParticipationPresenter.BuddiesAndParticipationView;
+import cc.kune.core.shared.dto.GroupDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.WsArmor;
+
+import com.google.inject.Inject;
+
+public class BuddiesAndParticipationPanel extends AbstractSNPanel implements BuddiesAndParticipationView {
+
+ @Inject
+ public BuddiesAndParticipationPanel(final I18nTranslationService i18n, final GuiProvider guiProvider,
+ final WsArmor armor) {
+ super(i18n, guiProvider, armor);
+ setVisible(false);
+ mainTitle.setText(i18n.t("His/her Net:"));
+ mainTitle.setTitle(i18n.t("This user buddies and groups where participes"));
+ firstCategoryLabel.setText(i18n.t("Buddies"));
+ firstCategoryLabel.setTitle(i18n.t("This user buddies"));
+ sndCategoryLabel.setText(i18n.t("and participates in"));
+ sndCategoryLabel.setTitle(i18n.t("Groups in which this user participates"));
+ firstDeckLabel.setText(i18n.t(CoreMessages.BUDDIES_NOT_PUBLIC));
+ trdCategoryLabel.setText("NOT USED");
+ trdCategoryLabel.setTitle("NOT USED");
+ trdCategoryPanel.setVisible(false);
+ sndDeckLabel.setText("NOT USED");
+ bottomActionsToolbar = new ActionFlowPanel(guiProvider);
+ bottomPanel.add(bottomActionsToolbar);
+ bottomActionsToolbar.setStyleName("k-sn-bottomPanel-actions");
+ armor.getEntityToolsNorth().add(widget);
+ deck.showWidget(2);
+ }
+
+ @Override
+ public void addBuddie(final GroupDTO group, final String avatarUrl, final String tooltip,
+ final String tooltipTitle, final GuiActionDescCollection menu) {
+ final BasicThumb thumb = createThumb(group, avatarUrl, tooltip, tooltipTitle, menu);
+ firstCategoryFlow.add(thumb);
+ }
+
+ @Override
+ public void addParticipation(final GroupDTO group, final String avatarUrl, final String tooltip,
+ final String tooltipTitle, final GuiActionDescCollection menu) {
+ final BasicThumb thumb = createThumb(group, avatarUrl, tooltip, tooltipTitle, menu);
+ sndCategoryFlow.add(thumb);
+ }
+
+ @Override
+ public void setBuddiesCount(final int count) {
+ firstCategoryCount.setText(new StringBuffer("(").append(count).append(")").toString());
+ }
+
+ @Override
+ public void setParticipationCount(final int count) {
+ sndCategoryCount.setText(new StringBuffer("(").append(count).append(")").toString());
+ }
+
+ @Override
+ public void setParticipationVisible(final boolean visible) {
+ sndCategoryPanel.setVisible(visible);
+ }
+
+ @Override
+ public void setVisible(final boolean visible) {
+ mainPanel.setVisible(visible);
+ }
+
+ @Override
+ public void showBuddies() {
+ deck.showWidget(2);
+ }
+
+ @Override
+ public void showBuddiesNotPublic() {
+ deck.showWidget(0);
+ }
+
+}
Added: trunk/src/main/java/cc/kune/core/client/sn/BuddiesAndParticipationPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/BuddiesAndParticipationPresenter.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sn/BuddiesAndParticipationPresenter.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -0,0 +1,220 @@
+package cc.kune.core.client.sn;
+
+import java.util.List;
+
+import cc.kune.common.client.actions.ui.IsActionExtensible;
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
+import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
+import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.client.sn.actions.registry.AbstractSNMembersActionsRegistry;
+import cc.kune.core.client.sn.actions.registry.GroupMembersActionsRegistry;
+import cc.kune.core.client.sn.actions.registry.SNAdminsMenuItemsRegistry;
+import cc.kune.core.client.sn.actions.registry.SNCollabsMenuItemsRegistry;
+import cc.kune.core.client.sn.actions.registry.SNPendingsMenuItemsRegistry;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.SocialNetworkChangedEvent;
+import cc.kune.core.client.state.StateChangedEvent;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.domain.utils.AccessRights;
+import cc.kune.core.shared.dto.GroupDTO;
+import cc.kune.core.shared.dto.ParticipationDataDTO;
+import cc.kune.core.shared.dto.StateAbstractDTO;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+import com.gwtplatform.mvp.client.Presenter;
+import com.gwtplatform.mvp.client.View;
+import com.gwtplatform.mvp.client.annotations.ProxyCodeSplit;
+import com.gwtplatform.mvp.client.proxy.Proxy;
+import com.gwtplatform.mvp.client.proxy.RevealRootContentEvent;
+
+public class BuddiesAndParticipationPresenter
+ extends
+ Presenter<BuddiesAndParticipationPresenter.BuddiesAndParticipationView, BuddiesAndParticipationPresenter.BuddiesAndParticipationProxy> {
+
+ @ProxyCodeSplit
+ public interface BuddiesAndParticipationProxy extends Proxy<BuddiesAndParticipationPresenter> {
+ }
+
+ public interface BuddiesAndParticipationView extends View {
+
+ void addBuddie(GroupDTO group, String avatarUrl, String tooltip, String tooltipTitle,
+ GuiActionDescCollection menu);
+
+ void addParticipation(GroupDTO group, String avatarUrl, String tooltip, String tooltipTitle,
+ GuiActionDescCollection menu);
+
+ void clear();
+
+ IsActionExtensible getBottomToolbar();
+
+ void setBuddiesCount(int count);
+
+ void setParticipationCount(int count);
+
+ void setParticipationVisible(boolean visible);
+
+ void setVisible(boolean visible);
+
+ void showBuddies();
+
+ void showBuddiesNotPublic();
+ }
+
+ private final GroupMembersActionsRegistry actionsRegistry;
+ private final SNAdminsMenuItemsRegistry adminsMenuItemsRegistry;
+ private final SNCollabsMenuItemsRegistry collabsMenuItemsRegistry;
+ private final Provider<FileDownloadUtils> downloadProvider;
+ private final SNPendingsMenuItemsRegistry pendingsMenuItemsRegistry;
+
+ @Inject
+ public BuddiesAndParticipationPresenter(final EventBus eventBus, final BuddiesAndParticipationView view,
+ final BuddiesAndParticipationProxy proxy, final StateManager stateManager, final Session session,
+ final Provider<FileDownloadUtils> downloadProvider,
+ final SNAdminsMenuItemsRegistry adminsMenuItemsRegistry,
+ final SNCollabsMenuItemsRegistry collabsMenuItemsRegistry,
+ final SNPendingsMenuItemsRegistry pendingsMenuItemsRegistry,
+ final GroupMembersActionsRegistry actionsRegistry) {
+ super(eventBus, view, proxy);
+ this.downloadProvider = downloadProvider;
+ this.adminsMenuItemsRegistry = adminsMenuItemsRegistry;
+ this.collabsMenuItemsRegistry = collabsMenuItemsRegistry;
+ this.pendingsMenuItemsRegistry = pendingsMenuItemsRegistry;
+ this.actionsRegistry = actionsRegistry;
+ stateManager.onStateChanged(true, new StateChangedEvent.StateChangedHandler() {
+ @Override
+ public void onStateChanged(final StateChangedEvent event) {
+ BuddiesAndParticipationPresenter.this.onStateChanged(event.getState());
+ }
+ });
+ stateManager.onSocialNetworkChanged(true, new SocialNetworkChangedEvent.SocialNetworkChangedHandler() {
+
+ @Override
+ public void onSocialNetworkChanged(final SocialNetworkChangedEvent event) {
+ BuddiesAndParticipationPresenter.this.onStateChanged(event.getState());
+ }
+ });
+ createActions();
+ }
+
+ private void createActions() {
+ getView().getBottomToolbar().addActions(actionsRegistry);
+ }
+
+ private GuiActionDescCollection createMenuItems(final GroupDTO group,
+ final AbstractSNMembersActionsRegistry registry) {
+ final GuiActionDescCollection items = new GuiActionDescCollection();
+ for (final Provider<MenuItemDescriptor> provider : registry) {
+ final MenuItemDescriptor menuItem = provider.get();
+ menuItem.setTarget(group);
+ items.add(menuItem);
+ }
+ return items;
+ }
+
+ private String getAvatar(final GroupDTO admin) {
+ return admin.hasLogo() ? downloadProvider.get().getLogoImageUrl(admin.getStateToken()) : "images/unknown.jpg";
+ }
+
+ private void onStateChanged(final StateAbstractDTO state) {
+ if (state.getGroup().isNotPersonal()) {
+ getView().setVisible(false);
+ } else {
+ setParticipationState(state);
+ if (state.getSocialNetworkData().isBuddiesVisible()) {
+ getView().clear();
+ // setGroupMembers(state.getGroupMembers(),
+ // state.getGroupRights());
+ } else {
+ getView().clear();
+ getView().showBuddiesNotPublic();
+ }
+ getView().setVisible(true);
+ }
+ }
+
+ @Override
+ protected void revealInParent() {
+ RevealRootContentEvent.fire(this, this);
+ }
+
+ // private void setGroupMembers(final SocialNetworkDTO socialNetwork, final
+ // AccessRights rights) {
+ // final AccessListsDTO accessLists = socialNetwork.getAccessLists();
+ //
+ // final List<GroupDTO> adminsList = accessLists.getAdmins().getList();
+ // final List<GroupDTO> collabList = accessLists.getEditors().getList();
+ // final List<GroupDTO> pendingCollabsList =
+ // socialNetwork.getPendingCollaborators().getList();
+ //
+ // final int numAdmins = adminsList.size();
+ // final int numCollabs = collabList.size();
+ // final int numPendings = pendingCollabsList.size();
+ //
+ // getView().setAdminsCount(numAdmins);
+ // getView().setCollabsCount(numCollabs);
+ // getView().setPendingsCount(numPendings);
+ //
+ // if ((numAdmins + numCollabs) == 0) {
+ // getView().showOrphan();
+ // } else {
+ // final boolean userIsAdmin = rights.isAdministrable();
+ // final boolean userCanView = rights.isVisible();
+ //
+ // if (userCanView) {
+ // for (final GroupDTO admin : adminsList) {
+ // final String avatar = getAvatar(admin);
+ // getView().addAdmin(admin, avatar, admin.getLongName(), "",
+ // createMenuItems(admin, adminsMenuItemsRegistry));
+ // }
+ // getView().setCollabsVisible(numCollabs > 0);
+ // for (final GroupDTO collab : collabList) {
+ // final String avatar = getAvatar(collab);
+ // getView().addCollab(collab, avatar, collab.getLongName(), "",
+ // createMenuItems(collab, collabsMenuItemsRegistry));
+ // }
+ // if (userIsAdmin) {
+ // getView().setPendingVisible(numPendings > 0);
+ // for (final GroupDTO pendingCollab : pendingCollabsList) {
+ // final String avatar = getAvatar(pendingCollab);
+ // getView().addPending(pendingCollab, avatar, pendingCollab.getLongName(),
+ // "",
+ // createMenuItems(pendingCollab, pendingsMenuItemsRegistry));
+ // }
+ // } else {
+ // getView().setPendingVisible(false);
+ // }
+ // getView().showMembers();
+ // }
+ // }
+ // getView().setVisible(true);
+ // }
+
+ private void setParticipationState(final StateAbstractDTO state) {
+ final ParticipationDataDTO participation = state.getParticipation();
+ final AccessRights rights = state.getGroupRights();
+ getView().clear();
+ final List<GroupDTO> groupsIsAdmin = participation.getGroupsIsAdmin();
+ final List<GroupDTO> groupsIsCollab = participation.getGroupsIsCollab();
+ final int numAdmins = groupsIsAdmin.size();
+ final int numCollaborators = groupsIsCollab.size();
+ for (final GroupDTO group : groupsIsAdmin) {
+ // getView().addParticipation(group, null, null, null,
+ // actionsRegistry);
+ // view.addItem(createGridItem(adminCategory, group, rights,
+ // unJoinMenuItem));
+ }
+ for (final GroupDTO group : groupsIsCollab) {
+ // view.addItem(createGridItem(collabCategory, group, rights,
+ // unJoinMenuItem));
+ }
+ final int totalGroups = numAdmins + numCollaborators;
+ if (totalGroups > 0) {
+ getView().setParticipationCount(totalGroups);
+ getView().setParticipationVisible(true);
+ } else {
+ getView().setParticipationVisible(false);
+ }
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/core/client/sn/GroupMembersPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/GroupMembersPanel.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/core/client/sn/GroupMembersPanel.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -1,98 +1,33 @@
package cc.kune.core.client.sn;
-import cc.kune.common.client.actions.gxtui.AbstractGxtMenuGui;
import cc.kune.common.client.actions.ui.ActionFlowPanel;
-import cc.kune.common.client.actions.ui.ActionSimplePanel;
-import cc.kune.common.client.actions.ui.IsActionExtensible;
import cc.kune.common.client.actions.ui.bind.GuiProvider;
import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
-import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
-import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
import cc.kune.common.client.ui.BasicThumb;
import cc.kune.core.client.sn.GroupMembersPresenter.GroupMembersView;
import cc.kune.core.shared.dto.GroupDTO;
import cc.kune.core.shared.i18n.I18nTranslationService;
import cc.kune.gspace.client.WsArmor;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.uibinder.client.UiBinder;
-import com.google.gwt.uibinder.client.UiField;
-import com.google.gwt.user.client.ui.DeckPanel;
-import com.google.gwt.user.client.ui.DockLayoutPanel;
-import com.google.gwt.user.client.ui.FlowPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.ScrollPanel;
-import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
-import com.gwtplatform.mvp.client.ViewImpl;
-public class GroupMembersPanel extends ViewImpl implements GroupMembersView {
+public class GroupMembersPanel extends AbstractSNPanel implements GroupMembersView {
- interface GroupMembersPanelUiBinder extends UiBinder<Widget, GroupMembersPanel> {
- }
-
- private static GroupMembersPanelUiBinder uiBinder = GWT.create(GroupMembersPanelUiBinder.class);
- private final ActionSimplePanel actions;
- @UiField
- Label adminsCount;
- @UiField
- FlowPanel adminsFlow;
- @UiField
- Label adminsLabel;
- ActionFlowPanel bottomActionsToolbar;
- @UiField
- FlowPanel bottomPanel;
- @UiField
- Label collabsCount;
- @UiField
- FlowPanel collabsFlow;
- @UiField
- Label collabsLabel;
- @UiField
- DockLayoutPanel collabsPanel;
- @UiField
- ScrollPanel collabsScroll;
- @UiField
- DeckPanel deck;
- @UiField
- FlowPanel mainPanel;
- @UiField
- Label mainTitle;
- @UiField
- FlowPanel membersFlow;
- @UiField
- Label noMembersVisible;
- @UiField
- Label orphanProject;
- @UiField
- Label pendingsCount;
- @UiField
- FlowPanel pendingsFlow;
- @UiField
- Label pendingsLabel;
- @UiField
- DockLayoutPanel pendingsPanel;
- @UiField
- ScrollPanel pendingsScroll;
- private final Widget widget;
-
@Inject
public GroupMembersPanel(final I18nTranslationService i18n, final GuiProvider guiProvider, final WsArmor armor) {
- widget = uiBinder.createAndBindUi(this);
+ super(i18n, guiProvider, armor);
+ setVisible(false);
mainTitle.setText(i18n.t("Group members"));
mainTitle.setTitle(i18n.t("People and groups collaborating in this group"));
- adminsLabel.setText(i18n.t("Admins"));
- adminsLabel.setTitle(i18n.t("People that can admin this group"));
- collabsLabel.setText(i18n.t("Collaborators"));
- collabsLabel.setTitle(i18n.t("Other people that collaborate with this group"));
- pendingsLabel.setText(i18n.t("Pending"));
- pendingsLabel.setTitle(i18n.t("People pending to be accepted in this group by the admins"));
- orphanProject.setText(i18n.t("This is an orphaned project, if you are interested please request to join to work on it"));
- noMembersVisible.setText(i18n.t("The members of this group are not public"));
+ firstCategoryLabel.setText(i18n.t("Admins"));
+ firstCategoryLabel.setTitle(i18n.t("People that can admin this group"));
+ sndCategoryLabel.setText(i18n.t("Collaborators"));
+ sndCategoryLabel.setTitle(i18n.t("Other people that collaborate with this group"));
+ trdCategoryLabel.setText(i18n.t("Pending"));
+ trdCategoryLabel.setTitle(i18n.t("People pending to be accepted in this group by the admins"));
+ sndDeckLabel.setText(i18n.t("This is an orphaned project, if you are interested please request to join to work on it"));
+ firstDeckLabel.setText(i18n.t("The members of this group are not public"));
bottomActionsToolbar = new ActionFlowPanel(guiProvider);
- actions = new ActionSimplePanel(guiProvider);
bottomPanel.add(bottomActionsToolbar);
bottomActionsToolbar.setStyleName("k-sn-bottomPanel-actions");
armor.getEntityToolsNorth().add(widget);
@@ -103,92 +38,51 @@
public void addAdmin(final GroupDTO group, final String avatarUrl, final String tooltip, final String tooltipTitle,
final GuiActionDescCollection menu) {
final BasicThumb thumb = createThumb(group, avatarUrl, tooltip, tooltipTitle, menu);
- adminsFlow.add(thumb);
+ firstCategoryFlow.add(thumb);
}
@Override
public void addCollab(final GroupDTO group, final String avatarUrl, final String tooltip,
final String tooltipTitle, final GuiActionDescCollection menu) {
final BasicThumb thumb = createThumb(group, avatarUrl, tooltip, tooltipTitle, menu);
- collabsFlow.add(thumb);
+ sndCategoryFlow.add(thumb);
}
@Override
public void addPending(final GroupDTO group, final String avatarUrl, final String tooltip,
final String tooltipTitle, final GuiActionDescCollection menu) {
final BasicThumb thumb = createThumb(group, avatarUrl, tooltip, tooltipTitle, menu);
- pendingsFlow.add(thumb);
+ trdCategoryFlow.add(thumb);
}
@Override
- public Widget asWidget() {
- return widget;
- }
-
- @Override
- public void clear() {
- pendingsFlow.clear();
- adminsFlow.clear();
- collabsFlow.clear();
- actions.clear();
- }
-
- private BasicThumb createThumb(final GroupDTO group, final String avatarUrl, final String tooltip,
- final String tooltipTitle, final GuiActionDescCollection menuitems) {
- final BasicThumb thumb = new BasicThumb(avatarUrl, AVATARSIZE, group.getShortName(), AVATARLABELMAXSIZE, false);
- final MenuDescriptor menu = new MenuDescriptor();
- menu.setStandalone(true);
- menu.putValue(AbstractGxtMenuGui.MENU_POSITION, AbstractGxtMenuGui.MenuPosition.bl);
- for (final GuiActionDescrip item : menuitems) {
- item.setParent(menu);
- }
- final ClickHandler clickHand = new ClickHandler() {
- @Override
- public void onClick(final ClickEvent event) {
- menu.show(thumb);
- }
- };
- thumb.addClickHandler(clickHand);
- actions.add(menu);
- actions.add(menuitems);
- thumb.setTooltip(tooltipTitle, tooltip);
- thumb.setLabelVisible(false);
- return thumb;
- }
-
- @Override
- public IsActionExtensible getBottomToolbar() {
- return bottomActionsToolbar;
- }
-
- @Override
public void setAdminsCount(final int count) {
- adminsCount.setText(new StringBuffer("(").append(count).append(")").toString());
+ firstCategoryCount.setText(new StringBuffer("(").append(count).append(")").toString());
}
@Override
public void setCollabsCount(final int count) {
- collabsCount.setText(new StringBuffer("(").append(count).append(")").toString());
+ sndCategoryCount.setText(new StringBuffer("(").append(count).append(")").toString());
}
@Override
public void setCollabsVisible(final boolean visible) {
- collabsPanel.setVisible(visible);
+ sndCategoryPanel.setVisible(visible);
}
@Override
public void setPendingsCount(final int count) {
- pendingsCount.setText(new StringBuffer("(").append(count).append(")").toString());
+ trdCategoryCount.setText(new StringBuffer("(").append(count).append(")").toString());
}
@Override
public void setPendingVisible(final boolean visible) {
- pendingsPanel.setVisible(visible);
+ trdCategoryPanel.setVisible(visible);
}
@Override
public void setVisible(final boolean visible) {
- deck.setVisible(visible);
+ mainPanel.setVisible(visible);
}
@Override
Deleted: trunk/src/main/java/cc/kune/core/client/sn/GroupMembersPanel.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/GroupMembersPanel.ui.xml 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/core/client/sn/GroupMembersPanel.ui.xml 2011-03-02 01:14:27 UTC (rev 1267)
@@ -1,77 +0,0 @@
-<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
-<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
- xmlns:g="urn:import:com.google.gwt.user.client.ui">
- <ui:style>
- .important {
- font-weight: bold;
- }
- </ui:style>
-
- <g:FlowPanel width="100%" ui:field="mainPanel"
- addStyleNames="k-sn-mainpanel">
- <g:Label ui:field="mainTitle" addStyleNames="k-sn-maintitle" />
- <g:DeckPanel ui:field="deck" addStyleNames="k-sn-deck">
- <g:Label ui:field="noMembersVisible" addStyleNames="k-sn-novisible-label" />
- <g:Label ui:field="orphanProject" addStyleNames="k-sn-orphan-label" />
- <g:FlowPanel width="100%" ui:field="membersFlow">
-
- <g:DockLayoutPanel unit="EM" width="100%"
- addStyleNames="k-sn-adminspanel" height="80px">
- <g:north size="1.2">
- <g:FlowPanel>
- <g:Label text="Admins" ui:field="adminsLabel"
- addStyleNames="k-sn-adminslabel" /><g:Label ui:field="adminsCount"
- addStyleNames="k-sn-adminsCountlabel" />
- </g:FlowPanel>
- </g:north>
- <g:center>
- <g:ScrollPanel width="100%" addStyleNames="k-sn-adminsscroll">
- <g:FlowPanel addStyleNames="k-sn-adminsflow"
- ui:field="adminsFlow" />
- </g:ScrollPanel>
- </g:center>
- </g:DockLayoutPanel>
-
- <g:DockLayoutPanel unit="EM" width="100%"
- ui:field="collabsPanel" addStyleNames="k-sn-collabspanel"
- height="80px">
- <g:north size="1.2">
- <g:FlowPanel>
- <g:Label text="Collabs" ui:field="collabsLabel"
- addStyleNames="k-sn-collabslabel" /><g:Label ui:field="collabsCount"
- addStyleNames="k-sn-collabsCountlabel" />
- </g:FlowPanel>
- </g:north>
- <g:center>
- <g:ScrollPanel ui:field="collabsScroll" width="100%"
- addStyleNames="k-sn-collabsscroll">
- <g:FlowPanel ui:field="collabsFlow"
- addStyleNames="k-sn-collabsflow" />
- </g:ScrollPanel>
- </g:center>
-
- </g:DockLayoutPanel>
-
- <g:DockLayoutPanel unit="EM" width="100%"
- ui:field="pendingsPanel" addStyleNames="k-sn-pendingspanel"
- height="80px">
- <g:north size="1.2">
- <g:FlowPanel>
- <g:Label text="Pendings" ui:field="pendingsLabel"
- addStyleNames="k-sn-pendingslabel" /><g:Label ui:field="pendingsCount"
- addStyleNames="k-sn-pendingsCountlabel" />
- </g:FlowPanel>
- </g:north>
- <g:center>
- <g:ScrollPanel ui:field="pendingsScroll"
- addStyleNames="k-sn-pendingsscroll" width="100%">
- <g:FlowPanel addStyleNames="k-sn-pendingsflow"
- ui:field="pendingsFlow" />
- </g:ScrollPanel>
- </g:center>
- </g:DockLayoutPanel>
- </g:FlowPanel>
- </g:DeckPanel>
- <g:FlowPanel ui:field="bottomPanel" addStyleNames="k-sn-bottomPanel" />
- </g:FlowPanel>
-</ui:UiBinder>
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/core/client/sn/GroupMembersPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/GroupMembersPresenter.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/core/client/sn/GroupMembersPresenter.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -38,9 +38,6 @@
}
public interface GroupMembersView extends View {
- int AVATARLABELMAXSIZE = 4;
- int AVATARSIZE = 22;
- String NOAVATAR = "";
void addAdmin(GroupDTO group, String avatarUrl, String tooltip, String tooltipTitle,
GuiActionDescCollection menu);
@@ -99,7 +96,7 @@
GroupMembersPresenter.this.onStateChanged(event.getState());
}
});
- stateManager.onSocialNetworkChanged(new SocialNetworkChangedEvent.SocialNetworkChangedHandler() {
+ stateManager.onSocialNetworkChanged(true, new SocialNetworkChangedEvent.SocialNetworkChangedHandler() {
@Override
public void onSocialNetworkChanged(final SocialNetworkChangedEvent event) {
Added: trunk/src/main/java/cc/kune/core/client/sn/actions/GotoYourHomePageAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/GotoYourHomePageAction.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/GotoYourHomePageAction.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -0,0 +1,18 @@
+package cc.kune.core.client.sn.actions;
+
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+
+public class GotoYourHomePageAction extends GotoGroupAction {
+
+ @Inject
+ public GotoYourHomePageAction(final StateManager stateManager, final I18nTranslationService i18n,
+ final CoreResources res) {
+ super(stateManager, i18n, res);
+ putValue(NAME, i18n.t("Visit your homepage"));
+ }
+
+}
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/GroupMembersConfActions.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/GroupMembersConfActions.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/GroupMembersConfActions.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -2,6 +2,7 @@
import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
+import cc.kune.common.client.actions.ui.descrip.MenuRadioItemDescriptor;
import cc.kune.common.client.actions.ui.descrip.SubMenuDescriptor;
import cc.kune.core.client.resources.CoreResources;
import cc.kune.core.client.sn.actions.conditions.IsGroupCondition;
@@ -11,6 +12,8 @@
import cc.kune.core.client.state.StateManager;
import cc.kune.core.shared.domain.AdmissionType;
import cc.kune.core.shared.domain.SocialNetworkVisibility;
+import cc.kune.core.shared.dto.GroupDTO;
+import cc.kune.core.shared.dto.StateAbstractDTO;
import cc.kune.core.shared.i18n.I18nTranslationService;
import com.google.inject.Inject;
@@ -29,24 +32,30 @@
final JoinGroupAction joinGroupAction, final IsGroupCondition isGroupCondition,
final UnJoinGroupAction unJoinGroupAction) {
OPTIONS_MENU.withText(i18n.t("Options")).withIcon(res.arrowDownSitebar()).withStyles("k-sn-options-menu");
+ final MenuRadioItemDescriptor anyoneItem = membersVisibility.get().withVisibility(
+ SocialNetworkVisibility.anyone);
+ final MenuRadioItemDescriptor onlyMembersItem = membersVisibility.get().withVisibility(
+ SocialNetworkVisibility.onlymembers);
+ final MenuRadioItemDescriptor onlyAdminsItem = membersVisibility.get().withVisibility(
+ SocialNetworkVisibility.onlyadmins);
+ final MenuRadioItemDescriptor closedItem = membersModeration.get().withModeration(AdmissionType.Closed);
+ final MenuRadioItemDescriptor moderatedItem = membersModeration.get().withModeration(AdmissionType.Moderated);
+ final MenuRadioItemDescriptor openItem = membersModeration.get().withModeration(AdmissionType.Open);
registry.add(OPTIONS_MENU);
registry.add(VISIBILITY_SUBMENU.withText(i18n.t("Those who can view this member list")).withParent(OPTIONS_MENU));
registry.add(MODERATION_SUBMENU.withText(i18n.t("New members policy")).withParent(OPTIONS_MENU));
- registry.add(membersVisibility.get().withVisibility(SocialNetworkVisibility.anyone).withParent(
- VISIBILITY_SUBMENU).withText(i18n.t("anyone")));
- registry.add(membersVisibility.get().withVisibility(SocialNetworkVisibility.onlymembers).withParent(
- VISIBILITY_SUBMENU).withText(i18n.t("only members")));
- registry.add(membersVisibility.get().withVisibility(SocialNetworkVisibility.onlyadmins).withParent(
- VISIBILITY_SUBMENU).withText(i18n.t("only admins")));
- registry.add(membersModeration.get().withModeration(AdmissionType.Moderated).withParent(MODERATION_SUBMENU).withText(
- i18n.t("moderate request to join")));
- registry.add(membersModeration.get().withModeration(AdmissionType.Open).withParent(MODERATION_SUBMENU).withText(
- i18n.t("auto accept request to join")));
- // registry.add(membersModeration.get().withModeration(AdmissionType.Closed).withParent(MODERATION_SUBMENU).withText(
+ registry.add(anyoneItem.withParent(VISIBILITY_SUBMENU).withText(i18n.t("anyone")));
+ registry.add(onlyMembersItem.withParent(VISIBILITY_SUBMENU).withText(i18n.t("only members")));
+ registry.add(onlyAdminsItem.withParent(VISIBILITY_SUBMENU).withText(i18n.t("only admins")));
+ registry.add(moderatedItem.withParent(MODERATION_SUBMENU).withText(i18n.t("moderate request to join")));
+ registry.add(openItem.withParent(MODERATION_SUBMENU).withText(i18n.t("auto accept request to join")));
+ // registry.add(closedItem.withParent(MODERATION_SUBMENU).withText(
// i18n.t("closed for new members")));
- registry.add(new ButtonDescriptor(joinGroupAction).withStyles("k-no-backimage"));
- registry.add(new ButtonDescriptor(unJoinGroupAction).withStyles("k-no-backimage"));
+ final ButtonDescriptor joinBtn = new ButtonDescriptor(joinGroupAction);
+ final ButtonDescriptor unJoinBtn = new ButtonDescriptor(unJoinGroupAction);
+ registry.add(joinBtn.withStyles("k-no-backimage"));
+ registry.add(unJoinBtn.withStyles("k-no-backimage"));
stateManager.onStateChanged(true, new StateChangedHandler() {
@Override
@@ -54,6 +63,32 @@
final boolean administrable = event.getState().getGroupRights().isAdministrable();
OPTIONS_MENU.setVisible(administrable);
OPTIONS_MENU.setEnabled(administrable);
+ final StateAbstractDTO state = event.getState();
+ final GroupDTO currentGroup = state.getGroup();
+ if (currentGroup.isNotPersonal()) {
+ switch (state.getSocialNetworkData().getSocialNetworkVisibility()) {
+ case anyone:
+ anyoneItem.setChecked(true);
+ break;
+ case onlyadmins:
+ onlyAdminsItem.setChecked(true);
+ break;
+ case onlymembers:
+ onlyMembersItem.setChecked(true);
+ break;
+ }
+ }
+ switch (currentGroup.getAdmissionType()) {
+ case Moderated:
+ moderatedItem.setChecked(true);
+ break;
+ case Open:
+ openItem.setChecked(true);
+ break;
+ case Closed:
+ closedItem.setChecked(true);
+ break;
+ }
}
});
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/RolAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/RolAction.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/RolAction.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -1,6 +1,5 @@
package cc.kune.core.client.sn.actions;
-
import cc.kune.common.client.actions.AbstractExtendedAction;
import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
import cc.kune.core.client.resources.CoreResources;
@@ -32,8 +31,7 @@
this.session = session;
this.i18n = i18n;
this.snServiceProvider = snServiceProvider;
- rightsManager.onRightsChanged(new AccessRightsChangedHandler() {
-
+ rightsManager.onRightsChanged(true, new AccessRightsChangedHandler() {
@Override
public void onAccessRightsChanged(final AccessRightsChangedEvent event) {
refreshStatus(rolRequired, authNeed, session.isLogged(), visibleForMembers, visibleForNonMemb,
@@ -61,5 +59,7 @@
}
setEnabled(newEnabled);
putValue(GuiActionDescrip.VISIBLE, newVisibility);
+ // NotifyUser.info("Set '" + getValue(Action.NAME) + "' visible: " +
+ // newVisibility, true);
}
}
Added: trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsLoggedCondition.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsLoggedCondition.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsLoggedCondition.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -0,0 +1,24 @@
+package cc.kune.core.client.sn.actions.conditions;
+
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
+import cc.kune.common.client.actions.ui.descrip.GuiAddCondition;
+import cc.kune.core.client.state.Session;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+ at Singleton
+public class IsLoggedCondition implements GuiAddCondition {
+
+ private final Session session;
+
+ @Inject
+ public IsLoggedCondition(final Session session) {
+ this.session = session;
+ }
+
+ @Override
+ public boolean mustBeAdded(final GuiActionDescrip descr) {
+ return (session.isLogged());
+ }
+}
Added: trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsMeCondition.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsMeCondition.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsMeCondition.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -0,0 +1,26 @@
+package cc.kune.core.client.sn.actions.conditions;
+
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
+import cc.kune.common.client.actions.ui.descrip.GuiAddCondition;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.shared.dto.GroupDTO;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+ at Singleton
+public class IsMeCondition implements GuiAddCondition {
+
+ private final Session session;
+
+ @Inject
+ public IsMeCondition(final Session session) {
+ this.session = session;
+ }
+
+ @Override
+ public boolean mustBeAdded(final GuiActionDescrip descr) {
+ return (session.isLogged() && session.getCurrentUser().getShortName().equals(
+ ((GroupDTO) descr.getTarget()).getShortName()));
+ }
+}
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsNotMeCondition.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsNotMeCondition.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsNotMeCondition.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -20,7 +20,7 @@
@Override
public boolean mustBeAdded(final GuiActionDescrip descr) {
- return (session.isLogged() && !session.getCurrentUser().getShortName().equals(
- ((GroupDTO) descr.getTarget()).getShortName()));
+ return (session.isNotLogged() || (session.isLogged() && !session.getCurrentUser().getShortName().equals(
+ ((GroupDTO) descr.getTarget()).getShortName())));
}
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/registry/SNAdminsMenuItemsRegistry.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/registry/SNAdminsMenuItemsRegistry.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/registry/SNAdminsMenuItemsRegistry.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -7,9 +7,12 @@
import cc.kune.core.client.sn.actions.DenyJoinGroupAction;
import cc.kune.core.client.sn.actions.GotoGroupAction;
import cc.kune.core.client.sn.actions.GotoMemberAction;
+import cc.kune.core.client.sn.actions.GotoYourHomePageAction;
import cc.kune.core.client.sn.actions.RemoveMemberAction;
import cc.kune.core.client.sn.actions.conditions.IsAdministrableCondition;
import cc.kune.core.client.sn.actions.conditions.IsGroupCondition;
+import cc.kune.core.client.sn.actions.conditions.IsLoggedCondition;
+import cc.kune.core.client.sn.actions.conditions.IsMeCondition;
import cc.kune.core.client.sn.actions.conditions.IsNotMeCondition;
import cc.kune.core.client.sn.actions.conditions.IsPersonCondition;
import cc.kune.core.client.state.Session;
@@ -20,18 +23,20 @@
public class SNAdminsMenuItemsRegistry extends AbstractSNMembersActionsRegistry {
@Inject
- public SNAdminsMenuItemsRegistry(final Session session, final IsAdministrableCondition isAdministrableCondition,
- final IsPersonCondition isPersonCondition, final IsGroupCondition isGroupCondition,
- final IsNotMeCondition isNotMe, final ChangeToCollabAction changeToCollabAction,
- final ChangeToAdminAction changeToAdminAction, final RemoveMemberAction removeMemberAction,
- final AcceptJoinGroupAction acceptJoinGroupAction, final DenyJoinGroupAction denyJoinGroupAction,
- final GotoGroupAction gotoGroupAction, final GotoMemberAction gotoMemberAction) {
+ public SNAdminsMenuItemsRegistry(final Session session, final IsLoggedCondition isLogged,
+ final IsAdministrableCondition isAdministrableCondition, final IsPersonCondition isPersonCondition,
+ final IsGroupCondition isGroupCondition, final IsMeCondition isMe, final IsNotMeCondition isNotMe,
+ final ChangeToCollabAction changeToCollabAction, final ChangeToAdminAction changeToAdminAction,
+ final RemoveMemberAction removeMemberAction, final AcceptJoinGroupAction acceptJoinGroupAction,
+ final DenyJoinGroupAction denyJoinGroupAction, final GotoGroupAction gotoGroupAction,
+ final GotoMemberAction gotoMemberAction, final GotoYourHomePageAction gotoYourHomePageAction) {
add(new Provider<MenuItemDescriptor>() {
@Override
public MenuItemDescriptor get() {
final MenuItemDescriptor item = new MenuItemDescriptor(changeToCollabAction);
item.add(isAdministrableCondition);
item.add(isNotMe);
+ item.add(isLogged);
return item;
}
});
@@ -41,6 +46,7 @@
final MenuItemDescriptor item = new MenuItemDescriptor(removeMemberAction);
item.add(isAdministrableCondition);
item.add(isNotMe);
+ item.add(isLogged);
return item;
}
});
@@ -49,12 +55,22 @@
public MenuItemDescriptor get() {
final MenuItemDescriptor item = new MenuItemDescriptor(gotoMemberAction);
item.add(isPersonCondition);
+ item.add(isNotMe);
return item;
}
});
add(new Provider<MenuItemDescriptor>() {
@Override
public MenuItemDescriptor get() {
+ final MenuItemDescriptor item = new MenuItemDescriptor(gotoYourHomePageAction);
+ item.add(isPersonCondition);
+ item.add(isMe);
+ return item;
+ }
+ });
+ add(new Provider<MenuItemDescriptor>() {
+ @Override
+ public MenuItemDescriptor get() {
final MenuItemDescriptor item = new MenuItemDescriptor(gotoGroupAction);
item.add(isGroupCondition);
return item;
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/registry/SNCollabsMenuItemsRegistry.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/registry/SNCollabsMenuItemsRegistry.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/registry/SNCollabsMenuItemsRegistry.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -7,9 +7,11 @@
import cc.kune.core.client.sn.actions.DenyJoinGroupAction;
import cc.kune.core.client.sn.actions.GotoGroupAction;
import cc.kune.core.client.sn.actions.GotoMemberAction;
+import cc.kune.core.client.sn.actions.GotoYourHomePageAction;
import cc.kune.core.client.sn.actions.RemoveMemberAction;
import cc.kune.core.client.sn.actions.conditions.IsAdministrableCondition;
import cc.kune.core.client.sn.actions.conditions.IsGroupCondition;
+import cc.kune.core.client.sn.actions.conditions.IsMeCondition;
import cc.kune.core.client.sn.actions.conditions.IsNotMeCondition;
import cc.kune.core.client.sn.actions.conditions.IsPersonCondition;
import cc.kune.core.client.state.Session;
@@ -22,10 +24,11 @@
@Inject
public SNCollabsMenuItemsRegistry(final Session session, final IsAdministrableCondition isAdministrableCondition,
final IsPersonCondition isPersonCondition, final IsGroupCondition isGroupCondition,
- final IsNotMeCondition isNotMe, final ChangeToCollabAction changeToCollabAction,
+ final IsMeCondition isMe, final IsNotMeCondition isNotMe, final ChangeToCollabAction changeToCollabAction,
final ChangeToAdminAction changeToAdminAction, final RemoveMemberAction removeMemberAction,
final AcceptJoinGroupAction acceptJoinGroupAction, final DenyJoinGroupAction denyJoinGroupAction,
- final GotoGroupAction gotoGroupAction, final GotoMemberAction gotoMemberAction) {
+ final GotoGroupAction gotoGroupAction, final GotoMemberAction gotoMemberAction,
+ final GotoYourHomePageAction gotoYourHomePageAction) {
add(new Provider<MenuItemDescriptor>() {
@Override
public MenuItemDescriptor get() {
@@ -53,6 +56,15 @@
add(new Provider<MenuItemDescriptor>() {
@Override
public MenuItemDescriptor get() {
+ final MenuItemDescriptor item = new MenuItemDescriptor(gotoYourHomePageAction);
+ item.add(isPersonCondition);
+ item.add(isMe);
+ return item;
+ }
+ });
+ add(new Provider<MenuItemDescriptor>() {
+ @Override
+ public MenuItemDescriptor get() {
final MenuItemDescriptor item = new MenuItemDescriptor(gotoGroupAction);
item.add(isGroupCondition);
return item;
Modified: trunk/src/main/java/cc/kune/core/client/state/AccessRightsClientManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/AccessRightsClientManager.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/core/client/state/AccessRightsClientManager.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -21,6 +21,7 @@
import cc.kune.core.client.state.StateChangedEvent.StateChangedHandler;
import cc.kune.core.shared.domain.utils.AccessRights;
+import cc.kune.core.shared.dto.StateAbstractDTO;
import com.google.gwt.event.shared.EventBus;
import com.google.inject.Inject;
@@ -28,16 +29,19 @@
public class AccessRightsClientManager {
private final EventBus eventBus;
private AccessRights previousRights;
+ private final Session session;
@Inject
- public AccessRightsClientManager(final EventBus eventBus, final StateManager stateManager) {
+ public AccessRightsClientManager(final EventBus eventBus, final StateManager stateManager, final Session session) {
this.eventBus = eventBus;
+ this.session = session;
this.previousRights = null;
stateManager.onStateChanged(true, new StateChangedHandler() {
-
@Override
public void onStateChanged(final StateChangedEvent event) {
final AccessRights rights = event.getState().getGroupRights();
+ // NotifyUser.info("prev rights " + previousRights +
+ // " new rights: " + rights);
if (!rights.equals(previousRights)) {
AccessRightsChangedEvent.fire(eventBus, previousRights, rights);
previousRights = rights;
@@ -47,7 +51,11 @@
});
}
- public void onRightsChanged(final AccessRightsChangedEvent.AccessRightsChangedHandler handler) {
+ public void onRightsChanged(final boolean fireNow, final AccessRightsChangedEvent.AccessRightsChangedHandler handler) {
eventBus.addHandler(AccessRightsChangedEvent.getType(), handler);
+ final StateAbstractDTO currentState = session.getCurrentState();
+ if (fireNow && currentState != null) {
+ handler.onAccessRightsChanged(new AccessRightsChangedEvent(previousRights, currentState.getGroupRights()));
+ }
}
}
Modified: trunk/src/main/java/cc/kune/core/client/state/SiteTokenListeners.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/SiteTokenListeners.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/core/client/state/SiteTokenListeners.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -62,7 +62,7 @@
stateManager.get().addSiteToken(SiteCommonTokens.SIGNIN, new HistoryTokenCallback() {
@Override
public void onHistoryToken() {
- signIn.get().doSignIn();
+ signIn.get().showSignInDialog();
}
});
stateManager.get().addSiteToken(SiteCommonTokens.REGISTER, new HistoryTokenCallback() {
Modified: trunk/src/main/java/cc/kune/core/client/state/StateManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/StateManager.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/core/client/state/StateManager.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -37,16 +37,16 @@
void gotoToken(String newToken);
- void onGroupChanged(GroupChangedEvent.GroupChangedHandler handler);
+ void onGroupChanged(boolean fireNow, GroupChangedEvent.GroupChangedHandler handler);
@Deprecated
void onGroupChanged(Listener2<String, String> listener);
+ void onSocialNetworkChanged(boolean fireNow, SocialNetworkChangedEvent.SocialNetworkChangedHandler handler);
+
@Deprecated
void onSocialNetworkChanged(Listener<StateAbstractDTO> listener);
- void onSocialNetworkChanged(SocialNetworkChangedEvent.SocialNetworkChangedHandler handler);
-
/**
* @param fireNow
* if true, fire handler with current state
Modified: trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -98,7 +98,7 @@
}
private void checkGroupAndToolChange(final StateAbstractDTO newState) {
- final String previousGroup = previousToken == null ? "" : previousToken.getGroup();
+ final String previousGroup = getPreviousGroup();
final String newGroup = newState.getStateToken().getGroup();
final String previousTokenTool = previousToken == null ? "" : previousToken.getTool();
final String newTokenTool = newState.getStateToken().getTool();
@@ -117,6 +117,11 @@
resumedToken = null;
}
+ private String getPreviousGroup() {
+ final String previousGroup = previousToken == null ? "" : previousToken.getGroup();
+ return previousGroup;
+ }
+
@Override
public void gotoToken(final StateToken newToken) {
Log.debug("StateManager: history goto-token newItem (" + newToken + ")");
@@ -130,8 +135,13 @@
}
@Override
- public void onGroupChanged(final GroupChangedHandler handler) {
+ public void onGroupChanged(final boolean fireNow, final GroupChangedHandler handler) {
eventBus.addHandler(GroupChangedEvent.getType(), handler);
+ final StateAbstractDTO currentState = session.getCurrentState();
+ if (fireNow && currentState != null) {
+ handler.onGroupChanged(new GroupChangedEvent(getPreviousGroup(), currentState.getStateToken().getGroup()));
+ }
+
}
@Override
@@ -172,22 +182,25 @@
}
@Override
- public void onSocialNetworkChanged(final Listener<StateAbstractDTO> listener) {
- throw new NotImplementedException();
+ public void onSocialNetworkChanged(final boolean fireNow, final SocialNetworkChangedHandler handler) {
+ eventBus.addHandler(SocialNetworkChangedEvent.getType(), handler);
+ final StateAbstractDTO currentState = session.getCurrentState();
+ if (fireNow && currentState != null) {
+ handler.onSocialNetworkChanged(new SocialNetworkChangedEvent(currentState));
+ }
}
@Override
- public void onSocialNetworkChanged(final SocialNetworkChangedHandler handler) {
- eventBus.addHandler(SocialNetworkChangedEvent.getType(), handler);
+ public void onSocialNetworkChanged(final Listener<StateAbstractDTO> listener) {
+ throw new NotImplementedException();
}
@Override
public void onStateChanged(final boolean fireNow, final StateChangedHandler handler) {
eventBus.addHandler(StateChangedEvent.getType(), handler);
- if (fireNow) {
- if (session.getCurrentState() != null) {
- handler.onStateChanged(new StateChangedEvent(session.getCurrentState()));
- }
+ final StateAbstractDTO currentState = session.getCurrentState();
+ if (fireNow && currentState != null) {
+ handler.onStateChanged(new StateChangedEvent(currentState));
}
}
@@ -219,6 +232,7 @@
*/
@Override
public void reload() {
+ Log.info("Reloading state");
onHistoryChanged(history.getToken());
}
Modified: trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPresenter.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPresenter.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -77,7 +77,7 @@
final StateManager stateManager, final Session session) {
super(eventBus, view, proxy);
this.session = session;
- stateManager.onGroupChanged(new GroupChangedHandler() {
+ stateManager.onGroupChanged(true, new GroupChangedHandler() {
@Override
public void onGroupChanged(final GroupChangedEvent event) {
setGroupLogo(session.getCurrentState().getGroup());
Modified: trunk/src/main/java/cc/kune/core/shared/dto/GroupDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/GroupDTO.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/core/shared/dto/GroupDTO.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -26,17 +26,17 @@
public class GroupDTO implements IsSerializable {
- private Long id;
- private String shortName;
- private String longName;
- private GroupType groupType;
+ AdmissionType admissionType;
private ContentSimpleDTO defaultContent;
+ private LicenseDTO defaultLicense;
private ContentSimpleDTO groupBackImage;
- private LicenseDTO defaultLicense;
- private String workspaceTheme;
+ private GroupType groupType;
private boolean hasLogo;
+ private Long id;
+ private String longName;
+ private String shortName;
private StateToken stateToken;
- AdmissionType admissionType;
+ private String workspaceTheme;
public GroupDTO() {
this(null, null, GroupType.ORGANIZATION);
@@ -133,6 +133,10 @@
return getHasLogo();
}
+ public boolean isNotPersonal() {
+ return !isPersonal();
+ }
+
public boolean isPersonal() {
return groupType.equals(GroupType.PERSONAL);
}
Modified: trunk/src/main/java/cc/kune/wave/client/WaveClientSimpleAuthenticator.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WaveClientSimpleAuthenticator.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/cc/kune/wave/client/WaveClientSimpleAuthenticator.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -1,9 +1,6 @@
package cc.kune.wave.client;
-import cc.kune.common.client.log.Log;
import cc.kune.common.client.noti.NotifyUser;
-import cc.kune.common.client.utils.SimpleCallback;
-import cc.kune.common.client.utils.WindowUtils;
import cc.kune.gspace.client.WsArmor;
import com.google.gwt.http.client.Request;
@@ -12,7 +9,8 @@
import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.Response;
import com.google.gwt.http.client.URL;
-import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
+import com.google.gwt.user.client.Cookies;
+import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.inject.Inject;
public class WaveClientSimpleAuthenticator {
@@ -24,7 +22,7 @@
this.wsArmor = wsArmor;
}
- public void doLogin(final String userWithoutDomain, final String passwd, final SimpleCallback callback) {
+ public void doLogin(final String userWithoutDomain, final String passwd, final AsyncCallback<Void> callback) {
final RequestBuilder request = new RequestBuilder(RequestBuilder.POST, "/auth/signin");
final StringBuffer params = new StringBuffer();
params.append("address=");
@@ -39,25 +37,25 @@
@Override
public void onError(final Request request, final Throwable exception) {
NotifyUser.error(exception.getStackTrace().toString(), true);
- callback.onCancel();
+ callback.onFailure(exception);
}
@Override
public void onResponseReceived(final Request request, final Response response) {
- final String url = WindowUtils.getLocation().getHost() + "/";
- Log.debug("Wave client url: " + url);
- callback.onSuccess();
- // String token =
- // Cookies.getCookie(JETTY_SESSION_TOKEN_NAME);
- final ForIsWidget userSpace = wsArmor.getUserSpace();
- if (userSpace.getWidgetCount() > 0) {
- userSpace.remove(0);
- }
- userSpace.add(new WebClient());
+ callback.onSuccess(null);
+ // final ForIsWidget userSpace = wsArmor.getUserSpace();
+ // if (userSpace.getWidgetCount() > 0) {
+ // userSpace.remove(0);
+ // }
+ // userSpace.add(new WebClient());
}
});
} catch (final RequestException e) {
NotifyUser.error(e.getStackTrace().toString(), true);
}
}
+
+ public String getCookieTokenValue() {
+ return Cookies.getCookie("JSESSIONID");
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/auth/AuthenticatedMethodInterceptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/auth/AuthenticatedMethodInterceptor.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/auth/AuthenticatedMethodInterceptor.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -38,14 +38,15 @@
public static final Log LOG = LogFactory.getLog(AuthenticatedMethodInterceptor.class);
@Inject
- Provider<UserSession> userSessionProvider;
-
- @Inject
Provider<HttpServletRequest> requestProvider;
@Inject
Provider<SessionService> sessionServiceProvider;
+ @Inject
+ Provider<UserSession> userSessionProvider;
+
+ @Override
public Object invoke(final MethodInvocation invocation) throws Throwable {
final Object[] arguments = invocation.getArguments();
// Some browsers getCookie returns "null" as String instead of null
@@ -55,28 +56,29 @@
LOG.info("Userhash received: " + userHash);
LOG.info("--------------------------------------------------------------------------------");
final UserSession userSession = userSessionProvider.get();
- final SessionService sessionService = sessionServiceProvider.get();
+ // final SessionService sessionService = sessionServiceProvider.get();
final Authenticated authAnnotation = invocation.getStaticPart().getAnnotation(Authenticated.class);
final boolean mandatory = authAnnotation.mandatory();
if (userHash == null && mandatory) {
- sessionService.getNewSession();
+ // sessionService.getNewSession();
throw new UserMustBeLoggedException();
} else if (userSession.isUserNotLoggedIn() && mandatory) {
- sessionService.getNewSession();
+ // sessionService.getNewSession();
LOG.info("Session expired (not logged in server and mandatory)");
throw new SessionExpiredException();
} else if (userSession.isUserNotLoggedIn() && userHash == null) {
// Ok, do nothing
} else if (userSession.isUserNotLoggedIn() && userHash != null) {
- sessionService.getNewSession();
+ // sessionService.getNewSession();
LOG.info("Session expired (not logged in server)");
throw new SessionExpiredException();
} else if (!userSession.getHash().equals(userHash)) {
+ final String serverHash = userSession.getHash();
userSession.logout();
- sessionService.getNewSession();
- LOG.info("Session expired (userHash different in server)");
+ // sessionService.getNewSession();
+ LOG.info("Session expired (userHash: " + userHash + " different from server hash: " + serverHash + ")");
throw new SessionExpiredException();
}
final Object result = invocation.proceed();
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/auth/SessionServiceDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/auth/SessionServiceDefault.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/auth/SessionServiceDefault.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -22,13 +22,12 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
-import cc.kune.core.client.state.Session;
-
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
@Singleton
+ at Deprecated
public class SessionServiceDefault implements SessionService {
private final Provider<HttpServletRequest> requestProvider;
@@ -38,23 +37,18 @@
this.requestProvider = requestProvider;
}
+ @Override
+ @Deprecated
public void getNewSession() {
- HttpSession session = getSession();
- if (session != null) {
- // During tests session == null
- session.invalidate();
- }
- getSession(true);
+ // HttpSession session = getSession();
+ // if (session != null) {
+ // // During tests session == null
+ // session.invalidate();
+ // }
+ // getSession(true);
setSessionExpiration();
}
- public void setSessionExpiration() {
- HttpSession session = getSession();
- if (session != null) {
- session.setMaxInactiveInterval(Session.SESSION_DURATION / 1000);
- }
- }
-
private HttpSession getSession() {
return requestProvider.get().getSession();
}
@@ -63,4 +57,13 @@
return requestProvider.get().getSession(create);
}
+ @Override
+ @Deprecated
+ public void setSessionExpiration() {
+ // HttpSession session = getSession();
+ // if (session != null) {
+ // session.setMaxInactiveInterval(Session.SESSION_DURATION / 1000);
+ // }
+ }
+
}
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 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/UserRPC.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -19,8 +19,6 @@
*/
package org.ourproject.kune.platf.server.rpc;
-import java.util.UUID;
-
import org.jivesoftware.smack.util.Base64;
import org.ourproject.kune.platf.server.UserSession;
import org.ourproject.kune.platf.server.auth.ActionLevel;
@@ -75,12 +73,11 @@
@Override
@Transactional(rollbackOn = DefaultException.class)
- public UserInfoDTO createUser(final UserDTO userDTO, final boolean wantPersonalHomepage) throws DefaultException {
+ public void createUser(final UserDTO userDTO, final boolean wantPersonalHomepage) throws DefaultException {
final User user = userManager.createUser(userDTO.getShortName(), userDTO.getName(), userDTO.getEmail(),
userDTO.getPassword(), userDTO.getLanguage().getCode(), userDTO.getCountry().getCode(),
userDTO.getTimezone().getId());
groupManager.createUserGroup(user, wantPersonalHomepage);
- return login(userDTO.getShortName(), userDTO.getPassword());
}
@Override
@@ -112,17 +109,18 @@
@Override
@Transactional
- public UserInfoDTO login(final String nickOrEmail, final String passwd) throws DefaultException {
- final SessionService sessionService = sessionServiceProvider.get();
- sessionService.getNewSession();
+ public UserInfoDTO login(final String nickOrEmail, final String passwd, final String waveToken)
+ throws DefaultException {
+ // final SessionService sessionService = sessionServiceProvider.get();
+ // sessionService.getNewSession();
final User user = userManager.login(nickOrEmail, passwd);
- return loginUser(user);
+ return loginUser(user, waveToken);
}
- private UserInfoDTO loginUser(final User user) throws DefaultException {
+ private UserInfoDTO loginUser(final User user, final String waveToken) throws DefaultException {
if (user != null) {
// Maybe use terracotta.org for http session clustering
- getUserSession().login(user, UUID.randomUUID().toString());
+ getUserSession().login(user, waveToken);
return loadUserInfo(user);
} else {
throw new UserAuthException();
@@ -134,8 +132,9 @@
@Transactional
public void logout(final String userHash) throws DefaultException {
getUserSession().logout();
- final SessionService sessionService = sessionServiceProvider.get();
- sessionService.getNewSession();
+ // FIXME final SessionService sessionService =
+ // sessionServiceProvider.get();
+ // FIXME sessionService.getNewSession();
};
@Override
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -953,7 +953,7 @@
@Override
public void onHistoryToken() {
- i(SignIn.class).doSignIn();
+ i(SignIn.class).showSignInDialog();
}
});
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTest.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTest.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -19,6 +19,10 @@
*/
package org.ourproject.kune.platf.integration;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.IOException;
+
import org.ourproject.kune.platf.server.UserSession;
import org.ourproject.kune.platf.server.properties.DatabaseProperties;
@@ -33,15 +37,18 @@
DatabaseProperties properties;
@Inject
protected UserSession session;
+ protected String token;
@Inject
UserService userService;
- protected String doLogin() throws DefaultException {
- return userService.login(getSiteAdminShortName(), properties.getAdminPassword()).getUserHash();
+ protected String doLogin() throws DefaultException, IOException {
+ waveLogin();
+ return userService.login(getSiteAdminShortName(), properties.getAdminPassword(), token).getUserHash();
}
- protected String doLoginWithDummyUser() throws DefaultException {
- return userService.login("dummy", properties.getAdminPassword()).getUserHash();
+ protected String doLoginWithDummyUser() throws DefaultException, IOException {
+ waveLogin();
+ return userService.login("dummy", properties.getAdminPassword(), token).getUserHash();
}
protected void doLogout() throws DefaultException {
@@ -64,4 +71,16 @@
return properties.getAdminShortName();
}
+ protected void waveLogin() throws IOException {
+ token = "somesampletoken";
+ // final ClientAuthenticator authenticator = new
+ // ClientAuthenticator("http://localhost:8080"
+ // + SessionManager.SIGN_IN_URL);
+ // final HttpCookie cookie =
+ // authenticator.authenticate("admin at localhost",
+ // "easyeasy".toCharArray());
+ // token = cookie.getValue();
+ assertNotNull(token);
+ }
+
}
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 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/site/UserServiceTest.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -115,14 +115,14 @@
@Test
public void testSiteEmailLogin() throws Exception {
assertNull(session.getUser().getId());
- userService.login(properties.getAdminEmail(), properties.getAdminPassword());
+ userService.login(properties.getAdminEmail(), properties.getAdminPassword(), token);
assertNotNull(session.getUser().getId());
}
@Test
public void testSiteNameLogin() throws Exception {
assertNull(session.getUser().getId());
- userService.login(properties.getAdminShortName(), properties.getAdminPassword());
+ userService.login(properties.getAdminShortName(), properties.getAdminPassword(), token);
assertNotNull(session.getUser().getId());
}
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/PersistenceTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/PersistenceTest.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/PersistenceTest.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -84,7 +84,10 @@
}
public void rollbackTransaction() {
- getManager().getTransaction().rollback();
+ final EntityTransaction transaction = getManager().getTransaction();
+ if (transaction.isActive()) {
+ transaction.rollback();
+ }
}
}
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/manager/impl/AbstractSocialNetworkManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/manager/impl/AbstractSocialNetworkManagerTest.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/manager/impl/AbstractSocialNetworkManagerTest.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -21,6 +21,7 @@
import static org.junit.Assert.assertEquals;
+import org.junit.After;
import org.junit.Before;
import org.ourproject.kune.platf.server.PersistenceTest;
import org.ourproject.kune.testhelper.ctx.DomainContext;
@@ -65,4 +66,9 @@
otherUser = ctx.getUser("otheruser");
assertSocialNetworkIsEmpty();
}
+
+ @After
+ public void rollback() {
+ rollbackTransaction();
+ }
}
\ No newline at end of file
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerMoreTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerMoreTest.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerMoreTest.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -93,7 +93,6 @@
final SocialNetworkRequestResult result = socialNetworkManager.requestToJoin(user, group);
assertEquals(result, SocialNetworkRequestResult.denied);
- rollbackTransaction();
}
@Test
@@ -103,7 +102,6 @@
final SocialNetworkRequestResult result = socialNetworkManager.requestToJoin(user, group);
assertEquals(result, SocialNetworkRequestResult.moderated);
assertTrue(group.getSocialNetwork().getPendingCollaborators().getList().contains(userGroup));
- rollbackTransaction();
}
@Test
@@ -114,7 +112,6 @@
assertEquals(result, SocialNetworkRequestResult.accepted);
assertTrue(group.getSocialNetwork().getAccessLists().getEditors().getList().contains(userGroup));
assertEquals(group.getSocialNetwork().getAccessLists().getEditors().getMode(), GroupListMode.NORMAL);
- rollbackTransaction();
}
@Test
@@ -127,7 +124,6 @@
assertEquals(orphanedGroup.getSocialNetwork().getAccessLists().getAdmins().getMode(), GroupListMode.NORMAL);
// FIXME Check change group type to PROJECT
- rollbackTransaction();
}
@Test(expected = AlreadyGroupMemberException.class)
@@ -146,7 +142,6 @@
socialNetworkManager.requestToJoin(user, group);
socialNetworkManager.requestToJoin(user, group);
assertEquals(group.getSocialNetwork().getPendingCollaborators().getList().size(), 1);
- rollbackTransaction();
}
@Test(expected = Exception.class)
@@ -172,7 +167,6 @@
assertEquals(group.getSocialNetwork().getAccessLists().getEditors().getList().size(), 1);
assertEquals(group.getSocialNetwork().getAccessLists().getEditors().getMode(), GroupListMode.NORMAL);
assertEquals(group.getSocialNetwork().getPendingCollaborators().getList().size(), 0);
- rollbackTransaction();
}
@Test(expected = AccessViolationException.class)
@@ -205,7 +199,6 @@
assertEquals(group.getSocialNetwork().getAccessLists().getEditors().getList().size(), 0);
assertEquals(group.getSocialNetwork().getAccessLists().getEditors().getMode(), GroupListMode.NOBODY);
assertEquals(group.getSocialNetwork().getPendingCollaborators().getList().size(), 0);
- rollbackTransaction();
}
@Test(expected = AccessViolationException.class)
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerTest.java 2011-02-28 12:14:26 UTC (rev 1266)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerTest.java 2011-03-02 01:14:27 UTC (rev 1267)
@@ -23,7 +23,6 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import org.junit.After;
import org.junit.Test;
import cc.kune.core.client.errors.AccessViolationException;
@@ -47,7 +46,6 @@
assertEquals(group.getSocialNetwork().getAccessLists().getEditors().getList().size(), 1);
assertEquals(group.getSocialNetwork().getAccessLists().getEditors().getMode(), GroupListMode.NORMAL);
assertEquals(group.getSocialNetwork().getPendingCollaborators().getList().size(), 0);
- closeTransaction();
}
@Test(expected = Exception.class)
@@ -90,7 +88,6 @@
socialNetworkManager.requestToJoin(user, group);
socialNetworkManager.addGroupToCollabs(admin, userGroup, group);
assertEquals(group.getSocialNetwork().getPendingCollaborators().getList().size(), 0);
- closeTransaction();
}
@Test
@@ -99,7 +96,6 @@
socialNetworkManager.requestToJoin(user, group);
socialNetworkManager.addGroupToAdmins(admin, userGroup, group);
assertEquals(group.getSocialNetwork().getPendingCollaborators().getList().size(), 0);
- closeTransaction();
}
@Test(expected = Exception.class)
@@ -107,13 +103,6 @@
socialNetworkManager.addGroupToViewers(otherUser, userGroup, group);
}
- @After
- public void close() {
- if (getTransaction().isActive()) {
- rollbackTransaction();
- }
- }
-
@Test
public void deleteMember() throws Exception {
socialNetworkManager.addAdmin(admin, group);
@@ -126,7 +115,6 @@
assertEquals(group.getSocialNetwork().getAccessLists().getEditors().getMode(), GroupListMode.NOBODY);
assertEquals(group.getSocialNetwork().getAccessLists().getEditors().getList().size(), 0);
assertEquals(group.getSocialNetwork().getPendingCollaborators().getList().size(), 0);
- closeTransaction();
}
@Test(expected = Exception.class)
@@ -145,7 +133,6 @@
assertFalse(group.getSocialNetwork().getAccessLists().getEditors().getList().contains(userGroup));
assertEquals(group.getSocialNetwork().getAccessLists().getEditors().getList().size(), 0);
assertEquals(group.getSocialNetwork().getPendingCollaborators().getList().size(), 0);
- closeTransaction();
}
@Test(expected = AccessViolationException.class)
More information about the kune-commits
mailing list