mn8 Language Reference | Index    

Emx

SUMMARY: ATTRIBUTES SUMMARY  ELEMENTS SUMMARY  CONSTRUCTORS SUMMARY  NO OPERATORS  METHODS SUMMARYDETAIL: ATTRIBUTE DETAILS  ELEMENT DETAILS  CONSTRUCTOR DETAILS  NO OPERATORS  METHOD DETAILS

Description

This concept converts the RFC822 email string to XML.

Every field will have a RFC822 namespace and the field name,the RFC822 standard fields will have a standard field name, any field starting with "x-" will be put in one of the extension-field element and any other element will be put in the user-defined-element.

The part element will holds the mail content headers and the BodyPart element, where will be placed the content body.

Usage

This example will show how you can create an EMX concept, and print the result to XML string.

    #the $s variable holds a normal RFC822 email string
    $mail = Emx.create( $s )

    #the $mail is now a mail concept with elements and attributes
    #it is prints the mail in XML
    print $mail.toXML

    #if you want to print your original mail (the source)
    print $mail.toTXT

Version: 0.1
Authors:Antal Attila ()
Location:
Inherits: Concept

Attribute List

 @content TYPEOF String LABEL "emx:content"
 @lang TYPEOF String LABEL "xml:lang"
 @xmlns1 TYPEOF Nil LABEL "xmlns:emx"
 @xmlns2 TYPEOF Nil LABEL "xmlns:rfc822"
top

Element List

 msg! TYPEOF String LABEL "msg"
 header! TYPEOF Map LABEL "header"
 msgSource! TYPEOF String LABEL "msgSource"
 rpath TYPEOF Element LABEL "rfc822:return-path"
 _from TYPEOF Element LABEL "rfc822:from"
 sender TYPEOF Element LABEL "rfc822:sender"
 rfrom TYPEOF Element LABEL "rfc822:resent-from"
 rsender TYPEOF Element LABEL "rfc822:resent-sender"
 _to TYPEOF Element LABEL "rfc822:to"
 cc TYPEOF Element LABEL "rfc822:cc"
 bcc TYPEOF Element LABEL "rfc822:bcc"
 rpto TYPEOF Element LABEL "rfc822:reply-to"
 rsto TYPEOF Element LABEL "rfc822:resent-to"
 rscc TYPEOF Element LABEL "rfc822:resent-cc"
 rsbcc TYPEOF Element LABEL "rfc822:resent-bcc"
 rsrpto TYPEOF Element LABEL "rfc822:resent-reply-to"
 keyw TYPEOF Element LABEL "rfc822:keywords"
 subj TYPEOF Element LABEL "rfc822:subject"
 comm TYPEOF Element LABEL "rfc822:comments"
 recev* TYPEOF Element LABEL "rfc822:received"
 date TYPEOF Element LABEL "rfc822:date"
 rdate TYPEOF Element LABEL "rfc822:resent-date"
 msgid TYPEOF Element LABEL "rfc822:message-id"
 rmsgid TYPEOF Element LABEL "rfc822:resent-message-id"
 inrto TYPEOF Element LABEL "rfc822:in-reply-to"
 ref TYPEOF Element LABEL "rfc822:references"
 encr TYPEOF Element LABEL "rfc822:encrypted"
 ext* TYPEOF Emx:ext LABEL "rfc:822:extension-field"
 udef* TYPEOF Emx:udef LABEL "rfc:822:user-defined-field"
 content TYPEOF Emx:part LABEL "emx:part"
top

Constructor List

create (String $msg)
top

Method List

Emx:partaddPart
Emx:adressextractAddress (String $s)
extractExtended
Emx:groupextractGroup (String $key)
extractReceived
extractUserDefined
StringextractValue (String $key)
Emx:adressextractWholeAddress (String $key)
formatHeader
SeriesgetBounds (String $s)
StringtoTXT
top
Methods inherited from: Concept
cloneConcept, extendsConcept, fromXML, getAllInheritedConcepts, getConceptAttribute, getConceptAttributeField, getConceptAttributeFields, getConceptAttributes, getConceptConstructors, getConceptElement, getConceptElementField, getConceptElementFields, getConceptElements, getConceptLabel, getConceptMethod, getConceptMethods, getConceptOperators, getConceptType, getErrorHandler, getInheritedConcepts, getResourceURI, hasConceptAttribute, hasConceptElement, hasConceptMethod, hasPath, isHidden, loadContent, setConceptLabel, setErrorHandler, setHidden, setShowEmpty, showEmpty, toTXT, toXML, setResourceURI

Detailed Attribute Info

@content

Label:emx:content
Type:String
Is Static:false
Is Hidden:false
Show Empty:false

Mail content attribute, can placed here an URL which will points to your mail content

