indexing description: "API interface to user services" author: "Rafael Bischof " date: "$Date$" revision: "$Revision$" class USER_SERVICE inherit API_SERVICE create make feature -- Basic operations user_my_name (a_session: STRING): STRING is -- Return username of user associated with a_session local l_msg: O_USER_MY_NAME_MESSAGE l_string_msg: O_GENERAL_STRING_MESSAGE do Result := "" -- argument validiation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session else -- generate and send message create l_msg.make (a_session) send_and_wait_for_reply (l_msg) if is_ok then l_string_msg ?= last_reply check string_message: l_string_msg /= Void end Result := l_string_msg.string end end end user_my_password (a_session: STRING): STRING is -- Return password of user associated with a_session local l_msg: O_USER_MY_PASSWORD_MESSAGE l_string_msg: O_GENERAL_STRING_MESSAGE do Result := "" -- argument validiation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session else -- generate and send message create l_msg.make (a_session) send_and_wait_for_reply (l_msg) if is_ok then l_string_msg ?= last_reply check string_message: l_string_msg /= Void end Result := l_string_msg.string end end end user_my_email (a_session: STRING): STRING is -- Return email of user associated with a_session. local l_msg: O_USER_MY_EMAIL_MESSAGE l_string_msg: O_GENERAL_STRING_MESSAGE do Result := "" -- argument validiation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session else -- generate and send message create l_msg.make (a_session) send_and_wait_for_reply (l_msg) if is_ok then l_string_msg ?= last_reply check string_message: l_string_msg /= Void end Result := l_string_msg.string end end end user_profile_visible (a_user_name: STRING): DS_HASH_TABLE [ANY, STRING] is -- Returns 0 if not visible for anonymous users, otherwise value > 0. local l_reply_msg: O_GENERAL_STRING_MESSAGE l_msg: O_USER_PROFILE_VISIBLE_MESSAGE i: INTEGER do if a_user_name = Void or else a_user_name.is_empty or else not is_valid_name (a_user_name) then last_fault := err_invalid_name else -- generate and send message create l_msg.make (a_user_name) send_and_wait_for_reply (l_msg) if is_ok then l_reply_msg ?= last_reply check message: l_reply_msg /= Void end i := l_reply_msg.string.to_integer -- decode integer and create hash table create Result.make (3) Result.force (i.bit_and (1), "profile_visible") Result.force (i.bit_and (2).bit_shift_right (1), "foaf_visible") Result.force (i.bit_and (4).bit_shift_right (2), "sha1mbox_visible") Result.force (i, "encoded") end end end user_change_profile_visible (a_session: STRING; a_value: INTEGER_REF): BOOLEAN_REF is -- Sets the profile visibility local l_msg: O_USER_CHANGE_PROFILE_VISIBLE_MESSAGE do -- argument validation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session elseif a_value = Void or else a_value.item < 0 then last_fault := err_invalid_information else -- generate and send message create l_msg.make (a_session, a_value.item) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) else create Result Result.set_item (False) end end end user_retrieve_openids_from_user (a_session: STRING; a_username: STRING): ARRAY [STRING] is -- Return a list of `a_username's openid's. -- If he is requesting the list with his own session, he gets the complete list, -- otherwise, a subset of exported OpenID's. local l_msg: O_USER_RETRIEVE_OPENIDS_FROM_USER_MESSAGE l_reply: O_USER_STRINGARRAY_REPLY_MESSAGE l_openids: ARRAY [STRING] i: INTEGER do -- argument validiation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session elseif a_username = Void or else a_username.is_empty then last_fault := err_invalid_user else create l_msg.make (a_session, a_username) send_and_wait_for_reply (l_msg) if is_ok then l_reply ?= last_reply check user_retrieve_openids_from_user_reply_message: l_reply /= Void end l_openids := l_reply.content create Result.make (0, l_openids.count-1) from i := 0 until i >= l_openids.count loop Result.put (l_openids.item (i), i) i := i + 1 end end end end user_remove_openid (a_session: STRING; a_openid: STRING): BOOLEAN_REF is -- Remove openid of a user local l_msg: O_USER_REMOVE_OPENID_MESSAGE do -- argument validiation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session elseif not is_valid_url (a_openid) then last_fault := err_invalid_url else -- generate and send message create l_msg.make (a_session, a_openid) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end user_change_openid (a_session: STRING; a_openid: STRING; a_visible: INTEGER_REF): BOOLEAN_REF is -- Change openid visibility of a user local l_msg: O_USER_CHANGE_OPENID_MESSAGE do -- argument validiation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session elseif not is_valid_url (a_openid) then last_fault := err_invalid_url else -- generate and send message create l_msg.make (a_session, a_openid, a_visible) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end user_remove_foaf (a_session: STRING; a_foaf: STRING): BOOLEAN_REF is -- Remove foaf of a user local l_msg: O_USER_REMOVE_FOAF_MESSAGE do -- argument validiation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session elseif not is_valid_url (a_foaf) then last_fault := err_invalid_url else -- generate and send message create l_msg.make (a_session, a_foaf) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end user_add_foaf (a_session: STRING; a_foaf: STRING): BOOLEAN_REF is -- Add foaf to a user local l_msg: O_USER_ADD_FOAF_MESSAGE do -- argument validiation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session elseif not is_valid_url (a_foaf) then last_fault := err_invalid_url else -- generate and send message create l_msg.make (a_session, a_foaf) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end user_retrieve_foaf (a_session: STRING; a_username: STRING): ARRAY [STRING] is -- Return a list of `a_username's foaf's. local l_msg: O_USER_RETRIEVE_FOAF_MESSAGE l_reply: O_USER_STRINGARRAY_REPLY_MESSAGE l_foaf: ARRAY [STRING] i: INTEGER do -- argument validiation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session elseif a_username = Void or else a_username.is_empty then last_fault := err_invalid_user else create l_msg.make (a_session, a_username) send_and_wait_for_reply (l_msg) if is_ok then l_reply ?= last_reply check user_retrieve_foaf_reply_message: l_reply /= Void end l_foaf := l_reply.content create Result.make (0, l_foaf.count-1) from i := 0 until i >= l_foaf.count loop Result.put (l_foaf.item (i), i) i := i + 1 end end end end user_retrieve_information (a_session: STRING; a_user_name: STRING): DS_HASH_TABLE [ANY, STRING] is -- Retrieve user information of user with name user_name. local l_msg: O_USER_RETRIEVE_INFORMATION_MESSAGE l_user_information_reply_msg: O_USER_RETRIEVE_INFORMATION_REPLY_MESSAGE l_user_data: DS_HASH_TABLE [ANY, STRING] do -- argument validiation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session elseif a_user_name = Void or else a_user_name.is_empty then last_fault := err_invalid_name else -- generate and send message create l_msg.make (a_session, a_user_name) send_and_wait_for_reply (l_msg) if is_ok then l_user_information_reply_msg ?= last_reply check user_information_reply_message: l_user_information_reply_msg /= Void end create Result.make (2) Result.force (a_user_name, "user_name") l_user_data ?= l_user_information_reply_msg.data check l_user_data_valid: l_user_data /= Void end from l_user_data.start until l_user_data.after loop Result.force (l_user_data.item_for_iteration, l_user_data.key_for_iteration) l_user_data.forth end end end end user_set_information (a_session: STRING; a_informations: ARRAY [ANY]): BOOLEAN_REF is -- Set new information for user with session a_session. local l_msg: O_USER_SET_INFORMATION_MESSAGE l_informations: ARRAYED_LIST [TUPLE [information_type: STRING; information_value: STRING]] l_tuple: TUPLE [information_type: STRING; information_value: STRING] l_information: DS_HASH_TABLE [ANY, STRING] l_information_type: STRING l_information_value: STRING i: INTEGER do -- argument validation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session elseif a_informations = Void or else a_informations.is_empty then last_fault := err_invalid_information else -- FIXME struct should be validated -- generate and send message from i := 1 create l_informations.make (a_informations.count) until i > a_informations.count loop l_information ?= a_informations.item (i) if l_information = Void then last_fault := err_invalid_information else l_information_type := l_information.item ("information_type").out l_information_value := l_information.item ("information_value").out create l_tuple l_tuple.information_type := l_information_type l_tuple.information_value := l_information_value l_informations.force (l_tuple) end i := i + 1 end if last_fault = Void then create l_msg.make (a_session, l_informations) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end end user_set_icon (a_session: STRING; an_icon: STRING): BOOLEAN_REF is -- Set new icon of user with session a_session. local l_msg: O_USER_SET_ICON_MESSAGE do -- argument validation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session elseif not is_valid_file_name (an_icon) then last_fault := err_invalid_icon else -- generate and send message create l_msg.make (a_session, an_icon) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end user_reset_icon (a_session: STRING): BOOLEAN_REF is -- Reset icon of user with session a_session. local l_msg: O_USER_RESET_ICON_MESSAGE do -- argument validation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session else -- generate and send message create l_msg.make (a_session) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end user_login_key (a_user_key, a_app_key: STRING): STRING is -- Login a user with a_user_key and a_app_key, return the session token on success. local l_msg: O_USER_LOGIN_KEY_MESSAGE l_session_msg: O_USER_SESSION_MESSAGE do Result := "" -- argument validiation if not is_valid_key (a_user_key) then last_fault := err_invalid_user_key elseif not is_valid_key (a_app_key) then last_fault := err_invalid_app_key else -- generate and send message create l_msg.make (a_user_key, a_app_key) send_and_wait_for_reply (l_msg) if is_ok then l_session_msg ?= last_reply check session_message: l_session_msg /= Void end Result := l_session_msg.session end end end user_add_bookmark (a_session: STRING; a_project: INTEGER_REF): BOOLEAN_REF is -- Add bookmark to a_project local l_msg: O_USER_ADD_BOOKMARK_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 <= 0 then last_fault := err_invalid_project else -- generate and send message create l_msg.make (a_session, a_project) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end user_remove_bookmark (a_session: STRING; a_project: INTEGER_REF): BOOLEAN_REF is -- Remove bookmark to a_project local l_msg: O_USER_REMOVE_BOOKMARK_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 <= 0 then last_fault := err_invalid_project else -- generate and send message create l_msg.make (a_session, a_project) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end user_list_bookmark (a_session: STRING; a_username: STRING): ARRAY [DS_HASH_TABLE [ANY, STRING]] is -- List bookmarks of user a_username. local l_msg: O_USER_LIST_BOOKMARK_MESSAGE l_reply: O_USER_LIST_BOOKMARK_REPLY_MESSAGE l_pl: HASH_TABLE [STRING, INTEGER] l_project: DS_HASH_TABLE [ANY, STRING] i: INTEGER l_project_id_ref: INTEGER_REF do -- argument validiation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session elseif a_username = Void or else a_username.is_empty then last_fault := err_invalid_user else create l_msg.make (a_session, a_username) send_and_wait_for_reply (l_msg) if is_ok then l_reply ?= last_reply check bookmark_list_reply_message: l_reply /= Void end l_pl := l_reply.project_list create Result.make (0, l_pl.count-1) from l_pl.start i := 0 until l_pl.after loop create l_project.make (2) l_project.force (l_pl.item_for_iteration, "name") create l_project_id_ref l_project_id_ref.set_item (l_pl.key_for_iteration) l_project.force (l_project_id_ref, "project_id") Result.force (l_project, i) i := i + 1 l_pl.forth end end end end user_set_workitem_subscription (a_session: STRING; a_project: INTEGER_REF; a_settings: ARRAY [ANY]): BOOLEAN_REF is -- Set workitem subscription for `a_project'. local l_msg: O_USER_SET_WORKITEM_SUBSCRIPTION_MESSAGE l_settings: ARRAYED_LIST [TUPLE [workitem_type: INTEGER; subscription_type: INTEGER; is_enabled: BOOLEAN]] l_tuple: TUPLE [workitem_type: INTEGER; subscription_type: INTEGER; is_enabled: BOOLEAN] i: INTEGER l_workitem_type: INTEGER l_subscription_type: INTEGER l_is_enabled: BOOLEAN l_workitem_type_ref: INTEGER_REF l_subscription_type_ref: INTEGER_REF l_is_enabled_ref: BOOLEAN_REF l_setting: DS_HASH_TABLE [ANY, STRING] do -- argument validiation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session elseif a_project <= 0 then last_fault := err_invalid_project elseif a_settings = Void or else a_settings.is_empty then last_fault := err_invalid_settings else -- FIXME structs should be validated -- generate and send message from i := 1 create l_settings.make (a_settings.count) until i > a_settings.count loop l_setting ?= a_settings.item (i) if l_setting = Void then last_fault := err_invalid_settings else l_workitem_type_ref ?= l_setting.item ("workitem_type") l_subscription_type_ref ?= l_setting.item ("subscription_type") l_is_enabled_ref ?= l_setting.item ("is_enabled") l_workitem_type := l_workitem_type_ref.item l_subscription_type := l_subscription_type_ref.item l_is_enabled := l_is_enabled_ref.item if l_workitem_type <= 0 then last_fault := err_invalid_workitem_type elseif l_subscription_type <= 0 then last_fault := err_invalid_subscription_type else create l_tuple l_tuple.workitem_type := l_workitem_type l_tuple.subscription_type := l_subscription_type l_tuple.is_enabled := l_is_enabled l_settings.force (l_tuple) end end i := i + 1 end if last_fault = Void then create l_msg.make (a_session, a_project, l_settings) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end end user_list_workitem_subscription (a_session: STRING; a_project: INTEGER_REF): ARRAY [DS_HASH_TABLE [ANY, STRING]] is -- List workitem subscriptions for `a_project'. local l_msg: O_USER_LIST_WORKITEM_SUBSCRIPTION_MESSAGE l_reply: O_USER_WORKITEM_SUBSCRIPTIONS_MESSAGE l_sl: ARRAYED_LIST [TUPLE[workitem_type: INTEGER; subscription_type: INTEGER]] l_subscription: DS_HASH_TABLE [ANY, STRING] i: INTEGER l_wi_type_ref: INTEGER_REF l_s_type_ref: INTEGER_REF do -- argument validiation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session elseif a_project <= 0 then last_fault := err_invalid_project else create l_msg.make (a_session, a_project) send_and_wait_for_reply (l_msg) if is_ok then l_reply ?= last_reply check reply_message: l_reply /= Void end l_sl := l_reply.subscriptions create Result.make (0, l_sl.count-1) from l_sl.start i := 0 until l_sl.after loop create l_subscription.make (2) create l_wi_type_ref l_wi_type_ref.set_item (l_sl.item.workitem_type) l_subscription.force (l_wi_type_ref, "workitem_type") create l_s_type_ref l_s_type_ref.set_item (l_sl.item.subscription_type) l_subscription.force (l_s_type_ref, "subscription_type") Result.force (l_subscription, i) i := i + 1 l_sl.forth end end end end user_list_reported_issues (a_session: STRING; a_username: STRING): ARRAY [DS_HASH_TABLE [ANY, STRING]] is -- List issues for a specific user `a_username' local l_msg: O_USER_LIST_REPORTED_ISSUES_MESSAGE l_issue_list_reply_msg: O_USER_LIST_REPORTED_ISSUES_REPLY_MESSAGE l_issue_list: DS_HASH_TABLE [TUPLE [issue_id: INTEGER; project_name: STRING; creation_time: INTEGER; title: STRING; tags: STRING], INTEGER] l_issue_t: TUPLE [issue_id: INTEGER; project_name: STRING; creation_time: INTEGER; title: STRING; tags: STRING] l_issue: DS_HASH_TABLE [ANY, STRING] i: INTEGER l_issue_id_ref: INTEGER_REF l_creation_time_ref: INTEGER_REF do -- argument validiation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session elseif a_username = Void or else a_username.is_empty then last_fault := err_invalid_user else create l_msg.make (a_session, a_username) send_and_wait_for_reply (l_msg) if is_ok then l_issue_list_reply_msg ?= last_reply check issue_list_reply_message: l_issue_list_reply_msg /= Void end l_issue_list := l_issue_list_reply_msg.issue_list create Result.make (0, l_issue_list.count - 1) from i := 0 until i >= l_issue_list.count loop l_issue_t := l_issue_list.item (i) create l_issue.make (5) create l_issue_id_ref l_issue_id_ref.set_item (l_issue_t.issue_id) l_issue.force (l_issue_id_ref, "issue_id") l_issue.force (l_issue_t.project_name, "project_name") create l_creation_time_ref l_creation_time_ref.set_item (l_issue_t.creation_time) l_issue.force (l_creation_time_ref, "creation_time") l_issue.force (l_issue_t.title, "title") l_issue.force (l_issue_t.tags, "tags") Result.force (l_issue, i) i := i + 1 end end end end user_request_friendship (a_session: STRING; a_requestee: STRING): BOOLEAN_REF is -- User with session `a_session' requests friendship with `a_requestee'. local l_msg: O_USER_REQUEST_FRIENDSHIP_MESSAGE do -- argument validation check_anonymous_session (a_session) if not is_valid_session(a_session) then last_fault := err_invalid_session elseif a_requestee = Void or else a_requestee.is_empty then last_fault := err_invalid_user else -- generate and send message create l_msg.make (a_session, a_requestee) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end user_process_friendship_request (a_session: STRING; a_requester: STRING; an_accept: BOOLEAN_REF): BOOLEAN_REF is -- User with session `a_session' processes friendship request from `a_requester'. -- Accept: `an_accept' = True, Reject: `an_accept' = False local l_msg: O_USER_PROCESS_FRIENDSHIP_REQUEST_MESSAGE do -- argument validation check_anonymous_session (a_session) if not is_valid_session(a_session) then last_fault := err_invalid_session elseif a_requester = Void or else a_requester.is_empty then last_fault := err_invalid_user else -- generate and send message create l_msg.make (a_session, a_requester, an_accept) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end user_remove_friendship (a_session: STRING; a_friend: STRING): BOOLEAN_REF is -- User with session `a_session' removes friendship with `a_friend'. local l_msg: O_USER_REMOVE_FRIENDSHIP_MESSAGE do -- argument validation check_anonymous_session (a_session) if not is_valid_session(a_session) then last_fault := err_invalid_session elseif a_friend = Void or else a_friend.is_empty then last_fault := err_invalid_user else -- generate and send message create l_msg.make (a_session, a_friend) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end user_list_friends (a_session: STRING; a_username: STRING) : ARRAY [DS_HASH_TABLE [ANY, STRING]] is -- List friends of user `a_username'. local l_msg: O_USER_LIST_FRIENDS_MESSAGE l_reply: O_USER_LIST_FRIENDS_REPLY_MESSAGE l_friend_list: DS_HASH_TABLE [TUPLE [name: STRING; icon: STRING; real_name: STRING], INTEGER] l_friend: DS_HASH_TABLE [ANY, STRING] i: INTEGER do -- argument validation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session elseif a_username = Void or else a_username.is_empty then last_fault := err_invalid_user else -- generate and send message create l_msg.make (a_session, a_username) send_and_wait_for_reply (l_msg) if is_ok then l_reply ?= last_reply check valid_reply_message: l_reply /= Void end l_friend_list := l_reply.friend_list create Result.make (0, l_friend_list.count - 1) from l_friend_list.start i := 0 until l_friend_list.after loop create l_friend.make (2) l_friend.force (l_friend_list.item_for_iteration.name, "name") l_friend.force (l_friend_list.item_for_iteration.icon, "icon") l_friend.force (l_friend_list.item_for_iteration.real_name, "real_name") Result.force (l_friend, i) i := i + 1 l_friend_list.forth end end end end user_send_message (a_session, a_username, a_subject, a_message: STRING) : BOOLEAN_REF is -- Send a message to `a_username' with `a_subject' and `a_message'. local l_msg: O_USER_SEND_MESSAGE_MESSAGE do -- argument validation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session elseif a_username = Void or else a_username.is_empty then last_fault := err_invalid_user elseif a_subject = Void or else a_subject.is_empty then last_fault := err_invalid_subject elseif a_message = Void or else a_message.is_empty then last_fault := err_invalid_message else -- generate and send message create l_msg.make (a_session, a_username, a_subject, a_message) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end user_disable_account (a_session: STRING) : BOOLEAN_REF is -- Disable account of user with `a_session'. local l_msg: O_USER_DISABLE_ACCOUNT_MESSAGE do -- argument validation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session else -- generate and send message create l_msg.make (a_session) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end user_list_communities (a_session: STRING; a_username: STRING): ARRAY [DS_HASH_TABLE [ANY, STRING]] is -- List communities of user a_username. local l_msg: O_USER_LIST_COMMUNITIES_MESSAGE l_reply: O_COMMUNITY_LIST_REPLY_MESSAGE l_communitiy_list: DS_ARRAYED_LIST [STRING] l_community: DS_HASH_TABLE [ANY, STRING] i: INTEGER do -- argument validiation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session elseif a_username = Void or else a_username.is_empty then last_fault := err_invalid_user else create l_msg.make (a_session, a_username) send_and_wait_for_reply (l_msg) if is_ok then l_reply ?= last_reply check valid_reply: l_reply /= Void end l_communitiy_list := l_reply.community_list create Result.make (0, l_communitiy_list.count - 1) from l_communitiy_list.start i := 0 until l_communitiy_list.after loop create l_community.make (1) l_community.force (l_communitiy_list.item_for_iteration, "name") Result.force (l_community, i) i := i + 1 l_communitiy_list.forth end end end end feature -- Creation new_tuple (a_name: STRING): TUPLE is -- Tuple of default-valued arguments to pass to call `a_name'. do if a_name.is_equal (user_my_name_name) then create {TUPLE [STRING]}Result elseif a_name.is_equal (user_my_password_name) then create {TUPLE [STRING]}Result elseif a_name.is_equal (user_my_email_name) then create {TUPLE [STRING]}Result elseif a_name.is_equal (user_profile_visible_name) then create {TUPLE [STRING]}Result elseif a_name.is_equal (user_change_profile_visible_name) then create {TUPLE [STRING, INTEGER_REF]}Result elseif a_name.is_equal (user_retrieve_information_name) then create {TUPLE [STRING, STRING]}Result elseif a_name.is_equal (user_retrieve_openids_from_user_name) then create {TUPLE [STRING, STRING]}Result elseif a_name.is_equal (user_retrieve_foaf_name) then create {TUPLE [STRING, STRING]}Result elseif a_name.is_equal (user_remove_foaf_name) then create {TUPLE [STRING, STRING]}Result elseif a_name.is_equal (user_add_foaf_name) then create {TUPLE [STRING, STRING]}Result elseif a_name.is_equal (user_remove_openid_name) then create {TUPLE [STRING, STRING]}Result elseif a_name.is_equal (user_change_openid_name) then create {TUPLE [STRING, STRING, INTEGER_REF]}Result elseif a_name.is_equal (user_set_information_name) then create {TUPLE [STRING, ARRAY [ANY]]}Result elseif a_name.is_equal (user_set_icon_name) then create {TUPLE [STRING, STRING]}Result elseif a_name.is_equal (user_reset_icon_name) then create {TUPLE [STRING]}Result elseif a_name.is_equal (user_login_key_name) then create {TUPLE [STRING, STRING]}Result elseif a_name.is_equal (user_add_bookmark_name) then create {TUPLE [STRING, INTEGER_REF]}Result elseif a_name.is_equal (user_remove_bookmark_name) then create {TUPLE [STRING, INTEGER_REF]}Result elseif a_name.is_equal (user_list_bookmark_name) then create {TUPLE [STRING, STRING]}Result elseif a_name.is_equal (user_set_workitem_subscription_name) then create {TUPLE [STRING, INTEGER_REF, ARRAY [ANY]]}Result elseif a_name.is_equal (user_list_workitem_subscription_name) then create {TUPLE [STRING, INTEGER_REF]}Result elseif a_name.is_equal (user_list_reported_issues_name) then create {TUPLE [STRING, STRING]}Result elseif a_name.is_equal (user_request_friendship_name) then create {TUPLE [STRING, STRING]}Result elseif a_name.is_equal (user_process_friendship_request_name) then create {TUPLE [STRING, STRING, BOOLEAN_REF]}Result elseif a_name.is_equal (user_remove_friendship_name) then create {TUPLE [STRING, STRING]}Result elseif a_name.is_equal (user_list_friends_name) then create {TUPLE [STRING, STRING]}Result elseif a_name.is_equal (user_send_message_name) then create {TUPLE [STRING, STRING, STRING, STRING]}Result elseif a_name.is_equal (user_disable_account_name) then create {TUPLE [STRING]}Result elseif a_name.is_equal (user_list_communities_name) then create {TUPLE [STRING, STRING]}Result end end feature -- Initialisation self_register is -- Register all actions for this service do register_with_help (agent user_my_name, user_my_name_name, "Your user name.") register_with_help (agent user_my_password, user_my_password_name, "Your password.") register_with_help (agent user_my_email, user_my_email_name, "Your email address.") register_with_help (agent user_profile_visible, user_profile_visible_name, "Your profile visibility.") register_with_help (agent user_change_profile_visible, user_change_profile_visible_name, "Set profile visibility.") register_with_help (agent user_retrieve_information, user_retrieve_information_name, "Retrieve user information.") register_with_help (agent user_retrieve_openids_from_user, user_retrieve_openids_from_user_name, "Retrieve OpenIDs from username.") register_with_help (agent user_retrieve_foaf, user_retrieve_foaf_name, "Retrieve FOAFs from username.") register_with_help (agent user_remove_foaf, user_remove_foaf_name, "Remove FOAF.") register_with_help (agent user_add_foaf, user_add_foaf_name, "Add FOAF.") register_with_help (agent user_remove_openid, user_remove_openid_name, "Remove OpenID.") register_with_help (agent user_change_openid, user_change_openid_name, "Change OpenID.") register_with_help (agent user_set_information, user_set_information_name, "Set user information.") register_with_help (agent user_set_icon, user_set_icon_name, "Set user icon.") register_with_help (agent user_reset_icon, user_reset_icon_name, "Reset user icon to default image.") register_with_help (agent user_login_key, user_login_key_name, "Login with user_key and application_key, receive a session.") register_with_help (agent user_add_bookmark, user_add_bookmark_name, "Add bookmark to project") register_with_help (agent user_remove_bookmark, user_remove_bookmark_name, "Remove bookmark to project") register_with_help (agent user_list_bookmark, user_list_bookmark_name, "List bookmarks for a user") register_with_help (agent user_set_workitem_subscription, user_set_workitem_subscription_name, "Set workitem type subscriptions") register_with_help (agent user_list_workitem_subscription, user_list_workitem_subscription_name, "List workitem type subscriptions") register_with_help (agent user_list_reported_issues, user_list_reported_issues_name, "List reported issues for a user.") register_with_help (agent user_request_friendship, user_request_friendship_name, "Request friendship between two users.") register_with_help (agent user_process_friendship_request, user_process_friendship_request_name, "Process a friendship request.") register_with_help (agent user_remove_friendship, user_remove_friendship_name, "Removes friendship with a user.") register_with_help (agent user_list_friends, user_list_friends_name, "List friends for a user") register_with_help (agent user_send_message, user_send_message_name, "Send a message to a user") register_with_help (agent user_disable_account, user_disable_account_name, "Disable a user account") register_with_help (agent user_list_communities, user_list_communities_name, "List communities for a user.") end feature {NONE} -- Implementation user_my_name_name: STRING is "my_name" user_login_key_name: STRING is "login_key" user_my_password_name: STRING is "my_password" user_my_email_name: STRING is "my_email" user_profile_visible_name: STRING is "profile_visible" user_change_profile_visible_name: STRING is "change_profile_visible" user_retrieve_information_name: STRING is "retrieve_information" user_retrieve_openids_from_user_name: STRING is "retrieve_openids_from_user" user_retrieve_foaf_name: STRING is "retrieve_foaf" user_remove_foaf_name: STRING is "remove_foaf" user_add_foaf_name: STRING is "add_foaf" user_remove_openid_name: STRING is "remove_openid" user_change_openid_name: STRING is "change_openid" user_set_information_name: STRING is "set_information" user_set_icon_name: STRING is "set_icon" user_reset_icon_name: STRING is "reset_icon" user_add_bookmark_name: STRING is "add_bookmark" user_remove_bookmark_name: STRING is "remove_bookmark" user_list_bookmark_name: STRING is "list_bookmark" user_set_workitem_subscription_name: STRING is "set_workitem_subscription" user_list_workitem_subscription_name: STRING is "list_workitem_subscription" user_list_reported_issues_name: STRING is "list_reported_issues" user_request_friendship_name: STRING is "request_friendship" user_process_friendship_request_name: STRING is "process_friendship_request" user_remove_friendship_name: STRING is "remove_friendship" user_list_friends_name: STRING is "list_friends" user_send_message_name: STRING is "send_message" user_disable_account_name: STRING is "disable_account" user_list_communities_name: STRING is "list_communities" end