[kune-commits] r1315 - in trunk/src: main/java/cc/kune/client main/java/cc/kune/common/client/actions/gwtui main/java/cc/kune/common/client/actions/ui main/java/cc/kune/common/client/actions/ui/descrip main/java/cc/kune/common/client/ui main/java/cc/kune/core/client main/java/cc/kune/core/client/actions main/java/cc/kune/core/client/auth main/java/cc/kune/core/client/cnt main/java/cc/kune/core/client/registry main/java/cc/kune/core/client/resources main/java/cc/kune/core/client/resources/nav main/java/cc/kune/core/client/sitebar main/java/cc/kune/core/client/sitebar/logo main/java/cc/kune/core/client/sitebar/spaces main/java/cc/kune/core/client/sn main/java/cc/kune/core/client/sn/actions/registry main/java/cc/kune/core/client/ws main/java/cc/kune/core/client/ws/entheader main/java/cc/kune/core/shared/dto main/java/cc/kune/docs/client main/java/cc/kune/docs/client/actions main/java/cc/kune/docs/client/viewers main/java/cc/kune/gspace/client main/java/cc/kune/gspace/client/actions/perspective main/java/cc/kune/gspace/client/tags main/java/cc/kune/gspace/client/tool main/java/cc/kune/gspace/client/tool/old main/java/cc/kune/gspace/client/tool/selector main/java/cc/kune/gspace/client/ui/footer/license main/java/cc/kune/pspace/client main/java/cc/kune/wave/client main/java/org/ourproject/kune/blogs/client/cnt main/java/org/ourproject/kune/chat/client/cnt main/java/org/ourproject/kune/gallery/client/cnt main/java/org/ourproject/kune/wiki/client/cnt main/java/org/ourproject/kune/workspace/client main/java/org/ourproject/kune/workspace/client/ctxnav main/java/org/ourproject/kune/workspace/client/title test/java/cc/kune/core/server/integration/content test/java/cc/kune/docs test/java/org/ourproject/kune/platf/client/actions test/java/org/ourproject/kune/platf/client/ui/dialogs/upload

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Mon Apr 18 02:41:29 CEST 2011


Author: vjrj_
Date: 2011-04-18 02:41:28 +0200 (Mon, 18 Apr 2011)
New Revision: 1315

Added:
   trunk/src/main/java/cc/kune/core/client/registry/IconsRegistry.java
   trunk/src/main/java/cc/kune/core/client/resources/nav/NavResources.java
   trunk/src/main/java/cc/kune/docs/client/DocsClientTool.java
   trunk/src/main/java/cc/kune/docs/client/DocsGinModule.java
   trunk/src/main/java/cc/kune/docs/client/actions/
   trunk/src/main/java/cc/kune/docs/client/actions/AbstractFoldableContentActions.java
   trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java
   trunk/src/main/java/cc/kune/docs/client/actions/DocsGoUpBtn.java
   trunk/src/main/java/cc/kune/docs/client/viewers/
   trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPanel.java
   trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPanel.ui.xml
   trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPresenter.java
   trunk/src/main/java/cc/kune/docs/client/viewers/FolderItemDescriptor.java
   trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPanel.java
   trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPanel.ui.xml
   trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java
   trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorEntryPoint.java
   trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java
   trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.ui.xml
   trunk/src/main/java/cc/kune/gspace/client/actions/perspective/MenuPerspective.java
   trunk/src/test/java/org/ourproject/kune/platf/client/actions/IconsRegistryTest.java
Removed:
   trunk/src/main/java/cc/kune/core/client/actions/ActionRegistries.java
   trunk/src/main/java/cc/kune/core/client/registry/ContentIconsRegistry.java
   trunk/src/main/java/cc/kune/docs/client/AbstractFoldableContentActions.java
   trunk/src/main/java/cc/kune/docs/client/ContentRenameAction.java
   trunk/src/main/java/cc/kune/docs/client/DocsGoUpBtn.java
   trunk/src/main/java/cc/kune/docs/client/DocsViewerPanel.java
   trunk/src/main/java/cc/kune/docs/client/DocsViewerPanel.ui.xml
   trunk/src/main/java/cc/kune/docs/client/DocsViewerPresenter.java
   trunk/src/main/java/cc/kune/docs/client/DocumentClientActions.java
   trunk/src/main/java/cc/kune/docs/client/DocumentClientTool.java
   trunk/src/main/java/cc/kune/docs/client/DocumentGinModule.java
   trunk/src/main/java/cc/kune/docs/client/cnt/
   trunk/src/main/java/cc/kune/docs/client/ctx/
   trunk/src/main/java/cc/kune/gspace/client/WsArmor.java
   trunk/src/main/java/cc/kune/gspace/client/WsArmorEntryPoint.java
   trunk/src/main/java/cc/kune/gspace/client/WsArmorImpl.java
   trunk/src/main/java/cc/kune/gspace/client/WsArmorImpl.ui.xml
   trunk/src/test/java/org/ourproject/kune/platf/client/actions/ContentIconsRegistryTest.java
Modified:
   trunk/src/main/java/cc/kune/client/KuneGinjector.java
   trunk/src/main/java/cc/kune/client/OnAppStartFactory.java
   trunk/src/main/java/cc/kune/common/client/actions/gwtui/GwtSimpleGuiItem.java
   trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractComposedGuiItem.java
   trunk/src/main/java/cc/kune/common/client/actions/ui/ActionFlowPanel.java
   trunk/src/main/java/cc/kune/common/client/actions/ui/ActionSimplePanel.java
   trunk/src/main/java/cc/kune/common/client/actions/ui/IsActionExtensible.java
   trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/GuiActionDescProviderCollection.java
   trunk/src/main/java/cc/kune/common/client/ui/BasicThumb.java
   trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
   trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java
   trunk/src/main/java/cc/kune/core/client/auth/WaveClientSimpleAuthenticator.java
   trunk/src/main/java/cc/kune/core/client/cnt/AbstractContentPanel.java
   trunk/src/main/java/cc/kune/core/client/cnt/ActionContentToolbarImpl.java
   trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPanel.java
   trunk/src/main/java/cc/kune/core/client/registry/ContentCapabilitiesRegistry.java
   trunk/src/main/java/cc/kune/core/client/resources/generateMainImageBundle.sh
   trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPanel.java
   trunk/src/main/java/cc/kune/core/client/sitebar/logo/SiteLogoViewImpl.java
   trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java
   trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorViewImpl.java
   trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.java
   trunk/src/main/java/cc/kune/core/client/sn/GroupSNPanel.java
   trunk/src/main/java/cc/kune/core/client/sn/UserSNPanel.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/registry/AbstractSNActionsRegistry.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/registry/AbstractSNMembersActionsRegistry.java
   trunk/src/main/java/cc/kune/core/client/ws/CoreViewImpl.java
   trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java
   trunk/src/main/java/cc/kune/core/shared/dto/HasContent.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/gspace/client/tags/TagsSummaryPanel.java
   trunk/src/main/java/cc/kune/gspace/client/tool/ContentViewerSelector.java
   trunk/src/main/java/cc/kune/gspace/client/tool/old/FoldableAbstractClientTool.java
   trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPanel.java
   trunk/src/main/java/cc/kune/gspace/client/ui/footer/license/EntityLicensePanel.java
   trunk/src/main/java/cc/kune/pspace/client/PSpacePanel.java
   trunk/src/main/java/cc/kune/wave/client/WaveClientManager.java
   trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPanel.java
   trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPanel.java
   trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPanel.java
   trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryFolderContentPanel.java
   trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPanel.java
   trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiFolderContentPanel.java
   trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/RegistryModule.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java
   trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceAddTest.java
   trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceVariousTest.java
   trunk/src/test/java/cc/kune/docs/DocumentToolTest.java
   trunk/src/test/java/org/ourproject/kune/platf/client/ui/dialogs/upload/FileUploaderPresenterTest.java
Log:
Folder Viewer

Modified: trunk/src/main/java/cc/kune/client/KuneGinjector.java
===================================================================
--- trunk/src/main/java/cc/kune/client/KuneGinjector.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/client/KuneGinjector.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -49,7 +49,7 @@
 import cc.kune.core.client.ws.entheader.EntityHeaderPresenter;
 import cc.kune.core.shared.i18n.I18nTranslationService;
 import cc.kune.docs.client.DocsGinjector;
-import cc.kune.docs.client.DocumentGinModule;
+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,7 +66,7 @@
 import com.gwtplatform.mvp.client.proxy.ProxyFailureHandler;
 
 @GinModules({ KuneGinModule.class, CoreGinModule.class, ChatGinModule.class, WaveGinModule.class,
-        PSpaceGinModule.class, GSpaceGinModule.class, DocumentGinModule.class })
+        PSpaceGinModule.class, GSpaceGinModule.class, DocsGinModule.class })
 public interface KuneGinjector extends Ginjector, GSpaceGinjector, DocsGinjector {
 
     /*

Modified: trunk/src/main/java/cc/kune/client/OnAppStartFactory.java
===================================================================
--- trunk/src/main/java/cc/kune/client/OnAppStartFactory.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/client/OnAppStartFactory.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -3,7 +3,7 @@
 import cc.kune.core.client.init.AppStartEvent;
 import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
 import cc.kune.core.client.state.Session;
-import cc.kune.docs.client.DocumentClientTool;
+import cc.kune.docs.client.DocsClientTool;
 
 import com.google.inject.Inject;
 import com.google.inject.Provider;
@@ -11,7 +11,7 @@
 public class OnAppStartFactory {
 
     @Inject
-    public OnAppStartFactory(final Session session, final Provider<DocumentClientTool> docClientTool) {
+    public OnAppStartFactory(final Session session, final Provider<DocsClientTool> docClientTool) {
         session.onAppStart(true, new AppStartHandler() {
             @Override
             public void onAppStart(final AppStartEvent event) {

Modified: trunk/src/main/java/cc/kune/common/client/actions/gwtui/GwtSimpleGuiItem.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/gwtui/GwtSimpleGuiItem.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/common/client/actions/gwtui/GwtSimpleGuiItem.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -41,8 +41,14 @@
     }
 
     @Override
+    public void clear() {
+        super.clear();
+        bar.clear();
+    }
+
+    @Override
     protected void insertWidget(final AbstractGuiItem item, final int position) {
-        int count = bar.getWidgetCount();
+        final int count = bar.getWidgetCount();
         bar.insert(item, count < position ? count : position);
     }
 

Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractComposedGuiItem.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractComposedGuiItem.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractComposedGuiItem.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -78,9 +78,7 @@
             if (binding == null) {
                 throw new UIException("Unknown binding for: " + descrip);
             } else {
-                // Log.debug("Creating: " + descrip);
                 final AbstractGuiItem item = binding.create(descrip);
-                // Log.debug("Adding: " + descrip);
                 if (binding.shouldBeAdded()) {
                     if (descrip.getPosition() == GuiActionDescrip.NO_POSITION) {
                         addWidget(item);
@@ -92,6 +90,11 @@
         }
     }
 
+    @Override
+    public void clear() {
+        getGuiItems().clear();
+    }
+
     public GuiActionDescCollection getGuiItems() {
         if (guiItems == null) {
             guiItems = new GuiActionDescCollection();

Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/ActionFlowPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/ActionFlowPanel.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/ActionFlowPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -41,8 +41,14 @@
     }
 
     @Override
+    public void clear() {
+        super.clear();
+        bar.clear();
+    }
+
+    @Override
     protected void insertWidget(final AbstractGuiItem item, final int position) {
         final int count = bar.getWidgetCount();
         bar.insert(item, count < position ? count : position);
     }
-}
+}
\ No newline at end of file

Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/ActionSimplePanel.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/ActionSimplePanel.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/ActionSimplePanel.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -40,7 +40,9 @@
         bar.add(item);
     }
 
+    @Override
     public void clear() {
+        super.clear();
         bar.clear();
     }
 

Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/IsActionExtensible.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/IsActionExtensible.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/IsActionExtensible.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -35,17 +35,19 @@
     /**
      * Adds some action descriptions
      * 
-     * @param actions
-     *            the actions
+     * @param action
+     *            the action
      */
-    void addAll(GuiActionDescCollection actions);
+    void add(GuiActionDescrip... actions);
 
     /**
      * Adds some action descriptions
      * 
-     * @param action
-     *            the action
+     * @param actions
+     *            the actions
      */
-    void add(GuiActionDescrip... actions);
+    void addAll(GuiActionDescCollection actions);
 
+    void clear();
+
 }

Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/GuiActionDescProviderCollection.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/GuiActionDescProviderCollection.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/GuiActionDescProviderCollection.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -23,12 +23,12 @@
 
 import com.google.inject.Provider;
 
