[kune-commits] r1327 - in trunk/src/main/java/cc/kune: core/public gspace/client gspace/client/resources gspace/client/viewers wave/client

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Thu Apr 28 20:56:20 CEST 2011


Author: vjrj_
Date: 2011-04-28 20:56:20 +0200 (Thu, 28 Apr 2011)
New Revision: 1327

Modified:
   trunk/src/main/java/cc/kune/core/public/ws.css
   trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java
   trunk/src/main/java/cc/kune/gspace/client/resources/wsArmor.css
   trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.ui.xml
   trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java
   trunk/src/main/java/cc/kune/wave/client/WebClient.java
Log:
WIAB editor in GSpace

Modified: trunk/src/main/java/cc/kune/core/public/ws.css
===================================================================
--- trunk/src/main/java/cc/kune/core/public/ws.css	2011-04-28 18:00:03 UTC (rev 1326)
+++ trunk/src/main/java/cc/kune/core/public/ws.css	2011-04-28 18:56:20 UTC (rev 1327)
@@ -1126,4 +1126,9 @@
 
 .k-ent-header-btn * {
   font-size: 13px !important;
-}
\ No newline at end of file
+}
+
+table.k-folder-viewer {
+    border: 5px solid #FFF;
+    border-collapse: separate;
+}

Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java	2011-04-28 18:00:03 UTC (rev 1326)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java	2011-04-28 18:56:20 UTC (rev 1327)
@@ -42,159 +42,161 @@
 
 public class GSpaceArmorImpl extends Composite implements GSpaceArmor {
 
-    interface WsArmorImplUiBinder extends UiBinder<Widget, GSpaceArmorImpl> {
-    }
+  interface WsArmorImplUiBinder extends UiBinder<Widget, GSpaceArmorImpl> {
+  }
 
-    private static WsArmorImplUiBinder uiBinder = GWT.create(WsArmorImplUiBinder.class);
+  private static WsArmorImplUiBinder uiBinder = GWT.create(WsArmorImplUiBinder.class);
 
-    @UiField
-    VerticalPanel docContainer;
-    @UiField
-    FlowPanel docFooter;
-    @UiField
-    FlowPanel docHeader;
-    @UiField
-    FlowPanel docSubheader;
-    @UiField
-    FlowPanel entityFooter;
-    @UiField
-    FlowPanel entityHeader;
-    @UiField
-    VerticalPanel entityToolsCenter;
-    @UiField
-    VerticalPanel entityToolsNorth;
-    @UiField
-    VerticalPanel entityToolsSouth;
-    private final ActionFlowPanel footerToolbar;
-    @UiField
-    SplitLayoutPanel groupSpace;
-    private final ActionFlowPanel headerToolbar;
-    @UiField
-    SimplePanel homeSpace;
-    @UiField
-    DockLayoutPanel mainpanel;
-    @UiField
-    SimplePanel publicSpace;
-    @UiField
-    FlowPanel sitebar;
-    @UiField
-    DockLayoutPanel splitCenter;
-    @UiField
-    DockLayoutPanel splitEast;
-    private final ActionFlowPanel subheaderToolbar;
-    @UiField
-    TabLayoutPanel tabs;
-    @UiField
-    FlowPanel userSpace;
+  @UiField
+  VerticalPanel docContainer;
+  @UiField
+  FlowPanel docFooter;
+  @UiField
+  FlowPanel docHeader;
+  @UiField
+  FlowPanel docSubheader;
+  @UiField
+  FlowPanel entityFooter;
+  @UiField
+  FlowPanel entityHeader;
+  @UiField
+  VerticalPanel entityToolsCenter;
+  @UiField
+  VerticalPanel entityToolsNorth;
+  @UiField
+  VerticalPanel entityToolsSouth;
+  private final ActionFlowPanel footerToolbar;
+  @UiField
+  SplitLayoutPanel groupSpace;
+  private final ActionFlowPanel headerToolbar;
+  @UiField
+  SimplePanel homeSpace;
+  @UiField
+  DockLayoutPanel mainpanel;
+  @UiField
+  SimplePanel publicSpace;
+  @UiField
+  FlowPanel sitebar;
+  @UiField
+  DockLayoutPanel splitCenter;
+  @UiField
+  DockLayoutPanel splitEast;
+  private final ActionFlowPanel subheaderToolbar;
+  @UiField
+  TabLayoutPanel tabs;
+  @UiField
+  FlowPanel userSpace;
 
-    @Inject
-    public GSpaceArmorImpl(final Provider<ActionFlowPanel> toolbarProv) {
-        initWidget(uiBinder.createAndBindUi(this));
-        groupSpace.setWidgetMinSize(splitEast, 150);
-        tabs.setStyleName("k-spaces");
-        homeSpace.add(RootPanel.get("k-home-wrapper"));
-        DOM.setStyleAttribute((Element) groupSpace.getWidgetContainerElement(splitEast), "overflow", "visible");
-        DOM.setStyleAttribute((Element) splitEast.getWidgetContainerElement(entityToolsCenter), "overflow", "visible");
-        footerToolbar = toolbarProv.get();
-        headerToolbar = toolbarProv.get();
-        subheaderToolbar = toolbarProv.get();
-        getDocHeader().add(headerToolbar);
-        getDocSubheader().add(subheaderToolbar);
-        getDocFooter().add(footerToolbar);
-    }
+  @Inject
+  public GSpaceArmorImpl(final Provider<ActionFlowPanel> toolbarProv) {
+    initWidget(uiBinder.createAndBindUi(this));
+    groupSpace.setWidgetMinSize(splitEast, 150);
+    tabs.setStyleName("k-spaces");
+    homeSpace.add(RootPanel.get("k-home-wrapper"));
+    DOM.setStyleAttribute((Element) groupSpace.getWidgetContainerElement(splitEast), "overflow",
+        "visible");
+    DOM.setStyleAttribute((Element) splitEast.getWidgetContainerElement(entityToolsCenter), "overflow",
+        "visible");
+    footerToolbar = toolbarProv.get();
+    headerToolbar = toolbarProv.get();
+    subheaderToolbar = toolbarProv.get();
+    getDocHeader().add(headerToolbar);
+    getDocSubheader().add(subheaderToolbar);
+    getDocFooter().add(footerToolbar);
+  }
 
-    @Override
-    public ForIsWidget getDocContainer() {
-        return docContainer;
-    }
+  @Override
+  public ForIsWidget getDocContainer() {
+    return docContainer;
+  }
 
-    @Override
-    public ForIsWidget getDocFooter() {
-        return docFooter;
-    }
+  @Override
+  public ForIsWidget getDocFooter() {
+    return docFooter;
+  }
 
-    @Override
-    public ForIsWidget getDocHeader() {
-        return docHeader;
-    }
+  @Override
+  public ForIsWidget getDocHeader() {
+    return docHeader;
+  }
 
-    @Override
-    public ForIsWidget getDocSubheader() {
-        return docSubheader;
-    }
+  @Override
+  public ForIsWidget getDocSubheader() {
+    return docSubheader;
+  }
 
-    @Override
-    public ForIsWidget getEntityFooter() {
-        return entityFooter;
-    }
+  @Override
+  public ForIsWidget getEntityFooter() {
+    return entityFooter;
+  }
 
-    @Override
-    public ForIsWidget getEntityHeader() {
-        return entityHeader;
-    }
+  @Override
+  public ForIsWidget getEntityHeader() {
+    return entityHeader;
+  }
 
-    @Override
-    public ForIsWidget getEntityToolsCenter() {
-        return entityToolsCenter;
-    }
+  @Override
+  public ForIsWidget getEntityToolsCenter() {
+    return entityToolsCenter;
+  }
 
-    @Override
-    public ForIsWidget getEntityToolsNorth() {
-        return entityToolsNorth;
-    }
+  @Override
+  public ForIsWidget getEntityToolsNorth() {
+    return entityToolsNorth;
+  }
 
-    @Override
-    public ForIsWidget getEntityToolsSouth() {
-        return entityToolsSouth;
-    }
+  @Override
+  public ForIsWidget getEntityToolsSouth() {
+    return entityToolsSouth;
+  }
 
-    @Override
-    public IsActionExtensible getFooterToolbar() {
-        return footerToolbar;
-    }
+  @Override
+  public IsActionExtensible getFooterToolbar() {
+    return footerToolbar;
+  }
 
-    @Override
-    public IsActionExtensible getHeaderToolbar() {
-        return headerToolbar;
-    }
+  @Override
+  public IsActionExtensible getHeaderToolbar() {
+    return headerToolbar;
+  }
 
-    @Override
-    public SimplePanel getPublicSpace() {
-        return publicSpace;
-    }
+  @Override
+  public SimplePanel getPublicSpace() {
+    return publicSpace;
+  }
 
-    @Override
-    public ForIsWidget getSitebar() {
-        return sitebar;
-    }
+  @Override
+  public ForIsWidget getSitebar() {
+    return sitebar;
+  }
 
-    @Override
-    public IsActionExtensible getSubheaderToolbar() {
-        return subheaderToolbar;
-    }
+  @Override
+  public IsActionExtensible getSubheaderToolbar() {
+    return subheaderToolbar;
+  }
 
-    @Override
-    public ForIsWidget getUserSpace() {
-        return userSpace;
-    }
+  @Override
+  public ForIsWidget getUserSpace() {
+    return userSpace;
+  }
 
-    @Override
-    public void selectGroupSpace() {
-        tabs.selectTab(groupSpace);
-    }
+  @Override
+  public void selectGroupSpace() {
+    tabs.selectTab(groupSpace);
+  }
 
-    @Override
-    public void selectHomeSpace() {
-        tabs.selectTab(homeSpace);
-    }
+  @Override
+  public void selectHomeSpace() {
+    tabs.selectTab(homeSpace);
+  }
 
-    @Override
-    public void selectPublicSpace() {
-        tabs.selectTab(publicSpace);
-    }
+  @Override
+  public void selectPublicSpace() {
+    tabs.selectTab(publicSpace);
+  }
 
-    @Override
-    public void selectUserSpace() {
-        tabs.selectTab(userSpace);
-    }
+  @Override
+  public void selectUserSpace() {
+    tabs.selectTab(userSpace);
+  }
 }

