getParentEntity (NotesMIMEEntity - JavaScript™)
Returns the parent MIME entity of the current MIME entity within a multipart entity.
Defined in
NotesMIMEEntitySyntax
getParentEntity() : NotesMIMEEntity
Return value | Description |
---|---|
NotesMIMEEntity | The parent MIME entity, or null. |
Examples
This button displays the content of the current document if it is in MIME format.// Do not automatically convert MIME to rich text
session.setConvertMIME(false);
var mime:NotesMIMEEntity = currentDocument.getDocument().getMIMEEntity();
if (mime != null) {
// If multipart MIME entity
if (mime.getContentType().equals("multipart")) {
// Print preamble
if (!mime.getPreamble().equals("")) {
requestScope.status = "Preamble:\t" + mime.getPreamble() + "\n";
}
// Print content of each child entity
var child1:NotesMIMEEntity = mime.getFirstChildEntity();
while (child1 != null) {
requestScope.status +=
child1.getBoundaryStart() + child1.getContentAsText() +
child1.getBoundaryEnd() + "\n";
var child2:NotesMIMEEntity = child1.getFirstChildEntity();
if (child2 == null) {
child2 = child1.getNextSibling();
if (child2 == null) {
child2 = child1.getParentEntity();
if (child2 != null) {
child2 = child2.getNextSibling();
}
}
}
child1 = child2;
}
}
// If not multipart, just print content
else {
requestScope.status = mime.getContentAsText();
}
} else {
requestScope.status = "Not MIME";
}
// Restore conversion
session.setConvertMIME(true);