[kune-commits] r1138 - in trunk: src/main/java src/main/java/com src/main/java/com/google src/main/java/com/google/gwt src/main/java/com/google/gwt/wave src/main/java/com/google/gwt/wave/client src/main/java/com/google/gwt/wave/client/event src/main/java/com/google/gwt/wave/public src/main/java/org/ourproject/kune/app src/main/java/org/ourproject/kune/blogs/client/cnt src/main/java/org/ourproject/kune/docs/client src/main/java/org/ourproject/kune/docs/client/cnt src/main/java/org/ourproject/kune/docs/server src/main/java/org/ourproject/kune/gallery/client/cnt src/main/java/org/ourproject/kune/platf/client/rpc src/main/java/org/ourproject/kune/platf/server/domain src/main/java/org/ourproject/kune/platf/server/rpc src/main/java/org/ourproject/kune/platf/server/tool src/main/java/org/ourproject/kune/wiki/client/cnt src/main/java/org/ourproject/kune/workspace/client src/main/java/org/ourproject/kune/workspace/client/cnt src/main/java/org/ourproject/kune/workspace/client/skel src/main/java/org/ourproject/kune/workspace/client/tool src/test/java/org/ourproject/kune/platf/integration war

vjrj vjrj at ourproject.org
Wed Jul 22 22:31:11 CEST 2009


Author: vjrj
Date: 2009-07-22 22:31:08 +0200 (Wed, 22 Jul 2009)
New Revision: 1138

Added:
   trunk/src/main/java/com/
   trunk/src/main/java/com/google/
   trunk/src/main/java/com/google/gwt/
   trunk/src/main/java/com/google/gwt/wave/
   trunk/src/main/java/com/google/gwt/wave/Wave.gwt.xml
   trunk/src/main/java/com/google/gwt/wave/client/
   trunk/src/main/java/com/google/gwt/wave/client/WaveEmbed.java
   trunk/src/main/java/com/google/gwt/wave/client/WaveWidget.java
   trunk/src/main/java/com/google/gwt/wave/client/WaveWidgetTest.java
   trunk/src/main/java/com/google/gwt/wave/client/event/
   trunk/src/main/java/com/google/gwt/wave/client/event/HasWaveLoadHandlers.java
   trunk/src/main/java/com/google/gwt/wave/client/event/WaveLoadEvent.java
   trunk/src/main/java/com/google/gwt/wave/client/event/WaveLoadHandler.java
   trunk/src/main/java/com/google/gwt/wave/client/package.html
   trunk/src/main/java/com/google/gwt/wave/public/
   trunk/src/main/java/com/google/gwt/wave/public/wave_embed.js
   trunk/war/ws-aux/
Modified:
   trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml
   trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPresenter.java
   trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
   trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
   trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPresenter.java
   trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java
   trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPresenter.java
   trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentService.java
   trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentServiceAsync.java
   trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java
   trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java
   trunk/src/main/java/org/ourproject/kune/platf/server/tool/ServerTool.java
   trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentView.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/tool/FoldableAbstractClientTool.java
   trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTestHelper.java
Log:
Incomplete - taskwave simple integration 


Added: trunk/src/main/java/com/google/gwt/wave/Wave.gwt.xml
===================================================================
--- trunk/src/main/java/com/google/gwt/wave/Wave.gwt.xml	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/com/google/gwt/wave/Wave.gwt.xml	2009-07-22 20:31:08 UTC (rev 1138)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6.4//EN"
+  "http://google-web-toolkit.googlecode.com/svn/tags/1.6.4/distro-source/core/src/gwt-module.dtd">
+<!--                                                                        -->
+<!-- Copyright 2009 Google Inc.                                             -->
+<!-- Licensed under the Apache License, Version 2.0 (the "License"); you    -->
+<!-- may not use this file except in compliance with the License. You may   -->
+<!-- may obtain a copy of the License at                                    -->
+<!--                                                                        -->
+<!-- http://www.apache.org/licenses/LICENSE-2.0                             -->
+<!--                                                                        -->
+<!-- Unless required by applicable law or agreed to in writing, software    -->
+<!-- distributed under the License is distributed on an "AS IS" BASIS,      -->
+<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        -->
+<!-- implied. License for the specific language governing permissions and   -->
+<!-- limitations under the License.                                         -->
+<module rename-to="wave">
+    <inherits name='com.google.gwt.user.User'/>
+<!--
+      <entry-point class="com.google.gwt.wave.client.WaveWidgetTest"/>
+  -->
+
+    <script src="wave_embed.js"/>
+</module>

