[kune-commits] r939 - in trunk/src: main/java/org/ourproject/kune/chat/client main/java/org/ourproject/kune/chat/client/cnt/info main/java/org/ourproject/kune/chat/client/cnt/info/ui main/java/org/ourproject/kune/chat/client/cnt/room main/java/org/ourproject/kune/chat/client/cnt/room/ui main/java/org/ourproject/kune/chat/client/ctx main/java/org/ourproject/kune/docs/client main/java/org/ourproject/kune/docs/client/cnt main/java/org/ourproject/kune/docs/client/cnt/folder/viewer main/java/org/ourproject/kune/docs/client/cnt/reader main/java/org/ourproject/kune/docs/client/ctx main/java/org/ourproject/kune/docs/client/ctx/admin main/java/org/ourproject/kune/platf/client/state main/java/org/ourproject/kune/workspace/client/editor test/java/org/ourproject/kune/platf/client/state test/java/org/ourproject/kune/platf/integration/selenium

vjrj vjrj at ourproject.org
Tue Nov 4 16:07:21 CET 2008


Author: vjrj
Date: 2008-11-04 16:07:14 +0100 (Tue, 04 Nov 2008)
New Revision: 939

Added:
   trunk/src/main/java/org/ourproject/kune/chat/client/ChatConnectionOptions.java
   trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ChatInfoPanel.java
   trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlPanel.java
   trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPanel.java
   trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewerPanel.java
   trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewer.java
   trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewerPanel.java
   trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewerPresenter.java
   trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewerView.java
   trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditor.java
   trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorPanel.java
   trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorPresenter.java
   trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorView.java
   trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeActionListener.java
Removed:
   trunk/src/main/java/org/ourproject/kune/chat/client/ChatOptions.java
   trunk/src/main/java/org/ourproject/kune/chat/client/ChatProvider.java
   trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ui/ChatInfoPanel.java
   trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomControlPanel.java
   trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomPanel.java
   trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ui/
   trunk/src/main/java/org/ourproject/kune/docs/client/Document.java
   trunk/src/main/java/org/ourproject/kune/docs/client/actions/
   trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/ui/
   trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReader.java
   trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderPresenter.java
   trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderView.java
   trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/
   trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContext.java
   trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPanel.java
   trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java
   trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextView.java
   trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/ui/
   trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeListener.java
Modified:
   trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
   trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
   trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngine.java
   trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java
   trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
   trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
   trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
   trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java
   trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeCollection.java
   trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManager.java
   trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java
   trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
   trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/KuneSeleniumTestHelper.java
Log:
Incomplete - task UI tools & workspace refactorization 

Complete - task StateManager refactor 


Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -21,13 +21,13 @@
 import org.ourproject.kune.chat.client.cnt.ChatContent;
 import org.ourproject.kune.chat.client.cnt.ChatContentPresenter;
 import org.ourproject.kune.chat.client.cnt.info.ChatInfo;
-import org.ourproject.kune.chat.client.cnt.info.ui.ChatInfoPanel;
+import org.ourproject.kune.chat.client.cnt.info.ChatInfoPanel;
 import org.ourproject.kune.chat.client.cnt.room.ChatRoom;
 import org.ourproject.kune.chat.client.cnt.room.ChatRoomControl;
+import org.ourproject.kune.chat.client.cnt.room.ChatRoomControlPanel;
 import org.ourproject.kune.chat.client.cnt.room.ChatRoomControlPresenter;
+import org.ourproject.kune.chat.client.cnt.room.ChatRoomPanel;
 import org.ourproject.kune.chat.client.cnt.room.ChatRoomPresenter;
-import org.ourproject.kune.chat.client.cnt.room.ui.ChatRoomControlPanel;
-import org.ourproject.kune.chat.client.cnt.room.ui.ChatRoomPanel;
 import org.ourproject.kune.chat.client.ctx.ChatContext;
 import org.ourproject.kune.chat.client.ctx.ChatContextPresenter;
 import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdmin;
@@ -53,19 +53,9 @@
 
 public class ChatClientModule extends AbstractModule {
 
-    public ChatClientModule() {
-    }
-
     @Override
     public void onInstall() {
 
-        register(Singleton.class, new Factory<ChatInfo>(ChatInfo.class) {
-            @Override
-            public ChatInfo create() {
-                return new ChatInfoPanel();
-            }
-        });
-
         register(ToolGroup.class, new Factory<ChatClientActions>(ChatClientActions.class) {
             @Override
             public ChatClientActions create() {
@@ -74,6 +64,22 @@
             }
         });
 
+        register(ToolGroup.class, new Factory<ChatClientTool>(ChatClientTool.class) {
+            @Override
+            public ChatClientTool create() {
+                return new ChatClientTool($(Session.class), $(Application.class), $(I18nUITranslationService.class),
+                        $(EmiteUIDialog.class), $(WorkspaceSkeleton.class), $$(GroupMembersSummary.class),
+                        $(ToolSelector.class), $(WsThemePresenter.class), $$(ChatContent.class), $$(ChatContext.class));
+            }
+        });
+
+        register(Singleton.class, new Factory<ChatInfo>(ChatInfo.class) {
+            @Override
+            public ChatInfo create() {
+                return new ChatInfoPanel();
+            }
+        });
+
         register(Singleton.class, new Factory<ChatContent>(ChatContent.class) {
             @Override
             public ChatContent create() {
@@ -110,6 +116,7 @@
                 return presenter;
             }
         });
+
         register(Singleton.class, new Factory<RoomsAdmin>(RoomsAdmin.class) {
             @Override
             public RoomsAdmin create() {
@@ -120,14 +127,5 @@
             }
         });
 
-        register(ToolGroup.class, new Factory<ChatClientTool>(ChatClientTool.class) {
-            @Override
-            public ChatClientTool create() {
-                return new ChatClientTool($(Session.class), $(Application.class), $(I18nUITranslationService.class),
-                        $(EmiteUIDialog.class), $(WorkspaceSkeleton.class), $$(GroupMembersSummary.class),
-                        $(ToolSelector.class), $(WsThemePresenter.class), $$(ChatContent.class), $$(ChatContext.class));
-            }
-        });
-
     }
 }

Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -43,7 +43,7 @@
 import com.calclab.suco.client.listener.Listener;
 import com.calclab.suco.client.listener.Listener0;
 
