[kune-commits] r1096 - in trunk/src: main/java/org/ourproject/kune/platf/client/dto main/java/org/ourproject/kune/platf/client/services main/java/org/ourproject/kune/platf/client/state main/java/org/ourproject/kune/platf/client/ui/rte/insertimg main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext main/java/org/ourproject/kune/platf/server/content main/java/org/ourproject/kune/platf/server/domain main/java/org/ourproject/kune/platf/server/rest main/java/org/ourproject/kune/workspace/client main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia main/java/org/ourproject/kune/workspace/client/search main/java/org/ourproject/kune/workspace/client/signin test/java/org/ourproject/kune/platf/server/manager

vjrj vjrj at ourproject.org
Tue Apr 21 14:54:25 CEST 2009


Author: vjrj
Date: 2009-04-21 14:54:21 +0200 (Tue, 21 Apr 2009)
New Revision: 1096

Added:
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaGroup.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertMediaExt.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertMediaExtPanel.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertMediaExtPresenter.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertMediaExtView.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertMediaLocal.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertMediaLocalPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertMediaLocalPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertMediaLocalView.java
Removed:
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertMediaGroup.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMedia.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPanel.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPresenter.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaView.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMedia.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaView.java
Modified:
   trunk/src/main/java/org/ourproject/kune/platf/client/dto/LinkDTO.java
   trunk/src/main/java/org/ourproject/kune/platf/client/services/CoreModule.java
   trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java
   trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java
   trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPanel.java
   trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManager.java
   trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java
   trunk/src/main/java/org/ourproject/kune/platf/server/domain/Container.java
   trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java
   trunk/src/main/java/org/ourproject/kune/platf/server/rest/ContentJSONService.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/search/AbstractLiveSearcherField.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearcherContants.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterForm.java
   trunk/src/test/java/org/ourproject/kune/platf/server/manager/ContentManagerTest.java
Log:
Incomplete - task Reset on insert image 

Incomplete - task Hibernate search improving 

Incomplete - task Field order problem in new user 

Incomplete - task Insert Media dialog 


Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/LinkDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/LinkDTO.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/LinkDTO.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -92,6 +92,6 @@
 
     @Override
     public String toString() {
-        return "LinkDTO[(" + getLink() + "): " + getShortName() + "]";
+        return "LinkDTO[" + getLink() + ": " + getLongName() + "]";
     }
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/CoreModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/CoreModule.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/CoreModule.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -23,8 +23,8 @@
 import org.ourproject.kune.platf.client.app.EntityOptionsGroup;
 import org.ourproject.kune.platf.client.app.ToolGroup;
 import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageGroup;
-import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertMediaGroup;
 import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkGroup;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaGroup;
 import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharGroup;
 
 import com.calclab.suco.client.ioc.module.AbstractModule;

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -73,7 +73,6 @@
 import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialogPanel;
 import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialogPresenter;
 import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageGroup;
-import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertMediaGroup;
 import org.ourproject.kune.platf.client.ui.rte.insertimg.ext.InsertImageExt;
 import org.ourproject.kune.platf.client.ui.rte.insertimg.ext.InsertImageExtPanel;
 import org.ourproject.kune.platf.client.ui.rte.insertimg.ext.InsertImageExtPresenter;
@@ -92,9 +91,10 @@
 import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialog;
 import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialogPanel;
 import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialogPresenter;
-import org.ourproject.kune.platf.client.ui.rte.insertmedia.ext.InsertExtMedia;
-import org.ourproject.kune.platf.client.ui.rte.insertmedia.ext.InsertExtMediaPanel;
-import org.ourproject.kune.platf.client.ui.rte.insertmedia.ext.InsertExtMediaPresenter;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaGroup;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.ext.InsertMediaExt;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.ext.InsertMediaExtPanel;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.ext.InsertMediaExtPresenter;
 import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialog;
 import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialogPanel;
 import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialogPresenter;
@@ -489,11 +489,11 @@
             }
         });
 