Added: trunk/src/main/java/com/google/gwt/wave/client/WaveEmbed.java
===================================================================
--- trunk/src/main/java/com/google/gwt/wave/client/WaveEmbed.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/com/google/gwt/wave/client/WaveEmbed.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -0,0 +1,136 @@
+package com.google.gwt.wave.client;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.core.client.GWT.UncaughtExceptionHandler;
+import com.google.gwt.user.client.Element;
+import com.google.gwt.wave.client.event.HasWaveLoadHandlers;
+import com.google.gwt.wave.client.event.WaveLoadEvent;
+
+final class WaveEmbed extends JavaScriptObject {
+
+  protected WaveEmbed() {
+    // Required by JavaScriptObject types
+  }
+
+  // Undocumented:
+  //     loadSearch
+  //     setContactProvider
+  //     provideContacts
+
+  // Not yet available:
+  //     addParticipant
+  //     addReply
+  
+  /**
+   * Creates a new WaveEmbed using the default Wave server URL:
+   * <code>http://wave-devel.corp.google.com/a/google.com/</code>
+   */
+  public static native WaveEmbed newInstance() /*-{
+    return new $wnd.WavePanel();
+  }-*/;
+
+  /**
+   * Creates a new WaveEmbed using the specified Wave server URL.
+   * 
+   * @param serverURL The URL of the Wave server to use
+   */
+  public static native WaveEmbed newInstance(String serverURL) /*-{
+    return new $wnd.WavePanel(serverURL);
+  }-*/;
+
+  /**
+   * Set the UI configuration for the wave. This must be done before init() is
+   * called. Note that fontSize must be expressed in points, such as "12pts".
+   * 
+   * @param bgColor
+   * @param color
+   * @param font
+   * @param fontSize
+   */
+  public native void setUIConfig(String bgColor, String color, String font,
+      String fontSize) /*-{
+    this.setUIConfig(bgColor, color, font, fontSize);
+  }-*/;
+
+  /**
+   * Actually creates the wave &gt;iframe> inside the given container. This is
+   * not done in the constructor so the caller can set various initialization
+   * options before the creation.
+   * 
+   * @param container The container element which will hold the Wave &gt;IFRAME>
+   */
+  public native void init(Element container) /*-{
+    this.init(container);
+  }-*/;
+
+  /**
+   * Loads the given wave into the wavePanel. This can be called before or after
+   * init.
+   * 
+   * @param waveId The Id of the Wave to load
+   */
+  public native void loadWave(String waveId) /*-{
+    this.loadWave(waveId);
+  }-*/;
+
+  /**
+   * Loads the given wave into the wavePanel. This can be called before or after
+   * init.
+   * 
+   * @param source An instance of HasWaveLoadHandlers where the WaveLoadEvent
+   *          will be dispatched from
+   * @param waveId The Id of the Wave to load
+   */
+  public native void loadWave(HasWaveLoadHandlers source, String waveId) /*-{
+    this.loadWave(waveId, function() {
+        @com.google.gwt.wave.client.WaveEmbed::fireWaveLoadEvent(Lcom/google/gwt/wave/client/event/HasWaveLoadHandlers;Ljava/lang/String;)(source, waveId);
+    })
+  }-*/;
+
+  // Called from JSNI
+  @SuppressWarnings("unused")
+  private static void fireWaveLoadEvent(HasWaveLoadHandlers source,
+      String waveId) {
+    UncaughtExceptionHandler ueh = GWT.getUncaughtExceptionHandler();
+    WaveLoadEvent event = new WaveLoadEvent(waveId);
+
+    if (ueh != null) {
+      try {
+        source.fireEvent(event);
+      } catch (Exception ex) {
+        ueh.onUncaughtException(ex);
+      }
+    } else {
+      source.fireEvent(event);
+    }
+  }
+
+  /**
+   * Returns the ID of the created &lt;iframe>
+   * 
+   * @return the ID of the created &lt;iframe>
+   */
+  public native String getFrameId() /*-{
+    return this.getFrameId();
+  }-*/;
+
+  /**
+   * Adds the current user as a participant to the wave.
+   * <p>
+   * NOTE: Not yet functional in developer sandbox!
+   */
+  public native void addParticipant() /*-{
+    this.addParticipant();
+  }-*/;
+
+  /**
+   * Adds a reply to the currently loaded wave. An empty reply will be added to
+   * the wave.
+   * <p>
+   * NOTE: Not yet functional in developer sandbox!
+   */
+  public native void addReply() /*-{
+    this.addReply();
+  }-*/;
+}

Added: trunk/src/main/java/com/google/gwt/wave/client/WaveWidget.java
===================================================================
--- trunk/src/main/java/com/google/gwt/wave/client/WaveWidget.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/com/google/gwt/wave/client/WaveWidget.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -0,0 +1,65 @@
+package com.google.gwt.wave.client;
+
+import com.google.gwt.dom.client.Document;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.wave.client.event.HasWaveLoadHandlers;
+import com.google.gwt.wave.client.event.WaveLoadEvent;
+import com.google.gwt.wave.client.event.WaveLoadHandler;
+
+public class WaveWidget extends Widget implements HasWaveLoadHandlers {
+
+    private static final String UICONFIG_ERROR = "setUIConfig must be called before the widget is attached.";
+
+    private final WaveEmbed waveEmbed;
+
+    public WaveWidget(final String waveServer) {
+        setElement(Document.get().createDivElement());
+        this.waveEmbed = WaveEmbed.newInstance(waveServer);
+    }
+
+    public HandlerRegistration addWaveLoadHandler(final WaveLoadHandler handler) {
+        return addHandler(handler, WaveLoadEvent.getType());
+    }
+
+    /**
+     * Loads the given wave into the WaveWidget. This method may be called at
+     * any time.
+     */
+    public void loadWave(final String waveId) {
+        waveEmbed.loadWave(this, waveId);
+    }
+
+    @Override
+    public void onLoad() {
+        waveEmbed.init(getElement());
+    }
+
+    /**
+     * Set the UI configuration for the wave. This must be done before the panel
+     * is attached to the page.
+     * 
+     * @param bgColor
+     *            An HTML color for the background, like "#ffffff"
+     * @param color
+     *            A color for the text, like "#000000"
+     * @param font
+     *            A font style, like "sans"
+     * @param fontSize
+     *            The font size, which must be expressed in points, as in "12pt"
+     */
+    public void setUIConfig(final String bgColor, final String color, final String font, final String fontSize) {
+        assert (!isAttached()) : UICONFIG_ERROR;
+        waveEmbed.setUIConfig(bgColor, color, font, fontSize);
+    }
+
+    // Package protected until this is functional on the developer sandbox
+    void addParticipant() {
+        waveEmbed.addParticipant();
+    }
+
+    // Package protected until this is functional on the developer sandbox
+    void addReply() {
+        waveEmbed.addReply();
+    }
+}

Added: trunk/src/main/java/com/google/gwt/wave/client/WaveWidgetTest.java
===================================================================
--- trunk/src/main/java/com/google/gwt/wave/client/WaveWidgetTest.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/com/google/gwt/wave/client/WaveWidgetTest.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -0,0 +1,31 @@
+package com.google.gwt.wave.client;
+
+import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.GWT.UncaughtExceptionHandler;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.ui.RootPanel;
+import com.google.gwt.wave.client.event.WaveLoadEvent;
+import com.google.gwt.wave.client.event.WaveLoadHandler;
+
+public class WaveWidgetTest implements EntryPoint {
+
+    public void onModuleLoad() {
+        GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
+            public void onUncaughtException(final Throwable e) {
+                Window.alert("Uncaught exception: " + e.getMessage());
+            }
+        });
+        final WaveWidget ww = new WaveWidget("http://wave.google.com/a/wavesandbox.com/");
+        ww.setUIConfig("#333", "#ccc", "sans", "12pt");
+
+        RootPanel.get().add(ww);
+        ww.addWaveLoadHandler(new WaveLoadHandler() {
+            public void onWaveLoad(final WaveLoadEvent event) {
+                Window.alert("Wave '" + event.getWaveId() + "' loaded!");
+            }
+        });
+        ww.loadWave("???");
+    }
+
+}

