[kune-commits] r1321 - in trunk/src: main/java/cc/kune main/java/cc/kune/blogs main/java/cc/kune/blogs/client main/java/cc/kune/blogs/client/actions main/java/cc/kune/blogs/server main/java/cc/kune/client main/java/cc/kune/core/server main/java/cc/kune/core/ws main/java/cc/kune/docs/client main/java/cc/kune/docs/client/actions main/java/cc/kune/gspace/client main/java/cc/kune/gspace/client/actions main/java/cc/kune/gspace/client/viewers main/java/org/ourproject/kune main/java/org/ourproject/kune/blogs test/java/cc/kune test/java/cc/kune/blogs test/java/cc/kune/blogs/server test/java/org/ourproject/kune/blogs

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Tue Apr 26 21:57:21 CEST 2011


Author: vjrj_
Date: 2011-04-26 21:57:21 +0200 (Tue, 26 Apr 2011)
New Revision: 1321

Added:
   trunk/src/main/java/cc/kune/blogs/
   trunk/src/main/java/cc/kune/blogs/KuneBlogs.gwt.xml
   trunk/src/main/java/cc/kune/blogs/client/
   trunk/src/main/java/cc/kune/blogs/client/BlogsClientTool.java
   trunk/src/main/java/cc/kune/blogs/client/BlogsGinModule.java
   trunk/src/main/java/cc/kune/blogs/client/BlogsGinjector.java
   trunk/src/main/java/cc/kune/blogs/client/BlogsParts.java
   trunk/src/main/java/cc/kune/blogs/client/actions/
   trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java
   trunk/src/main/java/cc/kune/blogs/client/actions/DelBlogMenuItem.java
   trunk/src/main/java/cc/kune/blogs/client/actions/DelPostMenuItem.java
   trunk/src/main/java/cc/kune/blogs/client/actions/GoParentBlogBtn.java
   trunk/src/main/java/cc/kune/blogs/client/actions/NewBlogBtn.java
   trunk/src/main/java/cc/kune/blogs/client/actions/NewPostBtn.java
   trunk/src/main/java/cc/kune/blogs/client/actions/OpenBlogMenuItem.java
   trunk/src/main/java/cc/kune/blogs/server/
   trunk/src/main/java/cc/kune/docs/client/actions/DelDocMenuItem.java
   trunk/src/main/java/cc/kune/docs/client/actions/GoParentFolderBtn.java
   trunk/src/main/java/cc/kune/docs/client/actions/OpenDocMenuItem.java
   trunk/src/main/java/cc/kune/gspace/client/actions/AbstractFoldableToolActions.java
   trunk/src/main/java/cc/kune/gspace/client/actions/ActionGroups.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/GoParentContainerBtn.java
   trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerBtn.java
   trunk/src/main/java/cc/kune/gspace/client/actions/NewContentBtn.java
   trunk/src/main/java/cc/kune/gspace/client/actions/OpenContentMenuItem.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/
   trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.ui.xml
   trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.ui.xml
   trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsFlowPanel.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsFlowPanel.ui.xml
   trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.ui.xml
   trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java
   trunk/src/test/java/cc/kune/blogs/
   trunk/src/test/java/cc/kune/blogs/server/
Removed:
   trunk/src/main/java/cc/kune/core/ws/armor/
   trunk/src/main/java/cc/kune/docs/client/actions/AbstractFoldableContentActions.java
   trunk/src/main/java/cc/kune/docs/client/actions/DelContentMenuItem.java
   trunk/src/main/java/cc/kune/docs/client/actions/FolderGoUpBtn.java
   trunk/src/main/java/cc/kune/docs/client/actions/OpenContentMenuItem.java
   trunk/src/main/java/cc/kune/docs/client/viewers/
   trunk/src/main/java/cc/kune/gspace/client/actions/perspective/
   trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.ui.xml
   trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPanel.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPanel.ui.xml
   trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java
   trunk/src/main/java/org/ourproject/kune/blogs/server/
   trunk/src/main/java/org/ourproject/kune/docs/
   trunk/src/test/java/org/ourproject/kune/blogs/server/
Modified:
   trunk/src/main/java/cc/kune/Kune.gwt.xml
   trunk/src/main/java/cc/kune/blogs/server/BlogServerModule.java
   trunk/src/main/java/cc/kune/blogs/server/BlogServerTool.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/core/server/KuneRackModule.java
   trunk/src/main/java/cc/kune/docs/client/DocsGinModule.java
   trunk/src/main/java/cc/kune/docs/client/DocsGinjector.java
   trunk/src/main/java/cc/kune/docs/client/DocsParts.java
   trunk/src/main/java/cc/kune/docs/client/actions/DelFolderMenuItem.java
   trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java
   trunk/src/main/java/cc/kune/docs/client/actions/NewDocBtn.java
   trunk/src/main/java/cc/kune/docs/client/actions/NewFolderBtn.java
   trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
   trunk/src/main/java/cc/kune/gspace/client/GSpaceGinjector.java
   trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemDescriptor.java
   trunk/src/test/java/cc/kune/blogs/server/BlogServerToolTest.java
Log:
Blog tool added

Modified: trunk/src/main/java/cc/kune/Kune.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/Kune.gwt.xml	2011-04-26 11:38:16 UTC (rev 1320)
+++ trunk/src/main/java/cc/kune/Kune.gwt.xml	2011-04-26 19:57:21 UTC (rev 1321)
@@ -7,6 +7,7 @@
   <inherits name="cc.kune.wave.KuneWave" />
   <inherits name="cc.kune.chat.KuneChat" />
   <inherits name="cc.kune.docs.KuneDocs" />
+  <inherits name="cc.kune.blogs.KuneBlogs" />
   <inherits name="cc.kune.pspace.PSpace" />
   <inherits name="com.calclab.suco.Suco" />
   <inherits name="org.adamtacy.GWTEffects"></inherits>

Added: trunk/src/main/java/cc/kune/blogs/KuneBlogs.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/blogs/KuneBlogs.gwt.xml	                        (rev 0)
+++ trunk/src/main/java/cc/kune/blogs/KuneBlogs.gwt.xml	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,5 @@
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.1.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.1.0/distro-source/core/src/gwt-module.dtd">
+<module>
+  <inherits name="cc.kune.core.Core" />
+  <source path="client" />
+</module>
\ No newline at end of file


Property changes on: trunk/src/main/java/cc/kune/blogs/KuneBlogs.gwt.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/src/main/java/cc/kune/blogs/client/BlogsClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/BlogsClientTool.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/blogs/client/BlogsClientTool.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,69 @@
+/*
+ *
+ * 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.blogs.client;
+
+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.old.FoldableAbstractClientTool;
+import cc.kune.gspace.client.tool.selector.ToolSelector;
+
+import com.google.inject.Inject;
+
+public class BlogsClientTool extends FoldableAbstractClientTool {
+
+    public static final String NAME = "blogs";
+    public static final String TYPE_BLOG = NAME + "." + "blog";
+    public static final String TYPE_POST = NAME + "." + "post";
+    public static final String TYPE_ROOT = NAME + "." + "root";
+    public static final String TYPE_UPLOADEDFILE = NAME + "." + FoldableAbstractClientTool.UPLOADEDFILE_SUFFIX;
+    private final NavResources navResources;
+
+    @Inject
+    public BlogsClientTool(final I18nUITranslationService i18n, final ToolSelector toolSelector,
+            final ContentCapabilitiesRegistry cntCapRegistry, final NavResources navResources) {
+        super(NAME, i18n.t("blogs"), toolSelector, cntCapRegistry);
+        this.navResources = navResources;
+
+        // registerAclEditableTypes();
+        registerAuthorableTypes(TYPE_POST, TYPE_UPLOADEDFILE);
+        registerDragableTypes(TYPE_UPLOADEDFILE);
+        registerDropableTypes(TYPE_ROOT);
+        registerPublishModerableTypes(TYPE_POST, TYPE_UPLOADEDFILE);
+        registerRateableTypes(TYPE_POST, TYPE_UPLOADEDFILE);
+        registerRenamableTypes(TYPE_BLOG, TYPE_POST, TYPE_UPLOADEDFILE);
+        registerTageableTypes(TYPE_BLOG, TYPE_UPLOADEDFILE, TYPE_POST);
+        // registerTranslatableTypes();
+
+        registerIcons();
+    }
+
+    @Override
+    public String getName() {
+        return NAME;
+    }
+
+    private void registerIcons() {
+        registerContentTypeIcon(TYPE_BLOG, navResources.blog());
+        registerContentTypeIcon(TYPE_POST, navResources.post());
+        registerUploadTypesAndMimes(TYPE_UPLOADEDFILE);
+    }
+
+}


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

Added: trunk/src/main/java/cc/kune/blogs/client/BlogsGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/BlogsGinModule.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/blogs/client/BlogsGinModule.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,16 @@
+package cc.kune.blogs.client;
+
+import cc.kune.blogs.client.actions.BlogsClientActions;
+
+import com.google.inject.Singleton;
+import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
+
+public class BlogsGinModule extends AbstractPresenterModule {
+
+    @Override
+    protected void configure() {
+        bind(BlogsClientTool.class).in(Singleton.class);
+        bind(BlogsClientActions.class).in(Singleton.class);
+    }
+
+}


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

Added: trunk/src/main/java/cc/kune/blogs/client/BlogsGinjector.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/BlogsGinjector.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/blogs/client/BlogsGinjector.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,9 @@
+package cc.kune.blogs.client;
+
+import com.google.gwt.inject.client.Ginjector;
+
+public interface BlogsGinjector extends Ginjector {
+
+    BlogsParts getBlogsParts();
+
+}


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

Added: trunk/src/main/java/cc/kune/blogs/client/BlogsParts.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/BlogsParts.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/blogs/client/BlogsParts.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,14 @@
+package cc.kune.blogs.client;
+
+import cc.kune.core.client.state.Session;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class BlogsParts {
+
+    @Inject
+    public BlogsParts(final Session session, final Provider<BlogsClientTool> clientTool) {
+        clientTool.get();
+    }
+}
\ No newline at end of file


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

Added: trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -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.blogs.client.actions;
+
+import static org.ourproject.kune.blogs.client.BlogClientTool.TYPE_BLOG;
+import static org.ourproject.kune.blogs.client.BlogClientTool.TYPE_POST;
+import static org.ourproject.kune.blogs.client.BlogClientTool.TYPE_ROOT;
+import static org.ourproject.kune.blogs.client.BlogClientTool.TYPE_UPLOADEDFILE;
+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 com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class BlogsClientActions extends AbstractFoldableToolActions {
+
+    final String[] all = { TYPE_ROOT, TYPE_BLOG, TYPE_POST, TYPE_UPLOADEDFILE };
+    final String[] containers = { TYPE_ROOT, TYPE_BLOG };
+    final String[] containersNoRoot = { TYPE_BLOG };
+    final String[] contents = { TYPE_POST, TYPE_UPLOADEDFILE };
+    final String[] contentsModerated = { TYPE_POST, TYPE_UPLOADEDFILE };
+
+    @Inject
+    public BlogsClientActions(final I18nUITranslationService i18n, final Session session,
+            final StateManager stateManager, final ActionRegistryByType registry, final CoreResources res,
+            final Provider<GoParentBlogBtn> folderGoUp, final Provider<NewPostBtn> newDocBtn,
+            final Provider<NewBlogBtn> newFolderBtn, final Provider<OpenBlogMenuItem> openContentMenuItem,
+            final Provider<DelPostMenuItem> delContentMenuItem, final Provider<DelBlogMenuItem> delFolderMenuItem) {
+        super(session, stateManager, i18n, registry);
+        actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, contents);
+        actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, containersNoRoot);
+        actionsRegistry.addAction(ActionGroups.VIEW, newDocBtn, containersNoRoot);
+        actionsRegistry.addAction(ActionGroups.VIEW, newFolderBtn, TYPE_ROOT);
+        actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, contents);
+        actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, containersNoRoot);
+        actionsRegistry.addAction(ActionGroups.MENUITEM, delContentMenuItem, contents);
+        actionsRegistry.addAction(ActionGroups.MENUITEM, delFolderMenuItem, containersNoRoot);
+    }
+
+    @Override
+    protected void createPostSessionInitActions() {
+    }
+}


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

Added: trunk/src/main/java/cc/kune/blogs/client/actions/DelBlogMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/actions/DelBlogMenuItem.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/blogs/client/actions/DelBlogMenuItem.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,16 @@
+package cc.kune.blogs.client.actions;
+
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.actions.DelContainerMenuItem;
+
+import com.google.inject.Inject;
+
+public class DelBlogMenuItem extends DelContainerMenuItem {
+
+    @Inject
+    public DelBlogMenuItem(final I18nTranslationService i18n, final DelContainerAction action, final CoreResources res) {
+        super(i18n, action, res);
+    }
+
+}


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

Added: trunk/src/main/java/cc/kune/blogs/client/actions/DelPostMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/actions/DelPostMenuItem.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/blogs/client/actions/DelPostMenuItem.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,15 @@
+package cc.kune.blogs.client.actions;
+
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.actions.DelContentMenuItem;
+
+import com.google.inject.Inject;
+
+public class DelPostMenuItem extends DelContentMenuItem {
+
+    @Inject
+    public DelPostMenuItem(final I18nTranslationService i18n, final DelContentAction action, final CoreResources res) {
+        super(i18n, action, res);
+    }
+}


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

Added: trunk/src/main/java/cc/kune/blogs/client/actions/GoParentBlogBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/actions/GoParentBlogBtn.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/blogs/client/actions/GoParentBlogBtn.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,16 @@
+package cc.kune.blogs.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 GoParentBlogBtn extends GoParentContainerBtn {
+
+    @Inject
+    public GoParentBlogBtn(final I18nTranslationService i18n, final GoParentContainerAction action, final CoreResources res) {
+        super(i18n, action, res);
+    }
+
+}


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

Added: trunk/src/main/java/cc/kune/blogs/client/actions/NewBlogBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/actions/NewBlogBtn.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/blogs/client/actions/NewBlogBtn.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,18 @@
+package cc.kune.blogs.client.actions;
+
+import cc.kune.blogs.client.BlogsClientTool;
+import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.actions.NewContainerBtn;
+
+import com.google.inject.Inject;
+
+public class NewBlogBtn extends NewContainerBtn {
+
+    @Inject
+    public NewBlogBtn(final I18nTranslationService i18n, final NewContainerAction action, final NavResources res) {
+        super(i18n, action, res, i18n.t("New blog"), i18n.t("Create a new blog"), i18n.t("New blog"),
+                BlogsClientTool.TYPE_BLOG);
+    }
+
+}


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

Added: trunk/src/main/java/cc/kune/blogs/client/actions/NewPostBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/actions/NewPostBtn.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/blogs/client/actions/NewPostBtn.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,20 @@
+package cc.kune.blogs.client.actions;
+
+import cc.kune.blogs.client.BlogsClientTool;
+import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
+import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.actions.NewContentBtn;
+
+import com.google.inject.Inject;
+
+public class NewPostBtn extends NewContentBtn {
+
+    @Inject
+    public NewPostBtn(final I18nTranslationService i18n, final NewContentAction action, final NavResources res,
+            final GlobalShortcutRegister shorcutReg) {
+        super(i18n, action, res, shorcutReg, i18n.t("New post"), i18n.t("Create a new blog post"), i18n.t("New post"),
+                BlogsClientTool.TYPE_POST);
+    }
+
+}


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

Added: trunk/src/main/java/cc/kune/blogs/client/actions/OpenBlogMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/actions/OpenBlogMenuItem.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/blogs/client/actions/OpenBlogMenuItem.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,16 @@
+package cc.kune.blogs.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 OpenBlogMenuItem extends OpenContentMenuItem {
+
+    @Inject
+    public OpenBlogMenuItem(final I18nTranslationService i18n, final OpenContentAction action, final NavResources res) {
+        super(i18n, action, res);
+    }
+
+}


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

Copied: trunk/src/main/java/cc/kune/blogs/server (from rev 1313, trunk/src/main/java/org/ourproject/kune/blogs/server)

Modified: trunk/src/main/java/cc/kune/blogs/server/BlogServerModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/server/BlogServerModule.java	2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/blogs/server/BlogServerModule.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -17,7 +17,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
-package org.ourproject.kune.blogs.server;
+package cc.kune.blogs.server;
 
 import com.google.inject.Binder;
 import com.google.inject.Module;

Modified: trunk/src/main/java/cc/kune/blogs/server/BlogServerTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/server/BlogServerTool.java	2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/blogs/server/BlogServerTool.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -17,7 +17,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
-package org.ourproject.kune.blogs.server;
+package cc.kune.blogs.server;
 
 
 import cc.kune.core.client.errors.ContainerNotPermittedException;

Modified: trunk/src/main/java/cc/kune/client/KuneEntryPoint.java
===================================================================
--- trunk/src/main/java/cc/kune/client/KuneEntryPoint.java	2011-04-26 11:38:16 UTC (rev 1320)
+++ trunk/src/main/java/cc/kune/client/KuneEntryPoint.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -77,6 +77,7 @@
         ginjector.getSpinerPresenter();
         ginjector.getGroupMembersPresenter();
         ginjector.getDocsParts();
+        ginjector.getBlogsParts();
         ginjector.getSiteLogoPresenter();
         ginjector.getSpacesTabPresenter();
         ginjector.getChatClient();

Modified: trunk/src/main/java/cc/kune/client/KuneGinjector.java
===================================================================
--- trunk/src/main/java/cc/kune/client/KuneGinjector.java	2011-04-26 11:38:16 UTC (rev 1320)
+++ trunk/src/main/java/cc/kune/client/KuneGinjector.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -19,6 +19,8 @@
  */
 package cc.kune.client;
 