-public class ChatClientTool extends AbstractClientTool implements ChatProvider {
+public class ChatClientTool extends AbstractClientTool {
     public static final String NAME = "chats";
     public static final String TYPE_ROOT = "chat.root";
     public static final String TYPE_ROOM = "chat.room";
@@ -63,8 +63,8 @@
         session.onInitDataReceived(new Listener<InitDataDTO>() {
             public void onEvent(final InitDataDTO initData) {
                 checkChatDomain(initData.getChatDomain());
-                final ChatOptions chatOptions = new ChatOptions(initData.getChatHttpBase(), initData.getChatDomain(),
-                        initData.getChatRoomHost());
+                final ChatConnectionOptions chatOptions = new ChatConnectionOptions(initData.getChatHttpBase(),
+                        initData.getChatDomain(), initData.getChatRoomHost());
                 chat = new ChatEngineXmpp(emiteUIDialog, chatOptions, i18n, ws);
                 groupMembersSummaryProvider.get().addUserOperation(
                         new MenuItem<GroupDTO>("images/new-chat.gif", i18n.t("Start a chat with this member"),

Copied: trunk/src/main/java/org/ourproject/kune/chat/client/ChatConnectionOptions.java (from rev 934, trunk/src/main/java/org/ourproject/kune/chat/client/ChatOptions.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatOptions.java	2008-10-28 15:40:27 UTC (rev 934)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatConnectionOptions.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -0,0 +1,36 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.chat.client;
+
+import com.calclab.emiteuimodule.client.UserChatOptions;
+
+public class ChatConnectionOptions {
+    public UserChatOptions userOptions;
+    public final String httpBase;
+    public final String domain;
+    public final String roomHost;
+
+    public ChatConnectionOptions(final String httpBase, final String domain, final String roomHost) {
+        this.httpBase = httpBase;
+        this.domain = domain;
+        this.roomHost = roomHost;
+        userOptions = null;
+    }
+}


Property changes on: trunk/src/main/java/org/ourproject/kune/chat/client/ChatConnectionOptions.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngine.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngine.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngine.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -22,7 +22,7 @@
 public interface ChatEngine {
     void addNewBuddie(String shortName);
 
-    ChatOptions getChatOptions();
+    ChatConnectionOptions getChatOptions();
 
     void joinRoom(String roomName, String userAlias);
 

Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -39,13 +39,13 @@
 import com.gwtext.client.widgets.event.ButtonListenerAdapter;
 
 class ChatEngineXmpp implements ChatEngine {
-    private final ChatOptions chatOptions;
+    private final ChatConnectionOptions chatOptions;
     private final EmiteUIDialog emiteDialog;
     private final I18nTranslationService i18n;
     private final WorkspaceSkeleton ws;
     private ToolbarButton traybarButton;
 
-    public ChatEngineXmpp(final EmiteUIDialog emiteUIDialog, final ChatOptions chatOptions,
+    public ChatEngineXmpp(final EmiteUIDialog emiteUIDialog, final ChatConnectionOptions chatOptions,
             final I18nTranslationService i18n, final WorkspaceSkeleton ws) {
         this.emiteDialog = emiteUIDialog;
         this.chatOptions = chatOptions;
@@ -57,7 +57,7 @@
         Site.important("In development (emite)");
     }
 
-    public ChatOptions getChatOptions() {
+    public ChatConnectionOptions getChatOptions() {
         return chatOptions;
     }
 

Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/ChatOptions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatOptions.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatOptions.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -1,36 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.chat.client;
-
-import com.calclab.emiteuimodule.client.UserChatOptions;
-
-public class ChatOptions {
-    public UserChatOptions userOptions;
-    public final String httpBase;
-    public final String domain;
-    public final String roomHost;
-
-    public ChatOptions(final String httpBase, final String domain, final String roomHost) {
-        this.httpBase = httpBase;
-        this.domain = domain;
-        this.roomHost = roomHost;
-        userOptions = null;
-    }
-}

Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/ChatProvider.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatProvider.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatProvider.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.chat.client;
-
-public interface ChatProvider {
-    ChatEngine getChat();
-}

Copied: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ChatInfoPanel.java (from rev 934, trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ui/ChatInfoPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ui/ChatInfoPanel.java	2008-10-28 15:40:27 UTC (rev 934)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ChatInfoPanel.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -0,0 +1,39 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.chat.client.cnt.info;
+
+
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+
+ at Deprecated
+public class ChatInfoPanel extends VerticalPanel implements ChatInfo {
+    private final VerticalPanel stateArea;
+
+    public ChatInfoPanel() {
+        final FlowPanel flow = new FlowPanel();
+        add(flow);
+        stateArea = new VerticalPanel();
+        add(stateArea);
+    }
+
+    public void show() {
+    }
+}


Property changes on: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ChatInfoPanel.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ui/ChatInfoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ui/ChatInfoPanel.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ui/ChatInfoPanel.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -1,39 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.chat.client.cnt.info.ui;
-
-import org.ourproject.kune.chat.client.cnt.info.ChatInfo;
-
-import com.google.gwt.user.client.ui.FlowPanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-
-public class ChatInfoPanel extends VerticalPanel implements ChatInfo {
-    private final VerticalPanel stateArea;
-
-    public ChatInfoPanel() {
-        final FlowPanel flow = new FlowPanel();
-        add(flow);
-        stateArea = new VerticalPanel();
-        add(stateArea);
-    }
-
-    public void show() {
-    }
-}

Copied: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlPanel.java (from rev 934, trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomControlPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomControlPanel.java	2008-10-28 15:40:27 UTC (rev 934)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlPanel.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -0,0 +1,46 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.chat.client.cnt.room;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.CustomPushButton;
+
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+public class ChatRoomControlPanel extends HorizontalPanel implements ChatRoomControlView {
+    private final CustomPushButton enterRoomBtn;
+
+    public ChatRoomControlPanel(final I18nTranslationService i18n, final ChatRoomControlPresenter presenter) {
+        enterRoomBtn = new CustomPushButton(i18n.t("Enter room"), new ClickListener() {
+            public void onClick(final Widget sender) {
+                presenter.onEnterRoom();
+            }
+        });
+        add(enterRoomBtn);
+        setEnterRoomEnabled(true);
+    }
+
+    public void setEnterRoomEnabled(final boolean isEnabled) {
+        enterRoomBtn.setEnabled(isEnabled);
+    }
+
+}
\ No newline at end of file


Property changes on: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlPanel.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPanel.java (from rev 934, trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomPanel.java	2008-10-28 15:40:27 UTC (rev 934)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPanel.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -0,0 +1,33 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.chat.client.cnt.room;
+
+import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.Label;
+
+public class ChatRoomPanel implements ChatRoomView {
+
+    public ChatRoomPanel(final WorkspaceSkeleton ws) {
+        ws.getEntityWorkspace().setContent(new Label("History of room conversations." + Site.IN_DEVELOPMENT));
+    }
+
+}


Property changes on: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPanel.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomControlPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomControlPanel.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomControlPanel.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -1,48 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.chat.client.cnt.room.ui;
-
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomControlPresenter;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomControlView;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.ui.CustomPushButton;
-
-import com.google.gwt.user.client.ui.ClickListener;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-public class ChatRoomControlPanel extends HorizontalPanel implements ChatRoomControlView {
-    private final CustomPushButton enterRoomBtn;
-
-    public ChatRoomControlPanel(final I18nTranslationService i18n, final ChatRoomControlPresenter presenter) {
-        enterRoomBtn = new CustomPushButton(i18n.t("Enter room"), new ClickListener() {
-            public void onClick(final Widget sender) {
-                presenter.onEnterRoom();
-            }
-        });
-        add(enterRoomBtn);
-        setEnterRoomEnabled(true);
-    }
-
-    public void setEnterRoomEnabled(final boolean isEnabled) {
-        enterRoomBtn.setEnabled(isEnabled);
-    }
-
-}
\ No newline at end of file

Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomPanel.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomPanel.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -1,34 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.chat.client.cnt.room.ui;
-
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomView;
-import org.ourproject.kune.workspace.client.site.Site;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-
-import com.google.gwt.user.client.ui.Label;
-
-public class ChatRoomPanel implements ChatRoomView {
-
-    public ChatRoomPanel(final WorkspaceSkeleton ws) {
-        ws.getEntityWorkspace().setContent(new Label("History of room conversations." + Site.IN_DEVELOPMENT));
-    }
-
-}

Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/Document.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/Document.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/Document.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.docs.client;
-
-public interface Document {
-
-}

Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -29,7 +29,7 @@
 import static org.ourproject.kune.docs.client.DocumentClientTool.TYPE_WIKIPAGE;
 
 import org.ourproject.kune.docs.client.cnt.DocumentContent;
-import org.ourproject.kune.docs.client.ctx.admin.AdminContext;
+import org.ourproject.kune.docs.client.ctx.admin.DocContextEditor;
 import org.ourproject.kune.platf.client.actions.ActionEnableCondition;
 import org.ourproject.kune.platf.client.actions.ActionMenuItemDescriptor;
 import org.ourproject.kune.platf.client.actions.ActionToolbarButtonAndItemDescriptor;
@@ -87,7 +87,7 @@
     private final Provider<TextEditor> textEditorProvider;
     private final KuneErrorHandler errorHandler;
     private final DocumentContent documentContent;
-    private final Provider<AdminContext> adminContextProvider;
+    private final Provider<DocContextEditor> adminContextProvider;
 
     public DocumentClientActions(final I18nUITranslationService i18n, final ContextNavigator contextNavigator,
             final Session session, final StateManager stateManager,
@@ -96,7 +96,7 @@
             final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,
             final Provider<FileDownloadUtils> fileDownloadProvider, final EntityLogo entityLogo,
             final Provider<TextEditor> textEditorProvider, final KuneErrorHandler errorHandler,
-            final DocumentContent documentContent, final Provider<AdminContext> adminContextProvider) {
+            final DocumentContent documentContent, final Provider<DocContextEditor> adminContextProvider) {
         this.i18n = i18n;
         this.contextNavigator = contextNavigator;
         this.session = session;

Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -22,19 +22,19 @@
 import org.ourproject.kune.docs.client.cnt.DocumentContentPanel;
 import org.ourproject.kune.docs.client.cnt.DocumentContentPresenter;
 import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewer;
+import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerPanel;
 import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerPresenter;
 import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerView;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.ui.FolderViewerPanel;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReader;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderPresenter;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderView;
-import org.ourproject.kune.docs.client.cnt.reader.ui.DocumentReaderPanel;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentViewer;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentViewerPanel;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentViewerPresenter;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentViewerView;
 import org.ourproject.kune.docs.client.ctx.DocumentContext;
 import org.ourproject.kune.docs.client.ctx.DocumentContextPresenter;
-import org.ourproject.kune.docs.client.ctx.admin.AdminContext;
-import org.ourproject.kune.docs.client.ctx.admin.AdminContextPanel;
-import org.ourproject.kune.docs.client.ctx.admin.AdminContextPresenter;
-import org.ourproject.kune.docs.client.ctx.admin.AdminContextView;
+import org.ourproject.kune.docs.client.ctx.admin.DocContextEditor;
+import org.ourproject.kune.docs.client.ctx.admin.DocContextEditorPanel;
+import org.ourproject.kune.docs.client.ctx.admin.DocContextEditorPresenter;
+import org.ourproject.kune.docs.client.ctx.admin.DocContextEditorView;
 import org.ourproject.kune.platf.client.actions.ActionManager;
 import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
 import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
@@ -70,9 +70,6 @@
 
 public class DocumentClientModule extends AbstractModule {
 
-    public DocumentClientModule() {
-    }
-
     @Override
     public void onInstall() {
 
@@ -94,7 +91,7 @@
                         $$(GroupServiceAsync.class), $$(FileUploader.class), $(ContentActionRegistry.class),
                         $(ContextActionRegistry.class), $$(FileDownloadUtils.class), $(EntityLogo.class),
                         $$(TextEditor.class), $(KuneErrorHandler.class), $(DocumentContent.class),
-                        $$(AdminContext.class));
+                        $$(DocContextEditor.class));
             }
         });
 
@@ -107,7 +104,7 @@
                         contentNavigatorToolbar);
 
                 final DocumentContentPresenter presenter = new DocumentContentPresenter($(StateManager.class),
-                        $(Session.class), $$(DocumentReader.class), $$(TextEditor.class), $$(FolderViewer.class),
+                        $(Session.class), $$(DocumentViewer.class), $$(TextEditor.class), $$(FolderViewer.class),
                         toolbar, $(ContentActionRegistry.class));
                 final DocumentContentPanel panel = new DocumentContentPanel($(WorkspaceSkeleton.class));
                 presenter.init(panel);
@@ -115,13 +112,13 @@
             }
         });
 
-        register(Singleton.class, new Factory<AdminContext>(AdminContext.class) {
+        register(Singleton.class, new Factory<DocContextEditor>(DocContextEditor.class) {
             @Override
-            public AdminContext create() {
-                final AdminContextPresenter presenter = new AdminContextPresenter($(Session.class),
+            public DocContextEditor create() {
+                final DocContextEditorPresenter presenter = new DocContextEditorPresenter($(Session.class),
                         $(StateManager.class), $$(TagsSummary.class), $$(ContentServiceAsync.class),
                         $(EntityTitle.class), $(EntitySubTitle.class));
-                final AdminContextView view = new AdminContextPanel(presenter, $(I18nUITranslationService.class),
+                final DocContextEditorView view = new DocContextEditorPanel(presenter, $(I18nUITranslationService.class),
                         $(WorkspaceSkeleton.class));
                 presenter.init(view);
                 return presenter;
@@ -132,17 +129,17 @@
             @Override
             public DocumentContext create() {
                 final DocumentContextPresenter presenter = new DocumentContextPresenter($(StateManager.class),
-                        $$(ContextNavigator.class), $$(AdminContext.class));
+                        $$(ContextNavigator.class), $$(DocContextEditor.class));
                 return presenter;
             }
         });
 
-        register(Singleton.class, new Factory<DocumentReader>(DocumentReader.class) {
+        register(Singleton.class, new Factory<DocumentViewer>(DocumentViewer.class) {
             @Override
-            public DocumentReader create() {
-                final DocumentReaderView view = new DocumentReaderPanel($(WorkspaceSkeleton.class),
+            public DocumentViewer create() {
+                final DocumentViewerView view = new DocumentViewerPanel($(WorkspaceSkeleton.class),
                         $(I18nTranslationService.class));
-                final DocumentReaderPresenter presenter = new DocumentReaderPresenter(view, $$(FileDownloadUtils.class));
+                final DocumentViewerPresenter presenter = new DocumentViewerPresenter(view, $$(FileDownloadUtils.class));
                 return presenter;
             }
         });

Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -21,7 +21,7 @@
 
 import org.ourproject.kune.docs.client.DocumentClientTool;
 import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewer;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReader;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentViewer;
 import org.ourproject.kune.platf.client.actions.ActionItemCollection;
 import org.ourproject.kune.platf.client.actions.ActionRegistry;
 import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
@@ -40,14 +40,14 @@
 public class DocumentContentPresenter implements DocumentContent {
     private DocumentContentView view;
     private final Session session;
-    private final Provider<DocumentReader> docReaderProvider;
+    private final Provider<DocumentViewer> docReaderProvider;
     private final Provider<TextEditor> textEditorProvider;
     private final Provider<FolderViewer> folderViewerProvider;
     private final ActionToolbar<StateToken> toolbar;
     private final ActionRegistry<StateToken> actionRegistry;
 
     public DocumentContentPresenter(final StateManager stateManager, final Session session,
-            final Provider<DocumentReader> docReaderProvider, final Provider<TextEditor> textEditorProvider,
+            final Provider<DocumentViewer> docReaderProvider, final Provider<TextEditor> textEditorProvider,
             final Provider<FolderViewer> folderViewerProvider, final ActionToolbar<StateToken> toolbar,
             final ActionRegistry<StateToken> actionRegistry) {
         this.session = session;

Copied: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewerPanel.java (from rev 934, trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/ui/FolderViewerPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/ui/FolderViewerPanel.java	2008-10-28 15:40:27 UTC (rev 934)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewerPanel.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -0,0 +1,33 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.docs.client.cnt.folder.viewer;
+
+import org.ourproject.kune.workspace.client.site.Site;
+
+import com.google.gwt.user.client.ui.Label;
+
+public class FolderViewerPanel extends Label implements FolderViewerView {
+
+    public FolderViewerPanel() {
+        super("Folder properties, translations ..." + Site.IN_DEVELOPMENT);
+        super.setStyleName("kune-Content-Main");
+        super.addStyleName("kune-Margin-7-trbl");
+    }
+}


Property changes on: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewerPanel.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReader.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReader.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReader.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -1,31 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.docs.client.cnt.reader;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
-import org.ourproject.kune.platf.client.dto.StateToken;
-
-public interface DocumentReader {
-
-    View getView();
-
-    void showDocument(StateToken token, String text, String typeId, BasicMimeTypeDTO mimeType);
-}

Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderPresenter.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderPresenter.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -1,62 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.docs.client.cnt.reader;
-
-import org.ourproject.kune.docs.client.DocumentClientTool;
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
-import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
-import org.ourproject.kune.platf.client.ui.download.ImageSize;
-
-import com.calclab.suco.client.ioc.Provider;
-
-public class DocumentReaderPresenter implements DocumentReader {
-    private final DocumentReaderView view;
-    private final Provider<FileDownloadUtils> downloadProvider;
-
-    public DocumentReaderPresenter(final DocumentReaderView view, final Provider<FileDownloadUtils> downloadProvider) {
-        this.view = view;
-        this.downloadProvider = downloadProvider;
-    }
-
-    public View getView() {
-        return view;
-    }
-
-    public void showDocument(final StateToken token, final String text, final String typeId,
-            final BasicMimeTypeDTO mimeType) {
-        if (typeId.equals(DocumentClientTool.TYPE_UPLOADEDFILE)) {
-            if (mimeType != null) {
-                FileDownloadUtils fileDownloadUtils = downloadProvider.get();
-                if (mimeType.getType().equals("image")) {
-                    view.showImage(fileDownloadUtils.getImageUrl(token), fileDownloadUtils.getImageResizedUrl(token,
-                            ImageSize.sized));
-                } else if (mimeType.toString().equals("text/plain") || mimeType.toString().equals("application/pdf")) {
-                    view.setContent(text);
-                } else {
-                    view.setContent("");
-                }
-            }
-        } else {
-            view.setContent(text);
-        }
-    }
-}

Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderView.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderView.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -1,30 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.docs.client.cnt.reader;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface DocumentReaderView extends View {
-
-    void setContent(String content);
-
-    void showImage(String imageUrl, String imageResizedUrl);
-
-}

Copied: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewer.java (from rev 934, trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReader.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReader.java	2008-10-28 15:40:27 UTC (rev 934)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewer.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -0,0 +1,31 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.docs.client.cnt.reader;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
+import org.ourproject.kune.platf.client.dto.StateToken;
+
+public interface DocumentViewer {
+
+    View getView();
+
+    void showDocument(StateToken token, String text, String typeId, BasicMimeTypeDTO mimeType);
+}


Property changes on: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewer.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewerPanel.java (from rev 934, trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderPanel.java	2008-10-28 15:40:27 UTC (rev 934)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewerPanel.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -0,0 +1,73 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.docs.client.cnt.reader;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.KuneUiUtils;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.Widget;
+
+public class DocumentViewerPanel implements DocumentViewerView {
+
+    private final WorkspaceSkeleton ws;
+    private final I18nTranslationService i18n;
+
+    public DocumentViewerPanel(final WorkspaceSkeleton ws, I18nTranslationService i18n) {
+        this.ws = ws;
+        this.i18n = i18n;
+    }
+
+    public void setContent(final String content) {
+        final HTML html = new HTML(content);
+        setDefStyle(html);
+        ws.getEntityWorkspace().setContent(html);
+    }
+
+    public void showImage(String imageUrl, String imageResizedUrl) {
+        final Image imgOrig = new Image(imageUrl);
+        final Image imgResized = new Image(imageResizedUrl);
+        KuneUiUtils.setQuickTip(imgOrig, i18n.t("Click to zoom out"));
+        KuneUiUtils.setQuickTip(imgResized, i18n.t("Click to zoom in"));
+        setDefStyle(imgOrig);
+        setDefStyle(imgResized);
+        imgOrig.addStyleName("kune-pointer");
+        imgResized.addStyleName("kune-pointer");
+        imgResized.addClickListener(new ClickListener() {
+            public void onClick(Widget sender) {
+                ws.getEntityWorkspace().setContent(imgOrig);
+            }
+        });
+        imgOrig.addClickListener(new ClickListener() {
+            public void onClick(Widget sender) {
+                ws.getEntityWorkspace().setContent(imgResized);
+            }
+        });
+        ws.getEntityWorkspace().setContent(imgResized);
+    }
+
+    private void setDefStyle(final Widget widget) {
+        widget.setStyleName("kune-Content-Main");
+        widget.addStyleName("kune-Margin-7-trbl");
+    }
+}


Property changes on: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewerPanel.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewerPresenter.java (from rev 934, trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderPresenter.java	2008-10-28 15:40:27 UTC (rev 934)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewerPresenter.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -0,0 +1,62 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.docs.client.cnt.reader;
+
+import org.ourproject.kune.docs.client.DocumentClientTool;
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.download.ImageSize;
+
+import com.calclab.suco.client.ioc.Provider;
+
+public class DocumentViewerPresenter implements DocumentViewer {
+    private final DocumentViewerView view;
+    private final Provider<FileDownloadUtils> downloadProvider;
+
+    public DocumentViewerPresenter(final DocumentViewerView view, final Provider<FileDownloadUtils> downloadProvider) {
+        this.view = view;
+        this.downloadProvider = downloadProvider;
+    }
+
+    public View getView() {
+        return view;
+    }
+
+    public void showDocument(final StateToken token, final String text, final String typeId,
+            final BasicMimeTypeDTO mimeType) {
+        if (typeId.equals(DocumentClientTool.TYPE_UPLOADEDFILE)) {
+            if (mimeType != null) {
+                FileDownloadUtils fileDownloadUtils = downloadProvider.get();
+                if (mimeType.getType().equals("image")) {
+                    view.showImage(fileDownloadUtils.getImageUrl(token), fileDownloadUtils.getImageResizedUrl(token,
+                            ImageSize.sized));
+                } else if (mimeType.toString().equals("text/plain") || mimeType.toString().equals("application/pdf")) {
+                    view.setContent(text);
+                } else {
+                    view.setContent("");
+                }
+            }
+        } else {
+            view.setContent(text);
+        }
+    }
+}


Property changes on: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewerPresenter.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewerView.java (from rev 934, trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderView.java	2008-10-28 15:40:27 UTC (rev 934)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewerView.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -0,0 +1,30 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.docs.client.cnt.reader;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface DocumentViewerView extends View {
+
+    void setContent(String content);
+
+    void showImage(String imageUrl, String imageResizedUrl);
+
+}


Property changes on: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewerView.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -20,7 +20,7 @@
 package org.ourproject.kune.docs.client.ctx;
 
 import org.ourproject.kune.docs.client.DocumentClientTool;
-import org.ourproject.kune.docs.client.ctx.admin.AdminContext;
+import org.ourproject.kune.docs.client.ctx.admin.DocContextEditor;
 import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
 import org.ourproject.kune.platf.client.dto.StateContainerDTO;
 import org.ourproject.kune.platf.client.dto.StateContentDTO;
@@ -32,10 +32,10 @@
 
 public class DocumentContextPresenter implements DocumentContext {
     private final Provider<ContextNavigator> contextNavigatorProvider;
-    private final Provider<AdminContext> adminContextProvider;
+    private final Provider<DocContextEditor> adminContextProvider;
 
     public DocumentContextPresenter(final StateManager stateManager,
-            final Provider<ContextNavigator> contextNavigatorProvider, final Provider<AdminContext> adminContextProvider) {
+            final Provider<ContextNavigator> contextNavigatorProvider, final Provider<DocContextEditor> adminContextProvider) {
         this.contextNavigatorProvider = contextNavigatorProvider;
         this.adminContextProvider = adminContextProvider;
         stateManager.onStateChanged(new Listener<StateAbstractDTO>() {

Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContext.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContext.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContext.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -1,32 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.docs.client.ctx.admin;
-
-import org.ourproject.kune.platf.client.dto.StateContentDTO;
-
-public interface AdminContext {
-    void attach();
-
-    void clear();
-
-    void detach();
-
-    void setState(StateContentDTO content);
-}

Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPanel.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPanel.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -1,277 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.docs.client.ctx.admin;
-
-import java.util.Date;
-import java.util.List;
-
-import org.ourproject.kune.platf.client.dto.AccessListsDTO;
-import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
-import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.VerticalPanel;
-
-public class AdminContextPanel extends VerticalPanel implements AdminContextView {
-    // private static final Images IMG = Images.App.getInstance();
-
-    // private static final int FORMS_WIDTH = 145;
-
-    // private final IndexedStackPanelWithSubItems options;
-    // private final AdminContextPresenter presenter;
-    //
-    // private AccessListsPanel accessListsPanel;
-    // private DateField publishedOnField;
-    // private TextArea tagsField;
-    // private VerticalPanel tagsComponent;
-    // private VerticalPanel publishedOnComponent;
-    // private LanguageSelectorComponent langPresenter;
-    // private VerticalPanel authorsComponent;
-    // private VerticalPanel langComponent;
-    // private IconLabel addAuthorLabel;
-    // private final I18nTranslationService i18n;
-    // private final String authors_item;
-    // private final String publication_item;
-    // private final String perms_item;
-    // private final String language_item;
-    // private final String tags_item;
-
-    private final WorkspaceSkeleton ws;
-    private final Label testLabel;
-
-    public AdminContextPanel(final AdminContextPresenter presenter, final I18nTranslationService i18n,
-            WorkspaceSkeleton ws) {
-        this.ws = ws;
-        testLabel = new Label("Admin ctx");
-        // this.presenter = presenter;
-        // this.i18n = i18n;
-        // options = new IndexedStackPanelWithSubItems();
-        // //options.addStyleName("kune-AdminContextPanel");
-        //
-        // //add(options);
-        // //setCellWidth(options, "100%");
-        // setWidth("100%");
-        // authors_item = i18n.t("Authors");
-        // publication_item = i18n.t("Publication");
-        // perms_item = i18n.t("Permissions");
-        // language_item = i18n.t("Language");
-        // tags_item = i18n.t("Tags");
-    }
-
-    public void attach() {
-        if (!testLabel.isAttached()) {
-            ws.getEntityWorkspace().setContext(testLabel);
-        }
-    }
-
-    public void detach() {
-        if (testLabel.isAttached()) {
-            testLabel.removeFromParent();
-        }
-    }
-
-    public void removeAccessListComponent() {
-        // if (options.containsItem(perms_item)) {
-        // removeComponent(perms_item);
-        // }
-    }
-
-    public void removeAuthorsComponent() {
-        // if (options.containsItem(authors_item)) {
-        // removeComponent(authors_item);
-        // }
-    }
-
-    public void removeLangComponent() {
-        // if (options.containsItem(language_item)) {
-        // removeComponent(language_item);
-        // }
-    }
-
-    public void removePublishedOnComponent() {
-        // if (options.containsItem(publication_item)) {
-        // removeComponent(publication_item);
-        // }
-    }
-
-    public void removeTagsComponent() {
-        // if (options.containsItem(tags_item)) {
-        // removeComponent(tags_item);
-        // }
-    }
-
-    public void reset() {
-        // options.clear();
-    }
-
-    public void setAccessLists(final AccessListsDTO accessLists) {
-        // if (accessListsPanel == null) {
-        // accessListsPanel = new AccessListsPanel(i18n);
-        // }
-        // if (!options.containsItem(perms_item)) {
-        // addComponent(perms_item, i18n.t("Who can admin/edit/view this work"),
-        // accessListsPanel);
-        // }
-        // accessListsPanel.setAccessLists(accessLists);
-    }
-
-    public void setAuthors(final List<UserSimpleDTO> authors) {
-        // if (authorsComponent == null) {
-        // authorsComponent = new VerticalPanel();
-        // addAuthorLabel = new IconLabel(IMG.addGreen(), i18n.t("Add author"));
-        // addAuthorLabel.addClickListener(new ClickListener() {
-        // public void onClick(final Widget sender) {
-        // presenter.doAction(DocsEvents.ADD_AUTHOR, null);
-        // }
-        // });
-        // } else {
-        // if (options.containsItem(authors_item)) {
-        // options.removeStackItem(authors_item);
-        // }
-        // authorsComponent.clear();
-        // }
-        // if (!options.containsItem(authors_item)) {
-        // addComponent(authors_item, i18n.t("Authors of this work"),
-        // authorsComponent);
-        // }
-        // for (final Iterator<UserSimpleDTO> iterator = authors.iterator();
-        // iterator.hasNext();) {
-        // final UserSimpleDTO author = iterator.next();
-        // final StackSubItemAction[] authorActions = { new
-        // StackSubItemAction(IMG.del(), i18n.t("Remove author"),
-        // DocsEvents.REMOVE_AUTHOR) };
-        // options.addStackSubItem(authors_item, IMG.personDef(),
-        // author.getShortName(), author.getName(),
-        // authorActions, presenter);
-        // }
-        // authorsComponent.add(addAuthorLabel);
-    }
-
-    public void setLanguage(final I18nLanguageDTO language) {
-        // if (langComponent == null) {
-        // langPresenter = WorkspaceFactory.createLanguageSelectorComponent();
-        // langComponent = new VerticalPanel();
-        // final LanguageSelectorPanel view = (LanguageSelectorPanel)
-        // langPresenter.getView();
-        // view.setWidth("" + FORMS_WIDTH);
-        // langComponent.add(view);
-        // view.addChangeListener(new ComboBoxListenerAdapter() {
-        // public void onSelect(final ComboBox comboBox, final Record record,
-        // final int index) {
-        // presenter.doChangeLanguage(record.getAsString(LanguageSelectorPanel.LANG_ID));
-        // }
-        // });
-        // }
-        // if (!options.containsItem(language_item)) {
-        // addComponent(language_item, i18n.t("The language of this work"),
-        // langComponent);
-        // }
-        // langPresenter.setLanguage(language);
-    }
-
-    public void setPublishedOn(final Date publishedOn) {
-        // if (publishedOnField == null) {
-        // publishedOnComponent = createPublicationComponent();
-        // }
-        // if (!options.containsItem(publication_item)) {
-        // addComponent(publication_item, i18n.t("Date of publication of this
-        // work"), publishedOnComponent);
-        // }
-        // // publishedOnField.setValue(publishedOn);
-    }
-
-    public void setTags(final String tags) {
-        // if (tagsComponent == null) {
-        // tagsComponent = createTagsComponent();
-        // }
-        // if (!options.containsItem(tags_item)) {
-        // addComponent(tags_item,
-        // i18n.t("Keywords or terms associated with this work"),
-        // tagsComponent);
-        // }
-        // tagsField.setValue(tags);
-        // }
-        //
-        // private void addComponent(final String header, final String
-        // headerTitle,
-        // final VerticalPanel panel) {
-        // panel.addStyleName("kune-AdminContextPanel-inner-wrap");
-        // final VerticalPanel vp = options.addStackItem(header, headerTitle,
-        // false);
-        // vp.setStyleName("kune-AdminContextPanel-inner");
-        // vp.add(panel);
-        // vp.setCellWidth(panel, "100%");
-        // vp.setWidth("100%");
-    }
-
-    // private FormPanel createDefaultForm() {
-    // final FormPanel form = new FormPanel();
-    // form.setHideLabels(true);
-    // form.setWidth(FORMS_WIDTH);
-    // form.setBorder(false);
-    // return form;
-    // }
-
-    // private VerticalPanel createPublicationComponent() {
-    // // final FormPanel form = createDefaultForm();
-    // //
-    // // publishedOnField = new DateField();
-    // // publishedOnField.setWidth("140");
-    // // publishedOnField.setFormat("Y-m-d");
-    // //
-    // // publishedOnField.addListener(new FieldListenerAdapter() {
-    // // public void onChange(final Field field, final Object newVal, final
-    // // Object oldVal) {
-    // // presenter.setPublishedOn((Date) newVal);
-    // // }
-    // // });
-    // //
-    // // form.add(publishedOnField);
-    // //
-    // // final VerticalPanel vp = new VerticalPanel();
-    // // vp.add(form);
-    // // return vp;
-    // //// }
-    //
-    // private VerticalPanel createTagsComponent() {
-    // final FormPanel form = createDefaultForm();
-    // tagsField = new TextArea();
-    // tagsField.setWidth("" + FORMS_WIDTH);
-    // tagsField.setHeight("3em");
-    // tagsField.addListener(new FieldListenerAdapter() {
-    // public void onChange(final Field field, final Object newVal, final
-    // Object oldVal) {
-    // presenter.setTags((String) newVal);
-    // }
-    // });
-    //
-    // form.add(tagsField);
-    // final VerticalPanel vp = new VerticalPanel();
-    // vp.add(form);
-    // return vp;
-    // }
-
-    // private void removeComponent(final String header) {
-    // options.removeStackItem(header);
-    // }
-
-}

Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -1,176 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.docs.client.ctx.admin;
-
-import java.util.Date;
-import java.util.List;
-
-import org.ourproject.kune.platf.client.dto.AccessListsDTO;
-import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
-import org.ourproject.kune.platf.client.dto.StateContainerDTO;
-import org.ourproject.kune.platf.client.dto.StateContentDTO;
-import org.ourproject.kune.platf.client.dto.TagResultDTO;
-import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
-import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
-import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.site.Site;
-import org.ourproject.kune.workspace.client.tags.TagsSummary;
-import org.ourproject.kune.workspace.client.title.EntitySubTitle;
-import org.ourproject.kune.workspace.client.title.EntityTitle;
-
-import com.calclab.suco.client.ioc.Provider;
-
-public class AdminContextPresenter implements AdminContext {
-
-    private AdminContextView view;
-    private final Session session;
-    private final Provider<TagsSummary> tagsSummaryProvider;
-    private final Provider<ContentServiceAsync> contentServiceProvider;
-    private final EntitySubTitle entitySubTitle;
-    private final EntityTitle entityTitle;
-    private final StateManager stateManager;
-
-    public AdminContextPresenter(final Session session, final StateManager stateManager,
-            final Provider<TagsSummary> tagsSummaryProvider,
-            final Provider<ContentServiceAsync> contentServiceProvider, final EntityTitle entityTitle,
-            final EntitySubTitle entitySubTitle) {
-        this.session = session;
-        this.stateManager = stateManager;
-        this.tagsSummaryProvider = tagsSummaryProvider;
-        this.contentServiceProvider = contentServiceProvider;
-        this.entityTitle = entityTitle;
-        this.entitySubTitle = entitySubTitle;
-    }
-
-    public void addAuthor(final String authorShortName) {
-        Site.showProgressProcessing();
-        final StateContainerDTO currentState = session.getContentState();
-        contentServiceProvider.get().addAuthor(session.getUserHash(), currentState.getStateToken(), authorShortName,
-                new AsyncCallbackSimple<Object>() {
-                    public void onSuccess(final Object result) {
-                        Site.hideProgress();
-                        stateManager.reload();
-                    }
-                });
-    }
-
-    public void attach() {
-        view.attach();
-    }
-
-    public void clear() {
-        view.reset();
-    }
-
-    public void delAuthor(final String authorShortName) {
-        Site.showProgressProcessing();
-        final StateContainerDTO currentState = session.getContentState();
-        contentServiceProvider.get().removeAuthor(session.getUserHash(), currentState.getStateToken(), authorShortName,
-                new AsyncCallbackSimple<Object>() {
-                    public void onSuccess(final Object result) {
-                        Site.hideProgress();
-                        stateManager.reload();
-                    }
-                });
-    }
-
-    public void detach() {
-        view.detach();
-    }
-
-    public void doChangeLanguage(final String langCode) {
-        Site.showProgressProcessing();
-        final StateContainerDTO currentState = session.getContentState();
-        contentServiceProvider.get().setLanguage(session.getUserHash(), currentState.getStateToken(), langCode,
-                new AsyncCallbackSimple<I18nLanguageDTO>() {
-                    public void onSuccess(final I18nLanguageDTO lang) {
-                        Site.hideProgress();
-                        entitySubTitle.setContentLanguage(lang.getEnglishName());
-                    }
-                });
-    }
-
-    public void init(final AdminContextView view) {
-        this.view = view;
-    }
-
-    public void setPublishedOn(final Date publishedOn) {
-        Site.showProgressProcessing();
-        final StateContainerDTO currentState = session.getContentState();
-        contentServiceProvider.get().setPublishedOn(session.getUserHash(), currentState.getStateToken(), publishedOn,
-                new AsyncCallbackSimple<Object>() {
-                    public void onSuccess(final Object result) {
-                        Site.hideProgress();
-                        entityTitle.setContentDate(publishedOn);
-                    }
-                });
-
-    }
-
-    public void setState(final StateContentDTO content) {
-        // In the future check the use of these components by each tool
-        final I18nLanguageDTO language = content.getLanguage();
-        final AccessListsDTO accessLists = content.getAccessLists();
-        final Date publishedOn = content.getPublishedOn();
-        final String tags = content.getTags();
-        final List<UserSimpleDTO> authors = content.getAuthors();
-
-        if (tags != null) {
-            view.setTags(tags);
-        } else {
-            view.removeTagsComponent();
-        }
-        if (language != null) {
-            view.setLanguage(language);
-        } else {
-            view.removeLangComponent();
-        }
-        if (authors != null) {
-            view.setAuthors(authors);
-        } else {
-            view.removeAuthorsComponent();
-        }
-        if (publishedOn != null) {
-            view.setPublishedOn(publishedOn);
-        } else {
-            view.removePublishedOnComponent();
-        }
-        if (accessLists != null) {
-            view.setAccessLists(accessLists);
-        } else {
-            view.removeAccessListComponent();
-        }
-    }
-
-    public void setTags(final String tagsString) {
-        Site.showProgressProcessing();
-        final StateContainerDTO currentState = session.getContentState();
-        contentServiceProvider.get().setTags(session.getUserHash(), currentState.getStateToken(), tagsString,
-                new AsyncCallbackSimple<List<TagResultDTO>>() {
-                    public void onSuccess(final List<TagResultDTO> result) {
-                        tagsSummaryProvider.get().setGroupTags(result);
-                        Site.hideProgress();
-                    }
-                });
-    }
-
-}

Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextView.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextView.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -1,58 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.docs.client.ctx.admin;
-
-import java.util.Date;
-import java.util.List;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.AccessListsDTO;
-import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
-import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
-
-public interface AdminContextView extends View {
-
-    void attach();
-
-    void detach();
-
-    void removeAccessListComponent();
-
-    void removeAuthorsComponent();
-
-    void removeLangComponent();
-
-    void removePublishedOnComponent();
-
-    void removeTagsComponent();
-
-    void reset();
-
-    void setAccessLists(AccessListsDTO accessLists);
-
-    void setAuthors(List<UserSimpleDTO> authors);
-
-    void setLanguage(I18nLanguageDTO language);
-
-    void setPublishedOn(Date publishedOn);
-
-    void setTags(String tags);
-
-}

Copied: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditor.java (from rev 937, trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContext.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContext.java	2008-10-30 17:13:18 UTC (rev 937)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditor.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -0,0 +1,32 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.docs.client.ctx.admin;
+
+import org.ourproject.kune.platf.client.dto.StateContentDTO;
+
+public interface DocContextEditor {
+    void attach();
+
+    void clear();
+
+    void detach();
+
+    void setState(StateContentDTO content);
+}


Property changes on: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditor.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorPanel.java (from rev 937, trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPanel.java	2008-10-30 17:13:18 UTC (rev 937)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorPanel.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -0,0 +1,277 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.docs.client.ctx.admin;
+
+import java.util.Date;
+import java.util.List;
+
+import org.ourproject.kune.platf.client.dto.AccessListsDTO;
+import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
+import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.VerticalPanel;
+
+public class DocContextEditorPanel extends VerticalPanel implements DocContextEditorView {
+    // private static final Images IMG = Images.App.getInstance();
+
+    // private static final int FORMS_WIDTH = 145;
+
+    // private final IndexedStackPanelWithSubItems options;
+    // private final AdminContextPresenter presenter;
+    //
+    // private AccessListsPanel accessListsPanel;
+    // private DateField publishedOnField;
+    // private TextArea tagsField;
+    // private VerticalPanel tagsComponent;
+    // private VerticalPanel publishedOnComponent;
+    // private LanguageSelectorComponent langPresenter;
+    // private VerticalPanel authorsComponent;
+    // private VerticalPanel langComponent;
+    // private IconLabel addAuthorLabel;
+    // private final I18nTranslationService i18n;
+    // private final String authors_item;
+    // private final String publication_item;
+    // private final String perms_item;
+    // private final String language_item;
+    // private final String tags_item;
+
+    private final WorkspaceSkeleton ws;
+    private final Label testLabel;
+
+    public DocContextEditorPanel(final DocContextEditorPresenter presenter, final I18nTranslationService i18n,
+            WorkspaceSkeleton ws) {
+        this.ws = ws;
+        testLabel = new Label("Admin ctx");
+        // this.presenter = presenter;
+        // this.i18n = i18n;
+        // options = new IndexedStackPanelWithSubItems();
+        // //options.addStyleName("kune-AdminContextPanel");
+        //
+        // //add(options);
+        // //setCellWidth(options, "100%");
+        // setWidth("100%");
+        // authors_item = i18n.t("Authors");
+        // publication_item = i18n.t("Publication");
+        // perms_item = i18n.t("Permissions");
+        // language_item = i18n.t("Language");
+        // tags_item = i18n.t("Tags");
+    }
+
+    public void attach() {
+        if (!testLabel.isAttached()) {
+            ws.getEntityWorkspace().setContext(testLabel);
+        }
+    }
+
+    public void detach() {
+        if (testLabel.isAttached()) {
+            testLabel.removeFromParent();
+        }
+    }
+
+    public void removeAccessListComponent() {
+        // if (options.containsItem(perms_item)) {
+        // removeComponent(perms_item);
+        // }
+    }
+
+    public void removeAuthorsComponent() {
+        // if (options.containsItem(authors_item)) {
+        // removeComponent(authors_item);
+        // }
+    }
+
+    public void removeLangComponent() {
+        // if (options.containsItem(language_item)) {
+        // removeComponent(language_item);
+        // }
+    }
+
+    public void removePublishedOnComponent() {
+        // if (options.containsItem(publication_item)) {
+        // removeComponent(publication_item);
+        // }
+    }
+
+    public void removeTagsComponent() {
+        // if (options.containsItem(tags_item)) {
+        // removeComponent(tags_item);
+        // }
+    }
+
+    public void reset() {
+        // options.clear();
+    }
+
+    public void setAccessLists(final AccessListsDTO accessLists) {
+        // if (accessListsPanel == null) {
+        // accessListsPanel = new AccessListsPanel(i18n);
+        // }
+        // if (!options.containsItem(perms_item)) {
+        // addComponent(perms_item, i18n.t("Who can admin/edit/view this work"),
+        // accessListsPanel);
+        // }
+        // accessListsPanel.setAccessLists(accessLists);
+    }
+
+    public void setAuthors(final List<UserSimpleDTO> authors) {
+        // if (authorsComponent == null) {
+        // authorsComponent = new VerticalPanel();
+        // addAuthorLabel = new IconLabel(IMG.addGreen(), i18n.t("Add author"));
+        // addAuthorLabel.addClickListener(new ClickListener() {
+        // public void onClick(final Widget sender) {
+        // presenter.doAction(DocsEvents.ADD_AUTHOR, null);
+        // }
+        // });
+        // } else {
+        // if (options.containsItem(authors_item)) {
+        // options.removeStackItem(authors_item);
+        // }
+        // authorsComponent.clear();
+        // }
+        // if (!options.containsItem(authors_item)) {
+        // addComponent(authors_item, i18n.t("Authors of this work"),
+        // authorsComponent);
+        // }
+        // for (final Iterator<UserSimpleDTO> iterator = authors.iterator();
+        // iterator.hasNext();) {
+        // final UserSimpleDTO author = iterator.next();
+        // final StackSubItemAction[] authorActions = { new
+        // StackSubItemAction(IMG.del(), i18n.t("Remove author"),
+        // DocsEvents.REMOVE_AUTHOR) };
+        // options.addStackSubItem(authors_item, IMG.personDef(),
+        // author.getShortName(), author.getName(),
+        // authorActions, presenter);
+        // }
+        // authorsComponent.add(addAuthorLabel);
+    }
+
+    public void setLanguage(final I18nLanguageDTO language) {
+        // if (langComponent == null) {
+        // langPresenter = WorkspaceFactory.createLanguageSelectorComponent();
+        // langComponent = new VerticalPanel();
+        // final LanguageSelectorPanel view = (LanguageSelectorPanel)
+        // langPresenter.getView();
+        // view.setWidth("" + FORMS_WIDTH);
+        // langComponent.add(view);
+        // view.addChangeListener(new ComboBoxListenerAdapter() {
+        // public void onSelect(final ComboBox comboBox, final Record record,
+        // final int index) {
+        // presenter.doChangeLanguage(record.getAsString(LanguageSelectorPanel.LANG_ID));
+        // }
+        // });
+        // }
+        // if (!options.containsItem(language_item)) {
+        // addComponent(language_item, i18n.t("The language of this work"),
+        // langComponent);
+        // }
+        // langPresenter.setLanguage(language);
+    }
+
+    public void setPublishedOn(final Date publishedOn) {
+        // if (publishedOnField == null) {
+        // publishedOnComponent = createPublicationComponent();
+        // }
+        // if (!options.containsItem(publication_item)) {
+        // addComponent(publication_item, i18n.t("Date of publication of this
+        // work"), publishedOnComponent);
+        // }
+        // // publishedOnField.setValue(publishedOn);
+    }
+
+    public void setTags(final String tags) {
+        // if (tagsComponent == null) {
+        // tagsComponent = createTagsComponent();
+        // }
+        // if (!options.containsItem(tags_item)) {
+        // addComponent(tags_item,
+        // i18n.t("Keywords or terms associated with this work"),
+        // tagsComponent);
+        // }
+        // tagsField.setValue(tags);
+        // }
+        //
+        // private void addComponent(final String header, final String
+        // headerTitle,
+        // final VerticalPanel panel) {
+        // panel.addStyleName("kune-AdminContextPanel-inner-wrap");
+        // final VerticalPanel vp = options.addStackItem(header, headerTitle,
+        // false);
+        // vp.setStyleName("kune-AdminContextPanel-inner");
+        // vp.add(panel);
+        // vp.setCellWidth(panel, "100%");
+        // vp.setWidth("100%");
+    }
+
+    // private FormPanel createDefaultForm() {
+    // final FormPanel form = new FormPanel();
+    // form.setHideLabels(true);
+    // form.setWidth(FORMS_WIDTH);
+    // form.setBorder(false);
+    // return form;
+    // }
+
+    // private VerticalPanel createPublicationComponent() {
+    // // final FormPanel form = createDefaultForm();
+    // //
+    // // publishedOnField = new DateField();
+    // // publishedOnField.setWidth("140");
+    // // publishedOnField.setFormat("Y-m-d");
+    // //
+    // // publishedOnField.addListener(new FieldListenerAdapter() {
+    // // public void onChange(final Field field, final Object newVal, final
+    // // Object oldVal) {
+    // // presenter.setPublishedOn((Date) newVal);
+    // // }
+    // // });
+    // //
+    // // form.add(publishedOnField);
+    // //
+    // // final VerticalPanel vp = new VerticalPanel();
+    // // vp.add(form);
+    // // return vp;
+    // //// }
+    //
+    // private VerticalPanel createTagsComponent() {
+    // final FormPanel form = createDefaultForm();
+    // tagsField = new TextArea();
+    // tagsField.setWidth("" + FORMS_WIDTH);
+    // tagsField.setHeight("3em");
+    // tagsField.addListener(new FieldListenerAdapter() {
+    // public void onChange(final Field field, final Object newVal, final
+    // Object oldVal) {
+    // presenter.setTags((String) newVal);
+    // }
+    // });
+    //
+    // form.add(tagsField);
+    // final VerticalPanel vp = new VerticalPanel();
+    // vp.add(form);
+    // return vp;
+    // }
+
+    // private void removeComponent(final String header) {
+    // options.removeStackItem(header);
+    // }
+
+}

Copied: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorPresenter.java (from rev 937, trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java	2008-10-30 17:13:18 UTC (rev 937)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorPresenter.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -0,0 +1,176 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.docs.client.ctx.admin;
+
+import java.util.Date;
+import java.util.List;
+
+import org.ourproject.kune.platf.client.dto.AccessListsDTO;
+import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
+import org.ourproject.kune.platf.client.dto.StateContainerDTO;
+import org.ourproject.kune.platf.client.dto.StateContentDTO;
+import org.ourproject.kune.platf.client.dto.TagResultDTO;
+import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
+import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.workspace.client.tags.TagsSummary;
+import org.ourproject.kune.workspace.client.title.EntitySubTitle;
+import org.ourproject.kune.workspace.client.title.EntityTitle;
+
+import com.calclab.suco.client.ioc.Provider;
+
+public class DocContextEditorPresenter implements DocContextEditor {
+
+    private DocContextEditorView view;
+    private final Session session;
+    private final Provider<TagsSummary> tagsSummaryProvider;
+    private final Provider<ContentServiceAsync> contentServiceProvider;
+    private final EntitySubTitle entitySubTitle;
+    private final EntityTitle entityTitle;
+    private final StateManager stateManager;
+
+    public DocContextEditorPresenter(final Session session, final StateManager stateManager,
+            final Provider<TagsSummary> tagsSummaryProvider,
+            final Provider<ContentServiceAsync> contentServiceProvider, final EntityTitle entityTitle,
+            final EntitySubTitle entitySubTitle) {
+        this.session = session;
+        this.stateManager = stateManager;
+        this.tagsSummaryProvider = tagsSummaryProvider;
+        this.contentServiceProvider = contentServiceProvider;
+        this.entityTitle = entityTitle;
+        this.entitySubTitle = entitySubTitle;
+    }
+
+    public void addAuthor(final String authorShortName) {
+        Site.showProgressProcessing();
+        final StateContainerDTO currentState = session.getContentState();
+        contentServiceProvider.get().addAuthor(session.getUserHash(), currentState.getStateToken(), authorShortName,
+                new AsyncCallbackSimple<Object>() {
+                    public void onSuccess(final Object result) {
+                        Site.hideProgress();
+                        stateManager.reload();
+                    }
+                });
+    }
+
+    public void attach() {
+        view.attach();
+    }
+
+    public void clear() {
+        view.reset();
+    }
+
+    public void delAuthor(final String authorShortName) {
+        Site.showProgressProcessing();
+        final StateContainerDTO currentState = session.getContentState();
+        contentServiceProvider.get().removeAuthor(session.getUserHash(), currentState.getStateToken(), authorShortName,
+                new AsyncCallbackSimple<Object>() {
+                    public void onSuccess(final Object result) {
+                        Site.hideProgress();
+                        stateManager.reload();
+                    }
+                });
+    }
+
+    public void detach() {
+        view.detach();
+    }
+
+    public void doChangeLanguage(final String langCode) {
+        Site.showProgressProcessing();
+        final StateContainerDTO currentState = session.getContentState();
+        contentServiceProvider.get().setLanguage(session.getUserHash(), currentState.getStateToken(), langCode,
+                new AsyncCallbackSimple<I18nLanguageDTO>() {
+                    public void onSuccess(final I18nLanguageDTO lang) {
+                        Site.hideProgress();
+                        entitySubTitle.setContentLanguage(lang.getEnglishName());
+                    }
+                });
+    }
+
+    public void init(final DocContextEditorView view) {
+        this.view = view;
+    }
+
+    public void setPublishedOn(final Date publishedOn) {
+        Site.showProgressProcessing();
+        final StateContainerDTO currentState = session.getContentState();
+        contentServiceProvider.get().setPublishedOn(session.getUserHash(), currentState.getStateToken(), publishedOn,
+                new AsyncCallbackSimple<Object>() {
+                    public void onSuccess(final Object result) {
+                        Site.hideProgress();
+                        entityTitle.setContentDate(publishedOn);
+                    }
+                });
+
+    }
+
+    public void setState(final StateContentDTO content) {
+        // In the future check the use of these components by each tool
+        final I18nLanguageDTO language = content.getLanguage();
+        final AccessListsDTO accessLists = content.getAccessLists();
+        final Date publishedOn = content.getPublishedOn();
+        final String tags = content.getTags();
+        final List<UserSimpleDTO> authors = content.getAuthors();
+
+        if (tags != null) {
+            view.setTags(tags);
+        } else {
+            view.removeTagsComponent();
+        }
+        if (language != null) {
+            view.setLanguage(language);
+        } else {
+            view.removeLangComponent();
+        }
+        if (authors != null) {
+            view.setAuthors(authors);
+        } else {
+            view.removeAuthorsComponent();
+        }
+        if (publishedOn != null) {
+            view.setPublishedOn(publishedOn);
+        } else {
+            view.removePublishedOnComponent();
+        }
+        if (accessLists != null) {
+            view.setAccessLists(accessLists);
+        } else {
+            view.removeAccessListComponent();
+        }
+    }
+
+    public void setTags(final String tagsString) {
+        Site.showProgressProcessing();
+        final StateContainerDTO currentState = session.getContentState();
+        contentServiceProvider.get().setTags(session.getUserHash(), currentState.getStateToken(), tagsString,
+                new AsyncCallbackSimple<List<TagResultDTO>>() {
+                    public void onSuccess(final List<TagResultDTO> result) {
+                        tagsSummaryProvider.get().setGroupTags(result);
+                        Site.hideProgress();
+                    }
+                });
+    }
+
+}


Property changes on: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorPresenter.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorView.java (from rev 937, trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextView.java	2008-10-30 17:13:18 UTC (rev 937)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorView.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -0,0 +1,58 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.docs.client.ctx.admin;
+
+import java.util.Date;
+import java.util.List;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.AccessListsDTO;
+import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
+import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
+
+public interface DocContextEditorView extends View {
+
+    void attach();
+
+    void detach();
+
+    void removeAccessListComponent();
+
+    void removeAuthorsComponent();
+
+    void removeLangComponent();
+
+    void removePublishedOnComponent();
+
+    void removeTagsComponent();
+
+    void reset();
+
+    void setAccessLists(AccessListsDTO accessLists);
+
+    void setAuthors(List<UserSimpleDTO> authors);
+
+    void setLanguage(I18nLanguageDTO language);
+
+    void setPublishedOn(Date publishedOn);
+
+    void setTags(String tags);
+
+}


Property changes on: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorView.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeActionListener.java (from rev 937, trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeListener.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeListener.java	2008-10-30 17:13:18 UTC (rev 937)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeActionListener.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.platf.client.state;
+
+public interface BeforeActionListener {
+
+    boolean beforeAction();
+
+}


Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeActionListener.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeCollection.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeCollection.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeCollection.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -2,7 +2,7 @@
 
 import java.util.ArrayList;
 
-public class BeforeStateChangeCollection extends ArrayList<BeforeStateChangeListener> {
+public class BeforeStateChangeCollection extends ArrayList<BeforeActionListener> {
 
     private static final long serialVersionUID = 1L;
 

Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeListener.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeListener.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -1,8 +0,0 @@
-package org.ourproject.kune.platf.client.state;
-
-
-public interface BeforeStateChangeListener {
-
-    boolean beforeChange(String newToken);
-
-}

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManager.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManager.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -29,7 +29,7 @@
 
 public interface StateManager {
 
-    void addBeforeStateChangeListener(BeforeStateChangeListener listener);
+    void addBeforeStateChangeListener(BeforeActionListener listener);
 
     void addSiteToken(String token, Listener0 whenToken);
 
@@ -47,7 +47,7 @@
 
     void reload();
 
-    void removeBeforeStateChangeListener(BeforeStateChangeListener listener);
+    void removeBeforeStateChangeListener(BeforeActionListener listener);
 
     void removeSiteToken(String token);
 

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -87,7 +87,7 @@
         beforeStateChangeCollection = new BeforeStateChangeCollection();
     }
 
-    public void addBeforeStateChangeListener(BeforeStateChangeListener listener) {
+    public void addBeforeStateChangeListener(BeforeActionListener listener) {
         beforeStateChangeCollection.add(listener);
     }
 
@@ -109,7 +109,7 @@
     }
 
     public void onHistoryChanged(final String historyToken) {
-        if (beforeStateListenersAllowChange(historyToken)) {
+        if (beforeStateListenersAllowChange()) {
             final Listener0 tokenListener = siteTokens.get(historyToken);
             Log.debug("StateManager: history token changed (" + historyToken + ")");
             if (tokenListener == null) {
@@ -125,7 +125,7 @@
                 tokenListener.onEvent();
             }
         } else {
-            resumedToken = previousToken;
+            resumedToken = new StateToken(historyToken);
         }
     }
 
@@ -150,7 +150,7 @@
         onHistoryChanged(history.getToken());
     }
 
-    public void removeBeforeStateChangeListener(BeforeStateChangeListener listener) {
+    public void removeBeforeStateChangeListener(BeforeActionListener listener) {
         beforeStateChangeCollection.remove(listener);
     }
 
@@ -199,9 +199,9 @@
         previousToken = newState.getStateToken();
     }
 
-    private boolean beforeStateListenersAllowChange(String newToken) {
-        for (BeforeStateChangeListener listener : beforeStateChangeCollection) {
-            if (!listener.beforeChange(newToken)) {
+    private boolean beforeStateListenersAllowChange() {
+        for (BeforeActionListener listener : beforeStateChangeCollection) {
+            if (!listener.beforeAction()) {
                 return false;
             }
         }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -27,7 +27,7 @@
 import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
 import org.ourproject.kune.platf.client.dto.AccessRolDTO;
 import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.state.BeforeStateChangeListener;
+import org.ourproject.kune.platf.client.state.BeforeActionListener;
 import org.ourproject.kune.platf.client.state.StateManager;
 import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
 
@@ -50,7 +50,7 @@
     private ActionToolbarButtonDescriptor<StateToken> save;
     private ActionToolbarButtonDescriptor<StateToken> close;
     private final I18nUITranslationService i18n;
-    private final BeforeStateChangeListener beforeStateChangeListener;
+    private final BeforeActionListener beforeStateChangeListener;
     private final StateManager stateManager;
 
     public TextEditorPresenter(final boolean isAutoSave, final ActionToolbar<StateToken> toolbar,
@@ -64,8 +64,8 @@
         saveAndCloseConfirmed = false;
         createActions();
 
-        beforeStateChangeListener = new BeforeStateChangeListener() {
-            public boolean beforeChange(String newToken) {
+        beforeStateChangeListener = new BeforeActionListener() {
+            public boolean beforeAction() {
                 return beforeTokenChange();
             }
         };

Modified: trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -29,8 +29,8 @@
     private MockListener2<String, String> groupChangeListener;
     private MockListener<StateAbstractDTO> stateChangeListener;
     private StateAbstractDTO state;
-    private BeforeStateChangeListener beforeChangeListener1;
-    private BeforeStateChangeListener beforeChangeListener2;
+    private BeforeActionListener beforeChangeListener1;
+    private BeforeActionListener beforeChangeListener2;
 
     @Before
     public void before() {
@@ -43,8 +43,8 @@
         stateChangeListener = new MockListener<StateAbstractDTO>();
         groupChangeListener = new MockListener2<String, String>();
         toolChangeListener = new MockListener2<String, String>();
-        beforeChangeListener1 = Mockito.mock(BeforeStateChangeListener.class);
-        beforeChangeListener2 = Mockito.mock(BeforeStateChangeListener.class);
+        beforeChangeListener1 = Mockito.mock(BeforeActionListener.class);
+        beforeChangeListener2 = Mockito.mock(BeforeActionListener.class);
         stateManager.onStateChanged(stateChangeListener);
         stateManager.onGroupChanged(groupChangeListener);
         stateManager.onToolChanged(toolChangeListener);
@@ -197,8 +197,8 @@
         stateManager.addBeforeStateChangeListener(beforeChangeListener1);
         stateManager.addBeforeStateChangeListener(beforeChangeListener2);
         String newToken = "something";
-        Mockito.stub(beforeChangeListener1.beforeChange(newToken)).toReturn(value);
-        Mockito.stub(beforeChangeListener2.beforeChange(newToken)).toReturn(value2);
+        Mockito.stub(beforeChangeListener1.beforeAction()).toReturn(value);
+        Mockito.stub(beforeChangeListener2.beforeAction()).toReturn(value2);
         return newToken;
     }
 

Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/KuneSeleniumTestHelper.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/KuneSeleniumTestHelper.java	2008-11-04 12:32:31 UTC (rev 938)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/KuneSeleniumTestHelper.java	2008-11-04 15:07:14 UTC (rev 939)
@@ -44,7 +44,7 @@
 
     @Before
     public void before() {
-        mustCapture = false;
+        mustCapture = true;
         try {
             selenium.deleteAllVisibleCookies();
             selenium.refresh();




More information about the kune-commits mailing list