Added: trunk/src/main/java/com/google/gwt/wave/client/event/HasWaveLoadHandlers.java
===================================================================
--- trunk/src/main/java/com/google/gwt/wave/client/event/HasWaveLoadHandlers.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/com/google/gwt/wave/client/event/HasWaveLoadHandlers.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -0,0 +1,8 @@
+package com.google.gwt.wave.client.event;
+
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
+
+public interface HasWaveLoadHandlers extends HasHandlers {
+  HandlerRegistration addWaveLoadHandler(WaveLoadHandler handler);
+}

Added: trunk/src/main/java/com/google/gwt/wave/client/event/WaveLoadEvent.java
===================================================================
--- trunk/src/main/java/com/google/gwt/wave/client/event/WaveLoadEvent.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/com/google/gwt/wave/client/event/WaveLoadEvent.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2008 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.wave.client.event;
+
+import com.google.gwt.event.shared.GwtEvent;
+
+/**
+ * Represents a selection event.
+ * 
+ * @param <I>
+ *            the type being selected
+ */
+public class WaveLoadEvent extends GwtEvent<WaveLoadHandler> {
+
+    /**
+     * Handler type.
+     */
+    private static Type<WaveLoadHandler> type;
+
+    /**
+     * Fires a selection event on all registered handlers in the handler
+     * manager.If no such handlers exist, this method will do nothing.
+     * 
+     * @param <I>
+     *            the selected item type
+     * @param source
+     *            the source of the handlers
+     * @param selectedItem
+     *            the selected item
+     */
+    public static <I> void fire(final HasWaveLoadHandlers source, final String waveId) {
+        if (type != null) {
+            final WaveLoadEvent event = new WaveLoadEvent(waveId);
+            source.fireEvent(event);
+        }
+    }
+
+    /**
+     * Gets the type associated with this event.
+     * 
+     * @return returns the handler type
+     */
+    public static Type<WaveLoadHandler> getType() {
+        if (type == null) {
+            type = new Type<WaveLoadHandler>();
+        }
+        return type;
+    }
+
+    private final String waveId;
+
+    /**
+     * Creates a new selection event.
+     * 
+     * @param selectedItem
+     *            selected item
+     */
+    public WaveLoadEvent(final String waveId) {
+        this.waveId = waveId;
+    }
+
+    @Override
+    public final Type<WaveLoadHandler> getAssociatedType() {
+        return type;
+    }
+
+    public String getWaveId() {
+        return waveId;
+    }
+
+    @Override
+    protected void dispatch(final WaveLoadHandler handler) {
+        handler.onWaveLoad(this);
+    }
+}

Added: trunk/src/main/java/com/google/gwt/wave/client/event/WaveLoadHandler.java
===================================================================
--- trunk/src/main/java/com/google/gwt/wave/client/event/WaveLoadHandler.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/com/google/gwt/wave/client/event/WaveLoadHandler.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -0,0 +1,7 @@
+package com.google.gwt.wave.client.event;
+
+import com.google.gwt.event.shared.EventHandler;
+
+public interface WaveLoadHandler extends EventHandler {
+  void onWaveLoad(WaveLoadEvent event);
+}

Added: trunk/src/main/java/com/google/gwt/wave/client/package.html
===================================================================
--- trunk/src/main/java/com/google/gwt/wave/client/package.html	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/com/google/gwt/wave/client/package.html	2009-07-22 20:31:08 UTC (rev 1138)
@@ -0,0 +1,5 @@
+<html>
+<body>
+Core classes used in the Google Wave Embed API Library for GWT
+</body>
+</html>