-public class GuiActionDescProviderCollection extends ArrayList<Provider<GuiActionDescrip>> {
+public class GuiActionDescProviderCollection extends ArrayList<Provider<? extends GuiActionDescrip>> {
 
     private static final long serialVersionUID = -7933642706229301169L;
 
-    public void add(final Provider<GuiActionDescrip>... descriptors) {
-        for (final Provider<GuiActionDescrip> descriptor : descriptors) {
+    public void add(final Provider<? extends GuiActionDescrip>... descriptors) {
+        for (final Provider<? extends GuiActionDescrip> descriptor : descriptors) {
             super.add(descriptor);
         }
     }

Modified: trunk/src/main/java/cc/kune/common/client/ui/BasicThumb.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/BasicThumb.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/common/client/ui/BasicThumb.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -19,14 +19,17 @@
  */
 package cc.kune.common.client.ui;
 
+import cc.kune.common.client.log.Log;
 import cc.kune.common.client.tooltip.Tooltip;
 import cc.kune.common.client.utils.TextUtils;
 
 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.user.client.ui.Composite;
 import com.google.gwt.user.client.ui.Image;
 import com.google.gwt.user.client.ui.Label;
@@ -41,25 +44,44 @@
     private final Label label;
     private boolean onOverLabel;
 
-    public BasicThumb(final String imageUrl, final int imgSize, final String text, final int textMaxLenght,
+    public BasicThumb(final Object imageRef, final int imgSize, final String text, final int textMaxLenght,
             final boolean crop) {
-        this(imageUrl, imgSize, text, textMaxLenght, crop, null);
+        this(imageRef, imgSize, text, textMaxLenght, crop, null);
     }
 
-    public BasicThumb(final String imageUrl, final int imgSize, final String text, final int textMaxLenght,
+    /**
+     * 
+     * @param imageRef
+     *            This can be a ImageResource or a String Url
+     * @param imgSize
+     * @param text
+     * @param textMaxLenght
+     * @param crop
+     * @param clickHandler
+     */
+    public BasicThumb(final Object imageRef, final int imgSize, final String text, final int textMaxLenght,
             final boolean crop, final ClickHandler clickHandler) {
         super();
         onOverLabel = false;
         final VerticalPanel vpanel = new VerticalPanel();
-        if (imgSize == NOSIZE) {
-            image = new Image(imageUrl);
-        } else {
-            if (crop) {
-                image = new Image(imageUrl, 0, 0, imgSize, imgSize);
+        if (imageRef instanceof String) {
+            final String imageUrl = (String) imageRef;
+            if (imgSize == NOSIZE) {
+                image = new Image(imageUrl);
             } else {
-                image = new Image(imageUrl);
-                image.setPixelSize(imgSize, imgSize);
+                if (crop) {
+                    image = new Image(imageUrl, 0, 0, imgSize, imgSize);
+                } else {
+                    image = new Image(imageUrl);
+                    image.setPixelSize(imgSize, imgSize);
+                }
             }
+        } else if (imageRef instanceof ImageResource) {
+            image = new Image((ImageResource) imageRef);
+        } else {
+            // This should not happen
+            image = new Image();
+            Log.info("Unrecognized icon of BasicThumb: " + imageRef);
         }
         final String title = textMaxLenght == NOSIZE ? text : TextUtils.ellipsis(text, textMaxLenght);
         label = new Label(title);
@@ -94,12 +116,12 @@
         initWidget(vpanel);
     }
 
-    public BasicThumb(final String imageUrl, final String thumText, final ClickHandler clickHandler) {
-        this(imageUrl, NOSIZE, thumText, NOSIZE, false, clickHandler);
+    public BasicThumb(final Object imageRef, final String thumText, final ClickHandler clickHandler) {
+        this(imageRef, NOSIZE, thumText, NOSIZE, false, clickHandler);
     }
 
-    public BasicThumb(final String imageUrl, final String text, final int textMaxLenght, final ClickHandler clickHandler) {
-        this(imageUrl, NOSIZE, text, textMaxLenght, false, clickHandler);
+    public BasicThumb(final Object imageRef, final String text, final int textMaxLenght, final ClickHandler clickHandler) {
+        this(imageRef, NOSIZE, text, textMaxLenght, false, clickHandler);
     }
 
     public void addClickHandler(final ClickHandler clickHandler) {
@@ -111,6 +133,15 @@
         image.addClickHandler(clickHandler);
     }
 
+    public void addDoubleClickHandler(final DoubleClickHandler clickHandler) {
+        addDoubleClickHandlerImpl(clickHandler);
+    }
+
+    private void addDoubleClickHandlerImpl(final DoubleClickHandler clickHandler) {
+        label.addDoubleClickHandler(clickHandler);
+        image.addDoubleClickHandler(clickHandler);
+    }
+
     public void setLabelVisible(final boolean visible) {
         label.setVisible(visible);
     }
@@ -128,11 +159,8 @@
     }
 
     public void setTooltip(final String tip) {
-        // DOM.setElementAttribute(thumbImg.getElement(), "qtip", tip);
-        image.setTitle(tip);
-        label.setTitle(tip);
-        // KuneUiUtils.setQuickTip(thumbImg, tip);
-        // KuneUiUtils.setQuickTip(thumbLabel, tip);
+        Tooltip.to(image, tip);
+        Tooltip.to(label, tip);
     }
 
     public void setTooltip(final String tipTitle, final String tip) {

Modified: trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreGinModule.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/core/client/CoreGinModule.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -28,7 +28,7 @@
 import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
 import cc.kune.common.client.ui.MaskWidget;
 import cc.kune.common.client.ui.MaskWidgetView;
-import cc.kune.core.client.actions.ActionRegistries;
+import cc.kune.core.client.actions.ActionRegistryByType;
 import cc.kune.core.client.auth.Register;
 import cc.kune.core.client.auth.RegisterPanel;
 import cc.kune.core.client.auth.RegisterPresenter;
@@ -57,6 +57,7 @@
 import cc.kune.core.client.notify.msgs.UserNotifierViewImpl;
 import cc.kune.core.client.notify.spiner.SpinerPresenter;
 import cc.kune.core.client.notify.spiner.SpinerViewImpl;
+import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
 import cc.kune.core.client.sitebar.SiteUserOptions;
 import cc.kune.core.client.sitebar.SiteUserOptionsPresenter;
 import cc.kune.core.client.sitebar.SitebarActions;
@@ -99,8 +100,8 @@
 import cc.kune.core.client.ws.entheader.EntityHeaderPanel;
 import cc.kune.core.client.ws.entheader.EntityHeaderPresenter;
 import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.WsArmor;
-import cc.kune.gspace.client.WsArmorImpl;
+import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.GSpaceArmorImpl;
 import cc.kune.gspace.client.tags.TagsSummaryPanel;
 import cc.kune.gspace.client.tags.TagsSummaryPresenter;
 import cc.kune.gspace.client.ui.footer.license.EntityLicensePanel;
@@ -174,12 +175,11 @@
 
         s(UserMessagesPresenter.class);
         s(UserMessagesPanel.class);
-
         // bind(MessagePanelView.class).to(MessagePanel.class);
 
         // UI
-        s(WsArmorImpl.class);
-        bind(WsArmor.class).to(WsArmorImpl.class).in(Singleton.class);
+        s(GSpaceArmorImpl.class);
+        bind(GSpaceArmor.class).to(GSpaceArmorImpl.class).in(Singleton.class);
         bind(GuiProvider.class).to(DefaultGuiProvider.class).in(Singleton.class);
         s(GxtGuiProvider.class);
         s(GwtGuiProvider.class);
@@ -202,7 +202,8 @@
         s(SiteTokens.class);
         s(ReservedWordsRegistry.class);
         eagle(TokenMatcher.class);
-        s(ActionRegistries.class);
+        s(ActionRegistryByType.class);
+        s(ContentCapabilitiesRegistry.class);
         eagle(CoreParts.class);
 
         // SN

Deleted: trunk/src/main/java/cc/kune/core/client/actions/ActionRegistries.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/ActionRegistries.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/core/client/actions/ActionRegistries.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -1,18 +0,0 @@
-package cc.kune.core.client.actions;
-
-
-public class ActionRegistries {
-
-    ActionRegistryByType contentFooterActions;
-    ActionRegistryByType contentHeaderActions;
-    ActionRegistryByType contentItemMenu;
-    ActionRegistryByType contentSubHeaderActions;
-
-    public ActionRegistries() {
-        contentSubHeaderActions = new ActionRegistryByType();
-        contentHeaderActions = new ActionRegistryByType();
-        contentFooterActions = new ActionRegistryByType();
-        contentItemMenu = new ActionRegistryByType();
-    }
-
-}

Modified: trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -31,11 +31,11 @@
         collection.add(descrip);
     }
 
-    public void addAction(final Provider<GuiActionDescrip> action) {
+    public void addAction(final Provider<? extends GuiActionDescrip> action) {
         addAction(action, GENERIC);
     }
 
-    public void addAction(final Provider<GuiActionDescrip> action, final String... typeIds) {
+    public void addAction(final Provider<? extends GuiActionDescrip> action, final String... typeIds) {
         assert action != null;
         for (final String typeId : typeIds) {
             final GuiActionDescProviderCollection actionColl = getActions(typeId);
@@ -70,7 +70,7 @@
     public GuiActionDescCollection getCurrentActions(final Object targetItem, final String typeId,
             final boolean isLogged, final AccessRights rights, @Nullable final Class<?> clazz) {
         final GuiActionDescCollection collection = new GuiActionDescCollection();
-        for (final Provider<GuiActionDescrip> descripProv : getActions(typeId)) {
+        for (final Provider<? extends GuiActionDescrip> descripProv : getActions(typeId)) {
             final GuiActionDescrip descrip = descripProv.get();
             final AbstractAction action = descrip.getAction();
             final Object perspective = descrip.getValue(ActionPerspective.KEY);

Modified: trunk/src/main/java/cc/kune/core/client/auth/WaveClientSimpleAuthenticator.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/WaveClientSimpleAuthenticator.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/core/client/auth/WaveClientSimpleAuthenticator.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -2,7 +2,7 @@
 
 import cc.kune.common.client.log.Log;
 import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 
 import com.google.gwt.http.client.Request;
 import com.google.gwt.http.client.RequestBuilder;
@@ -16,10 +16,10 @@
 
 public class WaveClientSimpleAuthenticator {
 
-    private final WsArmor wsArmor;
+    private final GSpaceArmor wsArmor;
 
     @Inject
-    public WaveClientSimpleAuthenticator(final WsArmor wsArmor) {
+    public WaveClientSimpleAuthenticator(final GSpaceArmor wsArmor) {
         this.wsArmor = wsArmor;
     }
 

Modified: trunk/src/main/java/cc/kune/core/client/cnt/AbstractContentPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/cnt/AbstractContentPanel.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/core/client/cnt/AbstractContentPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -19,7 +19,7 @@
  */
 package cc.kune.core.client.cnt;
 
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 
 import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
 import com.google.gwt.user.client.ui.Widget;
@@ -28,7 +28,7 @@
     private Widget widget;
     private final ForIsWidget ws;
 
-    public AbstractContentPanel(final WsArmor ws) {
+    public AbstractContentPanel(final GSpaceArmor ws) {
         this.ws = ws.getDocContainer();
     }
 

Modified: trunk/src/main/java/cc/kune/core/client/cnt/ActionContentToolbarImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/cnt/ActionContentToolbarImpl.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/core/client/cnt/ActionContentToolbarImpl.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -21,7 +21,7 @@
 
 import cc.kune.common.client.actions.ui.ActionFlowPanel;
 import cc.kune.common.client.actions.ui.bind.GuiProvider;
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 
 import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
 import com.google.inject.Inject;
@@ -31,7 +31,7 @@
     private final ForIsWidget wsToolbar;
 
     @Inject
-    public ActionContentToolbarImpl(final GuiProvider guiProvider, final WsArmor wsArmor) {
+    public ActionContentToolbarImpl(final GuiProvider guiProvider, final GSpaceArmor wsArmor) {
         super(guiProvider);
         this.wsToolbar = wsArmor.getDocSubheader();
     }

Modified: trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPanel.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -24,7 +24,7 @@
 import cc.kune.common.client.ui.IconLabel;
 import cc.kune.core.client.resources.CoreResources;
 import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 import cc.kune.wave.client.WaveClientManager;
 
 import com.google.gwt.event.dom.client.ClickEvent;
@@ -44,7 +44,7 @@
     private final IconLabel messageLabel;
     private final FlowPanel messagePanel;
 
-    public FoldableContentPanel(final WsArmor ws, final I18nTranslationService i18n, final CoreResources res,
+    public FoldableContentPanel(final GSpaceArmor ws, final I18nTranslationService i18n, final CoreResources res,
             final WaveClientManager waveClientManager) {
         super(ws);
         this.i18n = i18n;

Modified: trunk/src/main/java/cc/kune/core/client/registry/ContentCapabilitiesRegistry.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/registry/ContentCapabilitiesRegistry.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/core/client/registry/ContentCapabilitiesRegistry.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -30,7 +30,7 @@
     private final DragableRegistry dragable;
     private final DropableRegistry dropable;
     private final EmailSubscribeAbleRegistry emailSubscribeAble;
-    private final ContentIconsRegistry iconsRegistry;
+    private final IconsRegistry iconsRegistry;
     private final LicensableRegistry licensable;
     private final PublishModerableRegistry publishModerable;
     private final RateableRegistry rateable;
@@ -43,7 +43,7 @@
 
     @Inject
     public ContentCapabilitiesRegistry(final AuthorableRegistry authorableRegistry,
-            final AclEditableRegistry aclEditableRegistry, final ContentIconsRegistry iconsRegistry,
+            final AclEditableRegistry aclEditableRegistry, final IconsRegistry iconsRegistry,
             final CanBeHomepageRegistry canBeHomepage, final ComentableRegistry comentable,
             final DragableRegistry dragable, final DropableRegistry dropable,
             final EmailSubscribeAbleRegistry emailSubscribeAble, final LicensableRegistry licensable,
@@ -102,7 +102,7 @@
         return emailSubscribeAble;
     }
 
-    public ContentIconsRegistry getIconsRegistry() {
+    public IconsRegistry getIconsRegistry() {
         return iconsRegistry;
     }
 

Deleted: trunk/src/main/java/cc/kune/core/client/registry/ContentIconsRegistry.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/registry/ContentIconsRegistry.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/core/client/registry/ContentIconsRegistry.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -1,78 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package cc.kune.core.client.registry;
-
-import java.util.HashMap;
-
-import cc.kune.core.shared.dto.BasicMimeTypeDTO;
-
-public class ContentIconsRegistry {
-    private final HashMap<String, String> contentTypesIcons;
-
-    public ContentIconsRegistry() {
-        contentTypesIcons = new HashMap<String, String>();
-    }
-
-    public String getContentTypeIcon(final String typeId) {
-        final String icon = contentTypesIcons.get(typeId);
-        return icon == null ? "" : icon;
-    }
-
-    /**
-     * If there is a specific icon for a type/subtype pair or a generic type
-     * icon in defect
-     * 
-     * @param typeId
-     *            the kune typeId (see *ClientTool)
-     * @param mimeType
-     * @return
-     */
-    public String getContentTypeIcon(final String typeId, final BasicMimeTypeDTO mimeType) {
-        String icon = getContentTypeIcon(concatenate(typeId, mimeType));
-        if (icon.equals("")) {
-            if (mimeType == null) {
-                return getContentTypeIcon(typeId);
-            }
-        } else {
-            return icon;
-        }
-        final String subtype = mimeType.getSubtype();
-        if (subtype != null && subtype.length() > 0) {
-            icon = getContentTypeIcon(typeId, new BasicMimeTypeDTO(mimeType.getType()));
-        }
-        return icon.equals("") ? getContentTypeIcon(typeId) : icon;
-    }
-
-    public void registerContentTypeIcon(final String typeId, final BasicMimeTypeDTO mimeType, final String iconUrl) {
-        registerContentTypeIcon(concatenate(typeId, mimeType), iconUrl);
-    }
-
-    public void registerContentTypeIcon(final String contentTypeId, final String iconUrl) {
-        contentTypesIcons.put(contentTypeId, iconUrl);
-    }
-
-    private String concatenate(final String typeId, final BasicMimeTypeDTO mimeType) {
-        if (mimeType != null) {
-            return typeId + "|" + mimeType;
-        } else {
-            return typeId;
-        }
-    }
-}

Added: trunk/src/main/java/cc/kune/core/client/registry/IconsRegistry.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/registry/IconsRegistry.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/registry/IconsRegistry.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -0,0 +1,78 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ \*/
+package cc.kune.core.client.registry;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import cc.kune.core.shared.dto.BasicMimeTypeDTO;
+
+public class IconsRegistry {
+    private final Map<String, Object> contentTypesIcons;
+
+    public IconsRegistry() {
+        contentTypesIcons = new HashMap<String, Object>();
+    }
+
+    private String concatenate(final String typeId, final BasicMimeTypeDTO mimeType) {
+        if (mimeType != null) {
+            return typeId + "|" + mimeType;
+        } else {
+            return typeId;
+        }
+    }
+
+    public Object getContentTypeIcon(final String typeId) {
+        return contentTypesIcons.get(typeId);
+    }
+
+    /**
+     * If there is a specific icon for a type/subtype pair or a generic type
+     * icon in defect
+     * 
+     * @param typeId
+     *            the kune typeId (see *ClientTool)
+     * @param mimeType
+     * @return
+     */
+    public Object getContentTypeIcon(final String typeId, final BasicMimeTypeDTO mimeType) {
+        Object icon = getContentTypeIcon(concatenate(typeId, mimeType));
+        if (icon == null) {
+            if (mimeType == null) {
+                return getContentTypeIcon(typeId);
+            }
+        } else {
+            return icon;
+        }
+        final String subtype = mimeType.getSubtype();
+        if (subtype != null && subtype.length() > 0) {
+            icon = getContentTypeIcon(typeId, new BasicMimeTypeDTO(mimeType.getType()));
+        }
+        return icon == null ? getContentTypeIcon(typeId) : icon;
+    }
+
+    public void registerContentTypeIcon(final String typeId, final BasicMimeTypeDTO mimeType, final Object icon) {
+        registerContentTypeIcon(concatenate(typeId, mimeType), icon);
+    }
+
+    public void registerContentTypeIcon(final String contentTypeId, final Object icon) {
+        contentTypesIcons.put(contentTypeId, icon);
+    }
+}


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

Modified: trunk/src/main/java/cc/kune/core/client/resources/generateMainImageBundle.sh
===================================================================
--- trunk/src/main/java/cc/kune/core/client/resources/generateMainImageBundle.sh	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/core/client/resources/generateMainImageBundle.sh	2011-04-18 00:41:28 UTC (rev 1315)
@@ -4,12 +4,12 @@
 #       @Resource("image")
 #	AbstractImagePrototype arrowDownWhite();
 #
-
+PARAM=$*
 cat << EOF
 
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.ImageBundle;
+import com.google.gwt.resources.client.ClientBundle;
+import com.google.gwt.resources.client.ClientBundle.Source;
+import com.google.gwt.resources.client.ImageResource;
 
 /**
  *
@@ -18,7 +18,8 @@
  */
 public interface XXXResources extends ClientBundle {
 EOF
-for i in `ls -1 *png *gif 2> /dev/null`
+#for i in `ls -1 *png *gif 2> /dev/null`
+for i in `ls -1 $PARAM 2> /dev/null`
 do
    echo -e "\n at Source(\"$i\")\nImageResource" \
   `echo ·$i |cut -d '.' -f 1 | sed 's/-/ /g' | sed 's/_/ /g' | perl -ne '@a=split;foreach (@a) {push @b,ucfirst};print "@b\n"' | sed 's/ //g' | sed 's/·//g'`"();"

Added: trunk/src/main/java/cc/kune/core/client/resources/nav/NavResources.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/resources/nav/NavResources.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/resources/nav/NavResources.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -0,0 +1,94 @@
+package cc.kune.core.client.resources.nav;
+
+import com.google.gwt.resources.client.ClientBundle;
+import com.google.gwt.resources.client.ImageResource;
+
+public interface NavResources extends ClientBundle {
+
+    @Source("blog.png")
+    ImageResource blog();
+
+    @Source("blog_add.png")
+    ImageResource blogAdd();
+
+    @Source("download.png")
+    ImageResource download();
+
+    @Source("film.png")
+    ImageResource film();
+
+    @Source("folder.png")
+    ImageResource folder();
+
+    @Source("folder_add.png")
+    ImageResource folderAdd();
+
+    @Source("gallery.png")
+    ImageResource gallery();
+
+    @Source("gallery_add.png")
+    ImageResource galleryAdd();
+
+    @Source("go.png")
+    ImageResource go();
+
+    @Source("music.png")
+    ImageResource music();
+
+    @Source("page.png")
+    ImageResource page();
+
+    @Source("page_add.png")
+    ImageResource pageAdd();
+
+    @Source("page_excel.png")
+    ImageResource pageExcel();
+
+    @Source("page_pdf.png")
+    ImageResource pagePdf();
+
+    @Source("page_pps.png")
+    ImageResource pagePps();
+
+    @Source("page_text.png")
+    ImageResource pageText();
+
+    @Source("page_word.png")
+    ImageResource pageWord();
+
+    @Source("page_zip.png")
+    ImageResource pageZip();
+
+    @Source("picture.png")
+    ImageResource picture();
+
+    @Source("post.png")
+    ImageResource post();
+
+    @Source("post_add.png")
+    ImageResource postAdd();
+
+    @Source("refresh.png")
+    ImageResource refresh();
+
+    @Source("room.png")
+    ImageResource room();
+
+    @Source("room_add.png")
+    ImageResource roomAdd();
+
+    @Source("upload.png")
+    ImageResource upload();
+
+    @Source("wiki.png")
+    ImageResource wiki();
+
+    @Source("wiki_add.png")
+    ImageResource wikiAdd();
+
+    @Source("wikipage.png")
+    ImageResource wikipage();
+
+    @Source("wikipage_add.png")
+    ImageResource wikipageAdd();
+}


Property changes on: trunk/src/main/java/cc/kune/core/client/resources/nav/NavResources.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPanel.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -23,7 +23,7 @@
 import cc.kune.common.client.actions.ui.IsActionExtensible;
 import cc.kune.core.client.sitebar.SitebarActionsPresenter.SitebarActionsView;
 import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 
 import com.google.gwt.user.client.ui.Widget;
 import com.google.inject.Inject;
@@ -37,7 +37,7 @@
     private final ActionSimplePanel toolbarRight;
 
     @Inject
-    public SitebarActionsPanel(final WsArmor armor, final ActionSimplePanel toolbarRight,
+    public SitebarActionsPanel(final GSpaceArmor armor, final ActionSimplePanel toolbarRight,
             final ActionSimplePanel toolbarLeft, final I18nTranslationService i18n,
             final Provider<AboutKuneDialog> aboutPanel) {
         this.toolbarRight = toolbarRight;

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/logo/SiteLogoViewImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/logo/SiteLogoViewImpl.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/logo/SiteLogoViewImpl.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -20,7 +20,7 @@
 package cc.kune.core.client.sitebar.logo;
 
 import cc.kune.core.client.sitebar.logo.SiteLogoPresenter.SiteLogoView;
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.event.dom.client.ClickEvent;
@@ -43,7 +43,7 @@
     Image logo;
 
     @Inject
-    public SiteLogoViewImpl(final WsArmor armor) {
+    public SiteLogoViewImpl(final GSpaceArmor armor) {
         armor.getSitebar().insert(uiBinder.createAndBindUi(this), 0);
     }
 

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -26,7 +26,7 @@
 import cc.kune.core.client.state.StateManager;
 import cc.kune.core.client.state.TokenUtils;
 import cc.kune.core.client.state.UserSignOutEvent;
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 
 import com.google.gwt.event.dom.client.ClickEvent;
 import com.google.gwt.event.dom.client.ClickHandler;
@@ -66,7 +66,7 @@
         void setUserBtnDown(boolean down);
     }
 
-    private final WsArmor armor;
+    private final GSpaceArmor armor;
     private Space currentSpace;
     private String groupToken;
     private String homeToken;
@@ -77,7 +77,7 @@
 
     @Inject
     public SpaceSelectorPresenter(final EventBus eventBus, final StateManager stateManager,
-            final SpaceSelectorView view, final SpaceSelectorProxy proxy, final WsArmor armor, final Session session) {
+            final SpaceSelectorView view, final SpaceSelectorProxy proxy, final GSpaceArmor armor, final Session session) {
         super(eventBus, view, proxy);
         this.stateManager = stateManager;
         this.armor = armor;

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorViewImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorViewImpl.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorViewImpl.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -22,7 +22,7 @@
 import cc.kune.common.client.tooltip.Tooltip;
 import cc.kune.core.client.sitebar.spaces.SpaceSelectorPresenter.SpaceSelectorView;
 import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 import cc.kune.gspace.client.resources.WsArmorResources;
 
 import com.google.gwt.core.client.GWT;
@@ -51,7 +51,7 @@
     ToggleButton userButton;
 
     @Inject
-    public SpaceSelectorViewImpl(final WsArmor armor, final I18nTranslationService i18n, final WsArmorResources res) {
+    public SpaceSelectorViewImpl(final GSpaceArmor armor, final I18nTranslationService i18n, final WsArmorResources res) {
         armor.getSitebar().insert(uiBinder.createAndBindUi(this), 0);
         Tooltip.to(homeButton, i18n.t("Your home page in this site"));
         Tooltip.to(userButton, i18n.t("User space: it shows a list of all your documents and contents "

Modified: trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -11,7 +11,7 @@
 import cc.kune.common.client.tooltip.Tooltip;
 import cc.kune.common.client.ui.BasicThumb;
 import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.event.dom.client.ClickEvent;
@@ -83,7 +83,7 @@
     ScrollPanel trdCategoryScroll;
     protected final Widget widget;
 
-    public AbstractSNPanel(final I18nTranslationService i18n, final GuiProvider guiProvider, final WsArmor armor) {
+    public AbstractSNPanel(final I18nTranslationService i18n, final GuiProvider guiProvider, final GSpaceArmor armor) {
         widget = uiBinder.createAndBindUi(this);
         actions = new ActionSimplePanel(guiProvider);
     }

Modified: trunk/src/main/java/cc/kune/core/client/sn/GroupSNPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/GroupSNPanel.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/core/client/sn/GroupSNPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -8,14 +8,14 @@
 import cc.kune.core.client.sn.GroupSNPresenter.GroupSNView;
 import cc.kune.core.shared.dto.GroupDTO;
 import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 
 import com.google.inject.Inject;
 
 public class GroupSNPanel extends AbstractSNPanel implements GroupSNView {
 
     @Inject
-    public GroupSNPanel(final I18nTranslationService i18n, final GuiProvider guiProvider, final WsArmor armor) {
+    public GroupSNPanel(final I18nTranslationService i18n, final GuiProvider guiProvider, final GSpaceArmor armor) {
         super(i18n, guiProvider, armor);
         setVisible(false);
         mainTitle.setText(i18n.t("Group members"));

Modified: trunk/src/main/java/cc/kune/core/client/sn/UserSNPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/UserSNPanel.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/core/client/sn/UserSNPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -8,7 +8,7 @@
 import cc.kune.core.shared.dto.GroupDTO;
 import cc.kune.core.shared.dto.UserSimpleDTO;
 import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 
 import com.google.gwt.user.client.ui.Label;
 import com.google.inject.Inject;
@@ -16,7 +16,7 @@
 public class UserSNPanel extends AbstractSNPanel implements UserSNView {
 
     @Inject
-    public UserSNPanel(final I18nTranslationService i18n, final GuiProvider guiProvider, final WsArmor armor) {
+    public UserSNPanel(final I18nTranslationService i18n, final GuiProvider guiProvider, final GSpaceArmor armor) {
         super(i18n, guiProvider, armor);
         setVisible(false);
         mainTitle.setText(i18n.t("His/her network:"));

Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/registry/AbstractSNActionsRegistry.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/registry/AbstractSNActionsRegistry.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/registry/AbstractSNActionsRegistry.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -2,10 +2,6 @@
 
 import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
 
-public abstract class AbstractSNActionsRegistry extends GuiActionDescCollection { // NOPMD
-                                                                                  // by
-                                                                                  // vjrj
-                                                                                  // on
-                                                                                  // 10/02/11
-                                                                                  // 3:19
+ at SuppressWarnings("serial")
+public abstract class AbstractSNActionsRegistry extends GuiActionDescCollection {
 }
\ No newline at end of file

Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/registry/AbstractSNMembersActionsRegistry.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/registry/AbstractSNMembersActionsRegistry.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/registry/AbstractSNMembersActionsRegistry.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -6,5 +6,6 @@
 
 import com.google.inject.Provider;
 
-public abstract class AbstractSNMembersActionsRegistry extends ArrayList<Provider<MenuItemDescriptor>> { // NOPMD by vjrj on 10/02/11 3:19
+ at SuppressWarnings("serial")
+public abstract class AbstractSNMembersActionsRegistry extends ArrayList<Provider<MenuItemDescriptor>> {
 }
\ No newline at end of file

Modified: trunk/src/main/java/cc/kune/core/client/ws/CoreViewImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/ws/CoreViewImpl.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/core/client/ws/CoreViewImpl.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -21,7 +21,7 @@
 
 import cc.kune.core.client.resources.CoreResources;
 import cc.kune.core.client.state.StateManagerDefault;
-import cc.kune.gspace.client.WsArmorImpl;
+import cc.kune.gspace.client.GSpaceArmorImpl;
 import cc.kune.gspace.client.resources.WsArmorResources;
 
 import com.google.gwt.core.client.GWT;
@@ -35,7 +35,7 @@
  */
 public class CoreViewImpl extends ViewImpl implements CorePresenter.CoreView {
 
-    private final WsArmorImpl armor;
+    private final GSpaceArmorImpl armor;
 
     /**
      * Instantiates a new core view.
@@ -44,7 +44,7 @@
      *            the body
      */
     @Inject
-    public CoreViewImpl(final WsArmorImpl armor, final StateManagerDefault stateManager) {
+    public CoreViewImpl(final GSpaceArmorImpl armor, final StateManagerDefault stateManager) {
         this.armor = armor;
         GWT.<CoreResources> create(CoreResources.class).css().ensureInjected();
         GWT.<WsArmorResources> create(WsArmorResources.class).style().ensureInjected();

Modified: trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -30,7 +30,7 @@
 import cc.kune.core.client.ws.entheader.EntityHeaderPresenter.EntityHeaderView;
 import cc.kune.core.shared.domain.utils.StateToken;
 import cc.kune.core.shared.dto.GroupDTO;
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 
 import com.google.gwt.user.client.ui.AbstractImagePrototype;
 import com.google.gwt.user.client.ui.HorizontalPanel;
@@ -53,7 +53,7 @@
 
     @Inject
     public EntityHeaderPanel(final Provider<FileDownloadUtils> downloadProvider, final CoreResources images,
-            final GuiProvider bindings, final WsArmor armor) {
+            final GuiProvider bindings, final GSpaceArmor armor) {
         mainPanel = new HorizontalPanel();
         mainPanel.setWidth("100%");
         this.downloadProvider = downloadProvider;

Modified: trunk/src/main/java/cc/kune/core/shared/dto/HasContent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/HasContent.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/core/shared/dto/HasContent.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -1,7 +1,11 @@
 package cc.kune.core.shared.dto;
 
 public interface HasContent {
+
+    ContainerDTO getContainer();
+
     String getTypeId();
 
     void setTypeId(String typeId);
+
 }

Deleted: trunk/src/main/java/cc/kune/docs/client/AbstractFoldableContentActions.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/AbstractFoldableContentActions.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/docs/client/AbstractFoldableContentActions.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -1,73 +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;
-
-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 I18nUITranslationService i18n;
-    protected final Session session;
-    protected final StateManager stateManager;
-
-    public AbstractFoldableContentActions(final Session session, final StateManager stateManager,
-            final I18nUITranslationService i18n) {
-        this.session = session;
-        this.stateManager = stateManager;
-        this.i18n = i18n;
-        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/ContentRenameAction.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/ContentRenameAction.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/docs/client/ContentRenameAction.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -1,20 +0,0 @@
-package cc.kune.docs.client;
-
-import cc.kune.common.client.actions.ActionEvent;
-import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.utils.TextUtils;
-import cc.kune.core.client.actions.RolAction;
-import cc.kune.core.shared.dto.AccessRolDTO;
-
-public class ContentRenameAction extends RolAction {
-
-    public ContentRenameAction() {
-        super(AccessRolDTO.Editor, true);
-    }
-
-    @Override
-    public void actionPerformed(final ActionEvent event) {
-        NotifyUser.info(TextUtils.IN_DEVELOPMENT);
-    }
-
-}
\ No newline at end of file

Copied: trunk/src/main/java/cc/kune/docs/client/DocsClientTool.java (from rev 1314, trunk/src/main/java/cc/kune/docs/client/DocumentClientTool.java)
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocsClientTool.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/DocsClientTool.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -0,0 +1,70 @@
+/*
+ *
+ * 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.docs.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 DocsClientTool extends FoldableAbstractClientTool {
+    public static final String NAME = "docs";
+    public static final String TYPE_DOCUMENT = NAME + "." + "doc";
+    public static final String TYPE_FOLDER = NAME + "." + "folder";
+    public static final String TYPE_ROOT = NAME + "." + "root";
+    public static final String TYPE_UPLOADEDFILE = NAME + "." + FoldableAbstractClientTool.UPLOADEDFILE_SUFFIX;
+    public static final String TYPE_WAVE = NAME + "." + FoldableAbstractClientTool.WAVE_SUFFIX;
+    private final NavResources navResources;
+
+    @Inject
+    public DocsClientTool(final I18nUITranslationService i18n, final ToolSelector toolSelector,
+            final ContentCapabilitiesRegistry cntCapRegistry, final NavResources navResources) {
+        super(NAME, i18n.t("documents"), toolSelector, cntCapRegistry);
+        this.navResources = navResources;
+
+        // registerAclEditableTypes(TYPE_DOCUMENT, TYPE_UPLOADEDFILE);
+        registerAuthorableTypes(TYPE_DOCUMENT, TYPE_UPLOADEDFILE);
+        registerDragableTypes(TYPE_DOCUMENT, TYPE_FOLDER, TYPE_UPLOADEDFILE);
+        registerDropableTypes(TYPE_ROOT, TYPE_FOLDER);
+        registerPublishModerableTypes(TYPE_DOCUMENT, TYPE_UPLOADEDFILE);
+        registerRateableTypes(TYPE_DOCUMENT, TYPE_UPLOADEDFILE);
+        registerRenamableTypes(TYPE_DOCUMENT, TYPE_FOLDER, TYPE_UPLOADEDFILE);
+        registerTageableTypes(TYPE_DOCUMENT, TYPE_UPLOADEDFILE);
+        registerTranslatableTypes(TYPE_DOCUMENT, TYPE_FOLDER);
+
+        registerIcons();
+    }
+
+    @Override
+    public String getName() {
+        return NAME;
+    }
+
+    private void registerIcons() {
+        registerContentTypeIcon(TYPE_FOLDER, navResources.folder());
+        registerContentTypeIcon(TYPE_DOCUMENT, navResources.page());
+        registerContentTypeIcon(TYPE_WAVE, navResources.page());
+        registerUploadTypesAndMimes(TYPE_UPLOADEDFILE);
+    }
+
+}

Copied: trunk/src/main/java/cc/kune/docs/client/DocsGinModule.java (from rev 1314, trunk/src/main/java/cc/kune/docs/client/DocumentGinModule.java)
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocsGinModule.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/DocsGinModule.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -0,0 +1,24 @@
+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.FolderViewerPanel;
+import cc.kune.docs.client.viewers.FolderViewerPresenter;
+
+import com.google.inject.Singleton;
+import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
+
+public class DocsGinModule extends AbstractPresenterModule {
+
+    @Override
+    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,
+                FolderViewerPanel.class, FolderViewerPresenter.FolderViewerProxy.class);
+    }
+
+}


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

Modified: trunk/src/main/java/cc/kune/docs/client/DocsGinjector.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocsGinjector.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/docs/client/DocsGinjector.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -1,5 +1,8 @@
 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;
 
@@ -7,6 +10,7 @@
 
     DocsParts getDocsParts();
 
-    AsyncProvider<DocsViewerPresenter> getDocsViewerPresenter();
+    AsyncProvider<DocViewerPresenter> getDocsViewerPresenter();
 
+    AsyncProvider<FolderViewerPresenter> getFolderViewerPresenter();
 }

Deleted: trunk/src/main/java/cc/kune/docs/client/DocsGoUpBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocsGoUpBtn.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/docs/client/DocsGoUpBtn.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -1,32 +0,0 @@
-package cc.kune.docs.client;
-
-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.core.client.resources.CoreResources;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.actions.perspective.ViewPerspective;
-
-import com.google.inject.Inject;
-
-public class DocsGoUpBtn extends ButtonDescriptor {
-
-    public class DocNewAction extends AbstractExtendedAction {
-
-        public DocNewAction() {
-        }
-
-        @Override
-        public void actionPerformed(final ActionEvent event) {
-        }
-
-    }
-
-    @Inject
-    public DocsGoUpBtn(final I18nTranslationService i18n, final DocNewAction action, final CoreResources res) {
-        super(action);
-        this.withToolTip(i18n.t("Go up: Open the container folder")).withIcon(res.folderGoUp()).in(
-                ViewPerspective.class);
-    }
-
-}

Modified: trunk/src/main/java/cc/kune/docs/client/DocsParts.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocsParts.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/docs/client/DocsParts.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -1,6 +1,8 @@
 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;
@@ -8,7 +10,10 @@
 public class DocsParts {
 
     @Inject
-    public DocsParts(final Session session, final Provider<DocsViewerPresenter> docsViewer) {
+    public DocsParts(final Session session, final Provider<DocViewerPresenter> docsViewer,
+            final Provider<FolderViewerPresenter> folderViewer, final Provider<DocsClientTool> docsClientTool) {
+        docsClientTool.get();
         docsViewer.get();
+        folderViewer.get();
     }
 }
\ No newline at end of file

Deleted: trunk/src/main/java/cc/kune/docs/client/DocsViewerPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocsViewerPanel.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/docs/client/DocsViewerPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -1,156 +0,0 @@
-package cc.kune.docs.client;
-
-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.DocsViewerPresenter.DocsViewerView;
-import cc.kune.gspace.client.WsArmor;
-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 DocsViewerPanel extends ViewImpl implements DocsViewerView {
-    interface DocsViewerPanelUiBinder extends UiBinder<Widget, DocsViewerPanel> {
-    }
-
-    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 WsArmor wsArmor;
-
-    @Inject
-    public DocsViewerPanel(final WsArmor 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) {
-    }
-
-    @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();
-            }
-        });
-    }
-}

Deleted: trunk/src/main/java/cc/kune/docs/client/DocsViewerPanel.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocsViewerPanel.ui.xml	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/docs/client/DocsViewerPanel.ui.xml	2011-04-18 00:41:28 UTC (rev 1315)
@@ -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

Deleted: trunk/src/main/java/cc/kune/docs/client/DocsViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocsViewerPresenter.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/docs/client/DocsViewerPresenter.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -1,77 +0,0 @@
-package cc.kune.docs.client;
-
-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.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 DocsViewerPresenter extends
-        Presenter<DocsViewerPresenter.DocsViewerView, DocsViewerPresenter.DocsViewerProxy> implements ContentViewer {
-
-    @ProxyCodeSplit
-    public interface DocsViewerProxy extends Proxy<DocsViewerPresenter> {
-    }
-
-    public interface DocsViewerView extends View {
-
-        void attach();
-
-        void detach();
-
-        void setActions(GuiActionDescCollection actions);
-
-        void setContent(StateContentDTO state);
-    }
-
-    private final ActionRegistryByType actionsRegistry;
-    private final Session session;
-
-    @Inject
-    public DocsViewerPresenter(final EventBus eventBus, final DocsViewerView view, final DocsViewerProxy proxy,
-            final Session session, final ContentViewerSelector viewerSelector,
-            final ActionRegistryByType actionsRegistry) {
-        super(eventBus, view, proxy);
-        this.session = session;
-        this.actionsRegistry = actionsRegistry;
-        viewerSelector.register(DocumentClientTool.TYPE_WAVE, this, true);
-    }
-
-    @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

Deleted: trunk/src/main/java/cc/kune/docs/client/DocumentClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocumentClientActions.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/docs/client/DocumentClientActions.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -1,94 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package cc.kune.docs.client;
-
-import static cc.kune.docs.client.DocumentClientTool.TYPE_DOCUMENT;
-import static cc.kune.docs.client.DocumentClientTool.TYPE_FOLDER;
-import static cc.kune.docs.client.DocumentClientTool.TYPE_ROOT;
-import static cc.kune.docs.client.DocumentClientTool.TYPE_UPLOADEDFILE;
-import cc.kune.core.client.i18n.I18nUITranslationService;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-
-public class DocumentClientActions extends AbstractFoldableContentActions {
-    public DocumentClientActions(final I18nUITranslationService i18n, final Session session,
-            final StateManager stateManager) {
-        super(session, stateManager, i18n);
-    }
-
-    @Override
-    protected void createActions() {
-        final String[] all = { TYPE_ROOT, TYPE_FOLDER, TYPE_DOCUMENT, TYPE_UPLOADEDFILE };
-        final String[] containers = { TYPE_ROOT, TYPE_FOLDER, };
-        final String[] contentsModerated = { TYPE_DOCUMENT, TYPE_UPLOADEDFILE };
-        final String[] containersNoRoot = { TYPE_FOLDER };
-        final String[] contents = { TYPE_DOCUMENT, TYPE_UPLOADEDFILE };
-
-        // 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/DocumentClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocumentClientTool.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/docs/client/DocumentClientTool.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -1,66 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.docs.client;
-
-import cc.kune.core.client.i18n.I18nUITranslationService;
-import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
-import cc.kune.gspace.client.tool.old.FoldableAbstractClientTool;
-import cc.kune.gspace.client.tool.selector.ToolSelector;
-
-import com.google.inject.Inject;
-
-public class DocumentClientTool extends FoldableAbstractClientTool {
-    public static final String NAME = "docs";
-    public static final String TYPE_DOCUMENT = NAME + "." + "doc";
-    public static final String TYPE_FOLDER = NAME + "." + "folder";
-    public static final String TYPE_ROOT = NAME + "." + "root";
-    public static final String TYPE_UPLOADEDFILE = NAME + "." + FoldableAbstractClientTool.UPLOADEDFILE_SUFFIX;
-    public static final String TYPE_WAVE = NAME + "." + FoldableAbstractClientTool.WAVE_SUFFIX;
-
-    @Inject
-    public DocumentClientTool(final I18nUITranslationService i18n, final ToolSelector toolSelector,
-            final ContentCapabilitiesRegistry cntCapRegistry) {
-        super(NAME, i18n.t("documents"), toolSelector, cntCapRegistry);
-
-        // registerAclEditableTypes(TYPE_DOCUMENT, TYPE_UPLOADEDFILE);
-        registerAuthorableTypes(TYPE_DOCUMENT, TYPE_UPLOADEDFILE);
-        registerDragableTypes(TYPE_DOCUMENT, TYPE_FOLDER, TYPE_UPLOADEDFILE);
-        registerDropableTypes(TYPE_ROOT, TYPE_FOLDER);
-        registerPublishModerableTypes(TYPE_DOCUMENT, TYPE_UPLOADEDFILE);
-        registerRateableTypes(TYPE_DOCUMENT, TYPE_UPLOADEDFILE);
-        registerRenamableTypes(TYPE_DOCUMENT, TYPE_FOLDER, TYPE_UPLOADEDFILE);
-        registerTageableTypes(TYPE_DOCUMENT, TYPE_UPLOADEDFILE);
-        registerTranslatableTypes(TYPE_DOCUMENT, TYPE_FOLDER);
-
-        registerIcons();
-    }
-
-    @Override
-    public String getName() {
-        return NAME;
-    }
-
-    private void registerIcons() {
-        registerContentTypeIcon(TYPE_FOLDER, "images/nav/folder.png");
-        registerContentTypeIcon(TYPE_DOCUMENT, "images/nav/page.png");
-        registerUploadTypesAndMimes(TYPE_UPLOADEDFILE);
-    }
-
-}

Deleted: trunk/src/main/java/cc/kune/docs/client/DocumentGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocumentGinModule.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/docs/client/DocumentGinModule.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -1,15 +0,0 @@
-package cc.kune.docs.client;
-
-import com.google.inject.Singleton;
-import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
-
-public class DocumentGinModule extends AbstractPresenterModule {
-
-    @Override
-    protected void configure() {
-        bind(DocumentClientTool.class).in(Singleton.class);
-        bindPresenter(DocsViewerPresenter.class, DocsViewerPresenter.DocsViewerView.class, DocsViewerPanel.class,
-                DocsViewerPresenter.DocsViewerProxy.class);
-    }
-
-}

Copied: trunk/src/main/java/cc/kune/docs/client/actions/AbstractFoldableContentActions.java (from rev 1314, trunk/src/main/java/cc/kune/docs/client/AbstractFoldableContentActions.java)
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/AbstractFoldableContentActions.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/actions/AbstractFoldableContentActions.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -0,0 +1,76 @@
+/*
+ *
+ * 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();
+
+}


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

Copied: trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java (from rev 1314, trunk/src/main/java/cc/kune/docs/client/DocumentClientActions.java)
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -0,0 +1,109 @@
+/*
+ *
+ * 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.docs.client.actions;
+
+import static cc.kune.docs.client.DocsClientTool.TYPE_DOCUMENT;
+import static cc.kune.docs.client.DocsClientTool.TYPE_FOLDER;
+import static cc.kune.docs.client.DocsClientTool.TYPE_ROOT;
+import static cc.kune.docs.client.DocsClientTool.TYPE_UPLOADEDFILE;
+import static cc.kune.docs.client.DocsClientTool.TYPE_WAVE;
+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 com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class DocsClientActions extends AbstractFoldableContentActions {
+
+    final String[] all = { TYPE_ROOT, TYPE_FOLDER, TYPE_DOCUMENT, TYPE_UPLOADEDFILE };
+
+    final String[] containers = { TYPE_ROOT, TYPE_FOLDER, };
+    final String[] containersNoRoot = { TYPE_FOLDER };
+    final String[] contents = { TYPE_DOCUMENT, TYPE_UPLOADEDFILE, TYPE_WAVE };
+    final String[] contentsModerated = { TYPE_DOCUMENT, TYPE_UPLOADEDFILE };
+
+    private final Provider<DocsGoUpBtn> docsGoUp;
+
+    @Inject
+    public DocsClientActions(final I18nUITranslationService i18n, final Session session,
+            final StateManager stateManager, final ActionRegistryByType registry, final CoreResources res,
+            final Provider<DocsGoUpBtn> docsGoUp) {
+        super(session, stateManager, i18n, registry);
+        this.docsGoUp = docsGoUp;
+    }
+
+    @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);
+        actionsRegistry.addAction(docsGoUp, contents);
+        actionsRegistry.addAction(docsGoUp, containersNoRoot);
+    }
+}

Copied: trunk/src/main/java/cc/kune/docs/client/actions/DocsGoUpBtn.java (from rev 1314, trunk/src/main/java/cc/kune/docs/client/DocsGoUpBtn.java)
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/DocsGoUpBtn.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/actions/DocsGoUpBtn.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -0,0 +1,42 @@
+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.core.client.resources.CoreResources;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.dto.HasContent;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.actions.perspective.ViewPerspective;
+
+import com.google.inject.Inject;
+
+public class DocsGoUpBtn extends ButtonDescriptor {
+
+    public static class DocsGoUpAction extends AbstractExtendedAction {
+
+        private final Session session;
+        private final StateManager stateManager;
+
+        @Inject
+        public DocsGoUpAction(final Session session, final StateManager stateManager) {
+            this.session = session;
+            this.stateManager = stateManager;
+        }
+
+        @Override
+        public void actionPerformed(final ActionEvent event) {
+            stateManager.gotoStateToken(((HasContent) session.getCurrentState()).getContainer().getStateToken());
+        }
+
+    }
+
+    @Inject
+    public DocsGoUpBtn(final I18nTranslationService i18n, final DocsGoUpAction action, final CoreResources res) {
+        super(action);
+        this.withToolTip(i18n.t("Go up: Open the container folder")).withIcon(res.folderGoUp()).in(
+                ViewPerspective.class);
+    }
+
+}

Copied: trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPanel.java (from rev 1314, trunk/src/main/java/cc/kune/docs/client/DocsViewerPanel.java)
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPanel.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -0,0 +1,158 @@
+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/docs/client/viewers/DocViewerPanel.ui.xml (from rev 1314, trunk/src/main/java/cc/kune/docs/client/DocsViewerPanel.ui.xml)
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPanel.ui.xml	                        (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPanel.ui.xml	2011-04-18 00:41:28 UTC (rev 1315)
@@ -0,0 +1,25 @@
+<!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/docs/client/viewers/DocViewerPresenter.java (from rev 1314, trunk/src/main/java/cc/kune/docs/client/DocsViewerPresenter.java)
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPresenter.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPresenter.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -0,0 +1,79 @@
+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

Added: trunk/src/main/java/cc/kune/docs/client/viewers/FolderItemDescriptor.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/viewers/FolderItemDescriptor.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/viewers/FolderItemDescriptor.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -0,0 +1,93 @@
+/*
+ *
+ * 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.viewers;
+
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
+import cc.kune.core.shared.domain.ContentStatus;
+import cc.kune.core.shared.domain.utils.StateToken;
+
+public class FolderItemDescriptor {
+    private final GuiActionDescCollection actionCollection;
+    private final boolean allowDrag;
+    private final boolean allowDrop;
+    private final ContentStatus contentStatus;
+    private final Object icon;
+    private final String id;
+    private final String parentId;
+    private final String text;
+    private final StateToken token;
+    private final String tooltip;
+
+    public FolderItemDescriptor(final String id, final String parentId, final Object icon, final String text,
+            final String tooltip, final ContentStatus contentStatus, final StateToken token, final boolean allowDrag,
+            final boolean allowDrop, final GuiActionDescCollection actionCollection) {
+        this.id = id;
+        this.parentId = parentId;
+        this.icon = icon;
+        this.text = text;
+        this.tooltip = tooltip;
+        this.contentStatus = contentStatus;
+        this.token = token;
+        this.allowDrag = allowDrag;
+        this.allowDrop = allowDrop;
+        this.actionCollection = actionCollection;
+    }
+
+    public GuiActionDescCollection getActionCollection() {
+        return actionCollection;
+    }
+
+    public ContentStatus getContentStatus() {
+        return contentStatus;
+    }
+
+    public Object getIcon() {
+        return icon;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public String getParentId() {
+        return parentId;
+    }
+
+    public StateToken getStateToken() {
+        return token;
+    }
+
+    public String getText() {
+        return text;
+    }
+
+    public String getTooltip() {
+        return tooltip;
+    }
+
+    public boolean isDraggable() {
+        return allowDrag;
+    }
+
+    public boolean isDroppable() {
+        return allowDrop;
+    }
+
+}


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

Added: trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPanel.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -0,0 +1,114 @@
+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) {
+    }
+
+}


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

Added: trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPanel.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPanel.ui.xml	                        (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPanel.ui.xml	2011-04-18 00:41:28 UTC (rev 1315)
@@ -0,0 +1,20 @@
+<!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


Property changes on: trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPanel.ui.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPresenter.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPresenter.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -0,0 +1,178 @@
+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


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

Copied: trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java (from rev 1313, trunk/src/main/java/cc/kune/gspace/client/WsArmor.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -0,0 +1,66 @@
+/*
+ *
+ * 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;
+
+import cc.kune.common.client.actions.ui.IsActionExtensible;
+
+import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
+import com.google.gwt.user.client.ui.SimplePanel;
+
+public interface GSpaceArmor {
+
+    ForIsWidget getDocContainer();
+
+    ForIsWidget getDocFooter();
+
+    ForIsWidget getDocHeader();
+
+    ForIsWidget getDocSubheader();
+
+    ForIsWidget getEntityFooter();
+
+    ForIsWidget getEntityHeader();
+
+    ForIsWidget getEntityToolsCenter();
+
+    ForIsWidget getEntityToolsNorth();
+
+    ForIsWidget getEntityToolsSouth();
+
+    IsActionExtensible getFooterToolbar();
+
+    IsActionExtensible getHeaderToolbar();
+
+    SimplePanel getPublicSpace();
+
+    ForIsWidget getSitebar();
+
+    IsActionExtensible getSubheaderToolbar();
+
+    ForIsWidget getUserSpace();
+
+    void selectGroupSpace();
+
+    void selectHomeSpace();
+
+    void selectPublicSpace();
+
+    void selectUserSpace();
+}
\ No newline at end of file

Copied: trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorEntryPoint.java (from rev 1313, trunk/src/main/java/cc/kune/gspace/client/WsArmorEntryPoint.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorEntryPoint.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorEntryPoint.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -0,0 +1,60 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client;
+
+import cc.kune.gspace.client.resources.WsArmorResources;
+
+import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.InlineLabel;
+import com.google.gwt.user.client.ui.RootLayoutPanel;
+
+ at Deprecated
+public class GSpaceArmorEntryPoint implements EntryPoint {
+    @Override
+    public void onModuleLoad() {
+        final WsArmorResources resources = GWT.create(WsArmorResources.class);
+        resources.style().ensureInjected();
+
+        final RootLayoutPanel rootPanel = RootLayoutPanel.get();
+        final GSpaceArmorImpl armor = new GSpaceArmorImpl(null);
+        final InlineLabel icons = new InlineLabel("Icons");
+        final InlineLabel login = new InlineLabel("Login");
+        final InlineLabel logo = new InlineLabel("Logo");
+        icons.setStyleName(resources.style().floatLeft());
+        login.setStyleName(resources.style().floatRight());
+        logo.setStyleName(resources.style().floatRight());
+        armor.getSitebar().add(icons);
+        armor.getSitebar().add(logo);
+        armor.getSitebar().add(login);
+        armor.getEntityToolsNorth().add(new InlineLabel("Group members"));
+        armor.getEntityToolsCenter().add(new InlineLabel("Documents"));
+        armor.getEntityToolsSouth().add(new InlineLabel("Group tags"));
+        armor.getEntityHeader().add(new InlineLabel("Name of the Initiative"));
+        armor.getDocHeader().add(new InlineLabel("Some doc title"));
+        final InlineLabel editors = new InlineLabel("Editors:");
+        editors.addStyleName(resources.style().docSubheaderLeft());
+        armor.getDocSubheader().add(editors);
+        armor.getDocFooter().add(new InlineLabel("Tags:"));
+        armor.getEntityFooter().add(new InlineLabel("Rate it:"));
+        rootPanel.add(armor);
+    }
+
+}

Copied: trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java (from rev 1313, trunk/src/main/java/cc/kune/gspace/client/WsArmorImpl.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -0,0 +1,200 @@
+/*
+ *
+ * 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;
+
+import cc.kune.common.client.actions.ui.ActionFlowPanel;
+import cc.kune.common.client.actions.ui.IsActionExtensible;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Element;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.DockLayoutPanel;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
+import com.google.gwt.user.client.ui.RootPanel;
+import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.gwt.user.client.ui.SplitLayoutPanel;
+import com.google.gwt.user.client.ui.TabLayoutPanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class GSpaceArmorImpl extends Composite implements GSpaceArmor {
+
+    interface WsArmorImplUiBinder extends UiBinder<Widget, GSpaceArmorImpl> {
+    }
+
+    private static WsArmorImplUiBinder uiBinder = GWT.create(WsArmorImplUiBinder.class);
+
+    @UiField
+    VerticalPanel docContainer;
+    @UiField
+    FlowPanel docFooter;
+    @UiField
+    FlowPanel docHeader;
+    @UiField
+    FlowPanel docSubheader;
+    @UiField
+    FlowPanel entityFooter;
+    @UiField
+    FlowPanel entityHeader;
+    @UiField
+    VerticalPanel entityToolsCenter;
+    @UiField
+    VerticalPanel entityToolsNorth;
+    @UiField
+    VerticalPanel entityToolsSouth;
+    private final ActionFlowPanel footerToolbar;
+    @UiField
+    SplitLayoutPanel groupSpace;
+    private final ActionFlowPanel headerToolbar;
+    @UiField
+    SimplePanel homeSpace;
+    @UiField
+    DockLayoutPanel mainpanel;
+    @UiField
+    SimplePanel publicSpace;
+    @UiField
+    FlowPanel sitebar;
+    @UiField
+    DockLayoutPanel splitCenter;
+    @UiField
+    DockLayoutPanel splitEast;
+    private final ActionFlowPanel subheaderToolbar;
+    @UiField
+    TabLayoutPanel tabs;
+    @UiField
+    FlowPanel userSpace;
+
+    @Inject
+    public GSpaceArmorImpl(final Provider<ActionFlowPanel> toolbarProv) {
+        initWidget(uiBinder.createAndBindUi(this));
+        groupSpace.setWidgetMinSize(splitEast, 150);
+        tabs.setStyleName("k-spaces");
+        homeSpace.add(RootPanel.get("k-home-wrapper"));
+        DOM.setStyleAttribute((Element) groupSpace.getWidgetContainerElement(splitEast), "overflow", "visible");
+        DOM.setStyleAttribute((Element) splitEast.getWidgetContainerElement(entityToolsCenter), "overflow", "visible");
+        footerToolbar = toolbarProv.get();
+        headerToolbar = toolbarProv.get();
+        subheaderToolbar = toolbarProv.get();
+        getDocHeader().add(headerToolbar);
+        getDocSubheader().add(subheaderToolbar);
+        getDocFooter().add(footerToolbar);
+    }
+
+    @Override
+    public ForIsWidget getDocContainer() {
+        return docContainer;
+    }
+
+    @Override
+    public ForIsWidget getDocFooter() {
+        return docFooter;
+    }
+
+    @Override
+    public ForIsWidget getDocHeader() {
+        return docHeader;
+    }
+
+    @Override
+    public ForIsWidget getDocSubheader() {
+        return docSubheader;
+    }
+
+    @Override
+    public ForIsWidget getEntityFooter() {
+        return entityFooter;
+    }
+
+    @Override
+    public ForIsWidget getEntityHeader() {
+        return entityHeader;
+    }
+
+    @Override
+    public ForIsWidget getEntityToolsCenter() {
+        return entityToolsCenter;
+    }
+
+    @Override
+    public ForIsWidget getEntityToolsNorth() {
+        return entityToolsNorth;
+    }
+
+    @Override
+    public ForIsWidget getEntityToolsSouth() {
+        return entityToolsSouth;
+    }
+
+    @Override
+    public IsActionExtensible getFooterToolbar() {
+        return footerToolbar;
+    }
+
+    @Override
+    public IsActionExtensible getHeaderToolbar() {
+        return headerToolbar;
+    }
+
+    @Override
+    public SimplePanel getPublicSpace() {
+        return publicSpace;
+    }
+
+    @Override
+    public ForIsWidget getSitebar() {
+        return sitebar;
+    }
+
+    @Override
+    public IsActionExtensible getSubheaderToolbar() {
+        return subheaderToolbar;
+    }
+
+    @Override
+    public ForIsWidget getUserSpace() {
+        return userSpace;
+    }
+
+    @Override
+    public void selectGroupSpace() {
+        tabs.selectTab(groupSpace);
+    }
+
+    @Override
+    public void selectHomeSpace() {
+        tabs.selectTab(homeSpace);
+    }
+
+    @Override
+    public void selectPublicSpace() {
+        tabs.selectTab(publicSpace);
+    }
+
+    @Override
+    public void selectUserSpace() {
+        tabs.selectTab(userSpace);
+    }
+}

Copied: trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.ui.xml (from rev 1313, trunk/src/main/java/cc/kune/gspace/client/WsArmorImpl.ui.xml)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.ui.xml	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.ui.xml	2011-04-18 00:41:28 UTC (rev 1315)
@@ -0,0 +1,117 @@
+<!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:import:cc.kune.core.client"
+  xmlns:kp="urn:import:cc.kune.pspace.client" xmlns:g="urn:import:com.google.gwt.user.client.ui">
+  <ui:with field='res'
+    type='cc.kune.gspace.client.resources.WsArmorResources' />
+  <ui:style>
+    .frame {
+        border: 0px;
+        margin: 0px;
+    }
+  </ui:style>
+  <g:DockLayoutPanel ui:field="mainpanel" styleName='{res.style.mainPanel}'
+    unit="PX">
+    <g:north size="22">
+      <g:FlowPanel ui:field="sitebar" height="22px"
+        styleName='{res.style.siteBar}'>
+      </g:FlowPanel>
+    </g:north>
+    <g:center>
+      <g:TabLayoutPanel width="100%" height="100%"
+        barUnit='PX' barHeight='0' ui:field="tabs">
+        <g:tab>
+          <g:header size='0' />
+          <g:SimplePanel ui:field="homeSpace" width="100%"
+            height="100%"></g:SimplePanel>
+        </g:tab>
+        <g:tab>
+          <g:header size='0' />
+          <g:FlowPanel ui:field="userSpace" width="100%"
+            height="100%">
+<!--            <g:Frame url="/" styleName="{style.frame}"-->
+<!--              ui:field="frame" width="100%" height="100%" />-->
+          </g:FlowPanel>
+        </g:tab>
+        <g:tab>
+          <g:header size='0' />
+          <g:SplitLayoutPanel width="100%" height="100%"
+            ui:field="groupSpace">
+            <g:center size="1.0">
+              <g:DockLayoutPanel unit="PX" ui:field="splitCenter">
+                <g:north size="168">
+                  <g:VerticalPanel width="100%" height="168px">
+                    <g:FlowPanel height="70px" width="100%"
+                      styleName="{res.style.entityHeader}" ui:field="entityHeader">
+                      <!--<g:RichTextArea width="100%" height="70px" /> -->
+                    </g:FlowPanel>
+                    <g:FlowPanel width="100%" height="38px"
+                      styleName="{res.style.docHeader}" ui:field="docHeader">
+                    </g:FlowPanel>
+                    <g:FlowPanel width="100%" height="60px"
+                      styleName="{res.style.docSubheader}" ui:field="docSubheader">
+                        <g:HTMLPanel ui:field="arrow" styleName="{res.style.docSubheaderArrow}" />
+                    </g:FlowPanel>
+                  </g:VerticalPanel>
+                </g:north>
+                <g:center>
+                  <g:DockLayoutPanel unit="PX"
+                    styleName="{res.style.docEditorMargin}">
+                    <g:west size="10">
+                      <g:SimplePanel />
+                    </g:west>
+                    <g:east size="15">
+                      <g:SimplePanel />
+                    </g:east>
+                    <g:center>
+                      <g:ScrollPanel styleName="{res.style.docEditor}">
+                        <g:VerticalPanel width="100%"
+                          height="100%" ui:field="docContainer"></g:VerticalPanel>
+                      </g:ScrollPanel>
+                    </g:center>
+                    <g:south size="33.0">
+                      <g:VerticalPanel height="33px"
+                        width="100%" styleName="{res.style.docFooter}">
+                        <g:FlowPanel width="100%" height="33"
+                          ui:field="docFooter">
+                        </g:FlowPanel>
+                      </g:VerticalPanel>
+                    </g:south>
+                  </g:DockLayoutPanel>
+                </g:center>
+                <g:south size="36">
+                  <g:FlowPanel height="36px" width="100%"
+                    styleName="{res.style.entityFooter}" ui:field="entityFooter">
+                  </g:FlowPanel>
+                </g:south>
+              </g:DockLayoutPanel>
+            </g:center>
+            <g:west size="200.0">
+              <g:DockLayoutPanel unit="PX"
+                styleName="{res.style.entityTools}" ui:field="splitEast">
+                <g:north size="305">
+                  <g:VerticalPanel width="100%"
+                    ui:field="entityToolsNorth" styleName="{res.style.entityToolsNorth}"></g:VerticalPanel>
+                </g:north>
+                <g:center>
+                  <g:VerticalPanel width="100%"
+                    ui:field="entityToolsCenter" styleName="{res.style.entityToolsCenter}">
+                  </g:VerticalPanel>
+                </g:center>
+                <g:south size="98">
+                  <g:VerticalPanel width="100%"
+                    styleName="{res.style.entityToolsSouth}" ui:field="entityToolsSouth"></g:VerticalPanel>
+                </g:south>
+              </g:DockLayoutPanel>
+            </g:west>
+          </g:SplitLayoutPanel>
+        </g:tab>
+        <g:tab>
+          <g:header size='0' />
+          <g:SimplePanel ui:field="publicSpace" width="100%"
+            height="100%"></g:SimplePanel>
+        </g:tab>
+      </g:TabLayoutPanel>
+    </g:center>
+  </g:DockLayoutPanel>
+</ui:UiBinder>
\ No newline at end of file

Deleted: trunk/src/main/java/cc/kune/gspace/client/WsArmor.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/WsArmor.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/gspace/client/WsArmor.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -1,58 +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.gspace.client;
-
-import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
-import com.google.gwt.user.client.ui.SimplePanel;
-
-public interface WsArmor {
-
-    ForIsWidget getDocContainer();
-
-    ForIsWidget getDocFooter();
-
-    ForIsWidget getDocHeader();
-
-    ForIsWidget getDocSubheader();
-
-    ForIsWidget getEntityFooter();
-
-    ForIsWidget getEntityHeader();
-
-    ForIsWidget getEntityToolsCenter();
-
-    ForIsWidget getEntityToolsNorth();
-
-    ForIsWidget getEntityToolsSouth();
-
-    SimplePanel getPublicSpace();
-
-    ForIsWidget getSitebar();
-
-    ForIsWidget getUserSpace();
-
-    void selectGroupSpace();
-
-    void selectHomeSpace();
-
-    void selectPublicSpace();
-
-    void selectUserSpace();
-}
\ No newline at end of file

Deleted: trunk/src/main/java/cc/kune/gspace/client/WsArmorEntryPoint.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/WsArmorEntryPoint.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/gspace/client/WsArmorEntryPoint.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -1,61 +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.gspace.client;
-
-import cc.kune.gspace.client.resources.WsArmorResources;
-
-import com.google.gwt.core.client.EntryPoint;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.user.client.ui.InlineLabel;
-import com.google.gwt.user.client.ui.RootLayoutPanel;
-
- at Deprecated
-public class WsArmorEntryPoint implements EntryPoint {
-    @Override
-    public void onModuleLoad() {
-        final WsArmorResources resources = GWT.create(WsArmorResources.class);
-        resources.style().ensureInjected();
-
-        final RootLayoutPanel rootPanel = RootLayoutPanel.get();
-        final WsArmorImpl armor = new WsArmorImpl();
-        final InlineLabel icons = new InlineLabel("Icons");
-        final InlineLabel login = new InlineLabel("Login");
-        final InlineLabel logo = new InlineLabel("Logo");
-        icons.setStyleName(resources.style().floatLeft());
-        login.setStyleName(resources.style().floatRight());
-        logo.setStyleName(resources.style().floatRight());
-        armor.getSitebar().add(icons);
-        armor.getSitebar().add(logo);
-        armor.getSitebar().add(login);
-        armor.getEntityToolsNorth().add(new InlineLabel("Group members"));
-        armor.getEntityToolsCenter().add(new InlineLabel("Documents"));
-        armor.getEntityToolsSouth().add(new InlineLabel("Group tags"));
-        armor.getEntityHeader().add(new InlineLabel("Name of the Initiative"));
-        armor.getDocHeader().add(new InlineLabel("Some doc title"));
-        final InlineLabel editors = new InlineLabel("Editors:");
-        editors.addStyleName(resources.style().docSubheaderLeft());
-        armor.getDocSubheader().add(editors);
-        armor.getDocFooter().add(new InlineLabel("Tags:"));
-        armor.getEntityFooter().add(new InlineLabel("Rate it:"));
-        rootPanel.add(armor);
-
-    }
-
-}

Deleted: trunk/src/main/java/cc/kune/gspace/client/WsArmorImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/WsArmorImpl.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/gspace/client/WsArmorImpl.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -1,179 +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.gspace.client;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.uibinder.client.UiBinder;
-import com.google.gwt.uibinder.client.UiField;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.DockLayoutPanel;
-import com.google.gwt.user.client.ui.FlowPanel;
-import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
-import com.google.gwt.user.client.ui.RootPanel;
-import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.gwt.user.client.ui.SplitLayoutPanel;
-import com.google.gwt.user.client.ui.TabLayoutPanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-public class WsArmorImpl extends Composite implements WsArmor {
-
-    interface WsArmorImplUiBinder extends UiBinder<Widget, WsArmorImpl> {
-    }
-
-    private static WsArmorImplUiBinder uiBinder = GWT.create(WsArmorImplUiBinder.class);
-
-    @UiField
-    VerticalPanel docContainer;
-    @UiField
-    FlowPanel docFooter;
-    @UiField
-    FlowPanel docHeader;
-    @UiField
-    FlowPanel docSubheader;
-    @UiField
-    FlowPanel entityFooter;
-    @UiField
-    FlowPanel entityHeader;
-    @UiField
-    VerticalPanel entityToolsCenter;
-    @UiField
-    VerticalPanel entityToolsNorth;
-    @UiField
-    VerticalPanel entityToolsSouth;
-    @UiField
-    SplitLayoutPanel groupSpace;
-    @UiField
-    SimplePanel homeSpace;
-    @UiField
-    DockLayoutPanel mainpanel;
-    @UiField
-    SimplePanel publicSpace;
-    @UiField
-    FlowPanel sitebar;
-    @UiField
-    DockLayoutPanel splitCenter;
-    @UiField
-    DockLayoutPanel splitEast;
-    @UiField
-    TabLayoutPanel tabs;
-    @UiField
-    FlowPanel userSpace;
-
-    public WsArmorImpl() {
-        initWidget(uiBinder.createAndBindUi(this));
-        groupSpace.setWidgetMinSize(splitEast, 150);
-        tabs.setStyleName("k-spaces");
-        homeSpace.add(RootPanel.get("k-home-wrapper"));
-        // mainpanel.getWidgetContainerElement(splitEast).setAttribute("overflow",
-        // "visible");
-        // splitEast.getWidgetContainerElement(entityToolsCenter).setPropertyString("overflow",
-        // "visible !important");
-        // entityToolsCenter.getParent().setStyleName("k-nooverflow");
-        // groupSpace.getWidgetContainerElement(splitEast).setPropertyString("overflow",
-        // "visible !important");
-
-        DOM.setStyleAttribute((Element) groupSpace.getWidgetContainerElement(splitEast), "overflow", "visible");
-        DOM.setStyleAttribute((Element) splitEast.getWidgetContainerElement(entityToolsCenter), "overflow", "visible");
-
-    }
-
-    @Override
-    public ForIsWidget getDocContainer() {
-        return docContainer;
-    }
-
-    @Override
-    public ForIsWidget getDocFooter() {
-        return docFooter;
-    }
-
-    @Override
-    public ForIsWidget getDocHeader() {
-        return docHeader;
-    }
-
-    @Override
-    public ForIsWidget getDocSubheader() {
-        return docSubheader;
-    }
-
-    @Override
-    public ForIsWidget getEntityFooter() {
-        return entityFooter;
-    }
-
-    @Override
-    public ForIsWidget getEntityHeader() {
-        return entityHeader;
-    }
-
-    @Override
-    public ForIsWidget getEntityToolsCenter() {
-        return entityToolsCenter;
-    }
-
-    @Override
-    public ForIsWidget getEntityToolsNorth() {
-        return entityToolsNorth;
-    }
-
-    @Override
-    public ForIsWidget getEntityToolsSouth() {
-        return entityToolsSouth;
-    }
-
-    @Override
-    public SimplePanel getPublicSpace() {
-        return publicSpace;
-    }
-
-    @Override
-    public ForIsWidget getSitebar() {
-        return sitebar;
-    }
-
-    @Override
-    public ForIsWidget getUserSpace() {
-        return userSpace;
-    }
-
-    @Override
-    public void selectGroupSpace() {
-        tabs.selectTab(groupSpace);
-    }
-
-    @Override
-    public void selectHomeSpace() {
-        tabs.selectTab(homeSpace);
-    }
-
-    @Override
-    public void selectPublicSpace() {
-        tabs.selectTab(publicSpace);
-    }
-
-    @Override
-    public void selectUserSpace() {
-        tabs.selectTab(userSpace);
-    }
-}

Deleted: trunk/src/main/java/cc/kune/gspace/client/WsArmorImpl.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/WsArmorImpl.ui.xml	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/gspace/client/WsArmorImpl.ui.xml	2011-04-18 00:41:28 UTC (rev 1315)
@@ -1,116 +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:kp="urn:import:cc.kune.pspace.client" xmlns:g="urn:import:com.google.gwt.user.client.ui">
-  <ui:with field='res'
-    type='cc.kune.gspace.client.resources.WsArmorResources' />
-  <ui:style>
-    .frame {
-        border: 0px;
-        margin: 0px;
-    }
-  </ui:style>
-  <g:DockLayoutPanel ui:field="mainpanel" styleName='{res.style.mainPanel}'
-    unit="PX">
-    <g:north size="22">
-      <g:FlowPanel ui:field="sitebar" height="22px"
-        styleName='{res.style.siteBar}'>
-      </g:FlowPanel>
-    </g:north>
-    <g:center>
-      <g:TabLayoutPanel width="100%" height="100%"
-        barUnit='PX' barHeight='0' ui:field="tabs">
-        <g:tab>
-          <g:header size='0' />
-          <g:SimplePanel ui:field="homeSpace" width="100%"
-            height="100%"></g:SimplePanel>
-        </g:tab>
-        <g:tab>
-          <g:header size='0' />
-          <g:FlowPanel ui:field="userSpace" width="100%"
-            height="100%">
-<!--            <g:Frame url="/" styleName="{style.frame}"-->
-<!--              ui:field="frame" width="100%" height="100%" />-->
-          </g:FlowPanel>
-        </g:tab>
-        <g:tab>
-          <g:header size='0' />
-          <g:SplitLayoutPanel width="100%" height="100%"
-            ui:field="groupSpace">
-            <g:center size="1.0">
-              <g:DockLayoutPanel unit="PX" ui:field="splitCenter">
-                <g:north size="168">
-                  <g:VerticalPanel width="100%" height="168px">
-                    <g:FlowPanel height="70px" width="100%"
-                      styleName="{res.style.entityHeader}" ui:field="entityHeader">
-                      <!--<g:RichTextArea width="100%" height="70px" /> -->
-                    </g:FlowPanel>
-                    <g:FlowPanel width="100%" height="38px"
-                      styleName="{res.style.docHeader}" ui:field="docHeader">
-                    </g:FlowPanel>
-                    <g:FlowPanel width="100%" height="60px"
-                      styleName="{res.style.docSubheader}" ui:field="docSubheader">
-                        <g:HTMLPanel ui:field="arrow" styleName="{res.style.docSubheaderArrow}" />
-                    </g:FlowPanel>
-                  </g:VerticalPanel>
-                </g:north>
-                <g:center>
-                  <g:DockLayoutPanel unit="PX"
-                    styleName="{res.style.docEditorMargin}">
-                    <g:west size="10">
-                      <g:SimplePanel />
-                    </g:west>
-                    <g:east size="15">
-                      <g:SimplePanel />
-                    </g:east>
-                    <g:center>
-                      <g:ScrollPanel styleName="{res.style.docEditor}">
-                        <g:VerticalPanel width="100%"
-                          height="100%" ui:field="docContainer"></g:VerticalPanel>
-                      </g:ScrollPanel>
-                    </g:center>
-                    <g:south size="33.0">
-                      <g:VerticalPanel height="33px"
-                        width="100%" styleName="{res.style.docFooter}">
-                        <g:FlowPanel width="100%" height="33"
-                          ui:field="docFooter">
-                        </g:FlowPanel>
-                      </g:VerticalPanel>
-                    </g:south>
-                  </g:DockLayoutPanel>
-                </g:center>
-                <g:south size="36">
-                  <g:FlowPanel height="36px" width="100%"
-                    styleName="{res.style.entityFooter}" ui:field="entityFooter">
-                  </g:FlowPanel>
-                </g:south>
-              </g:DockLayoutPanel>
-            </g:center>
-            <g:west size="200.0">
-              <g:DockLayoutPanel unit="PX"
-                styleName="{res.style.entityTools}" ui:field="splitEast">
-                <g:north size="305">
-                  <g:VerticalPanel width="100%"
-                    ui:field="entityToolsNorth" styleName="{res.style.entityToolsNorth}"></g:VerticalPanel>
-                </g:north>
-                <g:center>
-                  <g:VerticalPanel width="100%"
-                    ui:field="entityToolsCenter" styleName="{res.style.entityToolsCenter}">
-                  </g:VerticalPanel>
-                </g:center>
-                <g:south size="98">
-                  <g:VerticalPanel width="100%"
-                    styleName="{res.style.entityToolsSouth}" ui:field="entityToolsSouth"></g:VerticalPanel>
-                </g:south>
-              </g:DockLayoutPanel>
-            </g:west>
-          </g:SplitLayoutPanel>
-        </g:tab>
-        <g:tab>
-          <g:header size='0' />
-          <g:SimplePanel ui:field="publicSpace" width="100%"
-            height="100%"></g:SimplePanel>
-        </g:tab>
-      </g:TabLayoutPanel>
-    </g:center>
-  </g:DockLayoutPanel>
-</ui:UiBinder>
\ No newline at end of file

Added: trunk/src/main/java/cc/kune/gspace/client/actions/perspective/MenuPerspective.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/perspective/MenuPerspective.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/perspective/MenuPerspective.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -0,0 +1,7 @@
+package cc.kune.gspace.client.actions.perspective;
+
+/**
+ * An action that must be showed in menu of docs/folder, etc
+ */
+public interface MenuPerspective extends ActionPerspective {
+}


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

Modified: trunk/src/main/java/cc/kune/gspace/client/tags/TagsSummaryPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tags/TagsSummaryPanel.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/gspace/client/tags/TagsSummaryPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -20,7 +20,7 @@
 package cc.kune.gspace.client.tags;
 
 import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 import cc.kune.gspace.client.tags.TagsSummaryPresenter.TagsSummaryView;
 
 import com.google.gwt.event.dom.client.ClickHandler;
@@ -37,7 +37,7 @@
     private FlowPanel mainPanel;
 
     @Inject
-    public TagsSummaryPanel(final I18nTranslationService i18n, final WsArmor ws) {
+    public TagsSummaryPanel(final I18nTranslationService i18n, final GSpaceArmor ws) {
         this.i18n = i18n;
         mainPanel = new FlowPanel();
         flowPanel = new FlowPanel();

Modified: trunk/src/main/java/cc/kune/gspace/client/tool/ContentViewerSelector.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/ContentViewerSelector.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/ContentViewerSelector.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -6,8 +6,8 @@
 
 import javax.annotation.Nonnull;
 
-import cc.kune.common.client.errors.UIException;
 import cc.kune.common.client.log.Log;
+import cc.kune.common.client.notify.NotifyUser;
 import cc.kune.core.client.init.AppStartEvent;
 import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
 import cc.kune.core.client.state.Session;
@@ -57,24 +57,26 @@
         });
     }
 
+    public void register(@Nonnull final ContentViewer view, final boolean isDefault, @Nonnull final String... typeIds) {
+        for (final String typeId : typeIds) {
+            List<ContentViewer> list = viewsRegister.get(typeId);
+            if (list == null) {
+                list = new ArrayList<ContentViewer>();
+            }
+            if (!list.contains(view)) {
+                list.add(view);
+            }
+            if (isDefault) {
+                defViewsRegister.put(typeId, view);
+            }
+        }
+    }
+
     public void register(final String typeId, final ContentViewer view) {
         Log.info("Registered " + typeId + " with class " + ContentViewer.class);
-        register(typeId, view, false);
+        register(view, false, typeId);
     }
 
-    public void register(@Nonnull final String typeId, @Nonnull final ContentViewer view, final boolean isDefault) {
-        List<ContentViewer> list = viewsRegister.get(typeId);
-        if (list == null) {
-            list = new ArrayList<ContentViewer>();
-        }
-        if (!list.contains(view)) {
-            list.add(view);
-        }
-        if (isDefault) {
-            defViewsRegister.put(typeId, view);
-        }
-    }
-
     private void setContent(final ContentViewer view, final HasContent state) {
         view.setContent(state);
         view.attach();
@@ -89,7 +91,7 @@
             if (viewsList != null && !viewsList.isEmpty()) {
                 setContent(viewsList.get(0), state);
             } else {
-                throw new UIException("Unsupported typeId: " + typeId);
+                NotifyUser.error("Unsupported typeId: " + typeId);
             }
         } else {
             setContent(defView, state);

Modified: trunk/src/main/java/cc/kune/gspace/client/tool/old/FoldableAbstractClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/old/FoldableAbstractClientTool.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/old/FoldableAbstractClientTool.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -19,7 +19,6 @@
  */
 package cc.kune.gspace.client.tool.old;
 
-
 import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
 import cc.kune.core.shared.dto.BasicMimeTypeDTO;
 import cc.kune.gspace.client.tool.selector.ToolSelector;
@@ -52,8 +51,8 @@
         contentCapabilitiesRegistry.getIconsRegistry().registerContentTypeIcon(typeId, mimeType, iconUrl);
     }
 
-    public void registerContentTypeIcon(final String contentTypeId, final String iconUrl) {
-        contentCapabilitiesRegistry.getIconsRegistry().registerContentTypeIcon(contentTypeId, iconUrl);
+    public void registerContentTypeIcon(final String contentTypeId, final Object icon) {
+        contentCapabilitiesRegistry.getIconsRegistry().registerContentTypeIcon(contentTypeId, icon);
     }
 
     protected void registerDragableTypes(final String... typeIds) {

Modified: trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPanel.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -1,6 +1,6 @@
 package cc.kune.gspace.client.tool.selector;
 
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 import cc.kune.gspace.client.tool.selector.ToolSelectorItemPresenter.ToolSelectorItemView;
 import cc.kune.gspace.client.tool.selector.ToolSelectorPresenter.ToolSelectorView;
 
@@ -23,7 +23,7 @@
     FlowPanel flow;
 
     @Inject
-    public ToolSelectorPanel(final WsArmor wsArmor) {
+    public ToolSelectorPanel(final GSpaceArmor wsArmor) {
         wsArmor.getEntityToolsCenter().add(uiBinder.createAndBindUi(this));
     }
 

Modified: trunk/src/main/java/cc/kune/gspace/client/ui/footer/license/EntityLicensePanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/ui/footer/license/EntityLicensePanel.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/gspace/client/ui/footer/license/EntityLicensePanel.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -23,7 +23,7 @@
 import cc.kune.common.client.ui.KuneWindowUtils;
 import cc.kune.core.shared.dto.LicenseDTO;
 import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 import cc.kune.gspace.client.ui.footer.license.EntityLicensePresenter.EntityLicenseView;
 
 import com.google.gwt.event.dom.client.HasClickHandlers;
@@ -41,7 +41,7 @@
     private final Tooltip tooltip;
 
     @Inject
-    public EntityLicensePanel(final I18nTranslationService i18n, final WsArmor armor) {
+    public EntityLicensePanel(final I18nTranslationService i18n, final GSpaceArmor armor) {
         this.i18n = i18n;
         licenseImage = new Image();
 

Modified: trunk/src/main/java/cc/kune/pspace/client/PSpacePanel.java
===================================================================
--- trunk/src/main/java/cc/kune/pspace/client/PSpacePanel.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/pspace/client/PSpacePanel.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -23,7 +23,7 @@
 import cc.kune.common.client.actions.ui.IsActionExtensible;
 import cc.kune.common.client.actions.ui.bind.GuiProvider;
 import cc.kune.core.client.resources.CoreResources;
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 import cc.kune.pspace.client.PSpacePresenter.PSpaceView;
 
 import com.google.gwt.core.client.GWT;
@@ -65,7 +65,7 @@
     private final Widget widget;
 
     @Inject
-    public PSpacePanel(final GuiProvider guiProvider, final CoreResources res, final WsArmor wsArmor) {
+    public PSpacePanel(final GuiProvider guiProvider, final CoreResources res, final GSpaceArmor wsArmor) {
         widget = uiBinder.createAndBindUi(this);
         actionPanel = new ActionFlowPanel(guiProvider);
         actionPanelContainer.add(actionPanel);

Modified: trunk/src/main/java/cc/kune/wave/client/WaveClientManager.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WaveClientManager.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/cc/kune/wave/client/WaveClientManager.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -9,7 +9,7 @@
 import cc.kune.core.client.state.UserSignOutEvent;
 import cc.kune.core.client.state.UserSignOutEvent.UserSignOutHandler;
 import cc.kune.core.shared.dto.WaveClientParams;
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 
 import com.google.gwt.core.client.JavaScriptObject;
 import com.google.gwt.core.client.JsonUtils;
@@ -22,7 +22,7 @@
 
     @Inject
     public WaveClientManager(final Session session, final StateManager stateManager, final EventBus eventBus,
-            final UserServiceAsync userService, final WsArmor wsArmor) {
+            final UserServiceAsync userService, final GSpaceArmor wsArmor) {
         session.onUserSignIn(true, new UserSignInHandler() {
             @Override
             public void onUserSignIn(final UserSignInEvent event) {

Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPanel.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -22,7 +22,7 @@
 import cc.kune.core.client.cnt.FoldableContentPanel;
 import cc.kune.core.client.resources.CoreResources;
 import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 import cc.kune.wave.client.WaveClientManager;
 
 import com.google.inject.Inject;
@@ -30,7 +30,7 @@
 public class BlogFolderContentPanel extends FoldableContentPanel implements BlogFolderContentView {
 
     @Inject
-    public BlogFolderContentPanel(final WsArmor ws, final I18nTranslationService i18n, final CoreResources res,
+    public BlogFolderContentPanel(final GSpaceArmor ws, final I18nTranslationService i18n, final CoreResources res,
             final WaveClientManager waveClientManager) {
         super(ws, i18n, res, waveClientManager);
     }

Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPanel.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -22,14 +22,14 @@
 import cc.kune.core.client.cnt.FoldableContentPanel;
 import cc.kune.core.client.resources.CoreResources;
 import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 import cc.kune.wave.client.WaveClientManager;
 
 import com.google.inject.Inject;
 
 public class BlogViewerPanel extends FoldableContentPanel implements BlogViewerView {
     @Inject
-    public BlogViewerPanel(final WsArmor ws, final I18nTranslationService i18n, final CoreResources res,
+    public BlogViewerPanel(final GSpaceArmor ws, final I18nTranslationService i18n, final CoreResources res,
             final WaveClientManager waveClientManager) {
         super(ws, i18n, res, waveClientManager);
     }

Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPanel.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -22,7 +22,7 @@
 import cc.kune.core.client.cnt.FoldableContentPanel;
 import cc.kune.core.client.resources.CoreResources;
 import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 import cc.kune.wave.client.WaveClientManager;
 
 import com.google.inject.Inject;
@@ -30,7 +30,7 @@
 public class ChatRoomPanel extends FoldableContentPanel implements ChatRoomView {
 
     @Inject
-    public ChatRoomPanel(final WsArmor ws, final I18nTranslationService i18n, final CoreResources res,
+    public ChatRoomPanel(final GSpaceArmor ws, final I18nTranslationService i18n, final CoreResources res,
             final WaveClientManager waveClientManager) {
         super(ws, i18n, res, waveClientManager);
     }

Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryFolderContentPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryFolderContentPanel.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryFolderContentPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -26,7 +26,7 @@
 import cc.kune.core.client.state.StateManager;
 import cc.kune.core.shared.domain.utils.StateToken;
 import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 import cc.kune.wave.client.WaveClientManager;
 
 import com.google.gwt.core.client.Scheduler;
@@ -44,7 +44,7 @@
     private final StateManager stateManager;
 
     @Inject
-    public GalleryFolderContentPanel(final WsArmor ws, final I18nTranslationService i18n, final CoreResources res,
+    public GalleryFolderContentPanel(final GSpaceArmor ws, final I18nTranslationService i18n, final CoreResources res,
             final StateManager stateManager, final Session session, final WaveClientManager waveClientManager) {
         super(ws, i18n, res, waveClientManager);
         this.stateManager = stateManager;

Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPanel.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -22,7 +22,7 @@
 import cc.kune.core.client.cnt.FoldableContentPanel;
 import cc.kune.core.client.resources.CoreResources;
 import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 import cc.kune.wave.client.WaveClientManager;
 
 import com.google.inject.Inject;
@@ -30,7 +30,7 @@
 public class GalleryViewerPanel extends FoldableContentPanel implements GalleryViewerView {
 
     @Inject
-    public GalleryViewerPanel(final WsArmor ws, final I18nTranslationService i18n, final CoreResources res,
+    public GalleryViewerPanel(final GSpaceArmor ws, final I18nTranslationService i18n, final CoreResources res,
             final WaveClientManager waveClientManager) {
         super(ws, i18n, res, waveClientManager);
     }

Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiFolderContentPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiFolderContentPanel.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiFolderContentPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -22,7 +22,7 @@
 import cc.kune.core.client.cnt.FoldableContentPanel;
 import cc.kune.core.client.resources.CoreResources;
 import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 import cc.kune.wave.client.WaveClientManager;
 
 import com.google.inject.Inject;
@@ -30,7 +30,7 @@
 public class WikiFolderContentPanel extends FoldableContentPanel implements WikiFolderContentView {
 
     @Inject
-    public WikiFolderContentPanel(final WsArmor ws, final I18nTranslationService i18n, final CoreResources res,
+    public WikiFolderContentPanel(final GSpaceArmor ws, final I18nTranslationService i18n, final CoreResources res,
             final WaveClientManager waveClientManager) {
         super(ws, i18n, res, waveClientManager);
         super.setLabel("");

Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPanel.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -22,14 +22,14 @@
 import cc.kune.core.client.cnt.FoldableContentPanel;
 import cc.kune.core.client.resources.CoreResources;
 import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.GSpaceArmor;
 import cc.kune.wave.client.WaveClientManager;
 
 import com.google.inject.Inject;
 
 public class WikiViewerPanel extends FoldableContentPanel implements WikiViewerView {
     @Inject
-    public WikiViewerPanel(final WsArmor ws, final I18nTranslationService i18n, final CoreResources res,
+    public WikiViewerPanel(final GSpaceArmor ws, final I18nTranslationService i18n, final CoreResources res,
             final WaveClientManager waveClientManager) {
         super(ws, i18n, res, waveClientManager);
     }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/RegistryModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/RegistryModule.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/RegistryModule.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -29,8 +29,6 @@
 import cc.kune.core.client.registry.AuthorableRegistry;
 import cc.kune.core.client.registry.CanBeHomepageRegistry;
 import cc.kune.core.client.registry.ComentableRegistry;
-import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
-import cc.kune.core.client.registry.ContentIconsRegistry;
 import cc.kune.core.client.registry.DragableRegistry;
 import cc.kune.core.client.registry.DropableRegistry;
 import cc.kune.core.client.registry.EmailSubscribeAbleRegistry;
@@ -162,25 +160,33 @@
             }
         });
 
-        register(Singleton.class, new Factory<ContentIconsRegistry>(ContentIconsRegistry.class) {
-            @Override
-            public ContentIconsRegistry create() {
-                return new ContentIconsRegistry();
-            }
-        });
+        // register(Singleton.class, new
+        // Factory<IconsRegistry>(IconsRegistry.class) {
+        // @Override
+        // public IconsRegistry create() {
+        // return new IconsRegistry();
+        // }
+        // });
 
-        register(Singleton.class, new Factory<ContentCapabilitiesRegistry>(ContentCapabilitiesRegistry.class) {
-            @Override
-            public ContentCapabilitiesRegistry create() {
-                return new ContentCapabilitiesRegistry(i(AuthorableRegistry.class), i(AclEditableRegistry.class),
-                        i(ContentIconsRegistry.class), i(CanBeHomepageRegistry.class), i(ComentableRegistry.class),
-                        i(DragableRegistry.class), i(DropableRegistry.class), i(EmailSubscribeAbleRegistry.class),
-                        i(LicensableRegistry.class), i(PublishModerableRegistry.class), i(RateableRegistry.class),
-                        i(TageableRegistry.class), i(RenamableRegistry.class), i(TranslatableRegistry.class),
-                        i(VersionableRegistry.class), i(XmppComentableRegistry.class),
-                        i(XmppNotifyCapableRegistry.class));
-            }
-        });
+        // register(Singleton.class, new
+        // Factory<ContentCapabilitiesRegistry>(ContentCapabilitiesRegistry.class)
+        // {
+        // @Override
+        // public ContentCapabilitiesRegistry create() {
+        // return new ContentCapabilitiesRegistry(i(AuthorableRegistry.class),
+        // i(AclEditableRegistry.class),
+        // i(OldIconsRegistry.class), i(CanBeHomepageRegistry.class),
+        // i(ComentableRegistry.class),
+        // i(DragableRegistry.class), i(DropableRegistry.class),
+        // i(EmailSubscribeAbleRegistry.class),
+        // i(LicensableRegistry.class), i(PublishModerableRegistry.class),
+        // i(RateableRegistry.class),
+        // i(TageableRegistry.class), i(RenamableRegistry.class),
+        // i(TranslatableRegistry.class),
+        // i(VersionableRegistry.class), i(XmppComentableRegistry.class),
+        // i(XmppNotifyCapableRegistry.class));
+        // }
+        // });
 
         register(Singleton.class, new Factory<ContextActionRegistry>(ContextActionRegistry.class) {
             @Override

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -19,7 +19,7 @@
  */
 package org.ourproject.kune.workspace.client.ctxnav;
 
-import static cc.kune.docs.client.DocumentClientTool.TYPE_FOLDER;
+import static cc.kune.docs.client.DocsClientTool.TYPE_FOLDER;
 
 import java.util.HashMap;
 
@@ -33,7 +33,7 @@
 import org.ourproject.kune.workspace.client.upload.FileUploader;
 
 import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
-import cc.kune.core.client.registry.ContentIconsRegistry;
+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;
@@ -58,23 +58,23 @@
 
 public class ContextNavigatorPresenter implements ContextNavigator {
 
-    private ContextNavigatorView view;
-    private final StateManager stateManager;
-    private final Session session;
-    private final I18nTranslationService i18n;
+    private final ActionRegistry<StateToken> actionRegistry;
     private final HashMap<StateToken, ActionItemCollection<StateToken>> actionsByItem;
+    private final ActionContextBottomToolbar bottomToolbar;
+    private final ContentCapabilitiesRegistry capabilitiesRegistry;
+    private final IconsRegistry contentIconsRegistry;
+    private final Provider<FileDownloadUtils> downloadUtilsProvider;
     private boolean editOnNextStateChange;
-    private final ContentIconsRegistry contentIconsRegistry;
-    private final ActionRegistry<StateToken> actionRegistry;
+    private final I18nTranslationService i18n;
+    private final RenameAction renameAction;
+    private final Session session;
+    private final StateManager stateManager;
     private final ActionToolbar<StateToken> topToolbar;
-    private final Provider<FileDownloadUtils> downloadUtilsProvider;
     private final boolean useGenericImageIcon;
-    private final ContentCapabilitiesRegistry capabilitiesRegistry;
-    private final RenameAction renameAction;
-    private final ActionContextBottomToolbar bottomToolbar;
+    private ContextNavigatorView view;
 
     public ContextNavigatorPresenter(final StateManager stateManager, final Session session,
-            final I18nTranslationService i18n, final ContentIconsRegistry contentIconsRegistry,
+            final I18nTranslationService i18n, final IconsRegistry contentIconsRegistry,
             final ContentCapabilitiesRegistry capabilitiesRegistry, final ActionToolbar<StateToken> toolbar,
             final ActionContextBottomToolbar bottomToolbar, final ActionRegistry<StateToken> actionRegistry,
             final Provider<FileDownloadUtils> downloadUtilsProvider, final boolean useGenericImageIcon,
@@ -107,87 +107,6 @@
         });
     }
 
-    @Override
-    public void attach() {
-        // FIXME At the moment detach (removeFromParent) destroy the gwt-ext
-        // TreePanel and the widget must be recreated (cannot be attached again
-        // like in gwt)
-        topToolbar.attach();
-        bottomToolbar.attach();
-    }
-
-    @Override
-    public void clear() {
-        topToolbar.clear();
-        bottomToolbar.clear();
-        view.clear();
-        actionsByItem.clear();
-    }
-
-    @Override
-    public void detach() {
-        view.detach();
-        topToolbar.detach();
-        bottomToolbar.detach();
-    }
-
-    @Override
-    public void editItem(final StateToken stateToken) {
-        view.editItem(genId(stateToken));
-    }
-
-    public void init(final ContextNavigatorView view) {
-        this.view = view;
-        addListeners();
-    }
-
-    @Override
-    public boolean isSelected(final StateToken stateToken) {
-        return view.isSelected(genId(stateToken));
-    }
-
-    @Override
-    public void refreshState() {
-        final StateAbstractDTO currentState = session.getCurrentState();
-        if (currentState instanceof StateContainerDTO) {
-            setState((StateContainerDTO) currentState, true);
-        }
-    }
-
-    @Override
-    public void selectItem(final StateToken stateToken) {
-        view.selectItem(genId(stateToken));
-        topToolbar.disableMenusAndClearButtons();
-        bottomToolbar.disableMenusAndClearButtons();
-        final ActionItemCollection<StateToken> itemCollection = actionsByItem.get(stateToken);
-        topToolbar.addActions(itemCollection, OldAbstractFoldableContentActions.CONTEXT_TOPBAR);
-        bottomToolbar.addActions(itemCollection, OldAbstractFoldableContentActions.CONTEXT_BOTTOMBAR);
-    }
-
-    @Override
-    public void setEditOnNextStateChange(final boolean edit) {
-        editOnNextStateChange = edit;
-    }
-
-    @Override
-    public void setItemStatus(final StateToken stateToken, final ContentStatus status) {
-        clear();
-        refreshState();
-    }
-
-    @Override
-    public void setState(final StateContainerDTO state, final boolean select) {
-        setStateContainer(state, select);
-    }
-
-    protected void gotoToken(final String token) {
-        stateManager.gotoHistoryToken(token);
-    }
-
-    protected void onItemRename(final String token, final String newName, final String oldName) {
-        renameAction.rename(new StateToken(token), oldName, newName);
-    }
-
     private ActionItemCollection<StateToken> 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) {
@@ -241,6 +160,23 @@
         renameAction.onFail(onFail);
     }
 
+    @Override
+    public void attach() {
+        // FIXME At the moment detach (removeFromParent) destroy the gwt-ext
+        // TreePanel and the widget must be recreated (cannot be attached again
+        // like in gwt)
+        topToolbar.attach();
+        bottomToolbar.attach();
+    }
+
+    @Override
+    public void clear() {
+        topToolbar.clear();
+        bottomToolbar.clear();
+        view.clear();
+        actionsByItem.clear();
+    }
+
     private void createChildItems(final ContainerDTO container, final AccessRights containerRights) {
         for (final ContainerSimpleDTO siblingFolder : container.getChilds()) {
             addItem(siblingFolder.getName(), siblingFolder.getTypeId(), null, ContentStatus.publishedOnline,
@@ -269,6 +205,18 @@
         }
     }
 
+    @Override
+    public void detach() {
+        view.detach();
+        topToolbar.detach();
+        bottomToolbar.detach();
+    }
+
+    @Override
+    public void editItem(final StateToken stateToken) {
+        view.editItem(genId(stateToken));
+    }
+
     private String genId(final StateToken token) {
         return "k-cnav-" + token.toString().replace(StateToken.SEPARATOR, "-");
     }
@@ -279,7 +227,7 @@
         } else if (!useGenericImageIcon && mimeType != null && mimeType.getType().equals("image")) {
             return downloadUtilsProvider.get().getImageResizedUrl(token, ImageSize.ico);
         } else {
-            return contentIconsRegistry.getContentTypeIcon(contentTypeId, mimeType);
+            return (String) contentIconsRegistry.getContentTypeIcon(contentTypeId, mimeType);
         }
     }
 
@@ -292,6 +240,42 @@
         }
     }
 
+    protected void gotoToken(final String token) {
+        stateManager.gotoHistoryToken(token);
+    }
+
+    public void init(final ContextNavigatorView view) {
+        this.view = view;
+        addListeners();
+    }
+
+    @Override
+    public boolean isSelected(final StateToken stateToken) {
+        return view.isSelected(genId(stateToken));
+    }
+
+    protected void onItemRename(final String token, final String newName, final String oldName) {
+        renameAction.rename(new StateToken(token), oldName, newName);
+    }
+
+    @Override
+    public void refreshState() {
+        final StateAbstractDTO currentState = session.getCurrentState();
+        if (currentState instanceof StateContainerDTO) {
+            setState((StateContainerDTO) currentState, true);
+        }
+    }
+
+    @Override
+    public void selectItem(final StateToken stateToken) {
+        view.selectItem(genId(stateToken));
+        topToolbar.disableMenusAndClearButtons();
+        bottomToolbar.disableMenusAndClearButtons();
+        final ActionItemCollection<StateToken> itemCollection = actionsByItem.get(stateToken);
+        topToolbar.addActions(itemCollection, OldAbstractFoldableContentActions.CONTEXT_TOPBAR);
+        bottomToolbar.addActions(itemCollection, OldAbstractFoldableContentActions.CONTEXT_BOTTOMBAR);
+    }
+
     private void selectOrEditNode(final boolean select, final StateToken stateToken) {
         // Finaly
         if (editOnNextStateChange) {
@@ -306,12 +290,28 @@
         }
     }
 
+    @Override
+    public void setEditOnNextStateChange(final boolean edit) {
+        editOnNextStateChange = edit;
+    }
+
+    @Override
+    public void setItemStatus(final StateToken stateToken, final ContentStatus status) {
+        clear();
+        refreshState();
+    }
+
     private void setItemText(final StateToken stateToken, final String name) {
         if (view.isAttached()) {
             view.setItemText(genId(stateToken), name);
         }
     }
 
+    @Override
+    public void setState(final StateContainerDTO state, final boolean select) {
+        setStateContainer(state, select);
+    }
+
     private void setStateContainer(final StateContainerDTO state, final boolean select) {
         final StateToken stateToken = state.getStateToken();
         final boolean isContent = state instanceof StateContentDTO;

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -21,7 +21,7 @@
 
 import org.ourproject.kune.platf.client.View;
 
-import cc.kune.core.client.registry.ContentIconsRegistry;
+import cc.kune.core.client.registry.IconsRegistry;
 import cc.kune.core.client.registry.RenamableRegistry;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.client.state.StateManager;
@@ -35,20 +35,21 @@
 
 public class EntityTitlePresenter implements EntityTitle {
 
-    private EntityTitleView view;
-    private final Session session;
-    private final ContentIconsRegistry iconsRegistry;
+    private final IconsRegistry iconsRegistry;
     private final RenamableRegistry renamableContentRegistry;
     private final RenameAction renameAction;
+    private final Session session;
+    private EntityTitleView view;
 
     public EntityTitlePresenter(final StateManager stateManager, final Session session,
-            final ContentIconsRegistry iconsRegistry, RenamableRegistry renamableContentRegistry,
-            RenameAction renameAction) {
+            final IconsRegistry iconsRegistry, final RenamableRegistry renamableContentRegistry,
+            final RenameAction renameAction) {
         this.session = session;
         this.iconsRegistry = iconsRegistry;
         this.renamableContentRegistry = renamableContentRegistry;
         this.renameAction = renameAction;
         stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
+            @Override
             public void onEvent(final StateAbstractDTO state) {
                 if (state instanceof StateContentDTO) {
                     setState((StateContentDTO) state);
@@ -63,6 +64,24 @@
         addRenameListeners();
     }
 
+    private void addRenameListeners() {
+        final Listener2<StateToken, String> onSuccess = new Listener2<StateToken, String>() {
+            @Override
+            public void onEvent(final StateToken token, final String newName) {
+                view.setContentTitle(newName);
+            }
+        };
+        final Listener2<StateToken, String> onFail = new Listener2<StateToken, String>() {
+            @Override
+            public void onEvent(final StateToken token, final String oldName) {
+                view.setContentTitle(oldName);
+            }
+        };
+        renameAction.onSuccess(onSuccess);
+        renameAction.onFail(onFail);
+    }
+
+    @Override
     public void edit() {
         view.edit();
     }
@@ -75,34 +94,20 @@
         this.view = view;
     }
 
+    protected void onTitleRename(final String oldName, final String newName) {
+        final StateToken token = session.getCurrentState().getStateToken();
+        renameAction.rename(token, oldName, newName);
+    }
+
     /**
      * Used renaming from context
      */
+    @Override
     public void setContentTitle(final String title) {
         view.setContentTitle(title);
         view.setContentTitleVisible(true);
     }
 
-    protected void onTitleRename(final String oldName, final String newName) {
-        final StateToken token = session.getCurrentState().getStateToken();
-        renameAction.rename(token, oldName, newName);
-    }
-
-    private void addRenameListeners() {
-        Listener2<StateToken, String> onSuccess = new Listener2<StateToken, String>() {
-            public void onEvent(StateToken token, String newName) {
-                view.setContentTitle(newName);
-            }
-        };
-        Listener2<StateToken, String> onFail = new Listener2<StateToken, String>() {
-            public void onEvent(StateToken token, String oldName) {
-                view.setContentTitle(oldName);
-            }
-        };
-        renameAction.onSuccess(onSuccess);
-        renameAction.onFail(onFail);
-    }
-
     private void setContentTitle(final String title, final boolean editable) {
         setContentTitle(title);
         view.setContentTitleEditable(editable);
@@ -119,17 +124,19 @@
     }
 
     private void setState(final StateContainerDTO state) {
-        setContentTitle(state.getTitle(), state.getContainerRights().isEditable()
-                && renamableContentRegistry.contains(state.getContainer().getTypeId()));
-        final String contentTypeIcon = iconsRegistry.getContentTypeIcon(state.getTypeId(), null);
+        setContentTitle(
+                state.getTitle(),
+                state.getContainerRights().isEditable()
+                        && renamableContentRegistry.contains(state.getContainer().getTypeId()));
+        final String contentTypeIcon = (String) iconsRegistry.getContentTypeIcon(state.getTypeId(), null);
         setIcon(contentTypeIcon);
         view.setContentTitleVisible(true);
     }
 
     private void setState(final StateContentDTO state) {
-        setContentTitle(state.getTitle(), state.getContentRights().isEditable()
-                && renamableContentRegistry.contains(state.getTypeId()));
-        final String contentTypeIcon = iconsRegistry.getContentTypeIcon(state.getTypeId(), state.getMimeType());
+        setContentTitle(state.getTitle(),
+                state.getContentRights().isEditable() && renamableContentRegistry.contains(state.getTypeId()));
+        final String contentTypeIcon = (String) iconsRegistry.getContentTypeIcon(state.getTypeId(), state.getMimeType());
         setIcon(contentTypeIcon);
         view.setContentTitleVisible(true);
     }

Modified: trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceAddTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceAddTest.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceAddTest.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -38,7 +38,7 @@
 import cc.kune.core.shared.dto.ContentSimpleDTO;
 import cc.kune.core.shared.dto.StateContainerDTO;
 import cc.kune.core.shared.dto.StateContentDTO;
-import cc.kune.docs.client.DocumentClientTool;
+import cc.kune.docs.client.DocsClientTool;
 import cc.kune.docs.server.DocumentServerTool;
 
 public class ContentServiceAddTest extends ContentServiceIntegrationTest {
@@ -93,7 +93,7 @@
         final ContainerDTO parent = defaultContent.getContainer();
         final String title = "folder name";
         final StateContainerDTO newState = contentService.addFolder(session.getHash(), parent.getStateToken(), title,
-                DocumentClientTool.TYPE_FOLDER);
+                DocsClientTool.TYPE_FOLDER);
         assertNotNull(newState);
         assertNotNull(newState.getGroupMembers());
         assertNotNull(newState.getParticipation());
@@ -127,11 +127,11 @@
         final ContainerDTO parent = defaultContent.getContainer();
         final String title = "folder name";
         final StateContainerDTO newState = contentService.addFolder(session.getHash(), parent.getStateToken(), title,
-                DocumentClientTool.TYPE_FOLDER);
+                DocsClientTool.TYPE_FOLDER);
         assertNotNull(newState);
 
         final StateContainerDTO newState2 = contentService.addFolder(session.getHash(), parent.getStateToken(), title,
-                DocumentClientTool.TYPE_FOLDER);
+                DocsClientTool.TYPE_FOLDER);
         assertNotNull(newState2);
 
         final ContainerDTO parentAgain = getSiteDefaultContent().getContainer();

Modified: trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceVariousTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceVariousTest.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceVariousTest.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -41,7 +41,7 @@
 import cc.kune.core.shared.dto.StateContainerDTO;
 import cc.kune.core.shared.dto.StateContentDTO;
 import cc.kune.core.shared.dto.UserSimpleDTO;
-import cc.kune.docs.client.DocumentClientTool;
+import cc.kune.docs.client.DocsClientTool;
 import cc.kune.docs.server.DocumentServerTool;
 
 public class ContentServiceVariousTest extends ContentServiceIntegrationTest {
@@ -102,7 +102,7 @@
         final String oldTitle = "some title";
         String newTitle = "folder new name";
         final StateContainerDTO newState = contentService.addFolder(session.getHash(), defaultContent.getStateToken(),
-                oldTitle, DocumentClientTool.TYPE_FOLDER);
+                oldTitle, DocsClientTool.TYPE_FOLDER);
 
         final ContainerDTO newFolder = newState.getContainer();
 
@@ -207,7 +207,7 @@
         final String oldTitle = "some title";
         String newTitle = "folder new name";
         final StateContainerDTO newState = contentService.addFolder(session.getHash(), folder.getStateToken(),
-                oldTitle, DocumentClientTool.TYPE_FOLDER);
+                oldTitle, DocsClientTool.TYPE_FOLDER);
 
         final ContainerDTO newFolder = newState.getContainer();
 

Modified: trunk/src/test/java/cc/kune/docs/DocumentToolTest.java
===================================================================
--- trunk/src/test/java/cc/kune/docs/DocumentToolTest.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/test/java/cc/kune/docs/DocumentToolTest.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -23,16 +23,16 @@
 
 import org.junit.Test;
 
-import cc.kune.docs.client.DocumentClientTool;
+import cc.kune.docs.client.DocsClientTool;
 import cc.kune.docs.server.DocumentServerTool;
 
 public class DocumentToolTest {
 
     @Test
     public void clientAndServerSync() {
-        assertEquals(DocumentServerTool.NAME, DocumentClientTool.NAME);
-        assertEquals(DocumentServerTool.TYPE_ROOT, DocumentClientTool.TYPE_ROOT);
-        assertEquals(DocumentServerTool.TYPE_FOLDER, DocumentClientTool.TYPE_FOLDER);
-        assertEquals(DocumentServerTool.TYPE_DOCUMENT, DocumentClientTool.TYPE_DOCUMENT);
+        assertEquals(DocumentServerTool.NAME, DocsClientTool.NAME);
+        assertEquals(DocumentServerTool.TYPE_ROOT, DocsClientTool.TYPE_ROOT);
+        assertEquals(DocumentServerTool.TYPE_FOLDER, DocsClientTool.TYPE_FOLDER);
+        assertEquals(DocumentServerTool.TYPE_DOCUMENT, DocsClientTool.TYPE_DOCUMENT);
     }
 }

Deleted: trunk/src/test/java/org/ourproject/kune/platf/client/actions/ContentIconsRegistryTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/actions/ContentIconsRegistryTest.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/actions/ContentIconsRegistryTest.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -1,102 +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 org.ourproject.kune.platf.client.actions;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import cc.kune.core.client.registry.ContentIconsRegistry;
-import cc.kune.core.shared.dto.BasicMimeTypeDTO;
-
-public class ContentIconsRegistryTest {
-
-    private static final String CONTENT_TYPE_TEST = "somecontenttype";
-    private static final String ICON = "someicon";
-    private static final String OTHERICON = "othericon";
-    private static final String JUSTANOTHERICON = "justanothericon";
-
-    private ContentIconsRegistry reg;
-
-    @Before
-    public void before() {
-        reg = new ContentIconsRegistry();
-    }
-
-    @Test
-    public void testBasic() {
-        reg.registerContentTypeIcon(CONTENT_TYPE_TEST, ICON);
-        assertEquals(ICON, reg.getContentTypeIcon(CONTENT_TYPE_TEST));
-    }
-
-    @Test
-    public void testBasicMimeType() {
-        final BasicMimeTypeDTO mimeType = new BasicMimeTypeDTO("image/png");
-        reg.registerContentTypeIcon(CONTENT_TYPE_TEST, mimeType, ICON);
-        assertEquals(ICON, reg.getContentTypeIcon(CONTENT_TYPE_TEST, mimeType));
-        assertEquals("", reg.getContentTypeIcon(CONTENT_TYPE_TEST));
-    }
-
-    @Test
-    public void testBasicMimeTypeWithDef() {
-        final BasicMimeTypeDTO mimeType = new BasicMimeTypeDTO("image/png");
-        reg.registerContentTypeIcon(CONTENT_TYPE_TEST, mimeType, ICON);
-        reg.registerContentTypeIcon(CONTENT_TYPE_TEST, OTHERICON);
-        assertEquals(ICON, reg.getContentTypeIcon(CONTENT_TYPE_TEST, mimeType));
-        assertEquals(OTHERICON, reg.getContentTypeIcon(CONTENT_TYPE_TEST));
-    }
-
-    @Test
-    public void testBasicMimeTypeWithDefType() {
-        final BasicMimeTypeDTO mimeType = new BasicMimeTypeDTO("image/png");
-        final BasicMimeTypeDTO genericMimeType = new BasicMimeTypeDTO("image");
-        reg.registerContentTypeIcon(CONTENT_TYPE_TEST, mimeType, ICON);
-        reg.registerContentTypeIcon(CONTENT_TYPE_TEST, genericMimeType, OTHERICON);
-        reg.registerContentTypeIcon(CONTENT_TYPE_TEST, JUSTANOTHERICON);
-        assertEquals(ICON, reg.getContentTypeIcon(CONTENT_TYPE_TEST, mimeType));
-        assertEquals(OTHERICON, reg.getContentTypeIcon(CONTENT_TYPE_TEST, genericMimeType));
-        assertEquals(JUSTANOTHERICON, reg.getContentTypeIcon(CONTENT_TYPE_TEST));
-    }
-
-    @Test
-    public void testBasicMimeTypeWithOnlyDefType() {
-        final BasicMimeTypeDTO mimeType = new BasicMimeTypeDTO("image/png");
-        final BasicMimeTypeDTO genericMimeType = new BasicMimeTypeDTO("image");
-        reg.registerContentTypeIcon(CONTENT_TYPE_TEST, genericMimeType, OTHERICON);
-        reg.registerContentTypeIcon(CONTENT_TYPE_TEST, JUSTANOTHERICON);
-        assertEquals(OTHERICON, reg.getContentTypeIcon(CONTENT_TYPE_TEST, mimeType));
-        assertEquals(OTHERICON, reg.getContentTypeIcon(CONTENT_TYPE_TEST, genericMimeType));
-        assertEquals(JUSTANOTHERICON, reg.getContentTypeIcon(CONTENT_TYPE_TEST));
-    }
-
-    @Test
-    public void testNoResult() {
-        reg.registerContentTypeIcon(CONTENT_TYPE_TEST, new BasicMimeTypeDTO("text", "plain"), ICON);
-        assertEquals("", reg.getContentTypeIcon(CONTENT_TYPE_TEST, new BasicMimeTypeDTO("text", "rtf")));
-    }
-
-    @Test
-    public void testNullBasicMimeType() {
-        final BasicMimeTypeDTO mimeType = null;
-        reg.registerContentTypeIcon(CONTENT_TYPE_TEST, ICON);
-        assertEquals(ICON, reg.getContentTypeIcon(CONTENT_TYPE_TEST, mimeType));
-    }
-}

Copied: trunk/src/test/java/org/ourproject/kune/platf/client/actions/IconsRegistryTest.java (from rev 1313, trunk/src/test/java/org/ourproject/kune/platf/client/actions/ContentIconsRegistryTest.java)
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/actions/IconsRegistryTest.java	                        (rev 0)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/actions/IconsRegistryTest.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -0,0 +1,102 @@
+/*
+ *
+ * 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 org.ourproject.kune.platf.client.actions;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import cc.kune.core.client.registry.IconsRegistry;
+import cc.kune.core.shared.dto.BasicMimeTypeDTO;
+
+public class IconsRegistryTest {
+
+    private static final String CONTENT_TYPE_TEST = "somecontenttype";
+    private static final String ICON = "someicon";
+    private static final String JUSTANOTHERICON = "justanothericon";
+    private static final String OTHERICON = "othericon";
+
+    private IconsRegistry reg;
+
+    @Before
+    public void before() {
+        reg = new IconsRegistry();
+    }
+
+    @Test
+    public void testBasic() {
+        reg.registerContentTypeIcon(CONTENT_TYPE_TEST, ICON);
+        assertEquals(ICON, reg.getContentTypeIcon(CONTENT_TYPE_TEST));
+    }
+
+    @Test
+    public void testBasicMimeType() {
+        final BasicMimeTypeDTO mimeType = new BasicMimeTypeDTO("image/png");
+        reg.registerContentTypeIcon(CONTENT_TYPE_TEST, mimeType, ICON);
+        assertEquals(ICON, reg.getContentTypeIcon(CONTENT_TYPE_TEST, mimeType));
+        assertEquals(null, reg.getContentTypeIcon(CONTENT_TYPE_TEST));
+    }
+
+    @Test
+    public void testBasicMimeTypeWithDef() {
+        final BasicMimeTypeDTO mimeType = new BasicMimeTypeDTO("image/png");
+        reg.registerContentTypeIcon(CONTENT_TYPE_TEST, mimeType, ICON);
+        reg.registerContentTypeIcon(CONTENT_TYPE_TEST, OTHERICON);
+        assertEquals(ICON, reg.getContentTypeIcon(CONTENT_TYPE_TEST, mimeType));
+        assertEquals(OTHERICON, reg.getContentTypeIcon(CONTENT_TYPE_TEST));
+    }
+
+    @Test
+    public void testBasicMimeTypeWithDefType() {
+        final BasicMimeTypeDTO mimeType = new BasicMimeTypeDTO("image/png");
+        final BasicMimeTypeDTO genericMimeType = new BasicMimeTypeDTO("image");
+        reg.registerContentTypeIcon(CONTENT_TYPE_TEST, mimeType, ICON);
+        reg.registerContentTypeIcon(CONTENT_TYPE_TEST, genericMimeType, OTHERICON);
+        reg.registerContentTypeIcon(CONTENT_TYPE_TEST, JUSTANOTHERICON);
+        assertEquals(ICON, reg.getContentTypeIcon(CONTENT_TYPE_TEST, mimeType));
+        assertEquals(OTHERICON, reg.getContentTypeIcon(CONTENT_TYPE_TEST, genericMimeType));
+        assertEquals(JUSTANOTHERICON, reg.getContentTypeIcon(CONTENT_TYPE_TEST));
+    }
+
+    @Test
+    public void testBasicMimeTypeWithOnlyDefType() {
+        final BasicMimeTypeDTO mimeType = new BasicMimeTypeDTO("image/png");
+        final BasicMimeTypeDTO genericMimeType = new BasicMimeTypeDTO("image");
+        reg.registerContentTypeIcon(CONTENT_TYPE_TEST, genericMimeType, OTHERICON);
+        reg.registerContentTypeIcon(CONTENT_TYPE_TEST, JUSTANOTHERICON);
+        assertEquals(OTHERICON, reg.getContentTypeIcon(CONTENT_TYPE_TEST, mimeType));
+        assertEquals(OTHERICON, reg.getContentTypeIcon(CONTENT_TYPE_TEST, genericMimeType));
+        assertEquals(JUSTANOTHERICON, reg.getContentTypeIcon(CONTENT_TYPE_TEST));
+    }
+
+    @Test
+    public void testNoResult() {
+        reg.registerContentTypeIcon(CONTENT_TYPE_TEST, new BasicMimeTypeDTO("text", "plain"), ICON);
+        assertEquals(null, reg.getContentTypeIcon(CONTENT_TYPE_TEST, new BasicMimeTypeDTO("text", "rtf")));
+    }
+
+    @Test
+    public void testNullBasicMimeType() {
+        final BasicMimeTypeDTO mimeType = null;
+        reg.registerContentTypeIcon(CONTENT_TYPE_TEST, ICON);
+        assertEquals(ICON, reg.getContentTypeIcon(CONTENT_TYPE_TEST, mimeType));
+    }
+}

Modified: trunk/src/test/java/org/ourproject/kune/platf/client/ui/dialogs/upload/FileUploaderPresenterTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/ui/dialogs/upload/FileUploaderPresenterTest.java	2011-04-17 19:25:13 UTC (rev 1314)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/ui/dialogs/upload/FileUploaderPresenterTest.java	2011-04-18 00:41:28 UTC (rev 1315)
@@ -30,7 +30,7 @@
 
 import cc.kune.core.client.state.Session;
 import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.docs.client.DocumentClientTool;
+import cc.kune.docs.client.DocsClientTool;
 
 public class FileUploaderPresenterTest {
 
@@ -53,7 +53,7 @@
         Mockito.when(session.getCurrentStateToken()).thenReturn(new StateToken("group.docs.1.1"));
         assertTrue(presenter.checkFolderChange());
         Mockito.verify(view, Mockito.times(1)).setUploadParams(SOMEUSER_HASH, "group.docs.1",
-                DocumentClientTool.TYPE_UPLOADEDFILE);
+                DocsClientTool.TYPE_UPLOADEDFILE);
     }
 
     @Test
@@ -61,7 +61,7 @@
         Mockito.when(session.getCurrentStateToken()).thenReturn(new StateToken("group.docs.1"));
         assertTrue(presenter.checkFolderChange());
         Mockito.verify(view, Mockito.times(1)).setUploadParams(SOMEUSER_HASH, "group.docs.1",
-                DocumentClientTool.TYPE_UPLOADEDFILE);
+                DocsClientTool.TYPE_UPLOADEDFILE);
     }
 
     @Test
@@ -72,9 +72,9 @@
         Mockito.when(session.getCurrentStateToken()).thenReturn(new StateToken("group.docs.2"));
         assertTrue(presenter.checkFolderChange());
         Mockito.verify(view, Mockito.times(1)).setUploadParams(SOMEUSER_HASH, "group.docs.1",
-                DocumentClientTool.TYPE_UPLOADEDFILE);
+                DocsClientTool.TYPE_UPLOADEDFILE);
         Mockito.verify(view, Mockito.times(1)).setUploadParams(SOMEUSER_HASH, "group.docs.2",
-                DocumentClientTool.TYPE_UPLOADEDFILE);
+                DocsClientTool.TYPE_UPLOADEDFILE);
     }
 
     @Test
@@ -85,9 +85,9 @@
         Mockito.when(session.getCurrentStateToken()).thenReturn(new StateToken("group.docs.2"));
         assertFalse(presenter.checkFolderChange());
         Mockito.verify(view, Mockito.times(1)).setUploadParams(SOMEUSER_HASH, "group.docs.1",
-                DocumentClientTool.TYPE_UPLOADEDFILE);
+                DocsClientTool.TYPE_UPLOADEDFILE);
         Mockito.verify(view, Mockito.never()).setUploadParams(SOMEUSER_HASH, "group.docs.2",
-                DocumentClientTool.TYPE_UPLOADEDFILE);
+                DocsClientTool.TYPE_UPLOADEDFILE);
     }
 
     @Test
@@ -97,6 +97,6 @@
         Mockito.when(session.getCurrentStateToken()).thenReturn(new StateToken("group.docs.1"));
         assertTrue(presenter.checkFolderChange());
         Mockito.verify(view, Mockito.times(2)).setUploadParams(SOMEUSER_HASH, "group.docs.1",
-                DocumentClientTool.TYPE_UPLOADEDFILE);
+                DocsClientTool.TYPE_UPLOADEDFILE);
     }
 }




More information about the kune-commits mailing list