org.wso2.mashup.hostobjects.feed
Class MediaModule

java.lang.Object
  extended by org.mozilla.javascript.ScriptableObject
      extended by org.wso2.mashup.hostobjects.feed.MediaModule
All Implemented Interfaces:
java.io.Serializable, org.mozilla.javascript.ConstProperties, org.mozilla.javascript.debug.DebuggableObject, org.mozilla.javascript.Scriptable

public class MediaModule
extends org.mozilla.javascript.ScriptableObject

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);

See Also:
Serialized Form

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()
          

Copyright information for media object.

 java.lang.String jsGet_description()
           Short description describing the media object typically a sentence in length.
 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()
          

Allows particular images to be used as representative images for the media object.

 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)
          

Copyright information for media object.

 void jsSet_description(java.lang.String desc)
           Short description describing the media object typically a sentence in length.
 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)
          

Allows particular images to be used as representative images for the media object.

 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

MediaModule

public MediaModule()
Method Detail

jsConstructor

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
Parameters:
args - A string reprepsentation of the media object URI is mandatory
Throws:
java.io.IOException

getClassName

public java.lang.String getClassName()
Specified by:
getClassName in interface org.mozilla.javascript.Scriptable
Specified by:
getClassName in class org.mozilla.javascript.ScriptableObject

jsSet_copyright

public void jsSet_copyright(java.lang.String copyRight)

Copyright information for media object.

Parameters:
copyRight - copyright information as a String

jsGet_copyright

public java.lang.Object jsGet_copyright()

Copyright information for media object.

Returns:
copyright information as a String

jsSet_type

public void jsSet_type(java.lang.String type)

type is the standard MIME type of the object. It is an optional attribute.

Parameters:
type - as String

jsGet_type

public java.lang.Object jsGet_type()

type is the standard MIME type of the object. It is an optional attribute.

Returns:
type as String

jsSet_thumbnail

public void jsSet_thumbnail(java.lang.String uri)
                     throws org.wso2.mashup.MashupFault

Allows particular images to be used as representative images for the media object. If multiple thumbnails are included, it is assumed that the images are in order of importance.

Parameters:
uri - as String
Throws:
org.wso2.mashup.MashupFault - if the given URI is malformed

jsGet_thumbnail

public java.lang.String[] jsGet_thumbnail()

Allows particular images to be used as representative images for the media object. If multiple thumbnails are included, it is assumed that the images are in order of importance.

Returns:
a String array of thumbnail URIs

jsSet_fileSize

public void jsSet_fileSize(java.lang.Long fileSize)

fileSize is the number of bytes of the media object.

Parameters:
fileSize - in Bytes

jsGet_fileSize

public java.lang.Long jsGet_fileSize()

fileSize is the number of bytes of the media object.

Returns:
the size of the file in bytes

jsSet_height

public void jsSet_height(java.lang.Integer height)
Parameters:
height - is the height of the media object as an Integer.

jdGet_height

public java.lang.Integer jdGet_height()
Returns:
the height of the media object as an Integer.

jsSet_width

public void jsSet_width(java.lang.Integer width)

width is the width of the media object. It is an optional attribute.


jsGet_width

public java.lang.Integer jsGet_width()

width is the width of the media object. It is an optional attribute.


jsSet_description

public void jsSet_description(java.lang.String desc)
Short description describing the media object typically a sentence in length.

Parameters:
desc - as String

jsGet_description

public java.lang.String jsGet_description()
Short description describing the media object typically a sentence in length.

Returns:
description as String

jsSet_language

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).

Parameters:
lang - as String

jsGet_language

public 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).

Returns:
language as String

jsSet_bitrate

public void jsSet_bitrate(java.lang.Float rate)

bitrate is the kilobits per second rate of media.

Parameters:
rate - as Float

jsGet_bitrate

public java.lang.Float jsGet_bitrate()

bitrate is the kilobits per second rate of media.

Returns:
bitrate as Float

jsSet_framerate

public void jsSet_framerate(java.lang.Float rate)

framerate is the number of frames per second for the media object.

Parameters:
rate - as Float

jsGet_framerate

public java.lang.Float jsGet_framerate()

framerate is the number of frames per second for the media object.

Returns:
framerate as Float

jsSet_samplingrate

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).

Parameters:
rate - as Float

jsGet_samplingrate

public 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).

Returns:
samplingrate as Float

jsSet_channels

public void jsSet_channels(java.lang.Integer channles)

channels is number of audio channels in the media object.

Parameters:
channles - as Integer

jsGet_channels

public java.lang.Integer jsGet_channels()

channels is number of audio channels in the media object.

Returns:
The number of channles as Integer

jsSet_duration

public void jsSet_duration(java.lang.Long duration)

duration is the number of seconds the media object plays.

Parameters:
duration -

jsGet_duration

public java.lang.Long jsGet_duration()

duration is the number of seconds the media object plays.

Returns:
duration as Long