[kune-commits] r1099 - in trunk: .
src/main/java/org/ourproject/kune/app/public
src/main/java/org/ourproject/kune/app/public/others
src/main/java/org/ourproject/kune/platf/client/dto
src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia
src/main/java/org/ourproject/kune/platf/server
src/main/java/org/ourproject/kune/platf/server/manager/file
src/main/java/org/ourproject/kune/platf/server/properties
src/main/java/org/ourproject/kune/platf/server/rpc
src/main/java/org/ourproject/kune/workspace/client/cnt
src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia
src/main/resources
vjrj
vjrj at ourproject.org
Wed Apr 22 16:36:54 CEST 2009
Author: vjrj
Date: 2009-04-22 16:36:46 +0200 (Wed, 22 Apr 2009)
New Revision: 1099
Added:
trunk/src/main/java/org/ourproject/kune/app/public/others/
trunk/src/main/java/org/ourproject/kune/app/public/others/cortado-ovt-debug-0.2.2.jar
trunk/src/main/java/org/ourproject/kune/app/public/others/cortado-ovt-stripped-0.2.2.jar
Modified:
trunk/COPYRIGHT
trunk/TODO
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/ui/rte/insertmedia/abstractmedia/MediaUtils.java
trunk/src/main/java/org/ourproject/kune/platf/server/InitData.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/workspace/client/cnt/FoldableContentPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertMediaLocalPresenter.java
trunk/src/main/resources/kune.properties
Log:
Incomplete - task Audio/Video contents player (ogg support)
Modified: trunk/COPYRIGHT
===================================================================
--- trunk/COPYRIGHT 2009-04-22 01:29:14 UTC (rev 1098)
+++ trunk/COPYRIGHT 2009-04-22 14:36:46 UTC (rev 1099)
@@ -115,6 +115,11 @@
Copyright: under GNU Lesser General Public License
http://www.gnu.org/licenses/lgpl.html
+cortado:
+ A video player java applet (Ogg Theora, Ogg Vorbis)
+ http://www.flumotion.net/cortado/
+ Copyright: (C) 2004 Fluendo S.L under GNU General Public License
+
some license description:
from Wikipedia
Copyright: under GFDL http://www.gnu.org/copyleft/fdl.html
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2009-04-22 01:29:14 UTC (rev 1098)
+++ trunk/TODO 2009-04-22 14:36:46 UTC (rev 1099)
@@ -157,7 +157,8 @@
see: svn checkout svn://anonsvn.it.su.se/su-smack su-smack
** TODO <v> study different embeded video solutions
- for ogg :: http://www.flumotion.net/cortado/
- - for mp3+ogg :: flowplayer
+ - for mp3+flv :: flowplayer
+ - for avi :: ??
** TODO <d> Inform to translators when original content changes
** TODO <v> Restarting server don't affect client session
Now there are problems if client was started before server, when server restart (session persist)
Added: trunk/src/main/java/org/ourproject/kune/app/public/others/cortado-ovt-debug-0.2.2.jar
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/others/cortado-ovt-debug-0.2.2.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/app/public/others/cortado-ovt-stripped-0.2.2.jar
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/others/cortado-ovt-stripped-0.2.2.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
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-22 01:29:14 UTC (rev 1098)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/BasicMimeTypeDTO.java 2009-04-22 14:36:46 UTC (rev 1099)
@@ -76,6 +76,11 @@
&& (subtype.equals("mp3") || subtype.equals("x-mp3") || (subtype.equals("mpeg")));
}
+ public boolean isOgg() {
+ // http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
+ return type != null && subtype != null && subtype.equals("ogg");
+ }
+
/**
* 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-22 01:29:14 UTC (rev 1098)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/InitDataDTO.java 2009-04-22 14:36:46 UTC (rev 1099)
@@ -48,8 +48,19 @@
private int imgIconsize;
private ArrayList<ToolSimpleDTO> userTools;
private ArrayList<ToolSimpleDTO> groupTools;
- private String mediaEmbedObject;
+ private String flvEmbedObject;
+
+ private String oggEmbedObject;
+
+ private String mp3EmbedObject;
+
+ private String aviEmbedObject;
+
+ public String getAviEmbedObject() {
+ return aviEmbedObject;
+ }
+
public String getChatDomain() {
return chatDomain;
}
@@ -78,6 +89,10 @@
return defaultWsTheme;
}
+ public String getFlvEmbedObject() {
+ return flvEmbedObject;
+ }
+
public String getGalleryPermittedExtensions() {
return galleryPermittedExtensions;
}
@@ -114,10 +129,14 @@
return maxFileSizeInMb;
}
- public String getMediaEmbedObject() {
- return mediaEmbedObject;
+ public String getMp3EmbedObject() {
+ return mp3EmbedObject;
}
+ public String getOggEmbedObject() {
+ return oggEmbedObject;
+ }
+
public String getSiteDomain() {
return siteDomain;
}
@@ -150,6 +169,10 @@
return getUserInfo() != null;
}
+ public void setAviEmbedObject(final String aviEmbedObject) {
+ this.aviEmbedObject = aviEmbedObject;
+ }
+
public void setChatDomain(final String chatDomain) {
this.chatDomain = chatDomain;
}
@@ -178,6 +201,10 @@
this.defaultWsTheme = defaultWsTheme;
}
+ public void setFlvEmbedObject(final String flvEmbedObject) {
+ this.flvEmbedObject = flvEmbedObject;
+ }
+
public void setGalleryPermittedExtensions(final String galleryPermittedExtensions) {
this.galleryPermittedExtensions = galleryPermittedExtensions;
}
@@ -214,10 +241,14 @@
this.maxFileSizeInMb = maxFileSizeInMb;
}
- public void setMediaEmbedObject(final String mediaEmbedObject) {
- this.mediaEmbedObject = mediaEmbedObject;
+ public void setMp3EmbedObject(final String mp3EmbedObject) {
+ this.mp3EmbedObject = mp3EmbedObject;
}
+ public void setOggEmbedObject(final String oggEmbedObject) {
+ this.oggEmbedObject = oggEmbedObject;
+ }
+
public void setSiteDomain(final String siteDomain) {
this.siteDomain = siteDomain;
}
Modified: 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-22 01:29:14 UTC (rev 1098)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/MediaUtils.java 2009-04-22 14:36:46 UTC (rev 1099)
@@ -6,7 +6,7 @@
public class MediaUtils {
- public static final String DOC_FLV_URL_TAG = "###DOC_FLV_URL###";
+ public static final String DOC_URL_TAG = "###DOC_URL###";
private final Session session;
@@ -17,8 +17,19 @@
this.downloadUtils = downloadUtils;
}
- public String getEmbed(final StateToken token) {
- return session.getInitData().getMediaEmbedObject().replace(DOC_FLV_URL_TAG,
+ public String getFlvEmbed(final StateToken token) {
+ return session.getInitData().getFlvEmbedObject().replace(DOC_URL_TAG,
session.getSiteUrl() + downloadUtils.getUrl(token));
}
+
+ public String getMp3Embed(final StateToken token) {
+ return session.getInitData().getMp3EmbedObject().replace(DOC_URL_TAG,
+ session.getSiteUrl() + downloadUtils.getUrl(token));
+ }
+
+ public String getOggEmbed(final StateToken token) {
+ return session.getInitData().getOggEmbedObject().replace(DOC_URL_TAG,
+ session.getSiteUrl() + downloadUtils.getUrl(token));
+ }
+
}
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-22 01:29:14 UTC (rev 1098)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java 2009-04-22 14:36:46 UTC (rev 1099)
@@ -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;
@@ -52,8 +53,19 @@
private int imgIconsize;
private ArrayList<ToolSimple> userTools;
private ArrayList<ToolSimple> groupTools;
- private String mediaEmbedObject;
+ private String flvEmbedObject;
+
+ private String oggEmbedObject;
+
+ private String mp3EmbedObject;
+
+ private String aviEmbedObject;
+
+ public String getAviEmbedObject() {
+ return aviEmbedObject;
+ }
+
public String getChatDomain() {
return chatDomain;
}
@@ -82,6 +94,10 @@
return defaultWsTheme;
}
+ public String getFlvEmbedObject() {
+ return flvEmbedObject;
+ }
+
public String getGalleryPermittedExtensions() {
return galleryPermittedExtensions;
}
@@ -118,10 +134,14 @@
return maxFileSizeInMb;
}
- public String getMediaEmbedObject() {
- return mediaEmbedObject;
+ public String getMp3EmbedObject() {
+ return mp3EmbedObject;
}
+ public String getOggEmbedObject() {
+ return oggEmbedObject;
+ }
+
public String getSiteDomain() {
return siteDomain;
}
@@ -150,6 +170,10 @@
return wsThemes;
}
+ public void setAviEmbedObject(final String aviEmbedObject) {
+ this.aviEmbedObject = aviEmbedObject;
+ }
+
public void setChatDomain(final String chatDomain) {
this.chatDomain = chatDomain;
}
@@ -178,6 +202,10 @@
this.defaultWsTheme = defaultWsTheme;
}
+ public void setFlvEmbedObject(final String flvEmbedObject) {
+ this.flvEmbedObject = flvEmbedObject;
+ }
+
public void setGalleryPermittedExtensions(final String galleryPermittedExtensions) {
this.galleryPermittedExtensions = galleryPermittedExtensions;
}
@@ -214,10 +242,14 @@
this.maxFileSizeInMb = maxFileSizeInMb;
}
- public void setMediaEmbedObject(final String mediaEmbedObject) {
- this.mediaEmbedObject = mediaEmbedObject;
+ public void setMp3EmbedObject(final String mp3EmbedObject) {
+ this.mp3EmbedObject = mp3EmbedObject;
}
+ public void setOggEmbedObject(final String oggEmbedObject) {
+ this.oggEmbedObject = oggEmbedObject;
+ }
+
public void setSiteDomain(final String siteDomain) {
this.siteDomain = siteDomain;
}
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-22 01:29:14 UTC (rev 1098)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileDownloadManager.java 2009-04-22 14:36:46 UTC (rev 1099)
@@ -29,6 +29,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.errors.ContentNotFoundException;
import org.ourproject.kune.platf.client.ui.download.FileConstants;
@@ -59,6 +61,7 @@
static final String APPLICATION_X_DOWNLOAD = "application/x-download";
private static final long serialVersionUID = 1L;
+ public static final Log log = LogFactory.getLog(FileDownloadManager.class);
@Inject
ContentManager contentManager;
@@ -120,11 +123,16 @@
final File file = new File(absFilename);
resp.setContentLength((int) file.length());
+
+ String contentType;
if (mimeType == null || download) {
- resp.setContentType(APPLICATION_X_DOWNLOAD);
+ contentType = APPLICATION_X_DOWNLOAD;
} else {
- resp.setContentType(mimeType.toString());
+ contentType = mimeType.toString();
}
+ resp.setContentType(contentType);
+ log.info("Content type returned: " + contentType);
+
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-22 01:29:14 UTC (rev 1098)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/properties/KuneProperties.java 2009-04-22 14:36:46 UTC (rev 1099)
@@ -37,7 +37,10 @@
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 FLV_EMBEDED_OBJECT = "kune.media.flvembededobject";
+ String OGG_EMBEDED_OBJECT = "kune.media.oggembededobject";
+ String MP3_EMBEDED_OBJECT = "kune.media.mp3embededobject";
+ String AVI_EMBEDED_OBJECT = "kune.media.aviembededobject";
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-22 01:29:14 UTC (rev 1098)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SiteRPC.java 2009-04-22 14:36:46 UTC (rev 1099)
@@ -103,7 +103,10 @@
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));
+ data.setFlvEmbedObject(kuneProperties.get(KuneProperties.FLV_EMBEDED_OBJECT));
+ data.setMp3EmbedObject(kuneProperties.get(KuneProperties.MP3_EMBEDED_OBJECT));
+ data.setOggEmbedObject(kuneProperties.get(KuneProperties.OGG_EMBEDED_OBJECT));
+ data.setAviEmbedObject(kuneProperties.get(KuneProperties.AVI_EMBEDED_OBJECT));
return mapper.map(data, InitDataDTO.class);
}
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-22 01:29:14 UTC (rev 1098)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java 2009-04-22 14:36:46 UTC (rev 1099)
@@ -88,8 +88,12 @@
} 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.isMp3()) {
+ view.setContent(mediaUtils.get().getMp3Embed(token), false);
+ } else if (mimeType.isOgg()) {
+ view.setContent(mediaUtils.get().getOggEmbed(token), false);
+ } else if (mimeType.isFlv()) {
+ view.setContent(mediaUtils.get().getFlvEmbed(token), false);
} else if (mimeType.isText()) {
view.setContent(contentBody, true);
} else {
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-22 01:29:14 UTC (rev 1098)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertMediaLocalPresenter.java 2009-04-22 14:36:46 UTC (rev 1099)
@@ -30,6 +30,7 @@
@Override
protected String updateMediaInfo() {
- return mediaUtils.get().getEmbed(new StateToken(view.getSrc()));
+ // FIXME (avi, mp3, ...)
+ return mediaUtils.get().getFlvEmbed(new StateToken(view.getSrc()));
}
}
Modified: trunk/src/main/resources/kune.properties
===================================================================
--- trunk/src/main/resources/kune.properties 2009-04-22 01:29:14 UTC (rev 1098)
+++ trunk/src/main/resources/kune.properties 2009-04-22 14:36:46 UTC (rev 1099)
@@ -51,6 +51,10 @@
### 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="400" height="300" 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>
-
+# The code used to play local embeded videos/audios. Change this with other player/code (include a ###DOC_URL### tag)
+kune.media.flvembededobject = <object width="400" height="300" 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_URL###", "autoPlay": false, "autoBuffering": false },"canvas":{"backgroundColor":"#CC6633"},"plugins":{"controls":{"time":true,"volume":false,"fullscreen":true}}}' /> <param name="wmode" value="opaque"> </object>
+kune.media.mp3embededobject = <object width="350" height="24" 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_URL###", "autoPlay": false, "autoBuffering": false },"canvas":{"backgroundColor":"#CC6633"},"plugins":{"audio":{"url":"http://flowplayer.org/swf/flowplayer.audio.swf"},"controls":{"time":true,"volume":true,"fullscreen":false}}}' /> <param name="wmode" value="opaque"> </object>
+kune.media.aviembededobject = <object > </object>
+kune.media.oggembededobject = <applet code="com.fluendo.player.Cortado.class" archive="/kune/others/cortado-ovt-debug-0.2.2.jar" width="352" height="288"> <param name="url" value="###DOC_URL###"/> <param name="local" value="false"/> <param name="duration" value="232"/> <param name="keepAspect" value="true"/> <param name="video" value="true"/> <param name="audio" value="true"/> <param name="bufferSize" value="200"/> <param name="userId" value="user"/> <param name="password" value="test"/> </applet>
+# http://www.flumotion.net/cortado/
+# https://code.fluendo.com/flumotion/trac/browser/cortado/trunk/README
More information about the kune-commits
mailing list