top

@lang

Label:xml:lang
Type:String
Is Static:false
Is Hidden:false
Show Empty:false

Mail language

top

@xmlns1

Label:xmlns:emx
Type:Nil
Is Static:false
Is Hidden:false
Show Empty:false

XML namespace for this concept

top

@xmlns2

Label:xmlns:rfc822
Type:Nil
Is Static:false
Is Hidden:false
Show Empty:false

XML namespace for RFC822

top

Detailed Element Info

msg

Label:msg
Type:String
Is Static:false
Is Hidden:true
Is Multi:false
Show Empty:true

Hidden element to holds the message content

top

header

Label:header
Type:Map
Is Static:false
Is Hidden:true
Is Multi:false
Show Empty:true

Hidden element to holds the message header

top

msgSource

Label:msgSource
Type:String
Is Static:false
Is Hidden:true
Is Multi:false
Show Empty:true

Hidden element to holds the message source

top

rpath

Label:rfc822:return-path
Type:Element
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

Redturn-Path:

top

_from

Label:rfc822:from
Type:Element
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

From:

top

sender

Label:rfc822:sender
Type:Element
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

Sender:

top

rfrom

Label:rfc822:resent-from
Type:Element
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

Resent-From:

top

rsender

Label:rfc822:resent-sender
Type:Element
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

Resent-Sender:

top

_to

Label:rfc822:to
Type:Element
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

To:

top

cc

Label:rfc822:cc
Type:Element
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

CC:

top

bcc

Label:rfc822:bcc
Type:Element
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

Bcc:

top

rpto

Label:rfc822:reply-to
Type:Element
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

Reply-To:

top

rsto

Label:rfc822:resent-to
Type:Element
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

Resent-to:

top

rscc

Label:rfc822:resent-cc
Type:Element
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

Resent-Cc:

top

rsbcc

Label:rfc822:resent-bcc
Type:Element
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

Resent-Bcc:

top

rsrpto

Label:rfc822:resent-reply-to
Type:Element
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

Resent-Reply-To:

top

keyw

Label:rfc822:keywords
Type:Element
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

Keywords:

top

subj

Label:rfc822:subject
Type:Element
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

Subject:

top

comm

Label:rfc822:comments
Type:Element
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

Comments:

top

recev

Label:rfc822:received
Type:Element
Is Static:false
Is Hidden:false
Is Multi:true
Show Empty:true

Received:

top

date

Label:rfc822:date
Type:Element
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

Date:

top

rdate

Label:rfc822:resent-date
Type:Element
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

Resent-Date:

top

msgid

Label:rfc822:message-id
Type:Element
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

Message-Id:

top

rmsgid

Label:rfc822:resent-message-id
Type:Element
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

Resent-Message-Id:

top

inrto

Label:rfc822:in-reply-to
Type:Element
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

In-Reply-To:

top

ref

Label:rfc822:references
Type:Element
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

References:

top

encr

Label:rfc822:encrypted
Type:Element
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

Encrypted:

top

ext

Label:rfc:822:extension-field
Type:Emx:ext
Is Static:false
Is Hidden:false
Is Multi:true
Show Empty:true

Extension field for all fields starting with "x-"

top

udef

Label:rfc:822:user-defined-field
Type:Emx:udef
Is Static:false
Is Hidden:false
Is Multi:true
Show Empty:true

Any other unlisted fields

top

content

Label:emx:part
Type:Emx:part
Is Static:false
Is Hidden:false
Is Multi:false
Show Empty:false

The message content

top

Detailed Constructor Info

create (String $msg)
Parameters:
$msg :The message source string

Creating this concept, and constructs all elements

top

Detailed Method Info

addPart
Returns: Emx:part

Recursive function to extract message content from boundary nodes and put it into the part element.

top
extractAddress (String $s)
Parameters:
$s :Field value
Returns: Emx:adress

Extracts adress(es) from field value

top
extractExtended
Returns:

Extracts the extended-fields

top
extractGroup (String $key)
Parameters:
$key :Field name
Returns: Emx:group

Extracts user group from a named field

top
extractReceived
Returns:

Extracts the received fields

top
extractUserDefined
Returns:

Extracts the user defined fields

top
extractValue (String $key)
Parameters:
$key :Field name
Returns: String

Extracts a simple value from a named field

top
extractWholeAddress (String $key)
Parameters:
$key :Field name
Returns: Emx:adress

Extracts a complete adress from a named field

top
formatHeader
Returns:

Prepare the messager header, extracts the field name and value pairs

top
getBounds (String $s)
Parameters:
$s :Message content bound
Returns: Series

Extract a named bouds from a multipart message

top
toTXT
Returns: String

Returns the original mail source as string

top