Modified: trunk/src/main/java/cc/kune/gspace/client/resources/wsArmor.css
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/resources/wsArmor.css	2011-04-28 18:00:03 UTC (rev 1326)
+++ trunk/src/main/java/cc/kune/gspace/client/resources/wsArmor.css	2011-04-28 18:56:20 UTC (rev 1327)
@@ -123,8 +123,8 @@
   -webkit-border-top-right-radius: 7px;
   -moz-border-radius-topright: 7px;
   border-top-right-radius: 7px;
-  padding: 5px;
 }
+.docEditor div { overflow-y: visible; }
 
 .docFooter {
   border-left: 1px solid #959595;

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.java	2011-04-28 18:00:03 UTC (rev 1326)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.java	2011-04-28 18:56:20 UTC (rev 1327)
@@ -1,6 +1,25 @@
 package cc.kune.gspace.client.viewers;
 
+import org.waveprotocol.box.webclient.client.ClientIdGenerator;
+import org.waveprotocol.box.webclient.client.RemoteViewServiceMultiplexer;
+import org.waveprotocol.box.webclient.client.Session;
+import org.waveprotocol.box.webclient.client.SimpleWaveStore;
+import org.waveprotocol.box.webclient.client.StagesProvider;
+import org.waveprotocol.box.webclient.client.WaveWebSocketClient;
+import org.waveprotocol.box.webclient.search.WaveStore;
+import org.waveprotocol.box.webclient.widget.frame.FramedPanel;
+import org.waveprotocol.box.webclient.widget.loading.LoadingIndicator;
+import org.waveprotocol.wave.client.account.ProfileManager;
+import org.waveprotocol.wave.client.account.impl.ProfileManagerImpl;
+import org.waveprotocol.wave.client.widget.common.ImplPanel;
+import org.waveprotocol.wave.model.id.IdGenerator;
+import org.waveprotocol.wave.model.wave.ParticipantId;
+import org.waveprotocol.wave.model.waveref.InvalidWaveRefException;
+import org.waveprotocol.wave.model.waveref.WaveRef;
+import org.waveprotocol.wave.util.escapers.GwtWaverefEncoder;
+
 import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
+import cc.kune.common.client.errors.UIException;
 import cc.kune.common.client.ui.IconLabel;
 import cc.kune.common.client.ui.UiUtils;
 import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
@@ -9,12 +28,16 @@
 import cc.kune.gspace.client.GSpaceArmor;
 import cc.kune.gspace.client.viewers.DocViewerPresenter.DocViewerView;
 import cc.kune.wave.client.WaveClientManager;
+import cc.kune.wave.client.WebClient;
 
 import com.google.gwt.core.client.GWT;
+import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
 import com.google.gwt.resources.client.ImageResource;
 import com.google.gwt.safehtml.shared.SafeHtmlUtils;
 import com.google.gwt.uibinder.client.UiBinder;
 import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.ui.DeckPanel;
 import com.google.gwt.user.client.ui.InlineHTML;
 import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
@@ -28,24 +51,24 @@
 
   private static DocsViewerPanelUiBinder uiBinder = GWT.create(DocsViewerPanelUiBinder.class);
 
-  // private RemoteViewServiceMultiplexer channel;
+  private RemoteViewServiceMultiplexer channel;
   @UiField
   DeckPanel deck;
   private final GSpaceArmor gsArmor;
   private final IconsRegistry iconRegistry;
-  // private IdGenerator idGenerator;
-  // private final Element loading = new LoadingIndicator().getElement();
+  private IdGenerator idGenerator;
+  private final Element loading = new LoadingIndicator().getElement();
   @UiField
   InlineHTML onlyViewPanel;
-  // private ProfileManager profiles;
+  private ProfileManager profiles;
   /** The wave panel, if a wave is open. */
-  // private StagesProvider wave;
-  // private final WaveClientManager waveClientManager;
-  // @UiField
-  // FramedPanel waveFrame;
-  // @UiField
-  // ImplPanel waveHolder;
-  // private final WaveStore waveStore = new SimpleWaveStore();
+  private StagesProvider wave;
+  private final WaveClientManager waveClientManager;
+  @UiField
+  FramedPanel waveFrame;
+  @UiField
+  ImplPanel waveHolder;
+  private final WaveStore waveStore = new SimpleWaveStore();
   private final Widget widget;
 
   @Inject
@@ -53,7 +76,7 @@
       final ContentCapabilitiesRegistry capabilitiesRegistry) {
     this.gsArmor = wsArmor;
     this.iconRegistry = capabilitiesRegistry.getIconsRegistry();
-    // this.waveClientManager = waveClientManager;
+    this.waveClientManager = waveClientManager;
     widget = uiBinder.createAndBindUi(this);
   }
 
