[kune-commits] r1049 - in trunk: . img src/main/java/org/ourproject/kune/blogs/client src/main/java/org/ourproject/kune/docs/client src/main/java/org/ourproject/kune/gallery/client src/main/java/org/ourproject/kune/platf/client/actions src/main/java/org/ourproject/kune/platf/client/actions/toolbar src/main/java/org/ourproject/kune/platf/client/ui src/main/java/org/ourproject/kune/platf/client/ui/rte src/main/java/org/ourproject/kune/platf/client/ui/rte/impl src/main/java/org/ourproject/kune/workspace/client src/main/java/org/ourproject/kune/workspace/client/editor src/main/java/org/ourproject/kune/workspace/client/options/pscape

vjrj vjrj at ourproject.org
Sat Feb 14 12:23:20 CET 2009


Author: vjrj
Date: 2009-02-14 12:23:09 +0100 (Sat, 14 Feb 2009)
New Revision: 1049

Added:
   trunk/img/kune-arch-1sPart.png
Modified:
   trunk/DEV-GUIDE
   trunk/INSTALL
   trunk/TODO
   trunk/pom.xml
   trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java
   trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
   trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.java
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipsHelper.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditor.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorView.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RichTextArea.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/impl/RichTextAreaImplStandard.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPanel.java
Log:
Complete - task Some content status operations missing in some tools 

Complete - task Use gwt-log 2.5.3 


Modified: trunk/DEV-GUIDE
===================================================================
--- trunk/DEV-GUIDE	2009-02-12 14:06:25 UTC (rev 1048)
+++ trunk/DEV-GUIDE	2009-02-14 11:23:09 UTC (rev 1049)
@@ -115,6 +115,12 @@
 
 ==Some recommendations==
 
+===Usability===
+
+We try to make Kune very usable. Then please think like a human and use a human language in the UI messages, not techie language or Klingon or an alien language ;). 
+
+Your mother/father must understand and be capable of use Kune if they are capable of use yahoo/gmail/hotmail email accounts. It he/she are not capable of use Kune, we are not doing well our work, and we must do more usable our UI.
+
 ===Designs patterns===
 
 * MVC: We use a lot the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller MVC pattern] in our GWT code. See our HelloWorldModule class for a simple sample. We used to auto generate some MVC classes with the script script/generateBasicUIElements.sh:
@@ -124,8 +130,6 @@
 this generates four classes GroupOptions (the external interface), GroupOptionsPresenter (the Presenter with the business logic, the part you must test well), the GroupOptionsView (the interface to the panel, the UI code), the GroupOptionsPanel (the UI code, here all the gwt UI stuff). Also gives you in the standard output a sample code to use suco in a module to build these objects.
 * IoC: as we described before we use guice and suco for IoC. Again, see HelloWorldModule class for a very simple sample of gwt module using suco.
 
-===Usability===
-
 ==Development Environment==
 
 ===Prerequisite: Install kune===

Modified: trunk/INSTALL
===================================================================
--- trunk/INSTALL	2009-02-12 14:06:25 UTC (rev 1048)
+++ trunk/INSTALL	2009-02-14 11:23:09 UTC (rev 1049)
@@ -6,6 +6,11 @@
 
 ==Development instructions==
 
+===Prerrequisites===
+
+- Install java-jdk (>=5), maven2, mysql (> 5.0) and for example eclipse
+- Install gwt 1.5.3 and follow Appendix A for maven+gwt configuration
+
 ===MYSQL configuration===
 
 ====Before db creation====	
@@ -41,8 +46,6 @@
 
 ===Source code===
 
-- Install java-jdk (>=5), maven2, mysql (> 5.0) and for example eclipse
-- Install gwt 1.5.3 and follow Appendix A for maven+gwt configuration
 - Compile with maven:
  # (in the trunk directory)
  mvn compile -Dliquibase.should.run=false
@@ -78,11 +81,11 @@
  <property name="hibernate.search.default.indexBase" value="C:\kune\kune-index"/>
 do the same with every persistence unit defined inside.
 
-=== Run openfire jabber server===
+===Run openfire jabber server===
 
 Install and run a openfire jabber server (see Appendix B for proper configuration of openfire) or ejabberd.
 
-=== Install jmagick===
+===Install jmagick===
 
 Install jmagick-jni. In debian: apt-get install libjmagick6-jni (version 6.2.6-0) also you need or:
  sudo ln -s /usr/lib/jni/libJMagick.so /usr/lib/libJMagick.so

Modified: trunk/TODO
===================================================================
--- trunk/TODO	2009-02-12 14:06:25 UTC (rev 1048)
+++ trunk/TODO	2009-02-14 11:23:09 UTC (rev 1049)
@@ -144,10 +144,13 @@
 ** vjrj <v> IconHyperlink.java and IconLabel.java to gwt1.5
 
 * MID-TERM
-** <s,v> Samer suggests to implement a CBR system for suggests :)
-   http://en.wikipedia.org/wiki/Case-based_reasoning
-   linked with
-   http://www.mediawiki.org/wiki/API
+** <s,v> Integrate recommendations/suggestions subsystem
+*** Samer suggests to implement a CBR system for suggests :)
+    http://en.wikipedia.org/wiki/Case-based_reasoning
+    linked with
+    http://www.mediawiki.org/wiki/API
+*** links
+    http://taste.sourceforge.net/
 ** <s> Bastien's extension to emite, for assemblies:
 Possible extension of the Chat utility: make it a tool to take notes
 during a meeting.   Something where someone can define topics, where
@@ -441,6 +444,9 @@
 ** TODO <v> Strip html better in RTE, I18nTranslator, Chat
    http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/b4a27c80f50581cc
 ** TODO <v> See css utilities in http://code.google.com/p/cobogw/
