indexing description: "Issue comment message." author: "Peter Wyss " date: "$Date: 2007-07-11 00:58:41 +0200 (Wed, 11 Jul 2007) $" revision: "$Revision: 478 $" class O_ISSUE_COMMENT_MESSAGE inherit O_SESSION_MESSAGE rename make as make_session redefine make_from_generic, arguments end O_ISSUE_CONSTANTS undefine out end create make, make_extended create {O_MESSAGE_FACTORY} make_from_generic feature {NONE} -- Initialization make (a_session: like session; a_project: like project; a_project_issue_id: like project_issue_id; a_description: like description; a_is_internal: like is_internal) is -- Creates an issue reply which doesn't change the tags of the issue require a_session_ok: a_session /= Void and then not a_session.is_empty a_project_ok: a_project > 0 a_project_issue_id_ok: a_project_issue_id > 0 a_description_ok: a_description /= Void do make_session (a_session) project := a_project project_issue_id := a_project_issue_id description := a_description is_internal := a_is_internal create tags.make_empty is_extended := False ensure project_set: project = a_project project_issue_id_set: project_issue_id = a_project_issue_id description_set: description = a_description is_extended_set: is_extended = False is_internal_set: is_internal = a_is_internal end make_extended (a_session: like session; a_project: like project; a_project_issue_id: like project_issue_id; a_description: like description; a_tags: like tags; a_is_internal: like is_internal) is -- Creates an extended isssue reply (a reply which contains new tags to be set for the issue) require a_session_ok: a_session /= Void and then not a_session.is_empty a_project_ok: a_project > 0 a_project_issue_id_ok: a_project_issue_id > 0 a_description_ok: a_description /= Void a_tags_ok: a_tags /= Void do make_session (a_session) project := a_project project_issue_id := a_project_issue_id description := a_description tags := a_tags is_extended := True is_internal := a_is_internal ensure project_set: project = a_project project_issue_id_set: project_issue_id = a_project_issue_id description_set: description = a_description tags_set: tags = a_tags is_extended_set: is_extended = True is_internal_set: is_internal = a_is_internal 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 project := l_args.item (project_argument).to_integer project_issue_id := l_args.item (project_issue_id_argument).to_integer description := l_args.item (description_argument) tags := l_args.item (tags_argument) is_extended := l_args.item (is_extended_argument).to_boolean is_internal := l_args.item (is_internal_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_comment_type end project: INTEGER -- id of the project project_issue_id: INTEGER -- id of the issue in this project description: STRING -- Issue description tags: STRING -- Tags is_extended: BOOLEAN -- `true' = The message contains new tags which are to be set in the new issue revision -- `false' = Do not change the tags which means that the tags of the previous revision are used is_internal: BOOLEAN -- is this an internal message? arguments: HASH_TABLE [STRING, STRING] is -- Named arguments. do Result := Precursor Result.force (project.out, project_argument) Result.force (project_issue_id.out, project_issue_id_argument) Result.force (description, description_argument) Result.force (tags, tags_argument) Result.force (is_extended.out, is_extended_argument) Result.force (is_internal.out, is_internal_argument) end feature {NONE} -- Implementation project_argument: STRING is "project" project_issue_id_argument: STRING is "project_issue_id" description_argument: STRING is "description" tags_argument: STRING is "tags" is_extended_argument: STRING is "is_extended" is_internal_argument: STRING is "is_internal" invariant description_ok: description /= Void tags_ok: tags /= Void end