[kune-commits] r1097 - in trunk/src/main: java/org/ourproject/kune/blogs/client java/org/ourproject/kune/blogs/client/cnt java/org/ourproject/kune/chat/client java/org/ourproject/kune/chat/client/cnt java/org/ourproject/kune/docs/client java/org/ourproject/kune/docs/client/cnt java/org/ourproject/kune/gallery/client java/org/ourproject/kune/gallery/client/cnt java/org/ourproject/kune/platf/client/dto java/org/ourproject/kune/platf/client/services java/org/ourproject/kune/platf/client/state java/org/ourproject/kune/platf/client/ui java/org/ourproject/kune/platf/client/ui/download java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia java/org/ourproject/kune/platf/client/utils java/org/ourproject/kune/platf/public/images/nav java/org/ourproject/kune/platf/server java/org/ourproject/kune/platf/server/domain java/org/ourproject/kune/platf/server/manager/file java/org/ourproject/kune/platf/server/properties java/org/ourproject/kune/platf/server/rpc java/org/ourproject/kune/wiki/client java/org/ourproject/kune/wiki/client/cnt java/org/ourproject/kune/workspace/client java/org/ourproject/kune/workspace/client/cnt java/org/ourproject/kune/workspace/client/editor/insertlocalimg java/org/ourproject/kune/workspace/client/editor/insertlocalmedia java/org/ourproject/kune/workspace/client/tool resources

vjrj vjrj at ourproject.org
Wed Apr 22 02:42:03 CEST 2009


Author: vjrj
Date: 2009-04-22 02:41:57 +0200 (Wed, 22 Apr 2009)
New Revision: 1097

Added:
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/MediaUtils.java
   trunk/src/main/java/org/ourproject/kune/platf/public/images/nav/music.gif
   trunk/src/main/java/org/ourproject/kune/platf/public/images/nav/music.png
Modified:
   trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java
   trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPresenter.java
   trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPresenter.java
   trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
   trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java
   trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
   trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentPresenter.java
   trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPresenter.java
   trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java
   trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryFolderContentPresenter.java
   trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPresenter.java
   trunk/src/main/java/org/ourproject/kune/platf/client/dto/BasicMimeTypeDTO.java
   trunk/src/main/java/org/ourproject/kune/platf/client/dto/InitDataDTO.java
   trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateTokenUtils.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/WindowUtils.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileDownloadUtils.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPresenter.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractPresenter.java
   trunk/src/main/java/org/ourproject/kune/platf/client/utils/Url.java
   trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java
   trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java
   trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileDownloadManager.java
   trunk/src/main/java/org/ourproject/kune/platf/server/properties/KuneProperties.java
   trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SiteRPC.java
   trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java
   trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiFolderContentPresenter.java
   trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.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/tool/FoldableAbstractClientTool.java
   trunk/src/main/resources/kune.properties
Log:
Incomplete - task flash flv tests for embed video and audio 

Incomplete - task Insert Media dialog 

Incomplete - task Audio contents player 


Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -39,6 +39,7 @@
 import org.ourproject.kune.platf.client.state.Session;
 import org.ourproject.kune.platf.client.state.StateManager;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.MediaUtils;
 import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
 import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
 import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
@@ -97,7 +98,7 @@
             public BlogViewer create() {
                 final BlogViewerPresenter presenter = new BlogViewerPresenter($(StateManager.class), $(Session.class),
                         $(I18nUITranslationService.class), $(ActionContentToolbar.class),
-                        $(ContentActionRegistry.class), $$(FileDownloadUtils.class));
+                        $(ContentActionRegistry.class), $$(FileDownloadUtils.class), $$(MediaUtils.class));
                 final BlogViewerView view = new BlogViewerPanel($(WorkspaceSkeleton.class),
                         $(I18nTranslationService.class));
                 presenter.init(view);
@@ -110,7 +111,7 @@
             public BlogFolderContent create() {
                 final BlogFolderContentPresenter presenter = new BlogFolderContentPresenter($(StateManager.class),
                         $(Session.class), $(ActionContentToolbar.class), $(ContentActionRegistry.class),
-                        $(I18nTranslationService.class), $$(FileDownloadUtils.class));
+                        $(I18nTranslationService.class), $$(FileDownloadUtils.class), $$(MediaUtils.class));
                 final BlogFolderContentView view = new BlogFolderContentPanel($(WorkspaceSkeleton.class),
                         $(I18nTranslationService.class));
                 presenter.init(view);

Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPresenter.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPresenter.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -27,6 +27,7 @@
 import org.ourproject.kune.platf.client.state.Session;
 import org.ourproject.kune.platf.client.state.StateManager;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.MediaUtils;
 import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
 import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
 
@@ -37,10 +38,11 @@
     private BlogFolderContentView view;
     private final I18nTranslationService i18n;
 
-    public BlogFolderContentPresenter(StateManager stateManager, Session session, ActionContentToolbar toolbar,
-            final ActionRegistry<StateToken> actionRegistry, I18nTranslationService i18n,
-            Provider<FileDownloadUtils> downloadProvider) {
-        super(BlogClientTool.NAME, stateManager, session, toolbar, actionRegistry, downloadProvider, i18n);
+    public BlogFolderContentPresenter(final StateManager stateManager, final Session session,
+            final ActionContentToolbar toolbar, final ActionRegistry<StateToken> actionRegistry,
+            final I18nTranslationService i18n, final Provider<FileDownloadUtils> downloadProvider,
+            final Provider<MediaUtils> mediaUtils) {
+        super(BlogClientTool.NAME, stateManager, session, toolbar, actionRegistry, downloadProvider, i18n, mediaUtils);
         this.i18n = i18n;
     }
 
@@ -50,7 +52,7 @@
     }
 
     @Override