+** TODO <v> kune & accessibility
+   http://googlewebtoolkit.blogspot.com/2008/09/built-in-accessibility-in-gwt-15.html
+   http://extjs.com/forum/showthread.php?t=12999
 ** FIXED <s,v> Add in license choose a free/non-free indicator [3]
 ** FIXED <v> browser font size (different from default) issues (scroll in dialogs, buttons background, etc)
    CLOSED: [2009-01-03 sáb 01:37]
@@ -456,7 +462,5 @@
 ** <s> integrate some blog/wiki converter:
    http://code.google.com/p/google-blog-converters-appengine/
    http://toolserver.org/~merphant/wiki2html/
-** Think about recommendations/suggestions
-   http://taste.sourceforge.net/
 * IDEAS
 ** <d> Try to find a way dozer maps directly without use getters/setters (less js code and better performance)

Added: trunk/img/kune-arch-1sPart.png
===================================================================
(Binary files differ)


Property changes on: trunk/img/kune-arch-1sPart.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml	2009-02-12 14:06:25 UTC (rev 1048)
+++ trunk/pom.xml	2009-02-14 11:23:09 UTC (rev 1049)
@@ -82,7 +82,7 @@
     <dependency>
       <groupId>com.calclab</groupId>
       <artifactId>suco</artifactId>
-      <version>0.5.2.2</version>
+      <version>0.6.0</version>
     </dependency>
     <dependency>
       <groupId>jmagick</groupId>
@@ -94,7 +94,7 @@
     <dependency>
       <groupId>com.calclab.emite</groupId>
       <artifactId>emite</artifactId>
-      <version>0.4.4</version>
+      <version>0.4.5</version>
     </dependency>
     <dependency>
       <groupId>org.jivesoftware.smack</groupId>
@@ -380,9 +380,24 @@
     </repository>
   </repositories>
   <issueManagement>
-    <system>google code issues list</system>
-    <url>http://code.google.com/p/kune/issues/list</url>
+    <system>kune issues list at ourproject.org</system>
+    <url>http://ourproject.org/tracker/?group_id=407</url>
   </issueManagement>
+  <developers>
+  	<developer>
+  		<id>dani</id>
+  		<name>Daniel Gómez Blasco</name>
+  		<email>danigb at gmail.com</email>
+  	</developer>
+  	<developer>
+  		<name>Samer Hassan</name>
+  		<email>samer2004 at gmail.com</email>
+  	</developer>
+  	<developer>
+  		<name>Vicente J. Ruiz Jurado</name>
+  		<email>vjrj at ourproject.org</email>
+  	</developer>
+  </developers>
   <scm>
     <url>svn://scm.ourproject.org/svnroot/kune/trunk</url>
   </scm>

Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java	2009-02-12 14:06:25 UTC (rev 1048)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java	2009-02-14 11:23:09 UTC (rev 1049)
@@ -78,9 +78,8 @@
         createNewContentAction(TYPE_POST, "images/nav/post_add.png", i18n.t("New post"), parentMenuTitleCtx,
                 Position.ctx, TYPE_BLOG);
 
-        createContentModeratedActions(parentMenuTitle, contentsModerated);
-
         createContentRenameAction(parentMenuTitle, i18n.t("Rename"), contents);
+        createContentModeratedActions(parentMenuTitle, contentsModerated);
         createRenameContentInCtxAction(parentMenuTitleCtx, i18n.t("Rename"), containersNoRoot);
 
         // final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupCxt =

Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java	2009-02-12 14:06:25 UTC (rev 1048)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java	2009-02-14 11:23:09 UTC (rev 1049)
@@ -79,9 +79,8 @@
         createNewContentAction(TYPE_DOCUMENT, "images/nav/page_add.png", i18n.t("New document"), parentMenuTitleCtx,
                 Position.ctx, TYPE_ROOT, TYPE_FOLDER);
 
-        createContentModeratedActions(parentMenuTitle, contentsModerated);
-
         createContentRenameAction(parentMenuTitle, i18n.t("Rename"), contents);
+        createContentModeratedActions(parentMenuTitle, contentsModerated);
         createRenameContentInCtxAction(parentMenuTitleCtx, i18n.t("Rename"), containersNoRoot);
 
         // final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupCxt =

Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java	2009-02-12 14:06:25 UTC (rev 1048)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java	2009-02-14 11:23:09 UTC (rev 1049)
@@ -77,9 +77,8 @@
         createNewContainerAction(TYPE_ALBUM, "images/nav/gallery_add.png", i18n.t("New album"), parentMenuTitleCtx,
                 i18n.t("New"), i18n.t("New album"), Position.ctx, TYPE_ROOT);
 
-        createContentModeratedActions(parentMenuTitle, contentsModerated);
-
         createContentRenameAction(parentMenuTitle, i18n.t("Rename"), contents);
+        createContentModeratedActions(parentMenuTitle, contentsModerated);
         createRenameContentInCtxAction(parentMenuTitleCtx, i18n.t("Rename"), containersNoRoot);
 
         // final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupCxt =

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java	2009-02-12 14:06:25 UTC (rev 1048)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java	2009-02-14 11:23:09 UTC (rev 1049)
@@ -215,6 +215,10 @@
         return shortcut;
     }
 
