[kune-commits] r1316 - in trunk/src/main/java/cc/kune: common/client/actions/ui/descrip common/client/tooltip common/client/ui common/public core/client core/client/rpcservices core/public core/server/rpc core/server/utils docs/client/actions docs/client/viewers gspace/client gspace/client/tool wave/client wave/server

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Mon Apr 18 13:45:12 CEST 2011


Author: vjrj_
Date: 2011-04-18 13:45:11 +0200 (Mon, 18 Apr 2011)
New Revision: 1316

Added:
   trunk/src/main/java/cc/kune/common/client/ui/UiUtils.java
   trunk/src/main/java/cc/kune/docs/client/actions/FolderGoUpBtn.java
   trunk/src/main/java/cc/kune/docs/client/actions/NewDocBtn.java
   trunk/src/main/java/cc/kune/docs/client/actions/NewFolderBtn.java
   trunk/src/main/java/cc/kune/docs/client/actions/OpenContentBtn.java
Removed:
   trunk/src/main/java/cc/kune/docs/client/actions/DocsGoUpBtn.java
Modified:
   trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/AbstractGuiActionDescrip.java
   trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/GuiActionDescrip.java
   trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java
   trunk/src/main/java/cc/kune/common/client/ui/BasicThumb.java
   trunk/src/main/java/cc/kune/common/public/kune-common.css
   trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
   trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java
   trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java
   trunk/src/main/java/cc/kune/core/public/ws.css
   trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
   trunk/src/main/java/cc/kune/core/server/utils/FilenameUtils.java
   trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java
   trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPanel.java
   trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPresenter.java
   trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPanel.java
   trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
   trunk/src/main/java/cc/kune/gspace/client/tool/ContentViewerSelector.java
   trunk/src/main/java/cc/kune/wave/client/WebClient.java
   trunk/src/main/java/cc/kune/wave/server/CustomUserRegistrationServlet.java
   trunk/src/main/java/cc/kune/wave/server/WaveMain.java
Log:
New docs actions

Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/AbstractGuiActionDescrip.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/AbstractGuiActionDescrip.java	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/AbstractGuiActionDescrip.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -26,6 +26,7 @@
 import cc.kune.common.client.actions.Action;
 import cc.kune.common.client.actions.ActionEvent;
 import cc.kune.common.client.actions.ChangeableObject;
+import cc.kune.common.client.actions.KeyStroke;
 import cc.kune.gspace.client.actions.perspective.ActionPerspective;
 
 /**
@@ -52,7 +53,7 @@
     /**
      * Instantiates a new abstract ui action descriptor. This is used for
      * describe UI button, menus, menu items and so on
-     *
+     * 
      * @param action
      *            the action
      */
@@ -88,7 +89,7 @@
     /**
      * Gets the location, a string used to group actions with locations (top
      * bar, bottom bar, user bar...).
-     *
+     * 
      * @return the location
      */
     @Override
@@ -103,7 +104,7 @@
 
     /**
      * Gets the position.
-     *
+     * 
      * @return the position
      */
     @Override
@@ -138,13 +139,14 @@
     }
 
     @Override
