java.lang.Objectorg.mozilla.javascript.ScriptableObject
org.wso2.mashup.hostobjects.feed.MediaModule
public class MediaModule
This module allows the addition of Media Content to an Entry ex:
//Creating a Feed
var mashupFeed = new Feed();
mashupFeed.feedType = "rss_2.0";
mashupFeed.title = "EarthShots.org";
mashupFeed.description = "Photos from EarthShots.org";
mashupFeed.link = "http://www.earthshots.org";
//Creating an Entry for the Feed
var newEntry = new Entry();
newEntry.title = "Capitol Peak Evening by Tad Bowman";
newEntry.link = "http://www.earthshots.org/2007/10/capitol-peak-evening-by-tad-bowman/";
newEntry.description = "<a href="http://www.earthshots.org/2007/10/capitol-peak-evening-by-tad-bowman/"><img src="http://www.earthshots.org/photos/387.thumb.jpg" alt="Capitol Peak Evening by Tad Bowman" /></a>";
//Creating a Media module to be added to the Entry
var mediaModule = new MediaModule("http://www.earthshots.org/photos/387.jpg");
mediaModule.copyright = "2007 Tad Bowman";
mediaModule.type = "image/jpeg";
mediaModule.thumbnail = "http://www.earthshots.org/photos/387.thumb.jpg";
//Adding the Media Module to the Entry
newEntry.addMediaModule(mediaModule);
//Adding the Entry to the Feed
mashupFeed.insertEntry(newEntry);
| Field Summary |
|---|
| Fields inherited from class org.mozilla.javascript.ScriptableObject |
|---|
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST |
| Fields inherited from interface org.mozilla.javascript.Scriptable |
|---|
NOT_FOUND |
| Constructor Summary | |
|---|---|
MediaModule()
|
|
| Method Summary | |
|---|---|
java.lang.String |
getClassName()
|
java.lang.Integer |
jdGet_height()
|
static org.mozilla.javascript.Scriptable |
jsConstructor(org.mozilla.javascript.Context cx,
java.lang.Object[] args,
org.mozilla.javascript.Function ctorObj,
boolean inNewExpr)
|
java.lang.Float |
jsGet_bitrate()
bitrate is the kilobits per second rate of media. |
java.lang.Integer |
jsGet_channels()
channels is number of audio channels in the media object. |
java.lang.Object |
jsGet_copyright()
|
java.lang.String |
jsGet_description()
|
java.lang.Long |
jsGet_duration()
duration is the number of seconds the media object plays. |
java.lang.Long |
jsGet_fileSize()
fileSize is the number of bytes of the media object. |
java.lang.Float |
jsGet_framerate()
framerate is the number of frames per second for the media object. |
java.lang.String |
jsGet_language()
lang is the primary language encapsulated in the media object. |
java.lang.Float |
jsGet_samplingrate()
samplingrate is the number of samples per second taken to create the media object. |
java.lang.String[] |
jsGet_thumbnail()
|
java.lang.Object |
jsGet_type()
type is the standard MIME type of the object. |
java.lang.Integer |
jsGet_width()
width is the width of the media object. |
void |
jsSet_bitrate(java.lang.Float rate)
bitrate is the kilobits per second rate of media. |
void |
jsSet_channels(java.lang.Integer channles)
channels is number of audio channels in the media object. |
void |
jsSet_copyright(java.lang.String copyRight)
|
void |
jsSet_description(java.lang.String desc)
|
void |
jsSet_duration(java.lang.Long duration)
duration is the number of seconds the media object plays. |
void |
jsSet_fileSize(java.lang.Long fileSize)
fileSize is the number of bytes of the media object. |
void |
jsSet_framerate(java.lang.Float rate)
framerate is the number of frames per second for the media object. |
void |
jsSet_height(java.lang.Integer height)
|
void |
jsSet_language(java.lang.String lang)
lang is the primary language encapsulated in the media object. |
void |
jsSet_samplingrate(java.lang.Float rate)
samplingrate is the number of samples per second taken to create the media object. |
void |
jsSet_thumbnail(java.lang.String uri)
|
void |
jsSet_type(java.lang.String type)
type is the standard MIME type of the object. |
void |
jsSet_width(java.lang.Integer width)
width is the width of the media object. |
| Methods inherited from class org.mozilla.javascript.ScriptableObject |
|---|
associateValue, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, get, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, has, hasInstance, hasProperty, hasProperty, isConst, isSealed, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MediaModule()
| Method Detail |
|---|
public static org.mozilla.javascript.Scriptable jsConstructor(org.mozilla.javascript.Context cx,
java.lang.Object[] args,
org.mozilla.javascript.Function ctorObj,
boolean inNewExpr)
throws java.io.IOException
args - A string reprepsentation of the media object URI is mandatory
java.io.IOExceptionpublic java.lang.String getClassName()
getClassName in interface org.mozilla.javascript.ScriptablegetClassName in class org.mozilla.javascript.ScriptableObjectpublic void jsSet_copyright(java.lang.String copyRight)
copyRight - copyright information as a Stringpublic java.lang.Object jsGet_copyright()
public void jsSet_type(java.lang.String type)
type is the standard MIME type of the object. It is an optional attribute.
type - as Stringpublic java.lang.Object jsGet_type()
type is the standard MIME type of the object. It is an optional attribute.
public void jsSet_thumbnail(java.lang.String uri)
throws org.wso2.mashup.MashupFault
uri - as String
org.wso2.mashup.MashupFault - if the given URI is malformedpublic java.lang.String[] jsGet_thumbnail()
public void jsSet_fileSize(java.lang.Long fileSize)
fileSize is the number of bytes of the media object.
fileSize - in Bytespublic java.lang.Long jsGet_fileSize()
fileSize is the number of bytes of the media object.
public void jsSet_height(java.lang.Integer height)
height - is the height of the media object as an Integer.public java.lang.Integer jdGet_height()
public void jsSet_width(java.lang.Integer width)
width is the width of the media object. It is an optional attribute.
public java.lang.Integer jsGet_width()
width is the width of the media object. It is an optional attribute.
public void jsSet_description(java.lang.String desc)
desc - as Stringpublic java.lang.String jsGet_description()
public void jsSet_language(java.lang.String lang)
lang is the primary language encapsulated in the media object. Language codes possible are detailed in RFC 3066. This attribute is used similar to the xml:lang attribute detailed in the XML 1.0 Specification (Third Edition).
lang - as Stringpublic java.lang.String jsGet_language()
lang is the primary language encapsulated in the media object. Language codes possible are detailed in RFC 3066. This attribute is used similar to the xml:lang attribute detailed in the XML 1.0 Specification (Third Edition).
public void jsSet_bitrate(java.lang.Float rate)
bitrate is the kilobits per second rate of media.
rate - as Floatpublic java.lang.Float jsGet_bitrate()
bitrate is the kilobits per second rate of media.
public void jsSet_framerate(java.lang.Float rate)
framerate is the number of frames per second for the media object.
rate - as Floatpublic java.lang.Float jsGet_framerate()
framerate is the number of frames per second for the media object.
public void jsSet_samplingrate(java.lang.Float rate)
samplingrate is the number of samples per second taken to create the media object. It is expressed in thousands of samples per second (kHz).
rate - as Floatpublic java.lang.Float jsGet_samplingrate()
samplingrate is the number of samples per second taken to create the media object. It is expressed in thousands of samples per second (kHz).
public void jsSet_channels(java.lang.Integer channles)
channels is number of audio channels in the media object.
channles - as Integerpublic java.lang.Integer jsGet_channels()
channels is number of audio channels in the media object.
public void jsSet_duration(java.lang.Long duration)
duration is the number of seconds the media object plays.
duration - public java.lang.Long jsGet_duration()
duration is the number of seconds the media object plays.