+    public String getShortcutToS() {
+        return shortcut == null ? "" : shortcut.toString();
+    }
+
     /**
      * Gets the text.
      * 

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.java	2009-02-12 14:06:25 UTC (rev 1048)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.java	2009-02-14 11:23:09 UTC (rev 1049)
@@ -38,6 +38,12 @@
 
     public ActionToolbarMenuDescriptor(final AccessRolDTO accessRolDTO,
             final ActionToolbarPosition actionToolbarPosition, final Listener<T> onPerformCall,
+            final ActionAddCondition<T> addCondition) {
+        super(accessRolDTO, actionToolbarPosition, onPerformCall, addCondition);
+    }
+
+    public ActionToolbarMenuDescriptor(final AccessRolDTO accessRolDTO,
+            final ActionToolbarPosition actionToolbarPosition, final Listener<T> onPerformCall,
             final ActionEnableCondition<T> enableCondition) {
         super(accessRolDTO, actionToolbarPosition, onPerformCall, enableCondition);
     }
@@ -49,6 +55,12 @@
 
     public ActionToolbarMenuDescriptor(final AccessRolDTO accessRolDTO,
             final ActionToolbarPosition actionToolbarPosition, final Listener0 onPerformCall,
+            final ActionAddCondition<T> addCondition) {
+        super(accessRolDTO, actionToolbarPosition, onPerformCall, addCondition);
+    }
+
+    public ActionToolbarMenuDescriptor(final AccessRolDTO accessRolDTO,
+            final ActionToolbarPosition actionToolbarPosition, final Listener0 onPerformCall,
             final ActionEnableCondition<T> enableCondition) {
         super(accessRolDTO, actionToolbarPosition, onPerformCall, enableCondition);
     }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java	2009-02-12 14:06:25 UTC (rev 1048)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java	2009-02-14 11:23:09 UTC (rev 1049)
@@ -184,18 +184,18 @@
         final ActionToolbarMenuDescriptor<T> action = (ActionToolbarMenuDescriptor<T>) actionItem.getAction();
         final Item item;
         if (action instanceof ActionToolbarMenuRadioDescriptor) {
-            CheckItem checkItem = new CheckItem(action.getText() + action.getShortcut());
+            CheckItem checkItem = new CheckItem(action.getText() + action.getShortcutToS());
             ActionToolbarMenuRadioDescriptor<T> radioDescriptor = (ActionToolbarMenuRadioDescriptor<T>) action;
             checkItem.setGroup(radioDescriptor.getGroup());
             checkItem.setChecked(radioDescriptor.mustBeChecked());
             item = checkItem;
         } else if (action instanceof ActionToolbarMenuCheckItemDescriptor) {
-            CheckItem checkItem = new CheckItem(action.getText() + action.getShortcut());
+            CheckItem checkItem = new CheckItem(action.getText() + action.getShortcutToS());
             ActionToolbarMenuCheckItemDescriptor<T> checkItemDescriptor = (ActionToolbarMenuCheckItemDescriptor<T>) action;
             checkItem.setChecked(checkItemDescriptor.getMustBeChecked().mustBeChecked());
             item = checkItem;
         } else {
-            item = new Item(action.getText() + action.getShortcut());
+            item = new Item(action.getText() + action.getShortcutToS());
         }
         BaseItemListenerAdapter clickListener = new BaseItemListenerAdapter() {
             @Override
@@ -205,6 +205,9 @@
         };
         item.addListener(clickListener);
         item.setIcon(action.getIconUrl());
+        // ToolTip tip = new ToolTip();
+        // tip.setHtml(action.getToolTip());
+        // tip.setShowDelay(5000);
         item.setTitle(action.getToolTip());
         if (id != null) {
             item.setId(id);

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipsHelper.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipsHelper.java	2009-02-12 14:06:25 UTC (rev 1048)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipsHelper.java	2009-02-14 11:23:09 UTC (rev 1049)
@@ -31,6 +31,6 @@
         quickTipInstance.setDismissDelay(7000);
         quickTipInstance.setHideDelay(400);
         quickTipInstance.setMinWidth(100);
-        quickTipInstance.setShowDelay(750);
+        quickTipInstance.setShowDelay(1500);
     }
 }
\ No newline at end of file

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditor.java	2009-02-12 14:06:25 UTC (rev 1048)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditor.java	2009-02-14 11:23:09 UTC (rev 1049)
@@ -4,29 +4,19 @@
 import org.ourproject.kune.platf.client.actions.ActionCollection;
 import org.ourproject.kune.platf.client.actions.ActionDescriptor;
 import org.ourproject.kune.platf.client.dto.AccessRolDTO;
-import org.ourproject.kune.platf.client.dto.StateToken;
 
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
 public interface RTEditor {
 
-    void addAction(ActionDescriptor<StateToken> action);
+    void addAction(ActionDescriptor<Object> action);
 
-    void addActions(ActionCollection<StateToken> actions);
+    void addActions(ActionCollection<Object> actions);
 
-    void editContent(String content, Listener<String> onSave, Listener0 onEditCancelled);
+    void editContent(String content);
 
     View getView();
 
-    void onSavedSuccessful();
-
-    void onSaveFailed();
-
     void setAccessRol(AccessRolDTO accessRol);
 
-    void setAutosave(boolean autosave);
-
     void setExtended(boolean extended);
 
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java	2009-02-12 14:06:25 UTC (rev 1048)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java	2009-02-14 11:23:09 UTC (rev 1049)
@@ -2,6 +2,9 @@
 
 import java.util.Date;
 
+import org.ourproject.kune.platf.client.actions.ActionCollection;
+import org.ourproject.kune.platf.client.ui.rte.RichTextArea.BasicFormatter;
+import org.ourproject.kune.platf.client.ui.rte.RichTextArea.ExtendedFormatter;
 import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
 
 import com.google.gwt.dom.client.Element;
@@ -10,9 +13,15 @@
 public class RTEditorPanel implements RTEditorView {
 
     private final I18nUITranslationService i18n;
+    private final RichTextArea rta;
+    private final BasicFormatter basic;
+    private final ExtendedFormatter extended;
 
     public RTEditorPanel(final RTEditorPresenter presenter, I18nUITranslationService i18n) {
         this.i18n = i18n;
+        rta = new RichTextArea();
+        basic = rta.getBasicFormatter();
+        extended = rta.getExtendedFormatter();
     }
 
     public void addComment(String userName) {
@@ -25,24 +34,160 @@
     }
 
     public boolean canBeExtended() {
+        return extended != null;
+    }
+
+    public void copy() {
+        extended.undo();
+    }
+
+    public void createlink(String url) {
         // TODO Auto-generated method stub
-        return false;
+
     }
 
+    public void cut() {
+        extended.undo();
+    }
+
+    public void delete() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void fontname(String name) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void fontsize(String size) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void forecolor(String color) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void indent() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void inserthorizontalrule() {
+        // TODO Auto-generated method stub
+
+    }
+
     public void insertHR() {
+        extended.insertHorizontalRule();
+    }
+
+    public void inserthtml(String html) {
         // TODO Auto-generated method stub
 
     }
 
+    public void insertimage(String url) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void insertorderedlist() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void insertparagraph() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void insertunorderedlist() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void italic() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void justifycenter() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void justifyfull() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void justifyleft() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void justifyright() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void outdent() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void paste() {
+        extended.undo();
+    }
+
     public void redo() {
+        extended.redo();
+    }
+
+    public void removeformat() {
         // TODO Auto-generated method stub
     }
 
+    public void selectall() {
+        // TODO Auto-generated method stub
+    }
+
     public void selectAll() {
         // TODO Auto-generated method stub
     }
 
-    public void undo() {
+    public void setActions(ActionCollection<Object> actions) {
         // TODO Auto-generated method stub
+
     }
+
+    public void strikethrough() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void subscript() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void superscript() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void underline() {
+        basic.toggleUnderline();
+    }
+
+    public void undo() {
+        extended.undo();
+    }
+
+    public void unlink() {
+        extended.removeLink();
+    }
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java	2009-02-12 14:06:25 UTC (rev 1048)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java	2009-02-14 11:23:09 UTC (rev 1049)
@@ -9,11 +9,10 @@
 import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
 import org.ourproject.kune.platf.client.actions.ContentEditorActionRegistry;
 import org.ourproject.kune.platf.client.dto.AccessRolDTO;
-import org.ourproject.kune.platf.client.dto.StateToken;
 import org.ourproject.kune.platf.client.services.I18nTranslationService;
 import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.workspace.client.site.Site;
 
-import com.calclab.suco.client.events.Listener;
 import com.calclab.suco.client.events.Listener0;
 
 public class RTEditorPresenter implements RTEditor {
@@ -21,32 +20,32 @@
     private static final String EDIT_MENU = "Edit";
     private static final String INSERT_MENU = "Insert";
     private RTEditorView view;
-    private boolean autosave;
     private boolean extended;
     private AccessRolDTO accessRol;
     private final I18nTranslationService i18n;
     private final Session session;
+    private final ActionCollection<Object> actions;
 
     public RTEditorPresenter(ContentEditorActionRegistry contentEditorActionRegistry, I18nTranslationService i18n,
             Session session) {
         this.i18n = i18n;
         this.session = session;
-        createDefActions();
-        autosave = false;
         extended = true;
         accessRol = AccessRolDTO.Editor;
+        actions = createDefActions();
     }
 
-    public void addAction(ActionDescriptor<StateToken> action) {
-        // TODO Auto-generated method stub
+    public void addAction(ActionDescriptor<Object> action) {
+        actions.add(action);
     }
 
-    public void addActions(ActionCollection<StateToken> actions) {
-        // TODO Auto-generated method stub
+    public void addActions(ActionCollection<Object> actions) {
+        this.actions.addAll(actions);
     }
 
-    public void editContent(String content, Listener<String> onSave, Listener0 onEditCancelled) {
-        // TODO Auto-generated method stub
+    public void editContent(String content) {
+        view.setActions(actions);
+
     }
 
     public View getView() {
@@ -57,28 +56,18 @@
         this.view = view;
     }
 
-    public void onSavedSuccessful() {
-        // TODO Auto-generated method stub
-    }
-
-    public void onSaveFailed() {
-        // TODO Auto-generated method stub
-    }
-
     public void setAccessRol(AccessRolDTO accessRol) {
         this.accessRol = accessRol;
     }
 
-    public void setAutosave(boolean autosave) {
-        this.autosave = autosave;
-    }
-
     public void setExtended(boolean extended) {
         this.extended = extended;
     }
 
-    private void createDefActions() {
-        ActionToolbarMenuDescriptor<StateToken> undo = new ActionToolbarMenuDescriptor<StateToken>(accessRol,
+    private ActionCollection<Object> createDefActions() {
+        ActionCollection<Object> defActions = new ActionCollection<Object>();
+
+        ActionToolbarMenuDescriptor<Object> undo = new ActionToolbarMenuDescriptor<Object>(accessRol,
                 ActionToolbarPosition.topbar, new Listener0() {
                     public void onEvent() {
                         view.undo();
@@ -88,7 +77,7 @@
         undo.setTextDescription(i18n.t("Undo"));
         undo.setParentMenuTitle(i18n.t(EDIT_MENU));
 
-        ActionToolbarMenuDescriptor<StateToken> redo = new ActionToolbarMenuDescriptor<StateToken>(accessRol,
+        ActionToolbarMenuDescriptor<Object> redo = new ActionToolbarMenuDescriptor<Object>(accessRol,
                 ActionToolbarPosition.topbar, new Listener0() {
                     public void onEvent() {
                         view.redo();
@@ -98,16 +87,55 @@
         redo.setTextDescription(i18n.t("Redo"));
         redo.setParentMenuTitle(i18n.t(EDIT_MENU));
 
-        ActionToolbarMenuDescriptor<StateToken> selectAll = new ActionToolbarMenuDescriptor<StateToken>(accessRol,
+        ActionToolbarMenuDescriptor<Object> copy = new ActionToolbarMenuDescriptor<Object>(accessRol,
                 ActionToolbarPosition.topbar, new Listener0() {
                     public void onEvent() {
-                        view.selectAll();
+                        view.copy();
                     }
                 });
+        copy.setShortcut(new ActionShortcut(true, 'C'));
+        copy.setTextDescription(i18n.t("Copy"));
+        copy.setParentMenuTitle(i18n.t(EDIT_MENU));
+
+        ActionToolbarMenuDescriptor<Object> cut = new ActionToolbarMenuDescriptor<Object>(accessRol,
+                ActionToolbarPosition.topbar, new Listener0() {
+                    public void onEvent() {
+                        view.cut();
+                    }
+                });
+        cut.setShortcut(new ActionShortcut(true, 'X'));
+        cut.setTextDescription(i18n.t("Cut"));
+        cut.setParentMenuTitle(i18n.t(EDIT_MENU));
+
+        ActionToolbarMenuDescriptor<Object> paste = new ActionToolbarMenuDescriptor<Object>(accessRol,
+                ActionToolbarPosition.topbar, new Listener0() {
+                    public void onEvent() {
+                        view.paste();
+                    }
+                });
+        paste.setShortcut(new ActionShortcut(true, 'V'));
+        paste.setTextDescription(i18n.t("Paste"));
+        paste.setParentMenuTitle(i18n.t(EDIT_MENU));
+
+        ActionToolbarMenuDescriptor<Object> selectAll = new ActionToolbarMenuDescriptor<Object>(accessRol,
+                ActionToolbarPosition.topbar, new Listener0() {
+                    public void onEvent() {
+                        view.selectall();
+                    }
+                });
         selectAll.setShortcut(new ActionShortcut(true, 'A'));
         selectAll.setTextDescription(i18n.t("Select all"));
         selectAll.setParentMenuTitle(i18n.t(EDIT_MENU));
 
+        ActionToolbarMenuDescriptor<Object> editHtml = new ActionToolbarMenuDescriptor<Object>(accessRol,
+                ActionToolbarPosition.topbar, new Listener0() {
+                    public void onEvent() {
+                        Site.info("In dev");
+                    }
+                });
+        editHtml.setTextDescription(i18n.t("Edit HTML"));
+        editHtml.setParentMenuTitle(i18n.t(EDIT_MENU));
+
         ActionToolbarMenuDescriptor<Object> comment = new ActionToolbarMenuDescriptor<Object>(accessRol,
                 ActionToolbarPosition.topbar, new Listener0() {
                     public void onEvent() {
@@ -122,13 +150,24 @@
         ActionToolbarMenuDescriptor<Object> hr = new ActionToolbarMenuDescriptor<Object>(accessRol,
                 ActionToolbarPosition.topbar, new Listener0() {
                     public void onEvent() {
-                        view.insertHR();
+                        view.inserthorizontalrule();
                     }
                 });
         hr.setShortcut(new ActionShortcut(true, 'M'));
         hr.setTextDescription(i18n.t("Horizontal line"));
         hr.setParentMenuTitle(i18n.t(INSERT_MENU));
         hr.setEnableCondition(isExtended());
+
+        defActions.add(undo);
+        defActions.add(redo);
+        defActions.add(copy);
+        defActions.add(cut);
+        defActions.add(paste);
+        defActions.add(selectAll);
+        defActions.add(editHtml);
+        defActions.add(comment);
+        defActions.add(hr);
+        return defActions;
     }
 
     private ActionEnableCondition<Object> isExtended() {

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorView.java	2009-02-12 14:06:25 UTC (rev 1048)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorView.java	2009-02-14 11:23:09 UTC (rev 1049)
@@ -1,6 +1,7 @@
 package org.ourproject.kune.platf.client.ui.rte;
 
 import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.actions.ActionCollection;
 
 public interface RTEditorView extends View {
 
@@ -8,11 +9,65 @@
 
     boolean canBeExtended();
 
-    void insertHR();
+    void copy();
 
+    void createlink(String url);
+
+    void cut();
+
+    void delete();
+
+    void fontname(String name);
+
+    void fontsize(String size);
+
+    void forecolor(String color);
+
+    void indent();
+
+    void inserthorizontalrule();
+
+    void inserthtml(String html);
+
+    void insertimage(String url);
+
+    void insertorderedlist();
+
+    void insertparagraph();
+
+    void insertunorderedlist();
+
+    void italic();
+
+    void justifycenter();
+
+    void justifyfull();
+
+    void justifyleft();
+
+    void justifyright();
+
+    void outdent();
+
+    void paste();
+
     void redo();
 
-    void selectAll();
+    void removeformat();
 
+    void selectall();
+
+    void setActions(ActionCollection<Object> actions);
+
+    void strikethrough();
+
+    void subscript();
+
+    void superscript();
+
+    void underline();
+
     void undo();
+
+    void unlink();
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RichTextArea.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RichTextArea.java	2009-02-12 14:06:25 UTC (rev 1048)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RichTextArea.java	2009-02-14 11:23:09 UTC (rev 1049)
@@ -181,6 +181,8 @@
      */
     public interface ExtendedFormatter extends BasicFormatter {
 
+        void copy();
+
         /**
          * Creates a link to the supplied URL.
          * 
@@ -189,6 +191,8 @@
          */
         void createLink(String url);
 
+        void cut();
+
         /**
          * Inserts a horizontal rule.
          */
@@ -229,6 +233,10 @@
          */
         void leftIndent();
 
+        void paste();
+
+        void redo();
+
         /**
          * Removes all formatting on the selected text.
          */
@@ -248,6 +256,8 @@
          * Toggles strikethrough.
          */
         void toggleStrikethrough();
+
+        void undo();
     }
 
     /**

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/impl/RichTextAreaImplStandard.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/impl/RichTextAreaImplStandard.java	2009-02-12 14:06:25 UTC (rev 1048)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/impl/RichTextAreaImplStandard.java	2009-02-14 11:23:09 UTC (rev 1049)
@@ -42,15 +42,23 @@
      */
     protected boolean initializing;
 