-    public boolean isChild() {
-        return !parent.equals(NO_PARENT);
+    public GuiActionDescrip in(final Class<? extends ActionPerspective> clazz) {
+        putValue(ActionPerspective.KEY, clazz);
+        return this;
     }
 
     @Override
-    public void in(Class<? extends ActionPerspective> clazz) {
-        putValue(ActionPerspective.KEY, clazz);
+    public boolean isChild() {
+        return !parent.equals(NO_PARENT);
     }
 
     @Override
@@ -182,7 +184,7 @@
      * If we have several toolbars, we can group with the "location" string key
      * actions that must be in the same location (ex: top bar, bottom bar, and
      * so on).
-     *
+     * 
      * @param location
      *            the new location
      */
@@ -199,7 +201,7 @@
     /**
      * Sets the position (where the UI element will be positioned, for instance
      * in a toolbar or in a menu).
-     *
+     * 
      * @param position
      *            the new position
      */
@@ -250,6 +252,12 @@
     }
 
     @Override
+    public GuiActionDescrip withShortcut(final KeyStroke shortcut) {
+        putValue(Action.ACCELERATOR_KEY, shortcut);
+        return this;
+    }
+
+    @Override
     public GuiActionDescrip withStyles(final String styles) {
         setStyles(styles);
         return this;

Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/GuiActionDescrip.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/GuiActionDescrip.java	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/GuiActionDescrip.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -2,6 +2,7 @@
 
 import cc.kune.common.client.actions.AbstractAction;
 import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.actions.KeyStroke;
 import cc.kune.common.client.actions.PropertyChangeListener;
 import cc.kune.gspace.client.actions.perspective.ActionPerspective;
 
@@ -48,7 +49,7 @@
 
     boolean hasTarget();
 
-    void in(Class<? extends ActionPerspective> clazz);
+    GuiActionDescrip in(Class<? extends ActionPerspective> clazz);
 
     boolean isChild();
 
@@ -84,6 +85,8 @@
 
     GuiActionDescrip withParent(GuiActionDescrip parent);
 
+    GuiActionDescrip withShortcut(KeyStroke keystroke);
+
     GuiActionDescrip withStyles(String styles);
 
     GuiActionDescrip withText(String text);

Modified: trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -107,7 +107,7 @@
 
     @Override
     public void show() {
-        if (!Tooltip.this.isShowing()) {
+        if (!Tooltip.this.isShowing() && ofWidget.isVisible()) {
             Tooltip.super.show();
             Tooltip.this.showAt(TooltipPositionCalculator.calculate(Window.getClientWidth(), Window.getClientHeight(),
                     ofWidget.getAbsoluteLeft(), ofWidget.getAbsoluteTop(), ofWidget.getOffsetWidth(),

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-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/common/client/ui/BasicThumb.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -23,7 +23,9 @@
 import cc.kune.common.client.tooltip.Tooltip;
 import cc.kune.common.client.utils.TextUtils;
 
+import com.google.gwt.event.dom.client.ClickEvent;
 import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.DoubleClickEvent;
 import com.google.gwt.event.dom.client.DoubleClickHandler;
 import com.google.gwt.event.dom.client.MouseOutEvent;
 import com.google.gwt.event.dom.client.MouseOutHandler;
@@ -43,6 +45,7 @@
     private final Image image;
     private final Label label;
     private boolean onOverLabel;
+    private final VerticalPanel panel;
 
     public BasicThumb(final Object imageRef, final int imgSize, final String text, final int textMaxLenght,
             final boolean crop) {
@@ -63,7 +66,7 @@
             final boolean crop, final ClickHandler clickHandler) {
         super();
         onOverLabel = false;
-        final VerticalPanel vpanel = new VerticalPanel();
+        panel = new VerticalPanel();
         if (imageRef instanceof String) {
             final String imageUrl = (String) imageRef;
             if (imgSize == NOSIZE) {
@@ -78,21 +81,23 @@
             }
         } else if (imageRef instanceof ImageResource) {
             image = new Image((ImageResource) imageRef);
+            image.setPixelSize(imgSize, imgSize);
         } else {
             // This should not happen
             image = new Image();
+            image.setPixelSize(imgSize, imgSize);
             Log.info("Unrecognized icon of BasicThumb: " + imageRef);
         }
         final String title = textMaxLenght == NOSIZE ? text : TextUtils.ellipsis(text, textMaxLenght);
         label = new Label(title);
-        vpanel.add(image);
-        vpanel.add(label);
-        vpanel.addStyleName("k-basic-thumb");
-        vpanel.addStyleName("kune-Margin-Mini-trbl");
-        vpanel.addStyleName("k-pointer");
-        vpanel.addStyleName("k-floatleft");
-        vpanel.setCellHorizontalAlignment(label, VerticalPanel.ALIGN_CENTER);
-        if (clickHandler instanceof ClickHandler) {
+        panel.add(image);
+        panel.add(label);
+        panel.addStyleName("k-basic-thumb");
+        panel.addStyleName("kune-Margin-Mini-trbl");
+        panel.addStyleName("k-pointer");
+        panel.addStyleName("k-floatleft");
+        panel.setCellHorizontalAlignment(label, VerticalPanel.ALIGN_CENTER);
+        if (clickHandler != null) {
             addClickHandlerImpl(clickHandler);
         }
         image.addMouseOverHandler(new MouseOverHandler() {
@@ -113,7 +118,7 @@
                 }
             }
         });
-        initWidget(vpanel);
+        initWidget(panel);
     }
 
     public BasicThumb(final Object imageRef, final String thumText, final ClickHandler clickHandler) {
@@ -129,8 +134,7 @@
     }
 
     private void addClickHandlerImpl(final ClickHandler clickHandler) {
-        label.addClickHandler(clickHandler);
-        image.addClickHandler(clickHandler);
+        panel.addDomHandler(clickHandler, ClickEvent.getType());
     }
 
     public void addDoubleClickHandler(final DoubleClickHandler clickHandler) {
@@ -138,8 +142,7 @@
     }
 
     private void addDoubleClickHandlerImpl(final DoubleClickHandler clickHandler) {
-        label.addDoubleClickHandler(clickHandler);
-        image.addDoubleClickHandler(clickHandler);
+        panel.addDomHandler(clickHandler, DoubleClickEvent.getType());
     }
 
     public void setLabelVisible(final boolean visible) {

Added: trunk/src/main/java/cc/kune/common/client/ui/UiUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/UiUtils.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/common/client/ui/UiUtils.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -0,0 +1,17 @@
+package cc.kune.common.client.ui;
+
+import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
+import com.google.gwt.user.client.ui.Panel;
+
+public class UiUtils {
+
+    public static void clear(final ForIsWidget widget) {
+        final Panel panel = (Panel) widget;
+        panel.clear();
+        // final int widgetCount = panel.getWidgetCount();
+        // for (int i = 0; i < widgetCount && widgetCount > 0; i++) {
+        // panel.remove(i);
+        // }
+    }
+
+}

Modified: trunk/src/main/java/cc/kune/common/public/kune-common.css
===================================================================
--- trunk/src/main/java/cc/kune/common/public/kune-common.css	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/common/public/kune-common.css	2011-04-18 11:45:11 UTC (rev 1316)
@@ -319,6 +319,7 @@
     vertical-align: middle;
     background-color: #F2F2F2;
     white-space: nowrap;
+    margin-right: 3px;
 }
 
 .oc-button:hover {

Modified: trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreGinModule.java	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/core/client/CoreGinModule.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -100,12 +100,6 @@
 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.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;
-import cc.kune.gspace.client.ui.footer.license.EntityLicensePresenter;
 import cc.kune.msgs.client.UserMessagesPanel;
 import cc.kune.msgs.client.UserMessagesPresenter;
 
@@ -155,8 +149,6 @@
                 GroupSNPresenter.GroupSNProxy.class);
         bindPresenter(UserSNPresenter.class, UserSNPresenter.UserSNView.class, UserSNPanel.class,
                 UserSNPresenter.UserSNProxy.class);
-        bindPresenter(EntityLicensePresenter.class, EntityLicensePresenter.EntityLicenseView.class,
-                EntityLicensePanel.class, EntityLicensePresenter.EntityLicenseProxy.class);
         bindPresenter(EntityHeaderPresenter.class, EntityHeaderPresenter.EntityHeaderView.class,
                 EntityHeaderPanel.class, EntityHeaderPresenter.EntityHeaderProxy.class);
         bindPresenter(SignInPresenter.class, SignInView.class, SignInPanel.class, SignInPresenter.SignInProxy.class);
@@ -164,8 +156,6 @@
                 RegisterPresenter.RegisterProxy.class);
         bindPresenter(UserConfirmPresenter.class, UserConfirmPresenter.UserConfirmView.class, UserConfirmPanel.class,
                 UserConfirmPresenter.UserConfirmProxy.class);
-        bindPresenter(TagsSummaryPresenter.class, TagsSummaryPresenter.TagsSummaryView.class, TagsSummaryPanel.class,
-                TagsSummaryPresenter.TagsSummaryProxy.class);
 
         bind(UserPassAutocompleteManager.class).to(UserPassAutocompleteManagerImpl.class).in(Singleton.class);
         bind(SignIn.class).to(SignInPresenter.class).in(Singleton.class);
@@ -178,8 +168,6 @@
         // bind(MessagePanelView.class).to(MessagePanel.class);
 
         // UI
-        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);

Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -53,8 +53,6 @@
 
     StateContainerDTO addRoom(String user, StateToken parentToken, String name) throws DefaultException;
 
-    StateContentDTO addWave(String userHash, StateToken parentToken, String waveFileType, String waveId);
-
     StateContentDTO delContent(String userHash, StateToken token) throws DefaultException;
 
     StateAbstractDTO getContent(String userHash, StateToken token) throws DefaultException;

Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -51,9 +51,6 @@
 
     void addRoom(String user, StateToken parentToken, String name, AsyncCallback<StateContainerDTO> callback);
 
-    void addWave(String userHash, StateToken parentToken, String waveFileType, String waveId,
-            AsyncCallback<StateContentDTO> asyncCallbackSimple);
-
     void delContent(String userHash, StateToken token, AsyncCallback<StateContentDTO> asyncCallback);
 
     void getContent(String user, StateToken newState, AsyncCallback<StateAbstractDTO> callback);

Modified: trunk/src/main/java/cc/kune/core/public/ws.css
===================================================================
--- trunk/src/main/java/cc/kune/core/public/ws.css	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/core/public/ws.css	2011-04-18 11:45:11 UTC (rev 1316)
@@ -1102,4 +1102,8 @@
 
 .k-tool-item-notselected {
     background-color: inherits;
+}
+
+.k-def-docbtn span {
+    font-size: 13px !important;
 }
\ No newline at end of file

Modified: trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -23,6 +23,8 @@
 
 import javax.persistence.NoResultException;
 
+import org.waveprotocol.wave.model.waveref.WaveRef;
+import org.waveprotocol.wave.util.escapers.jvm.JavaWaverefEncoder;
 
 import cc.kune.core.client.errors.AccessViolationException;
 import cc.kune.core.client.errors.ContentNotFoundException;
@@ -68,6 +70,7 @@
 import cc.kune.domain.Content;
 import cc.kune.domain.Group;
 import cc.kune.domain.User;
+import cc.kune.wave.server.KuneWaveManager;
 
 import com.google.inject.Inject;
 import com.google.inject.Provider;
@@ -83,6 +86,7 @@
     private final CreationService creationService;
     private final FinderService finderService;
     private final GroupManager groupManager;
+    private final KuneWaveManager kuneWaveManager;
     private final Mapper mapper;
     private final AccessRightsService rightsService;
     private final StateService stateService;
@@ -96,7 +100,7 @@
             final StateService stateService, final CreationService creationService, final GroupManager groupManager,
             final XmppManager xmppManager, final ContentManager contentManager,
             final ContainerManager containerManager, final TagUserContentManager tagManager,
-            final CommentManager commentManager, final Mapper mapper) {
+            final CommentManager commentManager, final Mapper mapper, final KuneWaveManager kuneWaveManager) {
         this.finderService = finderService;
         this.userSessionProvider = userSessionProvider;
         this.accessService = accessService;
@@ -110,6 +114,7 @@
         this.tagManager = tagManager;
         this.commentManager = commentManager;
         this.mapper = mapper;
+        this.kuneWaveManager = kuneWaveManager;
     }
 
     @Override
@@ -154,7 +159,8 @@
     public StateContentDTO addContent(final String userHash, final StateToken parentToken, final String title,
             final String typeId) throws DefaultException {
         final String body = "";
-        return createContent(parentToken, title, typeId, body);
+        final WaveRef waveRef = kuneWaveManager.createWave(body, getCurrentUser().getShortName());
+        return createContent(parentToken, title, typeId, JavaWaverefEncoder.encodeToUriPathSegment(waveRef));
     }
 
     @Override
@@ -201,15 +207,6 @@
         return null;
     }
 
-    @Override
-    @Authenticated
-    @Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
-    @Transactional
-    public StateContentDTO addWave(final String userHash, final StateToken parentToken, final String typeId,
-            final String waveId) throws DefaultException {
-        return createContent(parentToken, "Wave embeded test", typeId, waveId);
-    }
-
     private StateContentDTO createContent(final StateToken parentToken, final String title, final String typeId,
             final String body) {
         final User user = getCurrentUser();

Modified: trunk/src/main/java/cc/kune/core/server/utils/FilenameUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/utils/FilenameUtils.java	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/core/server/utils/FilenameUtils.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -30,13 +30,13 @@
      * 
      * @param filename
      */
-    public static void checkBasicFilename(String filename) {
-        if (filename.length() == 0 || filename.equals(".") || filename.equals("..")) {
+    public static void checkBasicFilename(final String filename) {
+        if (filename == null || filename.length() == 0 || filename.equals(".") || filename.equals("..")) {
             throw new NameNotPermittedException();
         }
     }
 
-    public static String chomp(String filename) {
+    public static String chomp(final String filename) {
         return StringUtils.chomp(filename);
     }
 }

Modified: trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -36,20 +36,23 @@
 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[] 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) {
+            final Provider<FolderGoUpBtn> folderGoUp, final Provider<NewDocBtn> newDocBtn,
+            final Provider<NewFolderBtn> newFolderBtn, final Provider<OpenContentBtn> openContentBtn) {
         super(session, stateManager, i18n, registry);
-        this.docsGoUp = docsGoUp;
+        actionsRegistry.addAction(folderGoUp, contents);
+        actionsRegistry.addAction(folderGoUp, containersNoRoot);
+        actionsRegistry.addAction(newDocBtn, containers);
+        actionsRegistry.addAction(newFolderBtn, containers);
+        actionsRegistry.addAction(openContentBtn, contents);
+        actionsRegistry.addAction(openContentBtn, containersNoRoot);
     }
 
     @Override
@@ -103,7 +106,5 @@
     @Override
     protected void createPostSessionInitActions() {
         // super.createUploadMediaAction(TYPE_GALLERY);
-        actionsRegistry.addAction(docsGoUp, contents);
-        actionsRegistry.addAction(docsGoUp, containersNoRoot);
     }
 }

Deleted: trunk/src/main/java/cc/kune/docs/client/actions/DocsGoUpBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/DocsGoUpBtn.java	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/docs/client/actions/DocsGoUpBtn.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -1,42 +0,0 @@
-package cc.kune.docs.client.actions;
-
-import cc.kune.common.client.actions.AbstractExtendedAction;
-import cc.kune.common.client.actions.ActionEvent;
-import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
-import cc.kune.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/actions/FolderGoUpBtn.java (from rev 1315, trunk/src/main/java/cc/kune/docs/client/actions/DocsGoUpBtn.java)
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/FolderGoUpBtn.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/actions/FolderGoUpBtn.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -0,0 +1,54 @@
+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.domain.utils.StateToken;
+import cc.kune.core.shared.dto.ContainerDTO;
+import cc.kune.core.shared.dto.StateAbstractDTO;
+import cc.kune.core.shared.dto.StateContainerDTO;
+import cc.kune.core.shared.dto.StateContentDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.actions.perspective.ViewPerspective;
+
+import com.google.inject.Inject;
+
+public class FolderGoUpBtn extends ButtonDescriptor {
+
+    public static class FolderGoUpAction extends AbstractExtendedAction {
+
+        private final Session session;
+        private final StateManager stateManager;
+
+        @Inject
+        public FolderGoUpAction(final Session session, final StateManager stateManager) {
+            this.session = session;
+            this.stateManager = stateManager;
+        }
+
+        @Override
+        public void actionPerformed(final ActionEvent event) {
+            StateToken stateToken;
+            final StateAbstractDTO state = session.getCurrentState();
+            if (state instanceof StateContentDTO) {
+                stateToken = ((StateContentDTO) state).getContainer().getStateToken();
+            } else {
+                final ContainerDTO container = ((StateContainerDTO) state).getContainer();
+                stateToken = container.getStateToken().copy().setFolder(container.getParentFolderId());
+            }
+            stateManager.gotoStateToken(stateToken);
+        }
+
+    }
+
+    @Inject
+    public FolderGoUpBtn(final I18nTranslationService i18n, final FolderGoUpAction action, final CoreResources res) {
+        super(action);
+        this.withToolTip(i18n.t("Go up: Open the container folder")).withIcon(res.folderGoUp()).in(
+                ViewPerspective.class);
+    }
+
+}

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

Added: trunk/src/main/java/cc/kune/docs/client/actions/NewFolderBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/NewFolderBtn.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/actions/NewFolderBtn.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -0,0 +1,68 @@
+package cc.kune.docs.client.actions;
+
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.core.client.actions.RolAction;
+import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
+import cc.kune.core.client.rpcservices.ContentServiceAsync;
+import cc.kune.core.client.state.ContentCache;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.dto.AccessRolDTO;
+import cc.kune.core.shared.dto.HasContent;
+import cc.kune.core.shared.dto.StateContainerDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.docs.client.DocsClientTool;
+import cc.kune.gspace.client.actions.perspective.ViewPerspective;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class NewFolderBtn extends ButtonDescriptor {
+
+    public static class NewDocAction extends RolAction {
+
+        private final ContentCache cache;
+        private final Provider<ContentServiceAsync> contentService;
+        private final I18nTranslationService i18n;
+        private final Session session;
+        private final StateManager stateManager;
+
+        @Inject
+        public NewDocAction(final Session session, final StateManager stateManager, final I18nTranslationService i18n,
+                final Provider<ContentServiceAsync> contentService, final ContentCache cache) {
+            super(AccessRolDTO.Editor, true);
+            this.session = session;
+            this.stateManager = stateManager;
+            this.i18n = i18n;
+            this.contentService = contentService;
+            this.cache = cache;
+        }
+
+        @Override
+        public void actionPerformed(final ActionEvent event) {
+            stateManager.gotoStateToken(((HasContent) session.getCurrentState()).getContainer().getStateToken());
+            NotifyUser.showProgressProcessing();
+            contentService.get().addFolder(session.getUserHash(), session.getCurrentStateToken(), i18n.t("New folder"),
+                    DocsClientTool.TYPE_FOLDER, new AsyncCallbackSimple<StateContainerDTO>() {
+                        @Override
+                        public void onSuccess(final StateContainerDTO state) {
+                            // contextNavigator.setEditOnNextStateChange(true);
+                            stateManager.setRetrievedState(state);
+                        }
+                    });
+            cache.removeContent(session.getCurrentStateToken());
+        }
+
+    }
+
+    @Inject
+    public NewFolderBtn(final I18nTranslationService i18n, final NewDocAction action, final NavResources res) {
+        super(action);
+        this.withText(i18n.t("New folder")).withToolTip(
+                i18n.t("Create a new folder here. A folder will be a 'section' in the public web")).withIcon(
+                res.folderAdd()).in(ViewPerspective.class).withStyles("k-def-docbtn");
+    }
+}

Added: trunk/src/main/java/cc/kune/docs/client/actions/OpenContentBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/OpenContentBtn.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/actions/OpenContentBtn.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -0,0 +1,38 @@
+package cc.kune.docs.client.actions;
+
+import cc.kune.common.client.actions.AbstractExtendedAction;
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
+import cc.kune.core.client.resources.CoreResources;
+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.actions.perspective.MenuPerspective;
+
+import com.google.inject.Inject;
+
+public class OpenContentBtn extends MenuItemDescriptor {
+
+    public static class OpenContentAction extends AbstractExtendedAction {
+
+        private final StateManager stateManager;
+
+        @Inject
+        public OpenContentAction(final StateManager stateManager) {
+            this.stateManager = stateManager;
+        }
+
+        @Override
+        public void actionPerformed(final ActionEvent event) {
+            stateManager.gotoStateToken((StateToken) event.getTarget());
+        }
+
+    }
+
+    @Inject
+    public OpenContentBtn(final I18nTranslationService i18n, final OpenContentAction action, final CoreResources res) {
+        super(action);
+        this.withText(i18n.t("Open")).withIcon(res.arrowRightGreen()).in(MenuPerspective.class);
+    }
+
+}

Modified: trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPanel.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -19,6 +19,7 @@
 
 import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
 import cc.kune.common.client.errors.UIException;
+import cc.kune.common.client.ui.UiUtils;
 import cc.kune.core.shared.dto.StateContentDTO;
 import cc.kune.docs.client.viewers.DocViewerPresenter.DocViewerView;
 import cc.kune.gspace.client.GSpaceArmor;
@@ -34,6 +35,7 @@
 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.InlineLabel;
 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;
@@ -49,6 +51,7 @@
     private RemoteViewServiceMultiplexer channel;
     @UiField
     DeckPanel deck;
+    private final GSpaceArmor gsArmor;
     private IdGenerator idGenerator;
     private final Element loading = new LoadingIndicator().getElement();
     @UiField
@@ -63,11 +66,10 @@
     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.gsArmor = wsArmor;
         this.waveClientManager = waveClientManager;
         widget = uiBinder.createAndBindUi(this);
     }
@@ -79,17 +81,20 @@
 
     @Override
     public void attach() {
-        final ForIsWidget docContainer = wsArmor.getDocContainer();
-        final int widgetCount = docContainer.getWidgetCount();
-        for (int i = 0; i < widgetCount; i++) {
-            docContainer.remove(i);
-        }
+        final ForIsWidget docContainer = gsArmor.getDocContainer();
         docContainer.add(widget);
     }
 
+    public void clear() {
+        onlyViewPanel.setHTML("");
+        gsArmor.getSubheaderToolbar().clear();
+        UiUtils.clear(gsArmor.getDocContainer());
+        UiUtils.clear(gsArmor.getDocHeader());
+    }
+
     @Override
     public void detach() {
-        widget.removeFromParent();
+        clear();
     }
 
     private WaveRef getWaveRef(final String waveRefS) {
@@ -114,12 +119,15 @@
 
     @Override
     public void setActions(final GuiActionDescCollection actions) {
-        wsArmor.getSubheaderToolbar().clear();
-        wsArmor.getSubheaderToolbar().addAll(actions);
+        gsArmor.getSubheaderToolbar().clear();
+        gsArmor.getSubheaderToolbar().addAll(actions);
     }
 
     @Override
     public void setContent(final StateContentDTO state) {
+        final ForIsWidget docHeader = gsArmor.getDocHeader();
+        UiUtils.clear(docHeader);
+        docHeader.add(new InlineLabel(state.getTitle()));
         final boolean editable = state.getContentRights().isEditable();
         if (editable) {
             // initWaveClientIfNeeded();

Modified: trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPresenter.java	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPresenter.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -10,6 +10,7 @@
 import cc.kune.core.shared.dto.StateContentDTO;
 import cc.kune.docs.client.DocsClientTool;
 import cc.kune.docs.client.actions.DocsClientActions;
+import cc.kune.gspace.client.actions.perspective.ViewPerspective;
 import cc.kune.gspace.client.tool.ContentViewer;
 import cc.kune.gspace.client.tool.ContentViewerSelector;
 
@@ -32,6 +33,8 @@
 
         void attach();
 
+        void clear();
+
         void detach();
 
         void setActions(GuiActionDescCollection actions);
@@ -69,10 +72,11 @@
 
     @Override
     public void setContent(@Nonnull final HasContent state) {
+        getView().clear();
         final StateContentDTO stateContent = (StateContentDTO) state;
         final AccessRights rights = stateContent.getContentRights();
         final GuiActionDescCollection actions = actionsRegistry.getCurrentActions(stateContent.getGroup(),
-                stateContent.getTypeId(), session.isLogged(), rights);
+                stateContent.getTypeId(), session.isLogged(), rights, ViewPerspective.class);
         getView().setActions(actions);
         getView().setContent(stateContent);
     }

Modified: trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPanel.java	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPanel.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -5,6 +5,7 @@
 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.common.client.ui.UiUtils;
 import cc.kune.core.shared.dto.StateContainerDTO;
 import cc.kune.docs.client.viewers.FolderViewerPresenter.FolderViewerView;
 import cc.kune.gspace.client.GSpaceArmor;
@@ -16,6 +17,8 @@
 import com.google.gwt.uibinder.client.UiBinder;
 import com.google.gwt.uibinder.client.UiField;
 import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.InlineLabel;
 import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
 import com.google.gwt.user.client.ui.Widget;
 import com.google.inject.Inject;
@@ -31,8 +34,8 @@
 
     private final GSpaceArmor gsArmor;
 
-    int ICONLABELMAXSIZE = 10;
-    int ICONSIZE = 40;
+    int ICONLABELMAXSIZE = 20;
+    int ICONSIZE = 100;
     private final Widget widget;
 
     @Inject
@@ -54,12 +57,7 @@
 
     @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);
     }
 
@@ -67,6 +65,8 @@
     public void clear() {
         flow.clear();
         gsArmor.getSubheaderToolbar().clear();
+        UiUtils.clear(gsArmor.getDocContainer());
+        UiUtils.clear(gsArmor.getDocHeader());
     }
 
     public BasicThumb createThumb(final String text, final Object icon, final String tooltip,
@@ -97,7 +97,6 @@
 
     @Override
     public void detach() {
-        widget.removeFromParent();
         clear();
     }
 
@@ -109,6 +108,8 @@
 
     @Override
     public void setContainer(final StateContainerDTO state) {
+        gsArmor.getDocContainer().add(new HTML("<b>Note:</b> This GUI is provisional<br/>"));
+        gsArmor.getDocHeader().add(new InlineLabel(state.getTitle()));
     }
 
 }

Modified: trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPresenter.java	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPresenter.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -3,6 +3,7 @@
 import javax.annotation.Nonnull;
 
 import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
+import cc.kune.common.client.notify.NotifyUser;
 import cc.kune.core.client.actions.ActionRegistryByType;
 import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
 import cc.kune.core.client.registry.IconsRegistry;
@@ -23,6 +24,7 @@
 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.actions.perspective.ViewPerspective;
 import cc.kune.gspace.client.tool.ContentViewer;
 import cc.kune.gspace.client.tool.ContentViewerSelector;
 
@@ -89,7 +91,7 @@
 
     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 AccessRights rights) {
         final Object icon = getIcon(stateToken, contentTypeId, mimeType);
         final String tooltip = getTooltip(stateToken, mimeType);
         final FolderItemDescriptor item = new FolderItemDescriptor(genId(stateToken), genId(parentStateToken), icon,
@@ -99,9 +101,9 @@
                         session.isLogged(), rights, MenuPerspective.class));
         if (status.equals(ContentStatus.inTheDustbin) && !session.getShowDeletedContent()) {
             // Don't show
+            NotifyUser.info("Deleted, don't show");
         } else {
             getView().addItem(item, new DoubleClickHandler() {
-
                 @Override
                 public void onDoubleClick(final DoubleClickEvent event) {
                     stateManager.gotoStateToken(stateToken);
@@ -116,18 +118,16 @@
     }
 
     private void createChildItems(final ContainerDTO container, final AccessRights containerRights) {
+        NotifyUser.info("Size: " + container.getContents().size() + " siblings: " + container.getChilds().size());
+        for (final ContentSimpleDTO content : container.getContents()) {
+            addItem(content.getTitle(), content.getTypeId(), content.getMimeType(), content.getStatus(),
+                    content.getStateToken(), content.getStateToken().copy().clearDocument(), content.getRights());
+        }
         for (final ContainerSimpleDTO siblingFolder : container.getChilds()) {
             addItem(siblingFolder.getName(), siblingFolder.getTypeId(), null, ContentStatus.publishedOnline,
                     siblingFolder.getStateToken(),
-                    siblingFolder.getStateToken().copy().setFolder(siblingFolder.getParentFolderId()), containerRights,
-                    false);
+                    siblingFolder.getStateToken().copy().setFolder(siblingFolder.getParentFolderId()), containerRights);
         }
-        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
@@ -140,9 +140,7 @@
     }
 
     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")) {
+        if (!useGenericImageIcon && mimeType != null && mimeType.getType().equals("image")) {
             return downloadUtilsProvider.get().getImageResizedUrl(token, ImageSize.ico);
         } else {
             return iconsRegistry.getContentTypeIcon(contentTypeId, mimeType);
@@ -154,7 +152,7 @@
             // Used for previews
             return null;
         } else {
-            return i18n.t("Double click to open");
+            return null; // i18n.t("Double click to open");
         }
     }
 
@@ -167,11 +165,11 @@
     public void setContent(@Nonnull final HasContent state) {
         getView().clear();
         final StateContainerDTO stateContainer = (StateContainerDTO) state;
+        getView().setContainer(stateContainer);
         final AccessRights rights = stateContainer.getContainerRights();
         final GuiActionDescCollection actions = actionsRegistry.getCurrentActions(stateContainer.getGroup(),
-                stateContainer.getTypeId(), session.isLogged(), rights);
+                stateContainer.getTypeId(), session.isLogged(), rights, ViewPerspective.class);
         getView().setActions(actions);
-        getView().setContainer(stateContainer);
         createChildItems(stateContainer.getContainer(), stateContainer.getContainerRights());
         // view.setEditable(rights.isEditable());
     }

Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -19,9 +19,13 @@
  */
 package cc.kune.gspace.client;
 
+import cc.kune.gspace.client.tags.TagsSummaryPanel;
+import cc.kune.gspace.client.tags.TagsSummaryPresenter;
 import cc.kune.gspace.client.tool.selector.ToolSelector;
 import cc.kune.gspace.client.tool.selector.ToolSelectorPanel;
 import cc.kune.gspace.client.tool.selector.ToolSelectorPresenter;
+import cc.kune.gspace.client.ui.footer.license.EntityLicensePanel;
+import cc.kune.gspace.client.ui.footer.license.EntityLicensePresenter;
 
 import com.google.inject.Singleton;
 import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
@@ -35,6 +39,12 @@
      */
     @Override
     protected void configure() {
+        bindPresenter(EntityLicensePresenter.class, EntityLicensePresenter.EntityLicenseView.class,
+                EntityLicensePanel.class, EntityLicensePresenter.EntityLicenseProxy.class);
+        bindPresenter(TagsSummaryPresenter.class, TagsSummaryPresenter.TagsSummaryView.class, TagsSummaryPanel.class,
+                TagsSummaryPresenter.TagsSummaryProxy.class);
+        bind(GSpaceArmorImpl.class).in(Singleton.class);
+        bind(GSpaceArmor.class).to(GSpaceArmorImpl.class).in(Singleton.class);
         bind(GSpaceParts.class).asEagerSingleton();
         bindPresenter(ToolSelectorPresenter.class, ToolSelectorPresenter.ToolSelectorView.class,
                 ToolSelectorPanel.class, ToolSelectorPresenter.ToolSelectorProxy.class);

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-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/ContentViewerSelector.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -25,6 +25,7 @@
 @Singleton
 public class ContentViewerSelector {
 
+    private ContentViewer currentView;
     private final HashMap<String, ContentViewer> defViewsRegister;
     private final Session session;
     private final StateManager stateManager;
@@ -38,6 +39,12 @@
         defViewsRegister = new HashMap<String, ContentViewer>();
     }
 
+    private void detachCurrent() {
+        if (currentView != null) {
+            currentView.detach();
+        }
+    }
+
     public void init() {
         session.onAppStart(true, new AppStartHandler() {
             @Override
@@ -50,6 +57,7 @@
                             setContent((HasContent) state);
                         } else {
                             // NoContent
+                            detachCurrent();
                         }
                     }
                 });
@@ -78,8 +86,10 @@
     }
 
     private void setContent(final ContentViewer view, final HasContent state) {
+        detachCurrent();
         view.setContent(state);
         view.attach();
+        currentView = view;
     }
 
     public void setContent(@Nonnull final HasContent state) {

Modified: trunk/src/main/java/cc/kune/wave/client/WebClient.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WebClient.java	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/wave/client/WebClient.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -215,7 +215,7 @@
           }
         };
     Search search = SimpleSearch.create(RemoteSearchService.create(), waveStore);
