indexing description: "Issue retrieve reply message." author: "Peter Wyss " date: "$Date: 2007-05-12 19:57:51 +0200 (Sat, 12 May 2007) $" revision: "$Revision: 257 $" class O_ISSUE_RETRIEVE_REPLY_MESSAGE inherit O_MESSAGE rename make as make_message redefine make_from_generic end O_ISSUE_CONSTANTS undefine out end create make create {O_MESSAGE_FACTORY} make_from_generic feature {NONE} -- Initialization make (a_creation_time: like creation_time; a_last_modified: like last_modified; a_user: like user; a_title: like title; a_tags: like tags; a_is_private: like is_private; a_revisions: like revisions) is -- Create. -- FIXME Include 'is_private' flag in the response require a_creation_time_ok: a_creation_time > 0 a_last_modified_ok: a_last_modified > -1 a_user_ok: a_user /= Void and then not a_user.is_empty a_title_ok: a_title /= Void and then not a_title.is_empty a_tags_ok: a_tags /= Void and then not a_tags.is_empty a_revisions_ok: a_revisions /= Void and then not a_revisions.is_empty do make_message creation_time := a_creation_time last_modified := a_last_modified user := a_user title := a_title tags := a_tags is_private := a_is_private revisions := a_revisions ensure creation_time_set: creation_time = a_creation_time last_modified_set: last_modified = a_last_modified user_set: user = a_user title_set: title = a_title tags_set: tags = a_tags is_private_set: is_private = a_is_private revisions_set: revisions = a_revisions 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 creation_time := l_args.item (creation_time_argument).to_integer last_modified := l_args.item (last_modified_argument).to_integer user := l_args.item (user_argument) title := l_args.item (title_argument) tags := l_args.item (tags_argument) revisions ?= deserialize (l_args.item (revisions_argument)) is_private := l_args.item (is_private_argument).to_boolean end feature -- Access namespace: STRING is -- Namespace of the message type. once Result := issue_namespace end type: STRING is -- Type of the message. once Result := issue_retrieve_reply_type end creation_time: INTEGER -- creation time last_modified: INTEGER -- timestamp of the latest modification user: STRING -- user who created the issue title: STRING -- Title of the issue tags: STRING -- Tags of the issue revisions: ARRAYED_LIST [TUPLE [creation_time: INTEGER; user: STRING; text: STRING; tags: STRING]] -- List of revisions with [creation_time, text, tags] is_private: BOOLEAN -- true if the issue can only be viewed by by project members arguments: HASH_TABLE [STRING, STRING] is -- Named arguments. do create Result.make (5) Result.force (creation_time.out, creation_time_argument) Result.force (last_modified.out, last_modified_argument) Result.force (user, user_argument) Result.force (title, title_argument) Result.force (tags, tags_argument) Result.force (serialize(revisions), revisions_argument) Result.force (is_private.out, is_private_argument) end feature {NONE} -- Implementation creation_time_argument: STRING is "creation_time" last_modified_argument: STRING is "last_modified" user_argument: STRING is "user" title_argument: STRING is "title" tags_argument: STRING is "tags" revisions_argument: STRING is "revisions" is_private_argument: STRING is "is_private" invariant user_ok: user /= Void and then not user.is_empty title_ok: title /= Void and then not title.is_empty end