indexing description: "Workitem mail reply message." author: "Peter Wyss " date: "$Date: 2007-07-08 11:41:12 +0200 (Sun, 08 Jul 2007) $" revision: "$Revision: 452 $" class O_WORKITEM_MAIL_REPLY_MESSAGE inherit O_MESSAGE rename make as make_message redefine make_from_generic end O_WORKITEM_CONSTANTS undefine out end create make create {O_MESSAGE_FACTORY} make_from_generic feature {NONE} -- Initialization make (a_subject: like subject; a_body: like body; a_sender: like sender; a_addresses: like addresses) is -- Create. require a_subject_ok: a_subject /= Void a_body_ok: a_body /= Void a_sender_ok: a_sender /= Void a_addresses_ok: a_addresses /= Void do make_message subject := a_subject body := a_body sender := a_sender addresses := a_addresses ensure subject_set: subject = a_subject body_set: body = a_body sender_set: sender = a_sender addresses_set: addresses = a_addresses end make_from_generic (a_msg: O_GENERIC_MESSAGE) is -- Create from a generic message. local l_args: HASH_TABLE [STRING, STRING] i: INTEGER do Precursor (a_msg) l_args := a_msg.arguments subject := l_args.item (subject_argument) body := l_args.item (body_argument) sender := l_args.item (sender_argument) from i := 1 create addresses.make (0) until i > l_args.count - 3 loop addresses.force (l_args.item (address_argument + "_" + i.out)) i := i + 1 end end feature -- Access namespace: STRING is -- Namespace of the message type. once Result := workitem_namespace end type: STRING is -- Type of the message. once Result := workitem_mail_reply_type end subject: STRING -- mail subject body: STRING -- mail body sender: STRING -- mail sender name addresses: ARRAYED_LIST [STRING] -- mail addresses arguments: HASH_TABLE [STRING, STRING] is -- Named arguments. local i: INTEGER do create Result.make (3) Result.force (subject, subject_argument) Result.force (body, body_argument) Result.force (sender, sender_argument) from i := 1 addresses.start until addresses.after loop Result.force (addresses.item, address_argument + "_" + i.out) i := i + 1 addresses.forth end end feature {NONE} -- Implementation subject_argument: STRING is "subject" body_argument: STRING is "body" address_argument: STRING is "address" sender_argument: STRING is "sender" invariant subject_not_void: subject /= Void body_not_void: body /= Void sender_not_void: sender /= Void addresses_not_void: addresses /= Void end