[kune-commits] r1397 - in trunk/src/main/java: cc/kune/blogs/client/actions cc/kune/chat/client/actions cc/kune/docs/client/actions cc/kune/wiki/client/actions org/ourproject/kune

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Thu Jun 2 00:07:48 CEST 2011


Author: vjrj_
Date: 2011-06-02 00:07:48 +0200 (Thu, 02 Jun 2011)
New Revision: 1397

Added:
   trunk/src/main/java/cc/kune/chat/client/actions/ChatAboutContentBtn.java
Removed:
   trunk/src/main/java/org/ourproject/kune/blogs/
Modified:
   trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java
   trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java
   trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java
Log:
Chat about contents action

Modified: trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java	2011-06-01 19:01:44 UTC (rev 1396)
+++ trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java	2011-06-01 22:07:48 UTC (rev 1397)
@@ -23,6 +23,7 @@
 import static cc.kune.blogs.shared.BlogsConstants.TYPE_POST;
 import static cc.kune.blogs.shared.BlogsConstants.TYPE_ROOT;
 import static cc.kune.blogs.shared.BlogsConstants.TYPE_UPLOADEDFILE;
+import cc.kune.chat.client.actions.ChatAboutContentBtn;
 import cc.kune.core.client.actions.ActionRegistryByType;
 import cc.kune.core.client.i18n.I18nUITranslationService;
 import cc.kune.core.client.resources.CoreResources;
@@ -55,7 +56,7 @@
       final Provider<RefreshContentMenuItem> refresh,
       final Provider<ContentViewerOptionsMenu> optionsMenuContent,
       final Provider<ParticipateInContentBtn> participateBtn,
-      final Provider<DelBlogMenuItem> delFolderMenuItem,
+      final Provider<ChatAboutContentBtn> chatAbout, final Provider<DelBlogMenuItem> delFolderMenuItem,
       final Provider<SetAsHomePageMenuItem> setAsHomePage) {
     super(session, stateManager, i18n, registry);
     actionsRegistry.addAction(ActionGroups.VIEW, optionsMenuContent, all);
@@ -65,6 +66,7 @@
     actionsRegistry.addAction(ActionGroups.VIEW, participateBtn, contents);
     actionsRegistry.addAction(ActionGroups.VIEW, newDocBtn, containersNoRoot);
     actionsRegistry.addAction(ActionGroups.VIEW, newFolderBtn, TYPE_ROOT);
+    actionsRegistry.addAction(ActionGroups.VIEW, chatAbout, contents);
     actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, contents);
     actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, containersNoRoot);
     actionsRegistry.addAction(ActionGroups.MENUITEM, delContentMenuItem, contents);