Added: trunk/src/main/java/com/google/gwt/wave/public/wave_embed.js
===================================================================
--- trunk/src/main/java/com/google/gwt/wave/public/wave_embed.js	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/com/google/gwt/wave/public/wave_embed.js	2009-07-22 20:31:08 UTC (rev 1138)
@@ -0,0 +1,149 @@
+// embed.js retreived from http://wave-api.appspot.com/public/embed.js on 2009-06-02
+var a, WAVEPANEL_nextId = 0;
+if(typeof gadgets == "undefined" || !gadgets.rpc)document.write('<script src="http://wave.google.com/gadgets/js/core:rpc?debug=1&c=1" type="text/javascript"><\/script>');
+function WavePanel(b) {
+  this.id_ = WAVEPANEL_nextId++;
+  this.frameId_ = "iframe_panel_" + this.id_;
+  this.eventListeners_ = {};
+  this.init_ = false;
+  this.waveRootUrl = b || "http://wave-devel.corp.google.com/a/google.com/"
+}
+WavePanel.prototype.getId = function() {
+  return this.id_
+};
+WavePanel.prototype.setContactProvider = function(b) {
+  if(this.init_)throw"Can only set contact provider before calling init";this.contactProvider_ = b
+};
+WavePanel.prototype.init = function(b, c) {
+  this.init_ = true;
+  if(this.initWaveId_ && this.initSearch_)throw"Both an initial wave ID and a search were specified";this.setupRpc_(c);
+  this.createFrame_(b, this.contactProvider_, this.initWaveId_, this.initSearch_, this.uiConfig_);
+  gadgets.rpc.setRelayUrl(this.getFrameId(), this.getRelayUrl_(), false);
+  delete this.initSearch_;
+  delete this.initWaveId_
+};
+WavePanel.rpcSetup_ = false;
+WavePanel.callbackQueue_ = {};
+WavePanel.nextCallbackId = 0;
+WavePanel.pushCallback_ = function(b) {
+  if(!b)return"";
+  var c = "" + WavePanel.nextCallbackId;
+  WavePanel.nextCallbackId++;
+  WavePanel.callbackQueue_[c] = b;
+  return c
+};
+WavePanel.popCallback_ = function(b) {
+  if(b == "")return null;
+  var c = WavePanel.callbackQueue_[b];
+  delete WavePanel.callbackQueue_[b];
+  return c
+};
+a = WavePanel.prototype;
+a.setupRpc_ = function(b) {
+  if(!this.rpcSetup_) {
+    this.rpcSetup_ = true;
+    var c = this;
+    gadgets.rpc.register("load_done", function() {
+      b && b()
+    });
+    var e = function(d) {
+      var f = WavePanel.popCallback_(d.a[0]);
+      f && f(d.a[1])
+    };
+    gadgets.rpc.register("load_wave_done", function() {
+      e(this)
+    });
+    gadgets.rpc.register("request_contacts", function() {
+      if(!c.contactProvider_)throw"Got a contacts request but no contact provider is set.";c.contactProvider_(this.a[0])
+    });
+    gadgets.rpc.registerDefault(function() {
+      var d = this.s, f = this.a[0], h = c.eventListeners_[d];
+      if(h)for(var g in h)h[g](f)
+    })
+  }
+};
+a.createFrame_ = function(b, c, e, d, f) {
+  var h = document.createElement("div");
+  h.innerHTML = '<iframe name="' + this.frameId_ + '" >';
+  var g = h.firstChild;
+  g.id = this.frameId_;
+  g.width = "100%";
+  g.height = "100%";
+  g.frameBorder = "no";
+  g.scrolling = "no";
+  g.marginHeight = 0;
+  g.marginWidth = 0;
+  g.className = "embed-iframe";
+  g.src = this.iframeUrl_(c, e, d, f);
+  b = b || document.body;
+  b.appendChild(g);
+  return g
+};
+a.iframeUrl_ = function(b, c, e, d) {
+  var f = [];
+  f.push("client.type=embedded");
+  f.push("parent=" + escape("http://" + window.location.host + window.location.pathname));
+  b && f.push("ext_contacts=1");
+  c && f.push("wave_id=" + encodeURIComponent(c));
+  e && f.push("search_query=" + encodeURIComponent(e));
+  if(d) {
+    d.bgcolor && f.push("bgcolor=" + encodeURIComponent(d.bgcolor));
+    d.color && f.push("color=" + encodeURIComponent(d.color));
+    d.font && f.push("font=" + encodeURIComponent(d.font));
+    d.fontsize && f.push("fontsize=" + encodeURIComponent(d.fontsize))
+  }return this.waveRootUrl + "?" + f.join("&")
+};
+a.addListener = function(b, c) {
+  var e = this.eventListeners_, d = e[b];
+  if(!d) {
+    d = [];
+    e[b] = d
+  }d.push(c)
+};
+a.getFrameId = function() {
+  return this.frameId_
+};
+a.getRelayUrl_ = function() {
+  var b = this.waveRootUrl, c = b.split("://");
+  if(c && c.length > 0) {
+    var e = c[c.length - 1];
+    b = c[0] + "://";
+    for(var d = 0;d < e.length;++d) {
+      if(e[d] == "/")break;
+      b += e[d]
+    }b += "/"
+  }return b + "gadgets/files/container/rpc_relay.html"
+};
+a.loadWave = function(b, c) {
+  if(this.init_) {
+    var e = WavePanel.pushCallback_(c);
+    gadgets.rpc.call(this.getFrameId(), "load_wave", null, e, b)
+  }else this.initWaveId_ = b
+};
+a.loadSearch = function(b, c) {
+  if(this.init_) {
+    var e = WavePanel.pushCallback_(c);
+    gadgets.rpc.call(this.getFrameId(), "digest_search", null, e, b)
+  }else this.initSearch_ = b
+};
+a.setUIConfig = function(b, c, e, d) {
+  if(this.init_)throw"Cannot change the UIConfig after Init has been called.";else this.uiConfig_ = {bgcolor:b, color:c, font:e, fontsize:d}
+};
+a.addParticipant = function() {
+  if(!this.init_)throw"Init not called.";gadgets.rpc.call(this.getFrameId(), "add_participant", null, "")
+};
+a.addReply = function(b, c) {
+  if(!this.init_)throw"Init not called.";var e = WavePanel.pushCallback_(c);
+  gadgets.rpc.call(this.getFrameId(), "add_reply", null, e, b)
+};
+a.provideContacts = function(b) {
+  if(!this.init_)throw"Init not called.";var c = [];
+  for(var e in b) {
+    var d = b[e];
+    c.push(e);
+    c.push(d.firstName);
+    c.push(d.lastName);
+    c.push(d.photoUrl)
+  }c.unshift(c.length / 4);
+  gadgets.rpc.call(this.getFrameId(), "provide_contacts", null, c)
+};

Modified: trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml	2009-07-22 20:31:08 UTC (rev 1138)
@@ -56,4 +56,6 @@
 
     <!-- <set-property name="user.agent" value="gecko" /> -->
 
+    <inherits name='com.google.gwt.wave.Wave' />
+
 </module>

Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPresenter.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPresenter.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -39,6 +39,7 @@
             final ContentActionRegistry actionRegistry, final Provider<FileDownloadUtils> downloadProvider,
             final Provider<MediaUtils> mediaUtils) {
         super(BlogClientTool.NAME, stateManager, session, toolbar, actionRegistry, downloadProvider, i18n, mediaUtils);
+        setUploadType(BlogClientTool.TYPE_UPLOADEDFILE);
     }
 
     public void init(final BlogViewerView view) {
@@ -48,7 +49,7 @@
     @Override
     protected void setState(final StateContentDTO state) {
         super.setState(state);
-        super.setContent(state, BlogClientTool.TYPE_UPLOADEDFILE);
+        super.setContent(state);
     }
 
 }

Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -23,6 +23,7 @@
 import static org.ourproject.kune.docs.client.DocumentClientTool.TYPE_FOLDER;
 import static org.ourproject.kune.docs.client.DocumentClientTool.TYPE_ROOT;
 import static org.ourproject.kune.docs.client.DocumentClientTool.TYPE_UPLOADEDFILE;
+import static org.ourproject.kune.docs.client.DocumentClientTool.TYPE_WAVE;
 
 import org.ourproject.kune.docs.client.cnt.DocumentViewer;
 import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
@@ -80,6 +81,8 @@
         createNewContentAction(TYPE_DOCUMENT, "images/nav/page_add.png", i18n.t("New document"), parentMenuTitleCtx,
                 Position.ctx, TYPE_ROOT, TYPE_FOLDER);
 