+import cc.kune.blogs.client.BlogsGinModule;
+import cc.kune.blogs.client.BlogsGinjector;
 import cc.kune.chat.client.ChatClient;
 import cc.kune.chat.client.ChatGinModule;
 import cc.kune.chat.client.ChatParts;
@@ -48,8 +50,8 @@
 import cc.kune.core.client.ws.CorePresenter;
 import cc.kune.core.client.ws.entheader.EntityHeaderPresenter;
 import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.docs.client.DocsGinModule;
 import cc.kune.docs.client.DocsGinjector;
-import cc.kune.docs.client.DocsGinModule;
 import cc.kune.gspace.client.GSpaceGinModule;
 import cc.kune.gspace.client.GSpaceGinjector;
 import cc.kune.pspace.client.PSpaceGinModule;
@@ -66,8 +68,8 @@
 import com.gwtplatform.mvp.client.proxy.ProxyFailureHandler;
 
 @GinModules({ KuneGinModule.class, CoreGinModule.class, ChatGinModule.class, WaveGinModule.class,
-        PSpaceGinModule.class, GSpaceGinModule.class, DocsGinModule.class })
-public interface KuneGinjector extends Ginjector, GSpaceGinjector, DocsGinjector {
+        PSpaceGinModule.class, GSpaceGinModule.class, DocsGinModule.class, BlogsGinModule.class })
+public interface KuneGinjector extends Ginjector, GSpaceGinjector, DocsGinjector, BlogsGinjector {
 
     /*
      * You have to add here all the GWTPresenters (as Provider or AsyncProvider)

Modified: trunk/src/main/java/cc/kune/client/OnAppStartFactory.java
===================================================================
--- trunk/src/main/java/cc/kune/client/OnAppStartFactory.java	2011-04-26 11:38:16 UTC (rev 1320)
+++ trunk/src/main/java/cc/kune/client/OnAppStartFactory.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -1,5 +1,6 @@
 package cc.kune.client;
 
+import cc.kune.blogs.client.BlogsClientTool;
 import cc.kune.core.client.init.AppStartEvent;
 import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
 import cc.kune.core.client.state.Session;
@@ -11,11 +12,13 @@
 public class OnAppStartFactory {
 
     @Inject
-    public OnAppStartFactory(final Session session, final Provider<DocsClientTool> docClientTool) {
+    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) {
-                docClientTool.get();
+                docsClientTool.get();
+                blogsClientTool.get();
             }
         });
     }

Modified: trunk/src/main/java/cc/kune/core/server/KuneRackModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/KuneRackModule.java	2011-04-26 11:38:16 UTC (rev 1320)
+++ trunk/src/main/java/cc/kune/core/server/KuneRackModule.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -22,6 +22,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import cc.kune.blogs.server.BlogServerModule;
 import cc.kune.core.client.rpcservices.ContentService;
 import cc.kune.core.client.rpcservices.GroupService;
 import cc.kune.core.client.rpcservices.I18nService;
@@ -139,7 +140,7 @@
         builder.use(new ServletModule());
         builder.use(new PlatformServerModule());
         builder.use(new DocumentServerModule());
-        // builder.use(new BlogServerModule());
+        builder.use(new BlogServerModule());
         // builder.use(new WikiServerModule());
         // builder.use(new ChatServerModule());
         // builder.use(new GalleryServerModule());

Modified: trunk/src/main/java/cc/kune/docs/client/DocsGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocsGinModule.java	2011-04-26 11:38:16 UTC (rev 1320)
+++ trunk/src/main/java/cc/kune/docs/client/DocsGinModule.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -1,10 +1,6 @@
 package cc.kune.docs.client;
 
 import cc.kune.docs.client.actions.DocsClientActions;
-import cc.kune.docs.client.viewers.DocViewerPanel;
-import cc.kune.docs.client.viewers.DocViewerPresenter;
-import cc.kune.docs.client.viewers.FolderViewerAsTablePanel;
-import cc.kune.docs.client.viewers.FolderViewerPresenter;
 
 import com.google.inject.Singleton;
 import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
@@ -15,10 +11,6 @@
     protected void configure() {
         bind(DocsClientTool.class).in(Singleton.class);
         bind(DocsClientActions.class).in(Singleton.class);
-        bindPresenter(DocViewerPresenter.class, DocViewerPresenter.DocViewerView.class, DocViewerPanel.class,
-                DocViewerPresenter.DocViewerProxy.class);
-        bindPresenter(FolderViewerPresenter.class, FolderViewerPresenter.FolderViewerView.class,
-                FolderViewerAsTablePanel.class, FolderViewerPresenter.FolderViewerProxy.class);
     }
 
 }

Modified: trunk/src/main/java/cc/kune/docs/client/DocsGinjector.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocsGinjector.java	2011-04-26 11:38:16 UTC (rev 1320)
+++ trunk/src/main/java/cc/kune/docs/client/DocsGinjector.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -1,16 +1,9 @@
 package cc.kune.docs.client;
 
-import cc.kune.docs.client.viewers.DocViewerPresenter;
-import cc.kune.docs.client.viewers.FolderViewerPresenter;
-
-import com.google.gwt.inject.client.AsyncProvider;
 import com.google.gwt.inject.client.Ginjector;
 
 public interface DocsGinjector extends Ginjector {
 
     DocsParts getDocsParts();
 
-    AsyncProvider<DocViewerPresenter> getDocsViewerPresenter();
-
-    AsyncProvider<FolderViewerPresenter> getFolderViewerPresenter();
 }

Modified: trunk/src/main/java/cc/kune/docs/client/DocsParts.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocsParts.java	2011-04-26 11:38:16 UTC (rev 1320)
+++ trunk/src/main/java/cc/kune/docs/client/DocsParts.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -1,8 +1,6 @@
 package cc.kune.docs.client;
 
 import cc.kune.core.client.state.Session;
-import cc.kune.docs.client.viewers.DocViewerPresenter;
-import cc.kune.docs.client.viewers.FolderViewerPresenter;
 
 import com.google.inject.Inject;
 import com.google.inject.Provider;
@@ -10,10 +8,7 @@
 public class DocsParts {
 
     @Inject
-    public DocsParts(final Session session, final Provider<DocViewerPresenter> docsViewer,
-            final Provider<FolderViewerPresenter> folderViewer, final Provider<DocsClientTool> docsClientTool) {
-        docsClientTool.get();
-        docsViewer.get();
-        folderViewer.get();
+    public DocsParts(final Session session, final Provider<DocsClientTool> clientTool) {
+        clientTool.get();
     }
 }
\ No newline at end of file

Deleted: trunk/src/main/java/cc/kune/docs/client/actions/AbstractFoldableContentActions.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/AbstractFoldableContentActions.java	2011-04-26 11:38:16 UTC (rev 1320)
+++ trunk/src/main/java/cc/kune/docs/client/actions/AbstractFoldableContentActions.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -1,76 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.docs.client.actions;
-
-import cc.kune.core.client.actions.ActionRegistryByType;
-import cc.kune.core.client.i18n.I18nUITranslationService;
-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.core.client.state.StateManager;
-
-public abstract class AbstractFoldableContentActions {
-
-    private static final String PUBLICATION_MENU = "Publication";
-
-    protected final ActionRegistryByType actionsRegistry;
-    protected final I18nUITranslationService i18n;
-    protected final Session session;
-    protected final StateManager stateManager;
-
-    public AbstractFoldableContentActions(final Session session, final StateManager stateManager,
-            final I18nUITranslationService i18n, final ActionRegistryByType actionsRegistry) {
-        this.session = session;
-        this.stateManager = stateManager;
-        this.i18n = i18n;
-        this.actionsRegistry = actionsRegistry;
-        createActions();
-        session.onAppStart(true, new AppStartHandler() {
-            @Override
-            public void onAppStart(final AppStartEvent event) {
-                createPostSessionInitActions();
-            }
-        });
-    }
-
-    protected abstract void createActions();
-
-    protected void createContentModeratedActions(final String parentMenuTitle, final String... contentsModerated) {
-    }
-
-    protected void createContentRenameAction(final String parentMenuTitle, final String textDescription,
-            final String... registerInTypes) {
-    }
-
-    protected void createDelContainerAction(final String text, final String parentMenuTitle,
-            final String... registerInTypes) {
-    }
-
-    protected void createDelContentAction(final String parentMenuTitle, final String textDescription,
-            final String... registerInTypes) {
-    }
-
-    protected void createDownloadActions(final String typeUploadedfile) {
-
-    }
-
-    protected abstract void createPostSessionInitActions();
-
-}

Deleted: trunk/src/main/java/cc/kune/docs/client/actions/DelContentMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/DelContentMenuItem.java	2011-04-26 11:38:16 UTC (rev 1320)
+++ trunk/src/main/java/cc/kune/docs/client/actions/DelContentMenuItem.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -1,87 +0,0 @@
-package cc.kune.docs.client.actions;
-
-import cc.kune.common.client.actions.ActionEvent;
-import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
-import cc.kune.common.client.notify.ConfirmAskEvent;
-import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.utils.OnAcceptCallback;
-import cc.kune.core.client.actions.RolAction;
-import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
-import cc.kune.core.client.rpcservices.ContentServiceAsync;
-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.AccessRolDTO;
-import cc.kune.core.shared.dto.StateContentDTO;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.docs.client.viewers.FolderViewerPresenter;
-
-import com.google.gwt.event.shared.EventBus;
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-
-public class DelContentMenuItem extends MenuItemDescriptor {
-
-    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;
-
-        @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 DelContentMenuItem(final I18nTranslationService i18n, final DelContentAction action, final CoreResources res) {
-        super(action);
-        this.withText(i18n.t("Delete")).withIcon(res.cancel());
-    }
-
-}

Copied: trunk/src/main/java/cc/kune/docs/client/actions/DelDocMenuItem.java (from rev 1320, trunk/src/main/java/cc/kune/docs/client/actions/DelContentMenuItem.java)
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/DelDocMenuItem.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/actions/DelDocMenuItem.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,15 @@
+package cc.kune.docs.client.actions;
+
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.actions.DelContentMenuItem;
+
+import com.google.inject.Inject;
+
+public class DelDocMenuItem extends DelContentMenuItem {
+
+    @Inject
+    public DelDocMenuItem(final I18nTranslationService i18n, final DelContentAction action, final CoreResources res) {
+        super(i18n, action, res);
+    }
+}

Modified: trunk/src/main/java/cc/kune/docs/client/actions/DelFolderMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/DelFolderMenuItem.java	2011-04-26 11:38:16 UTC (rev 1320)
+++ trunk/src/main/java/cc/kune/docs/client/actions/DelFolderMenuItem.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -1,69 +1,16 @@
 package cc.kune.docs.client.actions;
 
-import cc.kune.common.client.actions.ActionEvent;
-import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
-import cc.kune.common.client.notify.ConfirmAskEvent;
-import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.utils.OnAcceptCallback;
-import cc.kune.core.client.actions.RolAction;
 import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.client.rpcservices.ContentServiceAsync;
-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.AccessRolDTO;
 import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.docs.client.viewers.FolderViewerPresenter;
+import cc.kune.gspace.client.actions.DelContainerMenuItem;
 
-import com.google.gwt.event.shared.EventBus;
 import com.google.inject.Inject;
-import com.google.inject.Provider;
 
-public class DelFolderMenuItem extends MenuItemDescriptor {
+public class DelFolderMenuItem extends DelContainerMenuItem {
 
-    public static class DelFolderAction 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;
-
-        @Inject
-        public DelFolderAction(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 DelFolderMenuItem(final I18nTranslationService i18n, final DelFolderAction action, final CoreResources res) {
-        super(action);
-        this.withText(i18n.t("Delete")).withIcon(res.cancel());
+    public DelFolderMenuItem(final I18nTranslationService i18n, final DelContainerAction action, final CoreResources res) {
+        super(i18n, action, res);
     }
 
 }

Modified: trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java	2011-04-26 11:38:16 UTC (rev 1320)
+++ trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -29,12 +29,13 @@
 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.perspective.ActionGroups;
+import cc.kune.gspace.client.actions.AbstractFoldableToolActions;
+import cc.kune.gspace.client.actions.ActionGroups;
 
 import com.google.inject.Inject;
 import com.google.inject.Provider;
 
-public class DocsClientActions extends AbstractFoldableContentActions {
+public class DocsClientActions extends AbstractFoldableToolActions {
 
     final String[] all = { TYPE_ROOT, TYPE_FOLDER, TYPE_DOCUMENT, TYPE_UPLOADEDFILE };
     final String[] containers = { TYPE_ROOT, TYPE_FOLDER };
@@ -45,9 +46,9 @@
     @Inject
     public DocsClientActions(final I18nUITranslationService i18n, final Session session,
             final StateManager stateManager, final ActionRegistryByType registry, final CoreResources res,
-            final Provider<FolderGoUpBtn> folderGoUp, final Provider<NewDocBtn> newDocBtn,
-            final Provider<NewFolderBtn> newFolderBtn, final Provider<OpenContentMenuItem> openContentMenuItem,
-            final Provider<DelContentMenuItem> delContentMenuItem, final Provider<DelFolderMenuItem> delFolderMenuItem) {
+            final Provider<GoParentFolderBtn> folderGoUp, final Provider<NewDocBtn> newDocBtn,
+            final Provider<NewFolderBtn> newFolderBtn, final Provider<OpenDocMenuItem> openContentMenuItem,
+            final Provider<DelDocMenuItem> delContentMenuItem, final Provider<DelFolderMenuItem> delFolderMenuItem) {
         super(session, stateManager, i18n, registry);
         actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, contents);
         actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, containersNoRoot);
@@ -60,55 +61,6 @@
     }
 
     @Override
-    protected void createActions() {
-        // final String parentMenuTitle = i18n.t("File");
-        // final String parentMenuTitleCtx = i18n.t("Folder");
-        //
-        // createNewContainerAction(TYPE_FOLDER, "images/nav/folder_add.png",
-        // i18n.t("New folder"), parentMenuTitleCtx,
-        // i18n.t("New"), i18n.t("New folder"), Position.ctx, TYPE_ROOT,
-        // TYPE_FOLDER);
-        //
-        // createNewContentAction(TYPE_DOCUMENT, "images/nav/page_add.png",
-        // i18n.t("New document"), parentMenuTitleCtx,
-        // Position.ctx, TYPE_ROOT, TYPE_FOLDER);
-        //
-        // createTranslateAction(parentMenuTitle, TYPE_DOCUMENT, TYPE_FOLDER);
-        // createContentRenameAction(parentMenuTitle, i18n.t("Rename"),
-        // contents);
-        // createEditAction(parentMenuTitle, TYPE_DOCUMENT);
-        // createContentModeratedActions(parentMenuTitle, contentsModerated);
-        // createRenameContentInCtxAction(parentMenuTitleCtx, i18n.t("Rename"),
-        // containersNoRoot);
-        //
-        // // final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupCxt =
-        // // createSetAsDefContent(parentMenuTitleCtx);
-        //
-        // createRefreshCntAction(parentMenuTitle, contents);
-        // createRefreshCxtAction(parentMenuTitleCtx, containers);
-        //
-        // createSetAsDefContent(parentMenuTitle, contents);
-        //
-        // createSetGroupBackImageAction(parentMenuTitle, TYPE_UPLOADEDFILE);
-        //
-        // createUploadAction(i18n.t("Upload file"), "images/nav/upload.png",
-        // i18n.t("Upload files (images, PDFs...)"),
-        // null, containers);
-        //
-        // createDownloadActions(TYPE_UPLOADEDFILE);
-        //
-        // createGoAction(all);
-        //
-        // createGoHomeAction(containers);
-        //
-        // createDelContainerAction("Delete folder", parentMenuTitleCtx,
-        // containersNoRoot);
-        // createDelContentAction(parentMenuTitle, i18n.t("Delete"), contents);
-        // createShowDeletedItems(parentMenuTitleCtx, all);
-    }
-
-    @Override
     protected void createPostSessionInitActions() {
-        // super.createUploadMediaAction(TYPE_GALLERY);
     }
 }

Deleted: trunk/src/main/java/cc/kune/docs/client/actions/FolderGoUpBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/FolderGoUpBtn.java	2011-04-26 11:38:16 UTC (rev 1320)
+++ trunk/src/main/java/cc/kune/docs/client/actions/FolderGoUpBtn.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -1,55 +0,0 @@
-package cc.kune.docs.client.actions;
-
-import cc.kune.common.client.actions.AbstractExtendedAction;
-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.core.client.resources.CoreResources;
-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.ContainerDTO;
-import cc.kune.core.shared.dto.StateAbstractDTO;
-import cc.kune.core.shared.dto.StateContainerDTO;
-import cc.kune.core.shared.dto.StateContentDTO;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.google.inject.Inject;
-
-public class FolderGoUpBtn extends ButtonDescriptor {
-
-    public static class FolderGoUpAction extends AbstractExtendedAction {
-
-        private final Session session;
-        private final StateManager stateManager;
-
-        @Inject
-        public FolderGoUpAction(final Session session, final StateManager stateManager) {
-            this.session = session;
-            this.stateManager = stateManager;
-        }
-
-        @Override
-        public void actionPerformed(final ActionEvent event) {
-            NotifyUser.showProgress();
-            StateToken stateToken;
-            final StateAbstractDTO state = session.getCurrentState();
-            if (state instanceof StateContentDTO) {
-                stateToken = ((StateContentDTO) state).getContainer().getStateToken();
-            } else {
-                final ContainerDTO container = ((StateContainerDTO) state).getContainer();
-                stateToken = container.getStateToken().copy().setFolder(container.getParentFolderId());
-            }
-            stateManager.gotoStateToken(stateToken);
-            // NotifyUser.hideProgress();
-        }
-
-    }
-
-    @Inject
-    public FolderGoUpBtn(final I18nTranslationService i18n, final FolderGoUpAction action, final CoreResources res) {
-        super(action);
-        this.withToolTip(i18n.t("Go up: Open the container folder")).withIcon(res.folderGoUp());
-    }
-
-}

Copied: trunk/src/main/java/cc/kune/docs/client/actions/GoParentFolderBtn.java (from rev 1320, trunk/src/main/java/cc/kune/docs/client/actions/FolderGoUpBtn.java)
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/GoParentFolderBtn.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/actions/GoParentFolderBtn.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,16 @@
+package cc.kune.docs.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 GoParentFolderBtn extends GoParentContainerBtn {
+
+    @Inject
+    public GoParentFolderBtn(final I18nTranslationService i18n, final GoParentContainerAction action, final CoreResources res) {
+        super(i18n, action, res);
+    }
+
+}

Modified: trunk/src/main/java/cc/kune/docs/client/actions/NewDocBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/NewDocBtn.java	2011-04-26 11:38:16 UTC (rev 1320)
+++ trunk/src/main/java/cc/kune/docs/client/actions/NewDocBtn.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -1,75 +1,21 @@
 package cc.kune.docs.client.actions;
 
-import cc.kune.common.client.actions.ActionEvent;
-import cc.kune.common.client.actions.KeyStroke;
-import cc.kune.common.client.actions.Shortcut;
-import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
-import cc.kune.common.client.notify.NotifyUser;
 import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
-import cc.kune.core.client.actions.RolAction;
 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.ContentCache;
-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.HasContent;
-import cc.kune.core.shared.dto.StateContentDTO;
 import cc.kune.core.shared.i18n.I18nTranslationService;
 import cc.kune.docs.client.DocsClientTool;
+import cc.kune.gspace.client.actions.NewContentBtn;
 
 import com.google.inject.Inject;
-import com.google.inject.Provider;
 
-public class NewDocBtn extends ButtonDescriptor {
+public class NewDocBtn extends NewContentBtn {
 
-    public static class NewDocAction extends RolAction {
-
-        private final ContentCache cache;
-        private final Provider<ContentServiceAsync> contentService;
-        private final I18nTranslationService i18n;
-        private final Session session;
-        private final StateManager stateManager;
-
-        @Inject
-        public NewDocAction(final Session session, final StateManager stateManager, final I18nTranslationService i18n,
-                final Provider<ContentServiceAsync> contentService, final ContentCache cache) {
-            super(AccessRolDTO.Editor, true);
-            this.session = session;
-            this.stateManager = stateManager;
-            this.i18n = i18n;
-            this.contentService = contentService;
-            this.cache = cache;
-        }
-
-        @Override
-        public void actionPerformed(final ActionEvent event) {
-            NotifyUser.showProgressProcessing();
-            stateManager.gotoStateToken(((HasContent) session.getCurrentState()).getContainer().getStateToken());
-            contentService.get().addContent(session.getUserHash(), session.getCurrentStateToken(),
-                    i18n.t("New document"), DocsClientTool.TYPE_WAVE, new AsyncCallbackSimple<StateContentDTO>() {
-                        @Override
-                        public void onSuccess(final StateContentDTO state) {
-                            stateManager.setRetrievedStateAndGo(state);
-                            NotifyUser.hideProgress();
-                            // stateManager.refreshCurrentGroupState();
-                            // contextNavigator.setEditOnNextStateChange(true);
-                        }
-                    });
-            cache.removeContent(session.getCurrentStateToken());
-        }
-    }
-
     @Inject
-    public NewDocBtn(final I18nTranslationService i18n, final NewDocAction action, final NavResources res,
+    public NewDocBtn(final I18nTranslationService i18n, final NewContentAction action, final NavResources res,
             final GlobalShortcutRegister shorcutReg) {
-        super(action);
-        final KeyStroke shortcut = Shortcut.getShortcut(false, true, false, false, Character.valueOf('N'));
-        shorcutReg.put(shortcut, action);
-        this.withText(i18n.t("New document")).withToolTip(
-                "Create a New Document here. This document will be a new 'Page' in the public web if you publish it").withIcon(
-                res.pageAdd()).withShortcut(shortcut).withStyles("k-def-docbtn");
+        super(i18n, action, res, shorcutReg, i18n.t("New document"), i18n.t("Create a New Document here. "
+                + "This document will be a new 'Page' in the public web if you publish it"), i18n.t("New document"),
+                DocsClientTool.TYPE_WAVE);
     }
 
 }

Modified: trunk/src/main/java/cc/kune/docs/client/actions/NewFolderBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/NewFolderBtn.java	2011-04-26 11:38:16 UTC (rev 1320)
+++ trunk/src/main/java/cc/kune/docs/client/actions/NewFolderBtn.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -1,68 +1,19 @@
 package cc.kune.docs.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.core.client.actions.RolAction;
 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.ContentCache;
-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.HasContent;
-import cc.kune.core.shared.dto.StateContainerDTO;
 import cc.kune.core.shared.i18n.I18nTranslationService;
 import cc.kune.docs.client.DocsClientTool;
+import cc.kune.gspace.client.actions.NewContainerBtn;
 
 import com.google.inject.Inject;
-import com.google.inject.Provider;
 
-public class NewFolderBtn extends ButtonDescriptor {
+public class NewFolderBtn extends NewContainerBtn {
 
-    public static class NewDocAction extends RolAction {
-
-        private final ContentCache cache;
-        private final Provider<ContentServiceAsync> contentService;
-        private final I18nTranslationService i18n;
-        private final Session session;
-        private final StateManager stateManager;
-
-        @Inject
-        public NewDocAction(final Session session, final StateManager stateManager, final I18nTranslationService i18n,
-                final Provider<ContentServiceAsync> contentService, final ContentCache cache) {
-            super(AccessRolDTO.Editor, true);
-            this.session = session;
-            this.stateManager = stateManager;
-            this.i18n = i18n;
-            this.contentService = contentService;
-            this.cache = cache;
-        }
-
-        @Override
-        public void actionPerformed(final ActionEvent event) {
-            NotifyUser.showProgressProcessing();
-            stateManager.gotoStateToken(((HasContent) session.getCurrentState()).getContainer().getStateToken());
-            contentService.get().addFolder(session.getUserHash(), session.getCurrentStateToken(), i18n.t("New folder"),
-                    DocsClientTool.TYPE_FOLDER, new AsyncCallbackSimple<StateContainerDTO>() {
-                        @Override
-                        public void onSuccess(final StateContainerDTO state) {
-                            // contextNavigator.setEditOnNextStateChange(true);
-                            stateManager.setRetrievedStateAndGo(state);
-                            NotifyUser.hideProgress();
-                        }
-                    });
-            cache.removeContent(session.getCurrentStateToken());
-        }
-
-    }
-
     @Inject
-    public NewFolderBtn(final I18nTranslationService i18n, final NewDocAction action, final NavResources res) {
-        super(action);
-        this.withText(i18n.t("New folder")).withToolTip(
-                i18n.t("Create a new folder here. A folder will be a 'section' in the public web")).withIcon(
-                res.folderAdd()).withStyles("k-def-docbtn");
+    public NewFolderBtn(final I18nTranslationService i18n, final NewContainerAction action, final NavResources res) {
+        super(i18n, action, res, i18n.t("New folder"),
+                i18n.t("Create a new folder here. A folder will be a 'section' in the public web"),
+                i18n.t("New folder"), DocsClientTool.TYPE_FOLDER);
     }
+
 }

Deleted: trunk/src/main/java/cc/kune/docs/client/actions/OpenContentMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/OpenContentMenuItem.java	2011-04-26 11:38:16 UTC (rev 1320)
+++ trunk/src/main/java/cc/kune/docs/client/actions/OpenContentMenuItem.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -1,37 +0,0 @@
-package cc.kune.docs.client.actions;
-
-import cc.kune.common.client.actions.AbstractExtendedAction;
-import cc.kune.common.client.actions.ActionEvent;
-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.i18n.I18nTranslationService;
-
-import com.google.inject.Inject;
-
-public class OpenContentMenuItem extends MenuItemDescriptor {
-
-    public static class OpenContentAction extends AbstractExtendedAction {
-
-        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 OpenContentMenuItem(final I18nTranslationService i18n, final OpenContentAction action, final NavResources res) {
-        super(action);
-        this.withText(i18n.t("Open")).withIcon(res.go());
-    }
-
-}

Copied: trunk/src/main/java/cc/kune/docs/client/actions/OpenDocMenuItem.java (from rev 1320, trunk/src/main/java/cc/kune/docs/client/actions/OpenContentMenuItem.java)
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/OpenDocMenuItem.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/actions/OpenDocMenuItem.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,16 @@
+package cc.kune.docs.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 OpenDocMenuItem extends OpenContentMenuItem {
+
+    @Inject
+    public OpenDocMenuItem(final I18nTranslationService i18n, final OpenContentAction action, final NavResources res) {
+        super(i18n, action, res);
+    }
+
+}

Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java	2011-04-26 11:38:16 UTC (rev 1320)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -26,6 +26,10 @@
 import cc.kune.gspace.client.tool.selector.ToolSelectorPresenter;
 import cc.kune.gspace.client.ui.footer.license.EntityLicensePanel;
 import cc.kune.gspace.client.ui.footer.license.EntityLicensePresenter;
+import cc.kune.gspace.client.viewers.DocViewerPanel;
+import cc.kune.gspace.client.viewers.DocViewerPresenter;
+import cc.kune.gspace.client.viewers.FolderViewerAsTablePanel;
+import cc.kune.gspace.client.viewers.FolderViewerPresenter;
 
 import com.google.inject.Singleton;
 import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
@@ -49,6 +53,10 @@
         bindPresenter(ToolSelectorPresenter.class, ToolSelectorPresenter.ToolSelectorView.class,
                 ToolSelectorPanel.class, ToolSelectorPresenter.ToolSelectorProxy.class);
         bind(ToolSelector.class).to(ToolSelectorPresenter.class).in(Singleton.class);
+        bindPresenter(DocViewerPresenter.class, DocViewerPresenter.DocViewerView.class, DocViewerPanel.class,
+                DocViewerPresenter.DocViewerProxy.class);
+        bindPresenter(FolderViewerPresenter.class, FolderViewerPresenter.FolderViewerView.class,
+                FolderViewerAsTablePanel.class, FolderViewerPresenter.FolderViewerProxy.class);
     }
 
 }
\ No newline at end of file

Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceGinjector.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceGinjector.java	2011-04-26 11:38:16 UTC (rev 1320)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceGinjector.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -4,6 +4,8 @@
 import cc.kune.gspace.client.tool.ContentViewerSelector;
 import cc.kune.gspace.client.tool.selector.ToolSelectorPresenter;
 import cc.kune.gspace.client.ui.footer.license.EntityLicensePresenter;
+import cc.kune.gspace.client.viewers.DocViewerPresenter;
+import cc.kune.gspace.client.viewers.FolderViewerPresenter;
 
 import com.google.gwt.inject.client.AsyncProvider;
 import com.google.gwt.inject.client.Ginjector;
@@ -12,8 +14,12 @@
 
     ContentViewerSelector getContentViewerSelector();
 
+    AsyncProvider<DocViewerPresenter> getDocsViewerPresenter();
+
     AsyncProvider<EntityLicensePresenter> getEntityLicensePresenter();
 
+    AsyncProvider<FolderViewerPresenter> getFolderViewerPresenter();
+
     GSpaceParts getGSpaceParts();
 
     AsyncProvider<TagsSummaryPresenter> getTagsSummaryPresenter();

Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java	2011-04-26 11:38:16 UTC (rev 1320)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -6,6 +6,8 @@
 import cc.kune.gspace.client.tags.TagsSummaryPresenter;
 import cc.kune.gspace.client.tool.selector.ToolSelector;
 import cc.kune.gspace.client.ui.footer.license.EntityLicensePresenter;
+import cc.kune.gspace.client.viewers.DocViewerPresenter;
+import cc.kune.gspace.client.viewers.FolderViewerPresenter;
 
 import com.google.inject.Inject;
 import com.google.inject.Provider;
@@ -14,13 +16,16 @@
 
     @Inject
     public GSpaceParts(final Session session, final Provider<EntityLicensePresenter> licenseFooter,
-            final Provider<TagsSummaryPresenter> tagsPresenter, final Provider<ToolSelector> toolSelector) {
+            final Provider<TagsSummaryPresenter> tagsPresenter, final Provider<ToolSelector> toolSelector,
+            final Provider<DocViewerPresenter> docsViewer, final Provider<FolderViewerPresenter> folderViewer) {
         session.onAppStart(true, new AppStartHandler() {
             @Override
             public void onAppStart(final AppStartEvent event) {
                 licenseFooter.get();
                 tagsPresenter.get();
                 toolSelector.get();
+                docsViewer.get();
+                folderViewer.get();
             }
         });
     }

Copied: trunk/src/main/java/cc/kune/gspace/client/actions/AbstractFoldableToolActions.java (from rev 1315, trunk/src/main/java/cc/kune/docs/client/actions/AbstractFoldableContentActions.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/AbstractFoldableToolActions.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/AbstractFoldableToolActions.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,52 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.actions;
+
+import cc.kune.core.client.actions.ActionRegistryByType;
+import cc.kune.core.client.i18n.I18nUITranslationService;
+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.core.client.state.StateManager;
+
+public abstract class AbstractFoldableToolActions {
+
+    protected final ActionRegistryByType actionsRegistry;
+    protected final I18nUITranslationService i18n;
+    protected final Session session;
+    protected final StateManager stateManager;
+
+    public AbstractFoldableToolActions(final Session session, final StateManager stateManager,
+            final I18nUITranslationService i18n, final ActionRegistryByType actionsRegistry) {
+        this.session = session;
+        this.stateManager = stateManager;
+        this.i18n = i18n;
+        this.actionsRegistry = actionsRegistry;
+        session.onAppStart(true, new AppStartHandler() {
+            @Override
+            public void onAppStart(final AppStartEvent event) {
+                createPostSessionInitActions();
+            }
+        });
+    }
+
+    protected abstract void createPostSessionInitActions();
+
+}

Copied: trunk/src/main/java/cc/kune/gspace/client/actions/ActionGroups.java (from rev 1320, trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ActionGroups.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/ActionGroups.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/ActionGroups.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,14 @@
+package cc.kune.gspace.client.actions;
+
+/**
+ * A group of actions that must be grouped and showed in some perspective (on
+ * edit, etc)
+ */
+public class ActionGroups {
+    public static String EDIT = "edit";
+    public static String MENUITEM = "menu-item";
+    public static String VIEW = "view";
+
+    private ActionGroups() {
+    }
+}

Added: trunk/src/main/java/cc/kune/gspace/client/actions/DelContainerMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/DelContainerMenuItem.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/DelContainerMenuItem.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,69 @@
+package cc.kune.gspace.client.actions;
+
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
+import cc.kune.common.client.notify.ConfirmAskEvent;
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.common.client.utils.OnAcceptCallback;
+import cc.kune.core.client.actions.RolAction;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.client.rpcservices.ContentServiceAsync;
+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.AccessRolDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.viewers.FolderViewerPresenter;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class DelContainerMenuItem extends MenuItemDescriptor {
+
+    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;
+
+        @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();
+                        }
+                    });
+        }
+
+    }
+
+    public DelContainerMenuItem(final I18nTranslationService i18n, final DelContainerAction action,
+            final CoreResources res) {
+        super(action);
+        this.withText(i18n.t("Delete")).withIcon(res.cancel());
+    }
+
+}


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

