Object <- MailFormatter |
|
|
AdditionalParts Destination FormToFormat Preflighting TelecardToFormat |
| Field | Type | |
|---|---|---|
| MailFormatter: | telecardToFormat: | Telecard |
| formToFormat: | Form | |
| destination: | MailHandler | |
| additionalParts: | ObjectList | |
| partEncoders: | ObjectList | |
| preflighting: | Boolean |
Define Class MailFormatter; inherits from Object; abstract; field telecardToFormat: Telecard, getter, weak; // message that this formatter is working on field formToFormat: Form, getter; // a copy of the prototype form, containing all the form data, but not // installed on the telecard field destination: MailHandler, getter, weak; // transfer ticket which this formatter will use to pass // parts of the message to the mail service. field additionalParts: ObjectList, getter; // all the objects that are going to be formatted as individual parts. // used as the outList by the flattener. field partEncoders: ObjectList; // the PartEncoders to be used to format each item in additionalParts field preflighting: Boolean, getter, setter; // the mail formatter is currently preflighting the message. // public interface attribute AdditionalParts: ObjectList, readOnly; attribute TelecardToFormat: Telecard, readOnly; attribute FormToFormat: Form, readOnly; attribute Destination: MailHandler, readOnly; attribute Preflighting: Boolean; operation PreflightMessage(telecard: Telecard; destination: MailHandler); // called by the post office to let the MailHandler look over the message before // it is sent. operation FormatMessage(telecard: Telecard; destination: MailHandler); // called by the post office to format and send a message using a specific transfer // ticket. operation RegisterPartForFormatting(part: Object; partEncoder: PartEncoder): Unsigned; // call to add some object to be encoded later // returns the index of the item in the additionalParts list // Methods that may be overriden by subclasses operation StartMessageFormatting(); // called from FormatMessage before any other formatting operations are called. // override to do any setup that is needed before formatting. Call the inherited // method before doing anything else. operation FormatMessageDetails(); // called from FormatMessage to emit details about the message that are not // strictly part of the message contents such as the subject line and recipients. // default method calls the next eight operations in the order listed. // override to do any addition handling of message details. To modify the handling // of specific details override one or more of the operations below. operation FormatOriginators(); // collects the originators and passes them to HandleOriginators. operation FormatToRecipients(); // collects the To: recipients for the service specificed by the destination in a list // and passes it to HandleToRecipients. operation FormatCCRecipients(); // collects the CC: recipients for the service specificed by the destination in a list // and passes it to HandleToRecipients. operation FormatBCCRecipients(); // collects the BCC: recipients for the service specificed by the destination in a list // and passes it to HandleToRecipients(). operation FormatReplyToAddresses(); // collects the reply to addresses a list and passes it to HandleToRecipients(). operation FormatSubject(); // passes the value of the Subject attribute of the Telecard to HandleSubject() if // that value is not empty. operation FormatInReplyTo(); // passes the value of the InReplyTo attribute of the Telecard to HandleSubject() if // that value is not empty. operation FormatFormIdentifier(); // passes a text identifier of the form of the telecard to the mail handler. Default // implementation does nothing. operation FormatMessageIdentifier(); // passes the message ID to the mail handler. operation FormatMailElement(mailElement: Viewable), noMethod; // called from FormatMessage for each viewable that is on the Telecard // and needs to be sent. Default method does nothing. // Override to include the viewable and/or its data in some way. operation DoneWithMailElements(); // called after the last mailElement has been passed to FormatMailElement(). Default // method does nothing. Override to call RegisterPartForFormatting() with // any parts which represent data from more than one mailElement. operation FormatPart(part: Object; partEncoder: PartEncoder; uniqueID: Text), noMethod; // called for each part that was passed to RegisterPartForFormatting. operation DoneWithParts(); // called after the last part has been passed to FormatPart(). Default // method does nothing. Override to do any sort of final processing or cleanup // after all parts have been processed.. operation FinishMessageFormatting(); // called from FormatMessage after all other formatting operations are called. // override to do any cleanup that is needed after formatting. Call the inherited // method after everything else. end class;