+    public void copy() {
+        execCommand("Copy", null);
+    }
+
     @Override
     public native Element createElement() /*-{
-          return $doc.createElement('iframe');
-        }-*/;
+             return $doc.createElement('iframe');
+           }-*/;
 
     public void createLink(String url) {
         execCommand("CreateLink", url);
     }
 
+    public void cut() {
+        execCommand("Cut", null);
+    }
+
     public String getBackColor() {
         return queryCommandValue("BackColor");
     }
@@ -71,19 +79,19 @@
 
     @Override
     public native void initElement() /*-{
-         // Most browsers don't like setting designMode until slightly _after_
-         // the iframe becomes attached to the DOM. Any non-zero timeout will do
-         // just fine.
-         var _this = this;
-         _this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing = true;
-         setTimeout(function() {
-           // Turn on design mode.
-           _this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.designMode = 'On';
+            // Most browsers don't like setting designMode until slightly _after_
+            // the iframe becomes attached to the DOM. Any non-zero timeout will do
+            // just fine.
+            var _this = this;
+            _this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing = true;
+            setTimeout(function() {
+              // Turn on design mode.
+              _this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.designMode = 'On';
 
-           // Send notification that the iframe has reached design mode.
-           _this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
-         }, 1);
-       }-*/;
+              // Send notification that the iframe has reached design mode.
+              _this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
+            }, 1);
+          }-*/;
 
     public void insertHorizontalRule() {
         execCommand("InsertHorizontalRule", null);
@@ -143,6 +151,14 @@
         execCommand("Outdent", null);
     }
 