Added: trunk/src/main/java/cc/kune/gspace/client/actions/DelContentMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/DelContentMenuItem.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/DelContentMenuItem.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,86 @@
+package cc.kune.gspace.client.actions;
+
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
+import cc.kune.common.client.notify.ConfirmAskEvent;
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.common.client.utils.OnAcceptCallback;
+import cc.kune.core.client.actions.RolAction;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
+import cc.kune.core.client.rpcservices.ContentServiceAsync;
+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.AccessRolDTO;
+import cc.kune.core.shared.dto.StateContentDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.viewers.FolderViewerPresenter;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class DelContentMenuItem extends MenuItemDescriptor {
+
+    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;
+
+        @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();
+                                        }
+                                    });
+                        }
+                    });
+        }
+
+    }
+
+    public DelContentMenuItem(final I18nTranslationService i18n, final DelContentAction action, final CoreResources res) {
+        super(action);
+        this.withText(i18n.t("Delete")).withIcon(res.cancel());
+    }
+
+}


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

Added: trunk/src/main/java/cc/kune/gspace/client/actions/GoParentContainerBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/GoParentContainerBtn.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/GoParentContainerBtn.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,54 @@
+package cc.kune.gspace.client.actions;
+
+import cc.kune.common.client.actions.AbstractExtendedAction;
+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.core.client.resources.CoreResources;
+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.ContainerDTO;
+import cc.kune.core.shared.dto.StateAbstractDTO;
+import cc.kune.core.shared.dto.StateContainerDTO;
+import cc.kune.core.shared.dto.StateContentDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+
+public class GoParentContainerBtn extends ButtonDescriptor {
+
+    public static class GoParentContainerAction extends AbstractExtendedAction {
+
+        private final Session session;
+        private final StateManager stateManager;
+
+        @Inject
+        public GoParentContainerAction(final Session session, final StateManager stateManager) {
+            this.session = session;
+            this.stateManager = stateManager;
+        }
+
+        @Override
+        public void actionPerformed(final ActionEvent event) {
+            NotifyUser.showProgress();
+            StateToken stateToken;
+            final StateAbstractDTO state = session.getCurrentState();
+            if (state instanceof StateContentDTO) {
+                stateToken = ((StateContentDTO) state).getContainer().getStateToken();
+            } else {
+                final ContainerDTO container = ((StateContainerDTO) state).getContainer();
+                stateToken = container.getStateToken().copy().setFolder(container.getParentFolderId());
+            }
+            stateManager.gotoStateToken(stateToken);
+            // NotifyUser.hideProgress();
+        }
+
+    }
+
+    public GoParentContainerBtn(final I18nTranslationService i18n, final GoParentContainerAction action, final CoreResources res) {
+        super(action);
+        this.withToolTip(i18n.t("Go up: Open the container folder")).withIcon(res.folderGoUp());
+    }
+
+}


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