-        register(InsertMediaGroup.class, new Factory<InsertExtMedia>(InsertExtMedia.class) {
+        register(InsertMediaGroup.class, new Factory<InsertMediaExt>(InsertMediaExt.class) {
             @Override
-            public InsertExtMedia create() {
-                final InsertExtMediaPresenter presenter = new InsertExtMediaPresenter($(InsertMediaDialog.class), $(ExternalMediaRegistry.class));
-                final InsertExtMediaPanel panel = new InsertExtMediaPanel(presenter, i18n, $(ExternalMediaRegistry.class));
+            public InsertMediaExt create() {
+                final InsertMediaExtPresenter presenter = new InsertMediaExtPresenter($(InsertMediaDialog.class), $(ExternalMediaRegistry.class));
+                final InsertMediaExtPanel panel = new InsertMediaExtPanel(presenter, i18n, $(ExternalMediaRegistry.class));
                 presenter.init(panel);
                 return presenter;
             }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -79,6 +79,8 @@
 
     String getCurrentCCversion();
 
+    String getCurrentGroupShortName();
+
     I18nLanguageDTO getCurrentLanguage();
 
     StateAbstractDTO getCurrentState();

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -95,6 +95,10 @@
         return initData.getCurrentCCversion();
     }
 
+    public String getCurrentGroupShortName() {
+        return currentState == null ? null : currentState.getStateToken().getGroup();
+    }
+
     public I18nLanguageDTO getCurrentLanguage() {
         return currentLanguage;
     }
@@ -177,7 +181,7 @@
         return initData.getUserTools();
     }
 
-    public boolean inSameToken(StateToken token) {
+    public boolean inSameToken(final StateToken token) {
         return getCurrentStateToken().equals(token);
     }
 

Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertMediaGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertMediaGroup.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertMediaGroup.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -1,27 +0,0 @@
-package org.ourproject.kune.platf.client.ui.rte.insertimg;
-
-import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstract;
-
-import com.calclab.suco.client.ioc.Container;
-import com.calclab.suco.client.ioc.Provider;
-import com.calclab.suco.client.ioc.decorator.ProviderCollection;
-import com.calclab.suco.client.ioc.decorator.Singleton;
-
-public class InsertMediaGroup extends ProviderCollection {
-
-    public InsertMediaGroup(final Container container) {
-        super(container, Singleton.instance);
-    }
-
-    public void createAll() {
-        for (final Provider<?> p : getProviders()) {
-            p.get();
-        }
-    }
-
-    public void resetAll() {
-        for (final Provider<?> p : getProviders()) {
-            ((InsertMediaAbstract) p.get()).reset();
-        }
-    }
-}

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -27,9 +27,11 @@
     protected final Checkbox wrapText;
     protected final Checkbox clickOriginal;
     private final Label intro;
+    private final InsertImageAbstractPresenter presenter;
 
     public InsertImageAbstractPanel(final String title, final InsertImageAbstractPresenter presenter) {
         super(title);
+        this.presenter = presenter;
         super.setAutoWidth(true);
         super.setHeight(InsertImageDialogView.HEIGHT);
         super.getFormPanel().setLabelWidth(DEF_FIELD_LABEL_WITH + 20);
@@ -134,6 +136,13 @@
         super.insert(index, component);
     }
 
+    @Override
+    public void reset() {
+        super.reset();
+        ImageInfo linkImage = presenter.getImageInfo();
+        updateValues(linkImage);
+    }
+
     public void setIntro(final String text) {
         intro.setHtml(text);
     }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPanel.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPanel.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -3,7 +3,6 @@
 import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
 import org.ourproject.kune.platf.client.services.Images;
 import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialogPanel;
-import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertMediaGroup;
 
 import com.calclab.suco.client.events.Listener0;
 import com.gwtext.client.core.EventObject;

Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaGroup.java (from rev 1089, trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertMediaGroup.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertMediaGroup.java	2009-03-30 13:48:35 UTC (rev 1089)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaGroup.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -0,0 +1,27 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia;
+
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstract;
+
+import com.calclab.suco.client.ioc.Container;
+import com.calclab.suco.client.ioc.Provider;
+import com.calclab.suco.client.ioc.decorator.ProviderCollection;
+import com.calclab.suco.client.ioc.decorator.Singleton;
+
+public class InsertMediaGroup extends ProviderCollection {
+
+    public InsertMediaGroup(final Container container) {
+        super(container, Singleton.instance);
+    }
+
+    public void createAll() {
+        for (final Provider<?> p : getProviders()) {
+            p.get();
+        }
+    }
+
+    public void resetAll() {
+        for (final Provider<?> p : getProviders()) {
+            ((InsertMediaAbstract) p.get()).reset();
+        }
+    }
+}

Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMedia.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMedia.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMedia.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -1,7 +0,0 @@
-package org.ourproject.kune.platf.client.ui.rte.insertmedia.ext;
-
-import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstract;
-
-public interface InsertExtMedia extends InsertMediaAbstract {
-
-}

Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPanel.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPanel.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -1,16 +0,0 @@
-package org.ourproject.kune.platf.client.ui.rte.insertmedia.ext;
-
-import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
-import org.ourproject.kune.platf.client.ui.rte.insertmedia.ExternalMediaRegistry;
-import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractPanel;
-
-public class InsertExtMediaPanel extends InsertMediaAbstractPanel implements InsertExtMediaView {
-
-    public InsertExtMediaPanel(final InsertExtMediaPresenter presenter, final I18nTranslationService i18n,
-            final ExternalMediaRegistry externalMediaRegistry) {
-        super(i18n.t("External"), presenter);
-        String supportedVideos = externalMediaRegistry.getNames();
-        setIntro(i18n.t("Provide a link to the external video (supported videos: [%s])", supportedVideos) + "<br/>");
-    }
-
-}

Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPresenter.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPresenter.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -1,45 +0,0 @@
-package org.ourproject.kune.platf.client.ui.rte.insertmedia.ext;
-
-import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
-import org.ourproject.kune.platf.client.ui.rte.insertmedia.ExternalMediaDescriptor;
-import org.ourproject.kune.platf.client.ui.rte.insertmedia.ExternalMediaRegistry;
-import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialog;
-import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractPresenter;
-
-public class InsertExtMediaPresenter extends InsertMediaAbstractPresenter implements InsertExtMedia {
-
-    private InsertExtMediaView view;
-    private final ExternalMediaRegistry externalMediaRegistry;
-    private ExternalMediaDescriptor mediaDescriptor;
-
-    public InsertExtMediaPresenter(final InsertMediaDialog insertMediaDialog,
-            final ExternalMediaRegistry externalMediaRegistry) {
-        super(insertMediaDialog);
-        this.externalMediaRegistry = externalMediaRegistry;
-
-        externalMediaRegistry.add(new ExternalMediaDescriptor("youtube", "http://youtube.com",
-                "http://[a-z]*.youtube.com/watch?v=.*", "FIXME", "<embed [%d]>"));
-    }
-
-    public void init(final InsertExtMediaView view) {
-        super.init(view);
-        this.view = view;
-    }
-
-    @Override
-    public boolean isValid() {
-        String url = view.getSrc();
-        mediaDescriptor = externalMediaRegistry.get(url);
-        if (mediaDescriptor.equals(ExternalMediaRegistry.NO_MEDIA)) {
-            insertMediaDialog.setErrorMessage("We cannot process this video link", Level.error);
-            return false;
-        } else {
-            return true;
-        }
-    }
-
-    @Override
-    protected String updateMediaInfo() {
-        return mediaDescriptor.getEmbed(view.getSrc());
-    }
-}

Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaView.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaView.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -1,6 +0,0 @@
-package org.ourproject.kune.platf.client.ui.rte.insertmedia.ext;
-
-import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractView;
-
-public interface InsertExtMediaView extends InsertMediaAbstractView {
-}

Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertMediaExt.java (from rev 1089, trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMedia.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMedia.java	2009-03-30 13:48:35 UTC (rev 1089)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertMediaExt.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia.ext;
+
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstract;
+
+public interface InsertMediaExt extends InsertMediaAbstract {
+
+}

Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertMediaExtPanel.java (from rev 1089, trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPanel.java	2009-03-30 13:48:35 UTC (rev 1089)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertMediaExtPanel.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -0,0 +1,16 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia.ext;
+
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.ExternalMediaRegistry;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractPanel;
+
+public class InsertMediaExtPanel extends InsertMediaAbstractPanel implements InsertMediaExtView {
+
+    public InsertMediaExtPanel(final InsertMediaExtPresenter presenter, final I18nTranslationService i18n,
+            final ExternalMediaRegistry externalMediaRegistry) {
+        super(i18n.t("External"), presenter);
+        String supportedVideos = externalMediaRegistry.getNames();
+        setIntro(i18n.t("Provide a link to the external video (supported videos: [%s])", supportedVideos) + "<br/>");
+    }
+
+}

Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertMediaExtPresenter.java (from rev 1089, trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPresenter.java	2009-03-30 13:48:35 UTC (rev 1089)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertMediaExtPresenter.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -0,0 +1,45 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia.ext;
+
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.ExternalMediaDescriptor;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.ExternalMediaRegistry;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialog;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractPresenter;
+
+public class InsertMediaExtPresenter extends InsertMediaAbstractPresenter implements InsertMediaExt {
+
+    private InsertMediaExtView view;
+    private final ExternalMediaRegistry externalMediaRegistry;
+    private ExternalMediaDescriptor mediaDescriptor;
+
+    public InsertMediaExtPresenter(final InsertMediaDialog insertMediaDialog,
+            final ExternalMediaRegistry externalMediaRegistry) {
+        super(insertMediaDialog);
+        this.externalMediaRegistry = externalMediaRegistry;
+
+        externalMediaRegistry.add(new ExternalMediaDescriptor("youtube", "http://youtube.com",
+                "http://[a-z]*.youtube.com/watch?v=.*", "FIXME", "<embed [%d]>"));
+    }
+
+    public void init(final InsertMediaExtView view) {
+        super.init(view);
+        this.view = view;
+    }
+
+    @Override
+    public boolean isValid() {
+        String url = view.getSrc();
+        mediaDescriptor = externalMediaRegistry.get(url);
+        if (mediaDescriptor.equals(ExternalMediaRegistry.NO_MEDIA)) {
+            insertMediaDialog.setErrorMessage("We cannot process this video link", Level.error);
+            return false;
+        } else {
+            return true;
+        }
+    }
+
+    @Override
+    protected String updateMediaInfo() {
+        return mediaDescriptor.getEmbed(view.getSrc());
+    }
+}

Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertMediaExtView.java (from rev 1089, trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaView.java	2009-03-30 13:48:35 UTC (rev 1089)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertMediaExtView.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -0,0 +1,6 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia.ext;
+
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractView;
+
+public interface InsertMediaExtView extends InsertMediaAbstractView {
+}

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManager.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManager.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -40,12 +40,7 @@
             "language.code", "language.englishName", "language.nativeName", "lastRevision.body", "lastRevision.title",
             "mimeType.mimetype" };
 
-    String[] DEF_GROUP_SEARCH_FIELDS = new String[] { "container.owner.shortName", "authors.name", "authors.shortName",
-            "container.name", "language.code", "language.englishName", "language.nativeName", "lastRevision.body",
-            "lastRevision.title" };
-
-    String[] DEF_GROUP_SEARCH_FIELDS_WITH_MIME = new String[] { "authors.name", "authors.shortName", "container.name",
-            "language.code", "language.englishName", "language.nativeName", "lastRevision.body", "lastRevision.title",
+    String[] DEF_GROUP_SEARCH_FIELDS_WITH_MIME = new String[] { "lastRevision.title", "container.owner_shortName",
             "mimeType.mimetype" };
 
     void addAuthor(User user, Long contentId, String authorShortName) throws DefaultException;
@@ -72,8 +67,12 @@
 
     SearchResult<Content> search(String search, Integer firstResult, Integer maxResults);
 
-    SearchResult<Content> searchMime(String search, Integer firstResult, Integer maxResults, String mimetype);
+    SearchResult<Content> searchMime(String search, Integer firstResult, Integer maxResults, String group,
+            String mimetype);
 
+    SearchResult<?> searchMime(String search, Integer firstResult, Integer maxResults, String group, String mimetype,
+            String mimetype2);
+
     I18nLanguage setLanguage(User user, Long contentId, String languageCode) throws DefaultException;
 
     void setPublishedOn(User user, Long contentId, Date publishedOn) throws DefaultException;

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -20,6 +20,7 @@
 package org.ourproject.kune.platf.server.content;
 
 import java.util.Date;
+import java.util.List;
 
 import javax.persistence.EntityManager;
 
@@ -27,7 +28,6 @@
 import org.apache.lucene.queryParser.MultiFieldQueryParser;
 import org.apache.lucene.queryParser.ParseException;
 import org.apache.lucene.search.Query;
-import org.apache.lucene.search.BooleanClause.Occur;
 import org.ourproject.kune.platf.client.errors.DefaultException;
 import org.ourproject.kune.platf.client.errors.I18nNotFoundException;
 import org.ourproject.kune.platf.client.errors.NameInUseException;
@@ -172,7 +172,7 @@
     }
 
     public SearchResult<Content> search(final String search, final Integer firstResult, final Integer maxResults) {
-        final MultiFieldQueryParser parser = createParser();
+        final MultiFieldQueryParser parser = createMultiFieldParser();
         Query query;
         try {
             query = parser.parse(search);
@@ -183,9 +183,19 @@
     }
 
     public SearchResult<Content> searchMime(final String search, final Integer firstResult, final Integer maxResults,
-            final String mimetype) {
-        return search(getSearchQueries(search, mimetype), DEF_GLOBAL_SEARCH_FIELDS_WITH_MIME, getConditions(),
+            final String groupShortName, final String mimetype) {
+        List<Content> list = contentFinder.findMime(groupShortName, "%" + search + "%", mimetype, firstResult,
+                maxResults);
+        int count = contentFinder.findMimeCount(groupShortName, "%" + search + "%", mimetype);
+        return new SearchResult<Content>(count, list);
+    }
+
+    public SearchResult<?> searchMime(final String search, final Integer firstResult, final Integer maxResults,
+            final String groupShortName, final String mimetype, final String mimetype2) {
+        List<Content> list = contentFinder.find2Mime(groupShortName, "%" + search + "%", mimetype, mimetype2,
                 firstResult, maxResults);
+        int count = contentFinder.find2MimeCount(groupShortName, "%" + search + "%", mimetype, mimetype2);
+        return new SearchResult<Content>(count, list);
     }
 
     public I18nLanguage setLanguage(final User user, final Long contentId, final String languageCode)
@@ -227,7 +237,7 @@
         tagManager.setTags(user, content, tags);
     }
 
-    private MultiFieldQueryParser createParser() {
+    private MultiFieldQueryParser createMultiFieldParser() {
         final MultiFieldQueryParser parser = new MultiFieldQueryParser(DEF_GLOBAL_SEARCH_FIELDS, new StandardAnalyzer());
         return parser;
     }
@@ -239,25 +249,4 @@
         }
         return initialTitle;
     }
-
-    private Occur[] getConditions() {
-        String[] fields = ContentManager.DEF_GLOBAL_SEARCH_FIELDS_WITH_MIME;
-        Occur[] conditions = new Occur[fields.length];
-        for (int i = 0; i < conditions.length; i++) {
-            conditions[i] = Occur.SHOULD;
-        }
-        conditions[conditions.length - 1] = Occur.MUST;
-        return conditions;
-    }
-
-    private String[] getSearchQueries(final String search, final String mimetype) {
-        String[] fields = ContentManager.DEF_GLOBAL_SEARCH_FIELDS_WITH_MIME;
-        String[] query = new String[fields.length];
-        for (int i = 0; i < query.length; i++) {
-            query[i] = search;
-        }
-        query[query.length - 1] = mimetype;
-        return query;
-    }
-
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/domain/Container.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/Container.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/Container.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -73,7 +73,7 @@
     @ManyToOne
     private I18nLanguage language;
 
-    @IndexedEmbedded
+    @IndexedEmbedded(depth = 1, prefix = "owner_")
     @OneToOne
     private Group owner;
 

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-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -55,6 +55,8 @@
 
 import com.google.inject.name.Named;
 import com.wideplay.warp.persist.dao.Finder;
+import com.wideplay.warp.persist.dao.FirstResult;
+import com.wideplay.warp.persist.dao.MaxResults;
 
 @Entity
 @Table(name = "contents")
@@ -159,11 +161,36 @@
         }
     }
 
+    @Finder(query = "FROM Content WHERE lastRevision.title LIKE :title AND (mimeType.mimetype=:mimetype OR mimeType.mimetype=:mimetype2) AND container.owner.shortName=:group AND status != 'inTheDustbin' ORDER BY lastRevision.title ASC")
+    public List<Content> find2Mime(@Named("group") final String groupShortName, @Named("title") final String title,
+            @Named("mimetype") final String mimetype, @Named("mimetype2") final String mimetype2,
+            @FirstResult final int offset, @MaxResults final int limit) {
+        return null;
+    }
+
+    @Finder(query = "SELECT count(id) FROM Content WHERE lastRevision.title LIKE :title AND (mimeType.mimetype=:mimetype OR mimeType.mimetype=:mimetype2) AND container.owner.shortName=:group AND status != 'inTheDustbin'")
+    public int find2MimeCount(@Named("group") final String groupShortName, @Named("title") final String title,
+            @Named("mimetype") final String mimetype, @Named("mimetype2") final String mimetype2) {
+        return 0;
+    }
+
     @Finder(query = "select count(*) from Container ctx, Content ctn where ctn.container.id = ctx.id and ctx = :container and ctn.lastRevision.title LIKE :title")
     public Long findIfExistsTitle(@Named("container") final Container container, @Named("title") final String title) {
         return null;
     }
 
+    @Finder(query = "FROM Content WHERE lastRevision.title LIKE :title AND mimeType.mimetype=:mimetype AND container.owner.shortName=:group AND status != 'inTheDustbin' ORDER BY lastRevision.title ASC")
+    public List<Content> findMime(@Named("group") final String groupShortName, @Named("title") final String title,
+            @Named("mimetype") final String mimetype, @FirstResult final int offset, @MaxResults final int limit) {
+        return null;
+    }
+
+    @Finder(query = "SELECT count(id) FROM Content WHERE lastRevision.title LIKE :title AND mimeType.mimetype=:mimetype AND container.owner.shortName=:group AND status != 'inTheDustbin'")
+    public int findMimeCount(@Named("group") final String groupShortName, @Named("title") final String title,
+            @Named("mimetype") final String mimetype) {
+        return 0;
+    }
+
     @Transient
     public AccessLists getAccessLists() {
         return hasAccessList() ? accessLists : getContainer().getAccessLists();

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/rest/ContentJSONService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/rest/ContentJSONService.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rest/ContentJSONService.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -62,21 +62,19 @@
     }
 
     @REST(params = { SearcherContants.QUERY_PARAM, SearcherContants.START_PARAM, SearcherContants.LIMIT_PARAM,
-            SearcherContants.MIMETYPE_PARAM })
+            SearcherContants.GROUP_PARAM, SearcherContants.MIMETYPE_PARAM })
     public SearchResultDTO<LinkDTO> search(final String search, final Integer firstResult, final Integer maxResults,
-            final String mimetype) {
-        SearchResult<Content> results = contentManager.searchMime(search, firstResult, maxResults, mimetype);
+            final String group, final String mimetype) {
+        SearchResult<Content> results = contentManager.searchMime(search, firstResult, maxResults, group, mimetype);
         return map(results);
     }
 
     @REST(params = { SearcherContants.QUERY_PARAM, SearcherContants.START_PARAM, SearcherContants.LIMIT_PARAM,
-            SearcherContants.MIMETYPE_PARAM, SearcherContants.MIMETYPE2_PARAM })
+            SearcherContants.GROUP_PARAM, SearcherContants.MIMETYPE_PARAM, SearcherContants.MIMETYPE2_PARAM })
     public SearchResultDTO<LinkDTO> search(final String search, final Integer firstResult, final Integer maxResults,
-            final String mimetype, final String mimetype2) {
-        SearchResult<Content> results1st = contentManager.searchMime(search, firstResult, maxResults, mimetype);
-        SearchResult<Content> results2nd = contentManager.searchMime(search, firstResult, maxResults, mimetype2);
-        results1st.getList().addAll(results2nd.getList());
-        return map(results1st);
+            final String group, final String mimetype, final String mimetype2) {
+        return map(contentManager.searchMime(search, firstResult, maxResults, group, mimetype, mimetype2));
+
     }
 
     private SearchResultDTO<LinkDTO> map(final SearchResult<?> results) {

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -53,10 +53,10 @@
 import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
 import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialog;
 import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageGroup;
-import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertMediaGroup;
 import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkDialog;
 import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkGroup;
 import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialog;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaGroup;
 import org.ourproject.kune.platf.client.ui.rte.saving.RTESavingEditorPanel;
 import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
 import org.ourproject.kune.platf.client.utils.TimerWrapper;
@@ -80,9 +80,9 @@
 import org.ourproject.kune.workspace.client.editor.insertlocallink.InsertLinkLocal;
 import org.ourproject.kune.workspace.client.editor.insertlocallink.InsertLinkLocalPanel;
 import org.ourproject.kune.workspace.client.editor.insertlocallink.InsertLinkLocalPresenter;
-import org.ourproject.kune.workspace.client.editor.insertlocalmedia.InsertLocalMedia;
-import org.ourproject.kune.workspace.client.editor.insertlocalmedia.InsertLocalMediaPanel;
-import org.ourproject.kune.workspace.client.editor.insertlocalmedia.InsertLocalMediaPresenter;
+import org.ourproject.kune.workspace.client.editor.insertlocalmedia.InsertMediaLocalPanel;
+import org.ourproject.kune.workspace.client.editor.insertlocalmedia.InsertMediaLocalPresenter;
+import org.ourproject.kune.workspace.client.editor.insertlocalmedia.InsertMediaLocal;
 import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
 import org.ourproject.kune.workspace.client.entityheader.EntityHeaderPanel;
 import org.ourproject.kune.workspace.client.entityheader.EntityHeaderPresenter;
@@ -933,7 +933,8 @@
         register(InsertImageGroup.class, new Factory<InsertImageLocal>(InsertImageLocal.class) {
             @Override
             public InsertImageLocal create() {
-                final InsertImageLocalPresenter presenter = new InsertImageLocalPresenter($(InsertImageDialog.class));
+                final InsertImageLocalPresenter presenter = new InsertImageLocalPresenter($(InsertImageDialog.class),
+                        $(Session.class));
                 final InsertImageLocalPanel panel = new InsertImageLocalPanel(presenter,
                         $(I18nTranslationService.class), $(FileDownloadUtils.class));
                 presenter.init(panel);
@@ -970,11 +971,12 @@
             }
         });
 
-        register(InsertMediaGroup.class, new Factory<InsertLocalMedia>(InsertLocalMedia.class) {
+        register(InsertMediaGroup.class, new Factory<InsertMediaLocal>(InsertMediaLocal.class) {
             @Override
-            public InsertLocalMedia create() {
-                final InsertLocalMediaPresenter presenter = new InsertLocalMediaPresenter($(InsertMediaDialog.class));
-                final InsertLocalMediaPanel panel = new InsertLocalMediaPanel(presenter,
+            public InsertMediaLocal create() {
+                final InsertMediaLocalPresenter presenter = new InsertMediaLocalPresenter($(InsertMediaDialog.class),
+                        $(Session.class));
+                final InsertMediaLocalPanel panel = new InsertMediaLocalPanel(presenter,
                         $(I18nTranslationService.class), $(FileDownloadUtils.class));
                 presenter.init(panel);
                 return presenter;

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -12,6 +12,8 @@
 
 import com.calclab.suco.client.events.Listener;
 import com.gwtext.client.core.UrlParam;
+import com.gwtext.client.widgets.form.Field;
+import com.gwtext.client.widgets.form.event.FieldListenerAdapter;
 
 public class InsertImageLocalPanel extends InsertImageAbstractPanel implements InsertImageLocalView {
 
@@ -21,7 +23,7 @@
             final FileDownloadUtils downloadUtils) {
         super(i18n.t("Local"), presenter);
 
-        AbstractLiveSearcherField cb = new AbstractLiveSearcherField(i18n,
+        final AbstractLiveSearcherField cb = new AbstractLiveSearcherField(i18n,
                 SearcherContants.CONTENT_TEMPLATE_TEXT_PREFIX
                         + downloadUtils.getLogoImageUrl(new StateToken("{shortName}"))
                         + SearcherContants.CONTENT_TEMPLATE_TEXT_SUFFIX, SearcherContants.CONTENT_DATA_PROXY_URL,
@@ -34,7 +36,14 @@
         cb.setHideLabel(false);
         cb.setAllowBlank(false);
         cb.setWidth(220);
-        cb.setStoreBaseParams(new UrlParam[] { new UrlParam(SearcherContants.MIMETYPE_PARAM, BasicMimeTypeDTO.IMAGE) });
+        cb.addListener(new FieldListenerAdapter() {
+            @Override
+            public void onFocus(final Field field) {
+                cb.setStoreBaseParams(new UrlParam[] {
+                        new UrlParam(SearcherContants.GROUP_PARAM, presenter.getCurrentGroupName()),
+                        new UrlParam(SearcherContants.MIMETYPE_PARAM, BasicMimeTypeDTO.IMAGE) });
+            }
+        });
 
         super.insert(0, cb);
     }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPresenter.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPresenter.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -1,12 +1,20 @@
 package org.ourproject.kune.workspace.client.editor.insertlocalimg;
 
+import org.ourproject.kune.platf.client.state.Session;
 import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialog;
 import org.ourproject.kune.platf.client.ui.rte.insertimg.abstractimg.InsertImageAbstractPresenter;
 
 public class InsertImageLocalPresenter extends InsertImageAbstractPresenter implements InsertImageLocal {
 
-    public InsertImageLocalPresenter(InsertImageDialog insertImageDialog) {
+    private final Session session;
+
+    public InsertImageLocalPresenter(final InsertImageDialog insertImageDialog, final Session session) {
         super(insertImageDialog);
+        this.session = session;
     }
 
+    public String getCurrentGroupName() {
+        return session.getCurrentGroupShortName();
+    }
+
 }

Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMedia.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMedia.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMedia.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -1,7 +0,0 @@
-package org.ourproject.kune.workspace.client.editor.insertlocalmedia;
-
-import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstract;
-
-public interface InsertLocalMedia extends InsertMediaAbstract {
-
-}

Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPanel.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPanel.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -1,50 +0,0 @@
-package org.ourproject.kune.workspace.client.editor.insertlocalmedia;
-
-import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
-import org.ourproject.kune.platf.client.dto.LinkDTO;
-import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
-import org.ourproject.kune.platf.client.ui.WindowUtils;
-import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
-import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractPanel;
-import org.ourproject.kune.workspace.client.search.AbstractLiveSearcherField;
-import org.ourproject.kune.workspace.client.search.SearcherContants;
-
-import com.calclab.suco.client.events.Listener;
-import com.gwtext.client.core.UrlParam;
-
-public class InsertLocalMediaPanel extends InsertMediaAbstractPanel implements InsertLocalMediaView {
-
-    protected String src;
-
-    public InsertLocalMediaPanel(final InsertLocalMediaPresenter presenter, final I18nTranslationService i18n,
-            final FileDownloadUtils downloadUtils) {
-        super(i18n.t("Local"), presenter);
-
-        AbstractLiveSearcherField cb = new AbstractLiveSearcherField(i18n,
-                SearcherContants.CONTENT_TEMPLATE_TEXT_PREFIX
-                        + downloadUtils.getLogoImageUrl(new StateToken("{shortName}"))
-                        + SearcherContants.CONTENT_TEMPLATE_TEXT_SUFFIX, SearcherContants.CONTENT_DATA_PROXY_URL,
-                new Listener<LinkDTO>() {
-                    public void onEvent(final LinkDTO link) {
-                        src = WindowUtils.getPublicHost() + downloadUtils.getImageUrl(new StateToken(link.getLink()));
-                    }
-                });
-        cb.setLabel(i18n.t("Local media"));
-        cb.setHideLabel(false);
-        cb.setAllowBlank(false);
-        cb.setWidth(220);
-        cb.setStoreBaseParams(new UrlParam[] { new UrlParam(SearcherContants.MIMETYPE_PARAM, BasicMimeTypeDTO.AUDIO),
-                new UrlParam(SearcherContants.MIMETYPE2_PARAM, BasicMimeTypeDTO.VIDEO) });
-
-        hrefField.setVisible(false);
-        hrefField.disable();
-
-        super.insert(0, cb);
-    }
-
-    @Override
-    public String getSrc() {
-        return src;
-    }
-}

Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPresenter.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPresenter.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -1,18 +0,0 @@
-package org.ourproject.kune.workspace.client.editor.insertlocalmedia;
-
-import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialog;
-import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractPresenter;
-
-public class InsertLocalMediaPresenter extends InsertMediaAbstractPresenter implements InsertLocalMedia {
-
-    private InsertLocalMediaView view;
-
-    public InsertLocalMediaPresenter(InsertMediaDialog insertMediaDialog) {
-        super(insertMediaDialog);
-    }
-
-    public void init(InsertLocalMediaView view) {
-        super.init(view);
-        this.view = view;
-    }
-}

Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaView.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaView.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -1,6 +0,0 @@
-package org.ourproject.kune.workspace.client.editor.insertlocalmedia;
-
-import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractView;
-
-public interface InsertLocalMediaView extends InsertMediaAbstractView {
-}

Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertMediaLocal.java (from rev 1089, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMedia.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMedia.java	2009-03-30 13:48:35 UTC (rev 1089)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertMediaLocal.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.workspace.client.editor.insertlocalmedia;
+
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstract;
+
+public interface InsertMediaLocal extends InsertMediaAbstract {
+
+}

Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertMediaLocalPanel.java (from rev 1094, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPanel.java	2009-04-18 16:33:27 UTC (rev 1094)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertMediaLocalPanel.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -0,0 +1,59 @@
+package org.ourproject.kune.workspace.client.editor.insertlocalmedia;
+
+import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
+import org.ourproject.kune.platf.client.dto.LinkDTO;
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.WindowUtils;
+import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractPanel;
+import org.ourproject.kune.workspace.client.search.AbstractLiveSearcherField;
+import org.ourproject.kune.workspace.client.search.SearcherContants;
+
+import com.calclab.suco.client.events.Listener;
+import com.gwtext.client.core.UrlParam;
+import com.gwtext.client.widgets.form.Field;
+import com.gwtext.client.widgets.form.event.FieldListenerAdapter;
+
+public class InsertMediaLocalPanel extends InsertMediaAbstractPanel implements InsertMediaLocalView {
+
+    protected String src;
+
+    public InsertMediaLocalPanel(final InsertMediaLocalPresenter presenter, final I18nTranslationService i18n,
+            final FileDownloadUtils downloadUtils) {
+        super(i18n.t("Local"), presenter);
+
+        final AbstractLiveSearcherField cb = new AbstractLiveSearcherField(i18n,
+                SearcherContants.CONTENT_TEMPLATE_TEXT_PREFIX
+                        + downloadUtils.getLogoImageUrl(new StateToken("{shortName}"))
+                        + SearcherContants.CONTENT_TEMPLATE_TEXT_SUFFIX, SearcherContants.CONTENT_DATA_PROXY_URL,
+                new Listener<LinkDTO>() {
+                    public void onEvent(final LinkDTO link) {
+                        src = WindowUtils.getPublicHost() + downloadUtils.getImageUrl(new StateToken(link.getLink()));
+                    }
+                });
+        cb.setLabel(i18n.t("Local media"));
+        cb.setHideLabel(false);
+        cb.setAllowBlank(false);
+        cb.setWidth(220);
+        cb.addListener(new FieldListenerAdapter() {
+            @Override
+            public void onFocus(final Field field) {
+                cb.setStoreBaseParams(new UrlParam[] {
+                        new UrlParam(SearcherContants.GROUP_PARAM, presenter.getCurrentGroupName()),
+                        new UrlParam(SearcherContants.MIMETYPE_PARAM, BasicMimeTypeDTO.AUDIO),
+                        new UrlParam(SearcherContants.MIMETYPE2_PARAM, BasicMimeTypeDTO.VIDEO) });
+            }
+        });
+
+        hrefField.setVisible(false);
+        hrefField.disable();
+
+        super.insert(0, cb);
+    }
+
+    @Override
+    public String getSrc() {
+        return src;
+    }
+}

Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertMediaLocalPresenter.java (from rev 1089, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPresenter.java	2009-03-30 13:48:35 UTC (rev 1089)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertMediaLocalPresenter.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -0,0 +1,23 @@
+package org.ourproject.kune.workspace.client.editor.insertlocalmedia;
+
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialog;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractPresenter;
+
+public class InsertMediaLocalPresenter extends InsertMediaAbstractPresenter implements InsertMediaLocal {
+
+    private final Session session;
+
+    public InsertMediaLocalPresenter(final InsertMediaDialog insertMediaDialog, final Session session) {
+        super(insertMediaDialog);
+        this.session = session;
+    }
+
+    public String getCurrentGroupName() {
+        return session.getCurrentGroupShortName();
+    }
+
+    public void init(final InsertMediaLocalView view) {
+        super.init(view);
+    }
+}

Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertMediaLocalView.java (from rev 1089, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaView.java	2009-03-30 13:48:35 UTC (rev 1089)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertMediaLocalView.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -0,0 +1,6 @@
+package org.ourproject.kune.workspace.client.editor.insertlocalmedia;
+
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractView;
+
+public interface InsertMediaLocalView extends InsertMediaAbstractView {
+}

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/AbstractLiveSearcherField.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/AbstractLiveSearcherField.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/AbstractLiveSearcherField.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -37,7 +37,7 @@
                         new StringFieldDef(LINK_FIELD), new StringFieldDef(ICON_URL_FIELD) }));
         reader.setRoot("list");
         reader.setTotalProperty("size");
-        reader.setId(SHORT_NAME_FIELD);
+        reader.setId(LINK_FIELD);
 
         store = new Store(dataProxy, reader);
 

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearcherContants.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearcherContants.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearcherContants.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -7,6 +7,7 @@
     String QUERY_PARAM = "query";
     String MIMETYPE_PARAM = "mimetype";
     String MIMETYPE2_PARAM = "mimetype2";
+    String GROUP_PARAM = "group";
 
     String CONTENT_DATA_PROXY_URL = "/kune/json/ContentJSONService/search";
     String CONTENT_TEMPLATE_TEXT_PREFIX = "<div class=\"search-item\"><span class=\"kune-IconHyperlink\"><img src=\"";

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterForm.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterForm.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterForm.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -61,12 +61,12 @@
     private final Radio noPersonalHomePage;
     private final I18nTranslationService i18n;
 
-    public RegisterForm(final I18nTranslationService i18n, Session session) {
+    public RegisterForm(final I18nTranslationService i18n, final Session session) {
         this.i18n = i18n;
         super.addStyleName("kune-Margin-Large-l");
 
         shortNameRegField = new TextField();
-        shortNameRegField.setTabIndex(0);
+        shortNameRegField.setTabIndex(1);
         shortNameRegField.setFieldLabel(i18n.t("Nickname"));
         shortNameRegField.setName(NICK_FIELD);
         shortNameRegField.setWidth(DEF_SMALL_FIELD_WIDTH);
@@ -81,7 +81,7 @@
         add(shortNameRegField);
 
         longNameRegField = new TextField();
-        longNameRegField.setTabIndex(1);
+        longNameRegField.setTabIndex(2);
         longNameRegField.setFieldLabel(i18n.t("Full Name"));
         longNameRegField.setName(LONGNAME_FIELD);
         longNameRegField.setWidth(DEF_FIELD_WIDTH);
@@ -93,7 +93,7 @@
         add(longNameRegField);
 
         passwdRegField = new TextField();
-        passwdRegField.setTabIndex(2);
+        passwdRegField.setTabIndex(3);
         passwdRegField.setFieldLabel(i18n.t("Password"));
         passwdRegField.setName(PASSWORD_FIELD);
         passwdRegField.setPassword(true);
@@ -105,7 +105,7 @@
         add(passwdRegField);
 
         passwdRegFieldDup = new TextField();
-        passwdRegFieldDup.setTabIndex(3);
+        passwdRegFieldDup.setTabIndex(4);
         passwdRegFieldDup.setFieldLabel(i18n.t("Retype password"));
         passwdRegFieldDup.setName(PASSWORD_FIELD_DUP);
         passwdRegFieldDup.setPassword(true);
@@ -124,7 +124,7 @@
         add(passwdRegFieldDup);
 
         emailRegField = new TextField();
-        emailRegField.setTabIndex(4);
+        emailRegField.setTabIndex(5);
         emailRegField.setFieldLabel(i18n.t("Email"));
         emailRegField.setName(EMAIL_FIELD);
         emailRegField.setVtype(VType.EMAIL);
@@ -138,7 +138,7 @@
         langStore.load();
 
         languageCombo = new ComboBox();
-        languageCombo.setTabIndex(5);
+        languageCombo.setTabIndex(6);
         languageCombo.setLazyRender(true);
         languageCombo.setName(LANG_FIELD);
         languageCombo.setMinChars(1);

Modified: trunk/src/test/java/org/ourproject/kune/platf/server/manager/ContentManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/manager/ContentManagerTest.java	2009-04-19 18:47:36 UTC (rev 1095)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/manager/ContentManagerTest.java	2009-04-21 12:54:21 UTC (rev 1096)
@@ -62,10 +62,10 @@
     }
 
     @Test
-    public void testMimeSearch() {
+    public void testtMimeSearch() {
         createContentWithMimeAndCheck(MIMETYPE + "/png");
         contentManager.reIndex();
-        SearchResult<Content> search = contentManager.searchMime(BODY, 0, 10, MIMETYPE);
+        SearchResult<Content> search = contentManager.searchMime(BODY, 0, 10, "asb", MIMETYPE);
         assertEquals(1, search.getSize());
     }
 




More information about the kune-commits mailing list