[kune-commits] r1450 - in trunk/src/main: java/cc/kune/core/client/rpcservices java/cc/kune/core/client/sn/actions java/cc/kune/core/client/sn/actions/conditions java/cc/kune/core/client/sn/actions/registry java/cc/kune/core/public java/cc/kune/core/server/rpc webapp/others/splash/js
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Wed Jul 13 14:21:02 CEST 2011
Author: vjrj_
Date: 2011-07-13 14:21:02 +0200 (Wed, 13 Jul 2011)
New Revision: 1450
Added:
trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromCurrentGroupAction.java
trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromThisGroupAction.java
trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/ImPartOfGroupCondition.java
Removed:
trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinGroupAction.java
Modified:
trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetworkService.java
trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetworkServiceAsync.java
trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java
trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNMenuItemsRegistry.java
trunk/src/main/java/cc/kune/core/public/ws.html
trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java
trunk/src/main/webapp/others/splash/js/common_client.js
trunk/src/main/webapp/others/splash/js/permalink_client.js
Log:
gadget render when offline; Unjoin from personal page
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetworkService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetworkService.java 2011-07-13 02:03:09 UTC (rev 1449)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetworkService.java 2011-07-13 12:21:02 UTC (rev 1450)
@@ -30,33 +30,34 @@
@RemoteServiceRelativePath("SocialNetworkService")
public interface SocialNetworkService extends RemoteService {
- SocialNetworkDataDTO acceptJoinGroup(String hash, StateToken groupToken, String groupToAcceptShortName)
- throws DefaultException;
+ SocialNetworkDataDTO acceptJoinGroup(String hash, StateToken groupToken, String groupToAcceptShortName)
+ throws DefaultException;
- SocialNetworkDataDTO addAdminMember(String hash, StateToken groupToken, String groupToAddShortName)
- throws DefaultException;
+ SocialNetworkDataDTO addAdminMember(String hash, StateToken groupToken, String groupToAddShortName)
+ throws DefaultException;
- SocialNetworkDataDTO addCollabMember(String hash, StateToken groupToken, String groupToAddShortName)
- throws DefaultException;
+ SocialNetworkDataDTO addCollabMember(String hash, StateToken groupToken, String groupToAddShortName)
+ throws DefaultException;
- SocialNetworkDataDTO addViewerMember(String hash, StateToken groupToken, String groupToAddShortName)
- throws DefaultException;
+ SocialNetworkDataDTO addViewerMember(String hash, StateToken groupToken, String groupToAddShortName)
+ throws DefaultException;
- SocialNetworkDataDTO deleteMember(String hash, StateToken groupToken, String groupToDeleteShortName)
- throws DefaultException;
+ SocialNetworkDataDTO deleteMember(String hash, StateToken groupToken, String groupToDeleteShortName)
+ throws DefaultException;
- SocialNetworkDataDTO denyJoinGroup(String hash, StateToken groupToken, String groupToDenyShortName)
- throws DefaultException;
+ SocialNetworkDataDTO denyJoinGroup(String hash, StateToken groupToken, String groupToDenyShortName)
+ throws DefaultException;
- SocialNetworkDataDTO getSocialNetwork(String hash, StateToken groupToken) throws DefaultException;
+ SocialNetworkDataDTO getSocialNetwork(String hash, StateToken groupToken) throws DefaultException;
- SocialNetworkRequestResult requestJoinGroup(String hash, StateToken groupToken) throws DefaultException;
+ SocialNetworkRequestResult requestJoinGroup(String hash, StateToken groupToken)
+ throws DefaultException;
- SocialNetworkDataDTO setAdminAsCollab(String hash, StateToken groupToken, String groupToSetCollabShortName)
- throws DefaultException;
+ SocialNetworkDataDTO setAdminAsCollab(String hash, StateToken groupToken,
+ String groupToSetCollabShortName) throws DefaultException;
- SocialNetworkDataDTO setCollabAsAdmin(String hash, StateToken groupToken, String groupToSetAdminShortName)
- throws DefaultException;
+ SocialNetworkDataDTO setCollabAsAdmin(String hash, StateToken groupToken,
+ String groupToSetAdminShortName) throws DefaultException;
- SocialNetworkDataDTO unJoinGroup(String hash, StateToken groupToken) throws DefaultException;
+ void unJoinGroup(String hash, StateToken groupToken) throws DefaultException;
}
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetworkServiceAsync.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetworkServiceAsync.java 2011-07-13 02:03:09 UTC (rev 1449)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetworkServiceAsync.java 2011-07-13 12:21:02 UTC (rev 1450)
@@ -19,7 +19,6 @@
*/
package cc.kune.core.client.rpcservices;
-
import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.SocialNetworkDataDTO;
import cc.kune.core.shared.dto.SocialNetworkRequestResult;
@@ -28,33 +27,34 @@
public interface SocialNetworkServiceAsync {
- void acceptJoinGroup(String hash, StateToken groupToken, String groupToAcceptShortName,
- AsyncCallback<SocialNetworkDataDTO> callback);
+ void acceptJoinGroup(String hash, StateToken groupToken, String groupToAcceptShortName,
+ AsyncCallback<SocialNetworkDataDTO> callback);
- void addAdminMember(String hash, StateToken groupToken, String groupToAddShortName,
- AsyncCallback<SocialNetworkDataDTO> callback);
+ void addAdminMember(String hash, StateToken groupToken, String groupToAddShortName,
+ AsyncCallback<SocialNetworkDataDTO> callback);
- void addCollabMember(String hash, StateToken groupToken, String groupToAddShortName,
- AsyncCallback<SocialNetworkDataDTO> callback);
+ void addCollabMember(String hash, StateToken groupToken, String groupToAddShortName,
+ AsyncCallback<SocialNetworkDataDTO> callback);
- void addViewerMember(String hash, StateToken groupToken, String groupToAddShortName,
- AsyncCallback<SocialNetworkDataDTO> callback);
+ void addViewerMember(String hash, StateToken groupToken, String groupToAddShortName,
+ AsyncCallback<SocialNetworkDataDTO> callback);
- void deleteMember(String hash, StateToken groupToken, String groupToDeleteShortName,
- AsyncCallback<SocialNetworkDataDTO> callback);
+ void deleteMember(String hash, StateToken groupToken, String groupToDeleteShortName,
+ AsyncCallback<SocialNetworkDataDTO> callback);
- void denyJoinGroup(String hash, StateToken groupToken, String groupToDenyShortName,
- AsyncCallback<SocialNetworkDataDTO> callback);
+ void denyJoinGroup(String hash, StateToken groupToken, String groupToDenyShortName,
+ AsyncCallback<SocialNetworkDataDTO> callback);
- void getSocialNetwork(String hash, StateToken groupToken, AsyncCallback<SocialNetworkDataDTO> callback);
+ void getSocialNetwork(String hash, StateToken groupToken, AsyncCallback<SocialNetworkDataDTO> callback);
- void requestJoinGroup(String hash, StateToken groupToken, AsyncCallback<SocialNetworkRequestResult> callback);
+ void requestJoinGroup(String hash, StateToken groupToken,
+ AsyncCallback<SocialNetworkRequestResult> callback);
- void setAdminAsCollab(String hash, StateToken groupToken, String groupToSetCollabShortName,
- AsyncCallback<SocialNetworkDataDTO> callback);
+ void setAdminAsCollab(String hash, StateToken groupToken, String groupToSetCollabShortName,
+ AsyncCallback<SocialNetworkDataDTO> callback);
- void setCollabAsAdmin(String hash, StateToken groupToken, String groupToSetAdminShortName,
- AsyncCallback<SocialNetworkDataDTO> callback);
+ void setCollabAsAdmin(String hash, StateToken groupToken, String groupToSetAdminShortName,
+ AsyncCallback<SocialNetworkDataDTO> callback);
- void unJoinGroup(String hash, StateToken groupToken, AsyncCallback<SocialNetworkDataDTO> callback);
+ void unJoinGroup(String hash, StateToken groupToken, AsyncCallback<Void> callback);
}
Added: trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromCurrentGroupAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromCurrentGroupAction.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromCurrentGroupAction.java 2011-07-13 12:21:02 UTC (rev 1450)
@@ -0,0 +1,73 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.core.client.sn.actions;
+
+import cc.kune.common.client.actions.Action;
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.common.client.utils.OnAcceptCallback;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
+import cc.kune.core.client.rpcservices.SocialNetworkServiceAsync;
+import cc.kune.core.client.state.AccessRightsClientManager;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.dto.AccessRolDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class UnJoinFromCurrentGroupAction extends SNRolAction {
+
+ @Inject
+ public UnJoinFromCurrentGroupAction(final StateManager stateManager, final Session session,
+ final I18nTranslationService i18n, final CoreResources res,
+ final Provider<SocialNetworkServiceAsync> snServiceProvider,
+ final AccessRightsClientManager rightsClientManager) {
+ super(stateManager, session, i18n, res, snServiceProvider, rightsClientManager, AccessRolDTO.Editor,
+ true, false, true);
+ putValue(NAME, i18n.t("Leave this group"));
+ putValue(SHORT_DESCRIPTION, i18n.t("Do not participate anymore in this group"));
+ putValue(Action.SMALL_ICON, res.del());
+ putValue(Action.STYLES, "k-sn-join");
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ NotifyUser.askConfirmation(i18n.t("Leave this group"), i18n.t("Are you sure?"),
+ new OnAcceptCallback() {
+ @Override
+ public void onSuccess() {
+ NotifyUser.showProgressProcessing();
+ snServiceProvider.get().unJoinGroup(session.getUserHash(),
+ session.getCurrentState().getStateToken(), new AsyncCallbackSimple<Void>() {
+ @Override
+ public void onSuccess(final Void result) {
+ NotifyUser.hideProgress();
+ NotifyUser.info(i18n.t("Removed as member"));
+ stateManager.refreshCurrentGroupState();
+ }
+ });
+ }
+ });
+ }
+
+}
\ No newline at end of file
Added: trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromThisGroupAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromThisGroupAction.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromThisGroupAction.java 2011-07-13 12:21:02 UTC (rev 1450)
@@ -0,0 +1,83 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.core.client.sn.actions;
+
+import cc.kune.common.client.actions.Action;
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.common.client.utils.OnAcceptCallback;
+import cc.kune.core.client.actions.RolAction;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
+import cc.kune.core.client.rpcservices.SocialNetworkServiceAsync;
+import cc.kune.core.client.state.AccessRightsClientManager;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.dto.AccessRolDTO;
+import cc.kune.core.shared.dto.GroupDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class UnJoinFromThisGroupAction extends RolAction {
+
+ private final I18nTranslationService i18n;
+ private final Session session;
+ private final Provider<SocialNetworkServiceAsync> snServiceProvider;
+ private final StateManager stateManager;
+
+ @Inject
+ public UnJoinFromThisGroupAction(final StateManager stateManager, final Session session,
+ final I18nTranslationService i18n, final CoreResources res,
+ final Provider<SocialNetworkServiceAsync> snServiceProvider,
+ final AccessRightsClientManager rightsClientManager) {
+ super(AccessRolDTO.Editor, true);
+ this.stateManager = stateManager;
+ this.session = session;
+ this.i18n = i18n;
+ this.snServiceProvider = snServiceProvider;
+ putValue(NAME, i18n.t("Leave this group"));
+ putValue(SHORT_DESCRIPTION, i18n.t("Do not participate anymore in this group"));
+ putValue(Action.SMALL_ICON, res.del());
+ putValue(Action.STYLES, "k-sn-join");
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ NotifyUser.askConfirmation(i18n.t("Leave this group"), i18n.t("Are you sure?"),
+ new OnAcceptCallback() {
+ @Override
+ public void onSuccess() {
+ NotifyUser.showProgressProcessing();
+ snServiceProvider.get().unJoinGroup(session.getUserHash(),
+ ((GroupDTO) event.getTarget()).getStateToken(), new AsyncCallbackSimple<Void>() {
+ @Override
+ public void onSuccess(final Void result) {
+ NotifyUser.hideProgress();
+ NotifyUser.info(i18n.t("Removed as member"));
+ stateManager.refreshCurrentGroupState();
+ }
+ });
+ }
+ });
+ }
+
+}
\ No newline at end of file
Deleted: trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinGroupAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinGroupAction.java 2011-07-13 02:03:09 UTC (rev 1449)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinGroupAction.java 2011-07-13 12:21:02 UTC (rev 1450)
@@ -1,75 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.core.client.sn.actions;
-
-import cc.kune.common.client.actions.Action;
-import cc.kune.common.client.actions.ActionEvent;
-import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.utils.OnAcceptCallback;
-import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
-import cc.kune.core.client.rpcservices.SocialNetworkServiceAsync;
-import cc.kune.core.client.state.AccessRightsClientManager;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.dto.AccessRolDTO;
-import cc.kune.core.shared.dto.SocialNetworkDataDTO;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-
-public class UnJoinGroupAction extends SNRolAction {
-
- @Inject
- public UnJoinGroupAction(final StateManager stateManager, final Session session, final I18nTranslationService i18n,
- final CoreResources res, final Provider<SocialNetworkServiceAsync> snServiceProvider,
- final AccessRightsClientManager rightsClientManager) {
- super(stateManager, session, i18n, res, snServiceProvider, rightsClientManager, AccessRolDTO.Editor, true,
- false, true);
- putValue(NAME, i18n.t("Leave this group"));
- putValue(SHORT_DESCRIPTION, i18n.t("Do not participate anymore in this group"));
- putValue(Action.SMALL_ICON, res.del());
- putValue(Action.STYLES, "k-sn-join");
- }
-
- @Override
- public void actionPerformed(final ActionEvent event) {
- NotifyUser.askConfirmation(i18n.t("Leave this group"), i18n.t("Are you sure?"), new OnAcceptCallback() {
- @Override
- public void onSuccess() {
- NotifyUser.showProgressProcessing();
- snServiceProvider.get().unJoinGroup(session.getUserHash(), session.getCurrentState().getStateToken(),
- new AsyncCallbackSimple<SocialNetworkDataDTO>() {
- @Override
- public void onSuccess(final SocialNetworkDataDTO result) {
- NotifyUser.hideProgress();
- NotifyUser.info(i18n.t("Removed as member"));
- stateManager.refreshCurrentGroupState();
- // in the future with user info:
- // stateManager.reloadSocialNetwork((SocialNetworkResultDTO)
- // result);
- }
- });
- }
- });
- }
-
-}
\ No newline at end of file
Added: trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/ImPartOfGroupCondition.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/ImPartOfGroupCondition.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/ImPartOfGroupCondition.java 2011-07-13 12:21:02 UTC (rev 1450)
@@ -0,0 +1,60 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package 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 cc.kune.core.shared.dto.UserSimpleDTO;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+ at Singleton
+public class ImPartOfGroupCondition implements GuiAddCondition {
+
+ private final Session session;
+
+ @Inject
+ public ImPartOfGroupCondition(final Session session) {
+ this.session = session;
+ }
+
+ @Override
+ public boolean mustBeAdded(final GuiActionDescrip descr) {
+ final Object target = descr.getTarget();
+ if (target instanceof UserSimpleDTO) {
+ return false;
+ }
+ final GroupDTO targetGroup = (GroupDTO) target;
+ for (final GroupDTO adminIn : session.getCurrentUserInfo().getGroupsIsAdmin()) {
+ if (adminIn.equals(targetGroup)) {
+ return true;
+ }
+ }
+ for (final GroupDTO collabIn : session.getCurrentUserInfo().getGroupsIsCollab()) {
+ if (collabIn.equals(targetGroup)) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java 2011-07-13 02:03:09 UTC (rev 1449)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java 2011-07-13 12:21:02 UTC (rev 1450)
@@ -30,7 +30,7 @@
import cc.kune.core.client.sn.actions.JoinGroupAction;
import cc.kune.core.client.sn.actions.MembersModerationMenuItem;
import cc.kune.core.client.sn.actions.MembersVisibilityMenuItem;
-import cc.kune.core.client.sn.actions.UnJoinGroupAction;
+import cc.kune.core.client.sn.actions.UnJoinFromCurrentGroupAction;
import cc.kune.core.client.sn.actions.conditions.IsGroupCondition;
import cc.kune.core.client.sn.actions.conditions.IsLoggedCondition;
import cc.kune.core.client.state.Session;
@@ -66,7 +66,7 @@
final I18nTranslationService i18n, final Provider<MembersVisibilityMenuItem> membersVisibility,
final Provider<MembersModerationMenuItem> membersModeration, final CoreResources res,
final IsLoggedCondition isLoggedCondition, final JoinGroupAction joinGroupAction,
- final IsGroupCondition isGroupCondition, final UnJoinGroupAction unJoinGroupAction) {
+ final IsGroupCondition isGroupCondition, final UnJoinFromCurrentGroupAction unJoinGroupAction) {
OPTIONS_MENU.withToolTip(i18n.t("Options")).withIcon(res.arrowdownsitebar()).withStyles(
OPTIONS_STYLES);
final GuiActionDescrip optionsTitle = new MenuTitleItemDescriptor(i18n.t("Options")).withParent(OPTIONS_MENU);
@@ -132,7 +132,6 @@
closedItem.setChecked(true);
break;
}
- unJoinBtn.setVisible(session.isLogged());
}
});
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNMenuItemsRegistry.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNMenuItemsRegistry.java 2011-07-13 02:03:09 UTC (rev 1449)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNMenuItemsRegistry.java 2011-07-13 12:21:02 UTC (rev 1450)
@@ -28,7 +28,8 @@
import cc.kune.core.client.sn.actions.GotoPersonAction;
import cc.kune.core.client.sn.actions.GotoYourHomePageAction;
import cc.kune.core.client.sn.actions.RemoveMemberAction;
-import cc.kune.core.client.sn.actions.UnJoinGroupAction;
+import cc.kune.core.client.sn.actions.UnJoinFromThisGroupAction;
+import cc.kune.core.client.sn.actions.conditions.ImPartOfGroupCondition;
import cc.kune.core.client.sn.actions.conditions.IsCurrentStateAdministrableCondition;
import cc.kune.core.client.sn.actions.conditions.IsGroupCondition;
import cc.kune.core.client.sn.actions.conditions.IsLoggedCondition;
@@ -47,12 +48,13 @@
public UserSNMenuItemsRegistry(final Session session,
final IsCurrentStateAdministrableCondition isAdministrableCondition,
final IsPersonCondition isPersonCondition, final IsGroupCondition isGroupCondition,
- final IsLoggedCondition isLoggedCondition, 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 GotoPersonAction gotoPersonAction,
- final UnJoinGroupAction unjoinAction, final GotoYourHomePageAction gotoYourHomePageAction) {
+ final ImPartOfGroupCondition imPartOfGroup, final IsLoggedCondition isLoggedCondition,
+ 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 GotoPersonAction gotoPersonAction, final UnJoinFromThisGroupAction unjoinAction,
+ final GotoYourHomePageAction gotoYourHomePageAction) {
add(new Provider<MenuItemDescriptor>() {
@Override
public MenuItemDescriptor get() {
@@ -81,14 +83,15 @@
});
// This doesn't works, because its unregister from current state not
// from target group
- // add(new Provider<MenuItemDescriptor>() {
- // @Override
- // public MenuItemDescriptor get() {
- // final MenuItemDescriptor item = new MenuItemDescriptor(unjoinAction);
- // item.add(isLoggedCondition);
- // item.add(isGroupCondition);
- // return item;
- // }
- // });
+ add(new Provider<MenuItemDescriptor>() {
+ @Override
+ public MenuItemDescriptor get() {
+ final MenuItemDescriptor item = new MenuItemDescriptor(unjoinAction);
+ item.add(isLoggedCondition);
+ item.add(isGroupCondition);
+ item.add(imPartOfGroup);
+ return item;
+ }
+ });
}
}
Modified: trunk/src/main/java/cc/kune/core/public/ws.html
===================================================================
--- trunk/src/main/java/cc/kune/core/public/ws.html 2011-07-13 02:03:09 UTC (rev 1449)
+++ trunk/src/main/java/cc/kune/core/public/ws.html 2011-07-13 12:21:02 UTC (rev 1450)
@@ -58,7 +58,7 @@
<script type="text/javascript" src="/others/splash/js/gadget.js"></script>
<script type="text/javascript" src="/others/splash/js/rpc.js"></script>
<script type="text/javascript" src="/others/splash/js/common_client.js"></script>
-<script type="text/javascript" src="/others/splash/js/permalink_client.js"></script>
+<!-- <script type="text/javascript" src="/others/splash/js/permalink_client.js"></script> -->
<script type="text/javascript" src="http://wave.google.com/gadgets/js/core:rpc.js?c=1"></script>
<style type="text/css">
Modified: trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java 2011-07-13 02:03:09 UTC (rev 1449)
+++ trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java 2011-07-13 12:21:02 UTC (rev 1450)
@@ -220,14 +220,12 @@
@Override
@Authenticated
@Transactional
- public SocialNetworkDataDTO unJoinGroup(final String hash, final StateToken groupToken)
- throws DefaultException {
+ public void unJoinGroup(final String hash, final StateToken groupToken) throws DefaultException {
final UserSession userSession = getUserSession();
final User userLogged = userSession.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
checkIsNotPersonalGroup(group);
socialNetworkManager.unJoinGroup(userLogged.getUserGroup(), group);
- return generateResponse(userLogged, group);
}
}
Modified: trunk/src/main/webapp/others/splash/js/common_client.js
===================================================================
--- trunk/src/main/webapp/others/splash/js/common_client.js 2011-07-13 02:03:09 UTC (rev 1449)
+++ trunk/src/main/webapp/others/splash/js/common_client.js 2011-07-13 12:21:02 UTC (rev 1450)
@@ -125,6 +125,6 @@
}
});
- initEditor();
+ // initEditor();
initGadgetSystem();
}
Modified: trunk/src/main/webapp/others/splash/js/permalink_client.js
===================================================================
--- trunk/src/main/webapp/others/splash/js/permalink_client.js 2011-07-13 02:03:09 UTC (rev 1449)
+++ trunk/src/main/webapp/others/splash/js/permalink_client.js 2011-07-13 12:21:02 UTC (rev 1450)
@@ -96,11 +96,11 @@
var rpc = window.wave.Rpc.getInstance();
initGadgetSystem();
- rpc.rpcOpenWave();
+// rpc.rpcOpenWave();
- setInterval(function() {
+ //setInterval(function() {
// This is needed to specify the scope of the function.
- window.wave.Rpc.getInstance().rpcAsyncUpdate();
- }, RPC_UPDATE_INTERVAL_MS);
+ // window.wave.Rpc.getInstance().rpcAsyncUpdate();
+ //}, RPC_UPDATE_INTERVAL_MS);
});
More information about the kune-commits
mailing list