+        createWaveAction(TYPE_WAVE, parentMenuTitleCtx, Position.ctx, TYPE_ROOT, TYPE_FOLDER);
+
         createTranslateAction(parentMenuTitle, TYPE_DOCUMENT, TYPE_FOLDER);
         createContentRenameAction(parentMenuTitle, i18n.t("Rename"), contents);
         createEditAction(parentMenuTitle, TYPE_DOCUMENT);

Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -32,6 +32,7 @@
     public static final String TYPE_FOLDER = NAME + "." + "folder";
     public static final String TYPE_DOCUMENT = NAME + "." + "doc";
     public static final String TYPE_UPLOADEDFILE = NAME + "." + FoldableAbstractClientTool.UPLOADEDFILE_SUFFIX;
+    public static final String TYPE_WAVE = NAME + "." + FoldableAbstractClientTool.WAVE_SUFFIX;
 
     public DocumentClientTool(final I18nUITranslationService i18n, final ToolSelector toolSelector,
             final WsThemeManager wsThemePresenter, final WorkspaceSkeleton ws,

Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPresenter.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPresenter.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -40,6 +40,8 @@
             final Provider<MediaUtils> mediaUtils) {
         super(DocumentClientTool.NAME, stateManager, session, toolbar, actionRegistry, downloadProvider, i18n,
                 mediaUtils);
+        setUploadType(DocumentClientTool.TYPE_UPLOADEDFILE);
+        setWaveType(DocumentClientTool.TYPE_WAVE);
     }
 
     public void init(final DocumentViewerView view) {
@@ -49,6 +51,6 @@
     @Override
     protected void setState(final StateContentDTO state) {
         super.setState(state);
-        setContent(state, DocumentClientTool.TYPE_UPLOADEDFILE);
+        setContent(state);
     }
 }

Modified: trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -45,6 +45,7 @@
     public static final String TYPE_FOLDER = NAME + "." + "folder";
     public static final String TYPE_DOCUMENT = NAME + "." + "doc";
     public static final String TYPE_UPLOADEDFILE = NAME + "." + ServerTool.UPLOADEDFILE_SUFFIX;
+    public static final String TYPE_WAVE = NAME + "." + ServerTool.WAVE_SUFFIX;
 
     public static final String ROOT_NAME = "documents";
 
@@ -62,11 +63,11 @@
         this.i18n = translationService;
     }
 