@@ -81,27 +104,26 @@
     clear();
   }
 
-  // private WaveRef getWaveRef(final String waveRefS) {
-  // try {
-  // return GwtWaverefEncoder.decodeWaveRefFromPath(waveRefS);
-  // } catch (final InvalidWaveRefException e) {
-  // throw new UIException("Invalid waveref: " + waveRefS);
-  // }
-  // }
-  //
-  // private void initWaveClientIfNeeded() {
-  // if (channel == null) {
-  // final WaveWebSocketClient webSocket = new
-  // WaveWebSocketClient(WebClient.useSocketIO(),
-  // WebClient.getWebSocketBaseUrl(GWT.getModuleBaseURL()));
-  // webSocket.connect();
-  // channel = new RemoteViewServiceMultiplexer(webSocket,
-  // new ParticipantId(Session.get().getAddress()).getAddress());
-  // profiles = new ProfileManagerImpl();
-  // idGenerator = ClientIdGenerator.create();
-  // }
-  // }
+  private WaveRef getWaveRef(final String waveRefS) {
+    try {
+      return GwtWaverefEncoder.decodeWaveRefFromPath(waveRefS);
+    } catch (final InvalidWaveRefException e) {
+      throw new UIException("Invalid waveref: " + waveRefS);
+    }
+  }
 