Added: trunk/src/main/java/cc/kune/chat/client/actions/ChatAboutContentBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/ChatAboutContentBtn.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/actions/ChatAboutContentBtn.java	2011-06-01 22:07:48 UTC (rev 1397)
@@ -0,0 +1,72 @@
+/*
+ *
+ * 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.chat.client.ChatClient;
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
+import cc.kune.core.client.actions.RolAction;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.AccessRolDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class ChatAboutContentBtn extends ButtonDescriptor {
+
+  public static class ChatAboutContentAction extends RolAction {
+
+    private final Provider<ChatClient> chatClient;
+    private final I18nTranslationService i18n;
+    private final Session session;
+
+    @Inject
+    public ChatAboutContentAction(final Session session, final I18nTranslationService i18n,
+        final Provider<ChatClient> chatClient) {
+      super(AccessRolDTO.Viewer, true);
+      this.session = session;
+      this.i18n = i18n;
+      this.chatClient = chatClient;
+    }
+
+    @Override
+    public void actionPerformed(final ActionEvent event) {
+      final String subject = i18n.t("Chat about: [%s]", session.getContentState().getTitle());
+      final StateToken token = session.getCurrentStateToken();
+      chatClient.get().joinRoom(token.toString().replaceAll("\\.", "-"), subject,
+          session.getCurrentUserInfo().getShortName());
+      chatClient.get().show();
+    }
+
+  }
+
+  public static final String ID = "k-chatabout-btn";
+
+  @Inject
+  public ChatAboutContentBtn(final ChatAboutContentAction action, final CoreResources res,
+      final I18nTranslationService i18n) {
+    super(action);
+    this.withIcon(res.emiteRoom()).withToolTip(i18n.t("Chat and comment this")).withText(
+        i18n.t("Chat about")).withStyles("k-def-docbtn, k-fr").withId(ID);
+  }
+}


Property changes on: trunk/src/main/java/cc/kune/chat/client/actions/ChatAboutContentBtn.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java	2011-06-01 19:01:44 UTC (rev 1396)
+++ trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java	2011-06-01 22:07:48 UTC (rev 1397)
@@ -23,6 +23,7 @@
 import static cc.kune.docs.shared.DocsConstants.TYPE_FOLDER;
 import static cc.kune.docs.shared.DocsConstants.TYPE_ROOT;
 import static cc.kune.docs.shared.DocsConstants.TYPE_UPLOADEDFILE;
+import cc.kune.chat.client.actions.ChatAboutContentBtn;
 import cc.kune.core.client.actions.ActionRegistryByType;
 import cc.kune.core.client.i18n.I18nUITranslationService;
 import cc.kune.core.client.resources.CoreResources;
@@ -55,7 +56,8 @@
       final Provider<ContentViewerOptionsMenu> optionsMenuContent,
       final Provider<ParticipateInContentBtn> participateBtn,
       final Provider<DelFolderMenuItem> delFolderMenuItem,
-      final Provider<RefreshContentMenuItem> refresh, final Provider<SetAsHomePageMenuItem> setAsHomePage) {
+      final Provider<ChatAboutContentBtn> chatAbout, final Provider<RefreshContentMenuItem> refresh,
+      final Provider<SetAsHomePageMenuItem> setAsHomePage) {
     super(session, stateManager, i18n, registry);
     actionsRegistry.addAction(ActionGroups.VIEW, optionsMenuContent, all);
     actionsRegistry.addAction(ActionGroups.VIEW, refresh, all);
@@ -64,6 +66,7 @@
     actionsRegistry.addAction(ActionGroups.VIEW, newDocBtn, containers);
     actionsRegistry.addAction(ActionGroups.VIEW, participateBtn, contents);
     actionsRegistry.addAction(ActionGroups.VIEW, newFolderBtn, containers);
+    actionsRegistry.addAction(ActionGroups.VIEW, chatAbout, contents);
     actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, contents);
     actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, containersNoRoot);
     actionsRegistry.addAction(ActionGroups.MENUITEM, delContentMenuItem, contents);

Modified: trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java	2011-06-01 19:01:44 UTC (rev 1396)
+++ trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java	2011-06-01 22:07:48 UTC (rev 1397)
@@ -23,6 +23,7 @@
 import static cc.kune.wiki.shared.WikiConstants.TYPE_ROOT;
 import static cc.kune.wiki.shared.WikiConstants.TYPE_UPLOADEDFILE;
 import static cc.kune.wiki.shared.WikiConstants.TYPE_WIKIPAGE;
+import cc.kune.chat.client.actions.ChatAboutContentBtn;
 import cc.kune.core.client.actions.ActionRegistryByType;
 import cc.kune.core.client.i18n.I18nUITranslationService;
 import cc.kune.core.client.resources.CoreResources;
@@ -53,7 +54,8 @@
       final Provider<ContentViewerOptionsMenu> optionsMenuContent,
       final Provider<ParticipateInContentBtn> participateBtn,
       final Provider<DelFolderMenuItem> delFolderMenuItem,
-      final Provider<RefreshContentMenuItem> refresh, final Provider<SetAsHomePageMenuItem> setAsHomePage) {
+      final Provider<ChatAboutContentBtn> chatAbout, final Provider<RefreshContentMenuItem> refresh,
+      final Provider<SetAsHomePageMenuItem> setAsHomePage) {
     super(session, stateManager, i18n, registry);
     actionsRegistry.addAction(ActionGroups.VIEW, optionsMenuContent, all);
     actionsRegistry.addAction(ActionGroups.VIEW, refresh, all);
@@ -62,6 +64,7 @@
     actionsRegistry.addAction(ActionGroups.VIEW, newWikiBtn, containers);
     actionsRegistry.addAction(ActionGroups.VIEW, participateBtn, contents);
     actionsRegistry.addAction(ActionGroups.VIEW, newFolderBtn, containers);
+    actionsRegistry.addAction(ActionGroups.VIEW, chatAbout, contents);
     actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, contents);
     actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, containersNoRoot);
     actionsRegistry.addAction(ActionGroups.MENUITEM, delContentMenuItem, contents);




More information about the kune-commits mailing list