-    public void checkTypesBeforeContainerCreation(String parentTypeId, String typeId) {
+    public void checkTypesBeforeContainerCreation(final String parentTypeId, final String typeId) {
         checkContainerTypeId(parentTypeId, typeId);
     }
 
-    public void checkTypesBeforeContentCreation(String parentTypeId, String typeId) {
+    public void checkTypesBeforeContentCreation(final String parentTypeId, final String typeId) {
         checkContentTypeId(parentTypeId, typeId);
     }
 
@@ -125,9 +126,10 @@
     }
 
     void checkContentTypeId(final String parentTypeId, final String typeId) {
-        if (typeId.equals(TYPE_DOCUMENT) || typeId.equals(TYPE_UPLOADEDFILE)) {
+        if (typeId.equals(TYPE_DOCUMENT) || typeId.equals(TYPE_UPLOADEDFILE) || typeId.equals(TYPE_WAVE)) {
             // ok valid content
             if ((typeId.equals(TYPE_DOCUMENT) && (parentTypeId.equals(TYPE_ROOT) || parentTypeId.equals(TYPE_FOLDER)))
+                    || (typeId.equals(TYPE_WAVE) && (parentTypeId.equals(TYPE_ROOT) || parentTypeId.equals(TYPE_FOLDER)))
                     || (typeId.equals(TYPE_UPLOADEDFILE) && (parentTypeId.equals(TYPE_ROOT) || parentTypeId.equals(TYPE_FOLDER)))) {
                 // ok
             } else {

Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPresenter.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPresenter.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -40,6 +40,7 @@
             final Provider<MediaUtils> mediaUtils) {
         super(GalleryClientTool.NAME, stateManager, session, toolbar, actionRegistry, downloadProvider, i18n,
                 mediaUtils);
+        setUploadType(GalleryClientTool.TYPE_UPLOADEDFILE);
     }
 
     public void init(final GalleryViewerView view) {
@@ -49,7 +50,7 @@
     @Override
     protected void setState(final StateContentDTO state) {
         super.setState(state);
-        setContent(state, GalleryClientTool.TYPE_UPLOADEDFILE);
+        setContent(state);
     }
 
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentService.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentService.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -51,6 +51,8 @@
 
     StateContainerDTO addRoom(String user, StateToken parentToken, String name) throws DefaultException;
 
+    StateContentDTO addWave(String userHash, StateToken parentToken, String waveFileType, String waveId);
+
     StateContentDTO delContent(String userHash, StateToken token) throws DefaultException;
 
     StateAbstractDTO getContent(String userHash, StateToken token) throws DefaultException;

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentServiceAsync.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentServiceAsync.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentServiceAsync.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -51,6 +51,9 @@
 
     void addRoom(String user, StateToken parentToken, String name, AsyncCallback<StateContainerDTO> callback);
 
+    void addWave(String userHash, StateToken parentToken, String waveFileType, String waveId,
+            AsyncCallback<StateContentDTO> asyncCallbackSimple);
+
     void delContent(String userHash, StateToken token, AsyncCallback<StateContentDTO> asyncCallback);
 
     void getContent(String user, StateToken newState, AsyncCallback<StateAbstractDTO> callback);

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -95,6 +95,7 @@
     @Basic(optional = true)
     private Date publishedOn;
 
+    // @NotNull??
     private String typeId;
 
     @OneToMany(cascade = CascadeType.ALL)

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -98,7 +98,7 @@
     private final FinderService finderService;
 
     @Inject
-    public ContentRPC(FinderService finderService, final Provider<UserSession> userSessionProvider,
+    public ContentRPC(final FinderService finderService, final Provider<UserSession> userSessionProvider,
             final AccessService accessService, final AccessRightsService rightsService,
             final StateService stateService, final CreationService creationService, final GroupManager groupManager,
             final XmppManager xmppManager, final ContentManager contentManager,
@@ -156,11 +156,8 @@
     @Transactional(type = TransactionType.READ_WRITE)
     public StateContentDTO addContent(final String userHash, final StateToken parentToken, final String title,
             final String typeId) throws DefaultException {
-        final User user = getCurrentUser();
-        final Container container = accessService.accessToContainer(ContentUtils.parseId(parentToken.getFolder()),
-                user, AccessRol.Editor);
-        final Content addedContent = creationService.createContent(title, "", user, container, typeId);
-        return getState(user, addedContent);
+        final String body = "";
+        return createContent(parentToken, title, typeId, body);
     }
 
     @Authenticated
@@ -202,6 +199,14 @@
     }
 
     @Authenticated
+    @Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
+    @Transactional(type = TransactionType.READ_WRITE)
+    public StateContentDTO addWave(final String userHash, final StateToken parentToken, final String typeId,
+            final String waveId) throws DefaultException {
+        return createContent(parentToken, "Wave embeded test", typeId, waveId);
+    }
+
+    @Authenticated
     @Authorizated(accessRolRequired = AccessRol.Administrator)
     @Transactional(type = TransactionType.READ_WRITE)
     public StateContentDTO delContent(final String userHash, final StateToken token) throws DefaultException {
@@ -263,7 +268,7 @@
         final Long contentId = ContentUtils.parseId(token.getDocument());
 
         if (isUserLoggedIn()) {
-            RateResult result = contentManager.rateContent(rater, contentId, value);
+            final RateResult result = contentManager.rateContent(rater, contentId, value);
             return mapper.map(result, RateResultDTO.class);
         } else {
             throw new AccessViolationException();
@@ -352,7 +357,7 @@
                 || status.equals(ContentStatusDTO.inTheDustbin)) {
             throw new AccessViolationException();
         }
-        Content content = contentManager.setStatus(ContentUtils.parseId(token.getDocument()),
+        final Content content = contentManager.setStatus(ContentUtils.parseId(token.getDocument()),
                 ContentStatus.valueOf(status.toString()));
         return getState(getCurrentUser(), content);
     }
@@ -362,7 +367,7 @@
     @Transactional(type = TransactionType.READ_WRITE)
     public StateAbstractDTO setStatusAsAdmin(final String userHash, final StateToken token,
             final ContentStatusDTO status) {
-        Content content = contentManager.setStatus(ContentUtils.parseId(token.getDocument()),
+        final Content content = contentManager.setStatus(ContentUtils.parseId(token.getDocument()),
                 ContentStatus.valueOf(status.toString()));
         return getState(getCurrentUser(), content);
     }
@@ -390,6 +395,15 @@
         return mapper.map(comment, CommentDTO.class);
     }
 
+    private StateContentDTO createContent(final StateToken parentToken, final String title, final String typeId,
+            final String body) {
+        final User user = getCurrentUser();
+        final Container container = accessService.accessToContainer(ContentUtils.parseId(parentToken.getFolder()),
+                user, AccessRol.Editor);
+        final Content addedContent = creationService.createContent(title, body, user, container, typeId);
+        return getState(user, addedContent);
+    }
+
     private Container createFolder(final String groupShortName, final Long parentFolderId, final String title,
             final String typeId) throws DefaultException {
         final User user = getCurrentUser();
@@ -401,9 +415,9 @@
 
     @Authenticated(mandatory = false)
     @Authorizated(accessRolRequired = AccessRol.Viewer)
-    private StateAbstractDTO getContentOrDefContent(String userHash, StateToken stateToken, final User user,
-            final Content content) {
-        Long id = content.getId();
+    private StateAbstractDTO getContentOrDefContent(final String userHash, final StateToken stateToken,
+            final User user, final Content content) {
+        final Long id = content.getId();
         if (id != null) {
             // Content
             return mapState(stateService.create(user, content), user);
@@ -418,18 +432,18 @@
         return getUserSession().getUser();
     }
 
-    private StateContainerDTO getState(User user, Container container) {
-        StateContainer state = stateService.create(user, container);
+    private StateContainerDTO getState(final User user, final Container container) {
+        final StateContainer state = stateService.create(user, container);
         return mapState(state, user);
     }
 
-    private StateContentDTO getState(User user, Content content) {
-        StateContent state = stateService.create(user, content);
+    private StateContentDTO getState(final User user, final Content content) {
+        final StateContent state = stateService.create(user, content);
         return mapState(state, user);
     }
 
     private TagCloudResultDTO getSummaryTags(final Group group) {
-        TagCloudResult result = tagManager.getTagCloudResultByGroup(group);
+        final TagCloudResult result = tagManager.getTagCloudResultByGroup(group);
         return new TagCloudResultDTO(mapper.mapList(result.getTagCountList(), TagCountDTO.class), result.getMaxValue(),
                 result.getMinValue());
     }

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/tool/ServerTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/tool/ServerTool.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/tool/ServerTool.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -34,6 +34,7 @@
 
     /* Same constant in client */
     public static final String UPLOADEDFILE_SUFFIX = "uploaded";
+    public static final String WAVE_SUFFIX = "wave";
 
     void checkTypesBeforeContainerCreation(String parentTypeId, String typeId);
 

Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPresenter.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPresenter.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -39,6 +39,7 @@
             final ContentActionRegistry actionRegistry, final Provider<FileDownloadUtils> downloadProvider,
             final Provider<MediaUtils> mediaUtils) {
         super(WikiClientTool.NAME, stateManager, session, toolbar, actionRegistry, downloadProvider, i18n, mediaUtils);
+        setUploadType(WikiClientTool.UPLOADEDFILE_SUFFIX);
     }
 
     public void init(final WikiViewerView view) {
@@ -48,6 +49,5 @@
     @Override
     protected void setState(final StateContentDTO state) {
         super.setState(state);
-        setContent(state, WikiClientTool.TYPE_UPLOADEDFILE);
     }
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -581,6 +581,28 @@
         return uploadMedia;
     }
 
+    protected ActionToolbarMenuAndItemDescriptor<StateToken> createWaveAction(final String waveFileType,
+            final String parentMenuTitle, final Position position, final String... registerInTypes) {
+        final ActionToolbarMenuAndItemDescriptor<StateToken> addWave = new ActionToolbarMenuAndItemDescriptor<StateToken>(
+                AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener<StateToken>() {
+                    public void onEvent(final StateToken parentToken) {
+                        contentServiceProvider.get().addWave(session.getUserHash(), parentToken, waveFileType,
+                                "wavesandbox.com!w+NdlzA9PU%B", new AsyncCallbackSimple<StateContentDTO>() {
+                                    public void onSuccess(final StateContentDTO state) {
+                                        stateManager.setRetrievedState(state);
+                                    }
+                                });
+                    }
+                });
+        addWave.setTextDescription(i18n.t("Add Wave"));
+        addWave.setParentMenuTitle(parentMenuTitle);
+        addWave.setMustBeAuthenticated(true);
+        addWave.setParentSubMenuTitle(i18n.t("New"));
+        // addContent.setIconUrl(iconUrl);
+        register(addWave, position, registerInTypes);
+        return addWave;
+    }
+
     protected void downloadContent(final StateToken token) {
         fileDownloadProvider.get().downloadFile(token);
     }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentView.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentView.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -19,12 +19,15 @@
  */
 package org.ourproject.kune.workspace.client.cnt;
 
+import com.calclab.suco.client.events.Listener0;
 import com.google.gwt.user.client.ui.Widget;
 
 public interface AbstractContentView {
 
     public void setRawContent(final String content);
 
+    public void setWave(String waveId, Listener0 onLoaded);
+
     void attach();
 
     void detach();

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPanel.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPanel.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -26,6 +26,8 @@
 import org.ourproject.kune.platf.client.ui.RoundedPanel;
 import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
 
+import com.allen_sauer.gwt.log.client.Log;
+import com.calclab.suco.client.events.Listener0;
 import com.google.gwt.event.dom.client.ClickEvent;
 import com.google.gwt.event.dom.client.ClickHandler;
 import com.google.gwt.user.client.ui.HTML;
@@ -33,6 +35,9 @@
 import com.google.gwt.user.client.ui.Label;
 import com.google.gwt.user.client.ui.VerticalPanel;
 import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.wave.client.WaveWidget;
+import com.google.gwt.wave.client.event.WaveLoadEvent;
+import com.google.gwt.wave.client.event.WaveLoadHandler;
 
 public abstract class FoldableContentPanel extends AbstractContentPanel implements AbstractContentView {
 
@@ -86,6 +91,20 @@
         setContent(html);
     }
 
+    public void setWave(final String waveId, final Listener0 onLoaded) {
+        final WaveWidget waveWidget = new WaveWidget("http://wave.google.com/a/wavesandbox.com/");
+        waveWidget.setUIConfig("white", "black", "arial, sans", "10pt");
+        waveWidget.setHeight("100%");
+        waveWidget.addWaveLoadHandler(new WaveLoadHandler() {
+            public void onWaveLoad(final WaveLoadEvent event) {
+                Log.info("Wave '" + event.getWaveId() + "' loaded!");
+                onLoaded.onEvent();
+            }
+        });
+        waveWidget.loadWave(waveId);
+        setContent(waveWidget);
+    }
+
     public void setWidgetAsContent(final Widget widget, final boolean setDefMargins) {
         if (setDefMargins) {
             widget.addStyleName(DEF_CONTENT_MARGINS_STYLE);

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -32,10 +32,12 @@
 import org.ourproject.kune.platf.client.state.StateManager;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
 import org.ourproject.kune.platf.client.ui.download.ImageSize;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
 import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.MediaUtils;
 import org.ourproject.kune.workspace.client.AbstractFoldableContentActions;
 
 import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.events.Listener0;
 import com.calclab.suco.client.ioc.Provider;
 
 public abstract class FoldableContentPresenter extends AbstractContentPresenter implements FoldableContent {
@@ -47,6 +49,9 @@
     private final Provider<FileDownloadUtils> downloadProvider;
     private final I18nTranslationService i18n;
     private final Provider<MediaUtils> mediaUtils;
+    private String uploadType;
+    private String waveType;
+    private final Listener0 onWaveLoaded;
 
     public FoldableContentPresenter(final String toolName, final StateManager stateManager, final Session session,
             final ActionContentToolbar toolbar, final ActionRegistry<StateToken> actionRegistry,
@@ -64,56 +69,46 @@
                 setState(state);
             }
         });
+        onWaveLoaded = new Listener0() {
+            public void onEvent() {
+                NotifyUser.hideProgress();
+                NotifyUser.info("Wave loaded");
+            }
+        };
     }
 
     public String getToolName() {
         return toolName;
     }
 
+    public String getUploadType() {
+        return uploadType;
+    }
+
+    public String getWaveType() {
+        return waveType;
+    }
+
     public void refreshState() {
         setState(session.getContentState());
     }
 
-    protected void setContent(final StateContentDTO state, final String uploadedfileType) {
-        String typeId = state.getTypeId();
-        String contentBody = state.getContent();
-        StateToken token = state.getStateToken();
-        BasicMimeTypeDTO mimeType = state.getMimeType();
-        if (typeId.equals(uploadedfileType)) {
-            if (mimeType != null) {
-                FileDownloadUtils fileDownloadUtils = downloadProvider.get();
-                if (mimeType.isImage()) {
-                    view.showImage(fileDownloadUtils.getImageUrl(token), fileDownloadUtils.getImageResizedUrl(token,
-                            ImageSize.sized), false);
-                } else if (mimeType.isPdf()) {
-                    view.showImage(fileDownloadUtils.getImageUrl(token), fileDownloadUtils.getImageResizedUrl(token,
-                            ImageSize.sized), true);
-                } else if (mimeType.isMp3()) {
-                    view.setRawContent(mediaUtils.get().getMp3Embed(token));
-                } else if (mimeType.isOgg()) {
-                    view.setRawContent(mediaUtils.get().getOggEmbed(token));
-                } else if (mimeType.isFlv()) {
-                    view.setRawContent(mediaUtils.get().getFlvEmbed(token));
-                } else if (mimeType.isAvi()) {
-                    view.setRawContent(mediaUtils.get().getAviEmbed(token));
-                } else if (mimeType.isText()) {
-                    view.setContent(contentBody, true);
-                } else {
-                    view.setNoPreview();
-                }
-            } else {
-                view.setNoPreview();
-            }
+    public void setUploadType(final String uploadType) {
+        this.uploadType = uploadType;
+    }
+
+    public void setWaveType(final String waveType) {
+        this.waveType = waveType;
+    }
+
+    protected void setContent(final StateContentDTO state) {
+        final String typeId = state.getTypeId();
+        if (typeId.equals(getUploadType())) {
+            setUploadedContent(state);
+        } else if (typeId.equals(getWaveType())) {
+            setWaveContent(state);
         } else {
-            if ((contentBody == null || contentBody.length() == 0)) {
-                if (state.getContentRights().isEditable()) {
-                    view.setInfoMessage(i18n.t("There is no text in this page. Feel free to edit this page"));
-                } else {
-                    view.setInfoMessage(i18n.t("There is no text in this page"));
-                }
-            } else {
-                view.setRawContent(contentBody);
-            }
+            setNormalContent(state);
         }
         view.attach();
     }
@@ -121,7 +116,7 @@
     protected void setState(final StateAbstractDTO state) {
         toolbar.detach();
         if (state instanceof StateContainerDTO) {
-            StateContainerDTO stateCntCtx = (StateContainerDTO) state;
+            final StateContainerDTO stateCntCtx = (StateContainerDTO) state;
             if (stateCntCtx.getToolName().equals(toolName)) {
                 // This tool
                 if (stateCntCtx instanceof StateContentDTO) {
@@ -134,13 +129,13 @@
     }
 
     protected void setState(final StateContainerDTO state) {
-        ActionItemCollection<StateToken> collection = getActionCollection(state, state.getContainerRights());
+        final ActionItemCollection<StateToken> collection = getActionCollection(state, state.getContainerRights());
         setToolbar(collection);
         attach();
     }
 
     protected void setState(final StateContentDTO state) {
-        ActionItemCollection<StateToken> collection = getActionCollection(state, state.getContentRights());
+        final ActionItemCollection<StateToken> collection = getActionCollection(state, state.getContentRights());
         setToolbar(collection);
     }
 
@@ -150,11 +145,63 @@
                 true);
     }
 
+    private String getContentBody(final StateContentDTO state) {
+        final String contentBody = state.getContent();
+        return contentBody;
+    }
+
+    private void setNormalContent(final StateContentDTO state) {
+        final String contentBody = getContentBody(state);
+        if ((contentBody == null || contentBody.length() == 0)) {
+            if (state.getContentRights().isEditable()) {
+                view.setInfoMessage(i18n.t("There is no text in this page. Feel free to edit this page"));
+            } else {
+                view.setInfoMessage(i18n.t("There is no text in this page"));
+            }
+        } else {
+            view.setRawContent(contentBody);
+        }
+    }
+
     private void setToolbar(final ActionItemCollection<StateToken> collection) {
         toolbar.disableMenusAndClearButtons();
         toolbar.addActions(collection, AbstractFoldableContentActions.CONTENT_TOPBAR);
-        ;
         toolbar.attach();
     }
 
+    private void setUploadedContent(final StateContentDTO state) {
+        final String contentBody = state.getContent();
+        final StateToken token = state.getStateToken();
+        final BasicMimeTypeDTO mimeType = state.getMimeType();
+        if (mimeType != null) {
+            final FileDownloadUtils fileDownloadUtils = downloadProvider.get();
+            if (mimeType.isImage()) {
+                view.showImage(fileDownloadUtils.getImageUrl(token), fileDownloadUtils.getImageResizedUrl(token,
+                        ImageSize.sized), false);
+            } else if (mimeType.isPdf()) {
+                view.showImage(fileDownloadUtils.getImageUrl(token), fileDownloadUtils.getImageResizedUrl(token,
+                        ImageSize.sized), true);
+            } else if (mimeType.isMp3()) {
+                view.setRawContent(mediaUtils.get().getMp3Embed(token));
+            } else if (mimeType.isOgg()) {
+                view.setRawContent(mediaUtils.get().getOggEmbed(token));
+            } else if (mimeType.isFlv()) {
+                view.setRawContent(mediaUtils.get().getFlvEmbed(token));
+            } else if (mimeType.isAvi()) {
+                view.setRawContent(mediaUtils.get().getAviEmbed(token));
+            } else if (mimeType.isText()) {
+                view.setContent(contentBody, true);
+            } else {
+                view.setNoPreview();
+            }
+        } else {
+            view.setNoPreview();
+        }
+    }
+
+    private void setWaveContent(final StateContentDTO state) {
+        NotifyUser.showProgressLoading();
+        final String waveId = getContentBody(state);
+        view.setWave(waveId, onWaveLoaded);
+    }
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -61,8 +61,9 @@
         mainFitPanel = new Panel();
         mainFitPanel.setLayout(new FitLayout());
         mainFitPanel.setBorder(false);
+        mainFitPanel.setAutoScroll(false);
 
-        Panel mainAnchorLayout = new Panel();
+        final Panel mainAnchorLayout = new Panel();
         mainAnchorLayout.setLayout(new AnchorLayout());
         mainAnchorLayout.setBorder(false);
 
@@ -133,7 +134,7 @@
         contentWrap.add(contentBottomBar.getPanel(), new BorderLayoutData(RegionPosition.SOUTH));
         contextWrap.add(contextBottomBar.getPanel(), new BorderLayoutData(RegionPosition.SOUTH));
 
-        BorderLayoutData eastData = new BorderLayoutData(RegionPosition.EAST);
+        final BorderLayoutData eastData = new BorderLayoutData(RegionPosition.EAST);
         contextWrap.setWidth(175);
         eastData.setUseSplitTips(true);
         eastData.setCollapseModeMini(true);

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/tool/FoldableAbstractClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tool/FoldableAbstractClientTool.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tool/FoldableAbstractClientTool.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -26,6 +26,7 @@
 
 public abstract class FoldableAbstractClientTool extends AbstractClientTool {
     public static final String UPLOADEDFILE_SUFFIX = "uploaded";
+    public static final String WAVE_SUFFIX = "wave";
 
     protected final ContentCapabilitiesRegistry contentCapabilitiesRegistry;
 

Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTestHelper.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTestHelper.java	2009-07-22 15:12:39 UTC (rev 1137)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTestHelper.java	2009-07-22 20:31:08 UTC (rev 1138)
@@ -28,7 +28,7 @@
                         // memory
                         // test_db: use
                         // mysql
-                        bindConstant().annotatedWith(JpaUnit.class).to("test");
+                        bindConstant().annotatedWith(JpaUnit.class).to("test_db");
                         bindConstant().annotatedWith(PropertiesFileName.class).to("kune.properties");
                         bind(HttpServletRequest.class).to(HttpServletRequestMocked.class);
                     }




More information about the kune-commits mailing list