-    protected void setState(StateContainerDTO state) {
+    protected void setState(final StateContainerDTO state) {
         if (state.getTypeId().equals(BlogClientTool.TYPE_ROOT)) {
             if (state.getRootContainer().getChilds().size() == 0) {
                 view.setInfo(i18n.t("This group has no blogs"));

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-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPresenter.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -25,6 +25,7 @@
 import org.ourproject.kune.platf.client.state.Session;
 import org.ourproject.kune.platf.client.state.StateManager;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.MediaUtils;
 import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
 import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
 import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
@@ -33,18 +34,19 @@
 
 public class BlogViewerPresenter extends FoldableContentPresenter implements BlogViewer {
 
-    public BlogViewerPresenter(StateManager stateManager, Session session, I18nUITranslationService i18n,
-            ActionContentToolbar toolbar, ContentActionRegistry actionRegistry,
-            Provider<FileDownloadUtils> downloadProvider) {
-        super(BlogClientTool.NAME, stateManager, session, toolbar, actionRegistry, downloadProvider, i18n);
+    public BlogViewerPresenter(final StateManager stateManager, final Session session,
+            final I18nUITranslationService i18n, final ActionContentToolbar toolbar,
+            final ContentActionRegistry actionRegistry, final Provider<FileDownloadUtils> downloadProvider,
+            final Provider<MediaUtils> mediaUtils) {
+        super(BlogClientTool.NAME, stateManager, session, toolbar, actionRegistry, downloadProvider, i18n, mediaUtils);
     }
 
-    public void init(BlogViewerView view) {
+    public void init(final BlogViewerView view) {
         super.init(view);
     }
 
     @Override
-    protected void setState(StateContentDTO state) {
+    protected void setState(final StateContentDTO state) {
         super.setState(state);
         super.setContent(state, BlogClientTool.TYPE_UPLOADEDFILE);
     }

Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -37,6 +37,7 @@
 import org.ourproject.kune.platf.client.state.Session;
 import org.ourproject.kune.platf.client.state.StateManager;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.MediaUtils;
 import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
 import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
 import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
@@ -97,7 +98,7 @@
             public ChatRoom create() {
                 final ChatRoomPresenter presenter = new ChatRoomPresenter($(StateManager.class), $(Session.class),
                         $(I18nUITranslationService.class), $(ActionContentToolbar.class),
-                        $(ContentActionRegistry.class), $$(FileDownloadUtils.class));
+                        $(ContentActionRegistry.class), $$(FileDownloadUtils.class), $$(MediaUtils.class));
                 final ChatRoomPanel panel = new ChatRoomPanel($(WorkspaceSkeleton.class),
                         $(I18nTranslationService.class));
                 presenter.init(panel);

Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -28,6 +28,7 @@
 import org.ourproject.kune.platf.client.state.StateManager;
 import org.ourproject.kune.platf.client.ui.TextUtils;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.MediaUtils;
 import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
 import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
 
@@ -38,10 +39,11 @@
     private ChatRoomView view;
     private final I18nUITranslationService i18n;
 
-    public ChatRoomPresenter(StateManager stateManager, Session session, I18nUITranslationService i18n,
-            ActionContentToolbar toolbar, final ActionRegistry<StateToken> actionRegistry,
-            Provider<FileDownloadUtils> downloadProvider) {
-        super(ChatClientTool.NAME, stateManager, session, toolbar, actionRegistry, downloadProvider, i18n);
+    public ChatRoomPresenter(final StateManager stateManager, final Session session,
+            final I18nUITranslationService i18n, final ActionContentToolbar toolbar,
+            final ActionRegistry<StateToken> actionRegistry, final Provider<FileDownloadUtils> downloadProvider,
+            final Provider<MediaUtils> mediaUtils) {
+        super(ChatClientTool.NAME, stateManager, session, toolbar, actionRegistry, downloadProvider, i18n, mediaUtils);
         this.i18n = i18n;
     }
 
@@ -51,7 +53,7 @@
     }
 
     @Override
-    protected void setState(StateContainerDTO state) {
+    protected void setState(final StateContainerDTO state) {
         if (state.getTypeId().equals(ChatClientTool.TYPE_ROOT)) {
             if (state.getRootContainer().getChilds().size() == 0) {
                 view.setInfo(i18n.t("This group has no chat rooms."));

Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -39,6 +39,7 @@
 import org.ourproject.kune.platf.client.state.Session;
 import org.ourproject.kune.platf.client.state.StateManager;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.MediaUtils;
 import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
 import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
 import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
@@ -78,8 +79,8 @@
                         $(Session.class), $(StateManager.class), $(DeferredCommandWrapper.class),
                         $$(ContentServiceAsync.class), $$(GroupServiceAsync.class), $$(FileUploader.class),
                         $(ContentActionRegistry.class), $(ContextActionRegistry.class), $$(FileDownloadUtils.class),
-                        $(EntityHeader.class), $$(ContentEditor.class), $(ErrorHandler.class),
-                        $(DocumentViewer.class), $$(ContextPropEditor.class), $(SitePublicSpaceLink.class));
+                        $(EntityHeader.class), $$(ContentEditor.class), $(ErrorHandler.class), $(DocumentViewer.class),
+                        $$(ContextPropEditor.class), $(SitePublicSpaceLink.class));
             }
         });
 
@@ -97,7 +98,7 @@
             public DocumentViewer create() {
                 final DocumentViewerPresenter presenter = new DocumentViewerPresenter($(StateManager.class),
                         $(Session.class), $(I18nUITranslationService.class), $(ActionContentToolbar.class),
-                        $(ContentActionRegistry.class), $$(FileDownloadUtils.class));
+                        $(ContentActionRegistry.class), $$(FileDownloadUtils.class), $$(MediaUtils.class));
                 final DocumentViewerView view = new DocumentViewerPanel($(WorkspaceSkeleton.class),
                         $(I18nTranslationService.class));
                 presenter.init(view);
@@ -110,7 +111,7 @@
             public DocFolderContent create() {
                 final DocFolderContentPresenter presenter = new DocFolderContentPresenter($(StateManager.class),
                         $(Session.class), $(ActionContentToolbar.class), $(ContentActionRegistry.class),
-                        $$(FileDownloadUtils.class), $(I18nTranslationService.class));
+                        $$(FileDownloadUtils.class), $(I18nTranslationService.class), $$(MediaUtils.class));
                 final DocFolderContentView view = new DocFolderContentPanel($(WorkspaceSkeleton.class),
                         $(I18nTranslationService.class));
                 presenter.init(view);

Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentPresenter.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentPresenter.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -26,6 +26,7 @@
 import org.ourproject.kune.platf.client.state.Session;
 import org.ourproject.kune.platf.client.state.StateManager;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.MediaUtils;
 import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
 import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
 
@@ -33,10 +34,12 @@
 
 public class DocFolderContentPresenter extends FoldableContentPresenter implements DocFolderContent {
 
-    public DocFolderContentPresenter(StateManager stateManager, Session session, ActionContentToolbar toolbar,
-            final ActionRegistry<StateToken> actionRegistry, Provider<FileDownloadUtils> downloadProvider,
-            I18nTranslationService i18n) {
-        super(DocumentClientTool.NAME, stateManager, session, toolbar, actionRegistry, downloadProvider, i18n);
+    public DocFolderContentPresenter(final StateManager stateManager, final Session session,
+            final ActionContentToolbar toolbar, final ActionRegistry<StateToken> actionRegistry,
+            final Provider<FileDownloadUtils> downloadProvider, final I18nTranslationService i18n,
+            final Provider<MediaUtils> mediaUtils) {
+        super(DocumentClientTool.NAME, stateManager, session, toolbar, actionRegistry, downloadProvider, i18n,
+                mediaUtils);
     }
 
     public void init(final DocFolderContentView view) {

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-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPresenter.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -25,6 +25,7 @@
 import org.ourproject.kune.platf.client.state.Session;
 import org.ourproject.kune.platf.client.state.StateManager;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.MediaUtils;
 import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
 import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
 import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
@@ -33,18 +34,20 @@
 
 public class DocumentViewerPresenter extends FoldableContentPresenter implements DocumentViewer {
 
-    public DocumentViewerPresenter(StateManager stateManager, Session session, I18nUITranslationService i18n,
-            ActionContentToolbar toolbar, ContentActionRegistry actionRegistry,
-            Provider<FileDownloadUtils> downloadProvider) {
-        super(DocumentClientTool.NAME, stateManager, session, toolbar, actionRegistry, downloadProvider, i18n);
+    public DocumentViewerPresenter(final StateManager stateManager, final Session session,
+            final I18nUITranslationService i18n, final ActionContentToolbar toolbar,
+            final ContentActionRegistry actionRegistry, final Provider<FileDownloadUtils> downloadProvider,
+            final Provider<MediaUtils> mediaUtils) {
+        super(DocumentClientTool.NAME, stateManager, session, toolbar, actionRegistry, downloadProvider, i18n,
+                mediaUtils);
     }
 
-    public void init(DocumentViewerView view) {
+    public void init(final DocumentViewerView view) {
         super.init(view);
     }
 
     @Override
-    protected void setState(StateContentDTO state) {
+    protected void setState(final StateContentDTO state) {
         super.setState(state);
         setContent(state, DocumentClientTool.TYPE_UPLOADEDFILE);
     }

Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -39,6 +39,7 @@
 import org.ourproject.kune.platf.client.state.Session;
 import org.ourproject.kune.platf.client.state.StateManager;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.MediaUtils;
 import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
 import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
 import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
@@ -78,8 +79,8 @@
                         $(Session.class), $(StateManager.class), $(DeferredCommandWrapper.class),
                         $$(ContentServiceAsync.class), $$(GroupServiceAsync.class), $$(FileUploader.class),
                         $(ContentActionRegistry.class), $(ContextActionRegistry.class), $$(FileDownloadUtils.class),
-                        $(EntityHeader.class), $$(ContentEditor.class), $(ErrorHandler.class),
-                        $(GalleryViewer.class), $$(ContextPropEditor.class), $(SitePublicSpaceLink.class));
+                        $(EntityHeader.class), $$(ContentEditor.class), $(ErrorHandler.class), $(GalleryViewer.class),
+                        $$(ContextPropEditor.class), $(SitePublicSpaceLink.class));
             }
         });
 
@@ -97,7 +98,7 @@
             public GalleryViewer create() {
                 final GalleryViewerPresenter presenter = new GalleryViewerPresenter($(StateManager.class),
                         $(Session.class), $(I18nUITranslationService.class), $(ActionContentToolbar.class),
-                        $(ContentActionRegistry.class), $$(FileDownloadUtils.class));
+                        $(ContentActionRegistry.class), $$(FileDownloadUtils.class), $$(MediaUtils.class));
                 final GalleryViewerView view = new GalleryViewerPanel($(WorkspaceSkeleton.class),
                         $(I18nTranslationService.class));
                 presenter.init(view);
@@ -111,7 +112,7 @@
                 final GalleryFolderContentPresenter presenter = new GalleryFolderContentPresenter(
                         $(StateManager.class), $(Session.class), $(ActionContentToolbar.class),
                         $(ContentActionRegistry.class), $(I18nTranslationService.class), $$(FileDownloadUtils.class),
-                        $$(FileDownloadUtils.class));
+                        $$(FileDownloadUtils.class), $$(MediaUtils.class));
                 final GalleryFolderContentView view = new GalleryFolderContentPanel($(WorkspaceSkeleton.class),
                         $(I18nTranslationService.class), $(StateManager.class), $(Session.class));
                 presenter.init(view);

Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryFolderContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryFolderContentPresenter.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryFolderContentPresenter.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -30,6 +30,7 @@
 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.rte.insertmedia.abstractmedia.MediaUtils;
 import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
 import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
 
@@ -41,10 +42,12 @@
     private final I18nTranslationService i18n;
     private final Provider<FileDownloadUtils> downloadUtils;
 
-    public GalleryFolderContentPresenter(StateManager stateManager, Session session, ActionContentToolbar toolbar,
-            final ActionRegistry<StateToken> actionRegistry, I18nTranslationService i18n,
-            Provider<FileDownloadUtils> downloadUtils, Provider<FileDownloadUtils> downloadProvider) {
-        super(GalleryClientTool.NAME, stateManager, session, toolbar, actionRegistry, downloadProvider, i18n);
+    public GalleryFolderContentPresenter(final StateManager stateManager, final Session session,
+            final ActionContentToolbar toolbar, final ActionRegistry<StateToken> actionRegistry,
+            final I18nTranslationService i18n, final Provider<FileDownloadUtils> downloadUtils,
+            final Provider<FileDownloadUtils> downloadProvider, final Provider<MediaUtils> mediaUtils) {
+        super(GalleryClientTool.NAME, stateManager, session, toolbar, actionRegistry, downloadProvider, i18n,
+                mediaUtils);
         this.i18n = i18n;
         this.downloadUtils = downloadUtils;
     }
@@ -55,7 +58,7 @@
     }
 
     @Override
-    protected void setState(StateContainerDTO state) {
+    protected void setState(final StateContainerDTO state) {
         if (state.getTypeId().equals(GalleryClientTool.TYPE_ROOT)) {
             ContainerDTO rootContainer = state.getRootContainer();
             if (rootContainer.getChilds().size() == 0 && rootContainer.getContents().size() == 0) {

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-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPresenter.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -25,6 +25,7 @@
 import org.ourproject.kune.platf.client.state.Session;
 import org.ourproject.kune.platf.client.state.StateManager;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.MediaUtils;
 import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
 import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
 import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
@@ -33,18 +34,20 @@
 
 public class GalleryViewerPresenter extends FoldableContentPresenter implements GalleryViewer {
 
-    public GalleryViewerPresenter(StateManager stateManager, Session session, I18nUITranslationService i18n,
-            ActionContentToolbar toolbar, ContentActionRegistry actionRegistry,
-            Provider<FileDownloadUtils> downloadProvider) {
-        super(GalleryClientTool.NAME, stateManager, session, toolbar, actionRegistry, downloadProvider, i18n);
+    public GalleryViewerPresenter(final StateManager stateManager, final Session session,
+            final I18nUITranslationService i18n, final ActionContentToolbar toolbar,
+            final ContentActionRegistry actionRegistry, final Provider<FileDownloadUtils> downloadProvider,
+            final Provider<MediaUtils> mediaUtils) {
+        super(GalleryClientTool.NAME, stateManager, session, toolbar, actionRegistry, downloadProvider, i18n,
+                mediaUtils);
     }
 
-    public void init(GalleryViewerView view) {
+    public void init(final GalleryViewerView view) {
         super.init(view);
     }
 
     @Override
-    protected void setState(StateContentDTO state) {
+    protected void setState(final StateContentDTO state) {
         super.setState(state);
         setContent(state, GalleryClientTool.TYPE_UPLOADEDFILE);
     }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/BasicMimeTypeDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/BasicMimeTypeDTO.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/BasicMimeTypeDTO.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -57,6 +57,10 @@
         return type;
     }
 
+    public boolean isFlv() {
+        return type != null && subtype != null && type.equals("video") && subtype.equals("flv");
+    }
+
     /**
      * Duplicate code in BMT
      * 
@@ -66,6 +70,11 @@
         return type != null && type.equals(IMAGE);
     }
 
+    public boolean isMp3() {
+        return type != null && subtype != null && type.equals("audio")
+                && (subtype.equals("mp3") || subtype.equals("x-mp3") || (subtype.equals("mpeg")));
+    }
+
     /**
      * Duplicate code in BMT
      * 

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/InitDataDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/InitDataDTO.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/InitDataDTO.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -24,6 +24,8 @@
 import com.google.gwt.user.client.rpc.IsSerializable;
 
 public class InitDataDTO implements IsSerializable {
+
+    private String siteUrl;
     private UserInfoDTO userInfo;
     private ArrayList<LicenseDTO> licenses;
     private ArrayList<I18nLanguageSimpleDTO> languages;
@@ -46,6 +48,7 @@
     private int imgIconsize;
     private ArrayList<ToolSimpleDTO> userTools;
     private ArrayList<ToolSimpleDTO> groupTools;
+    private String mediaEmbedObject;
 
     public String getChatDomain() {
         return chatDomain;
@@ -111,6 +114,10 @@
         return maxFileSizeInMb;
     }
 
+    public String getMediaEmbedObject() {
+        return mediaEmbedObject;
+    }
+
     public String getSiteDomain() {
         return siteDomain;
     }
@@ -119,6 +126,10 @@
         return siteLogoUrl;
     }
 
+    public String getSiteUrl() {
+        return siteUrl;
+    }
+
     public String[] getTimezones() {
         return timezones;
     }
@@ -155,11 +166,11 @@
         this.countries = countries;
     }
 
-    public void setCurrentCCversion(String currentCCversion) {
+    public void setCurrentCCversion(final String currentCCversion) {
         this.currentCCversion = currentCCversion;
     }
 
-    public void setDefaultLicense(LicenseDTO defaultLicense) {
+    public void setDefaultLicense(final LicenseDTO defaultLicense) {
         this.defaultLicense = defaultLicense;
     }
 
@@ -171,23 +182,23 @@
         this.galleryPermittedExtensions = galleryPermittedExtensions;
     }
 
-    public void setGroupTools(ArrayList<ToolSimpleDTO> groupTools) {
+    public void setGroupTools(final ArrayList<ToolSimpleDTO> groupTools) {
         this.groupTools = groupTools;
     }
 
-    public void setImgCropsize(int imgCropsize) {
+    public void setImgCropsize(final int imgCropsize) {
         this.imgCropsize = imgCropsize;
     }
 
-    public void setImgIconsize(int imgIconsize) {
+    public void setImgIconsize(final int imgIconsize) {
         this.imgIconsize = imgIconsize;
     }
 
-    public void setImgResizewidth(int imgResizewidth) {
+    public void setImgResizewidth(final int imgResizewidth) {
         this.imgResizewidth = imgResizewidth;
     }
 
-    public void setImgThumbsize(int imgThumbsize) {
+    public void setImgThumbsize(final int imgThumbsize) {
         this.imgThumbsize = imgThumbsize;
     }
 
@@ -203,6 +214,10 @@
         this.maxFileSizeInMb = maxFileSizeInMb;
     }
 
+    public void setMediaEmbedObject(final String mediaEmbedObject) {
+        this.mediaEmbedObject = mediaEmbedObject;
+    }
+
     public void setSiteDomain(final String siteDomain) {
         this.siteDomain = siteDomain;
     }
@@ -211,6 +226,10 @@
         this.siteLogoUrl = siteLogoUrl;
     }
 
+    public void setSiteUrl(final String siteUrl) {
+        this.siteUrl = siteUrl;
+    }
+
     public void setTimezones(final String[] timezones) {
         this.timezones = timezones;
     }
@@ -219,7 +238,7 @@
         this.userInfo = currentUser;
     }
 
-    public void setUserTools(ArrayList<ToolSimpleDTO> userTools) {
+    public void setUserTools(final ArrayList<ToolSimpleDTO> userTools) {
         this.userTools = userTools;
     }
 

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateTokenUtils.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateTokenUtils.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateTokenUtils.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -1,9 +1,15 @@
 package org.ourproject.kune.platf.client.dto;
 
-import org.ourproject.kune.platf.client.ui.WindowUtils;
+import org.ourproject.kune.platf.client.state.Session;
 
 public class StateTokenUtils {
 
+    private final Session session;
+
+    public StateTokenUtils(final Session session) {
+        this.session = session;
+    }
+
     public String getPublicUrl(final StateToken token) {
         String publicUrl = "";
         String separator = ".";
@@ -13,7 +19,7 @@
         String folder = token.getFolder();
         String document = token.getDocument();
 
-        publicUrl += WindowUtils.getPublicHost() + "/public";
+        publicUrl += session.getSiteUrl() + "/public";
 
         if (group != null) {
             publicUrl += "/" + group;

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-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -92,6 +92,7 @@
 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.InsertMediaGroup;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.MediaUtils;
 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;
@@ -489,6 +490,13 @@
             }
         });
 
+
+        register(MediaUtils.class, new Factory<MediaUtils>(MediaUtils.class) {
+            @Override
+            public MediaUtils create() {
+                return new MediaUtils($(Session.class), $(FileDownloadUtils.class));
+            }});
+
         register(InsertMediaGroup.class, new Factory<InsertMediaExt>(InsertMediaExt.class) {
             @Override
             public InsertMediaExt create() {

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-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -105,6 +105,8 @@
 
     int getImgThumbsize();
 
+    InitDataDTO getInitData();
+
     List<I18nLanguageSimpleDTO> getLanguages();
 
     Object[][] getLanguagesArray();
@@ -113,6 +115,8 @@
 
     boolean getShowDeletedContent();
 
+    String getSiteUrl();
+
     Object[][] getTimezones();
 
     String getUserHash();

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-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -147,6 +147,10 @@
         return initData.getImgThumbsize();
     }
 
+    public InitDataDTO getInitData() {
+        return initData;
+    }
+
     public List<I18nLanguageSimpleDTO> getLanguages() {
         return initData.getLanguages();
     }
@@ -166,6 +170,10 @@
         return currentUserInfo == null ? false : currentUserInfo.getShowDeletedContent();
     }
 
+    public String getSiteUrl() {
+        return initData.getSiteUrl();
+    }
+
     public Object[][] getTimezones() {
         if (timezonesArray == null) {
             mapTimezones();

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/WindowUtils.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/WindowUtils.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/WindowUtils.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -30,42 +30,36 @@
         return result;
     }
 
-    public static String getPublicHost() {
-        // FIXME: Maybe get from InitData the site.domain
-        String port = WindowUtils.getLocation().getPort();
-        return "http://" + WindowUtils.getLocation().getHostName() + (port == null ? "" : ":" + port);
-    }
-
     private static native String getHash() /*-{
-        return $wnd.location.hash;
-    }-*/;
+           return $wnd.location.hash;
+       }-*/;
 
     private static native String getHost() /*-{
-        return $wnd.location.host;
-    }-*/;
+           return $wnd.location.host;
+       }-*/;
 
     private static native String getHostName() /*-{
-        return $wnd.location.hostname;
-    }-*/;
+           return $wnd.location.hostname;
+       }-*/;
 
     private static native String getHref() /*-{
-        return $wnd.location.href;
-    }-*/;
+           return $wnd.location.href;
+       }-*/;
 
     private static native String getPath() /*-{
-        return $wnd.location.pathname;
-    }-*/;
+           return $wnd.location.pathname;
+       }-*/;
 
     private static native String getPort() /*-{
-        return $wnd.location.port;
-    }-*/;
+           return $wnd.location.port;
+       }-*/;
 
     private static native String getProtocol() /*-{
-        return $wnd.location.protocol;
-    }-*/;
+           return $wnd.location.protocol;
+       }-*/;
 
     private static native String getQueryString() /*-{
-        return $wnd.location.search;
-    }-*/;
+           return $wnd.location.search;
+       }-*/;
 
 }
\ No newline at end of file

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileDownloadUtils.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileDownloadUtils.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileDownloadUtils.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -43,20 +43,20 @@
     }
 
     public void downloadFile(final StateToken token) {
-        final String url = calculateUrl(token, true);
+        final String url = calculateUrl(token, true, true);
         DOM.setElementAttribute(RootPanel.get("__download").getElement(), "src", url);
     }
 
-    public String getImageResizedUrl(final StateToken token, ImageSize imageSize) {
-        return calculateUrl(token, false) + "&" + new UrlParam(FileConstants.IMGSIZE, imageSize.toString());
+    public String getImageResizedUrl(final StateToken token, final ImageSize imageSize) {
+        return calculateUrl(token, false, true) + "&" + new UrlParam(FileConstants.IMGSIZE, imageSize.toString());
     }
 
     public String getImageUrl(final StateToken token) {
-        return calculateUrl(token, false);
+        return calculateUrl(token, false, true);
     }
 
-    public String getLogoAvatarHtml(StateToken groupToken, boolean groupHasLogo, boolean isPersonal, int size,
-            int hvspace) {
+    public String getLogoAvatarHtml(final StateToken groupToken, final boolean groupHasLogo, final boolean isPersonal,
+            final int size, final int hvspace) {
         if (groupHasLogo) {
             return "<img hspace='" + hvspace + "' vspace='" + hvspace + "' align='left' style='width: " + size
                     + "px; height: " + size + "px;' src='" + getLogoImageUrl(groupToken) + "'>";
@@ -66,13 +66,20 @@
         }
     }
 
-    public String getLogoImageUrl(StateToken token) {
+    public String getLogoImageUrl(final StateToken token) {
         return new Url(LOGODOWNLOADSERVLET, new UrlParam(FileConstants.TOKEN, token.toString())).toString();
     }
 
-    private String calculateUrl(final StateToken token, final boolean download) {
-        return new Url(DOWNLOADSERVLET, new UrlParam(FileConstants.TOKEN, token.toString()), new UrlParam(FileConstants.HASH,
-                session.getUserHash()), new UrlParam(FileConstants.DOWNLOAD, download)).toString();
+    public String getUrl(final StateToken token) {
+        return calculateUrl(token, false, false);
     }
 
+    private String calculateUrl(final StateToken token, final boolean download, final boolean useHash) {
+        Url url = new Url(DOWNLOADSERVLET, new UrlParam(FileConstants.TOKEN, token.toString()), new UrlParam(
+                FileConstants.DOWNLOAD, download));
+        if (useHash) {
+            url.add(new UrlParam(FileConstants.HASH, session.getUserHash()));
+        }
+        return url.toString();
+    }
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -53,11 +53,6 @@
         insertImageDialog.getImageInfo().setClickOriginal(checked);
     }
 
-    public void onInsert(final ImageInfo linkInfo) {
-        insertImageDialog.fireOnInsertImage(linkInfo);
-        reset();
-    }
-
     public void onPositionFieldChanged(final String position) {
         insertImageDialog.getImageInfo().setPosition(position);
     }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPresenter.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPresenter.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -67,11 +67,6 @@
         editorInsertDialog.setOnInsertLinkPressed(onInsertLinkPressed);
     }
 
-    public void onInsert(final LinkInfo linkInfo) {
-        editorInsertDialog.fireOnInsertLink(linkInfo);
-        reset();
-    }
-
     public void onOverFieldChanged(final String title) {
         editorInsertDialog.getLinkInfo().setTitle(title);
     }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractPresenter.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractPresenter.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -43,11 +43,6 @@
         insertMediaDialog.setOnInsertPressed(onInsertMediaPressed);
     }
 
-    public void onInsert(final String linkInfo) {
-        insertMediaDialog.fireOnInsertMedia(linkInfo);
-        reset();
-    }
-
     public void reset() {
         view.reset();
     }

Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/MediaUtils.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/MediaUtils.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/MediaUtils.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -0,0 +1,24 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia;
+
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+
+public class MediaUtils {
+
+    public static final String DOC_FLV_URL_TAG = "###DOC_FLV_URL###";
+
+    private final Session session;
+
+    private final FileDownloadUtils downloadUtils;
+
+    public MediaUtils(final Session session, final FileDownloadUtils downloadUtils) {
+        this.session = session;
+        this.downloadUtils = downloadUtils;
+    }
+
+    public String getEmbed(final StateToken token) {
+        return session.getInitData().getMediaEmbedObject().replace(DOC_FLV_URL_TAG,
+                session.getSiteUrl() + downloadUtils.getUrl(token));
+    }
+}

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/utils/Url.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/utils/Url.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/utils/Url.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -25,18 +25,22 @@
     private final String base;
     private final ArrayList<UrlParam> params;
 
-    public Url(String base) {
+    public Url(final String base) {
         this.base = base;
         params = new ArrayList<UrlParam>();
     }
 
-    public Url(String base, UrlParam... iniParams) {
+    public Url(final String base, final UrlParam... iniParams) {
         this(base);
         for (UrlParam param : iniParams) {
-            params.add(param);
+            add(param);
         }
     }
 
+    public void add(final UrlParam param) {
+        params.add(param);
+    }
+
     @Override
     public String toString() {
         String paramPart = "";

Added: trunk/src/main/java/org/ourproject/kune/platf/public/images/nav/music.gif
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/org/ourproject/kune/platf/public/images/nav/music.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/main/java/org/ourproject/kune/platf/public/images/nav/music.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/org/ourproject/kune/platf/public/images/nav/music.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -29,6 +29,7 @@
 import org.ourproject.kune.platf.server.users.UserInfo;
 
 public class InitData {
+    private String siteUrl;
     private List<License> licenses;
     private List<I18nLanguage> languages;
     private List<I18nCountry> countries;
@@ -51,6 +52,7 @@
     private int imgIconsize;
     private ArrayList<ToolSimple> userTools;
     private ArrayList<ToolSimple> groupTools;
+    private String mediaEmbedObject;
 
     public String getChatDomain() {
         return chatDomain;
@@ -116,6 +118,10 @@
         return maxFileSizeInMb;
     }
 
+    public String getMediaEmbedObject() {
+        return mediaEmbedObject;
+    }
+
     public String getSiteDomain() {
         return siteDomain;
     }
@@ -124,6 +130,10 @@
         return siteLogoUrl;
     }
 
+    public String getSiteUrl() {
+        return siteUrl;
+    }
+
     public String[] getTimezones() {
         return timezones;
     }
@@ -156,11 +166,11 @@
         this.countries = countries;
     }
 
-    public void setCurrentCCversion(String currentCCversion) {
+    public void setCurrentCCversion(final String currentCCversion) {
         this.currentCCversion = currentCCversion;
     }
 
-    public void setDefaultLicense(License defaultLicense) {
+    public void setDefaultLicense(final License defaultLicense) {
         this.defaultLicense = defaultLicense;
     }
 
@@ -172,23 +182,23 @@
         this.galleryPermittedExtensions = galleryPermittedExtensions;
     }
 
-    public void setGroupTools(ArrayList<ToolSimple> groupTools) {
+    public void setGroupTools(final ArrayList<ToolSimple> groupTools) {
         this.groupTools = groupTools;
     }
 
-    public void setImgCropsize(int imgCropsize) {
+    public void setImgCropsize(final int imgCropsize) {
         this.imgCropsize = imgCropsize;
     }
 
-    public void setImgIconsize(int imgIconsize) {
+    public void setImgIconsize(final int imgIconsize) {
         this.imgIconsize = imgIconsize;
     }
 
-    public void setImgResizewidth(int imgResizewidth) {
+    public void setImgResizewidth(final int imgResizewidth) {
         this.imgResizewidth = imgResizewidth;
     }
 
-    public void setImgThumbsize(int imgThumbsize) {
+    public void setImgThumbsize(final int imgThumbsize) {
         this.imgThumbsize = imgThumbsize;
     }
 
@@ -204,6 +214,10 @@
         this.maxFileSizeInMb = maxFileSizeInMb;
     }
 
+    public void setMediaEmbedObject(final String mediaEmbedObject) {
+        this.mediaEmbedObject = mediaEmbedObject;
+    }
+
     public void setSiteDomain(final String siteDomain) {
         this.siteDomain = siteDomain;
     }
@@ -212,6 +226,10 @@
         this.siteLogoUrl = siteLogoUrl;
     }
 
+    public void setSiteUrl(final String siteUrl) {
+        this.siteUrl = siteUrl;
+    }
+
     public void setTimezones(final String[] timezones) {
         this.timezones = timezones;
     }
@@ -220,7 +238,7 @@
         this.userInfo = currentUserInfo;
     }
 
-    public void setUserTools(ArrayList<ToolSimple> userTools) {
+    public void setUserTools(final ArrayList<ToolSimple> userTools) {
         this.userTools = userTools;
     }
 

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-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -161,14 +161,14 @@
         }
     }
 
-    @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")
+    @Finder(query = "FROM Content WHERE lastRevision.title LIKE :title AND (mimeType.mimetype=:mimetype OR mimeType.mimetype=:mimetype2) AND container.owner.shortName=:group AND deletedOn=null 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'")
+    @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 deletedOn=null")
     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;
@@ -179,13 +179,13 @@
         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")
+    @Finder(query = "FROM Content WHERE lastRevision.title LIKE :title AND mimeType.mimetype=:mimetype AND container.owner.shortName=:group AND deletedOn=null 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'")
+    @Finder(query = "SELECT count(id) FROM Content WHERE lastRevision.title LIKE :title AND mimeType.mimetype=:mimetype AND container.owner.shortName=:group AND deletedOn=null")
     public int findMimeCount(@Named("group") final String groupShortName, @Named("title") final String title,
             @Named("mimetype") final String mimetype) {
         return 0;

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileDownloadManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileDownloadManager.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileDownloadManager.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -87,8 +87,9 @@
         }
     }
 
-    String buildResponse(final Content cnt, final StateToken stateToken, final String downloadS, String imageSizeS,
-            final HttpServletResponse resp, FileUtils fileUtils) throws FileNotFoundException, IOException {
+    String buildResponse(final Content cnt, final StateToken stateToken, final String downloadS,
+            final String imageSizeS, final HttpServletResponse resp, final FileUtils fileUtils)
+            throws FileNotFoundException, IOException {
         final ImageSize imgsize = imageSizeS == null ? null : ImageSize.valueOf(imageSizeS);
         final boolean download = downloadS != null && downloadS.equals("true") ? true : false;
         final String absDir = kuneProperties.get(KuneProperties.UPLOAD_LOCATION) + FileUtils.toDir(stateToken);
@@ -121,10 +122,8 @@
         resp.setContentLength((int) file.length());
         if (mimeType == null || download) {
             resp.setContentType(APPLICATION_X_DOWNLOAD);
-        } else if (mimeType.isImage()) {
-            resp.setContentType(mimeType.toString());
         } else {
-            resp.setContentType(APPLICATION_X_DOWNLOAD);
+            resp.setContentType(mimeType.toString());
         }
         resp.setHeader(RESP_HEADER_CONTEND_DISP, RESP_HEADER_ATTACHMENT_FILENAME + title + extension + RESP_HEADER_END);
         return absFilename;

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/properties/KuneProperties.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/properties/KuneProperties.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/properties/KuneProperties.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -20,8 +20,9 @@
 package org.ourproject.kune.platf.server.properties;
 
 public interface KuneProperties {
+    String SITE_URL = "kune.siteurl";
+    String SITE_DOMAIN = "kune.site.domain";
     String DEFAULT_SITE_SHORT_NAME = "kune.default.site.shortName";
-    String SITE_DOMAIN = "kune.site.domain";
     String CURRENT_CC_VERSION = "kune.currentccversion";
     String CHAT_HTTP_BASE = "kune.chat.httpbase";
     String CHAT_DOMAIN = "kune.chat.domain";
@@ -36,6 +37,7 @@
     String IMAGES_THUMBSIZE = "kune.images.thumbsize";
     String IMAGES_CROPSIZE = "kune.images.cropsize";
     String IMAGES_ICONSIZE = "kune.images.iconsize";
+    String MEDIA_EMBEDED_OBJECT = "kune.media.embededobject";
 
     String get(String key);
 

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SiteRPC.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SiteRPC.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SiteRPC.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -79,6 +79,7 @@
         final InitData data = new InitData();
         final UserSession userSession = getUserSession();
 
+        data.setSiteUrl(kuneProperties.get(KuneProperties.SITE_URL));
         data.setLicenses(licenseManager.getAll());
         data.setLanguages(languageManager.getAll());
         data.setCountries(countryManager.getAll());
@@ -102,6 +103,7 @@
         data.setImgThumbsize(new Integer(kuneProperties.get(KuneProperties.IMAGES_THUMBSIZE)));
         data.setImgCropsize(new Integer(kuneProperties.get(KuneProperties.IMAGES_CROPSIZE)));
         data.setImgIconsize(new Integer(kuneProperties.get(KuneProperties.IMAGES_ICONSIZE)));
+        data.setMediaEmbedObject(kuneProperties.get(KuneProperties.MEDIA_EMBEDED_OBJECT));
         return mapper.map(data, InitDataDTO.class);
     }
 

Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -29,6 +29,7 @@
 import org.ourproject.kune.platf.client.state.Session;
 import org.ourproject.kune.platf.client.state.StateManager;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.MediaUtils;
 import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
 import org.ourproject.kune.wiki.client.cnt.WikiFolderContent;
 import org.ourproject.kune.wiki.client.cnt.WikiFolderContentPanel;
@@ -97,7 +98,7 @@
             public WikiViewer create() {
                 final WikiViewerPresenter presenter = new WikiViewerPresenter($(StateManager.class), $(Session.class),
                         $(I18nUITranslationService.class), $(ActionContentToolbar.class),
-                        $(ContentActionRegistry.class), $$(FileDownloadUtils.class));
+                        $(ContentActionRegistry.class), $$(FileDownloadUtils.class), $$(MediaUtils.class));
                 final WikiViewerView view = new WikiViewerPanel($(WorkspaceSkeleton.class),
                         $(I18nTranslationService.class));
                 presenter.init(view);
@@ -110,7 +111,7 @@
             public WikiFolderContent create() {
                 final WikiFolderContentPresenter presenter = new WikiFolderContentPresenter($(StateManager.class),
                         $(Session.class), $(ActionContentToolbar.class), $(ContentActionRegistry.class),
-                        $(I18nTranslationService.class), $$(FileDownloadUtils.class));
+                        $(I18nTranslationService.class), $$(FileDownloadUtils.class), $$(MediaUtils.class));
                 final WikiFolderContentView view = new WikiFolderContentPanel($(WorkspaceSkeleton.class),
                         $(I18nTranslationService.class));
                 presenter.init(view);

Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiFolderContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiFolderContentPresenter.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiFolderContentPresenter.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -27,6 +27,7 @@
 import org.ourproject.kune.platf.client.state.Session;
 import org.ourproject.kune.platf.client.state.StateManager;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.MediaUtils;
 import org.ourproject.kune.wiki.client.WikiClientTool;
 import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
 import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
@@ -38,10 +39,11 @@
     private WikiFolderContentView view;
     private final I18nTranslationService i18n;
 
-    public WikiFolderContentPresenter(StateManager stateManager, Session session, ActionContentToolbar toolbar,
-            final ActionRegistry<StateToken> actionRegistry, I18nTranslationService i18n,
-            Provider<FileDownloadUtils> downloadProvider) {
-        super(WikiClientTool.NAME, stateManager, session, toolbar, actionRegistry, downloadProvider, i18n);
+    public WikiFolderContentPresenter(final StateManager stateManager, final Session session,
+            final ActionContentToolbar toolbar, final ActionRegistry<StateToken> actionRegistry,
+            final I18nTranslationService i18n, final Provider<FileDownloadUtils> downloadProvider,
+            final Provider<MediaUtils> mediaUtils) {
+        super(WikiClientTool.NAME, stateManager, session, toolbar, actionRegistry, downloadProvider, i18n, mediaUtils);
         this.i18n = i18n;
     }
 
@@ -51,7 +53,7 @@
     }
 
     @Override
-    protected void setState(StateContainerDTO state) {
+    protected void setState(final StateContainerDTO state) {
         if (state.getTypeId().equals(WikiClientTool.TYPE_ROOT)) {
             ContainerDTO rootContainer = state.getRootContainer();
             if (rootContainer.getChilds().size() == 0 && rootContainer.getContents().size() == 0) {

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-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPresenter.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -24,6 +24,7 @@
 import org.ourproject.kune.platf.client.state.Session;
 import org.ourproject.kune.platf.client.state.StateManager;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.MediaUtils;
 import org.ourproject.kune.wiki.client.WikiClientTool;
 import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
 import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
@@ -33,18 +34,19 @@
 
 public class WikiViewerPresenter extends FoldableContentPresenter implements WikiViewer {
 
-    public WikiViewerPresenter(StateManager stateManager, Session session, I18nUITranslationService i18n,
-            ActionContentToolbar toolbar, ContentActionRegistry actionRegistry,
-            Provider<FileDownloadUtils> downloadProvider) {
-        super(WikiClientTool.NAME, stateManager, session, toolbar, actionRegistry, downloadProvider, i18n);
+    public WikiViewerPresenter(final StateManager stateManager, final Session session,
+            final I18nUITranslationService i18n, final ActionContentToolbar toolbar,
+            final ContentActionRegistry actionRegistry, final Provider<FileDownloadUtils> downloadProvider,
+            final Provider<MediaUtils> mediaUtils) {
+        super(WikiClientTool.NAME, stateManager, session, toolbar, actionRegistry, downloadProvider, i18n, mediaUtils);
     }
 
-    public void init(WikiViewerView view) {
+    public void init(final WikiViewerView view) {
         super.init(view);
     }
 
     @Override
-    protected void setState(StateContentDTO state) {
+    protected void setState(final StateContentDTO state) {
         super.setState(state);
         setContent(state, WikiClientTool.TYPE_UPLOADEDFILE);
     }

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-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -57,6 +57,7 @@
 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.insertmedia.abstractmedia.MediaUtils;
 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 +81,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.InsertMediaLocal;
 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;
@@ -306,7 +307,7 @@
         register(Singleton.class, new Factory<StateTokenUtils>(StateTokenUtils.class) {
             @Override
             public StateTokenUtils create() {
-                return new StateTokenUtils();
+                return new StateTokenUtils($(Session.class));
             }
         });
 
@@ -936,7 +937,7 @@
                 final InsertImageLocalPresenter presenter = new InsertImageLocalPresenter($(InsertImageDialog.class),
                         $(Session.class));
                 final InsertImageLocalPanel panel = new InsertImageLocalPanel(presenter,
-                        $(I18nTranslationService.class), $(FileDownloadUtils.class));
+                        $(I18nTranslationService.class), $(FileDownloadUtils.class), $(Session.class));
                 presenter.init(panel);
                 return presenter;
             }
@@ -975,7 +976,7 @@
             @Override
             public InsertMediaLocal create() {
                 final InsertMediaLocalPresenter presenter = new InsertMediaLocalPresenter($(InsertMediaDialog.class),
-                        $(Session.class));
+                        $(Session.class), $$(MediaUtils.class));
                 final InsertMediaLocalPanel panel = new InsertMediaLocalPanel(presenter,
                         $(I18nTranslationService.class), $(FileDownloadUtils.class));
                 presenter.init(panel);

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-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -32,6 +32,7 @@
 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.rte.insertmedia.abstractmedia.MediaUtils;
 import org.ourproject.kune.workspace.client.AbstractFoldableContentActions;
 
 import com.calclab.suco.client.events.Listener;
@@ -45,16 +46,19 @@
     private final ActionContentToolbar toolbar;
     private final Provider<FileDownloadUtils> downloadProvider;
     private final I18nTranslationService i18n;
+    private final Provider<MediaUtils> mediaUtils;
 
-    public FoldableContentPresenter(final String toolName, StateManager stateManager, Session session,
-            final ActionContentToolbar toolbar, ActionRegistry<StateToken> actionRegistry,
-            Provider<FileDownloadUtils> downloadProvider, I18nTranslationService i18n) {
+    public FoldableContentPresenter(final String toolName, final StateManager stateManager, final Session session,
+            final ActionContentToolbar toolbar, final ActionRegistry<StateToken> actionRegistry,
+            final Provider<FileDownloadUtils> downloadProvider, final I18nTranslationService i18n,
+            final Provider<MediaUtils> mediaUtils) {
         this.toolName = toolName;
         this.session = session;
         this.toolbar = toolbar;
         this.actionRegistry = actionRegistry;
         this.downloadProvider = downloadProvider;
         this.i18n = i18n;
+        this.mediaUtils = mediaUtils;
         stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
             public void onEvent(final StateAbstractDTO state) {
                 setState(state);
@@ -70,7 +74,7 @@
         setState(session.getContentState());
     }
 
-    protected void setContent(StateContentDTO state, String uploadedfileType) {
+    protected void setContent(final StateContentDTO state, final String uploadedfileType) {
         String typeId = state.getTypeId();
         String contentBody = state.getContent();
         StateToken token = state.getStateToken();
@@ -84,6 +88,8 @@
                 } else if (mimeType.isPdf()) {
                     view.showImage(fileDownloadUtils.getImageUrl(token), fileDownloadUtils.getImageResizedUrl(token,
                             ImageSize.sized), true);
+                } else if (mimeType.isMp3() || mimeType.isFlv()) {
+                    view.setContent(mediaUtils.get().getEmbed(token), false);
                 } else if (mimeType.isText()) {
                     view.setContent(contentBody, true);
                 } else {
@@ -106,7 +112,7 @@
         view.attach();
     }
 
-    protected void setState(StateAbstractDTO state) {
+    protected void setState(final StateAbstractDTO state) {
         toolbar.detach();
         if (state instanceof StateContainerDTO) {
             StateContainerDTO stateCntCtx = (StateContainerDTO) state;
@@ -121,23 +127,24 @@
         }
     }
 
-    protected void setState(StateContainerDTO state) {
+    protected void setState(final StateContainerDTO state) {
         ActionItemCollection<StateToken> collection = getActionCollection(state, state.getContainerRights());
         setToolbar(collection);
         attach();
     }
 
-    protected void setState(StateContentDTO state) {
+    protected void setState(final StateContentDTO state) {
         ActionItemCollection<StateToken> collection = getActionCollection(state, state.getContentRights());
         setToolbar(collection);
     }
 
-    private ActionItemCollection<StateToken> getActionCollection(StateContainerDTO state, AccessRightsDTO rights) {
+    private ActionItemCollection<StateToken> getActionCollection(final StateContainerDTO state,
+            final AccessRightsDTO rights) {
         return actionRegistry.getCurrentActions(state.getStateToken(), state.getTypeId(), session.isLogged(), rights,
                 true);
     }
 
-    private void setToolbar(ActionItemCollection<StateToken> collection) {
+    private void setToolbar(final ActionItemCollection<StateToken> collection) {
         toolbar.disableMenusAndClearButtons();
         toolbar.addActions(collection, AbstractFoldableContentActions.CONTENT_TOPBAR);
         ;

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-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -4,7 +4,7 @@
 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.state.Session;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
 import org.ourproject.kune.platf.client.ui.rte.insertimg.abstractimg.InsertImageAbstractPanel;
 import org.ourproject.kune.workspace.client.search.AbstractLiveSearcherField;
@@ -20,7 +20,7 @@
     protected String src;
 
     public InsertImageLocalPanel(final InsertImageLocalPresenter presenter, final I18nTranslationService i18n,
-            final FileDownloadUtils downloadUtils) {
+            final FileDownloadUtils downloadUtils, final Session session) {
         super(i18n.t("Local"), presenter);
 
         final AbstractLiveSearcherField cb = new AbstractLiveSearcherField(i18n,
@@ -29,7 +29,7 @@
                         + 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()));
+                        src = session.getSiteUrl() + downloadUtils.getImageUrl(new StateToken(link.getLink()));
                     }
                 });
         cb.setLabel(i18n.t("Local images"));

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertMediaLocalPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertMediaLocalPanel.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertMediaLocalPanel.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -4,7 +4,6 @@
 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;
@@ -29,7 +28,7 @@
                         + 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()));
+                        src = link.getLink();
                     }
                 });
         cb.setLabel(i18n.t("Local media"));

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertMediaLocalPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertMediaLocalPresenter.java	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertMediaLocalPresenter.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -1,16 +1,23 @@
 package org.ourproject.kune.workspace.client.editor.insertlocalmedia;
 
+import org.ourproject.kune.platf.client.dto.StateToken;
 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;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.MediaUtils;
 
+import com.calclab.suco.client.ioc.Provider;
+
 public class InsertMediaLocalPresenter extends InsertMediaAbstractPresenter implements InsertMediaLocal {
 
     private final Session session;
+    private final Provider<MediaUtils> mediaUtils;
 
-    public InsertMediaLocalPresenter(final InsertMediaDialog insertMediaDialog, final Session session) {
+    public InsertMediaLocalPresenter(final InsertMediaDialog insertMediaDialog, final Session session,
+            final Provider<MediaUtils> mediaUtils) {
         super(insertMediaDialog);
         this.session = session;
+        this.mediaUtils = mediaUtils;
     }
 
     public String getCurrentGroupName() {
@@ -20,4 +27,9 @@
     public void init(final InsertMediaLocalView view) {
         super.init(view);
     }
+
+    @Override
+    protected String updateMediaInfo() {
+        return mediaUtils.get().getEmbed(new StateToken(view.getSrc()));
+    }
 }

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-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tool/FoldableAbstractClientTool.java	2009-04-22 00:41:57 UTC (rev 1097)
@@ -29,9 +29,9 @@
 
     protected final ContentCapabilitiesRegistry contentCapabilitiesRegistry;
 
-    public FoldableAbstractClientTool(String shortName, String longName, ToolSelector toolSelector,
-            WsThemePresenter wsThemePresenter, WorkspaceSkeleton ws,
-            ContentCapabilitiesRegistry contentCapabilitiesRegistry) {
+    public FoldableAbstractClientTool(final String shortName, final String longName, final ToolSelector toolSelector,
+            final WsThemePresenter wsThemePresenter, final WorkspaceSkeleton ws,
+            final ContentCapabilitiesRegistry contentCapabilitiesRegistry) {
         super(shortName, longName, toolSelector, wsThemePresenter, ws);
         this.contentCapabilitiesRegistry = contentCapabilitiesRegistry;
     }
@@ -44,57 +44,58 @@
         contentCapabilitiesRegistry.getIconsRegistry().registerContentTypeIcon(contentTypeId, iconUrl);
     }
 
-    protected void registerAclEditableTypes(String... typeIds) {
+    protected void registerAclEditableTypes(final String... typeIds) {
         contentCapabilitiesRegistry.getAclEditable().register(typeIds);
     }
 
-    protected void registerAuthorableTypes(String... typeIds) {
+    protected void registerAuthorableTypes(final String... typeIds) {
         contentCapabilitiesRegistry.getAuthorable().register(typeIds);
     }
 
-    protected void registerComentableTypes(String... typeIds) {
+    protected void registerComentableTypes(final String... typeIds) {
         contentCapabilitiesRegistry.getComentable().register(typeIds);
     }
 
-    protected void registerDragableTypes(String... typeIds) {
+    protected void registerDragableTypes(final String... typeIds) {
         contentCapabilitiesRegistry.getDragable().register(typeIds);
     }
 
-    protected void registerDropableTypes(String... typeIds) {
+    protected void registerDropableTypes(final String... typeIds) {
         contentCapabilitiesRegistry.getDropable().register(typeIds);
     }
 
-    protected void registerEmailSubscribeAbleTypes(String... typeIds) {
+    protected void registerEmailSubscribeAbleTypes(final String... typeIds) {
         contentCapabilitiesRegistry.getEmailSubscribeAble().register(typeIds);
     }
 
-    protected void registerLicensableTypes(String... typeIds) {
+    protected void registerLicensableTypes(final String... typeIds) {
         contentCapabilitiesRegistry.getLicensable().register(typeIds);
     }
 
-    protected void registerPublishModerableTypes(String... typeIds) {
+    protected void registerPublishModerableTypes(final String... typeIds) {
         contentCapabilitiesRegistry.getPublishModerable().register(typeIds);
     }
 
-    protected void registerRateableTypes(String... typeIds) {
+    protected void registerRateableTypes(final String... typeIds) {
         contentCapabilitiesRegistry.getRateable().register(typeIds);
     }
 
-    protected void registerRenamableTypes(String... typeIds) {
+    protected void registerRenamableTypes(final String... typeIds) {
         contentCapabilitiesRegistry.getRenamable().register(typeIds);
     }
 
-    protected void registerTageableTypes(String... typeIds) {
+    protected void registerTageableTypes(final String... typeIds) {
         contentCapabilitiesRegistry.getTageable().register(typeIds);
     }
 
-    protected void registerTranslatableTypes(String... typeIds) {
+    protected void registerTranslatableTypes(final String... typeIds) {
         contentCapabilitiesRegistry.getTranslatable().register(typeIds);
     }
 
-    protected void registerUploadTypesAndMimes(String typeUploadedfile) {
+    protected void registerUploadTypesAndMimes(final String typeUploadedfile) {
         registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("image"), "images/nav/picture.png");
         registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("video"), "images/nav/film.png");
+        registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("audio"), "images/nav/music.png");
         registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "pdf"), "images/nav/page_pdf.png");
         registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "zip"), "images/nav/page_zip.png");
         registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "zip"), "images/nav/page_zip.png");
@@ -108,15 +109,15 @@
         registerContentTypeIcon(typeUploadedfile, "images/nav/page.png");
     }
 
-    protected void registerVersionableTypes(String... typeIds) {
+    protected void registerVersionableTypes(final String... typeIds) {
         contentCapabilitiesRegistry.getVersionable().register(typeIds);
     }
 
-    protected void registerXmppComentableTypes(String... typeIds) {
+    protected void registerXmppComentableTypes(final String... typeIds) {
         contentCapabilitiesRegistry.getXmppComentable().register(typeIds);
     }
 
-    protected void registerXmppNotifyCapableTypes(String... typeIds) {
+    protected void registerXmppNotifyCapableTypes(final String... typeIds) {
         contentCapabilitiesRegistry.getXmppNotificyCapable().register(typeIds);
     }
 }

Modified: trunk/src/main/resources/kune.properties
===================================================================
--- trunk/src/main/resources/kune.properties	2009-04-21 12:54:21 UTC (rev 1096)
+++ trunk/src/main/resources/kune.properties	2009-04-22 00:41:57 UTC (rev 1097)
@@ -1,14 +1,28 @@
+### kune.properties
 
+### general
+
+kune.upload.location = /var/lib/kune/uploads/
+
+### site config
+
+kune.siteurl = http://localhost:8080
+
+kune.sitelogourl = images/kune-logo-16px.png
+
 # Every kune site have a group with this name:
 kune.default.site.name = Site Administration
 kune.default.site.shortName = site
 kune.site.domain = localhost
 
+### licenses
+
 kune.default.license = by-sa-v3.0
 # Current CC version, see license table and shortname field (for instance by-sa-v3.0)
 kune.currentccversion = v3.0
 
-# Superuser of a kune installation (is member of site group)
+### Superuser of a kune installation (is member of site group)
+
 kune.admin.name = Site Administrator
 kune.admin.shortName = admin
 kune.admin.email = admin at localhost.localdomain
@@ -18,16 +32,14 @@
 kune.chat.domain = localhost
 kune.chat.roomHost = rooms.localhost
 
-# Workspace enabled themes
+### Workspace enabled themes
+
 # This names are also the name of the items in the theme menu and there are translated
 kune.wsthemes =  default,green,blue,grey,purple,red
 kune.wsthemes.default = default
 
-kune.sitelogourl = images/kune-logo-16px.png
+### Gallery options
 
-kune.upload.location = /var/lib/kune/uploads/
-
-# Gallery options
 kune.upload.gallerypermittedextensions = jpg,jpeg,png,gif,bmp,svg,avi,mpg,mpeg,ogg,mov,tif,tiff,mp3,wav
 kune.upload.maxfilesizeinmegas = 10
 # Images are resized to thumbsize pixels and later cropped (centered) to cropsize
@@ -36,3 +48,9 @@
 kune.images.thumbsize = 100
 kune.images.cropsize = 85
 kune.images.iconsize = 16
+
+### Media options
+
+# The code used to play local embeded videos/audios. Change this with other player/code (include a ###DOC_FLV_URL### tag)
+kune.media.embededobject = <object width="300" height="200" data="http://flowplayer.org/swf/flowplayer-3.1.0.swf" type="application/x-shockwave-flash"> <param name="movie" value="http://flowplayer.org/swf/flowplayer-3.1.0.swf" /> <param name="allowfullscreen" value="true" /> <param name="allowscriptaccess" value="always" /> <param name="flashvars" value='config={"clip":{"url":"###DOC_FLV_URL###", "autoPlay": false, "autoBuffering": false },"canvas":{"backgroundColor":"#112233"},"plugins":{"controls":{"time":true,"volume":false,"fullscreen":true}}}' /> <param name="wmode" value="opaque"> </object>
+




More information about the kune-commits mailing list