indexing description: "Wiki add message." author: "Peter Wyss " date: "$Date$" revision: "$Revision$" class O_WIKI_ADD_MESSAGE inherit O_SESSION_MESSAGE rename make as make_session redefine make_from_generic, arguments end O_WIKI_CONSTANTS undefine out end create make create {O_MESSAGE_FACTORY} make_from_generic feature {NONE} -- Initialization make (a_session: like session; a_project: like project; a_title: like title; a_diff: like diff; a_revision: like revision; a_old_revision: like old_revision; a_is_private: like is_private) is -- Create. require a_session_ok: a_session /= Void and then not a_session.is_empty a_project_ok: a_project > 0 a_title_ok: a_title /= Void and then not a_title.is_empty a_diff_ok: a_diff /= Void and then not a_diff.is_empty a_revision_ok: a_revision > 0 a_old_revision_ok: a_old_revision >= 0 do make_session (a_session) project := a_project title := a_title diff := a_diff revision := a_revision old_revision := a_old_revision is_private := a_is_private ensure project_set: project = a_project title_set: title = a_title diff_set: diff = a_diff revision_set: revision = a_revision old_revision_set: old_revision = a_old_revision is_private_set: is_private = a_is_private 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 title := l_args.item (title_argument) diff := l_args.item (diff_argument) revision := l_args.item (revision_argument).to_integer old_revision := l_args.item (old_revision_argument).to_integer is_private := l_args.item (is_private_argument).to_boolean end feature -- Access namespace: STRING is -- Namespace of the message type. once Result := wiki_namespace end type: STRING is -- Type of the message. once Result := wiki_add_type end project: INTEGER -- id of the project title: STRING -- Title of the WikiPage diff: STRING -- Wikipage diff revision: INTEGER -- revision old_revision: INTEGER -- revision before change is_private: BOOLEAN -- is this from a private wiki page? arguments: HASH_TABLE [STRING, STRING] is -- Named arguments. do Result := Precursor Result.force (project.out, project_argument) Result.force (title, title_argument) Result.force (diff, diff_argument) Result.force (revision.out, revision_argument) Result.force (old_revision.out, old_revision_argument) Result.force (is_private.out, is_private_argument) end feature {NONE} -- Implementation project_argument: STRING is "project" title_argument: STRING is "title" diff_argument: STRING is "diff" revision_argument: STRING is "revision" old_revision_argument: STRING is "old_revision" is_private_argument: STRING is "is_private" invariant title_ok: title /= Void and then not title.is_empty diff_ok: diff /= Void and then not diff.is_empty end