-    SearchPresenter searchUi = SearchPresenter.create(search, searchPanel, selectHandler);
+    SearchPresenter.create(search, searchPanel, selectHandler);
   }
 
   private void setupWavePanel() {

Modified: trunk/src/main/java/cc/kune/wave/server/CustomUserRegistrationServlet.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/CustomUserRegistrationServlet.java	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/wave/server/CustomUserRegistrationServlet.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -44,7 +44,7 @@
 
 /**
  * The user registration servlet allows new users to register accounts.
- *
+ * 
  * @author josephg at gmail.com (Joseph Gentle)
  */
 @Singleton

Modified: trunk/src/main/java/cc/kune/wave/server/WaveMain.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/WaveMain.java	2011-04-18 00:41:28 UTC (rev 1315)
+++ trunk/src/main/java/cc/kune/wave/server/WaveMain.java	2011-04-18 11:45:11 UTC (rev 1316)
@@ -114,7 +114,7 @@
 
     ServerRpcProvider server = injector.getInstance(ServerRpcProvider.class);
     WaveBus waveBus = injector.getInstance(WaveBus.class);
-
+    
     String domain =
       injector.getInstance(Key.get(String.class, Names.named(CoreSettings.WAVE_SERVER_DOMAIN)));
     if (!ParticipantIdUtil.isDomainAddress(ParticipantIdUtil.makeDomainAddress(domain))) {
@@ -168,7 +168,7 @@
     server.addServlet("/auth/register", injector.getInstance(UserRegistrationServlet.class));
 
     server.addServlet("/fetch/*", injector.getInstance(FetchServlet.class));
-
+    
     server.addServlet("/search/*", injector.getInstance(SearchServlet.class));
 
     server.addServlet("/robot/dataapi", injector.getInstance(DataApiServlet.class));
@@ -189,7 +189,7 @@
             gadgetServerPath);
     ServletHolder proxyServletHolder = server.addServlet("/gadgets/*", proxyServlet);
     proxyServletHolder.setInitParameter("HostHeader", gadgetServerHostname);
-
+    
     server.addServlet("/webclient/remote_logging",
         injector.getInstance(RemoteLoggingServiceImpl.class));
     // server.addServlet("/", injector.getInstance(WaveClientServlet.class));
@@ -203,7 +203,7 @@
   private static void initializeFrontend(Injector injector, ServerRpcProvider server,
       WaveBus waveBus, String waveDomain) throws WaveServerException {
     HashedVersionFactory hashFactory = injector.getInstance(HashedVersionFactory.class);
-
+   
     WaveletProvider provider = injector.getInstance(WaveletProvider.class);
     ClientFrontend frontend =
         ClientFrontendImpl.create(hashFactory, provider, waveBus, waveDomain);




More information about the kune-commits mailing list