Zimlet JavaScript API Reference - ZmMimePart

Class ZmMimePart


Extends ZmModel.

This class represents a mime part. Note that the content of the node is not copied into this object, for performance reasons. It is typically available via the 'bodyParts' list that is populated during node parsing.

Defined in: ZmMimePart.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
ZmMimePart(parent)
Creates a mime part.
Method Summary
Method Attributes Method Name and Description
 
addAlternativePart(node, contentType, index)
Checks within the given node tree for content within a multipart/alternative part that we don't have, and then creates and adds a MIME part for it.
<static>  
ZmMimePart.createFromDom(node, ctxt, parent)
Returns a ZmMimePart constructed from the given JSON object.
 
Returns this part's content.
 
Returns the content disposition.
 
getContentForType(contentType)
Returns content of the given type, in or below this part.
 
Returns the content type.
 
Returns the filename.
 
Returns true if this part should not be considered to be an attachment.
 
setContent(content)
Sets the content, overriding the original content.
 
setContentType(contentType)
Sets the content type, , overriding the original content type.
 
setIsBody(isBody)
Sets the 'is body' flag, overriding the original part's value.
Methods borrowed from class ZmModel:
addChangeListener, removeAllChangeListeners, removeChangeListener
Class Detail
ZmMimePart(parent)
Creates a mime part.
Parameters:
parent
Method Detail
{ZmMimePart} addAlternativePart(node, contentType, index)
Checks within the given node tree for content within a multipart/alternative part that we don't have, and then creates and adds a MIME part for it. Assumes that there will be at most one multipart/alternative.
Parameters:
{object} node
{string} contentType
{int} index
Returns:
{ZmMimePart} the MIME part that was created and added

<static> {ZmMimePart} ZmMimePart.createFromDom(node, ctxt, parent)
Returns a ZmMimePart constructed from the given JSON object. If a context hash is provided with 'attachments' and 'bodyParts' arrays, and a hash 'contentTypes', those will be populated as the node is recursively parsed.
Parameters:
{object} node
JSON representation of MIME part
{hash} ctxt
optional context
parent
Returns:
{ZmMimePart} a MIME part

{string} getContent()
Returns this part's content.
Returns:
{string} content the content

{string} getContentDisposition()
Returns the content disposition.
Returns:
{string} the content disposition

{string} getContentForType(contentType)
Returns content of the given type, in or below this part.
Parameters:
{string} contentType
the content type
Returns:
{string} the content

{string} getContentType()
Returns the content type.
Returns:
{string} the content type

{string} getFilename()
Returns the filename.
Returns:
{string} the filename

{boolean} isIgnoredPart()
Returns true if this part should not be considered to be an attachment.
Returns:
{boolean}

setContent(content)
Sets the content, overriding the original content.
Parameters:
{string} content
the content

setContentType(contentType)
Sets the content type, , overriding the original content type.
Parameters:
{string} contentType
the content type

setIsBody(isBody)
Sets the 'is body' flag, overriding the original part's value.
Parameters:
{boolean} isBody
if true, this part is the body

Documentation generated by JsDoc Toolkit 2.3.0 on Tue Jun 28 2016 21:01:36 GMT-0400 (EDT)