[kune-commits] r1727 - in trunk/src: main/java/cc/kune/barters/client/actions main/java/cc/kune/blogs/client/actions main/java/cc/kune/chat/client/actions main/java/cc/kune/core/client main/java/cc/kune/core/client/rpcservices main/java/cc/kune/core/client/sn main/java/cc/kune/core/client/sn/actions main/java/cc/kune/core/server main/java/cc/kune/core/server/rpc main/java/cc/kune/docs/client/actions main/java/cc/kune/events/client/actions main/java/cc/kune/gspace/client main/java/cc/kune/gspace/client/actions main/java/cc/kune/lists/client/actions main/java/cc/kune/tasks/client/actions main/java/cc/kune/wiki/client/actions test/java/cc/kune/core/client test/java/cc/kune/core/server/integration/socialnet
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Wed Feb 29 18:55:16 CET 2012
Author: vjrj_
Date: 2012-02-29 18:55:15 +0100 (Wed, 29 Feb 2012)
New Revision: 1727
Added:
trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceHelper.java
trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetService.java
trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetServiceAsync.java
trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetServiceHelper.java
trunk/src/main/java/cc/kune/gspace/client/actions/AddAdminMembersToContentMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/actions/AddAllMembersToContentMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/actions/AddCollabMembersToContentMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/actions/AddMembersToContentAction.java
trunk/src/main/java/cc/kune/gspace/client/actions/AddMembersToContentMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/actions/ContentViewerOptionsShareSubMenu.java
trunk/src/test/java/cc/kune/core/client/rpcservices/
Removed:
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/SocialNetClientUtils.java
Modified:
trunk/src/main/java/cc/kune/barters/client/actions/BartersClientActions.java
trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java
trunk/src/main/java/cc/kune/chat/client/actions/AddAsBuddieHeaderButton.java
trunk/src/main/java/cc/kune/chat/client/actions/AddAsBuddyAction.java
trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
trunk/src/main/java/cc/kune/core/client/sn/AdminsGroupSNDropController.java
trunk/src/main/java/cc/kune/core/client/sn/AllMembersGroupSNDropController.java
trunk/src/main/java/cc/kune/core/client/sn/CollabsGroupSNDropController.java
trunk/src/main/java/cc/kune/core/client/sn/GroupSNDropController.java
trunk/src/main/java/cc/kune/core/client/sn/actions/AcceptJoinGroupAction.java
trunk/src/main/java/cc/kune/core/client/sn/actions/AddEntityToThisGroupAction.java
trunk/src/main/java/cc/kune/core/client/sn/actions/ChangeToAdminAction.java
trunk/src/main/java/cc/kune/core/client/sn/actions/ChangeToCollabAction.java
trunk/src/main/java/cc/kune/core/client/sn/actions/DenyJoinGroupAction.java
trunk/src/main/java/cc/kune/core/client/sn/actions/JoinGroupAction.java
trunk/src/main/java/cc/kune/core/client/sn/actions/RemoveMemberAction.java
trunk/src/main/java/cc/kune/core/client/sn/actions/SNRolAction.java
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/server/KuneRackModule.java
trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java
trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java
trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java
trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java
trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
trunk/src/main/java/cc/kune/lists/client/actions/ListsClientActions.java
trunk/src/main/java/cc/kune/tasks/client/actions/TasksClientActions.java
trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java
trunk/src/test/java/cc/kune/core/server/integration/socialnet/SocialNetworkServiceTest.java
Log:
Menu items to share contents with members
Modified: trunk/src/main/java/cc/kune/barters/client/actions/BartersClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/barters/client/actions/BartersClientActions.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/barters/client/actions/BartersClientActions.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -29,6 +29,9 @@
import cc.kune.core.client.state.StateManager;
import cc.kune.gspace.client.actions.AbstractFoldableToolActions;
import cc.kune.gspace.client.actions.ActionGroups;
+import cc.kune.gspace.client.actions.AddAdminMembersToContentMenuItem;
+import cc.kune.gspace.client.actions.AddAllMembersToContentMenuItem;
+import cc.kune.gspace.client.actions.AddCollabMembersToContentMenuItem;
import cc.kune.gspace.client.actions.ContentViewerOptionsMenu;
import cc.kune.gspace.client.actions.ParticipateInContentBtn;
import cc.kune.gspace.client.actions.RefreshContentMenuItem;
@@ -51,11 +54,17 @@
final Provider<OpenBartersMenuItem> openContentMenuItem,
final Provider<DelBartersMenuItem> delContentMenuItem,
final Provider<ContentViewerOptionsMenu> optionsMenuContent,
+ final Provider<AddAllMembersToContentMenuItem> addAllMenuItem,
+ final Provider<AddAdminMembersToContentMenuItem> addAdminMembersMenuItem,
+ final Provider<AddCollabMembersToContentMenuItem> addCollabMembersMenuItem,
final Provider<TutorialContainerBtn> tutorialBtn,
final Provider<ParticipateInContentBtn> participateBtn,
final Provider<DelFolderMenuItem> delFolderMenuItem, final Provider<RefreshContentMenuItem> refresh) {
super(session, stateManager, i18n, registry);
actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAllMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addCollabMembersMenuItem, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, containers);
@@ -67,6 +76,9 @@
actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, delContentMenuItem, contents);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAllMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
}
@Override
Modified: trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -33,6 +33,9 @@
import cc.kune.core.client.state.StateManager;
import cc.kune.gspace.client.actions.AbstractFoldableToolActions;
import cc.kune.gspace.client.actions.ActionGroups;
+import cc.kune.gspace.client.actions.AddAdminMembersToContentMenuItem;
+import cc.kune.gspace.client.actions.AddAllMembersToContentMenuItem;
+import cc.kune.gspace.client.actions.AddCollabMembersToContentMenuItem;
import cc.kune.gspace.client.actions.ContentViewerOptionsMenu;
import cc.kune.gspace.client.actions.ParticipateInContentBtn;
import cc.kune.gspace.client.actions.RefreshContentMenuItem;
@@ -60,12 +63,18 @@
final Provider<DelPostMenuItem> delContentMenuItem,
final Provider<RefreshContentMenuItem> refresh, final Provider<TutorialContainerBtn> tutorialBtn,
final Provider<ContentViewerOptionsMenu> optionsMenuContent,
+ final Provider<AddAllMembersToContentMenuItem> addAllMenuItem,
+ final Provider<AddAdminMembersToContentMenuItem> addAdminMembersMenuItem,
+ final Provider<AddCollabMembersToContentMenuItem> addCollabMembersMenuItem,
final Provider<ParticipateInContentBtn> participateBtn, final BlogsNewMenu blogNewMenu,
final PostNewMenu postNewMenu, final NewMenusForTypeIdsRegistry newMenusRegistry,
final Provider<ChatAboutContentBtn> chatAbout, final Provider<DelBlogMenuItem> delFolderMenuItem,
final Provider<SetAsHomePageMenuItem> setAsHomePage) {
super(session, stateManager, i18n, registry);
actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAllMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addCollabMembersMenuItem, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, newPostIconBtn, noRoot);
actionsRegistry.addAction(ActionGroups.TOOLBAR, blogNewMenu, containersNoRoot);
actionsRegistry.addAction(ActionGroups.TOOLBAR, postNewMenu, contents);
@@ -81,6 +90,9 @@
actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, delContentMenuItem, contents);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAllMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
newMenusRegistry.register(TYPE_BLOG, blogNewMenu.get());
newMenusRegistry.register(TYPE_POST,
(MenuDescriptor) postNewMenu.get().withText(i18n.t("Add Gadget")));
Modified: trunk/src/main/java/cc/kune/chat/client/actions/AddAsBuddieHeaderButton.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/AddAsBuddieHeaderButton.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/chat/client/actions/AddAsBuddieHeaderButton.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -34,7 +34,7 @@
import cc.kune.core.client.resources.CoreMessages;
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.rpcservices.SocialNetServiceAsync;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
import cc.kune.core.client.ws.entheader.EntityHeader;
@@ -52,13 +52,13 @@
public static class AddAsBuddieHeaderAction extends AbstractExtendedAction {
private final ChatClient chatEngine;
private final Session session;
- private final Provider<SocialNetworkServiceAsync> snService;
+ private final Provider<SocialNetServiceAsync> snService;
@Inject
public AddAsBuddieHeaderAction(final ChatClient chatEngine, final Session session,
final ChatInstances chatInstances, final StateManager stateManager,
final I18nTranslationService i18n, final CoreResources img,
- final Provider<SocialNetworkServiceAsync> snService) {
+ final Provider<SocialNetServiceAsync> snService) {
super();
this.chatEngine = chatEngine;
this.session = session;
Modified: trunk/src/main/java/cc/kune/chat/client/actions/AddAsBuddyAction.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/AddAsBuddyAction.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/chat/client/actions/AddAsBuddyAction.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -28,7 +28,7 @@
import cc.kune.core.client.resources.CoreMessages;
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.rpcservices.SocialNetServiceAsync;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
import cc.kune.core.shared.dto.GroupDTO;
@@ -40,12 +40,12 @@
public class AddAsBuddyAction extends AbstractExtendedAction {
private final ChatClient chatEngine;
private final Session session;
- private final Provider<SocialNetworkServiceAsync> snService;
+ private final Provider<SocialNetServiceAsync> snService;
@Inject
public AddAsBuddyAction(final ChatClient chatEngine, final ChatInstances chatInstances,
final StateManager stateManager, final I18nTranslationService i18n, final CoreResources img,
- final Provider<SocialNetworkServiceAsync> snService, final Session session) {
+ final Provider<SocialNetServiceAsync> snService, final Session session) {
super();
this.chatEngine = chatEngine;
this.snService = snService;
Modified: trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreGinModule.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/core/client/CoreGinModule.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -66,6 +66,8 @@
import cc.kune.core.client.notify.spiner.SpinerViewImpl;
import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
import cc.kune.core.client.registry.NewMenusForTypeIdsRegistry;
+import cc.kune.core.client.rpcservices.ContentServiceHelper;
+import cc.kune.core.client.rpcservices.SocialNetServiceHelper;
import cc.kune.core.client.sitebar.ErrorsDialog;
import cc.kune.core.client.sitebar.SiteUserOptions;
import cc.kune.core.client.sitebar.SiteUserOptionsPresenter;
@@ -85,7 +87,6 @@
import cc.kune.core.client.sn.UserSNPresenter;
import cc.kune.core.client.sn.actions.AddBuddieSearchPanel;
import cc.kune.core.client.sn.actions.AddMemberSearchPanel;
-import cc.kune.core.client.sn.actions.SocialNetClientUtils;
import cc.kune.core.client.sn.actions.registry.GroupSNAdminsMenuItemsRegistry;
import cc.kune.core.client.sn.actions.registry.GroupSNCollabsMenuItemsRegistry;
import cc.kune.core.client.sn.actions.registry.GroupSNConfActions;
@@ -232,8 +233,10 @@
s(UserSNConfActions.class);
s(AddBuddieSearchPanel.class);
s(AddMemberSearchPanel.class);
- s(SocialNetClientUtils.class);
+ s(ContentServiceHelper.class);
+ s(SocialNetServiceHelper.class);
+
s(SiteUserOptionsPresenter.class);
s(SiteUserOptions.class, SiteUserOptionsPresenter.class);
s(SitebarNewGroupLink.class);
Added: trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceHelper.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceHelper.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceHelper.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -0,0 +1,36 @@
+package cc.kune.core.client.rpcservices;
+
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.SocialNetworkSubGroup;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class ContentServiceHelper {
+
+ private final Provider<ContentServiceAsync> contentService;
+ private final I18nTranslationService i18n;
+ private final Session session;
+
+ @Inject
+ public ContentServiceHelper(final Session session, final I18nTranslationService i18n,
+ final Provider<ContentServiceAsync> contentService) {
+ this.session = session;
+ this.i18n = i18n;
+ this.contentService = contentService;
+ }
+
+ public void addParticipants(final StateToken token, final SocialNetworkSubGroup subGroup) {
+ contentService.get().addParticipants(session.getUserHash(), token,
+ session.getCurrentGroupShortName(), subGroup, new AsyncCallbackSimple<Boolean>() {
+ @Override
+ public void onSuccess(final Boolean result) {
+ NotifyUser.info(result ? i18n.t("Shared with members")
+ : i18n.t("All these members are already partipating"));
+ }
+ });
+ }
+}
Copied: trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetService.java (from rev 1717, trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetworkService.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetService.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetService.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -0,0 +1,65 @@
+/*
+ *
+ * Copyright (C) 2007-2009 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.rpcservices;
+
+import cc.kune.core.client.errors.DefaultException;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.SocialNetworkDataDTO;
+import cc.kune.core.shared.dto.SocialNetworkRequestResult;
+
+import com.google.gwt.user.client.rpc.RemoteService;
+import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
+
+ at RemoteServiceRelativePath("SocialNetService")
+public interface SocialNetService extends RemoteService {
+
+ SocialNetworkDataDTO acceptJoinGroup(String hash, StateToken groupToken, String groupToAcceptShortName)
+ throws DefaultException;
+
+ SocialNetworkDataDTO addAdminMember(String hash, StateToken groupToken, String groupToAddShortName)
+ throws DefaultException;
+
+ void addAsBuddie(String hash, String userName) throws DefaultException;
+
+ SocialNetworkDataDTO addCollabMember(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 denyJoinGroup(String hash, StateToken groupToken, String groupToDenyShortName)
+ throws DefaultException;
+
+ SocialNetworkDataDTO getSocialNetwork(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 setCollabAsAdmin(String hash, StateToken groupToken,
+ String groupToSetAdminShortName) throws DefaultException;
+
+ void unJoinGroup(String hash, StateToken groupToken) throws DefaultException;
+}
Copied: trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetServiceAsync.java (from rev 1717, trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetworkServiceAsync.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetServiceAsync.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetServiceAsync.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -0,0 +1,62 @@
+/*
+ *
+ * Copyright (C) 2007-2009 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.rpcservices;
+
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.SocialNetworkDataDTO;
+import cc.kune.core.shared.dto.SocialNetworkRequestResult;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+public interface SocialNetServiceAsync {
+
+ void acceptJoinGroup(String hash, StateToken groupToken, String groupToAcceptShortName,
+ AsyncCallback<SocialNetworkDataDTO> callback);
+
+ void addAdminMember(String hash, StateToken groupToken, String groupToAddShortName,
+ AsyncCallback<SocialNetworkDataDTO> callback);
+
+ void addAsBuddie(String hash, String userName, AsyncCallback<Void> callback);
+
+ void addCollabMember(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 denyJoinGroup(String hash, StateToken groupToken, String groupToDenyShortName,
+ AsyncCallback<SocialNetworkDataDTO> callback);
+
+ void getSocialNetwork(String hash, StateToken groupToken, AsyncCallback<SocialNetworkDataDTO> callback);
+
+ void requestJoinGroup(String hash, StateToken groupToken,
+ AsyncCallback<SocialNetworkRequestResult> callback);
+
+ void setAdminAsCollab(String hash, StateToken groupToken, String groupToSetCollabShortName,
+ AsyncCallback<SocialNetworkDataDTO> callback);
+
+ void setCollabAsAdmin(String hash, StateToken groupToken, String groupToSetAdminShortName,
+ AsyncCallback<SocialNetworkDataDTO> callback);
+
+ void unJoinGroup(String hash, StateToken groupToken, AsyncCallback<Void> callback);
+}
Copied: trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetServiceHelper.java (from rev 1720, trunk/src/main/java/cc/kune/core/client/sn/actions/SocialNetClientUtils.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetServiceHelper.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetServiceHelper.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -0,0 +1,57 @@
+package cc.kune.core.client.rpcservices;
+
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.dto.SocialNetworkDataDTO;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class SocialNetServiceHelper {
+
+ private final I18nTranslationService i18n;
+ private final Session session;
+ private final Provider<SocialNetServiceAsync> snServiceProvider;
+ private final StateManager stateManager;
+
+ @Inject
+ public SocialNetServiceHelper(final StateManager stateManager, final Session session,
+ final I18nTranslationService i18n, final Provider<SocialNetServiceAsync> snServiceProvider) {
+ this.stateManager = stateManager;
+ this.session = session;
+ this.i18n = i18n;
+ this.snServiceProvider = snServiceProvider;
+ }
+
+ public void changeToAdmin(final String shortName) {
+ NotifyUser.showProgress();
+ snServiceProvider.get().setCollabAsAdmin(session.getUserHash(),
+ session.getCurrentState().getStateToken(), shortName,
+ new AsyncCallbackSimple<SocialNetworkDataDTO>() {
+ @Override
+ public void onSuccess(final SocialNetworkDataDTO result) {
+ SocialNetServiceHelper.this.onSuccess(result);
+ }
+ });
+ }
+
+ public void changeToCollab(final String shortName) {
+ NotifyUser.showProgress();
+ snServiceProvider.get().setAdminAsCollab(session.getUserHash(),
+ session.getCurrentState().getStateToken(), shortName,
+ new AsyncCallbackSimple<SocialNetworkDataDTO>() {
+ @Override
+ public void onSuccess(final SocialNetworkDataDTO result) {
+ SocialNetServiceHelper.this.onSuccess(result);
+ }
+ });
+ }
+
+ private void onSuccess(final SocialNetworkDataDTO result) {
+ NotifyUser.hideProgress();
+ NotifyUser.info(i18n.t("Member type changed"));
+ stateManager.setSocialNetwork(result);
+ }
+}
Deleted: trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetworkService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetworkService.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetworkService.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -1,65 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 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.rpcservices;
-
-import cc.kune.core.client.errors.DefaultException;
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.SocialNetworkDataDTO;
-import cc.kune.core.shared.dto.SocialNetworkRequestResult;
-
-import com.google.gwt.user.client.rpc.RemoteService;
-import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
-
- at RemoteServiceRelativePath("SocialNetworkService")
-public interface SocialNetworkService extends RemoteService {
-
- SocialNetworkDataDTO acceptJoinGroup(String hash, StateToken groupToken, String groupToAcceptShortName)
- throws DefaultException;
-
- SocialNetworkDataDTO addAdminMember(String hash, StateToken groupToken, String groupToAddShortName)
- throws DefaultException;
-
- void addAsBuddie(String hash, String userName) throws DefaultException;
-
- SocialNetworkDataDTO addCollabMember(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 denyJoinGroup(String hash, StateToken groupToken, String groupToDenyShortName)
- throws DefaultException;
-
- SocialNetworkDataDTO getSocialNetwork(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 setCollabAsAdmin(String hash, StateToken groupToken,
- String groupToSetAdminShortName) throws DefaultException;
-
- void unJoinGroup(String hash, StateToken groupToken) throws DefaultException;
-}
Deleted: trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetworkServiceAsync.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetworkServiceAsync.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/SocialNetworkServiceAsync.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -1,62 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 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.rpcservices;
-
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.SocialNetworkDataDTO;
-import cc.kune.core.shared.dto.SocialNetworkRequestResult;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-public interface SocialNetworkServiceAsync {
-
- void acceptJoinGroup(String hash, StateToken groupToken, String groupToAcceptShortName,
- AsyncCallback<SocialNetworkDataDTO> callback);
-
- void addAdminMember(String hash, StateToken groupToken, String groupToAddShortName,
- AsyncCallback<SocialNetworkDataDTO> callback);
-
- void addAsBuddie(String hash, String userName, AsyncCallback<Void> callback);
-
- void addCollabMember(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 denyJoinGroup(String hash, StateToken groupToken, String groupToDenyShortName,
- AsyncCallback<SocialNetworkDataDTO> callback);
-
- void getSocialNetwork(String hash, StateToken groupToken, AsyncCallback<SocialNetworkDataDTO> callback);
-
- void requestJoinGroup(String hash, StateToken groupToken,
- AsyncCallback<SocialNetworkRequestResult> callback);
-
- void setAdminAsCollab(String hash, StateToken groupToken, String groupToSetCollabShortName,
- AsyncCallback<SocialNetworkDataDTO> callback);
-
- void setCollabAsAdmin(String hash, StateToken groupToken, String groupToSetAdminShortName,
- AsyncCallback<SocialNetworkDataDTO> callback);
-
- void unJoinGroup(String hash, StateToken groupToken, AsyncCallback<Void> callback);
-}
Modified: trunk/src/main/java/cc/kune/core/client/sn/AdminsGroupSNDropController.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/AdminsGroupSNDropController.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/core/client/sn/AdminsGroupSNDropController.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -2,8 +2,8 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.dnd.KuneDragController;
-import cc.kune.core.client.rpcservices.ContentServiceAsync;
-import cc.kune.core.client.sn.actions.SocialNetClientUtils;
+import cc.kune.core.client.rpcservices.ContentServiceHelper;
+import cc.kune.core.client.rpcservices.SocialNetServiceHelper;
import cc.kune.core.client.state.Session;
import cc.kune.core.shared.dto.SocialNetworkSubGroup;
@@ -13,8 +13,8 @@
@Inject
public AdminsGroupSNDropController(final KuneDragController dragController,
- final ContentServiceAsync contentService, final Session session,
- final I18nTranslationService i18n, final SocialNetClientUtils sNClientUtils) {
+ final ContentServiceHelper contentService, final Session session,
+ final I18nTranslationService i18n, final SocialNetServiceHelper sNClientUtils) {
super(dragController, SocialNetworkSubGroup.admins, contentService, session, i18n, sNClientUtils);
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/AllMembersGroupSNDropController.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/AllMembersGroupSNDropController.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/core/client/sn/AllMembersGroupSNDropController.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -2,8 +2,8 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.dnd.KuneDragController;
-import cc.kune.core.client.rpcservices.ContentServiceAsync;
-import cc.kune.core.client.sn.actions.SocialNetClientUtils;
+import cc.kune.core.client.rpcservices.ContentServiceHelper;
+import cc.kune.core.client.rpcservices.SocialNetServiceHelper;
import cc.kune.core.client.state.Session;
import cc.kune.core.shared.dto.SocialNetworkSubGroup;
@@ -13,8 +13,8 @@
@Inject
public AllMembersGroupSNDropController(final KuneDragController dragController,
- final ContentServiceAsync contentService, final Session session,
- final I18nTranslationService i18n, final SocialNetClientUtils sNClientUtils) {
+ final ContentServiceHelper contentService, final Session session,
+ final I18nTranslationService i18n, final SocialNetServiceHelper sNClientUtils) {
super(dragController, SocialNetworkSubGroup.all, contentService, session, i18n, sNClientUtils);
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/CollabsGroupSNDropController.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/CollabsGroupSNDropController.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/core/client/sn/CollabsGroupSNDropController.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -2,8 +2,8 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.dnd.KuneDragController;
-import cc.kune.core.client.rpcservices.ContentServiceAsync;
-import cc.kune.core.client.sn.actions.SocialNetClientUtils;
+import cc.kune.core.client.rpcservices.ContentServiceHelper;
+import cc.kune.core.client.rpcservices.SocialNetServiceHelper;
import cc.kune.core.client.state.Session;
import cc.kune.core.shared.dto.SocialNetworkSubGroup;
@@ -13,8 +13,8 @@
@Inject
public CollabsGroupSNDropController(final KuneDragController dragController,
- final ContentServiceAsync contentService, final Session session,
- final I18nTranslationService i18n, final SocialNetClientUtils sNClientUtils) {
+ final ContentServiceHelper contentService, final Session session,
+ final I18nTranslationService i18n, final SocialNetServiceHelper sNClientUtils) {
super(dragController, SocialNetworkSubGroup.collabs, contentService, session, i18n, sNClientUtils);
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/GroupSNDropController.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/GroupSNDropController.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/core/client/sn/GroupSNDropController.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -1,12 +1,10 @@
package cc.kune.core.client.sn;
-import cc.kune.common.client.notify.NotifyUser;
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.dnd.AbstractDropController;
import cc.kune.core.client.dnd.KuneDragController;
-import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
-import cc.kune.core.client.rpcservices.ContentServiceAsync;
-import cc.kune.core.client.sn.actions.SocialNetClientUtils;
+import cc.kune.core.client.rpcservices.ContentServiceHelper;
+import cc.kune.core.client.rpcservices.SocialNetServiceHelper;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.ui.BasicDragableThumb;
import cc.kune.core.shared.dto.SocialNetworkSubGroup;
@@ -18,20 +16,19 @@
public class GroupSNDropController extends AbstractDropController {
- private final ContentServiceAsync contentService;
- private final I18nTranslationService i18n;
+ private final ContentServiceHelper contentService;
private final Session session;
- private final SocialNetClientUtils sNClientUtils;
+ private final SocialNetServiceHelper sNClientUtils;
private final SocialNetworkSubGroup subGroup;
public GroupSNDropController(final KuneDragController dragController,
- final SocialNetworkSubGroup subGroup, final ContentServiceAsync contentService,
- final Session session, final I18nTranslationService i18n, final SocialNetClientUtils sNClientUtils) {
+ final SocialNetworkSubGroup subGroup, final ContentServiceHelper contentService,
+ final Session session, final I18nTranslationService i18n,
+ final SocialNetServiceHelper sNClientUtils) {
super(dragController);
this.subGroup = subGroup;
this.contentService = contentService;
this.session = session;
- this.i18n = i18n;
this.sNClientUtils = sNClientUtils;
registerType(FolderItemWidget.class);
registerType(BasicDragableThumb.class);
@@ -40,14 +37,7 @@
@Override
public void onDropAllowed(final Widget widget, final SimpleDropController dropController) {
if (widget instanceof FolderItemWidget) {
- contentService.addParticipants(session.getUserHash(), ((FolderItemWidget) widget).getToken(),
- session.getCurrentGroupShortName(), subGroup, new AsyncCallbackSimple<Boolean>() {
- @Override
- public void onSuccess(final Boolean result) {
- NotifyUser.info(result ? i18n.t("Shared with members")
- : i18n.t("All these members are already partipating"));
- }
- });
+ contentService.addParticipants(((FolderItemWidget) widget).getToken(), subGroup);
}
if (widget instanceof BasicDragableThumb) {
final String shortName = ((BasicDragableThumb) widget).getToken().getGroup();
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/AcceptJoinGroupAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/AcceptJoinGroupAction.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/AcceptJoinGroupAction.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -26,7 +26,7 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
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.rpcservices.SocialNetServiceAsync;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
import cc.kune.core.shared.dto.GroupDTO;
@@ -38,14 +38,14 @@
public class AcceptJoinGroupAction extends AbstractExtendedAction {
private final I18nTranslationService i18n;
private final Session session;
- private final Provider<SocialNetworkServiceAsync> snServiceProvider;
+ private final Provider<SocialNetServiceAsync> snServiceProvider;
private final StateManager stateManager;
@Inject
public AcceptJoinGroupAction(final StateManager stateManager, final Session session,
final I18nTranslationService i18n, final CoreResources res,
- final Provider<SocialNetworkServiceAsync> snServiceProvider) {
+ final Provider<SocialNetServiceAsync> snServiceProvider) {
this.stateManager = stateManager;
this.session = session;
this.i18n = i18n;
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/AddEntityToThisGroupAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/AddEntityToThisGroupAction.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/AddEntityToThisGroupAction.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -26,7 +26,7 @@
import cc.kune.common.shared.utils.SimpleResponseCallback;
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.rpcservices.SocialNetServiceAsync;
import cc.kune.core.client.sitebar.search.OnEntitySelectedInSearch;
import cc.kune.core.client.state.AccessRightsClientManager;
import cc.kune.core.client.state.Session;
@@ -45,7 +45,7 @@
@Inject
public AddEntityToThisGroupAction(final StateManager stateManager, final Session session,
final I18nTranslationService i18n, final CoreResources res,
- final Provider<SocialNetworkServiceAsync> snServiceProvider,
+ final Provider<SocialNetServiceAsync> snServiceProvider,
final AddMemberSearchPanel searchPanel, final AccessRightsClientManager rightsClientManager) {
super(stateManager, session, i18n, res, snServiceProvider, rightsClientManager,
AccessRolDTO.Administrator, true, false, true);
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/ChangeToAdminAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/ChangeToAdminAction.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/ChangeToAdminAction.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -24,16 +24,17 @@
import cc.kune.common.client.actions.ActionEvent;
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.client.rpcservices.SocialNetServiceHelper;
import cc.kune.core.shared.dto.GroupDTO;
import com.google.inject.Inject;
public class ChangeToAdminAction extends AbstractExtendedAction {
- private final SocialNetClientUtils snClientUtils;
+ private final SocialNetServiceHelper snClientUtils;
@Inject
public ChangeToAdminAction(final I18nTranslationService i18n, final CoreResources res,
- final SocialNetClientUtils snClientUtils) {
+ final SocialNetServiceHelper snClientUtils) {
this.snClientUtils = snClientUtils;
putValue(NAME, i18n.t("Change to administrator"));
putValue(Action.SMALL_ICON, res.arrowUpGreen());
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/ChangeToCollabAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/ChangeToCollabAction.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/ChangeToCollabAction.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -24,16 +24,17 @@
import cc.kune.common.client.actions.ActionEvent;
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.client.rpcservices.SocialNetServiceHelper;
import cc.kune.core.shared.dto.GroupDTO;
import com.google.inject.Inject;
public class ChangeToCollabAction extends AbstractExtendedAction {
- private final SocialNetClientUtils sNClientUtils;
+ private final SocialNetServiceHelper sNClientUtils;
@Inject
public ChangeToCollabAction(final I18nTranslationService i18n, final CoreResources res,
- final SocialNetClientUtils sNClientUtils) {
+ final SocialNetServiceHelper sNClientUtils) {
this.sNClientUtils = sNClientUtils;
putValue(NAME, i18n.t("Change to collaborator"));
putValue(Action.SMALL_ICON, res.arrowDownGreen());
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/DenyJoinGroupAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/DenyJoinGroupAction.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/DenyJoinGroupAction.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -26,7 +26,7 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
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.rpcservices.SocialNetServiceAsync;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
import cc.kune.core.shared.dto.GroupDTO;
@@ -38,13 +38,13 @@
public class DenyJoinGroupAction extends AbstractExtendedAction {
private final I18nTranslationService i18n;
private final Session session;
- private final Provider<SocialNetworkServiceAsync> snServiceProvider;
+ private final Provider<SocialNetServiceAsync> snServiceProvider;
private final StateManager stateManager;
@Inject
public DenyJoinGroupAction(final StateManager stateManager, final Session session,
final I18nTranslationService i18n, final CoreResources res,
- final Provider<SocialNetworkServiceAsync> snServiceProvider) {
+ final Provider<SocialNetServiceAsync> snServiceProvider) {
this.stateManager = stateManager;
this.session = session;
this.i18n = i18n;
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/JoinGroupAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/JoinGroupAction.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/JoinGroupAction.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -28,7 +28,7 @@
import cc.kune.core.client.auth.SignIn;
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.rpcservices.SocialNetServiceAsync;
import cc.kune.core.client.state.AccessRightsClientManager;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.SiteTokens;
@@ -47,7 +47,7 @@
@Inject
public JoinGroupAction(final StateManager stateManager, final Session session,
final I18nTranslationService i18n, final CoreResources res,
- final Provider<SocialNetworkServiceAsync> snServiceProvider, final Provider<SignIn> signIn,
+ final Provider<SocialNetServiceAsync> snServiceProvider, final Provider<SignIn> signIn,
final AccessRightsClientManager rightsClientManager) {
super(stateManager, session, i18n, res, snServiceProvider, rightsClientManager, AccessRolDTO.Viewer,
false, true, false);
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/RemoveMemberAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/RemoveMemberAction.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/RemoveMemberAction.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -26,7 +26,7 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
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.rpcservices.SocialNetServiceAsync;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
import cc.kune.core.shared.dto.GroupDTO;
@@ -38,13 +38,13 @@
public class RemoveMemberAction extends AbstractExtendedAction {
private final I18nTranslationService i18n;
private final Session session;
- private final Provider<SocialNetworkServiceAsync> snServiceProvider;
+ private final Provider<SocialNetServiceAsync> snServiceProvider;
private final StateManager stateManager;
@Inject
public RemoveMemberAction(final StateManager stateManager, final Session session,
final I18nTranslationService i18n, final CoreResources res,
- final Provider<SocialNetworkServiceAsync> snServiceProvider) {
+ final Provider<SocialNetServiceAsync> snServiceProvider) {
this.stateManager = stateManager;
this.session = session;
this.i18n = i18n;
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/SNRolAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/SNRolAction.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/SNRolAction.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -22,7 +22,7 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.actions.RolActionAutoUpdated;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.client.rpcservices.SocialNetworkServiceAsync;
+import cc.kune.core.client.rpcservices.SocialNetServiceAsync;
import cc.kune.core.client.state.AccessRightsClientManager;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
@@ -33,11 +33,11 @@
public abstract class SNRolAction extends RolActionAutoUpdated {
protected final I18nTranslationService i18n;
- protected final Provider<SocialNetworkServiceAsync> snServiceProvider;
+ protected final Provider<SocialNetServiceAsync> snServiceProvider;
@Inject
public SNRolAction(final StateManager stateManager, final Session session, final I18nTranslationService i18n,
- final CoreResources res, final Provider<SocialNetworkServiceAsync> snServiceProvider,
+ final CoreResources res, final Provider<SocialNetServiceAsync> snServiceProvider,
final AccessRightsClientManager rightsManager, final AccessRolDTO rolRequired, final boolean authNeed,
final boolean visibleForNonMemb, final boolean visibleForMembers) {
super(stateManager, session, rightsManager, rolRequired, authNeed, visibleForNonMemb, visibleForMembers);
Deleted: trunk/src/main/java/cc/kune/core/client/sn/actions/SocialNetClientUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/SocialNetClientUtils.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/SocialNetClientUtils.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -1,59 +0,0 @@
-package cc.kune.core.client.sn.actions;
-
-import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.shared.i18n.I18nTranslationService;
-import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
-import cc.kune.core.client.rpcservices.SocialNetworkServiceAsync;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.dto.SocialNetworkDataDTO;
-
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-
-public class SocialNetClientUtils {
-
- private final I18nTranslationService i18n;
- private final Session session;
- private final Provider<SocialNetworkServiceAsync> snServiceProvider;
- private final StateManager stateManager;
-
- @Inject
- public SocialNetClientUtils(final StateManager stateManager, final Session session,
- final I18nTranslationService i18n, final Provider<SocialNetworkServiceAsync> snServiceProvider) {
- this.stateManager = stateManager;
- this.session = session;
- this.i18n = i18n;
- this.snServiceProvider = snServiceProvider;
- }
-
- public void changeToAdmin(final String shortName) {
- NotifyUser.showProgress();
- snServiceProvider.get().setCollabAsAdmin(session.getUserHash(),
- session.getCurrentState().getStateToken(), shortName,
- new AsyncCallbackSimple<SocialNetworkDataDTO>() {
- @Override
- public void onSuccess(final SocialNetworkDataDTO result) {
- SocialNetClientUtils.this.onSuccess(result);
- }
- });
- }
-
- public void changeToCollab(final String shortName) {
- NotifyUser.showProgress();
- snServiceProvider.get().setAdminAsCollab(session.getUserHash(),
- session.getCurrentState().getStateToken(), shortName,
- new AsyncCallbackSimple<SocialNetworkDataDTO>() {
- @Override
- public void onSuccess(final SocialNetworkDataDTO result) {
- SocialNetClientUtils.this.onSuccess(result);
- }
- });
- }
-
- private void onSuccess(final SocialNetworkDataDTO result) {
- NotifyUser.hideProgress();
- NotifyUser.info(i18n.t("Member type changed"));
- stateManager.setSocialNetwork(result);
- }
-}
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromCurrentGroupAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromCurrentGroupAction.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromCurrentGroupAction.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -26,7 +26,7 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
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.rpcservices.SocialNetServiceAsync;
import cc.kune.core.client.state.AccessRightsClientManager;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
@@ -40,7 +40,7 @@
@Inject
public UnJoinFromCurrentGroupAction(final StateManager stateManager, final Session session,
final I18nTranslationService i18n, final CoreResources res,
- final Provider<SocialNetworkServiceAsync> snServiceProvider,
+ final Provider<SocialNetServiceAsync> snServiceProvider,
final AccessRightsClientManager rightsClientManager) {
super(stateManager, session, i18n, res, snServiceProvider, rightsClientManager, AccessRolDTO.Editor,
true, false, true);
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromThisGroupAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromThisGroupAction.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromThisGroupAction.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -27,7 +27,7 @@
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.rpcservices.SocialNetServiceAsync;
import cc.kune.core.client.state.AccessRightsClientManager;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
@@ -46,13 +46,13 @@
private final I18nTranslationService i18n;
private final Session session;
- private final Provider<SocialNetworkServiceAsync> snServiceProvider;
+ private final Provider<SocialNetServiceAsync> 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 Provider<SocialNetServiceAsync> snServiceProvider,
final AccessRightsClientManager rightsClientManager) {
super(AccessRolDTO.Editor, true);
this.stateManager = stateManager;
Modified: trunk/src/main/java/cc/kune/core/server/KuneRackModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/KuneRackModule.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/core/server/KuneRackModule.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -32,7 +32,7 @@
import cc.kune.core.client.rpcservices.GroupService;
import cc.kune.core.client.rpcservices.I18nService;
import cc.kune.core.client.rpcservices.SiteService;
-import cc.kune.core.client.rpcservices.SocialNetworkService;
+import cc.kune.core.client.rpcservices.SocialNetService;
import cc.kune.core.client.rpcservices.UserService;
import cc.kune.core.server.init.FinderRegistry;
import cc.kune.core.server.manager.file.EntityBackgroundDownloadManager;
@@ -180,7 +180,7 @@
new ForwardFilter(suffix + "/ws.html"));
builder.installGWTServices("^" + suffix + "/", SiteService.class, GroupService.class,
- ContentService.class, UserService.class, SocialNetworkService.class, I18nService.class,
+ ContentService.class, UserService.class, SocialNetService.class, I18nService.class,
ListsService.class, ClientStatsService.class);
builder.installRESTServices("^" + suffix + "/json/", TestJSONService.class, GroupJSONService.class,
UserJSONService.class, I18nTranslationJSONService.class, ContentJSONService.class);
Modified: trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -27,7 +27,7 @@
import cc.kune.core.client.rpcservices.GroupService;
import cc.kune.core.client.rpcservices.I18nService;
import cc.kune.core.client.rpcservices.SiteService;
-import cc.kune.core.client.rpcservices.SocialNetworkService;
+import cc.kune.core.client.rpcservices.SocialNetService;
import cc.kune.core.client.rpcservices.UserService;
import cc.kune.core.server.access.AccessRightsService;
import cc.kune.core.server.access.AccessRightsServiceDefault;
@@ -156,7 +156,7 @@
bind(GroupService.class).to(GroupRPC.class);
bind(ContentService.class).to(ContentRPC.class);
bind(UserService.class).to(UserRPC.class);
- bind(SocialNetworkService.class).to(SocialNetworkRPC.class);
+ bind(SocialNetService.class).to(SocialNetworkRPC.class);
bind(I18nService.class).to(I18nRPC.class);
bind(ListsService.class).to(ListsRPC.class);
bind(ClientStatsService.class).to(StatsRPC.class);
Modified: trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -20,7 +20,7 @@
package cc.kune.core.server.rpc;
import cc.kune.core.client.errors.DefaultException;
-import cc.kune.core.client.rpcservices.SocialNetworkService;
+import cc.kune.core.client.rpcservices.SocialNetService;
import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.auth.ActionLevel;
import cc.kune.core.server.auth.Authenticated;
@@ -40,7 +40,7 @@
import com.google.inject.Inject;
import com.google.inject.persist.Transactional;
-public class SocialNetworkRPC implements SocialNetworkService, RPC {
+public class SocialNetworkRPC implements SocialNetService, RPC {
private final GroupManager groupManager;
private final Mapper mapper;
Modified: trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -33,11 +33,14 @@
import cc.kune.core.client.state.StateManager;
import cc.kune.gspace.client.actions.AbstractFoldableToolActions;
import cc.kune.gspace.client.actions.ActionGroups;
+import cc.kune.gspace.client.actions.AddAdminMembersToContentMenuItem;
+import cc.kune.gspace.client.actions.AddAllMembersToContentMenuItem;
+import cc.kune.gspace.client.actions.AddCollabMembersToContentMenuItem;
import cc.kune.gspace.client.actions.ContentViewerOptionsMenu;
-import cc.kune.gspace.client.actions.TutorialContainerBtn;
import cc.kune.gspace.client.actions.ParticipateInContentBtn;
import cc.kune.gspace.client.actions.RefreshContentMenuItem;
import cc.kune.gspace.client.actions.SetAsHomePageMenuItem;
+import cc.kune.gspace.client.actions.TutorialContainerBtn;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -59,6 +62,9 @@
final Provider<OpenDocMenuItem> openContentMenuItem, final Provider<NewFolderBtn> newFolderBtn,
final Provider<DelDocMenuItem> delContentMenuItem,
final Provider<ContentViewerOptionsMenu> optionsMenuContent,
+ final Provider<AddAllMembersToContentMenuItem> addAllMenuItem,
+ final Provider<AddAdminMembersToContentMenuItem> addAdminMembersMenuItem,
+ final Provider<AddCollabMembersToContentMenuItem> addCollabMembersMenuItem,
final Provider<ParticipateInContentBtn> participateBtn,
final Provider<DelFolderMenuItem> delFolderMenuItem,
final Provider<TutorialContainerBtn> tutorialBtn, final Provider<ChatAboutContentBtn> chatAbout,
@@ -69,6 +75,9 @@
super(session, stateManager, i18n, registry);
actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAllMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addCollabMembersMenuItem, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, newDocIconBtn, all);
actionsRegistry.addAction(ActionGroups.TOOLBAR, newFolderBtn, containers);
actionsRegistry.addAction(ActionGroups.TOOLBAR, foldersNewMenu, containers);
@@ -85,6 +94,9 @@
actionsRegistry.addAction(ActionGroups.ITEM_MENU, delContentMenuItem, contents);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, setAsHomePage, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAllMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
newMenusRegistry.register(TYPE_FOLDER, foldersNewMenu.get());
newMenusRegistry.register(TYPE_ROOT, foldersNewMenu.get());
newMenusRegistry.register(TYPE_DOCUMENT,
Modified: trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -28,6 +28,9 @@
import cc.kune.core.client.state.StateManager;
import cc.kune.gspace.client.actions.AbstractFoldableToolActions;
import cc.kune.gspace.client.actions.ActionGroups;
+import cc.kune.gspace.client.actions.AddAdminMembersToContentMenuItem;
+import cc.kune.gspace.client.actions.AddAllMembersToContentMenuItem;
+import cc.kune.gspace.client.actions.AddCollabMembersToContentMenuItem;
import cc.kune.gspace.client.actions.ContentViewerOptionsMenu;
import cc.kune.gspace.client.actions.ParticipateInContentBtn;
import cc.kune.gspace.client.actions.RefreshContentMenuItem;
@@ -48,6 +51,9 @@
final Provider<OpenMeetingMenuItem> openContentMenuItem,
final Provider<DelMeetingMenuItem> delContentMenuItem,
final Provider<ContentViewerOptionsMenu> optionsMenuContent,
+ final Provider<AddAllMembersToContentMenuItem> addAllMenuItem,
+ final Provider<AddAdminMembersToContentMenuItem> addAdminMembersMenuItem,
+ final Provider<AddCollabMembersToContentMenuItem> addCollabMembersMenuItem,
final Provider<ParticipateInContentBtn> participateBtn,
final Provider<Calendar1DayViewSelectBtn> cal1DayBtn,
final Provider<Calendar3DaysViewSelectBtn> cal3DaysBtn,
@@ -60,6 +66,9 @@
final Provider<CalendarGoTodayBtn> goToday, final Provider<RefreshContentMenuItem> refresh) {
super(session, stateManager, i18n, registry);
actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAllMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addCollabMembersMenuItem, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
actionsRegistry.addAction(ActionGroups.TOOLBAR, goToday, containers);
actionsRegistry.addAction(ActionGroups.TOOLBAR, calPrevBtn, containers);
@@ -70,7 +79,6 @@
actionsRegistry.addAction(ActionGroups.TOOLBAR, calNextBtn, containers);
actionsRegistry.addAction(ActionGroups.TOOLBAR, participateBtn, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, contents);
-
// On over calendar menu
actionsRegistry.addAction(ActionGroups.TOOLBAR, onOverMenu, containers);
Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -29,6 +29,7 @@
import cc.kune.core.client.sn.CollabsGroupSNDropController;
import cc.kune.core.client.sn.actions.WriteToBuddyHeaderButton;
import cc.kune.gspace.client.actions.ContentViewerOptionsMenu;
+import cc.kune.gspace.client.actions.ContentViewerOptionsShareSubMenu;
import cc.kune.gspace.client.actions.GiveUsFeedbackBtn;
import cc.kune.gspace.client.actions.RenameAction;
import cc.kune.gspace.client.armor.GSpaceArmor;
@@ -208,6 +209,7 @@
// Actions
s(ContentViewerOptionsMenu.class);
+ s(ContentViewerOptionsShareSubMenu.class);
s(RenameAction.class);
s(GiveUsFeedbackBtn.class);
s(WriteToBuddyHeaderButton.class);
Added: trunk/src/main/java/cc/kune/gspace/client/actions/AddAdminMembersToContentMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/AddAdminMembersToContentMenuItem.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/AddAdminMembersToContentMenuItem.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -0,0 +1,37 @@
+/*
+ *
+ * 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.gspace.client.actions;
+
+import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.dto.SocialNetworkSubGroup;
+
+import com.google.inject.Inject;
+
+public class AddAdminMembersToContentMenuItem extends AddMembersToContentMenuItem {
+
+ @Inject
+ public AddAdminMembersToContentMenuItem(final I18nTranslationService i18n,
+ final AddMembersToContentAction action, final ContentViewerOptionsMenu optionsMenu,
+ final CoreResources res) {
+ super(i18n.t("Share with admins"), SocialNetworkSubGroup.admins, action, optionsMenu, res);
+ }
+
+}
Added: trunk/src/main/java/cc/kune/gspace/client/actions/AddAllMembersToContentMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/AddAllMembersToContentMenuItem.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/AddAllMembersToContentMenuItem.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -0,0 +1,37 @@
+/*
+ *
+ * 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.gspace.client.actions;
+
+import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.dto.SocialNetworkSubGroup;
+
+import com.google.inject.Inject;
+
+public class AddAllMembersToContentMenuItem extends AddMembersToContentMenuItem {
+
+ @Inject
+ public AddAllMembersToContentMenuItem(final I18nTranslationService i18n,
+ final AddMembersToContentAction action, final ContentViewerOptionsMenu optionsMenu,
+ final CoreResources res) {
+ super(i18n.t("Share with all group members"), SocialNetworkSubGroup.all, action, optionsMenu, res);
+ }
+
+}
Added: trunk/src/main/java/cc/kune/gspace/client/actions/AddCollabMembersToContentMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/AddCollabMembersToContentMenuItem.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/AddCollabMembersToContentMenuItem.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -0,0 +1,37 @@
+/*
+ *
+ * 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.gspace.client.actions;
+
+import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.dto.SocialNetworkSubGroup;
+
+import com.google.inject.Inject;
+
+public class AddCollabMembersToContentMenuItem extends AddMembersToContentMenuItem {
+
+ @Inject
+ public AddCollabMembersToContentMenuItem(final I18nTranslationService i18n,
+ final AddMembersToContentAction action, final ContentViewerOptionsMenu optionsMenu,
+ final CoreResources res) {
+ super(i18n.t("Share with collaborators"), SocialNetworkSubGroup.collabs, action, optionsMenu, res);
+ }
+
+}
Added: trunk/src/main/java/cc/kune/gspace/client/actions/AddMembersToContentAction.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/AddMembersToContentAction.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/AddMembersToContentAction.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -0,0 +1,57 @@
+/*
+ *
+ * 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.gspace.client.actions;
+
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.core.client.actions.RolAction;
+import cc.kune.core.client.rpcservices.ContentServiceHelper;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.AbstractContentSimpleDTO;
+import cc.kune.core.shared.dto.AccessRolDTO;
+import cc.kune.core.shared.dto.SocialNetworkSubGroup;
+
+import com.google.inject.Inject;
+
+public class AddMembersToContentAction extends RolAction {
+
+ private final ContentServiceHelper contentService;
+ private final Session session;
+ private SocialNetworkSubGroup subGroup;
+
+ @Inject
+ public AddMembersToContentAction(final Session session, final ContentServiceHelper contentService) {
+ super(AccessRolDTO.Editor, true);
+ this.session = session;
+ this.contentService = contentService;
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ final StateToken token = session.getCurrentStateToken().hasAll() ? session.getCurrentStateToken()
+ : ((AbstractContentSimpleDTO) event.getTarget()).getStateToken();
+ contentService.addParticipants(token, subGroup);
+ }
+
+ public void setSubGroup(final SocialNetworkSubGroup subGroup) {
+ this.subGroup = subGroup;
+ }
+
+}
\ No newline at end of file
Added: trunk/src/main/java/cc/kune/gspace/client/actions/AddMembersToContentMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/AddMembersToContentMenuItem.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/AddMembersToContentMenuItem.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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.gspace.client.actions;
+
+import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.dto.SocialNetworkSubGroup;
+
+public class AddMembersToContentMenuItem extends MenuItemDescriptor {
+
+ public AddMembersToContentMenuItem(final String text, final SocialNetworkSubGroup subGroup,
+ final AddMembersToContentAction action, final ContentViewerOptionsMenu optionsMenu,
+ final CoreResources res) {
+ super(action);
+ action.setSubGroup(subGroup);
+ this.withText(text).withIcon(res.addGreen()).withParent(optionsMenu, false);
+ }
+
+}
Added: trunk/src/main/java/cc/kune/gspace/client/actions/ContentViewerOptionsShareSubMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/ContentViewerOptionsShareSubMenu.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/ContentViewerOptionsShareSubMenu.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -0,0 +1,42 @@
+/*
+ *
+ * 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.gspace.client.actions;
+
+import cc.kune.common.client.actions.ui.descrip.SubMenuDescriptor;
+import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.resources.CoreResources;
+
+import com.google.inject.Inject;
+
+/**
+ * The Class ContentViewerOptionsShareSubMenu (not used yet)
+ */
+public class ContentViewerOptionsShareSubMenu extends SubMenuDescriptor {
+
+ public static final String ID = "k-cnt-viewer-share-opt-submenu";
+
+ @Inject
+ public ContentViewerOptionsShareSubMenu(final I18nTranslationService i18n, final CoreResources res,
+ final ContentViewerOptionsMenu parent) {
+ super();
+ this.withText(i18n.t("Share")).withIcon(res.addGreen()).withId(ID).withParent(parent, false);
+ }
+
+}
Modified: trunk/src/main/java/cc/kune/lists/client/actions/ListsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/lists/client/actions/ListsClientActions.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/lists/client/actions/ListsClientActions.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -32,6 +32,9 @@
import cc.kune.core.client.state.StateManager;
import cc.kune.gspace.client.actions.AbstractFoldableToolActions;
import cc.kune.gspace.client.actions.ActionGroups;
+import cc.kune.gspace.client.actions.AddAdminMembersToContentMenuItem;
+import cc.kune.gspace.client.actions.AddAllMembersToContentMenuItem;
+import cc.kune.gspace.client.actions.AddCollabMembersToContentMenuItem;
import cc.kune.gspace.client.actions.ParticipateInContentBtn;
import cc.kune.gspace.client.actions.SetAsHomePageMenuItem;
import cc.kune.gspace.client.actions.TutorialContainerBtn;
@@ -58,7 +61,9 @@
final Provider<OptionsListMenu> optionsMenuContent,
final Provider<ShowSubscribersOfListBtn> subscribersCount,
final Provider<TutorialContainerBtn> tutorialBtn,
-
+ final Provider<AddAllMembersToContentMenuItem> addAllMenuItem,
+ final Provider<AddAdminMembersToContentMenuItem> addAdminMembersMenuItem,
+ final Provider<AddCollabMembersToContentMenuItem> addCollabMembersMenuItem,
final Provider<SetListOpenessMenuItem> listOpenessMenuItem,
final Provider<ParticipateInContentBtn> participateBtn, final ListsNewMenu listNewMenu,
final PostNewMenu postNewMenu, final NewMenusForTypeIdsRegistry newMenusRegistry,
@@ -66,6 +71,9 @@
final Provider<SetAsHomePageMenuItem> setAsHomePage) {
super(session, stateManager, i18n, registry);
actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAllMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addCollabMembersMenuItem, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, newPostIconBtn, noRoot);
actionsRegistry.addAction(ActionGroups.TOOLBAR, newListBtn, TYPE_ROOT);
actionsRegistry.addAction(ActionGroups.TOOLBAR, listNewMenu, containersNoRoot);
@@ -85,6 +93,9 @@
actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, contents);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAllMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
newMenusRegistry.register(TYPE_LIST, listNewMenu.get());
newMenusRegistry.register(TYPE_ROOT, listNewMenu.get());
newMenusRegistry.register(TYPE_POST,
Modified: trunk/src/main/java/cc/kune/tasks/client/actions/TasksClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/tasks/client/actions/TasksClientActions.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/tasks/client/actions/TasksClientActions.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -33,6 +33,9 @@
import cc.kune.core.shared.domain.ContentStatus;
import cc.kune.gspace.client.actions.AbstractFoldableToolActions;
import cc.kune.gspace.client.actions.ActionGroups;
+import cc.kune.gspace.client.actions.AddAdminMembersToContentMenuItem;
+import cc.kune.gspace.client.actions.AddAllMembersToContentMenuItem;
+import cc.kune.gspace.client.actions.AddCollabMembersToContentMenuItem;
import cc.kune.gspace.client.actions.ContentViewerOptionsMenu;
import cc.kune.gspace.client.actions.ParticipateInContentBtn;
import cc.kune.gspace.client.actions.RefreshContentMenuItem;
@@ -62,13 +65,18 @@
final Provider<ContentViewerOptionsMenu> optionsMenuContent,
final Provider<ParticipateInContentBtn> participateBtn,
final Provider<TutorialContainerBtn> tutorialBtn,
-
+ final Provider<AddAllMembersToContentMenuItem> addAllMenuItem,
+ final Provider<AddAdminMembersToContentMenuItem> addAdminMembersMenuItem,
+ final Provider<AddCollabMembersToContentMenuItem> addCollabMembersMenuItem,
final TasksFolderNewMenu taskFolderNewMenu, final TasksNewMenu taskNewMenu,
final NewMenusForTypeIdsRegistry newMenusRegistry, final Provider<ChatAboutContentBtn> chatAbout,
final Provider<DelFolderMenuItem> delFolderMenuItem,
final Provider<SetAsHomePageMenuItem> setAsHomePage) {
super(session, stateManager, i18n, registry);
actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAllMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addCollabMembersMenuItem, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
actionsRegistry.addAction(ActionGroups.TOOLBAR, newTaskIconBtn, all);
// actionsRegistry.addAction(ActionGroups.TOOLBAR, taskFolderNewMenu,
@@ -90,6 +98,9 @@
actionsRegistry.addAction(ActionGroups.ITEM_MENU, marksAsNotDoneMenuItem,
ContentStatus.inTheDustbin, TYPE_TASK);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAllMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
// Currently new menu in folders has no sense (because we have buttons for
// the same contents)
// newMenusRegistry.register(TYPE_FOLDER, taskFolderNewMenu.get());
Modified: trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -33,6 +33,9 @@
import cc.kune.core.client.state.StateManager;
import cc.kune.gspace.client.actions.AbstractFoldableToolActions;
import cc.kune.gspace.client.actions.ActionGroups;
+import cc.kune.gspace.client.actions.AddAdminMembersToContentMenuItem;
+import cc.kune.gspace.client.actions.AddAllMembersToContentMenuItem;
+import cc.kune.gspace.client.actions.AddCollabMembersToContentMenuItem;
import cc.kune.gspace.client.actions.ContentViewerOptionsMenu;
import cc.kune.gspace.client.actions.ParticipateInContentBtn;
import cc.kune.gspace.client.actions.RefreshContentMenuItem;
@@ -60,6 +63,9 @@
final Provider<ContentViewerOptionsMenu> optionsMenuContent,
final Provider<ParticipateInContentBtn> participateBtn,
final Provider<TutorialContainerBtn> tutorialBtn,
+ final Provider<AddAllMembersToContentMenuItem> addAllMenuItem,
+ final Provider<AddAdminMembersToContentMenuItem> addAdminMembersMenuItem,
+ final Provider<AddCollabMembersToContentMenuItem> addCollabMembersMenuItem,
final Provider<DelFolderMenuItem> delFolderMenuItem, final Provider<NewFolderBtn> newFolderBtn,
final Provider<ChatAboutContentBtn> chatAbout, final Provider<RefreshContentMenuItem> refresh,
final Provider<SetAsHomePageMenuItem> setAsHomePage,
@@ -67,6 +73,9 @@
final WikiPageNewMenu wikipageNewMenu) {
super(session, stateManager, i18n, registry);
actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAllMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addCollabMembersMenuItem, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
actionsRegistry.addAction(ActionGroups.TOOLBAR, newWikiIconBtn, all);
actionsRegistry.addAction(ActionGroups.TOOLBAR, newFolderBtn, containers);
@@ -87,6 +96,9 @@
actionsRegistry.addAction(ActionGroups.ITEM_MENU, delContentMenuItem, contents);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, setAsHomePage, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAllMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
// Currently new menu in folders has no sense (because we have buttons for
// the same contents)
// newMenusRegistry.register(TYPE_FOLDER, folderNewMenu.get());
Modified: trunk/src/test/java/cc/kune/core/server/integration/socialnet/SocialNetworkServiceTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/socialnet/SocialNetworkServiceTest.java 2012-02-29 15:57:49 UTC (rev 1726)
+++ trunk/src/test/java/cc/kune/core/server/integration/socialnet/SocialNetworkServiceTest.java 2012-02-29 17:55:15 UTC (rev 1727)
@@ -26,7 +26,7 @@
import cc.kune.core.client.errors.AlreadyUserMemberException;
import cc.kune.core.client.errors.UserMustBeLoggedException;
-import cc.kune.core.client.rpcservices.SocialNetworkService;
+import cc.kune.core.client.rpcservices.SocialNetService;
import cc.kune.core.server.UserSession;
import cc.kune.core.server.integration.IntegrationTest;
import cc.kune.core.server.integration.IntegrationTestHelper;
@@ -39,7 +39,7 @@
@Inject
UserSession session;
@Inject
- SocialNetworkService socialNetworkService;
+ SocialNetService socialNetworkService;
private StateToken groupToken;
More information about the kune-commits
mailing list