com.objectxp.mms.message
Class SMILMessage

java.lang.Object
  extended by com.objectxp.mms.message.MMSMessage
      extended by com.objectxp.mms.message.SMILMessage
All Implemented Interfaces:
java.io.Serializable

public class SMILMessage
extends MMSMessage
implements java.io.Serializable

The SMILMessage is a MMSMessage extended by a SMIL document to organise the presentation.
(SMIL = Synchronized Multimedia Integration Language) The concept of the SMILMessage means the ordering, layout, sequencing and timing of MMSMessagePart on the terminal screen and other devices such as a speaker. With SMILMessage, she sender of the MMS has the possibility to organise the multimedia content to a meaningful order and to instruct how the MMSMessagePart are rendered at the receiving terminal.

The MMSMessagePart of the SMILMessage must be referenced by the SMIL document, otherwise they might be ignored at the target terminal.

Since the smil-document refers to the messageParts, the MMS is called SMILMessage.

Example:
Assuming in your "/tmp" directory you've got a smil document called "smil.xml" which looks like this:

   <smil>
     <head>
       <layout><root-layout width="160" height="140"/></layout>
     </head>
     <body>
       <par dur="5s">
         <text src="blabla.txt"/>
       </par>
       <par dur="5s">
         <img src="picture.jpg"/>
       </par>
     </body>
   </smil>
 

You may now instantiate the MMSMessage related with this document:

    // jSMS will load the refered "blabla.txt" and "picture.jpg" files which must 
    // also be located in the same directory
    MMSMessage msg = new SMILMessage(new File("/tmp/smil.xml").toURL());
    // add destination (must be set do send a MMSMessage)
    msg.addTO(new MMSAddress(MMSAddress.ADDRESS_TYPE_MSISDN, "0785555555"));
    // ready to send the MMSMessage using the MMSService.
    mmsService.send(msg);
 

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.objectxp.mms.message.MMSMessage
CLASS_ADVERTISEMENT, CLASS_AUTO, CLASS_INFORMATIONAL, CLASS_PERSONAL, CONTENT_TYPE_MIXED, CONTENT_TYPE_RELATED, PRIORITY_HIGH, PRIORITY_LOW, PRIORITY_NORMAL, VERSION_1_0, VERSION_1_1, VERSION_1_2, VERSION_1_3
 
Constructor Summary
SMILMessage(SmilDocument doc)
          Creates a SMILMessage out of a SmilDocument.
SMILMessage(java.lang.String smil)
          Construct a SMIL message.
SMILMessage(java.net.URL path)
          Loads a SMIL document form the given URL.
 
Method Summary
 void export(java.lang.String directory)
          Writes the content of the SMILMessage to the given directory.
 java.lang.String getContentType()
          Returns the MessageContentType of the Message (also known as PDU type ).
 java.lang.String getSmilAsString()
          Get the SMIL document in a StringRepresentation.
 java.lang.String toString()
           
 
Methods inherited from class com.objectxp.mms.message.MMSMessage
addBCC, addCC, addMessagePart, addTO, containsHeader, getAdaptationAllowed, getApplicationId, getAuxApplicationInfo, getBCC, getCC, getContentClass, getDeliveryDate, getDeliveryReport, getDRMContent, getExpiryDate, getFrom, getHeader, getHeaderNames, getMessageClass, getMessageId, getMessageParts, getPriority, getReadReport, getReplyApplicationId, getReplyCharging, getReplyChargingDeadLine, getReplyChargingId, getReplyChargingSize, getSubject, getSubmissionDate, getTO, getTransactionId, getVersion, isSenderVisible, parseMMSEncoding, parseMMSEncoding, removeBCC, removeCC, removeTO, setAdaptationAllowed, setApplicationId, setAuxApplicationInfo, setContentClass, setContentType, setDeliveryDate, setDeliveryReport, setDRMContent, setExpiryDate, setFrom, setHeader, setMessageClass, setMessageId, setPriority, setReadReport, setReplyApplicationId, setReplyCharging, setReplyChargingDeadLine, setReplyChargingId, setReplyChargingSize, setSenderVisibility, setSubject, setSubmissionDate, setTransactionId, setVersion
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SMILMessage

public SMILMessage(SmilDocument doc)
Creates a SMILMessage out of a SmilDocument. The multimedia objects which are referenced by the SMIL-document are stored internally as MMSMessagePart.


SMILMessage

public SMILMessage(java.net.URL path)
            throws java.io.IOException
Loads a SMIL document form the given URL.

The multimedia objects which are referenced by the SMIL-document are loaded and stored internally as MMSMessagePart.

Note: only relative referenced media parts are supported!

Parameters:
path - location of smil document
Throws:
java.io.IOException - if jSMS fails to load smil documment or refered parts
java.lang.IllegalArgumentException - if given path is not valid

SMILMessage

public SMILMessage(java.lang.String smil)
Construct a SMIL message. The multimedia elements referenced by the SMIL document must be added by calling the addElement method for each multimedia element.

Parameters:
smil - a String holding the SMIL (XML) document.
Since:
jSMS 2.2
Method Detail

export

public void export(java.lang.String directory)
            throws java.io.IOException
Writes the content of the SMILMessage to the given directory.
The messageParts are stored according to they're location-name. If the location is not set, they will be numbered.
The smil document is always called 'smil.xml'

Overrides:
export in class MMSMessage
Parameters:
directory - the directory where the message-parts are stored. If this directory does not exist, it will be created.
Throws:
java.io.IOException - if an I/O error occurs.

getSmilAsString

public java.lang.String getSmilAsString()
Get the SMIL document in a StringRepresentation.

Returns:
the SMIL document as String

getContentType

public java.lang.String getContentType()
Returns the MessageContentType of the Message (also known as PDU type ). The MessageContentType of the SMILMessage is 'application/vnd.wap.multipart.related', appended by additional parameters.

Overrides:
getContentType in class MMSMessage
Returns:
contentType of the message

toString

public java.lang.String toString()
Overrides:
toString in class MMSMessage


object XP, Inc. © 2000-2008. All rights reserved object XP