indexing
description: "Wiki render html message."
author: "Dennis Rietmann "
date: "$Date$"
revision: "$Revision$"
class
O_WIKI_RENDER_HTML_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_wiki_text: like wiki_text; a_project_id: like project_id) is
-- Create.
require
a_session_ok: a_session /= Void and then not a_session.is_empty
a_wiki_text_ok: a_wiki_text /= Void
a_project_id_ok: a_project_id > 0
do
make_session (a_session)
wiki_text := a_wiki_text
project_id := a_project_id
ensure
wiki_text_set: wiki_text = a_wiki_text
project_id_set: project_id = a_project_id
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
wiki_text := l_args.item (wiki_text_argument)
project_id := l_args.item (project_id_argument).to_integer
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_render_html_type
end
wiki_text: STRING
-- the wiki text to render
project_id: INTEGER
-- the id of the project (required to create the hyperlinks)
arguments: HASH_TABLE [STRING, STRING] is
-- Named arguments.
do
Result := Precursor
Result.force (project_id.out, project_id_argument)
Result.force (wiki_text, wiki_text_argument)
end
feature {NONE} -- Implementation
wiki_text_argument: STRING is "wiki_text"
project_id_argument: STRING is "project_id"
invariant
project_id_ok: project_id > 0
end