+    public void paste() {
+        execCommand("Paste", null);
+    }
+
+    public void redo() {
+        execCommand("Redo", null);
+    }
+
     public void removeFormat() {
         execCommand("RemoveFormat", null);
     }
@@ -165,12 +181,12 @@
 
     @Override
     public native void setFocus(boolean focused) /*-{
-          if (focused) {
-            this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.focus();
-          } else {
-            this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.blur();
-          }
-        }-*/;
+             if (focused) {
+               this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.focus();
+             } else {
+               this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.blur();
+             }
+           }-*/;
 
     public void setFontName(String name) {
         execCommand("FontName", name);
@@ -236,6 +252,10 @@
         execCommand("Underline", "False");
     }
 
+    public void undo() {
+        execCommand("Undo", null);
+    }
+
     @Override
     public void uninitElement() {
         // Issue 1897: initElement uses a timeout, so its possible to call this
@@ -260,55 +280,55 @@
     }
 
     protected native String getHTMLImpl() /*-{
-          return this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.body.innerHTML;
-        }-*/;
+             return this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.body.innerHTML;
+           }-*/;
 
     protected native String getTextImpl() /*-{
-          return this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.body.textContent;
-        }-*/;
+             return this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.body.textContent;
+           }-*/;
 
     @Override
     protected native void hookEvents() /*-{
-          var elem = this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
-          var wnd = elem.contentWindow;
+             var elem = this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
+             var wnd = elem.contentWindow;
 
-          elem.__gwt_handler = function(evt) {
-            if (elem.__listener) {
-              elem.__listener. at org.ourproject.kune.platf.client.ui.rte.RichTextArea::onBrowserEvent(Lcom/google/gwt/user/client/Event;)(evt);
-            }
-          };
+             elem.__gwt_handler = function(evt) {
+               if (elem.__listener) {
+                 elem.__listener. at org.ourproject.kune.platf.client.ui.rte.RichTextArea::onBrowserEvent(Lcom/google/gwt/user/client/Event;)(evt);
+               }
+             };
 
-          elem.__gwt_focusHandler = function(evt) {
-            if (elem.__gwt_isFocused) {
-              return;
-            }
+             elem.__gwt_focusHandler = function(evt) {
+               if (elem.__gwt_isFocused) {
+                 return;
+               }
 
-            elem.__gwt_isFocused = true;
-            elem.__gwt_handler(evt);
-          };
+               elem.__gwt_isFocused = true;
+               elem.__gwt_handler(evt);
+             };
 
-          elem.__gwt_blurHandler = function(evt) {
-            if (!elem.__gwt_isFocused) {
-              return;
-            }
+             elem.__gwt_blurHandler = function(evt) {
+               if (!elem.__gwt_isFocused) {
+                 return;
+               }
 
-            elem.__gwt_isFocused = false;
-            elem.__gwt_handler(evt);
-          };
+               elem.__gwt_isFocused = false;
+               elem.__gwt_handler(evt);
+             };
 
-          wnd.addEventListener('keydown', elem.__gwt_handler, true);
-          wnd.addEventListener('keyup', elem.__gwt_handler, true);
-          wnd.addEventListener('keypress', elem.__gwt_handler, true);
-          wnd.addEventListener('mousedown', elem.__gwt_handler, true);
-          wnd.addEventListener('mouseup', elem.__gwt_handler, true);
-          wnd.addEventListener('mousemove', elem.__gwt_handler, true);
-          wnd.addEventListener('mouseover', elem.__gwt_handler, true);
-          wnd.addEventListener('mouseout', elem.__gwt_handler, true);
-          wnd.addEventListener('click', elem.__gwt_handler, true);
+             wnd.addEventListener('keydown', elem.__gwt_handler, true);
+             wnd.addEventListener('keyup', elem.__gwt_handler, true);
+             wnd.addEventListener('keypress', elem.__gwt_handler, true);
+             wnd.addEventListener('mousedown', elem.__gwt_handler, true);
+             wnd.addEventListener('mouseup', elem.__gwt_handler, true);
+             wnd.addEventListener('mousemove', elem.__gwt_handler, true);
+             wnd.addEventListener('mouseover', elem.__gwt_handler, true);
+             wnd.addEventListener('mouseout', elem.__gwt_handler, true);
+             wnd.addEventListener('click', elem.__gwt_handler, true);
 
-          wnd.addEventListener('focus', elem.__gwt_focusHandler, true);
-          wnd.addEventListener('blur', elem.__gwt_blurHandler, true);
-        }-*/;
+             wnd.addEventListener('focus', elem.__gwt_focusHandler, true);
+             wnd.addEventListener('blur', elem.__gwt_blurHandler, true);
+           }-*/;
 
     @Override
     protected void onElementInitialized() {
@@ -330,34 +350,34 @@
     }
 
     protected native void setHTMLImpl(String html) /*-{
-          this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.body.innerHTML = html;
-        }-*/;
+             this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.body.innerHTML = html;
+           }-*/;
 
     protected native void setTextImpl(String text) /*-{
-          this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.body.textContent = text;
-        }-*/;
+             this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.body.textContent = text;
+           }-*/;
 
     protected native void unhookEvents() /*-{
-          var elem = this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
-          var wnd = elem.contentWindow;
+             var elem = this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
+             var wnd = elem.contentWindow;
 
-          wnd.removeEventListener('keydown', elem.__gwt_handler, true);
-          wnd.removeEventListener('keyup', elem.__gwt_handler, true);
-          wnd.removeEventListener('keypress', elem.__gwt_handler, true);
-          wnd.removeEventListener('mousedown', elem.__gwt_handler, true);
-          wnd.removeEventListener('mouseup', elem.__gwt_handler, true);
-          wnd.removeEventListener('mousemove', elem.__gwt_handler, true);
-          wnd.removeEventListener('mouseover', elem.__gwt_handler, true);
-          wnd.removeEventListener('mouseout', elem.__gwt_handler, true);
-          wnd.removeEventListener('click', elem.__gwt_handler, true);
+             wnd.removeEventListener('keydown', elem.__gwt_handler, true);
+             wnd.removeEventListener('keyup', elem.__gwt_handler, true);
+             wnd.removeEventListener('keypress', elem.__gwt_handler, true);
+             wnd.removeEventListener('mousedown', elem.__gwt_handler, true);
+             wnd.removeEventListener('mouseup', elem.__gwt_handler, true);
+             wnd.removeEventListener('mousemove', elem.__gwt_handler, true);
+             wnd.removeEventListener('mouseover', elem.__gwt_handler, true);
+             wnd.removeEventListener('mouseout', elem.__gwt_handler, true);
+             wnd.removeEventListener('click', elem.__gwt_handler, true);
 
-          wnd.removeEventListener('focus', elem.__gwt_focusHandler, true);
-          wnd.removeEventListener('blur', elem.__gwt_blurHandler, true);
+             wnd.removeEventListener('focus', elem.__gwt_focusHandler, true);
+             wnd.removeEventListener('blur', elem.__gwt_blurHandler, true);
 
-          elem.__gwt_handler = null;
-          elem.__gwt_focusHandler = null;
-          elem.__gwt_blurHandler = null;
-        }-*/;
+             elem.__gwt_handler = null;
+             elem.__gwt_focusHandler = null;
+             elem.__gwt_blurHandler = null;
+           }-*/;
 
     void execCommand(String cmd, String param) {
         if (isRichEditingActive(elem)) {
@@ -370,12 +390,12 @@
     }
 
     native void execCommandAssumingFocus(String cmd, String param) /*-{
-          this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.execCommand(cmd, false, param);
-        }-*/;
+             this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.execCommand(cmd, false, param);
+           }-*/;
 
     native boolean isRichEditingActive(Element e) /*-{
-          return ((e.contentWindow.document.designMode).toUpperCase()) == 'ON';
-        }-*/;
+             return ((e.contentWindow.document.designMode).toUpperCase()) == 'ON';
+           }-*/;
 
     boolean queryCommandState(String cmd) {
         if (isRichEditingActive(elem)) {
@@ -390,8 +410,8 @@
     }
 
     native boolean queryCommandStateAssumingFocus(String cmd) /*-{
-          return !!this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.queryCommandState(cmd);
-        }-*/;
+             return !!this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.queryCommandState(cmd);
+           }-*/;
 
     String queryCommandValue(String cmd) {
         // When executing a command, focus the iframe first, since some commands
@@ -401,6 +421,6 @@
     }
 
     native String queryCommandValueAssumingFocus(String cmd) /*-{
-          return this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.queryCommandValue(cmd);
-        }-*/;
+             return this. at org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.queryCommandValue(cmd);
+           }-*/;
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java	2009-02-12 14:06:25 UTC (rev 1048)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java	2009-02-14 11:23:09 UTC (rev 1049)
@@ -19,7 +19,6 @@
  */
 package org.ourproject.kune.workspace.client;
 
