NotesMIMEEntity (JavaScript™)
Represents an item of type MIME (Multipurpose Internet Mail Extensions).
Access
To access the MIME content of a NotesDocument object:- First call NotesSession.setConvertMIME(false) to override normal conversion of MIME items to rich text. This is not needed to simply get or set content.
- Then call NotesDocument.getMIMEEntity.
- Or call NotesDocument.getFirstItem followed by NotesItem.getMIMEEntity.
- To create an item in MIME format, call NotesDocument.createMIMEEntity.
- Before exiting your code, call NotesSession.setConvertMIME(true) to restore the original setting if necessary.
Usage
A valid NotesMIMEEntity object becomes invalid if any of the following methods are applied to the containing NotesDocument object: computeWithForm, encrypt, save, send, sign, or closeMIMEEntities.Avoid processing items as both NotesItem and NotesMIMEEntity objects concurrently. Once you start using NotesMIMEEntity properties and methods, do not use other methods that access items in the same document until you terminate MIME processing with computeWithForm, encrypt, save, send, sign, or closeMIMEEntities.
An
item named $NoteHasNativeMIME
with a value of 1
indicates
that the document contains a MIME entity. An item of type MIME
part
contains the body of the MIME entity; in mail messages
this is typically the item named Body
. For a multipart
MIME entity, the document has multiple MIME part
items,
one for each parent and child entity. The MIME part
item
contains headers such as Content-Type
and Content-Transfer-Encoding
,
the preamble (parent entities), and body content (child and stand-alone
entities). In a mail message, items with certain names correspond
to MIME headers, for example, Subject
(Subject
header), SendTo
(To
header),
and Received
(Received
header).
The NotesMIMEEntity and NotesMIMEHeader classes collect and organize the MIME information from a document. One NotesMIMEEntity object represents a document containing a MIME entity that is not multipart. Multiple NotesMIMEEntity objects represent a document containing a MIME entity that is multipart. A multipart MIME entity consists of multiple parent and child entities. A child entity can also be a parent.
On an XPage, a rich text control is of type com.ibm.xsp.http.MimeMultipart
.
Its getHTML
method gets the content of the rich-text
control as XML. You can use this XML in setContentFromText to
initialize a new NotesMIMEEntity
object.
On an XPage, you can use getContentAsText to set the value of a rich text control.
A rich text control set
from getContentAsText is
not immediately accessible as a com.ibm.xsp.http.MimeMultipart
object
and programmatic access returns null. The user must first make an
edit in the control.