+  private void initWaveClientIfNeeded() {
+    if (channel == null) {
+      final WaveWebSocketClient webSocket = new WaveWebSocketClient(WebClient.useSocketIO(),
+          WebClient.getWebSocketBaseUrl(GWT.getModuleBaseURL()));
+      webSocket.connect();
+      channel = new RemoteViewServiceMultiplexer(webSocket,
+          new ParticipantId(Session.get().getAddress()).getAddress());
+      profiles = new ProfileManagerImpl(Session.get().getDomain());
+      idGenerator = ClientIdGenerator.create();
+    }
+  }
+
   @Override
   public void setActions(final GuiActionDescCollection actions) {
     gsArmor.getSubheaderToolbar().clear();
@@ -112,47 +134,43 @@
   public void setContent(final StateContentDTO state) {
     final ForIsWidget docHeader = gsArmor.getDocHeader();
     UiUtils.clear(docHeader);
-    // docHeader.add(new InlineLabel(state.getTitle()));
     docHeader.add(new IconLabel((ImageResource) iconRegistry.getContentTypeIcon(state.getTypeId(),
         state.getMimeType()), state.getTitle()));
     final boolean editable = state.getContentRights().isEditable();
     if (editable) {
-      // initWaveClientIfNeeded();
-      // setEditableWaveContent(state.getWaveRef(), false);
+      initWaveClientIfNeeded();
+      setEditableWaveContent(state.getWaveRef(), false);
       // waveHolder.clear();
-      // waveHolder.add(new Label(state.getContent() +
-      // " (but here goes the Wave editor -we are testing it-)"));
-      onlyViewPanel.setHTML(SafeHtmlUtils.fromTrustedString(state.getContent()));
+      // waveHolder.add(new Label(state.getContent()
+      // + " (but here goes the Wave editor -we are testing it-)"));
+      // onlyViewPanel.setHTML(SafeHtmlUtils.fromTrustedString(state.getContent()));
     } else {
       onlyViewPanel.setHTML(SafeHtmlUtils.fromTrustedString(state.getContent()));
     }
     // deck.showWidget(editable ? 0 : 1);
     deck.showWidget(1);
   }
-  //
-  // private void setEditableWaveContent(final String waveRefS, final boolean
-  // isNewWave) {
-  // final WaveRef waveRef = getWaveRef(waveRefS);
-  //
-  // if (wave != null) {
-  // wave.destroy();
-  // wave = null;
-  // }
-  //
-  // // Release the display:none.
-  // // UIObject.setVisible(waveFrame.getElement(), true);
-  // waveHolder.getElement().appendChild(loading);
-  // final Element holder =
-  // waveHolder.getElement().appendChild(Document.get().createDivElement());
-  // final StagesProvider wave = new StagesProvider(holder, waveHolder,
-  // waveRef, channel, idGenerator, profiles,
-  // waveStore, isNewWave);
-  // this.wave = wave;
-  // wave.load(new Command() {
-  // @Override
-  // public void execute() {
-  // loading.removeFromParent();
-  // }
-  // });
-  // }
+
+  private void setEditableWaveContent(final String waveRefS, final boolean isNewWave) {
+    final WaveRef waveRef = getWaveRef(waveRefS);
+
+    if (wave != null) {
+      wave.destroy();
+      wave = null;
+    }
+
+    // Release the display:none.
+    // UIObject.setVisible(waveFrame.getElement(), true);
+    waveHolder.getElement().appendChild(loading);
+    final Element holder = waveHolder.getElement().appendChild(Document.get().createDivElement());
+    final StagesProvider wave = new StagesProvider(holder, waveHolder, waveRef, channel, idGenerator,
+        profiles, waveStore, isNewWave);
+    this.wave = wave;
+    wave.load(new Command() {
+      @Override
+      public void execute() {
+        loading.removeFromParent();
+      }
+    });
+  }
 }

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.ui.xml	2011-04-28 18:00:03 UTC (rev 1326)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.ui.xml	2011-04-28 18:56:20 UTC (rev 1327)
@@ -4,24 +4,23 @@
   xmlns:w='urn:import:org.waveprotocol.wave.client.widget.common'>
   <ui:style>
     .wavePanel {
-        margin: 0 0 0 0;
+      margin: 0 0 0 0;
     }
 
     .waveHolder {
-        position: absolute;
-        top: 0;
-        bottom: 0;
-        left: 0;
-        right: 0;
+      position: absolute;
+      top: 0;
+      bottom: 0;
+      left: 0;
+      right: 0;
     }
   </ui:style>
   <g:HTMLPanel width="100%" height="100%">
     <g:DeckPanel ui:field="deck" addStyleNames="k-doc-content-deck">