-import org.ourproject.kune.platf.client.actions.ActionAddCondition;
 import org.ourproject.kune.platf.client.actions.ActionCheckedCondition;
 import org.ourproject.kune.platf.client.actions.ActionEnableCondition;
 import org.ourproject.kune.platf.client.actions.ActionMenuItemDescriptor;
@@ -74,6 +73,8 @@
         cnt, ctx
     }
 
+    private static final String PUBLICATION_MENU = "Publication";
+
     protected final Session session;
     protected final StateManager stateManager;
     protected final I18nUITranslationService i18n;
@@ -129,28 +130,16 @@
     }
 
     protected void createContentModeratedActions(String parentMenuTitle, final String... contentsModerated) {
-        final ActionToolbarMenuRadioDescriptor<StateToken> setPublishStatus = createSetStatusAction(
-                AccessRolDTO.Administrator, i18n.t("Published online"), parentMenuTitle,
-                ContentStatusDTO.publishedOnline);
-        final ActionToolbarMenuRadioDescriptor<StateToken> setEditionInProgressStatus = createSetStatusAction(
-                AccessRolDTO.Editor, i18n.t("Editing in progress"), parentMenuTitle, ContentStatusDTO.editingInProgress);
-        final ActionToolbarMenuRadioDescriptor<StateToken> setRejectStatus = createSetStatusAction(
-                AccessRolDTO.Administrator, i18n.t("Rejected"), parentMenuTitle, ContentStatusDTO.rejected);
-        final ActionToolbarMenuRadioDescriptor<StateToken> setSubmittedForPublishStatus = createSetStatusAction(
-                AccessRolDTO.Editor, i18n.t("Submitted for publish"), parentMenuTitle,
-                ContentStatusDTO.submittedForEvaluation);
-        final ActionToolbarMenuRadioDescriptor<StateToken> setInTheDustBinStatus = createSetStatusAction(
-                AccessRolDTO.Administrator, i18n.t("In the rubbish bin"), parentMenuTitle,
-                ContentStatusDTO.inTheDustbin);
-        contentActionRegistry.addAction(setPublishStatus, contentsModerated);
-        contentActionRegistry.addAction(setEditionInProgressStatus, contentsModerated);
-        contentActionRegistry.addAction(setRejectStatus, contentsModerated);
-        contentActionRegistry.addAction(setSubmittedForPublishStatus, contentsModerated);
-        contentActionRegistry.addAction(setInTheDustBinStatus, contentsModerated);
-        createPublishAction("images/accept.png", i18n.t("Publish online"), ContentStatusDTO.publishedOnline,
+        createSetStatusAction(AccessRolDTO.Administrator, i18n.t("Published online"), ContentStatusDTO.publishedOnline,
                 contentsModerated);
-        createPublishAction("images/cancel.png", i18n.t("Reject publication"), ContentStatusDTO.rejected,
+        createSetStatusAction(AccessRolDTO.Editor, i18n.t("Editing in progress"), ContentStatusDTO.editingInProgress,
                 contentsModerated);
+        createSetStatusAction(AccessRolDTO.Administrator, i18n.t("Rejected"), ContentStatusDTO.rejected,
+                contentsModerated);
+        createSetStatusAction(AccessRolDTO.Editor, i18n.t("Submitted for publish"),
+                ContentStatusDTO.submittedForEvaluation, contentsModerated);
+        createSetStatusAction(AccessRolDTO.Administrator, i18n.t("In the rubbish bin"), ContentStatusDTO.inTheDustbin,
+                contentsModerated);
     }
 
     protected void createContentRenameAction(String parentMenuTitle, String textDescription, String... registerInTypes) {
@@ -381,28 +370,6 @@
     protected void createPostSessionInitActions() {
     }
 
-    protected void createPublishAction(String icon, String tooltip, final ContentStatusDTO status,
-            String... registerInTypes) {
-        ActionToolbarButtonDescriptor<StateToken> pubAction = new ActionToolbarButtonDescriptor<StateToken>(
-                AccessRolDTO.Administrator, ActionToolbarPosition.topbar, new Listener<StateToken>() {
-                    public void onEvent(StateToken stateToken) {
-                        setContentStatus(status, stateToken);
-                    }
-                }, new ActionAddCondition<StateToken>() {
-                    public boolean mustBeAdded(StateToken token) {
-                        if (session.isCurrentStateAContent()
-                                && session.getContentState().getStatus().equals(ContentStatusDTO.submittedForEvaluation)) {
-                            return true;
-                        }
-                        return false;
-                    }
-                });
-        pubAction.setMustBeAuthenticated(true);
-        pubAction.setToolTip(tooltip);
-        pubAction.setIconUrl(icon);
-        contentActionRegistry.addAction(pubAction, registerInTypes);
-    }
-
     protected ActionToolbarMenuDescriptor<StateToken> createRefreshCntAction(String parentMenuTitle,
             String... registerInTypes) {
         final ActionToolbarMenuDescriptor<StateToken> refreshCnt = new ActionToolbarMenuDescriptor<StateToken>(
@@ -476,8 +443,8 @@
         return setAsDefGroupContent;
     }
 
-    protected ActionToolbarMenuRadioDescriptor<StateToken> createSetStatusAction(final AccessRolDTO rol,
-            final String textDescription, String parentMenuTitle, final ContentStatusDTO status) {
+    protected void createSetStatusAction(final AccessRolDTO rol, final String textDescription,
+            final ContentStatusDTO status, String[] contentsModerated) {
         final ActionToolbarMenuRadioDescriptor<StateToken> action = new ActionToolbarMenuRadioDescriptor<StateToken>(
                 rol, ActionToolbarPosition.topbar, new Listener<StateToken>() {
                     public void onEvent(final StateToken stateToken) {
@@ -493,9 +460,9 @@
                     }
                 });
         action.setTextDescription(textDescription);
-        action.setParentMenuTitle(parentMenuTitle);
-        action.setParentSubMenuTitle(i18n.t("Change the status"));
-        return action;
+        action.setParentMenuTitle(PUBLICATION_MENU);
+        // action.setParentSubMenuTitle(i18n.t("Change the status"));
+        contentActionRegistry.addAction(action, contentsModerated);
     }
 
     protected void createShowDeletedItems(String parentMenuTitle, String... registerInTypes) {

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	2009-02-12 14:06:25 UTC (rev 1048)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java	2009-02-14 11:23:09 UTC (rev 1049)
@@ -19,7 +19,6 @@
  */
 package org.ourproject.kune.workspace.client.editor;
 
-import org.ourproject.kune.platf.client.View;
 import org.ourproject.kune.platf.client.actions.ActionItem;
 import org.ourproject.kune.platf.client.actions.ActionItemCollection;
 import org.ourproject.kune.platf.client.actions.ActionToolbarButtonDescriptor;
@@ -89,14 +88,6 @@
         siteSignOutLink.addBeforeSignOut(beforeStateChangeListener);
     }
 
-    public String getContent() {
-        return view.getHTML();
-    }
-
-    public View getView() {
-        return view;
-    }
-
     public void init(final TextEditorView view) {
         this.view = view;
         this.view.setEnabled(true);

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPanel.java	2009-02-12 14:06:25 UTC (rev 1048)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPanel.java	2009-02-14 11:23:09 UTC (rev 1049)
@@ -38,7 +38,7 @@
 
     public EntityOptionsPublicSpaceConfPanel(final EntityOptionsPublicSpaceConfPresenter presenter,
             final WorkspaceSkeleton ws, I18nTranslationService i18n, WsThemePresenter wsPresenter) {
-        super.setTitle(i18n.t("Styling"));
+        super.setTitle(i18n.t("Style"));
         super.setIconCls("k-colors-icon");
         super.setAutoScroll(true);
         super.setBorder(false);




More information about the kune-commits mailing list