User bio
404 bio not found
Member since Jun 6, 2021
Replies:

Hadn’t used it since Ensemble 2009 ;-), to provide custom html output displayed by the management portal when viewing a message of a class extending Ens.MessageBody, you can override the %GetContentType() and %ShowContents() methods of Ens.Util.MessageBodyMethods in your message class.

Here is a small example :

Class dc.sample.msg.Message Extends Ens.MessageBody
{

Property Name As %String [ InitialExpression = "you" ];

// returns MIME content type
Method %GetContentType() As %String
{
    return "text/html"
}

// output content
Method %ShowContents()
{
    &html<<p>Hello,&nbsp;#(..Name)#</p>>
}


Storage Default
{
<Data name="MessageDefaultData">
<Subscript>"Message"</Subscript>
<Value name="1">
<Value>Name</Value>
</Value>
</Data>
<DefaultData>MessageDefaultData</DefaultData>
<Type>%Storage.Persistent</Type>
}

}

In the management portal message viewer, the message gets displayed as :

Certifications & Credly badges:
Robert has no Certifications & Credly badges yet.
Global Masters badges:
Followers:
Following:
Robert has not followed anybody yet.