-      <!-- <f:FramedPanel ui:field="waveFrame" addStyleNames="{style.wavePanel}"> -->
-      <!-- </f:FramedPanel> -->
-      <!-- <w:ImplPanel ui:field="waveHolder" addStyleNames="{style.waveHolder}"
-        /> -->
-      <g:InlineHTML ui:field="delete" />
+      <f:FramedPanel ui:field="waveFrame" addStyleNames="{style.wavePanel}">
+      </f:FramedPanel>
+      <w:ImplPanel ui:field="waveHolder" addStyleNames="{style.waveHolder}" />
+<!--       <g:InlineHTML ui:field="delete" /> -->
       <g:InlineHTML ui:field="onlyViewPanel" />
     </g:DeckPanel>
   </g:HTMLPanel>

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java	2011-04-28 18:00:03 UTC (rev 1326)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java	2011-04-28 18:56:20 UTC (rev 1327)
@@ -47,6 +47,7 @@
     this.guiProvider = guiProvider;
     this.res = res;
     widget = uiBinder.createAndBindUi(this);
+    widget.addStyleName("k-folder-viewer");
   }
 
   @Override

Modified: trunk/src/main/java/cc/kune/wave/client/WebClient.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WebClient.java	2011-04-28 18:00:03 UTC (rev 1326)
+++ trunk/src/main/java/cc/kune/wave/client/WebClient.java	2011-04-28 18:56:20 UTC (rev 1327)
@@ -262,9 +262,13 @@
    * Returns <code>ws://yourhost[:port]/</code>.
    */
   // XXX check formatting wrt GPE
-  private native String getWebSocketBaseUrl(String moduleBase) /*-{return "ws" + /:\/\/[^\/]+/.exec(moduleBase)[0] + "/";}-*/;
+  public native static String getWebSocketBaseUrl(String moduleBase) /*-{
+		return "ws" + /:\/\/[^\/]+/.exec(moduleBase)[0] + "/";
+  }-*/;
 
-  private native boolean useSocketIO() /*-{ return !!$wnd.__useSocketIO }-*/;
+  public native static boolean useSocketIO() /*-{
+		return !!$wnd.__useSocketIO
+  }-*/;
 
   /**
    */




More information about the kune-commits mailing list