indexing description: "Project request retrieve reply message." author: "Peter Wyss " date: "$Date: 2007-05-12 19:57:51 +0200 (Sat, 12 May 2007) $" revision: "$Revision: 257 $" class O_PROJECT_REQUEST_RETRIEVE_REPLY_MESSAGE inherit O_MESSAGE rename make as make_message redefine make_from_generic end O_PROJECT_CONSTANTS undefine out end create make create {O_MESSAGE_FACTORY} make_from_generic feature {NONE} -- Initialization make (a_request_id: like request_id; a_user_name: like user_name; a_user_email: like user_email; a_name: like name; a_description: like description; a_is_closed_source: like is_closed_source; a_message: like message) is -- Create. require a_request_id_ok: a_request_id > 0 a_user_name_ok: a_user_name /= Void and then not a_user_name.is_empty a_user_email_ok: a_user_email /= Void and then not a_user_email.is_empty a_name_ok: a_name /= Void and then not a_name.is_empty a_description_ok: a_description /= Void a_message_ok: a_message /= Void do make_message request_id := a_request_id user_name := a_user_name user_email := a_user_email name := a_name description := a_description is_closed_source := a_is_closed_source message := a_message ensure request_id_set: request_id = a_request_id user_name_set: user_name = a_user_name user_email_set: user_email = a_user_email name_set: name = a_name description_set: description = a_description is_closed_source_set: is_closed_source = a_is_closed_source message_set: message = a_message end make_from_generic (a_msg: O_GENERIC_MESSAGE) is -- Create from a generic message. local l_args: HASH_TABLE [STRING, STRING] do Precursor (a_msg) l_args := a_msg.arguments request_id := l_args.item (request_id_argument).to_integer user_name := l_args.item (user_name_argument) user_email := l_args.item (user_email_argument) name := l_args.item (name_argument) description := l_args.item (description_argument) is_closed_source := l_args.item (is_closed_source_argument).to_boolean message := l_args.item (message_argument) end feature -- Access namespace: STRING is -- Namespace of the message type. once Result := project_namespace end type: STRING is -- Type of the message. once Result := project_request_retrieve_reply_type end request_id: INTEGER --Request Id user_name: STRING --User name user_email: STRING --User e-mail name: STRING -- Project name description: STRING -- Description is_closed_source: BOOLEAN -- is closed source? message: STRING -- Message to origo team arguments: HASH_TABLE [STRING, STRING] is -- Named arguments. do create Result.make (7) Result.force (request_id.out, request_id_argument) Result.force (user_name, user_name_argument) Result.force (user_email, user_email_argument) Result.force (name, name_argument) Result.force (description, description_argument) Result.force (is_closed_source.out, is_closed_source_argument) Result.force (message, message_argument) end feature {NONE} -- Implementation request_id_argument: STRING is "request_id" user_name_argument: STRING is "user_name" user_email_argument: STRING is "user_email" name_argument: STRING is "name" description_argument: STRING is "description" is_closed_source_argument: STRING is "is_closed_source" message_argument: STRING is "message" invariant request_id_ok: request_id > 0 user_name_ok: user_name /= Void and then not user_name.is_empty user_email_ok: user_email /= Void and then not user_email.is_empty name_ok: name /= Void and then not name.is_empty description_ok: description /= Void message_ok: message /= Void end