note description: "API interface to wiki services" author: "Dennis Rietmann " date: "$Date$" revision: "$Revision$" class WIKI_SERVICE inherit API_SERVICE create make feature -- Basic operations wiki_render_html (a_session: STRING; a_project_id: INTEGER_REF; a_wiki_text: STRING) : STRING -- Parses wiki text and renders it as html local l_msg: O_WIKI_RENDER_HTML_MESSAGE l_reply_msg:A_GENERAL_STRING_MESSAGE do -- argument validiation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session elseif a_project_id <= 0 then last_fault := err_invalid_project else -- generate and send message create l_msg.make (create{A_STRING_VALUE}.make (a_session), create {A_STRING_VALUE}.make (a_wiki_text), create {A_INTEGER_VALUE}.make (a_project_id.to_integer)) send_and_wait_for_reply (l_msg) if is_ok then l_reply_msg ?= last_reply check l_reply_msg_ok: l_reply_msg /= Void end Result := l_reply_msg.string.value end end end feature -- Creation new_tuple (a_name: STRING): TUPLE -- Tuple of default-valued arguments to pass to call `a_name'. do if a_name.is_equal (wiki_render_html_name) then create {TUPLE [STRING, INTEGER_REF, STRING]}Result end end feature -- Initialisation self_register -- Register all actions for this service do register_with_help (agent wiki_render_html, wiki_render_html_name, "renders wiki text as html.") end feature {NONE} -- Implementation wiki_render_html_name: STRING = "render_html" end