Added: trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerBtn.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerBtn.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,72 @@
+package cc.kune.gspace.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.core.client.actions.RolAction;
+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.ContentCache;
+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.HasContent;
+import cc.kune.core.shared.dto.StateContainerDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class NewContainerBtn extends ButtonDescriptor {
+
+    public static class NewContainerAction extends RolAction {
+
+        private final ContentCache cache;
+        private final Provider<ContentServiceAsync> contentService;
+        private final I18nTranslationService i18n;
+        private final Session session;
+        private final StateManager stateManager;
+
+        @Inject
+        public NewContainerAction(final Session session, final StateManager stateManager,
+                final I18nTranslationService i18n, final Provider<ContentServiceAsync> contentService,
+                final ContentCache cache) {
+            super(AccessRolDTO.Editor, true);
+            this.session = session;
+            this.stateManager = stateManager;
+            this.i18n = i18n;
+            this.contentService = contentService;
+            this.cache = cache;
+        }
+
+        @Override
+        public void actionPerformed(final ActionEvent event) {
+            NotifyUser.showProgressProcessing();
+            stateManager.gotoStateToken(((HasContent) session.getCurrentState()).getContainer().getStateToken());
+            contentService.get().addFolder(session.getUserHash(), session.getCurrentStateToken(),
+                    (String) getValue(NEW_NAME), (String) getValue(ID), new AsyncCallbackSimple<StateContainerDTO>() {
+                        @Override
+                        public void onSuccess(final StateContainerDTO state) {
+                            // contextNavigator.setEditOnNextStateChange(true);
+                            stateManager.setRetrievedStateAndGo(state);
+                            NotifyUser.hideProgress();
+                        }
+                    });
+            cache.removeContent(session.getCurrentStateToken());
+        }
+
+    }
+
+    private static final String ID = "ctnernewid";
+    private static final String NEW_NAME = "ctnernewname";
+
+    public NewContainerBtn(final I18nTranslationService i18n, final NewContainerAction action, final NavResources res,
+            final String title, final String tooltip, final String newName, final String id) {
+        super(action);
+        // The name given to this new content
+        action.putValue(NEW_NAME, newName);
+        action.putValue(ID, id);
+        this.withText(title).withToolTip(tooltip).withIcon(res.folderAdd()).withStyles("k-def-docbtn");
+    }
+}


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

Added: trunk/src/main/java/cc/kune/gspace/client/actions/NewContentBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/NewContentBtn.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/NewContentBtn.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,78 @@
+package cc.kune.gspace.client.actions;
+
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.actions.KeyStroke;
+import cc.kune.common.client.actions.Shortcut;
+import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
+import cc.kune.core.client.actions.RolAction;
+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.ContentCache;
+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.HasContent;
+import cc.kune.core.shared.dto.StateContentDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class NewContentBtn extends ButtonDescriptor {
+
+    public static class NewContentAction extends RolAction {
+
+        private final ContentCache cache;
+        private final Provider<ContentServiceAsync> contentService;
+        private final Session session;
+        private final StateManager stateManager;
+
+        @Inject
+        public NewContentAction(final Session session, final StateManager stateManager,
+                final I18nTranslationService i18n, final Provider<ContentServiceAsync> contentService,
+                final ContentCache cache) {
+            super(AccessRolDTO.Editor, true);
+            this.session = session;
+            this.stateManager = stateManager;
+            this.contentService = contentService;
+            this.cache = cache;
+        }
+
+        @Override
+        public void actionPerformed(final ActionEvent event) {
+            NotifyUser.showProgressProcessing();
+            stateManager.gotoStateToken(((HasContent) session.getCurrentState()).getContainer().getStateToken());
+            contentService.get().addContent(session.getUserHash(), session.getCurrentStateToken(),
+                    (String) getValue(NEW_NAME), (String) getValue(ID), new AsyncCallbackSimple<StateContentDTO>() {
+                        @Override
+                        public void onSuccess(final StateContentDTO state) {
+                            stateManager.setRetrievedStateAndGo(state);
+                            NotifyUser.hideProgress();
+                            // stateManager.refreshCurrentGroupState();
+                            // contextNavigator.setEditOnNextStateChange(true);
+                        }
+                    });
+            cache.removeContent(session.getCurrentStateToken());
+        }
+    }
+
+    private static final String ID = "ctnnewid";
+    private static final String NEW_NAME = "ctnnewname";
+
+    public NewContentBtn(final I18nTranslationService i18n, final NewContentAction action, final NavResources res,
+            final GlobalShortcutRegister shorcutReg, final String title, final String tooltip, final String newName,
+            final String id) {
+        super(action);
+        // The name given to this new content
+        action.putValue(NEW_NAME, newName);
+        action.putValue(ID, id);
+        final KeyStroke shortcut = Shortcut.getShortcut(false, true, false, false, Character.valueOf('N'));
+        shorcutReg.put(shortcut, action);
+        this.withText(title).withToolTip(tooltip).withIcon(res.pageAdd()).withShortcut(shortcut).withStyles(
+                "k-def-docbtn");
+    }
+
+}


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

