note description: "Provide an interface to wiki data." author: "Peter Wyss " date: "$Date$" revision: "$Revision$" class WIKI_INTERFACE inherit BASE_INTERFACE O_WORKITEM_CONSTANTS create make feature -- Commands wiki_add (a_msg: A_MESSAGE) -- Add a new wiki workitem according to a_msg. require a_msg_ok: a_msg /= Void local l_pc_msg: O_WIKI_ADD_MESSAGE l_status: A_GENERAL_STATUS_MESSAGE l_user_ret: USER l_project_ret: PROJECT l_workitem_add_reply: O_WIKI_ADD_REPLY_MESSAGE l_wiki_workitem: WI_FULL_WIKI do l_pc_msg ?= a_msg check wiki_add_message: l_pc_msg /= Void end user_access.retrieve_user_by_session (l_pc_msg.session.value) if user_access.is_found then l_user_ret := user_access.last_user project_access.retrieve_project_by_id (l_pc_msg.project.value.to_integer) if project_access.is_found then l_project_ret := project_access.last_project create l_wiki_workitem.make ( l_project_ret.project_id, l_project_ret.name, l_user_ret.user_id, l_user_ret.name, l_pc_msg.url, l_pc_msg.title, l_pc_msg.is_private, l_pc_msg.revision.out, l_pc_msg.old_revision.value.to_integer_32.out, l_pc_msg.diff) workitem_access.store_wi (l_wiki_workitem) create l_workitem_add_reply.make (workitem_access.last_insert_id) node.send_message_reply (l_workitem_add_reply, a_msg) else create l_status.make (False, err_invalid_project) node.send_message_reply (l_status, a_msg) end else create l_status.make (False, err_session_timeout) node.send_message_reply (l_status, a_msg) end end end