[kune-commits] r1399 - in trunk/src: main/java/cc/kune/chat main/java/cc/kune/chat/client main/java/cc/kune/chat/client/actions main/java/cc/kune/chat/server main/java/cc/kune/chat/shared main/java/cc/kune/client main/java/cc/kune/common/client/ui/dialogs main/java/cc/kune/core/client/resources main/java/cc/kune/core/server main/java/cc/kune/core/server/rpc main/java/cc/kune/core/server/xmpp main/java/cc/kune/core/shared/dto main/java/cc/kune/gspace/client/actions main/java/cc/kune/gspace/client/viewers main/java/org/ourproject/kune/chat main/java/org/ourproject/kune/chat/client main/webapp main/webapp/others test/java/cc/kune/core/server/integration test/java/org/ourproject/kune/chat test/java/org/ourproject/kune/chat/server/managers
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Thu Jun 9 14:25:38 CEST 2011
Author: vjrj_
Date: 2011-06-09 14:25:38 +0200 (Thu, 09 Jun 2011)
New Revision: 1399
Added:
trunk/src/main/java/cc/kune/chat/client/ChatClientTool.java
trunk/src/main/java/cc/kune/chat/client/ChatGinjector.java
trunk/src/main/java/cc/kune/chat/client/actions/ChatClientActions.java
trunk/src/main/java/cc/kune/chat/client/actions/GoParentChatBtn.java
trunk/src/main/java/cc/kune/chat/client/actions/NewRoomBtn.java
trunk/src/main/java/cc/kune/chat/client/actions/OpenChatAction.java
trunk/src/main/java/cc/kune/chat/client/actions/OpenRoomArchiveMenuItem.java
trunk/src/main/java/cc/kune/chat/client/actions/OpenRoomBtn.java
trunk/src/main/java/cc/kune/chat/client/actions/OpenRoomMenuItem.java
trunk/src/main/java/cc/kune/chat/server/
trunk/src/main/java/cc/kune/chat/server/ChatManager.java
trunk/src/main/java/cc/kune/chat/server/ChatManagerDefault.java
trunk/src/main/java/cc/kune/chat/shared/
trunk/src/main/java/cc/kune/chat/shared/ChatConstants.java
trunk/src/main/java/cc/kune/common/client/ui/dialogs/PromptTopDialog.java
trunk/src/main/java/cc/kune/core/shared/dto/AbstractContentSimpleDTO.java
trunk/src/main/webapp/others/
trunk/src/main/webapp/others/kune-wave-extensions.xml
Removed:
trunk/src/main/java/org/ourproject/kune/chat/server/
Modified:
trunk/src/main/java/cc/kune/chat/KuneChat.gwt.xml
trunk/src/main/java/cc/kune/chat/client/ChatGinModule.java
trunk/src/main/java/cc/kune/chat/client/ChatParts.java
trunk/src/main/java/cc/kune/chat/server/ChatServerModule.java
trunk/src/main/java/cc/kune/chat/server/ChatServerTool.java
trunk/src/main/java/cc/kune/client/KuneEntryPoint.java
trunk/src/main/java/cc/kune/client/KuneGinjector.java
trunk/src/main/java/cc/kune/client/OnAppStartFactory.java
trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java
trunk/src/main/java/cc/kune/core/client/resources/CoreMessages.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/ContentRPC.java
trunk/src/main/java/cc/kune/core/server/xmpp/XmppManager.java
trunk/src/main/java/cc/kune/core/server/xmpp/XmppManagerDefault.java
trunk/src/main/java/cc/kune/core/shared/dto/ContainerSimpleDTO.java
trunk/src/main/java/cc/kune/core/shared/dto/ContentSimpleDTO.java
trunk/src/main/java/cc/kune/gspace/client/actions/DelContainerMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/actions/DelContentMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/actions/OpenContentMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/actions/SetAsHomePageMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java
trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java
trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
trunk/src/test/java/cc/kune/core/server/integration/DatabaseInitializerTest.java
trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java
trunk/src/test/java/org/ourproject/kune/chat/ChatToolTest.java
trunk/src/test/java/org/ourproject/kune/chat/server/managers/XmppManagerDefaultTest.java
Log:
chatroom tool and extension via xml
Modified: trunk/src/main/java/cc/kune/chat/KuneChat.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/chat/KuneChat.gwt.xml 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/main/java/cc/kune/chat/KuneChat.gwt.xml 2011-06-09 12:25:38 UTC (rev 1399)
@@ -10,4 +10,5 @@
<inherits name='com.calclab.hablar.icons.alt.HablarAltIcons' />
<source path="client" />
<public path="public" />
+ <source path="shared" />
</module>
\ No newline at end of file
Added: trunk/src/main/java/cc/kune/chat/client/ChatClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatClientTool.java (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/ChatClientTool.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -0,0 +1,53 @@
+/*
+ *
+ * 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.chat.client;
+
+import static cc.kune.chat.shared.ChatConstants.NAME;
+import static cc.kune.chat.shared.ChatConstants.TYPE_ROOM;
+import cc.kune.core.client.i18n.I18nUITranslationService;
+import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
+import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.gspace.client.tool.FoldableAbstractClientTool;
+import cc.kune.gspace.client.tool.selector.ToolSelector;
+
+import com.google.inject.Inject;
+
+public class ChatClientTool extends FoldableAbstractClientTool {
+
+ private final NavResources navResources;
+
+ @Inject
+ public ChatClientTool(final I18nUITranslationService i18n, final ToolSelector toolSelector,
+ final ContentCapabilitiesRegistry cntCapRegistry, final NavResources navResources) {
+ super(NAME, i18n.t("chatrooms"), toolSelector, cntCapRegistry);
+ this.navResources = navResources;
+ registerIcons();
+ }
+
+ @Override
+ public String getName() {
+ return NAME;
+ }
+
+ private void registerIcons() {
+ registerContentTypeIcon(TYPE_ROOM, navResources.room());
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/chat/client/ChatClientTool.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/chat/client/ChatGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatGinModule.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/main/java/cc/kune/chat/client/ChatGinModule.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -20,6 +20,7 @@
package cc.kune.chat.client;
import cc.kune.chat.client.actions.AddAsBuddieHeaderButton;
+import cc.kune.chat.client.actions.ChatClientActions;
import cc.kune.chat.client.actions.ChatSitebarActions;
import cc.kune.chat.client.actions.OpenGroupPublicChatRoomButton;
@@ -27,18 +28,20 @@
import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
public class ChatGinModule extends AbstractPresenterModule {
- /*
- * (non-Javadoc)
- *
- * @see com.google.gwt.inject.client.AbstractGinModule#configure()
- */
- @Override
- protected void configure() {
- bind(ChatClient.class).to(ChatClientDefault.class).in(Singleton.class);
- bind(ChatOptions.class).in(Singleton.class);
- bind(ChatSitebarActions.class).in(Singleton.class);
- bind(ChatParts.class).asEagerSingleton();
- bind(AddAsBuddieHeaderButton.class).in(Singleton.class);
- bind(OpenGroupPublicChatRoomButton.class).in(Singleton.class);
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.google.gwt.inject.client.AbstractGinModule#configure()
+ */
+ @Override
+ protected void configure() {
+ bind(ChatClient.class).to(ChatClientDefault.class).in(Singleton.class);
+ bind(ChatOptions.class).in(Singleton.class);
+ bind(ChatSitebarActions.class).in(Singleton.class);
+ bind(ChatParts.class).asEagerSingleton();
+ bind(AddAsBuddieHeaderButton.class).in(Singleton.class);
+ bind(OpenGroupPublicChatRoomButton.class).in(Singleton.class);
+ bind(ChatClientTool.class).in(Singleton.class);
+ bind(ChatClientActions.class).in(Singleton.class);
+ }
}
Added: trunk/src/main/java/cc/kune/chat/client/ChatGinjector.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatGinjector.java (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/ChatGinjector.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -0,0 +1,28 @@
+/*
+ *
+ * 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.chat.client;
+
+import com.google.gwt.inject.client.Ginjector;
+
+public interface ChatGinjector extends Ginjector {
+
+ ChatParts getChatParts();
+
+}
Property changes on: trunk/src/main/java/cc/kune/chat/client/ChatGinjector.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/chat/client/ChatParts.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatParts.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/main/java/cc/kune/chat/client/ChatParts.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -20,12 +20,14 @@
package cc.kune.chat.client;
import cc.kune.chat.client.actions.AddAsBuddieHeaderButton;
+import cc.kune.chat.client.actions.ChatClientActions;
import cc.kune.chat.client.actions.ChatSitebarActions;
import cc.kune.chat.client.actions.OpenGroupPublicChatRoomAction;
import cc.kune.chat.client.actions.OpenGroupPublicChatRoomButton;
import cc.kune.chat.client.actions.StartChatWithMemberAction;
import cc.kune.chat.client.actions.StartChatWithThisBuddieAction;
import cc.kune.chat.client.actions.StartChatWithUserAction;
+import cc.kune.chat.shared.ChatConstants;
import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
import cc.kune.core.client.init.AppStartEvent;
import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
@@ -42,83 +44,90 @@
import cc.kune.core.client.sn.actions.registry.UserSNMenuItemsRegistry;
import cc.kune.core.client.state.Session;
import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.tool.ContentViewerSelector;
+import cc.kune.gspace.client.viewers.FolderViewerPresenter;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class ChatParts {
- @Inject
- public ChatParts(final Session session, final I18nTranslationService i18n,
- final Provider<ChatSitebarActions> chatActionsProvider,
- final Provider<AddAsBuddieHeaderButton> buddieButton,
- final Provider<GroupSNAdminsMenuItemsRegistry> snAdminsRegistry,
- final Provider<GroupSNCollabsMenuItemsRegistry> snCollabsItemsRegistry,
- final Provider<GroupSNPendingsMenuItemsRegistry> snPendingItemsRegistry,
- final Provider<GroupSNConfActions> groupConfActions,
- final Provider<UserSNMenuItemsRegistry> userItemsRegistry, final IsNotMeCondition isNotMe,
- final IsCurrentStateAdministrableCondition isAdministrableCondition,
- final IsCurrentStateEditableCondition isEditableCondition,
- final IsCurrentStateAGroupCondition isGroupCondition, final IsPersonCondition isPersonCondition,
- final Provider<StartChatWithMemberAction> startChatWithMemberAction, final IsLoggedCondition isLogged,
- final Provider<StartChatWithUserAction> startChatWithUserAction,
- final Provider<StartChatWithThisBuddieAction> startChatWithBuddieAction,
- final Provider<OpenGroupPublicChatRoomAction> openGroupRoomAction,
- final Provider<OpenGroupPublicChatRoomButton> openGroupRoom) {
- session.onAppStart(true, new AppStartHandler() {
- @Override
- public void onAppStart(final AppStartEvent event) {
- chatActionsProvider.get();
- final Provider<MenuItemDescriptor> startChatWithMemberItem = new Provider<MenuItemDescriptor>() {
- @Override
- public MenuItemDescriptor get() {
- final MenuItemDescriptor item = new MenuItemDescriptor(startChatWithMemberAction.get());
- item.add(isNotMe);
- item.add(isPersonCondition);
- item.add(isLogged);
- return item;
- }
- };
- final Provider<MenuItemDescriptor> startChatWithBuddieItem = new Provider<MenuItemDescriptor>() {
- @Override
- public MenuItemDescriptor get() {
- final MenuItemDescriptor item = new MenuItemDescriptor(startChatWithBuddieAction.get());
- item.add(isLogged);
- item.add(isPersonCondition);
- return item;
- }
- };
- final Provider<MenuItemDescriptor> startChatWithUserItem = new Provider<MenuItemDescriptor>() {
- @Override
- public MenuItemDescriptor get() {
- final MenuItemDescriptor item = new MenuItemDescriptor(startChatWithUserAction.get());
- item.add(isNotMe);
- item.add(isLogged);
- item.add(isPersonCondition);
- return item;
- }
- };
- final Provider<MenuItemDescriptor> openChatAndInvite = new Provider<MenuItemDescriptor>() {
- @Override
- public MenuItemDescriptor get() {
- final OpenGroupPublicChatRoomAction action = openGroupRoomAction.get();
- action.setInviteMembers(true);
- final MenuItemDescriptor item = new MenuItemDescriptor(action);
- item.withText(i18n.t("Open group's room with members")).withToolTip(
- i18n.t("Enter to this group public chat room and invite members"));
- item.setParent(GroupSNConfActions.OPTIONS_MENU);
- item.setPosition(0);
- return item;
- }
- };
- snAdminsRegistry.get().add(startChatWithMemberItem);
- snCollabsItemsRegistry.get().add(startChatWithMemberItem);
- snPendingItemsRegistry.get().add(startChatWithUserItem);
- userItemsRegistry.get().add(startChatWithBuddieItem);
- groupConfActions.get().add(openChatAndInvite.get());
- buddieButton.get();
- openGroupRoom.get();
- }
- });
- }
+ @Inject
+ public ChatParts(final Session session, final I18nTranslationService i18n,
+ final Provider<ChatClientTool> clientTool, final Provider<ChatSitebarActions> chatActionsProvider,
+ final Provider<AddAsBuddieHeaderButton> buddieButton,
+ final Provider<GroupSNAdminsMenuItemsRegistry> snAdminsRegistry,
+ final Provider<GroupSNCollabsMenuItemsRegistry> snCollabsItemsRegistry,
+ final Provider<GroupSNPendingsMenuItemsRegistry> snPendingItemsRegistry,
+ final Provider<GroupSNConfActions> groupConfActions,
+ final Provider<UserSNMenuItemsRegistry> userItemsRegistry, final IsNotMeCondition isNotMe,
+ final IsCurrentStateAdministrableCondition isAdministrableCondition,
+ final IsCurrentStateEditableCondition isEditableCondition,
+ final IsCurrentStateAGroupCondition isGroupCondition, final IsPersonCondition isPersonCondition,
+ final Provider<StartChatWithMemberAction> startChatWithMemberAction,
+ final IsLoggedCondition isLogged, final Provider<StartChatWithUserAction> startChatWithUserAction,
+ final Provider<StartChatWithThisBuddieAction> startChatWithBuddieAction,
+ final ChatClientActions chatActions,
+ final Provider<OpenGroupPublicChatRoomAction> openGroupRoomAction,
+ final Provider<OpenGroupPublicChatRoomButton> openGroupRoom,
+ final ContentViewerSelector viewerSelector, final FolderViewerPresenter folderViewer) {
+ viewerSelector.register(folderViewer, true, ChatConstants.TYPE_ROOT);
+ viewerSelector.register(folderViewer, true, ChatConstants.TYPE_ROOM);
+ clientTool.get();
+ session.onAppStart(true, new AppStartHandler() {
+ @Override
+ public void onAppStart(final AppStartEvent event) {
+ chatActionsProvider.get();
+ final Provider<MenuItemDescriptor> startChatWithMemberItem = new Provider<MenuItemDescriptor>() {
+ @Override
+ public MenuItemDescriptor get() {
+ final MenuItemDescriptor item = new MenuItemDescriptor(startChatWithMemberAction.get());
+ item.add(isNotMe);
+ item.add(isPersonCondition);
+ item.add(isLogged);
+ return item;
+ }
+ };
+ final Provider<MenuItemDescriptor> startChatWithBuddieItem = new Provider<MenuItemDescriptor>() {
+ @Override
+ public MenuItemDescriptor get() {
+ final MenuItemDescriptor item = new MenuItemDescriptor(startChatWithBuddieAction.get());
+ item.add(isLogged);
+ item.add(isPersonCondition);
+ return item;
+ }
+ };
+ final Provider<MenuItemDescriptor> startChatWithUserItem = new Provider<MenuItemDescriptor>() {
+ @Override
+ public MenuItemDescriptor get() {
+ final MenuItemDescriptor item = new MenuItemDescriptor(startChatWithUserAction.get());
+ item.add(isNotMe);
+ item.add(isLogged);
+ item.add(isPersonCondition);
+ return item;
+ }
+ };
+ final Provider<MenuItemDescriptor> openChatAndInvite = new Provider<MenuItemDescriptor>() {
+ @Override
+ public MenuItemDescriptor get() {
+ final OpenGroupPublicChatRoomAction action = openGroupRoomAction.get();
+ action.setInviteMembers(true);
+ final MenuItemDescriptor item = new MenuItemDescriptor(action);
+ item.withText(i18n.t("Open group's room with members")).withToolTip(
+ i18n.t("Enter to this group public chat room and invite members"));
+ item.setParent(GroupSNConfActions.OPTIONS_MENU);
+ item.setPosition(0);
+ return item;
+ }
+ };
+ snAdminsRegistry.get().add(startChatWithMemberItem);
+ snCollabsItemsRegistry.get().add(startChatWithMemberItem);
+ snPendingItemsRegistry.get().add(startChatWithUserItem);
+ userItemsRegistry.get().add(startChatWithBuddieItem);
+ groupConfActions.get().add(openChatAndInvite.get());
+ buddieButton.get();
+ openGroupRoom.get();
+ }
+ });
+ }
}
Added: trunk/src/main/java/cc/kune/chat/client/actions/ChatClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/ChatClientActions.java (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/actions/ChatClientActions.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -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.chat.client.actions;
+
+import static cc.kune.chat.shared.ChatConstants.TYPE_ROOM;
+import static cc.kune.chat.shared.ChatConstants.TYPE_ROOT;
+import cc.kune.core.client.actions.ActionRegistryByType;
+import cc.kune.core.client.i18n.I18nUITranslationService;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.client.state.Session;
+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.ContentViewerOptionsMenu;
+import cc.kune.gspace.client.actions.RefreshContentMenuItem;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class ChatClientActions extends AbstractFoldableToolActions {
+
+ final String[] all = { TYPE_ROOT, TYPE_ROOM };
+ final String[] containers = { TYPE_ROOT, TYPE_ROOM };
+ final String[] containersNoRoot = { TYPE_ROOM };
+ final String[] contents = {};
+
+ @Inject
+ public ChatClientActions(final I18nUITranslationService i18n, final Session session,
+ final StateManager stateManager, final ActionRegistryByType registry, final CoreResources res,
+ final Provider<RefreshContentMenuItem> refresh, final Provider<NewRoomBtn> newRoomBtn,
+ final Provider<OpenRoomMenuItem> openRoomMenuItem, final Provider<GoParentChatBtn> folderGoUp,
+ final Provider<OpenRoomArchiveMenuItem> openRoomArchiveMenuItem,
+ final Provider<OpenRoomBtn> openRoomBtn,
+ final Provider<ContentViewerOptionsMenu> optionsMenuContent) {
+ super(session, stateManager, i18n, registry);
+ actionsRegistry.addAction(ActionGroups.VIEW, optionsMenuContent, all);
+ actionsRegistry.addAction(ActionGroups.VIEW, refresh, all);
+ actionsRegistry.addAction(ActionGroups.VIEW, newRoomBtn, TYPE_ROOT);
+ actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.VIEW, openRoomBtn, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.MENUITEM, openRoomMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.MENUITEM, openRoomArchiveMenuItem, containersNoRoot);
+ }
+
+ @Override
+ protected void createPostSessionInitActions() {
+ }
+}
Property changes on: trunk/src/main/java/cc/kune/chat/client/actions/ChatClientActions.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/chat/client/actions/GoParentChatBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/GoParentChatBtn.java (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/actions/GoParentChatBtn.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -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.chat.client.actions;
+
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.actions.GoParentContainerBtn;
+
+import com.google.inject.Inject;
+
+public class GoParentChatBtn extends GoParentContainerBtn {
+
+ @Inject
+ public GoParentChatBtn(final I18nTranslationService i18n, final GoParentContainerAction action,
+ final CoreResources res) {
+ super(i18n, action, res);
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/chat/client/actions/GoParentChatBtn.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/chat/client/actions/NewRoomBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/NewRoomBtn.java (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/actions/NewRoomBtn.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -0,0 +1,96 @@
+package cc.kune.chat.client.actions;
+
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.common.client.ui.dialogs.PromptTopDialog;
+import cc.kune.common.client.ui.dialogs.PromptTopDialog.Builder;
+import cc.kune.common.client.utils.TextUtils;
+import cc.kune.core.client.actions.RolAction;
+import cc.kune.core.client.resources.CoreMessages;
+import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
+import cc.kune.core.client.rpcservices.ContentServiceAsync;
+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.StateContainerDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class NewRoomBtn extends ButtonDescriptor {
+
+ public static class NewRoomAction extends RolAction {
+
+ private static final String CANCEL_ID = "k-nrbt-cancel";
+ private static final String CREATE_ID = "k-nrbt-create";
+ private static final String ID = "k-nrbt-dialog";
+ private static final String TEXTBOX_ID = "k-nrbt-textbox";
+ private final Provider<ContentServiceAsync> contentService;
+ private final I18nTranslationService i18n;
+ private final Session session;
+ private final StateManager stateManager;
+
+ @Inject
+ public NewRoomAction(final Session session, final StateManager stateManager,
+ final I18nTranslationService i18n, final Provider<ContentServiceAsync> contentService) {
+ super(AccessRolDTO.Administrator, true);
+ this.session = session;
+ this.stateManager = stateManager;
+ this.i18n = i18n;
+ this.contentService = contentService;
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ final Builder builder = new PromptTopDialog.Builder(ID, "Name of the new chatroom?", false, true);
+ builder.width("200px").height("50px").firstButtonTitle(i18n.t("Create")).sndButtonTitle(
+ i18n.t("Cancel")).firstButtonId(CREATE_ID).sndButtonId(CANCEL_ID);
+ builder.regex(TextUtils.UNIX_NAME).regexText(
+ i18n.t("The name must contain only characters, numbers and dashes")).textboxId(TEXTBOX_ID);
+ builder.minLength(3).maxLength(15).allowBlank(false).minLengthText(
+ CoreMessages.FIELD_MUST_BE_BETWEEN_3_AND_15_NO_CHARS).maxLengthText(
+ CoreMessages.FIELD_MUST_BE_BETWEEN_3_AND_15_NO_CHARS);
+ final PromptTopDialog diag = builder.build();
+ diag.showCentered();
+ diag.focusOnTextBox();
+ diag.getSecondBtn().addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(final ClickEvent event) {
+ diag.hide();
+ }
+ });
+ diag.getFirstBtn().addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(final ClickEvent event) {
+ if (diag.isValid()) {
+ NotifyUser.showProgressProcessing();
+ final String groupShortName = session.getCurrentState().getGroup().getShortName();
+ contentService.get().addRoom(session.getUserHash(),
+ session.getContainerState().getRootContainer().getStateToken(),
+ groupShortName + "-" + diag.getText(), new AsyncCallbackSimple<StateContainerDTO>() {
+ @Override
+ public void onSuccess(final StateContainerDTO state) {
+ stateManager.setRetrievedStateAndGo(state);
+ NotifyUser.hideProgress();
+ NotifyUser.info(i18n.t("Chatroom created"));
+ }
+ });
+ }
+ }
+ });
+ }
+ }
+
+ @Inject
+ public NewRoomBtn(final I18nTranslationService i18n, final NewRoomAction action, final NavResources res) {
+ super(action);
+ this.withText(i18n.t("New room")).withToolTip(i18n.t("Create a new chat room")).withStyles(
+ "k-def-docbtn, k-fr").withIcon(res.roomAdd());
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/chat/client/actions/NewRoomBtn.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/chat/client/actions/OpenChatAction.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/OpenChatAction.java (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/actions/OpenChatAction.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -0,0 +1,32 @@
+package cc.kune.chat.client.actions;
+
+import cc.kune.chat.client.ChatClient;
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.core.client.actions.RolAction;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.shared.dto.AbstractContentSimpleDTO;
+import cc.kune.core.shared.dto.AccessRolDTO;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class OpenChatAction extends RolAction {
+
+ private final Provider<ChatClient> chatClient;
+ private final Session session;
+
+ @Inject
+ public OpenChatAction(final Provider<ChatClient> chatClient, final Session session) {
+ super(AccessRolDTO.Viewer, true);
+ this.chatClient = chatClient;
+ this.session = session;
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ final ChatClient chat = chatClient.get();
+ final String roomName = ((AbstractContentSimpleDTO) event.getTarget()).getName();
+ chat.joinRoom(roomName, session.getCurrentUserInfo().getShortName());
+ chat.show();
+ }
+}
\ No newline at end of file
Property changes on: trunk/src/main/java/cc/kune/chat/client/actions/OpenChatAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/chat/client/actions/OpenRoomArchiveMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/OpenRoomArchiveMenuItem.java (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/actions/OpenRoomArchiveMenuItem.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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.chat.client.actions;
+
+import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.actions.OpenContentMenuItem;
+
+import com.google.inject.Inject;
+
+public class OpenRoomArchiveMenuItem extends OpenContentMenuItem {
+
+ @Inject
+ public OpenRoomArchiveMenuItem(final I18nTranslationService i18n, final OpenContentAction action,
+ final NavResources res) {
+ super(i18n, action, res);
+ this.withText(i18n.t("Open archive")).withToolTip(
+ i18n.t("Open the conversations archive of this room"));
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/chat/client/actions/OpenRoomArchiveMenuItem.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/chat/client/actions/OpenRoomBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/OpenRoomBtn.java (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/actions/OpenRoomBtn.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -0,0 +1,17 @@
+package cc.kune.chat.client.actions;
+
+import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
+import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+
+public class OpenRoomBtn extends ButtonDescriptor {
+
+ @Inject
+ public OpenRoomBtn(final I18nTranslationService i18n, final OpenChatAction action,
+ final NavResources res) {
+ super(action);
+ this.withText(i18n.t("Enter to this room")).withIcon(res.room()).withStyles("k-def-docbtn, k-fr");
+ }
+}
\ No newline at end of file
Property changes on: trunk/src/main/java/cc/kune/chat/client/actions/OpenRoomBtn.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/chat/client/actions/OpenRoomMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/OpenRoomMenuItem.java (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/actions/OpenRoomMenuItem.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -0,0 +1,17 @@
+package cc.kune.chat.client.actions;
+
+import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
+import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+
+public class OpenRoomMenuItem extends MenuItemDescriptor {
+
+ @Inject
+ public OpenRoomMenuItem(final I18nTranslationService i18n, final OpenChatAction action,
+ final NavResources res) {
+ super(action);
+ this.withText(i18n.t("Enter to this room")).withIcon(res.room());
+ }
+}
\ No newline at end of file
Property changes on: trunk/src/main/java/cc/kune/chat/client/actions/OpenRoomMenuItem.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/src/main/java/cc/kune/chat/server (from rev 1395, trunk/src/main/java/org/ourproject/kune/chat/server)
Added: trunk/src/main/java/cc/kune/chat/server/ChatManager.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/server/ChatManager.java (rev 0)
+++ trunk/src/main/java/cc/kune/chat/server/ChatManager.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -0,0 +1,11 @@
+package cc.kune.chat.server;
+
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.domain.Container;
+import cc.kune.domain.User;
+
+public interface ChatManager {
+
+ Container addRoom(String userHash, User user, StateToken parentToken, String roomName, String subject);
+
+}
Property changes on: trunk/src/main/java/cc/kune/chat/server/ChatManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/chat/server/ChatManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/server/ChatManagerDefault.java (rev 0)
+++ trunk/src/main/java/cc/kune/chat/server/ChatManagerDefault.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -0,0 +1,57 @@
+package cc.kune.chat.server;
+
+import cc.kune.chat.shared.ChatConstants;
+import cc.kune.core.client.errors.AccessViolationException;
+import cc.kune.core.client.errors.ContentNotFoundException;
+import cc.kune.core.client.errors.GroupNotFoundException;
+import cc.kune.core.server.content.ContentUtils;
+import cc.kune.core.server.content.CreationService;
+import cc.kune.core.server.manager.GroupManager;
+import cc.kune.core.server.xmpp.ChatConnection;
+import cc.kune.core.server.xmpp.XmppManager;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.domain.Container;
+import cc.kune.domain.User;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+ at Singleton
+public class ChatManagerDefault implements ChatManager {
+
+ private final CreationService creationService;
+ private final GroupManager groupManager;
+ private final XmppManager xmppManager;
+
+ @Inject
+ public ChatManagerDefault(final XmppManager xmppManager, final GroupManager groupManager,
+ final CreationService creationService) {
+ this.xmppManager = xmppManager;
+ this.groupManager = groupManager;
+ this.creationService = creationService;
+ }
+
+ @Override
+ public Container addRoom(final String userHash, final User user, final StateToken parentToken,
+ final String roomName, final String subject) {
+ final String groupShortName = parentToken.getGroup();
+ final String userShortName = user.getShortName();
+ final ChatConnection connection = xmppManager.login(userShortName, user.getPassword(), userHash);
+ xmppManager.createRoom(connection, roomName, userShortName + userHash, subject);
+ xmppManager.disconnect(connection);
+ try {
+ return creationService.createFolder(groupManager.findByShortName(groupShortName),
+ ContentUtils.parseId(parentToken.getFolder()), roomName, user.getLanguage(),
+ ChatConstants.TYPE_ROOM);
+ } catch (final ContentNotFoundException e) {
+ xmppManager.destroyRoom(connection, roomName);
+ throw new ContentNotFoundException();
+ } catch (final AccessViolationException e) {
+ xmppManager.destroyRoom(connection, roomName);
+ throw new AccessViolationException();
+ } catch (final GroupNotFoundException e) {
+ xmppManager.destroyRoom(connection, roomName);
+ throw new GroupNotFoundException();
+ }
+ }
+}
Property changes on: trunk/src/main/java/cc/kune/chat/server/ChatManagerDefault.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/chat/server/ChatServerModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/server/ChatServerModule.java 2011-05-15 22:23:33 UTC (rev 1395)
+++ trunk/src/main/java/cc/kune/chat/server/ChatServerModule.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
-package org.ourproject.kune.chat.server;
+package cc.kune.chat.server;
import com.google.inject.AbstractModule;
Modified: trunk/src/main/java/cc/kune/chat/server/ChatServerTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/server/ChatServerTool.java 2011-05-15 22:23:33 UTC (rev 1395)
+++ trunk/src/main/java/cc/kune/chat/server/ChatServerTool.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -17,16 +17,16 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
-package org.ourproject.kune.chat.server;
+package cc.kune.chat.server;
-import org.ourproject.kune.chat.client.ChatClientTool;
-
+import cc.kune.chat.shared.ChatConstants;
import cc.kune.core.client.errors.ContainerNotPermittedException;
import cc.kune.core.server.content.ContainerManager;
import cc.kune.core.server.manager.ToolConfigurationManager;
import cc.kune.core.server.tool.ServerTool;
import cc.kune.core.server.tool.ServerToolRegistry;
import cc.kune.core.server.tool.ServerToolTarget;
+import cc.kune.core.shared.i18n.I18nTranslationService;
import cc.kune.domain.Container;
import cc.kune.domain.Content;
import cc.kune.domain.Group;
@@ -36,24 +36,25 @@
import com.google.inject.Inject;
public class ChatServerTool implements ServerTool {
- public static final String NAME = "chats";
- public static final String ROOT_NAME = "chat rooms";
- public static final String TYPE_CHAT = ChatClientTool.TYPE_CHAT;
- public static final String TYPE_ROOM = ChatClientTool.TYPE_ROOM;
- public static final String TYPE_ROOT = ChatClientTool.TYPE_ROOT;
+
+ private final ChatManagerDefault chatManager;
private final ToolConfigurationManager configurationManager;
private final ContainerManager containerManager;
+ private final I18nTranslationService i18n;
@Inject
public ChatServerTool(final ToolConfigurationManager configurationManager,
- final ContainerManager containerManager) {
+ final ContainerManager containerManager, final ChatManagerDefault chatManager,
+ final I18nTranslationService i18n) {
this.configurationManager = configurationManager;
this.containerManager = containerManager;
+ this.chatManager = chatManager;
+ this.i18n = i18n;
}
private void checkContainerTypeId(final String parentTypeId, final String typeId) {
- if (typeId.equals(TYPE_ROOM)) {
- if (!parentTypeId.equals(TYPE_ROOT)) {
+ if (typeId.equals(ChatConstants.TYPE_ROOM)) {
+ if (!parentTypeId.equals(ChatConstants.TYPE_ROOT)) {
throw new ContainerNotPermittedException();
}
// ok valid container
@@ -69,7 +70,7 @@
@Override
public void checkTypesBeforeContentCreation(final String parentTypeId, final String typeId) {
- if (!parentTypeId.equals(TYPE_ROOM)) {
+ if (!parentTypeId.equals(ChatConstants.TYPE_ROOM)) {
throw new ContainerNotPermittedException();
}
// in the future chat history checks
@@ -77,12 +78,12 @@
@Override
public String getName() {
- return NAME;
+ return ChatConstants.NAME;
}
@Override
public String getRootName() {
- return ROOT_NAME;
+ return ChatConstants.NAME;
}
@Override
@@ -93,9 +94,13 @@
@Override
public Group initGroup(final User user, final Group group, final Object... otherVars) {
final ToolConfiguration config = new ToolConfiguration();
- final Container container = containerManager.createRootFolder(group, NAME, ROOT_NAME, TYPE_ROOT);
+ final Container container = containerManager.createRootFolder(group, ChatConstants.NAME,
+ ChatConstants.NAME, ChatConstants.TYPE_ROOT);
config.setRoot(container);
- group.setToolConfig(NAME, config);
+ final String groupShortName = group.getShortName();
+ chatManager.addRoom("none", user, container.getStateToken(), groupShortName,
+ i18n.t("Welcome to the [%s] public chat room", groupShortName));
+ group.setToolConfig(ChatConstants.NAME, config);
configurationManager.persist(config);
return group;
}
Added: trunk/src/main/java/cc/kune/chat/shared/ChatConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/shared/ChatConstants.java (rev 0)
+++ trunk/src/main/java/cc/kune/chat/shared/ChatConstants.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -0,0 +1,31 @@
+/*
+ *
+ * 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.chat.shared;
+
+public final class ChatConstants {
+
+ public static final String NAME = "chats";
+ public static final String TYPE_CHAT = NAME + "." + "chat";
+ public static final String TYPE_ROOM = NAME + "." + "room";
+ public static final String TYPE_ROOT = NAME + "." + "root";
+
+ private ChatConstants() {
+ }
+}
Property changes on: trunk/src/main/java/cc/kune/chat/shared/ChatConstants.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/client/KuneEntryPoint.java
===================================================================
--- trunk/src/main/java/cc/kune/client/KuneEntryPoint.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/main/java/cc/kune/client/KuneEntryPoint.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -76,10 +76,11 @@
ginjector.getUserNotifierPresenter();
ginjector.getSpinerPresenter();
ginjector.getGroupMembersPresenter();
+ ginjector.getBartersParts();
+ ginjector.getBlogsParts();
+ ginjector.getChatParts();
ginjector.getDocsParts();
- ginjector.getBlogsParts();
ginjector.getMeetingsParts();
- ginjector.getBartersParts();
ginjector.getWikiParts();
ginjector.getSiteLogoPresenter();
ginjector.getSpacesTabPresenter();
Modified: trunk/src/main/java/cc/kune/client/KuneGinjector.java
===================================================================
--- trunk/src/main/java/cc/kune/client/KuneGinjector.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/main/java/cc/kune/client/KuneGinjector.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -25,7 +25,7 @@
import cc.kune.blogs.client.BlogsGinjector;
import cc.kune.chat.client.ChatClient;
import cc.kune.chat.client.ChatGinModule;
-import cc.kune.chat.client.ChatParts;
+import cc.kune.chat.client.ChatGinjector;
import cc.kune.common.client.actions.gwtui.GwtGuiProvider;
import cc.kune.common.client.actions.gxtui.GxtGuiProvider;
import cc.kune.common.client.actions.ui.bind.GuiProvider;
@@ -77,7 +77,7 @@
PSpaceGinModule.class, GSpaceGinModule.class, DocsGinModule.class, BlogsGinModule.class,
WikiGinModule.class, BartersGinModule.class, MeetingsGinModule.class })
public interface KuneGinjector extends Ginjector, GSpaceGinjector, DocsGinjector, BlogsGinjector,
- WikiGinjector, BartersGinjector, MeetingsGinjector {
+ WikiGinjector, BartersGinjector, MeetingsGinjector, ChatGinjector {
/*
* You have to add here all the GWTPresenters (as Provider or AsyncProvider)
@@ -88,8 +88,6 @@
ChatClient getChatClient();
- ChatParts getChatParts();
-
AsyncProvider<CookiesManager> getCookiesManager();
CoreParts getCoreParts();
Modified: trunk/src/main/java/cc/kune/client/OnAppStartFactory.java
===================================================================
--- trunk/src/main/java/cc/kune/client/OnAppStartFactory.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/main/java/cc/kune/client/OnAppStartFactory.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -19,26 +19,31 @@
*/
package cc.kune.client;
+import cc.kune.barters.client.BartersClientTool;
import cc.kune.blogs.client.BlogsClientTool;
+import cc.kune.chat.client.ChatClientTool;
import cc.kune.core.client.init.AppStartEvent;
import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
import cc.kune.core.client.state.Session;
import cc.kune.docs.client.DocsClientTool;
+import cc.kune.meets.client.MeetingsClientTool;
+import cc.kune.wiki.client.WikiClientTool;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class OnAppStartFactory {
- @Inject
- public OnAppStartFactory(final Session session, final Provider<DocsClientTool> docsClientTool,
- final Provider<BlogsClientTool> blogsClientTool) {
- session.onAppStart(true, new AppStartHandler() {
- @Override
- public void onAppStart(final AppStartEvent event) {
- docsClientTool.get();
- blogsClientTool.get();
- }
- });
- }
+ @Inject
+ public OnAppStartFactory(final Session session, final Provider<DocsClientTool> docsClientTool,
+ final Provider<BlogsClientTool> blogsClientTool,
+ final Provider<BartersClientTool> bartersClientTool,
+ final Provider<MeetingsClientTool> meetsClientTool,
+ final Provider<ChatClientTool> chatsClientTool, final Provider<WikiClientTool> wikiClientTool) {
+ session.onAppStart(true, new AppStartHandler() {
+ @Override
+ public void onAppStart(final AppStartEvent event) {
+ }
+ });
+ }
}
Modified: trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -126,7 +126,7 @@
private final PopupTopPanel popup;
private String width;
- private BasicTopDialog(final Builder builder) {
+ protected BasicTopDialog(final Builder builder) {
popup = new PopupTopPanel(builder.autohide, builder.modal);
popup.add(this);
popup.ensureDebugId(builder.dialogId);
@@ -141,8 +141,8 @@
super.setSecondBtnId(builder.sndButtonId);
super.setSecondBtnTabIndex(builder.tabIndexStart + 1);
super.getTitleText().setText(builder.title);
- this.setWidth(builder.width);
- this.setHeight(builder.height);
+ setWidthImpl(builder.width);
+ setHeightImpl(builder.height);
setSizes();
Window.addResizeHandler(new ResizeHandler() {
@Override
@@ -171,6 +171,10 @@
@Override
public void setHeight(final String height) {
+ setHeightImpl(height);
+ }
+
+ private void setHeightImpl(final String height) {
this.height = height;
setSizes();
}
@@ -178,8 +182,7 @@
@Override
public void setSize(final String width, final String height) {
this.width = width;
- this.height = height;
- setSizes();
+ setHeightImpl(height);
}
private void setSizes() {
@@ -213,6 +216,10 @@
@Override
public void setWidth(final String width) {
+ setWidthImpl(width);
+ }
+
+ private void setWidthImpl(final String width) {
this.width = width;
setSizes();
}
Added: trunk/src/main/java/cc/kune/common/client/ui/dialogs/PromptTopDialog.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/dialogs/PromptTopDialog.java (rev 0)
+++ trunk/src/main/java/cc/kune/common/client/ui/dialogs/PromptTopDialog.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -0,0 +1,103 @@
+package cc.kune.common.client.ui.dialogs;
+
+import com.extjs.gxt.ui.client.widget.form.TextField;
+
+public class PromptTopDialog extends BasicTopDialog {
+
+ public static class Builder extends BasicTopDialog.Builder {
+
+ private boolean allowBlank;
+ private int maxLength;
+ private String maxLengthText;
+ private int minLength;
+ private String minLengthText;
+ private String regex;
+ private String regexText;
+ private String textboxId;
+
+ public Builder(final String dialogId, final String promptText, final boolean autohide,
+ final boolean modal) {
+ super(dialogId, autohide, modal);
+ super.title(promptText);
+ }
+
+ public Builder allowBlank(final boolean allowBlank) {
+ this.allowBlank = allowBlank;
+ return this;
+ }
+
+ @Override
+ public PromptTopDialog build() {
+ final PromptTopDialog dialog = new PromptTopDialog(this);
+ return dialog;
+ }
+
+ public Builder maxLength(final int maxLength) {
+ this.maxLength = maxLength;
+ return this;
+ }
+
+ public Builder maxLengthText(final String maxLengthText) {
+ this.maxLengthText = maxLengthText;
+ return this;
+ }
+
+ public Builder minLength(final int minLength) {
+ this.minLength = minLength;
+ return this;
+ }
+
+ public Builder minLengthText(final String minLengthText) {
+ this.minLengthText = minLengthText;
+ return this;
+ }
+
+ public Builder regex(final String regex) {
+ this.regex = regex;
+ return this;
+ }
+
+ public Builder regexText(final String regexText) {
+ this.regexText = regexText;
+ return this;
+ }
+
+ public Builder textboxId(final String textboxId) {
+ this.textboxId = textboxId;
+ return this;
+ }
+ }
+
+ private final TextField<String> textField;
+
+ protected PromptTopDialog(final Builder builder) {
+ super(builder);
+ textField = new TextField<String>();
+ textField.setRegex(builder.regex);
+ textField.getMessages().setRegexText(builder.regexText);
+ textField.getMessages().setMinLengthText(builder.minLengthText);
+ textField.getMessages().setMaxLengthText(builder.maxLengthText);
+ textField.setId(builder.textboxId);
+ textField.setMinLength(builder.minLength);
+ textField.setMaxLength(builder.maxLength);
+ textField.setAllowBlank(builder.allowBlank);
+ super.getInnerPanel().add(textField);
+ }
+
+ public void focusOnTextBox() {
+ textField.focus();
+ }
+
+ public String getText() {
+ return textField.getValue();
+ }
+
+ public boolean isValid() {
+ return textField.isValid();
+ }
+
+ public void setText(final String text) {
+ textField.setValue(text);
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/common/client/ui/dialogs/PromptTopDialog.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/core/client/resources/CoreMessages.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/resources/CoreMessages.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/main/java/cc/kune/core/client/resources/CoreMessages.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -26,6 +26,7 @@
public final static String ENT_LOGO_SELECTOR_NORMAL_TITLE = "Logo";
public final static String ENT_LOGO_SELECTOR_PERSON_TITLE = "Avatar";
public final static String FIELD_MUST_BE_BETWEEN_3_AND_15 = "The name must be between 3 and 15 lowercase characters. It can only contain Western characters and numbers";
+ public final static String FIELD_MUST_BE_BETWEEN_3_AND_15_NO_CHARS = "The name must be between 3 and 15 lowercase characters.";
public final static String GROUP_OPTIONS_DIALOG_TITLE = "Group options";
public final static String INCORRECT_NICKNAME_EMAIL_OR_PASSWORD = "The username/password is incorrect";
public final static String MEMBERS_NOT_PUBLIC = "The members of this group are not public";
Modified: trunk/src/main/java/cc/kune/core/server/KuneRackModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/KuneRackModule.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/main/java/cc/kune/core/server/KuneRackModule.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -25,6 +25,7 @@
import cc.kune.barters.server.BarterServerModule;
import cc.kune.blogs.server.BlogServerModule;
+import cc.kune.chat.server.ChatServerModule;
import cc.kune.core.client.rpcservices.ContentService;
import cc.kune.core.client.rpcservices.GroupService;
import cc.kune.core.client.rpcservices.I18nService;
@@ -152,7 +153,7 @@
builder.use(new BarterServerModule());
builder.use(new MeetingServerModule());
builder.use(new WikiServerModule());
- // builder.use(new ChatServerModule());
+ builder.use(new ChatServerModule());
// builder.use(new GalleryServerModule());
builder.use(new RESTServicesModule());
builder.use(configModule);
Modified: trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -20,6 +20,8 @@
package cc.kune.core.server;
import static cc.kune.core.server.OutermostCallInterceptor.outermostCall;
+import cc.kune.chat.server.ChatManager;
+import cc.kune.chat.server.ChatManagerDefault;
import cc.kune.core.client.rpcservices.ContentService;
import cc.kune.core.client.rpcservices.GroupService;
import cc.kune.core.client.rpcservices.I18nService;
@@ -119,6 +121,7 @@
bind(LicenseManager.class).to(LicenseManagerDefault.class);
bind(SocialNetworkManager.class).to(SocialNetworkManagerDefault.class);
bind(XmppManager.class).to(XmppManagerDefault.class);
+ bind(ChatManager.class).to(ChatManagerDefault.class);
bind(RateManager.class).to(RateManagerDefault.class);
bind(I18nCountryManager.class).to(I18nCountryManagerDefault.class);
bind(I18nLanguageManager.class).to(I18nLanguageManagerDefault.class);
Modified: trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -23,6 +23,7 @@
import javax.persistence.NoResultException;
+import cc.kune.chat.server.ChatManager;
import cc.kune.core.client.errors.AccessViolationException;
import cc.kune.core.client.errors.ContentNotFoundException;
import cc.kune.core.client.errors.DefaultException;
@@ -73,6 +74,7 @@
@Singleton
public class ContentRPC implements ContentService, RPC {
private final AccessService accessService;
+ private final ChatManager chatManager;
private final ContainerManager containerManager;
private final ContentManager contentManager;
private final CreationService creationService;
@@ -91,7 +93,7 @@
final StateService stateService, final CreationService creationService,
final GroupManager groupManager, final XmppManager xmppManager,
final ContentManager contentManager, final ContainerManager containerManager,
- final TagUserContentManager tagManager, final Mapper mapper) {
+ final TagUserContentManager tagManager, final Mapper mapper, final ChatManager chatManager) {
this.finderService = finderService;
this.userSessionProvider = userSessionProvider;
this.accessService = accessService;
@@ -104,6 +106,7 @@
this.containerManager = containerManager;
this.tagManager = tagManager;
this.mapper = mapper;
+ this.chatManager = chatManager;
}
@Override
@@ -151,34 +154,12 @@
@Override
@Authenticated
- @Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Editor)
+ @Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Administrator)
@Transactional
public StateContainerDTO addRoom(final String userHash, final StateToken parentToken,
final String roomName) throws DefaultException {
- // final String groupShortName = parentToken.getGroup();
- // final User user = getCurrentUser();
- // final String userShortName = user.getShortName();
- // final ChatConnection connection = xmppManager.login(userShortName,
- // user.getPassword(), userHash);
- // xmppManager.createRoom(connection, roomName, userShortName +
- // userHash);
- // xmppManager.disconnect(connection);
- // try {
- // final Container container = createFolder(groupShortName,
- // ContentUtils.parseId(parentToken.getFolder()),
- // roomName, ChatServerTool.TYPE_ROOM);
- // return getState(user, container);
- // } catch (final ContentNotFoundException e) {
- // xmppManager.destroyRoom(connection, roomName);
- // throw new ContentNotFoundException();
- // } catch (final AccessViolationException e) {
- // xmppManager.destroyRoom(connection, roomName);
- // throw new AccessViolationException();
- // } catch (final GroupNotFoundException e) {
- // xmppManager.destroyRoom(connection, roomName);
- // throw new GroupNotFoundException();
- // }
- return null;
+ final User user = getCurrentUser();
+ return getState(user, chatManager.addRoom(userHash, user, parentToken, roomName, ""));
}
private StateContentDTO createContent(final StateToken parentToken, final String title,
Modified: trunk/src/main/java/cc/kune/core/server/xmpp/XmppManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/xmpp/XmppManager.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/main/java/cc/kune/core/server/xmpp/XmppManager.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -25,20 +25,20 @@
public interface XmppManager {
- Room createRoom(ChatConnection connection, String roomName, String ownerAlias);
+ Room createRoom(ChatConnection connection, String roomName, String ownerAlias, String subject);
- void destroyRoom(ChatConnection conn, String roomName);
+ void destroyRoom(ChatConnection conn, String roomName);
- void disconnect(ChatConnection connection);
+ void disconnect(ChatConnection connection);
- Collection<RosterEntry> getRoster(ChatConnection connection);
+ Collection<RosterEntry> getRoster(ChatConnection connection);
- Room joinRoom(ChatConnection connection, String roomName, String alias);
+ Room joinRoom(ChatConnection connection, String roomName, String alias);
- ChatConnection login(String userName, String password, String resource);
+ ChatConnection login(String userName, String password, String resource);
- void sendMessage(Room room, String message);
+ void sendMessage(Room room, String message);
- void sendMessage(String userName, String message);
+ void sendMessage(String userName, String message);
}
Modified: trunk/src/main/java/cc/kune/core/server/xmpp/XmppManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/xmpp/XmppManagerDefault.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/main/java/cc/kune/core/server/xmpp/XmppManagerDefault.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -39,6 +39,7 @@
import org.jivesoftware.smackx.FormField;
import org.jivesoftware.smackx.muc.MultiUserChat;
+import cc.kune.common.client.utils.TextUtils;
import cc.kune.core.server.properties.ChatProperties;
import com.google.inject.Inject;
@@ -75,7 +76,8 @@
}
@Override
- public Room createRoom(final ChatConnection conn, final String roomName, final String alias) {
+ public Room createRoom(final ChatConnection conn, final String roomName, final String alias,
+ final String subject) {
final XmppConnection xConn = (XmppConnection) conn;
final MultiUserChat muc = new MultiUserChat(xConn.getConn(), getRoomName(roomName));
try {
@@ -83,6 +85,9 @@
configure(muc);
final XmppRoom room = new XmppRoom(muc, alias);
muc.addMessageListener(room);
+ if (TextUtils.notEmpty(subject)) {
+ muc.changeSubject(subject);
+ }
return room;
} catch (final XMPPException e) {
throw new ChatException(e);
Added: trunk/src/main/java/cc/kune/core/shared/dto/AbstractContentSimpleDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/AbstractContentSimpleDTO.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/shared/dto/AbstractContentSimpleDTO.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -0,0 +1,41 @@
+package cc.kune.core.shared.dto;
+
+import cc.kune.core.shared.domain.utils.StateToken;
+
+import com.google.gwt.user.client.rpc.IsSerializable;
+
+public abstract class AbstractContentSimpleDTO implements IsSerializable {
+
+ protected Long id;
+ private StateToken stateToken;
+ private String typeId;
+
+ public Long getId() {
+ return id;
+ }
+
+ public abstract String getName();
+
+ public StateToken getStateToken() {
+ return stateToken;
+ }
+
+ public String getTypeId() {
+ return typeId;
+ }
+
+ public void setId(final Long id) {
+ this.id = id;
+ }
+
+ public abstract void setName(final String name);
+
+ public void setStateToken(final StateToken stateToken) {
+ this.stateToken = stateToken;
+ }
+
+ public void setTypeId(final String typeId) {
+ this.typeId = typeId;
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/core/shared/dto/AbstractContentSimpleDTO.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/core/shared/dto/ContainerSimpleDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/ContainerSimpleDTO.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/main/java/cc/kune/core/shared/dto/ContainerSimpleDTO.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -19,59 +19,28 @@
*/
package cc.kune.core.shared.dto;
-import cc.kune.core.shared.domain.utils.StateToken;
-
-import com.google.gwt.user.client.rpc.IsSerializable;
-
/**
* A item can be both a container or a content
*
*/
-public class ContainerSimpleDTO implements IsSerializable {
- private Long id;
- private String name;
- private String typeId;
- private StateToken stateToken;
- private Long parentFolderId;
+public class ContainerSimpleDTO extends AbstractContentSimpleDTO {
+ private String name;
+ private Long parentFolderId;
- public Long getId() {
- return id;
- }
+ public String getName() {
+ return name;
+ }
- public String getName() {
- return name;
- }
+ public Long getParentFolderId() {
+ return parentFolderId;
+ }
- public Long getParentFolderId() {
- return parentFolderId;
- }
+ public void setName(final String name) {
+ this.name = name;
+ }
- public StateToken getStateToken() {
- return stateToken;
- }
+ public void setParentFolderId(final Long parentFolderId) {
+ this.parentFolderId = parentFolderId;
+ }
- public String getTypeId() {
- return typeId;
- }
-
- public void setId(final Long id) {
- this.id = id;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- public void setParentFolderId(final Long parentFolderId) {
- this.parentFolderId = parentFolderId;
- }
-
- public void setStateToken(final StateToken stateToken) {
- this.stateToken = stateToken;
- }
-
- public void setTypeId(final String typeId) {
- this.typeId = typeId;
- }
-
}
Modified: trunk/src/main/java/cc/kune/core/shared/dto/ContentSimpleDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/ContentSimpleDTO.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/main/java/cc/kune/core/shared/dto/ContentSimpleDTO.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -21,26 +21,16 @@
import cc.kune.core.shared.domain.ContentStatus;
import cc.kune.core.shared.domain.utils.AccessRights;
-import cc.kune.core.shared.domain.utils.StateToken;
-import com.google.gwt.user.client.rpc.IsSerializable;
+public class ContentSimpleDTO extends AbstractContentSimpleDTO {
-public class ContentSimpleDTO implements IsSerializable {
-
- private Long id;
private BasicMimeTypeDTO mimeType;
private Long modifiedOn;
private AccessRights rights;
- private StateToken stateToken;
private ContentStatus status;
private String title;
- private String typeId;
private String waveId;
- public Long getId() {
- return id;
- }
-
public BasicMimeTypeDTO getMimeType() {
return mimeType;
}
@@ -49,14 +39,15 @@
return modifiedOn;
}
+ @Override
+ public String getName() {
+ return title;
+ }
+
public AccessRights getRights() {
return rights;
}
- public StateToken getStateToken() {
- return stateToken;
- }
-
public ContentStatus getStatus() {
return status;
}
@@ -65,18 +56,10 @@
return title;
}
- public String getTypeId() {
- return typeId;
- }
-
public String getWaveId() {
return waveId;
}
- public void setId(final Long id) {
- this.id = id;
- }
-
public void setMimeType(final BasicMimeTypeDTO mimeType) {
this.mimeType = mimeType;
}
@@ -85,14 +68,15 @@
this.modifiedOn = modifiedOn;
}
+ @Override
+ public void setName(final String name) {
+ this.title = name;
+ }
+
public void setRights(final AccessRights rights) {
this.rights = rights;
}
- public void setStateToken(final StateToken stateToken) {
- this.stateToken = stateToken;
- }
-
public void setStatus(final ContentStatus status) {
this.status = status;
}
@@ -101,10 +85,6 @@
this.title = title;
}
- public void setTypeId(final String typeId) {
- this.typeId = typeId;
- }
-
public void setWaveId(final String waveId) {
this.waveId = waveId;
}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/DelContainerMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/DelContainerMenuItem.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/DelContainerMenuItem.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -30,6 +30,7 @@
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
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.i18n.I18nTranslationService;
import cc.kune.gspace.client.viewers.FolderViewerPresenter;
@@ -40,49 +41,49 @@
public class DelContainerMenuItem extends MenuItemDescriptor {
- public static class DelContainerAction extends RolAction {
+ public static class DelContainerAction extends RolAction {
- private final Provider<ContentServiceAsync> contentService;
- private final EventBus eventBus;
- private final I18nTranslationService i18n;
- private final Provider<FolderViewerPresenter> presenter;
- private final Session session;
- private final StateManager stateManager;
+ private final Provider<ContentServiceAsync> contentService;
+ private final EventBus eventBus;
+ private final I18nTranslationService i18n;
+ private final Provider<FolderViewerPresenter> presenter;
+ private final Session session;
+ private final StateManager stateManager;
- @Inject
- public DelContainerAction(final EventBus eventBus, final StateManager stateManager, final Session session,
- final Provider<ContentServiceAsync> contentService, final I18nTranslationService i18n,
- final Provider<FolderViewerPresenter> presenter) {
- super(AccessRolDTO.Administrator, true);
- this.eventBus = eventBus;
- this.stateManager = stateManager;
- this.session = session;
- this.contentService = contentService;
- this.i18n = i18n;
- this.presenter = presenter;
- }
-
- @Override
- public void actionPerformed(final ActionEvent event) {
- final StateToken token = (StateToken) event.getTarget();
- ConfirmAskEvent.fire(eventBus, i18n.t("Please confirm"),
- i18n.t("You will delete it with all its contents. Are you sure?"), i18n.t("Yes"), i18n.t("No"),
- null, null, new OnAcceptCallback() {
- @Override
- public void onSuccess() {
- NotifyUser.showProgress();
- NotifyUser.info("Sorry, in development");
- NotifyUser.hideProgress();
- }
- });
- }
-
+ @Inject
+ public DelContainerAction(final EventBus eventBus, final StateManager stateManager,
+ final Session session, final Provider<ContentServiceAsync> contentService,
+ final I18nTranslationService i18n, final Provider<FolderViewerPresenter> presenter) {
+ super(AccessRolDTO.Administrator, true);
+ this.eventBus = eventBus;
+ this.stateManager = stateManager;
+ this.session = session;
+ this.contentService = contentService;
+ this.i18n = i18n;
+ this.presenter = presenter;
}
- public DelContainerMenuItem(final I18nTranslationService i18n, final DelContainerAction action,
- final CoreResources res) {
- super(action);
- this.withText(i18n.t("Delete")).withIcon(res.cancel());
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ final StateToken token = ((AbstractContentSimpleDTO) event.getTarget()).getStateToken();
+ ConfirmAskEvent.fire(eventBus, i18n.t("Please confirm"),
+ i18n.t("You will delete it with all its contents. Are you sure?"), i18n.t("Yes"),
+ i18n.t("No"), null, null, new OnAcceptCallback() {
+ @Override
+ public void onSuccess() {
+ NotifyUser.showProgress();
+ NotifyUser.info("Sorry, in development");
+ NotifyUser.hideProgress();
+ }
+ });
}
+ }
+
+ public DelContainerMenuItem(final I18nTranslationService i18n, final DelContainerAction action,
+ final CoreResources res) {
+ super(action);
+ this.withText(i18n.t("Delete")).withIcon(res.cancel());
+ }
+
}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/DelContentMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/DelContentMenuItem.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/DelContentMenuItem.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -31,6 +31,7 @@
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
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.StateContentDTO;
import cc.kune.core.shared.i18n.I18nTranslationService;
@@ -42,64 +43,65 @@
public class DelContentMenuItem extends MenuItemDescriptor {
- public static class DelContentAction extends RolAction {
+ public static class DelContentAction extends RolAction {
- private final Provider<ContentServiceAsync> contentService;
- private final EventBus eventBus;
- private final I18nTranslationService i18n;
- private final Provider<FolderViewerPresenter> presenter;
- private final Session session;
- private final StateManager stateManager;
+ private final Provider<ContentServiceAsync> contentService;
+ private final EventBus eventBus;
+ private final I18nTranslationService i18n;
+ private final Provider<FolderViewerPresenter> presenter;
+ private final Session session;
+ private final StateManager stateManager;
- @Inject
- public DelContentAction(final EventBus eventBus, final StateManager stateManager, final Session session,
- final Provider<ContentServiceAsync> contentService, final I18nTranslationService i18n,
- final Provider<FolderViewerPresenter> presenter) {
- super(AccessRolDTO.Administrator, true);
- this.eventBus = eventBus;
- this.stateManager = stateManager;
- this.session = session;
- this.contentService = contentService;
- this.i18n = i18n;
- this.presenter = presenter;
- }
-
- @Override
- public void actionPerformed(final ActionEvent event) {
- final StateToken token = (StateToken) event.getTarget();
- ConfirmAskEvent.fire(eventBus, i18n.t("Please confirm"), i18n.t("Are you sure?"), i18n.t("Yes"),
- i18n.t("No"), null, null, new OnAcceptCallback() {
- @Override
- public void onSuccess() {
- NotifyUser.showProgress();
- contentService.get().delContent(session.getUserHash(), token,
- new AsyncCallbackSimple<StateContentDTO>() {
- @Override
- public void onSuccess(final StateContentDTO state) {
- // Is this necessary?
- // session.setCurrentState(state);
- final StateToken parent = token.copy().clearDocument();
- if (session.getCurrentStateToken().equals(parent)) {
- stateManager.refreshCurrentGroupState();
- // Warning: the previous action
- // is asynchronous (it gets a
- // content)
- presenter.get().refreshState();
- } else {
- stateManager.gotoStateToken(parent, false);
- }
- NotifyUser.hideProgress();
- }
- });
- }
- });
- }
-
+ @Inject
+ public DelContentAction(final EventBus eventBus, final StateManager stateManager,
+ final Session session, final Provider<ContentServiceAsync> contentService,
+ final I18nTranslationService i18n, final Provider<FolderViewerPresenter> presenter) {
+ super(AccessRolDTO.Administrator, true);
+ this.eventBus = eventBus;
+ this.stateManager = stateManager;
+ this.session = session;
+ this.contentService = contentService;
+ this.i18n = i18n;
+ this.presenter = presenter;
}
- public DelContentMenuItem(final I18nTranslationService i18n, final DelContentAction action, final CoreResources res) {
- super(action);
- this.withText(i18n.t("Delete")).withIcon(res.cancel());
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ final StateToken token = ((AbstractContentSimpleDTO) event.getTarget()).getStateToken();
+ ConfirmAskEvent.fire(eventBus, i18n.t("Please confirm"), i18n.t("Are you sure?"), i18n.t("Yes"),
+ i18n.t("No"), null, null, new OnAcceptCallback() {
+ @Override
+ public void onSuccess() {
+ NotifyUser.showProgress();
+ contentService.get().delContent(session.getUserHash(), token,
+ new AsyncCallbackSimple<StateContentDTO>() {
+ @Override
+ public void onSuccess(final StateContentDTO state) {
+ // Is this necessary?
+ // session.setCurrentState(state);
+ final StateToken parent = token.copy().clearDocument();
+ if (session.getCurrentStateToken().equals(parent)) {
+ stateManager.refreshCurrentGroupState();
+ // Warning: the previous action
+ // is asynchronous (it gets a
+ // content)
+ presenter.get().refreshState();
+ } else {
+ stateManager.gotoStateToken(parent, false);
+ }
+ NotifyUser.hideProgress();
+ }
+ });
+ }
+ });
}
+ }
+
+ public DelContentMenuItem(final I18nTranslationService i18n, final DelContentAction action,
+ final CoreResources res) {
+ super(action);
+ this.withText(i18n.t("Delete")).withIcon(res.cancel());
+ }
+
}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/OpenContentMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/OpenContentMenuItem.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/OpenContentMenuItem.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -24,32 +24,33 @@
import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
import cc.kune.core.client.resources.nav.NavResources;
import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.AbstractContentSimpleDTO;
import cc.kune.core.shared.i18n.I18nTranslationService;
import com.google.inject.Inject;
public class OpenContentMenuItem extends MenuItemDescriptor {
- public static class OpenContentAction extends AbstractExtendedAction {
+ public static class OpenContentAction extends AbstractExtendedAction {
- private final StateManager stateManager;
+ private final StateManager stateManager;
- @Inject
- public OpenContentAction(final StateManager stateManager) {
- this.stateManager = stateManager;
- }
-
- @Override
- public void actionPerformed(final ActionEvent event) {
- stateManager.gotoStateToken((StateToken) event.getTarget());
- }
-
+ @Inject
+ public OpenContentAction(final StateManager stateManager) {
+ this.stateManager = stateManager;
}
- public OpenContentMenuItem(final I18nTranslationService i18n, final OpenContentAction action, final NavResources res) {
- super(action);
- this.withText(i18n.t("Open")).withIcon(res.go());
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ stateManager.gotoStateToken(((AbstractContentSimpleDTO) event.getTarget()).getStateToken());
}
+ }
+
+ public OpenContentMenuItem(final I18nTranslationService i18n, final OpenContentAction action,
+ final NavResources res) {
+ super(action);
+ this.withText(i18n.t("Open")).withIcon(res.go());
+ }
+
}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/SetAsHomePageMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/SetAsHomePageMenuItem.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/SetAsHomePageMenuItem.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -28,6 +28,7 @@
import cc.kune.core.client.rpcservices.ContentServiceAsync;
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.ContentSimpleDTO;
import cc.kune.core.shared.i18n.I18nTranslationService;
@@ -54,7 +55,7 @@
@Override
public void actionPerformed(final ActionEvent event) {
- final StateToken token = (StateToken) event.getTarget();
+ final StateToken token = ((AbstractContentSimpleDTO) event.getTarget()).getStateToken();
NotifyUser.showProgressProcessing();
contentService.get().setAsDefaultContent(session.getUserHash(), token,
new AsyncCallbackSimple<ContentSimpleDTO>() {
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -21,10 +21,8 @@
import javax.annotation.Nonnull;
-import cc.kune.barters.shared.BartersConstants;
import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
import cc.kune.common.client.errors.UIException;
-import cc.kune.common.client.notify.NotifyUser;
import cc.kune.common.client.ui.EditEvent;
import cc.kune.common.client.ui.EditEvent.EditHandler;
import cc.kune.common.client.ui.HasEditHandler;
@@ -42,7 +40,6 @@
import cc.kune.gspace.client.actions.RenameAction;
import cc.kune.gspace.client.actions.RenameListener;
import cc.kune.gspace.client.tool.ContentViewer;
-import cc.kune.meets.shared.MeetingsConstants;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.HandlerRegistration;
@@ -168,10 +165,10 @@
// is already participant, show wave editor
if (org.waveprotocol.box.webclient.client.Session.get().isLoggedIn()) {
final String typeId = stateContent.getTypeId();
- if (typeId.equals(BartersConstants.TYPE_BARTER)
- || typeId.equals(MeetingsConstants.TYPE_MEETING)) {
- NotifyUser.important("Currently we are experiencing problems with this tool. We'll fix ASAP...");
- }
+ // if (typeId.equals(BartersConstants.TYPE_BARTER)
+ // || typeId.equals(MeetingsConstants.TYPE_MEETING)) {
+ // NotifyUser.important("Currently we are experiencing problems with this tool. We'll fix ASAP...");
+ // }
getView().setEditableContent(stateContent);
} else {
getView().setContent(stateContent);
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -23,6 +23,7 @@
import cc.kune.common.client.actions.ui.ActionSimplePanel;
import cc.kune.common.client.actions.ui.bind.GuiProvider;
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
@@ -91,7 +92,9 @@
menu.setStandalone(false);
itemWidget.setMenuVisible(false);
toolbar.add(menu);
- for (final GuiActionDescrip menuItem : item.getActionCollection()) {
+ final GuiActionDescCollection actions = item.getActionCollection();
+ toolbar.setVisible(actions.size() > 0);
+ for (final GuiActionDescrip menuItem : actions) {
menuItem.setParent(menu);
toolbar.add(menuItem);
}
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -36,6 +36,7 @@
import cc.kune.core.shared.domain.ContentStatus;
import cc.kune.core.shared.domain.utils.AccessRights;
import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.AbstractContentSimpleDTO;
import cc.kune.core.shared.dto.BasicMimeTypeDTO;
import cc.kune.core.shared.dto.ContainerDTO;
import cc.kune.core.shared.dto.ContainerSimpleDTO;
@@ -135,16 +136,19 @@
this.renameAction = renameAction;
}
- private void addItem(final String title, final String contentTypeId, final BasicMimeTypeDTO mimeType,
- final ContentStatus status, final StateToken stateToken, final StateToken parentStateToken,
- final AccessRights rights, final long modifiedOn) {
- final Object icon = getIcon(stateToken, contentTypeId, mimeType);
+ private void addItem(final AbstractContentSimpleDTO content, final BasicMimeTypeDTO mimeType,
+ final ContentStatus status, final StateToken parentStateToken, final AccessRights rights,
+ final long modifiedOn) {
+ final StateToken stateToken = content.getStateToken();
+ final String typeId = content.getTypeId();
+ final String name = content.getName();
+ final Object icon = getIcon(stateToken, typeId, mimeType);
final String tooltip = getTooltip(stateToken, mimeType);
final FolderItemDescriptor item = new FolderItemDescriptor(genId(stateToken),
- genId(parentStateToken), icon, title, tooltip, status, stateToken, modifiedOn,
- capabilitiesRegistry.isDragable(contentTypeId) && rights.isAdministrable(),
- capabilitiesRegistry.isDropable(contentTypeId) && rights.isAdministrable(),
- actionsRegistry.getCurrentActions(stateToken, contentTypeId, session.isLogged(), rights,
+ genId(parentStateToken), icon, name, tooltip, status, stateToken, modifiedOn,
+ capabilitiesRegistry.isDragable(typeId) && rights.isAdministrable(),
+ capabilitiesRegistry.isDropable(typeId) && rights.isAdministrable(),
+ actionsRegistry.getCurrentActions(content, typeId, session.isLogged(), rights,
ActionGroups.MENUITEM));
if (status.equals(ContentStatus.inTheDustbin) && !session.getShowDeletedContent()) {
// Don't show
@@ -195,16 +199,14 @@
} else {
// Folders
for (final ContainerSimpleDTO childFolder : container.getChilds()) {
- addItem(childFolder.getName(), childFolder.getTypeId(), null, ContentStatus.publishedOnline,
- childFolder.getStateToken(),
+ addItem(childFolder, null, ContentStatus.publishedOnline,
childFolder.getStateToken().copy().setFolder(childFolder.getParentFolderId()),
containerRights, FolderViewerView.NO_DATE);
}
// Other contents (docs, etc)
for (final ContentSimpleDTO content : container.getContents()) {
- addItem(content.getTitle(), content.getTypeId(), content.getMimeType(), content.getStatus(),
- content.getStateToken(), content.getStateToken().copy().clearDocument(),
- content.getRights(), content.getModifiedOn());
+ addItem(content, content.getMimeType(), content.getStatus(),
+ content.getStateToken().copy().clearDocument(), content.getRights(), content.getModifiedOn());
}
}
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -28,19 +28,20 @@
import cc.kune.gspace.client.tool.selector.ToolSelector;
public class ChatClientTool extends OldFoldableAbstractClientTool {
- public static final String NAME = "chats";
- public static final String TYPE_ROOT = "chat.root";
- public static final String TYPE_ROOM = "chat.room";
- public static final String TYPE_CHAT = "chat.chat";
+ public static final String NAME = "chats";
+ public static final String TYPE_CHAT = "chat.chat";
+ public static final String TYPE_ROOM = "chat.room";
+ public static final String TYPE_ROOT = "chat.root";
- public ChatClientTool(final I18nTranslationService i18n, final WorkspaceSkeleton ws,
- final ToolSelector toolSelector, final WsThemeManager wsThemePresenter,
- ContentCapabilitiesRegistry contentCapabilitiesRegistry) {
- super(NAME, i18n.t("chat rooms"), toolSelector, wsThemePresenter, ws, contentCapabilitiesRegistry);
- registerContentTypeIcon(TYPE_ROOM, "images/emite-room.png");
- }
+ public ChatClientTool(final I18nTranslationService i18n, final WorkspaceSkeleton ws,
+ final ToolSelector toolSelector, final WsThemeManager wsThemePresenter,
+ final ContentCapabilitiesRegistry contentCapabilitiesRegistry) {
+ super(NAME, i18n.t("chat rooms"), toolSelector, wsThemePresenter, ws, contentCapabilitiesRegistry);
+ registerContentTypeIcon(TYPE_ROOM, "images/emite-room.png");
+ }
- public String getName() {
- return NAME;
- }
+ @Override
+ public String getName() {
+ return NAME;
+ }
}
Added: trunk/src/main/webapp/others/kune-wave-extensions.xml
===================================================================
--- trunk/src/main/webapp/others/kune-wave-extensions.xml (rev 0)
+++ trunk/src/main/webapp/others/kune-wave-extensions.xml 2011-06-09 12:25:38 UTC (rev 1399)
@@ -0,0 +1,65 @@
+
+<!-- List of Wave extensions to use in Kune ===================== -->
+
+<extensions>
+
+ <extension>
+ <name>massmob</name>
+ <installerUrl>http://mass-mob.appspot.com/massmob/massmob-extension.xml
+ </installerUrl>
+ <gadgetUrl>http://mass-mob.appspot.com/massmob/org.ourproject.massmob.client.MassmobGadget.gadget.xml
+ </gadgetUrl>
+ <iconUrl>http://mass-mob.appspot.com/logo.png</iconUrl>
+ <iconCss></iconCss>
+ </extension>
+
+</extensions>
+
+<!-- Where and how to use the above extensions ================ -->
+
+<guiActionDescriptors>
+
+ <guiActionDescriptor>
+ <extensionName>massmob</extensionName>
+ <name>Create a meeting</name>
+ <description>Call and speed-up of events as meeting, smartmobs,
+ flashmobs, protest demonstrations, etc.</description>
+ <enabled>true</enabled>
+ <typeIds>
+ <typeId>docs.folder</typeId>
+ <typeId>docs.root</typeId>
+ <typeId>docs.root</typeId>
+ <typeId>blogs.blog</typeId>
+ </typeIds>
+ <name></name>
+ <location>
+ <rol>
+ <!-- Administrator, Editor, Viewer -->
+ <rolRequired>Editor</rolRequired>
+ <authNeed>true</authNeed>
+ </rol>
+ </location>
+ <!-- only for new waves: anyone, onlymembers, onlyadmins, ask -->
+ <participants>ask</participants>
+ </guiActionDescriptor>
+
+ <guiActionDescriptor>
+ <extensionName>massmob</extensionName>
+ <name>Add a meeting</name>
+ <description>Call and speed-up of events as meeting, smartmobs,
+ flashmobs, protest demonstrations, etc.</description>
+ <enabled>true</enabled>
+ <typeIds>
+ <typeId>docs.doc</typeId>
+ </typeIds>
+ <name></name>
+ <location>
+ <rol>
+ <!-- Administrator, Editor, Viewer -->
+ <rolRequired>Editor</rolRequired>
+ <authNeed>true</authNeed>
+ </rol>
+ </location>
+ </guiActionDescriptor>
+
+</guiActionDescriptors>
Property changes on: trunk/src/main/webapp/others/kune-wave-extensions.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/test/java/cc/kune/core/server/integration/DatabaseInitializerTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/DatabaseInitializerTest.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/test/java/cc/kune/core/server/integration/DatabaseInitializerTest.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -29,8 +29,8 @@
import org.junit.Before;
import org.junit.Test;
-import org.ourproject.kune.chat.server.ChatServerTool;
+import cc.kune.chat.shared.ChatConstants;
import cc.kune.core.server.content.ContainerManager;
import cc.kune.core.server.content.ContentManager;
import cc.kune.core.server.manager.GroupManager;
@@ -47,64 +47,64 @@
import com.google.inject.persist.Transactional;
public class DatabaseInitializerTest {
- @Inject
- ContainerManager containerManager;
- @Inject
- ContentManager contentManager;
- @Inject
- I18nCountryManager countryManager;
- private Group defaultGroup;
- @Inject
- GroupManager groupManager;
- @Inject
- I18nLanguageManager languageManager;
- @Inject
- LicenseManager licenseManager;
+ @Inject
+ ContainerManager containerManager;
+ @Inject
+ ContentManager contentManager;
+ @Inject
+ I18nCountryManager countryManager;
+ private Group defaultGroup;
+ @Inject
+ GroupManager groupManager;
+ @Inject
+ I18nLanguageManager languageManager;
+ @Inject
+ LicenseManager licenseManager;
- @Inject
- I18nTranslationManager transManager;
+ @Inject
+ I18nTranslationManager transManager;
- @Transactional
- @Before
- public void init() {
- new IntegrationTestHelper(this);
- defaultGroup = groupManager.getSiteDefaultGroup();
- }
+ @Transactional
+ @Before
+ public void init() {
+ new IntegrationTestHelper(this);
+ defaultGroup = groupManager.getSiteDefaultGroup();
+ }
- @Test
- public void testDefaultContentAndLicenses() {
- assertNotNull(defaultGroup.getDefaultContent());
- assertTrue(licenseManager.getAll().size() > 0);
- assertNotNull(defaultGroup.getDefaultLicense());
- }
+ @Test
+ public void testDefaultContentAndLicenses() {
+ assertNotNull(defaultGroup.getDefaultContent());
+ assertTrue(licenseManager.getAll().size() > 0);
+ assertNotNull(defaultGroup.getDefaultLicense());
+ }
- @Test
- public void testDefaultDocumentContent() {
- final Content content = defaultGroup.getDefaultContent();
- assertEquals(TYPE_DOCUMENT, content.getTypeId());
- final Container rootDocFolder = content.getContainer();
- assertEquals(true, rootDocFolder.isRoot());
- }
+ @Test
+ public void testDefaultDocumentContent() {
+ final Content content = defaultGroup.getDefaultContent();
+ assertEquals(TYPE_DOCUMENT, content.getTypeId());
+ final Container rootDocFolder = content.getContainer();
+ assertEquals(true, rootDocFolder.isRoot());
+ }
- @Test
- public void testI18n() {
- assertNotNull(countryManager.find(Long.valueOf(75)));
- assertNotNull(languageManager.findByCode("en"));
- assertNotNull(languageManager.find(Long.valueOf(1819)));
- }
+ @Test
+ public void testI18n() {
+ assertNotNull(countryManager.find(Long.valueOf(75)));
+ assertNotNull(languageManager.findByCode("en"));
+ assertNotNull(languageManager.find(Long.valueOf(1819)));
+ }
- @Test
- public void testToolConfiguration() {
- assertNotNull(defaultGroup);
- final ToolConfiguration docToolConfig = defaultGroup.getToolConfiguration(NAME);
- assertNotNull(docToolConfig);
- assertTrue(docToolConfig.isEnabled());
- final ToolConfiguration chatToolConfig = defaultGroup.getToolConfiguration(ChatServerTool.NAME);
- assertNotNull(chatToolConfig);
- assertTrue(chatToolConfig.isEnabled());
- final List<String> enabledTools = groupManager.findEnabledTools(defaultGroup.getId());
- assertNotNull(enabledTools);
- assertTrue(enabledTools.size() > 0);
- }
+ @Test
+ public void testToolConfiguration() {
+ assertNotNull(defaultGroup);
+ final ToolConfiguration docToolConfig = defaultGroup.getToolConfiguration(NAME);
+ assertNotNull(docToolConfig);
+ assertTrue(docToolConfig.isEnabled());
+ final ToolConfiguration chatToolConfig = defaultGroup.getToolConfiguration(ChatConstants.NAME);
+ assertNotNull(chatToolConfig);
+ assertTrue(chatToolConfig.isEnabled());
+ final List<String> enabledTools = groupManager.findEnabledTools(defaultGroup.getId());
+ assertNotNull(enabledTools);
+ assertTrue(enabledTools.size() > 0);
+ }
}
Modified: trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -22,7 +22,6 @@
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.configuration.ConfigurationException;
-import org.ourproject.kune.chat.server.ChatServerModule;
import org.waveprotocol.box.server.CoreSettings;
import org.waveprotocol.box.server.ServerModule;
import org.waveprotocol.box.server.persistence.PersistenceModule;
@@ -31,6 +30,7 @@
import org.waveprotocol.box.server.waveserver.WaveServerImpl;
import org.waveprotocol.wave.federation.noop.NoOpFederationModule;
+import cc.kune.chat.server.ChatServerModule;
import cc.kune.core.server.KunePersistenceService;
import cc.kune.core.server.PlatformServerModule;
import cc.kune.core.server.TestConstants;
Modified: trunk/src/test/java/org/ourproject/kune/chat/ChatToolTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/chat/ChatToolTest.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/test/java/org/ourproject/kune/chat/ChatToolTest.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -23,15 +23,16 @@
import org.junit.Test;
import org.ourproject.kune.chat.client.ChatClientTool;
-import org.ourproject.kune.chat.server.ChatServerTool;
+import cc.kune.chat.shared.ChatConstants;
+
public class ChatToolTest {
- @Test
- public void clientAndServerAreSync() {
- assertEquals(ChatServerTool.NAME, ChatClientTool.NAME);
- assertEquals(ChatServerTool.TYPE_ROOT, ChatClientTool.TYPE_ROOT);
- assertEquals(ChatServerTool.TYPE_ROOM, ChatClientTool.TYPE_ROOM);
- assertEquals(ChatServerTool.TYPE_CHAT, ChatClientTool.TYPE_CHAT);
- }
+ @Test
+ public void clientAndServerAreSync() {
+ assertEquals(ChatConstants.NAME, ChatClientTool.NAME);
+ assertEquals(ChatConstants.TYPE_ROOT, ChatClientTool.TYPE_ROOT);
+ assertEquals(ChatConstants.TYPE_ROOM, ChatClientTool.TYPE_ROOM);
+ assertEquals(ChatConstants.TYPE_CHAT, ChatClientTool.TYPE_CHAT);
+ }
}
Modified: trunk/src/test/java/org/ourproject/kune/chat/server/managers/XmppManagerDefaultTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/chat/server/managers/XmppManagerDefaultTest.java 2011-06-07 16:07:55 UTC (rev 1398)
+++ trunk/src/test/java/org/ourproject/kune/chat/server/managers/XmppManagerDefaultTest.java 2011-06-09 12:25:38 UTC (rev 1399)
@@ -75,7 +75,7 @@
final String roomName = "roomName";
final ChatConnection conn1 = manager.login("testUser1", "easy1", "test");
final ChatConnection conn2 = manager.login("testUser2", "easy2", "test");
- final Room room1 = manager.createRoom(conn1, roomName, "user1Alias");
+ final Room room1 = manager.createRoom(conn1, roomName, "user1Alias", "subject");
final OutputListener listener1 = new OutputListener("1");
room1.setListener(listener1);
final Room room2 = manager.joinRoom(conn2, roomName, "user2Alias");
More information about the kune-commits
mailing list