Added: trunk/src/main/java/cc/kune/gspace/client/actions/OpenContentMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/OpenContentMenuItem.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/OpenContentMenuItem.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,36 @@
+package cc.kune.gspace.client.actions;
+
+import cc.kune.common.client.actions.AbstractExtendedAction;
+import cc.kune.common.client.actions.ActionEvent;
+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.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+
+public class OpenContentMenuItem extends MenuItemDescriptor {
+
+    public static class OpenContentAction extends AbstractExtendedAction {
+
+        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());
+        }
+
+    }
+
+    public OpenContentMenuItem(final I18nTranslationService i18n, final OpenContentAction action, final NavResources res) {
+        super(action);
+        this.withText(i18n.t("Open")).withIcon(res.go());
+    }
+
+}


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

Copied: trunk/src/main/java/cc/kune/gspace/client/viewers (from rev 1315, trunk/src/main/java/cc/kune/docs/client/viewers)

Copied: trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java (from rev 1320, trunk/src/main/java/cc/kune/docs/client/viewers/AbstractFolderViewerPanel.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,66 @@
+package cc.kune.gspace.client.viewers;
+
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
+import cc.kune.common.client.ui.UiUtils;
+import cc.kune.core.shared.dto.StateContainerDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.viewers.FolderViewerPresenter.FolderViewerView;
+
+import com.google.gwt.user.client.ui.InlineLabel;
+import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtplatform.mvp.client.ViewImpl;
+
+public abstract class AbstractFolderViewerPanel extends ViewImpl implements FolderViewerView {
+    private final InlineLabel emptyLabel;
+    protected final GSpaceArmor gsArmor;
+    protected final I18nTranslationService i18n;
+    protected Widget widget;
+
+    public AbstractFolderViewerPanel(final GSpaceArmor gsArmor, final I18nTranslationService i18n) {
+        this.gsArmor = gsArmor;
+        this.i18n = i18n;
+        emptyLabel = new InlineLabel(i18n.t("This folder is empty."));
+        emptyLabel.setStyleName("k-empty-msg");
+    }
+
+    @Override
+    public Widget asWidget() {
+        return widget;
+    }
+
+    @Override
+    public void attach() {
+        final ForIsWidget docContainer = gsArmor.getDocContainer();
+        docContainer.add(widget);
+    }
+
+    @Override
+    public void clear() {
+        gsArmor.getSubheaderToolbar().clear();
+        UiUtils.clear(gsArmor.getDocContainer());
+        UiUtils.clear(gsArmor.getDocHeader());
+    }
+
+    @Override
+    public void detach() {
+        clear();
+    }
+
+    @Override
+    public void setActions(final GuiActionDescCollection actions) {
+        gsArmor.getSubheaderToolbar().clear();
+        gsArmor.getSubheaderToolbar().addAll(actions);
+    }
+
+    @Override
+    public void setContainer(final StateContainerDTO state) {
+        gsArmor.getDocHeader().add(new InlineLabel(state.getTitle()));
+    }
+
+    @Override
+    public void showEmptyMsg() {
+        gsArmor.getDocContainer().add(emptyLabel);
+    }
+}

Deleted: trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -1,158 +0,0 @@
-package cc.kune.docs.client.viewers;
-
-import org.waveprotocol.box.webclient.client.ClientIdGenerator;
-import org.waveprotocol.box.webclient.client.RemoteViewServiceMultiplexer;
-import org.waveprotocol.box.webclient.client.Session;
-import org.waveprotocol.box.webclient.client.SimpleWaveStore;
-import org.waveprotocol.box.webclient.client.StagesProvider;
-import org.waveprotocol.box.webclient.client.WaveWebSocketClient;
-import org.waveprotocol.box.webclient.search.WaveStore;
-import org.waveprotocol.box.webclient.widget.loading.LoadingIndicator;
-import org.waveprotocol.wave.client.account.ProfileManager;
-import org.waveprotocol.wave.client.account.impl.ProfileManagerImpl;
-import org.waveprotocol.wave.client.widget.common.ImplPanel;
-import org.waveprotocol.wave.model.id.IdGenerator;
-import org.waveprotocol.wave.model.wave.ParticipantId;
-import org.waveprotocol.wave.model.waveref.InvalidWaveRefException;
-import org.waveprotocol.wave.model.waveref.WaveRef;
-import org.waveprotocol.wave.util.escapers.GwtWaverefEncoder;
-
-import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
-import cc.kune.common.client.errors.UIException;
-import cc.kune.core.shared.dto.StateContentDTO;
-import cc.kune.docs.client.viewers.DocViewerPresenter.DocViewerView;
-import cc.kune.gspace.client.GSpaceArmor;
-import cc.kune.wave.client.WaveClientManager;
-import cc.kune.wave.client.WebClient;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.dom.client.Document;
-import com.google.gwt.dom.client.Element;
-import com.google.gwt.safehtml.shared.SafeHtmlUtils;
-import com.google.gwt.uibinder.client.UiBinder;
-import com.google.gwt.uibinder.client.UiField;
-import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.ui.DeckPanel;
-import com.google.gwt.user.client.ui.InlineHTML;
-import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.Widget;
-import com.google.inject.Inject;
-import com.gwtplatform.mvp.client.ViewImpl;
-
-public class DocViewerPanel extends ViewImpl implements DocViewerView {
-    interface DocsViewerPanelUiBinder extends UiBinder<Widget, DocViewerPanel> {
-    }
-
-    private static DocsViewerPanelUiBinder uiBinder = GWT.create(DocsViewerPanelUiBinder.class);
-
-    private RemoteViewServiceMultiplexer channel;
-    @UiField
-    DeckPanel deck;
-    private IdGenerator idGenerator;
-    private final Element loading = new LoadingIndicator().getElement();
-    @UiField
-    InlineHTML onlyViewPanel;
-    private ProfileManager profiles;
-    /** The wave panel, if a wave is open. */
-    private StagesProvider wave;
-    private final WaveClientManager waveClientManager;
-    // @UiField
-    // FramedPanel waveFrame;
-    @UiField
-    ImplPanel waveHolder;
-    private final WaveStore waveStore = new SimpleWaveStore();
-    private final Widget widget;
-    private final GSpaceArmor wsArmor;
-
-    @Inject
-    public DocViewerPanel(final GSpaceArmor wsArmor, final WaveClientManager waveClientManager) {
-        this.wsArmor = wsArmor;
-        this.waveClientManager = waveClientManager;
-        widget = uiBinder.createAndBindUi(this);
-    }
-
-    @Override
-    public Widget asWidget() {
-        return widget;
-    }
-
-    @Override
-    public void attach() {
-        final ForIsWidget docContainer = wsArmor.getDocContainer();
-        final int widgetCount = docContainer.getWidgetCount();
-        for (int i = 0; i < widgetCount; i++) {
-            docContainer.remove(i);
-        }
-        docContainer.add(widget);
-    }
-
-    @Override
-    public void detach() {
-        widget.removeFromParent();
-    }
-
-    private WaveRef getWaveRef(final String waveRefS) {
-        try {
-            return GwtWaverefEncoder.decodeWaveRefFromPath(waveRefS);
-        } catch (final InvalidWaveRefException e) {
-            throw new UIException("Invalid waveref: " + waveRefS);
-        }
-    }
-
-    private void initWaveClientIfNeeded() {
-        if (channel == null) {
-            final WaveWebSocketClient webSocket = new WaveWebSocketClient(WebClient.useSocketIO(),
-                    WebClient.getWebSocketBaseUrl(GWT.getModuleBaseURL()));
-            webSocket.connect();
-            channel = new RemoteViewServiceMultiplexer(webSocket,
-                    new ParticipantId(Session.get().getAddress()).getAddress());
-            profiles = new ProfileManagerImpl();
-            idGenerator = ClientIdGenerator.create();
-        }
-    }
-
-    @Override
-    public void setActions(final GuiActionDescCollection actions) {
-        wsArmor.getSubheaderToolbar().clear();
-        wsArmor.getSubheaderToolbar().addAll(actions);
-    }
-
-    @Override
-    public void setContent(final StateContentDTO state) {
-        final boolean editable = state.getContentRights().isEditable();
-        if (editable) {
-            // initWaveClientIfNeeded();
-            // setEditableWaveContent(state.getWaveRef(), false);
-            waveHolder.clear();
-            waveHolder.add(new Label(state.getContent() + " (but here goes the Wave editor -we are testing it-)"));
-            onlyViewPanel.setHTML(SafeHtmlUtils.fromTrustedString(state.getContent()));
-        } else {
-            onlyViewPanel.setHTML(SafeHtmlUtils.fromTrustedString(state.getContent()));
-        }
-        deck.showWidget(editable ? 0 : 1);
-    }
-
-    public void setEditableWaveContent(final String waveRefS, final boolean isNewWave) {
-        final WaveRef waveRef = getWaveRef(waveRefS);
-
-        if (wave != null) {
-            wave.destroy();
-            wave = null;
-        }
-
-        // Release the display:none.
-        // UIObject.setVisible(waveFrame.getElement(), true);
-        waveHolder.getElement().appendChild(loading);
-        final Element holder = waveHolder.getElement().appendChild(Document.get().createDivElement());
-        final StagesProvider wave = new StagesProvider(holder, waveHolder, waveRef, channel, idGenerator, profiles,
-                waveStore, isNewWave);
-        this.wave = wave;
-        wave.load(new Command() {
-            @Override
-            public void execute() {
-                loading.removeFromParent();
-            }
-        });
-    }
-}

Copied: trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.java (from rev 1317, trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPanel.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,150 @@
+package cc.kune.gspace.client.viewers;
+
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
+import cc.kune.common.client.ui.UiUtils;
+import cc.kune.core.shared.dto.StateContentDTO;
+import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.viewers.DocViewerPresenter.DocViewerView;
+import cc.kune.wave.client.WaveClientManager;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.safehtml.shared.SafeHtmlUtils;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.client.ui.DeckPanel;
+import com.google.gwt.user.client.ui.InlineHTML;
+import com.google.gwt.user.client.ui.InlineLabel;
+import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
+import com.gwtplatform.mvp.client.ViewImpl;
+
+public class DocViewerPanel extends ViewImpl implements DocViewerView {
+    interface DocsViewerPanelUiBinder extends UiBinder<Widget, DocViewerPanel> {
+    }
+
+    private static DocsViewerPanelUiBinder uiBinder = GWT.create(DocsViewerPanelUiBinder.class);
+
+    // private RemoteViewServiceMultiplexer channel;
+    @UiField
+    DeckPanel deck;
+    private final GSpaceArmor gsArmor;
+    // private IdGenerator idGenerator;
+    // private final Element loading = new LoadingIndicator().getElement();
+    @UiField
+    InlineHTML onlyViewPanel;
+    // private ProfileManager profiles;
+    /** The wave panel, if a wave is open. */
+    // private StagesProvider wave;
+    // private final WaveClientManager waveClientManager;
+    // @UiField
+    // FramedPanel waveFrame;
+    // @UiField
+    // ImplPanel waveHolder;
+    // private final WaveStore waveStore = new SimpleWaveStore();
+    private final Widget widget;
+
+    @Inject
+    public DocViewerPanel(final GSpaceArmor wsArmor, final WaveClientManager waveClientManager) {
+        this.gsArmor = wsArmor;
+        // this.waveClientManager = waveClientManager;
+        widget = uiBinder.createAndBindUi(this);
+    }
+
+    @Override
+    public Widget asWidget() {
+        return widget;
+    }
+
+    @Override
+    public void attach() {
+        final ForIsWidget docContainer = gsArmor.getDocContainer();
+        docContainer.add(widget);
+    }
+
+    @Override
+    public void clear() {
+        onlyViewPanel.setHTML("");
+        gsArmor.getSubheaderToolbar().clear();
+        UiUtils.clear(gsArmor.getDocContainer());
+        UiUtils.clear(gsArmor.getDocHeader());
+    }
+
+    @Override
+    public void detach() {
+        clear();
+    }
+
+    // private WaveRef getWaveRef(final String waveRefS) {
+    // try {
+    // return GwtWaverefEncoder.decodeWaveRefFromPath(waveRefS);
+    // } catch (final InvalidWaveRefException e) {
+    // throw new UIException("Invalid waveref: " + waveRefS);
+    // }
+    // }
+    //
+    // private void initWaveClientIfNeeded() {
+    // if (channel == null) {
+    // final WaveWebSocketClient webSocket = new
+    // WaveWebSocketClient(WebClient.useSocketIO(),
+    // WebClient.getWebSocketBaseUrl(GWT.getModuleBaseURL()));
+    // webSocket.connect();
+    // channel = new RemoteViewServiceMultiplexer(webSocket,
+    // new ParticipantId(Session.get().getAddress()).getAddress());
+    // profiles = new ProfileManagerImpl();
+    // idGenerator = ClientIdGenerator.create();
+    // }
+    // }
+
+    @Override
+    public void setActions(final GuiActionDescCollection actions) {
+        gsArmor.getSubheaderToolbar().clear();
+        gsArmor.getSubheaderToolbar().addAll(actions);
+    }
+
+    @Override
+    public void setContent(final StateContentDTO state) {
+        final ForIsWidget docHeader = gsArmor.getDocHeader();
+        UiUtils.clear(docHeader);
+        docHeader.add(new InlineLabel(state.getTitle()));
+        final boolean editable = state.getContentRights().isEditable();
+        if (editable) {
+            // initWaveClientIfNeeded();
+            // setEditableWaveContent(state.getWaveRef(), false);
+            // waveHolder.clear();
+            // waveHolder.add(new Label(state.getContent() +
+            // " (but here goes the Wave editor -we are testing it-)"));
+            onlyViewPanel.setHTML(SafeHtmlUtils.fromTrustedString(state.getContent()));
+        } else {
+            onlyViewPanel.setHTML(SafeHtmlUtils.fromTrustedString(state.getContent()));
+        }
+        // deck.showWidget(editable ? 0 : 1);
+        deck.showWidget(1);
+    }
+    //
+    // private void setEditableWaveContent(final String waveRefS, final boolean
+    // isNewWave) {
+    // final WaveRef waveRef = getWaveRef(waveRefS);
+    //
+    // if (wave != null) {
+    // wave.destroy();
+    // wave = null;
+    // }
+    //
+    // // Release the display:none.
+    // // UIObject.setVisible(waveFrame.getElement(), true);
+    // waveHolder.getElement().appendChild(loading);
+    // final Element holder =
+    // waveHolder.getElement().appendChild(Document.get().createDivElement());
+    // final StagesProvider wave = new StagesProvider(holder, waveHolder,
+    // waveRef, channel, idGenerator, profiles,
+    // waveStore, isNewWave);
+    // this.wave = wave;
+    // wave.load(new Command() {
+    // @Override
+    // public void execute() {
+    // loading.removeFromParent();
+    // }
+    // });
+    // }
+}

Deleted: trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPanel.ui.xml	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.ui.xml	2011-04-26 19:57:21 UTC (rev 1321)
@@ -1,25 +0,0 @@
-<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
-<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
-  xmlns:g='urn:import:com.google.gwt.user.client.ui' xmlns:f='urn:import:org.waveprotocol.box.webclient.widget.frame'
-  xmlns:w='urn:import:org.waveprotocol.wave.client.widget.common'>
-  <ui:style>
-    .wavePanel {
-        margin: 0 0 0 0;
-    }
-    .waveHolder {
-        position: absolute;
-        top: 0;
-        bottom: 0;
-        left: 0;
-        right: 0;
-    }
-  </ui:style>
-  <g:HTMLPanel width="100%" height="100%">
-   <g:DeckPanel ui:field="deck" addStyleNames="k-doc-content-deck">
-<!--     <f:FramedPanel ui:field="waveFrame" addStyleNames="{style.wavePanel}"> -->
-<!--     </f:FramedPanel> -->
-      <w:ImplPanel ui:field="waveHolder" addStyleNames="{style.waveHolder}" />
-    <g:InlineHTML ui:field="onlyViewPanel" />
-   </g:DeckPanel>
-  </g:HTMLPanel>
-</ui:UiBinder>
\ No newline at end of file

Copied: trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.ui.xml (from rev 1317, trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPanel.ui.xml)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.ui.xml	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.ui.xml	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,28 @@
+<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
+<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
+  xmlns:g='urn:import:com.google.gwt.user.client.ui' xmlns:f='urn:import:org.waveprotocol.box.webclient.widget.frame'
+  xmlns:w='urn:import:org.waveprotocol.wave.client.widget.common'>
+  <ui:style>
+    .wavePanel {
+        margin: 0 0 0 0;
+    }
+
+    .waveHolder {
+        position: absolute;
+        top: 0;
+        bottom: 0;
+        left: 0;
+        right: 0;
+    }
+  </ui:style>
+  <g:HTMLPanel width="100%" height="100%">
+    <g:DeckPanel ui:field="deck" addStyleNames="k-doc-content-deck">
+      <!-- <f:FramedPanel ui:field="waveFrame" addStyleNames="{style.wavePanel}"> -->
+      <!-- </f:FramedPanel> -->
+      <!-- <w:ImplPanel ui:field="waveHolder" addStyleNames="{style.waveHolder}"
+        /> -->
+      <g:InlineHTML ui:field="delete" />
+      <g:InlineHTML ui:field="onlyViewPanel" />
+    </g:DeckPanel>
+  </g:HTMLPanel>
+</ui:UiBinder>
\ No newline at end of file

Deleted: trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPresenter.java	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPresenter.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -1,79 +0,0 @@
-package cc.kune.docs.client.viewers;
-
-import javax.annotation.Nonnull;
-
-import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
-import cc.kune.core.client.actions.ActionRegistryByType;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.shared.domain.utils.AccessRights;
-import cc.kune.core.shared.dto.HasContent;
-import cc.kune.core.shared.dto.StateContentDTO;
-import cc.kune.docs.client.DocsClientTool;
-import cc.kune.docs.client.actions.DocsClientActions;
-import cc.kune.gspace.client.tool.ContentViewer;
-import cc.kune.gspace.client.tool.ContentViewerSelector;
-
-import com.google.gwt.event.shared.EventBus;
-import com.google.inject.Inject;
-import com.gwtplatform.mvp.client.Presenter;
-import com.gwtplatform.mvp.client.View;
-import com.gwtplatform.mvp.client.annotations.ProxyCodeSplit;
-import com.gwtplatform.mvp.client.proxy.Proxy;
-import com.gwtplatform.mvp.client.proxy.RevealRootContentEvent;
-
-public class DocViewerPresenter extends Presenter<DocViewerPresenter.DocViewerView, DocViewerPresenter.DocViewerProxy>
-        implements ContentViewer {
-
-    @ProxyCodeSplit
-    public interface DocViewerProxy extends Proxy<DocViewerPresenter> {
-    }
-
-    public interface DocViewerView extends View {
-
-        void attach();
-
-        void detach();
-
-        void setActions(GuiActionDescCollection actions);
-
-        void setContent(StateContentDTO state);
-    }
-
-    private final ActionRegistryByType actionsRegistry;
-    private final Session session;
-
-    @Inject
-    public DocViewerPresenter(final EventBus eventBus, final DocViewerView view, final DocViewerProxy proxy,
-            final Session session, final ContentViewerSelector viewerSelector,
-            final ActionRegistryByType actionsRegistry, final DocsClientActions actions) {
-        super(eventBus, view, proxy);
-        this.session = session;
-        this.actionsRegistry = actionsRegistry;
-        viewerSelector.register(this, true, DocsClientTool.TYPE_WAVE);
-    }
-
-    @Override
-    public void attach() {
-        getView().attach();
-    }
-
-    @Override
-    public void detach() {
-        getView().detach();
-    }
-
-    @Override
-    protected void revealInParent() {
-        RevealRootContentEvent.fire(this, this);
-    }
-
-    @Override
-    public void setContent(@Nonnull final HasContent state) {
-        final StateContentDTO stateContent = (StateContentDTO) state;
-        final AccessRights rights = stateContent.getContentRights();
-        final GuiActionDescCollection actions = actionsRegistry.getCurrentActions(stateContent.getGroup(),
-                stateContent.getTypeId(), session.isLogged(), rights);
-        getView().setActions(actions);
-        getView().setContent(stateContent);
-    }
-}
\ No newline at end of file

Copied: trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPresenter.java (from rev 1320, trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPresenter.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPresenter.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPresenter.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,87 @@
+package cc.kune.gspace.client.viewers;
+
+import javax.annotation.Nonnull;
+
+import cc.kune.blogs.client.BlogsClientTool;
+import cc.kune.blogs.client.actions.BlogsClientActions;
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
+import cc.kune.core.client.actions.ActionRegistryByType;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.shared.domain.utils.AccessRights;
+import cc.kune.core.shared.dto.HasContent;
+import cc.kune.core.shared.dto.StateContentDTO;
+import cc.kune.docs.client.DocsClientTool;
+import cc.kune.docs.client.actions.DocsClientActions;
+import cc.kune.gspace.client.actions.ActionGroups;
+import cc.kune.gspace.client.tool.ContentViewer;
+import cc.kune.gspace.client.tool.ContentViewerSelector;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.inject.Inject;
+import com.gwtplatform.mvp.client.Presenter;
+import com.gwtplatform.mvp.client.View;
+import com.gwtplatform.mvp.client.annotations.ProxyCodeSplit;
+import com.gwtplatform.mvp.client.proxy.Proxy;
+import com.gwtplatform.mvp.client.proxy.RevealRootContentEvent;
+
+public class DocViewerPresenter extends Presenter<DocViewerPresenter.DocViewerView, DocViewerPresenter.DocViewerProxy>
+        implements ContentViewer {
+
+    @ProxyCodeSplit
+    public interface DocViewerProxy extends Proxy<DocViewerPresenter> {
+    }
+
+    public interface DocViewerView extends View {
+
+        void attach();
+
+        void clear();
+
+        void detach();
+
+        void setActions(GuiActionDescCollection actions);
+
+        void setContent(StateContentDTO state);
+    }
+
+    private final ActionRegistryByType actionsRegistry;
+    private final Session session;
+
+    @Inject
+    public DocViewerPresenter(final EventBus eventBus, final DocViewerView view, final DocViewerProxy proxy,
+            final Session session, final ContentViewerSelector viewerSelector,
+            final ActionRegistryByType actionsRegistry, final DocsClientActions docsActions,
+            final BlogsClientActions blogActions) {
+        super(eventBus, view, proxy);
+        this.session = session;
+        this.actionsRegistry = actionsRegistry;
+        viewerSelector.register(this, true, DocsClientTool.TYPE_WAVE);
+        viewerSelector.register(this, true, BlogsClientTool.TYPE_POST);
+    }
+
+    @Override
+    public void attach() {
+        getView().attach();
+    }
+
+    @Override
+    public void detach() {
+        getView().detach();
+    }
+
+    @Override
+    protected void revealInParent() {
+        RevealRootContentEvent.fire(this, this);
+    }
+
+    @Override
+    public void setContent(@Nonnull final HasContent state) {
+        getView().clear();
+        final StateContentDTO stateContent = (StateContentDTO) state;
+        final AccessRights rights = stateContent.getContentRights();
+        final GuiActionDescCollection actions = actionsRegistry.getCurrentActions(stateContent.getGroup(),
+                stateContent.getTypeId(), session.isLogged(), rights, ActionGroups.VIEW);
+        getView().setActions(actions);
+        getView().setContent(stateContent);
+    }
+}
\ No newline at end of file

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemDescriptor.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/viewers/FolderItemDescriptor.java	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemDescriptor.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -17,7 +17,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  \*/
-package cc.kune.docs.client.viewers;
+package cc.kune.gspace.client.viewers;
 
 import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
 import cc.kune.core.shared.domain.ContentStatus;

Copied: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.java (from rev 1318, trunk/src/main/java/cc/kune/docs/client/viewers/FolderItemWidget.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,116 @@
+package cc.kune.gspace.client.viewers;
+
+import cc.kune.common.client.actions.ui.ActionSimplePanel;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.BlurEvent;
+import com.google.gwt.event.dom.client.FocusEvent;
+import com.google.gwt.event.dom.client.HasAllFocusHandlers;
+import com.google.gwt.event.dom.client.HasAllMouseHandlers;
+import com.google.gwt.event.dom.client.HasClickHandlers;
+import com.google.gwt.event.dom.client.HasDoubleClickHandlers;
+import com.google.gwt.event.dom.client.MouseOutEvent;
+import com.google.gwt.event.dom.client.MouseOverEvent;
+import com.google.gwt.resources.client.ImageResource;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.uibinder.client.UiHandler;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.FocusPanel;
+import com.google.gwt.user.client.ui.HasText;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.InlineLabel;
+import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.gwt.user.client.ui.Widget;
+
+public class FolderItemWidget extends Composite implements HasText {
+
+    interface FolderItemWidgetUiBinder extends UiBinder<Widget, FolderItemWidget> {
+    }
+
+    private static FolderItemWidgetUiBinder uiBinder = GWT.create(FolderItemWidgetUiBinder.class);
+
+    @UiField
+    FlowPanel flow;
+    @UiField
+    FocusPanel focusPanel;
+    @UiField
+    Image icon;
+    @UiField
+    SimplePanel menu;
+    @UiField
+    InlineLabel title;
+
+    public FolderItemWidget(final ImageResource iconResource, final String title) {
+        initWidget(uiBinder.createAndBindUi(this));
+        this.title.setText(title);
+        icon.setResource(iconResource);
+    }
+
+    private void clearFocusStyles() {
+        focusPanel.removeStyleDependentName("nofocused");
+        focusPanel.removeStyleDependentName("focused");
+    }
+
+    HasClickHandlers getRowClick() {
+        return focusPanel;
+    }
+
+    HasDoubleClickHandlers getRowDoubleClick() {
+        return focusPanel;
+    }
+
+    HasAllFocusHandlers getRowFocus() {
+        return focusPanel;
+    }
+
+    HasAllMouseHandlers getRowMouse() {
+        return focusPanel;
+    }
+
+    @Override
+    public String getText() {
+        return title.getText();
+    }
+
+    @UiHandler("focusPanel")
+    public void onBlur(final BlurEvent event) {
+        clearFocusStyles();
+        focusPanel.addStyleDependentName("nofocused");
+    }
+
+    @UiHandler("focusPanel")
+    public void onFocus(final FocusEvent event) {
+        clearFocusStyles();
+        focusPanel.addStyleDependentName("focused");
+    }
+
+    @UiHandler("focusPanel")
+    public void onOut(final MouseOutEvent event) {
+        clearFocusStyles();
+        focusPanel.addStyleDependentName("nofocused");
+    }
+
+    @UiHandler("focusPanel")
+    public void onOver(final MouseOverEvent event) {
+        clearFocusStyles();
+        focusPanel.addStyleDependentName("focused");
+    }
+
+    public void setMenu(final ActionSimplePanel toolbar) {
+        menu.add(toolbar);
+    }
+
+    public void setSelect(final boolean selected) {
+        clearFocusStyles();
+        focusPanel.removeStyleDependentName(selected ? "noselected" : "selected");
+        focusPanel.addStyleDependentName(selected ? "selected" : "noselected");
+    }
+
+    @Override
+    public void setText(final String text) {
+        title.setText(text);
+    }
+
+}

Copied: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.ui.xml (from rev 1318, trunk/src/main/java/cc/kune/docs/client/viewers/FolderItemWidget.ui.xml)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.ui.xml	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.ui.xml	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,56 @@
+<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
+<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
+  xmlns:co="urn:ui:cc.kune.core.client" xmlns:g="urn:import:com.google.gwt.user.client.ui">
+  <ui:style>
+    @external .k-folderitem-focus;
+    @external .k-folderitem-focus-focused;
+    @external .k-folderitem-focus-selected;
+    @external .k-folderitem-focus-noselected;
+    @external .k-folderitem-focus-nofocused;
+    .k-folderitem-focus {
+        background-color: none;
+    }
+
+    .k-folderitem-focus-focused {
+        background-color: #F2F5FD;
+    }
+
+    .k-folderitem-focus-selected {
+        background-color: #E3E9FF;
+    }
+
+    .k-folderitem-focus-noselected {
+    }
+
+    .k-folderitem-focus-nofocused {
+
+    }
+
+    .flow {
+        cursor: pointer;
+        border-bottom: 1px solid #F3F3F3;
+        line-height: 1.3em;
+        height: 28px;
+    }
+
+    .title {
+        font-size: 16px;
+        margin-left: 5px;
+    }
+
+    .icon {
+        margin: 5px;
+    }
+
+    .menu {
+        float: right;
+    }
+  </ui:style>
+  <g:FocusPanel ui:field="focusPanel" styleName="{style.k-folderitem-focus}">
+    <g:FlowPanel styleName="{style.flow}" ui:field="flow">
+      <g:Image styleName="{style.icon}" ui:field="icon" />
+      <g:InlineLabel styleName="{style.title}" ui:field="title" />
+      <g:SimplePanel styleName="{style.menu}" ui:field="menu" />
+    </g:FlowPanel>
+  </g:FocusPanel>
+</ui:UiBinder>
\ No newline at end of file

Copied: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsFlowPanel.java (from rev 1320, trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerAsFlowPanel.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsFlowPanel.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsFlowPanel.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,84 @@
+package cc.kune.gspace.client.viewers;
+
+import cc.kune.common.client.actions.gxtui.AbstractGxtMenuGui;
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
+import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
+import cc.kune.common.client.ui.BasicThumb;
+import cc.kune.core.shared.dto.StateContainerDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.GSpaceArmor;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.DoubleClickHandler;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
+
+public class FolderViewerAsFlowPanel extends AbstractFolderViewerPanel {
+    interface FolderViewerAsFlowPanelUiBinder extends UiBinder<Widget, FolderViewerAsFlowPanel> {
+    }
+    private static FolderViewerAsFlowPanelUiBinder uiBinder = GWT.create(FolderViewerAsFlowPanelUiBinder.class);
+
+    @UiField
+    FlowPanel flow;
+    int ICONLABELMAXSIZE = 20;
+    int ICONSIZE = 100;
+
+    @Inject
+    public FolderViewerAsFlowPanel(final GSpaceArmor gsArmor, final I18nTranslationService i18n) {
+        super(gsArmor, i18n);
+        widget = uiBinder.createAndBindUi(this);
+    }
+
+    @Override
+    public void addItem(final FolderItemDescriptor item, final ClickHandler clickHandler,
+            final DoubleClickHandler doubleClickHandler) {
+        // In this viewer we don't use the clickHandler from the presenter
+        flow.add(createThumb(item.getText(), item.getIcon(), item.getTooltip(), "", item.getActionCollection(),
+                doubleClickHandler));
+    }
+
+    @Override
+    public void clear() {
+        flow.clear();
+        super.clear();
+    }
+
+    public BasicThumb createThumb(final String text, final Object icon, final String tooltip,
+            final String tooltipTitle, final GuiActionDescCollection menuitems,
+            final DoubleClickHandler doubleClickHandler) {
+        final BasicThumb thumb = new BasicThumb(icon, ICONSIZE, text, ICONLABELMAXSIZE, false);
+        final MenuDescriptor menu = new MenuDescriptor();
+        menu.setStandalone(true);
+        menu.putValue(AbstractGxtMenuGui.MENU_POSITION, AbstractGxtMenuGui.MenuPosition.bl);
+        for (final GuiActionDescrip item : menuitems) {
+            item.setParent(menu);
+        }
+        final ClickHandler clickHand = new ClickHandler() {
+            @Override
+            public void onClick(final ClickEvent event) {
+                menu.show(thumb);
+            }
+        };
+        thumb.addClickHandler(clickHand);
+        thumb.addDoubleClickHandler(doubleClickHandler);
+        gsArmor.getSubheaderToolbar().add(menu);
+        gsArmor.getSubheaderToolbar().addAll(menuitems);
+        thumb.setTooltip(tooltipTitle, tooltip);
+        thumb.setLabelVisible(true);
+        return thumb;
+    }
+
+    @Override
+    public void setContainer(final StateContainerDTO state) {
+        super.setContainer(state);
+        gsArmor.getDocContainer().add(new HTML("<b>Note:</b> This GUI is provisional<br/>"));
+    }
+
+}

Copied: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsFlowPanel.ui.xml (from rev 1318, trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerAsFlowPanel.ui.xml)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsFlowPanel.ui.xml	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsFlowPanel.ui.xml	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,8 @@
+<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
+<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
+  xmlns:g='urn:import:com.google.gwt.user.client.ui'>
+  <ui:style>
+  </ui:style>
+  <g:FlowPanel ui:field="flow" width="100%" height="100%">
+  </g:FlowPanel>
+</ui:UiBinder>
\ No newline at end of file

Copied: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java (from rev 1320, trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerAsTablePanel.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,106 @@
+package cc.kune.gspace.client.viewers;
+
+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.GuiActionDescrip;
+import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.dto.StateContainerDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.GSpaceArmor;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.DoubleClickHandler;
+import com.google.gwt.event.dom.client.MouseOutEvent;
+import com.google.gwt.event.dom.client.MouseOutHandler;
+import com.google.gwt.event.dom.client.MouseOverEvent;
+import com.google.gwt.event.dom.client.MouseOverHandler;
+import com.google.gwt.resources.client.ImageResource;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.client.ui.FlexTable;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
+
+public class FolderViewerAsTablePanel extends AbstractFolderViewerPanel {
+
+    interface FolderViewerAsTablePanelUiBinder extends UiBinder<Widget, FolderViewerAsTablePanel> {
+    }
+
+    private static FolderViewerAsTablePanelUiBinder uiBinder = GWT.create(FolderViewerAsTablePanelUiBinder.class);
+
+    @UiField
+    FlexTable flex;
+
+    private final GuiProvider guiProvider;
+    private final CoreResources res;
+    protected FolderItemWidget selected;
+
+    @Inject
+    public FolderViewerAsTablePanel(final GSpaceArmor gsArmor, final I18nTranslationService i18n,
+            final GuiProvider guiProvider, final CoreResources res) {
+        super(gsArmor, i18n);
+        this.guiProvider = guiProvider;
+        this.res = res;
+        widget = uiBinder.createAndBindUi(this);
+    }
+
+    @Override
+    public void addItem(final FolderItemDescriptor item, final ClickHandler clickHandler,
+            final DoubleClickHandler doubleClickHandler) {
+        final int rowCount = flex.getRowCount();
+        final FolderItemWidget itemWidget = new FolderItemWidget((ImageResource) item.getIcon(), item.getText());
+        final ActionSimplePanel toolbar = new ActionSimplePanel(guiProvider);
+        itemWidget.setMenu(toolbar);
+        // Tooltip.to(itemWidget, item.getTooltip());
+        final MenuDescriptor menu = new MenuDescriptor(i18n.t("Actions"));
+        menu.withIcon(res.arrowdown()).withStyles("k-def-docbtn, k-btn, k-button");
+        menu.setStandalone(false);
+        menu.setVisible(false);
+        toolbar.add(menu);
+        for (final GuiActionDescrip menuItem : item.getActionCollection()) {
+            menuItem.setParent(menu);
+            toolbar.add(menuItem);
+        }
+        itemWidget.getRowClick().addClickHandler(new ClickHandler() {
+            @Override
+            public void onClick(final ClickEvent event) {
+                if (selected != null) {
+                    selected.setSelect(false);
+                }
+                itemWidget.setSelect(true);
+                selected = itemWidget;
+            }
+        });
+        itemWidget.getRowDoubleClick().addDoubleClickHandler(doubleClickHandler);
+        itemWidget.getRowMouse().addMouseOutHandler(new MouseOutHandler() {
+            @Override
+            public void onMouseOut(final MouseOutEvent event) {
+                menu.setVisible(false);
+                // itemWidget.setSelect(false);
+                // menu.hide();
+            }
+        });
+        itemWidget.getRowMouse().addMouseOverHandler(new MouseOverHandler() {
+            @Override
+            public void onMouseOver(final MouseOverEvent event) {
+                menu.setVisible(true);
+            }
+        });
+        flex.setWidget(rowCount + 1, 0, itemWidget);
+    }
+
+    @Override
+    public void clear() {
+        flex.clear();
+        super.clear();
+    }
+
+    @Override
+    public void setContainer(final StateContainerDTO state) {
+        super.setContainer(state);
+    }
+
+}

Copied: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.ui.xml (from rev 1318, trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerAsTablePanel.ui.xml)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.ui.xml	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.ui.xml	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,8 @@
+<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
+<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
+  xmlns:g="urn:import:com.google.gwt.user.client.ui">
+  <ui:style>
+  </ui:style>
+  <g:FlexTable ui:field="flex" width="100%" height="100%">
+  </g:FlexTable>
+</ui:UiBinder>
\ No newline at end of file

Deleted: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPanel.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -1,114 +0,0 @@
-package cc.kune.docs.client.viewers;
-
-import cc.kune.common.client.actions.gxtui.AbstractGxtMenuGui;
-import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
-import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
-import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
-import cc.kune.common.client.ui.BasicThumb;
-import cc.kune.core.shared.dto.StateContainerDTO;
-import cc.kune.docs.client.viewers.FolderViewerPresenter.FolderViewerView;
-import cc.kune.gspace.client.GSpaceArmor;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.DoubleClickHandler;
-import com.google.gwt.uibinder.client.UiBinder;
-import com.google.gwt.uibinder.client.UiField;
-import com.google.gwt.user.client.ui.FlowPanel;
-import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
-import com.google.gwt.user.client.ui.Widget;
-import com.google.inject.Inject;
-import com.gwtplatform.mvp.client.ViewImpl;
-
-public class FolderViewerPanel extends ViewImpl implements FolderViewerView {
-    interface FolderViewerPanelUiBinder extends UiBinder<Widget, FolderViewerPanel> {
-    }
-    private static FolderViewerPanelUiBinder uiBinder = GWT.create(FolderViewerPanelUiBinder.class);
-
-    @UiField
-    FlowPanel flow;
-
-    private final GSpaceArmor gsArmor;
-
-    int ICONLABELMAXSIZE = 10;
-    int ICONSIZE = 40;
-    private final Widget widget;
-
-    @Inject
-    public FolderViewerPanel(final GSpaceArmor wsArmor) {
-        this.gsArmor = wsArmor;
-        widget = uiBinder.createAndBindUi(this);
-    }
-
-    @Override
-    public void addItem(final FolderItemDescriptor item, final DoubleClickHandler doubleClickHandler) {
-        flow.add(createThumb(item.getText(), item.getIcon(), item.getTooltip(), "", item.getActionCollection(),
-                doubleClickHandler));
-    }
-
-    @Override
-    public Widget asWidget() {
-        return widget;
-    }
-
-    @Override
-    public void attach() {
-        // Duplicate code in DocViewerPanel
-        final ForIsWidget docContainer = gsArmor.getDocContainer();
-        final int widgetCount = docContainer.getWidgetCount();
-        for (int i = 0; i < widgetCount; i++) {
-            docContainer.remove(i);
-        }
-        docContainer.add(widget);
-    }
-
-    @Override
-    public void clear() {
-        flow.clear();
-        gsArmor.getSubheaderToolbar().clear();
-    }
-
-    public BasicThumb createThumb(final String text, final Object icon, final String tooltip,
-            final String tooltipTitle, final GuiActionDescCollection menuitems,
-            final DoubleClickHandler doubleClickHandler) {
-        final BasicThumb thumb = new BasicThumb(icon, ICONSIZE, text, ICONLABELMAXSIZE, false);
-        final MenuDescriptor menu = new MenuDescriptor();
-        menu.setStandalone(true);
-        menu.putValue(AbstractGxtMenuGui.MENU_POSITION, AbstractGxtMenuGui.MenuPosition.bl);
-        for (final GuiActionDescrip item : menuitems) {
-            item.setParent(menu);
-        }
-        final ClickHandler clickHand = new ClickHandler() {
-            @Override
-            public void onClick(final ClickEvent event) {
-                menu.show(thumb);
-            }
-        };
-
-        thumb.addClickHandler(clickHand);
-        thumb.addDoubleClickHandler(doubleClickHandler);
-        gsArmor.getSubheaderToolbar().add(menu);
-        gsArmor.getSubheaderToolbar().addAll(menuitems);
-        thumb.setTooltip(tooltipTitle, tooltip);
-        thumb.setLabelVisible(true);
-        return thumb;
-    }
-
-    @Override
-    public void detach() {
-        widget.removeFromParent();
-        clear();
-    }
-
-    @Override
-    public void setActions(final GuiActionDescCollection actions) {
-        gsArmor.getSubheaderToolbar().clear();
-        gsArmor.getSubheaderToolbar().addAll(actions);
-    }
-
-    @Override
-    public void setContainer(final StateContainerDTO state) {
-    }
-
-}

Deleted: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPanel.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPanel.ui.xml	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPanel.ui.xml	2011-04-26 19:57:21 UTC (rev 1321)
@@ -1,20 +0,0 @@
-<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
-<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
-  xmlns:g='urn:import:com.google.gwt.user.client.ui' xmlns:f='urn:import:org.waveprotocol.box.webclient.widget.frame'
-  xmlns:w='urn:import:org.waveprotocol.wave.client.widget.common'>
-  <ui:style>
-    .wavePanel {
-        margin: 0 0 0 0;
-    }
-
-    .waveHolder {
-        position: absolute;
-        top: 0;
-        bottom: 0;
-        left: 0;
-        right: 0;
-    }
-  </ui:style>
-  <g:FlowPanel ui:field="flow" width="100%" height="100%">
-  </g:FlowPanel>
-</ui:UiBinder>
\ No newline at end of file

Deleted: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPresenter.java	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -1,178 +0,0 @@
-package cc.kune.docs.client.viewers;
-
-import javax.annotation.Nonnull;
-
-import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
-import cc.kune.core.client.actions.ActionRegistryByType;
-import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
-import cc.kune.core.client.registry.IconsRegistry;
-import cc.kune.core.client.services.FileDownloadUtils;
-import cc.kune.core.client.services.ImageSize;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-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.BasicMimeTypeDTO;
-import cc.kune.core.shared.dto.ContainerDTO;
-import cc.kune.core.shared.dto.ContainerSimpleDTO;
-import cc.kune.core.shared.dto.ContentSimpleDTO;
-import cc.kune.core.shared.dto.HasContent;
-import cc.kune.core.shared.dto.StateContainerDTO;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.docs.client.DocsClientTool;
-import cc.kune.docs.client.actions.DocsClientActions;
-import cc.kune.gspace.client.actions.perspective.MenuPerspective;
-import cc.kune.gspace.client.tool.ContentViewer;
-import cc.kune.gspace.client.tool.ContentViewerSelector;
-
-import com.google.gwt.event.dom.client.DoubleClickEvent;
-import com.google.gwt.event.dom.client.DoubleClickHandler;
-import com.google.gwt.event.shared.EventBus;
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-import com.gwtplatform.mvp.client.Presenter;
-import com.gwtplatform.mvp.client.View;
-import com.gwtplatform.mvp.client.annotations.ProxyCodeSplit;
-import com.gwtplatform.mvp.client.proxy.Proxy;
-import com.gwtplatform.mvp.client.proxy.RevealRootContentEvent;
-
-public class FolderViewerPresenter extends
-        Presenter<FolderViewerPresenter.FolderViewerView, FolderViewerPresenter.FolderViewerProxy> implements
-        ContentViewer {
-
-    @ProxyCodeSplit
-    public interface FolderViewerProxy extends Proxy<FolderViewerPresenter> {
-    }
-
-    public interface FolderViewerView extends View {
-
-        void addItem(FolderItemDescriptor item, DoubleClickHandler handler);
-
-        void attach();
-
-        void clear();
-
-        void detach();
-
-        void setActions(GuiActionDescCollection actions);
-
-        void setContainer(StateContainerDTO state);
-    }
-
-    private final ActionRegistryByType actionsRegistry;
-    private final ContentCapabilitiesRegistry capabilitiesRegistry;
-    private final Provider<FileDownloadUtils> downloadUtilsProvider;
-    private final I18nTranslationService i18n;
-    private final IconsRegistry iconsRegistry;
-    private final Session session;
-    private final StateManager stateManager;
-    private final boolean useGenericImageIcon;
-
-    @Inject
-    public FolderViewerPresenter(final EventBus eventBus, final FolderViewerView view, final FolderViewerProxy proxy,
-            final Session session, final StateManager stateManager, final I18nTranslationService i18n,
-            final ContentViewerSelector viewerSelector, final ActionRegistryByType actionsRegistry,
-            final DocsClientActions actions, final Provider<FileDownloadUtils> downloadUtilsProvider,
-            final ContentCapabilitiesRegistry capabilitiesRegistry) {
-        super(eventBus, view, proxy);
-        this.session = session;
-        this.stateManager = stateManager;
-        this.i18n = i18n;
-        this.actionsRegistry = actionsRegistry;
-        this.downloadUtilsProvider = downloadUtilsProvider;
-        this.capabilitiesRegistry = capabilitiesRegistry;
-        iconsRegistry = capabilitiesRegistry.getIconsRegistry();
-        viewerSelector.register(this, true, DocsClientTool.TYPE_ROOT, DocsClientTool.TYPE_FOLDER);
-        useGenericImageIcon = false;
-    }
-
-    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 boolean isNodeSelected) {
-        final Object icon = getIcon(stateToken, contentTypeId, mimeType);
-        final String tooltip = getTooltip(stateToken, mimeType);
-        final FolderItemDescriptor item = new FolderItemDescriptor(genId(stateToken), genId(parentStateToken), icon,
-                title, tooltip, status, stateToken, capabilitiesRegistry.isDragable(contentTypeId)
-                        && rights.isAdministrable(), capabilitiesRegistry.isDropable(contentTypeId)
-                        && rights.isAdministrable(), actionsRegistry.getCurrentActions(stateToken, contentTypeId,
-                        session.isLogged(), rights, MenuPerspective.class));
-        if (status.equals(ContentStatus.inTheDustbin) && !session.getShowDeletedContent()) {
-            // Don't show
-        } else {
-            getView().addItem(item, new DoubleClickHandler() {
-
-                @Override
-                public void onDoubleClick(final DoubleClickEvent event) {
-                    stateManager.gotoStateToken(stateToken);
-                }
-            });
-        }
-    }
-
-    @Override
-    public void attach() {
-        getView().attach();
-    }
-
-    private void createChildItems(final ContainerDTO container, final AccessRights containerRights) {
-        for (final ContainerSimpleDTO siblingFolder : container.getChilds()) {
-            addItem(siblingFolder.getName(), siblingFolder.getTypeId(), null, ContentStatus.publishedOnline,
-                    siblingFolder.getStateToken(),
-                    siblingFolder.getStateToken().copy().setFolder(siblingFolder.getParentFolderId()), containerRights,
-                    false);
-        }
-        for (final ContentSimpleDTO content : container.getContents()) {
-            // content.getTitle()
-            addItem(content.getStateToken().toString(), content.getTypeId(), content.getMimeType(),
-                    content.getStatus(), content.getStateToken(), content.getStateToken().copy().clearDocument(),
-                    content.getRights(), false);
-        }
-    }
-
-    @Override
-    public void detach() {
-        getView().detach();
-    }
-
-    private String genId(final StateToken token) {
-        return "k-cnav-" + token.toString().replace(StateToken.SEPARATOR, "-");
-    }
-
-    private Object getIcon(final StateToken token, final String contentTypeId, final BasicMimeTypeDTO mimeType) {
-        if (contentTypeId.equals(DocsClientTool.TYPE_FOLDER)) {
-            return null;
-        } else if (!useGenericImageIcon && mimeType != null && mimeType.getType().equals("image")) {
-            return downloadUtilsProvider.get().getImageResizedUrl(token, ImageSize.ico);
-        } else {
-            return iconsRegistry.getContentTypeIcon(contentTypeId, mimeType);
-        }
-    }
-
-    private String getTooltip(final StateToken token, final BasicMimeTypeDTO mimeType) {
-        if (mimeType != null && (mimeType.isImage() || mimeType.isPdf())) {
-            // Used for previews
-            return null;
-        } else {
-            return i18n.t("Double click to open");
-        }
-    }
-
-    @Override
-    protected void revealInParent() {
-        RevealRootContentEvent.fire(this, this);
-    }
-
-    @Override
-    public void setContent(@Nonnull final HasContent state) {
-        getView().clear();
-        final StateContainerDTO stateContainer = (StateContainerDTO) state;
-        final AccessRights rights = stateContainer.getContainerRights();
-        final GuiActionDescCollection actions = actionsRegistry.getCurrentActions(stateContainer.getGroup(),
-                stateContainer.getTypeId(), session.isLogged(), rights);
-        getView().setActions(actions);
-        getView().setContainer(stateContainer);
-        createChildItems(stateContainer.getContainer(), stateContainer.getContainerRights());
-        // view.setEditable(rights.isEditable());
-    }
-}
\ No newline at end of file

Copied: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java (from rev 1320, trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPresenter.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -0,0 +1,193 @@
+package cc.kune.gspace.client.viewers;
+
+import javax.annotation.Nonnull;
+
+import cc.kune.blogs.client.BlogsClientTool;
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
+import cc.kune.core.client.actions.ActionRegistryByType;
+import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
+import cc.kune.core.client.registry.IconsRegistry;
+import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.client.services.ImageSize;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+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.BasicMimeTypeDTO;
+import cc.kune.core.shared.dto.ContainerDTO;
+import cc.kune.core.shared.dto.ContainerSimpleDTO;
+import cc.kune.core.shared.dto.ContentSimpleDTO;
+import cc.kune.core.shared.dto.HasContent;
+import cc.kune.core.shared.dto.StateContainerDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.docs.client.DocsClientTool;
+import cc.kune.gspace.client.actions.ActionGroups;
+import cc.kune.gspace.client.tool.ContentViewer;
+import cc.kune.gspace.client.tool.ContentViewerSelector;
+
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.DoubleClickEvent;
+import com.google.gwt.event.dom.client.DoubleClickHandler;
+import com.google.gwt.event.shared.EventBus;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+import com.gwtplatform.mvp.client.Presenter;
+import com.gwtplatform.mvp.client.View;
+import com.gwtplatform.mvp.client.annotations.ProxyCodeSplit;
+import com.gwtplatform.mvp.client.proxy.Proxy;
+import com.gwtplatform.mvp.client.proxy.RevealRootContentEvent;
+
+public class FolderViewerPresenter extends
+        Presenter<FolderViewerPresenter.FolderViewerView, FolderViewerPresenter.FolderViewerProxy> implements
+        ContentViewer {
+
+    @ProxyCodeSplit
+    public interface FolderViewerProxy extends Proxy<FolderViewerPresenter> {
+    }
+
+    public interface FolderViewerView extends View {
+
+        void addItem(FolderItemDescriptor item, ClickHandler clickHandler, DoubleClickHandler doubleClickHandler);
+
+        void attach();
+
+        void clear();
+
+        void detach();
+
+        void setActions(GuiActionDescCollection actions);
+
+        void setContainer(StateContainerDTO state);
+
+        void showEmptyMsg();
+    }
+
+    private final ActionRegistryByType actionsRegistry;
+    private final ContentCapabilitiesRegistry capabilitiesRegistry;
+    private final Provider<FileDownloadUtils> downloadUtilsProvider;
+    private final I18nTranslationService i18n;
+    private final IconsRegistry iconsRegistry;
+    private final Session session;
+    private final StateManager stateManager;
+    private final boolean useGenericImageIcon;
+
+    @Inject
+    public FolderViewerPresenter(final EventBus eventBus, final FolderViewerView view, final FolderViewerProxy proxy,
+            final Session session, final StateManager stateManager, final I18nTranslationService i18n,
+            final ContentViewerSelector viewerSelector, final ActionRegistryByType actionsRegistry,
+            final Provider<FileDownloadUtils> downloadUtilsProvider,
+            final ContentCapabilitiesRegistry capabilitiesRegistry) {
+        super(eventBus, view, proxy);
+        this.session = session;
+        this.stateManager = stateManager;
+        this.i18n = i18n;
+        this.actionsRegistry = actionsRegistry;
+        this.downloadUtilsProvider = downloadUtilsProvider;
+        this.capabilitiesRegistry = capabilitiesRegistry;
+        iconsRegistry = capabilitiesRegistry.getIconsRegistry();
+        viewerSelector.register(this, true, DocsClientTool.TYPE_ROOT, DocsClientTool.TYPE_FOLDER);
+        viewerSelector.register(this, true, BlogsClientTool.TYPE_ROOT, BlogsClientTool.TYPE_BLOG);
+        useGenericImageIcon = false;
+    }
+
+    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 Object icon = getIcon(stateToken, contentTypeId, mimeType);
+        final String tooltip = getTooltip(stateToken, mimeType);
+        final FolderItemDescriptor item = new FolderItemDescriptor(genId(stateToken), genId(parentStateToken), icon,
+                title, tooltip, status, stateToken, capabilitiesRegistry.isDragable(contentTypeId)
+                        && rights.isAdministrable(), capabilitiesRegistry.isDropable(contentTypeId)
+                        && rights.isAdministrable(), actionsRegistry.getCurrentActions(stateToken, contentTypeId,
+                        session.isLogged(), rights, ActionGroups.MENUITEM));
+        if (status.equals(ContentStatus.inTheDustbin) && !session.getShowDeletedContent()) {
+            // Don't show
+            // NotifyUser.info("Deleted, don't show");
+        } else {
+            getView().addItem(item, new ClickHandler() {
+                @Override
+                public void onClick(final ClickEvent event) {
+                    stateManager.gotoStateToken(stateToken);
+                }
+            }, new DoubleClickHandler() {
+                @Override
+                public void onDoubleClick(final DoubleClickEvent event) {
+                    stateManager.gotoStateToken(stateToken);
+                }
+            });
+        }
+    }
+
+    @Override
+    public void attach() {
+        getView().attach();
+    }
+
+    private void createChildItems(final ContainerDTO container, final AccessRights containerRights) {
+        if (container.getContents().size() + container.getChilds().size() == 0) {
+            getView().showEmptyMsg();
+        } else {
+            // Folders
+            for (final ContainerSimpleDTO childFolder : container.getChilds()) {
+                addItem(childFolder.getName(), childFolder.getTypeId(), null, ContentStatus.publishedOnline,
+                        childFolder.getStateToken(),
+                        childFolder.getStateToken().copy().setFolder(childFolder.getParentFolderId()), containerRights);
+            }
+            // 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());
+            }
+        }
+    }
+
+    @Override
+    public void detach() {
+        getView().detach();
+    }
+
+    private String genId(final StateToken token) {
+        return "k-cnav-" + token.toString().replace(StateToken.SEPARATOR, "-");
+    }
+
+    private Object getIcon(final StateToken token, final String contentTypeId, final BasicMimeTypeDTO mimeType) {
+        if (!useGenericImageIcon && mimeType != null && mimeType.getType().equals("image")) {
+            return downloadUtilsProvider.get().getImageResizedUrl(token, ImageSize.ico);
+        } else {
+            return iconsRegistry.getContentTypeIcon(contentTypeId, mimeType);
+        }
+    }
+
+    private String getTooltip(final StateToken token, final BasicMimeTypeDTO mimeType) {
+        if (mimeType != null && (mimeType.isImage() || mimeType.isPdf())) {
+            // Used for previews
+            return null;
+        } else {
+            return i18n.t("Double click to open");
+        }
+    }
+
+    public void refreshState() {
+        setContent((HasContent) session.getCurrentState());
+    }
+
+    @Override
+    protected void revealInParent() {
+        RevealRootContentEvent.fire(this, this);
+    }
+
+    @Override
+    public void setContent(@Nonnull final HasContent state) {
+        getView().clear();
+        final StateContainerDTO stateContainer = (StateContainerDTO) state;
+        getView().setContainer(stateContainer);
+        final AccessRights rights = stateContainer.getContainerRights();
+        final GuiActionDescCollection actions = actionsRegistry.getCurrentActions(stateContainer.getGroup(),
+                stateContainer.getTypeId(), session.isLogged(), rights, ActionGroups.VIEW);
+        getView().setActions(actions);
+        createChildItems(stateContainer.getContainer(), stateContainer.getContainerRights());
+        // view.setEditable(rights.isEditable());
+    }
+}
\ No newline at end of file

Copied: trunk/src/test/java/cc/kune/blogs/server (from rev 1313, trunk/src/test/java/org/ourproject/kune/blogs/server)

Modified: trunk/src/test/java/cc/kune/blogs/server/BlogServerToolTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/blogs/server/BlogServerToolTest.java	2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/test/java/cc/kune/blogs/server/BlogServerToolTest.java	2011-04-26 19:57:21 UTC (rev 1321)
@@ -17,16 +17,17 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
-package org.ourproject.kune.blogs.server;
+package cc.kune.blogs.server;
 
-import static org.ourproject.kune.blogs.server.BlogServerTool.TYPE_BLOG;
-import static org.ourproject.kune.blogs.server.BlogServerTool.TYPE_POST;
-import static org.ourproject.kune.blogs.server.BlogServerTool.TYPE_ROOT;
-import static org.ourproject.kune.blogs.server.BlogServerTool.TYPE_UPLOADEDFILE;
+import static cc.kune.blogs.server.BlogServerTool.TYPE_BLOG;
+import static cc.kune.blogs.server.BlogServerTool.TYPE_POST;
+import static cc.kune.blogs.server.BlogServerTool.TYPE_ROOT;
+import static cc.kune.blogs.server.BlogServerTool.TYPE_UPLOADEDFILE;
 
 import org.junit.Before;
 import org.junit.Test;
 
+import cc.kune.blogs.server.BlogServerTool;
 import cc.kune.core.client.errors.ContainerNotPermittedException;
 import cc.kune.core.client.errors.ContentNotPermittedException;
 




More information about the kune-commits mailing list