note description: "Provide an interface to community data." author: "Marco Zietzling " date: "$Date$" revision: "$Revision$" class COMMUNITY_INTERFACE inherit BASE_INTERFACE create make feature -- Commands community_create (a_msg: A_MESSAGE) -- Create a new community according to a_msg. require a_msg_ok: a_msg /= Void local l_create_msg: O_COMMUNITY_CREATE_MESSAGE l_community: COMMUNITY l_status: A_GENERAL_STATUS_MESSAGE l_name: STRING l_creator: USER do l_create_msg ?= a_msg check valid_message: l_create_msg /= Void end l_name := l_create_msg.name.out -- l_name.to_lower create l_community.make l_community.set_name (l_name) l_community.set_description (l_create_msg.description.value) l_community.set_logo ("no") community_access.retrieve_community_by_name (l_name) if community_access.is_found then create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_community_name_already_used)) else -- add creator as admin user_access.retrieve_user_by_session (l_create_msg.session.value) if user_access.is_found then l_creator := user_access.last_user community_access.insert_community (l_community) user_access.update_user_community_association (community_access.last_insert_id, l_creator.user_id, 6) -- retrieve the user and team associations and add them to the cache in case the user was logged in policy_cache.retrieve_associations (l_creator.user_id) create l_status.make (create {A_BOOLEAN_VALUE}.make (True), Void) else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_session)) end end node.send_message_reply (l_status, a_msg) end community_list (a_msg: A_MESSAGE) -- List all existing communities. require a_msg_ok: a_msg /= Void local l_msg: O_COMMUNITY_LIST_MESSAGE l_reply: O_COMMUNITY_LIST_REPLY_MESSAGE l_list: LIST [COMMUNITY] l_communities: DS_ARRAYED_LIST [A_STRING_VALUE] l_community: COMMUNITY l_status: A_GENERAL_STATUS_MESSAGE do l_msg ?= a_msg check valid_message: l_msg /= Void end user_access.retrieve_user_by_session (l_msg.session.value) if user_access.is_found then -- retrieve communities and map them into a DS_ARRAYED_LIST community_access.retrieve_all_communities from l_list := community_access.last_community_list create l_communities.make (l_list.count) l_list.start until l_list.after loop l_community := l_list.item l_communities.force_last (create {A_STRING_VALUE}.make (l_community.name)) l_list.forth end create l_reply.make (create {A_SEQUENCE_VALUE [A_STRING_VALUE]}.make (l_communities)) node.send_message_reply (l_reply, a_msg) else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_session)) node.send_message_reply (l_status, a_msg) end end community_retrieve (a_msg: A_MESSAGE) -- Retrieve detailed information about a community. require a_msg_ok: a_msg /= Void local l_msg: O_COMMUNITY_RETRIEVE_MESSAGE l_reply: O_COMMUNITY_RETRIEVE_REPLY_MESSAGE l_status: A_GENERAL_STATUS_MESSAGE l_community: COMMUNITY do l_msg ?= a_msg check valid_message: l_msg /= Void end user_access.retrieve_user_by_session (l_msg.session.value) if user_access.is_found then -- retrieve community community_access.retrieve_community_by_name (l_msg.community_name.value) if community_access.is_found then l_community := community_access.last_community create l_reply.make ( create {A_INTEGER_VALUE}.make (l_community.community_id), create {A_STRING_VALUE}.make (l_community.name), create {A_STRING_VALUE}.make (l_community.description), create {A_STRING_VALUE}.make (l_community.logo)) node.send_message_reply (l_reply, a_msg) else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_community)) node.send_message_reply (l_status, a_msg) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_session)) node.send_message_reply (l_status, a_msg) end end community_delete (a_msg: A_MESSAGE) -- Delete an entire community. require a_msg_ok: a_msg /= Void local l_msg: O_COMMUNITY_DELETE_MESSAGE l_status: A_GENERAL_STATUS_MESSAGE l_community: COMMUNITY do l_msg ?= a_msg check valid_message: l_msg /= Void end user_access.retrieve_user_by_session (l_msg.session.value) if user_access.is_found then -- retrieve community community_access.retrieve_community_by_name (l_msg.community_name.value) if community_access.is_found then l_community := community_access.last_community -- now delete this community community_access.delete_community (l_community.community_id) create l_status.make (create {A_BOOLEAN_VALUE}.make (True), Void) else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_community)) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_session)) end node.send_message_reply (l_status, a_msg) end community_change_group (a_msg: A_MESSAGE) -- Change access_group of a user for a community. require a_msg_ok: a_msg /= Void local l_msg: O_COMMUNITY_CHANGE_GROUP_MESSAGE l_status: A_GENERAL_STATUS_MESSAGE l_access_group: INTEGER l_user_name: STRING l_user: USER l_community_name: STRING l_community: COMMUNITY do l_msg ?= a_msg check valid_msg: l_msg /= Void end l_community_name := l_msg.community.value l_user_name := l_msg.user.value l_access_group := l_msg.group.value.to_integer -- is the access group valid? if l_access_group = 0 or policy_cache.community_access_groups.has (l_access_group) then -- is session valid? user_access.retrieve_user_by_session (l_msg.session.value) if user_access.is_found then -- is user valid? user_access.retrieve_user_by_name (l_user_name, False) if user_access.is_found then l_user := user_access.last_user -- is community vaild? community_access.retrieve_community_by_name (l_community_name) if community_access.is_found then l_community := community_access.last_community user_access.update_user_community_association (l_community.community_id, l_user.user_id, l_access_group) -- retrieve the user and team associations and add them to the cache in case the user was logged in policy_cache.retrieve_associations (l_user.user_id) -- TODO marcozi edit here to eventually enable workitem notification per community if needed? -- if l_grp = 0 then -- -- remove all workitem subscriptions if user hasn't already bookmarked project -- if not user_access.has_bookmarked_project (l_project, l_user_ret.user_id) then -- user_access.delete_project_workitem_subscriptions (l_user_ret.user_id, l_project) -- end -- else -- -- subscribe to all workitems if user hasn't already bookmarked project -- if not user_access.has_bookmarked_project (l_project, l_user_ret.user_id) then -- user_access.insert_all_project_workitem_subscriptions (l_user_ret.user_id, l_project) -- end -- end create l_status.make (create {A_BOOLEAN_VALUE}.make (True), Void) else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_community)) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_user)) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_session)) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_group)) end -- send status node.send_message_reply (l_status, a_msg) end community_list_members (a_msg: A_MESSAGE) -- List community admins/members. require a_msg_ok: a_msg /= Void local l_msg: O_COMMUNITY_LIST_MEMBERS_MESSAGE l_reply: O_USER_LIST_MESSAGE l_status: A_GENERAL_STATUS_MESSAGE l_lst: LIST [USER] l_members: DS_HASH_TABLE [A_STRING_VALUE, A_STRING_VALUE] l_usr: USER do l_msg ?= a_msg check valid_message: l_msg /= Void end user_access.retrieve_user_by_session (l_msg.session.value) if user_access.is_found then community_access.retrieve_community_by_name (l_msg.community.value) if community_access.is_found then -- retrieve users and map them into a HASH_TABLE community_access.retrieve_members (community_access.last_community.community_id, l_msg.group.value.to_integer) from l_lst := community_access.last_member_list create l_members.make (l_lst.count) l_lst.start until l_lst.after loop l_usr := l_lst.item l_members.force (create {A_STRING_VALUE}.make (l_usr.name), create {A_STRING_VALUE}.make (l_usr.user_id.out)) l_lst.forth end create l_reply.make (create {A_MAP_VALUE [A_STRING_VALUE]}.make (l_members)) node.send_message_reply (l_reply, a_msg) else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_community)) node.send_message_reply (l_status, a_msg) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_session)) node.send_message_reply (l_status, a_msg) end end community_list_projects (a_msg: A_MESSAGE) -- List community projects. -- TODO Refactor this call to return all the required project information -- FIXME Add more project data to the reply messge (from project_information) require a_msg_ok: a_msg /= Void local l_msg: O_COMMUNITY_LIST_PROJECTS_MESSAGE l_reply: O_PROJECT_LIST_MESSAGE l_status: A_GENERAL_STATUS_MESSAGE l_project_list: LIST [PROJECT] l_project_map: DS_HASH_TABLE [O_PROJECT_PROJECT_MESSAGE, A_STRING_VALUE] l_project: PROJECT i: INTEGER do l_msg ?= a_msg check valid_message: l_msg /= Void end user_access.retrieve_user_by_session (l_msg.session.value) if user_access.is_found then community_access.retrieve_community_by_name (l_msg.community.value) if community_access.is_found then -- retrieve projects and map them into a HASH_TABLE community_access.retrieve_projects (community_access.last_community.community_id) from l_project_list := community_access.last_project_list create l_project_map.make (l_project_list.count) l_project_list.start until l_project_list.after loop l_project := l_project_list.item l_project_map.force ( create {O_PROJECT_PROJECT_MESSAGE}.make ( create {A_INTEGER_VALUE}.make (l_project.project_id), create {A_STRING_VALUE}.make (l_project.name), create {A_STRING_VALUE}.make (l_project.project_pretty_name), create {A_STRING_VALUE}.make (""), create {A_STRING_VALUE}.make (l_project.logo), create {A_STRING_VALUE}.make (""), create {A_STRING_VALUE}.make (""), create {A_STRING_VALUE}.make (""), create {A_STRING_VALUE}.make ("")), create {A_STRING_VALUE}.make (i.out)) i := i + 1 l_project_list.forth end create l_reply.make (create {A_MAP_VALUE [O_PROJECT_PROJECT_MESSAGE]}.make (l_project_map)) node.send_message_reply (l_reply, a_msg) else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_community)) node.send_message_reply (l_status, a_msg) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_session)) node.send_message_reply (l_status, a_msg) end end community_add_project (a_msg: A_MESSAGE) -- Add a project to a community. require a_msg_ok: a_msg /= Void local l_msg: O_COMMUNITY_ADD_PROJECT_MESSAGE l_status: A_GENERAL_STATUS_MESSAGE l_community: COMMUNITY l_project: PROJECT do l_msg ?= a_msg check valid_msg: l_msg /= Void end user_access.retrieve_user_by_session (l_msg.session.value) if user_access.is_found then project_access.retrieve_project_by_name (l_msg.project.value) if project_access.is_found then l_project := project_access.last_project community_access.retrieve_community_by_name (l_msg.community.value) if community_access.is_found then l_community := community_access.last_community -- only insert association if it does not already exist if community_access.is_associated_with_project (l_community.community_id, l_project.project_id) then create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_community_project_already_associated)) else community_access.insert_community_project_association (l_community.community_id, l_project.project_id) create l_status.make (create {A_BOOLEAN_VALUE}.make (True), Void) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_community)) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_project)) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_session)) end node.send_message_reply (l_status, a_msg) end community_remove_project (a_msg: A_MESSAGE) -- Remove a project from a community. require a_msg_ok: a_msg /= Void local l_msg: O_COMMUNITY_REMOVE_PROJECT_MESSAGE l_status: A_GENERAL_STATUS_MESSAGE l_community: COMMUNITY l_project: PROJECT do l_msg ?= a_msg check valid_msg: l_msg /= Void end user_access.retrieve_user_by_session (l_msg.session.value) if user_access.is_found then project_access.retrieve_project_by_name (l_msg.project.value) if project_access.is_found then l_project := project_access.last_project community_access.retrieve_community_by_name (l_msg.community.value) if community_access.is_found then l_community := community_access.last_community community_access.delete_community_project_association (l_community.community_id, l_project.project_id) create l_status.make (create {A_BOOLEAN_VALUE}.make (True), Void) else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_community)) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_project)) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_session)) end node.send_message_reply (l_status, a_msg) end community_change_description (a_msg: A_MESSAGE) -- Change description of a community require a_msg_ok: a_msg /= Void local l_msg: O_COMMUNITY_CHANGE_DESCRIPTION_MESSAGE l_status: A_GENERAL_STATUS_MESSAGE l_community: COMMUNITY do l_msg ?= a_msg check valid_msg: l_msg /= Void end user_access.retrieve_user_by_session (l_msg.session.value) if user_access.is_found then community_access.retrieve_community_by_name (l_msg.community_name.value) if community_access.is_found then l_community := community_access.last_community community_access.update_community_description (l_community.community_id, l_msg.description.value) create l_status.make (create {A_BOOLEAN_VALUE}.make (True), Void) else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_community)) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_session)) end -- send status node.send_message_reply (l_status, a_msg) end community_list_wiki_pages (a_msg: A_MESSAGE) -- List community wiki pages. require a_msg_ok: a_msg /= Void local l_msg: O_COMMUNITY_LIST_WIKI_PAGES_MESSAGE l_reply: O_COMMUNITY_LIST_WIKI_PAGES_REPLY_MESSAGE l_status: A_GENERAL_STATUS_MESSAGE l_community: COMMUNITY l_wikipage_title_list: DS_ARRAYED_LIST [STRING] l_reply_list: DS_ARRAYED_LIST [A_STRING_VALUE] do l_msg ?= a_msg check valid_message: l_msg /= Void end user_access.retrieve_user_by_session (l_msg.session.value) if user_access.is_found then community_access.retrieve_community_by_name (l_msg.community_name.value) if community_access.is_found then -- retrieve users and map them into a HASH_TABLE l_community := community_access.last_community community_access.retrieve_wiki_page_titles (l_community.community_id) l_wikipage_title_list := community_access.last_wiki_page_title_list create l_reply_list.make (l_wikipage_title_list.count) from l_wikipage_title_list.start until l_wikipage_title_list.after loop l_reply_list.force_last (create {A_STRING_VALUE}.make (l_wikipage_title_list.item_for_iteration)) l_wikipage_title_list.forth end create l_reply.make (create {A_SEQUENCE_VALUE [A_STRING_VALUE]}.make (l_reply_list)) node.send_message_reply (l_reply, a_msg) else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_community)) node.send_message_reply (l_status, a_msg) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_session)) node.send_message_reply (l_status, a_msg) end end community_retrieve_wiki_page (a_msg: A_MESSAGE) -- Retrieve detailed wiki page of a community require a_msg_ok: a_msg /= Void local l_msg: O_COMMUNITY_RETRIEVE_WIKI_PAGE_MESSAGE l_reply: O_COMMUNITY_RETRIEVE_WIKI_PAGE_REPLY_MESSAGE l_status: A_GENERAL_STATUS_MESSAGE l_community: COMMUNITY l_user: USER l_is_member_admin: BOOLEAN l_is_origo_admin: BOOLEAN do l_msg ?= a_msg check valid_message: l_msg /= Void end user_access.retrieve_user_by_session (l_msg.session.value) if user_access.is_found then l_user := user_access.last_user -- retrieve community community_access.retrieve_community_by_name (l_msg.community_name.value) if community_access.is_found then l_community := community_access.last_community community_access.retrieve_wiki_page (l_community.community_id, l_msg.wiki_title.value) if community_access.is_found then -- check privacy status of the retrieved wiki page if not community_access.last_wiki_page.private then -- not private - reply create l_reply.make ( create {A_STRING_VALUE}.make (community_access.last_wiki_page.title), create {A_STRING_VALUE}.make (community_access.last_wiki_page.text), create {A_BOOLEAN_VALUE}.make (community_access.last_wiki_page.private)) node.send_message_reply (l_reply, a_msg) else --check if user has necessary rights to view a private wiki page policy_cache.retrieve_associations (l_user.user_id) l_is_member_admin := policy_cache.user_community_associations.item (l_user.user_id) /= Void and then policy_cache.user_community_associations.item (l_user.user_id).item (l_community.community_id) /= Void and then (policy_cache.user_community_associations.item (l_user.user_id).item (l_community.community_id).has (6) or else policy_cache.user_community_associations.item (l_user.user_id).item (l_community.community_id).has (7)) l_is_origo_admin := policy_cache.user_associations.item (l_user.user_id) /= Void and then policy_cache.user_associations.item (l_user.user_id).has (1) if l_is_member_admin or else l_is_origo_admin then -- user has rights - send it create l_reply.make ( create {A_STRING_VALUE}.make (community_access.last_wiki_page.title), create {A_STRING_VALUE}.make (community_access.last_wiki_page.text), create {A_BOOLEAN_VALUE}.make (community_access.last_wiki_page.private)) node.send_message_reply (l_reply, a_msg) else -- user does not have rights - send reply create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_private_wiki_page)) node.send_message_reply (l_status, a_msg) end end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_wiki_page)) node.send_message_reply (l_status, a_msg) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_community)) node.send_message_reply (l_status, a_msg) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_session)) node.send_message_reply (l_status, a_msg) end end community_add_wiki_page (a_msg: A_MESSAGE) -- Add a wiki page to a community. require a_msg_ok: a_msg /= Void local l_msg: O_COMMUNITY_ADD_WIKI_PAGE_MESSAGE l_status: A_GENERAL_STATUS_MESSAGE l_community: COMMUNITY l_user: USER do l_msg ?= a_msg check valid_message: l_msg /= Void end -- retrieve user user_access.retrieve_user_by_session (l_msg.session.value) if user_access.is_found then l_user := user_access.last_user -- retrieve community community_access.retrieve_community_by_name (l_msg.community_name.value) if community_access.is_found then l_community := community_access.last_community -- check if a wiki page with same title already exists community_access.retrieve_wiki_page (l_community.community_id, l_msg.title.value) if not community_access.is_found then community_access.insert_wiki_page (l_community.community_id, l_user.user_id, l_msg.title.value, l_msg.text.value, l_msg.private.value) create l_status.make (create {A_BOOLEAN_VALUE}.make (True), Void) else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_wiki_title_already_used)) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_community)) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_session)) end --send reply node.send_message_reply (l_status, a_msg) end community_edit_wiki_page (a_msg: A_MESSAGE) -- Edit a wiki page of a community. require a_msg_ok: a_msg /= Void local l_msg: O_COMMUNITY_EDIT_WIKI_PAGE_MESSAGE l_status: A_GENERAL_STATUS_MESSAGE l_community: COMMUNITY l_user: USER do l_msg ?= a_msg check valid_message: l_msg /= Void end -- retrieve user user_access.retrieve_user_by_session (l_msg.session.value) if user_access.is_found then l_user := user_access.last_user -- retrieve community community_access.retrieve_community_by_name (l_msg.community_name.value) if community_access.is_found then l_community := community_access.last_community -- check if a wiki page with same title exists community_access.retrieve_wiki_page (l_community.community_id, l_msg.title.value) if community_access.is_found then community_access.update_wiki_page (l_community.community_id, l_user.user_id, l_msg.title.value, l_msg.text.value, l_msg.private.value) create l_status.make (create {A_BOOLEAN_VALUE}.make (True), Void) else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_no_such_wiki_title)) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_community)) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_session)) end --send reply node.send_message_reply (l_status, a_msg) end community_rename_wiki_page (a_msg: A_MESSAGE) -- Rename a wiki page of a community. require a_msg_ok: a_msg /= Void local l_msg: O_COMMUNITY_RENAME_WIKI_PAGE_MESSAGE l_status: A_GENERAL_STATUS_MESSAGE l_community: COMMUNITY l_user: USER do l_msg ?= a_msg check valid_message: l_msg /= Void end -- retrieve user user_access.retrieve_user_by_session (l_msg.session.value) if user_access.is_found then l_user := user_access.last_user -- retrieve community community_access.retrieve_community_by_name (l_msg.community_name.value) if community_access.is_found then l_community := community_access.last_community -- check if a wiki page with same title exists community_access.retrieve_wiki_page (l_community.community_id, l_msg.old_title.value) if community_access.is_found then community_access.rename_wiki_page (l_community.community_id, l_user.user_id, l_msg.old_title.value, l_msg.new_title.value) create l_status.make (create {A_BOOLEAN_VALUE}.make (True), Void) else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_no_such_wiki_title)) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_community)) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_session)) end --send reply node.send_message_reply (l_status, a_msg) end community_delete_wiki_page (a_msg: A_MESSAGE) -- Delete a wiki page of a community. require a_msg_ok: a_msg /= Void local l_msg: O_COMMUNITY_DELETE_WIKI_PAGE_MESSAGE l_status: A_GENERAL_STATUS_MESSAGE l_community: COMMUNITY do l_msg ?= a_msg check valid_message: l_msg /= Void end user_access.retrieve_user_by_session (l_msg.session.value) if user_access.is_found then -- retrieve community community_access.retrieve_community_by_name (l_msg.community_name.value) if community_access.is_found then l_community := community_access.last_community -- retrieve wiki page community_access.retrieve_wiki_page (l_community.community_id, l_msg.wiki_title.value) if community_access.is_found then community_access.delete_wiki_page (l_community.community_id, l_msg.wiki_title.value) create l_status.make (create {A_BOOLEAN_VALUE}.make (True), Void) else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_wiki_page)) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_community)) end else create l_status.make (create {A_BOOLEAN_VALUE}.make (False), create {A_STRING_VALUE}.make (err_invalid_session)) end -- send reply node.send_message_reply (l_status, a_msg) end end