note description: "API interface to project services." author: "Patrick Ruckstuhl " date: "$Date$" revision: "$Revision$" class PROJECT_SERVICE inherit API_SERVICE O_PROJECT_CONSTANTS create make feature -- Basic operations project_create (a_session, a_name, a_description, a_owner_name: STRING; a_project_type, a_rcs_type, a_project_visibility: INTEGER_REF): BOOLEAN_REF -- Create a new project. local l_msg: O_PROJECT_CREATE_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_project (a_name) then last_fault := err_invalid_name elseif a_description = Void or else a_description.is_empty then last_fault := err_invalid_description elseif a_project_type <= 0 then last_fault := err_invalid_project_type elseif a_rcs_type <= 0 then last_fault := err_invalid_rcs_type elseif a_project_visibility <= 0 then last_fault := err_invalid_visibility_type else -- generate and send message create l_msg.make ( a_session, a_name, a_description, a_owner_name, a_project_type.item, a_rcs_type.item, a_project_visibility.item) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end project_remove (a_session: STRING; a_project_id: INTEGER_REF): BOOLEAN_REF -- Remove project with a_project_id local l_msg: O_PROJECT_REMOVE_MESSAGE do -- argument validation 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_INTEGER_VALUE}.make (a_project_id.item)) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end project_retrieve_id (a_session, a_name: STRING): INTEGER_REF -- Retrieve project id for project. local l_msg: O_PROJECT_RETRIEVE_ID_MESSAGE l_msg_reply: O_PROJECT_RETRIEVE_ID_REPLY_MESSAGE do -- argument validation if not is_valid_session (a_session) then last_fault := err_invalid_session else -- generate and send message create l_msg.make ( create {A_STRING_VALUE}.make (a_session), create {A_STRING_VALUE}.make (a_name)) send_and_wait_for_reply (l_msg) if is_ok then l_msg_reply ?= last_reply check project_iretrieve_id_reply_message: l_msg_reply /= Void end create Result Result.set_item (l_msg_reply.project_id.value.to_integer) end end end project_request_add (a_session, a_name, a_description: STRING; a_project_type, a_rcs_type, a_project_visibility: INTEGER_REF; a_message: STRING): BOOLEAN_REF -- Create a new project request. local l_msg: O_PROJECT_REQUEST_ADD_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_project (a_name) then last_fault := err_invalid_name elseif a_project_type <= 0 then last_fault := err_invalid_project_type elseif a_rcs_type <= 0 then last_fault := err_invalid_rcs_type elseif a_project_visibility <= 0 then last_fault := err_invalid_visibility_type elseif a_description = Void or else a_description.is_empty then last_fault := err_invalid_description elseif a_message = Void then last_fault := err_invalid_message else -- generate and send message create l_msg.make ( a_session, a_name, a_description, a_project_type.item, a_rcs_type.item, a_project_visibility.item, a_message) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end project_list_of_user (a_session: STRING; a_user: STRING): ARRAY [DS_HASH_TABLE [ANY, STRING]] -- List all existing projects. local l_msg: O_PROJECT_LIST_OF_USER_MESSAGE l_reply: O_PROJECT_LIST_OF_USER_REPLY_MESSAGE l_project_map: DS_HASH_TABLE[O_PROJECT_PROJECT_NAME_AND_GID_MESSAGE, A_STRING_VALUE] l_project_map_entry: O_PROJECT_PROJECT_NAME_AND_GID_MESSAGE l_project: DS_HASH_TABLE [ANY, STRING] i: INTEGER l_group_id_ref: INTEGER_REF 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_user.is_empty then last_fault := err_invalid_user else create l_msg.make (create {A_STRING_VALUE}.make (a_session), create {A_STRING_VALUE}.make (a_user)) send_and_wait_for_reply (l_msg) if is_ok then l_reply ?= last_reply check reply_message: l_reply /= Void end l_project_map := l_reply.project_list.map create Result.make (0, l_project_map.count-1) from l_project_map.start i := 0 until l_project_map.after loop l_project_map_entry := l_project_map.item_for_iteration create l_project.make (3) l_project.force (l_project_map_entry.project_name.value, "project_name") create l_group_id_ref l_group_id_ref.set_item (l_project_map_entry.group.value.to_integer) l_project.force (l_group_id_ref, "group_id") create l_project_id_ref l_project_id_ref.set_item (l_project_map.key_for_iteration.value.to_integer) l_project.force (l_project_id_ref, "project_id") Result.force (l_project, i) -- Increment i := i + 1 l_project_map.forth end end end end project_retrieve (a_session: STRING; a_project: INTEGER_REF): DS_HASH_TABLE [ANY, STRING] -- Get project information. local l_msg: O_PROJECT_ID_MESSAGE l_project_reply_msg: O_PROJECT_REPLY_MESSAGE l_pid_ref: INTEGER_REF l_project_type: 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 (create {A_STRING_VALUE}.make (a_session), create {A_INTEGER_VALUE}.make (a_project.item)) send_and_wait_for_reply (l_msg) if is_ok then l_project_reply_msg ?= last_reply check project_reply_message: l_project_reply_msg /= Void end create Result.make (4) create l_pid_ref l_pid_ref.set_item (l_project_reply_msg.project_id.value.to_integer) Result.force (l_pid_ref, "project_id") Result.force (l_project_reply_msg.name.value, "name") Result.force (l_project_reply_msg.logo.value, "logo") create l_project_type l_project_type.set_item (l_project_reply_msg.project_type.value.to_integer_32) Result.force (l_project_type, "project_type") end end end project_retrieve_statistics (a_session: STRING): DS_HASH_TABLE [ANY, STRING] -- Get statistics about projects in Origo local l_msg: O_PROJECT_RETRIEVE_STATISTICS_MESSAGE l_project_statistics_reply_msg: O_PROJECT_RETRIEVE_STATISTICS_REPLY_MESSAGE l_project_count_ref: INTEGER_REF l_os_count_ref: INTEGER_REF l_project_count_ref_hidden: INTEGER_REF l_os_count_ref_hidden: INTEGER_REF l_user_count_ref: INTEGER_REF do -- argument validiation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session else create l_msg.make (create {A_STRING_VALUE}.make (a_session)) send_and_wait_for_reply (l_msg) if is_ok then l_project_statistics_reply_msg ?= last_reply check l_project_statistics_reply_msg: l_project_statistics_reply_msg /= Void end create Result.make (6) create l_project_count_ref l_project_count_ref.set_item (l_project_statistics_reply_msg.project_count.value.to_integer) Result.force (l_project_count_ref, "project_count") create l_os_count_ref l_os_count_ref.set_item (l_project_statistics_reply_msg.open_source_count.value.to_integer) Result.force (l_os_count_ref, "open_source_count") create l_project_count_ref_hidden l_project_count_ref_hidden.set_item (l_project_statistics_reply_msg.project_count_hidden.value.to_integer) Result.force (l_project_count_ref_hidden, "project_count_hidden") create l_os_count_ref_hidden l_os_count_ref_hidden.set_item (l_project_statistics_reply_msg.open_source_count_hidden.value.to_integer) Result.force (l_os_count_ref_hidden, "open_source_count_hidden") create l_user_count_ref l_user_count_ref.set_item (l_project_statistics_reply_msg.user_count.value.to_integer) Result.force (l_user_count_ref, "user_count") Result.force (l_project_statistics_reply_msg.recent_projects.value, "recent_projects") end end end project_request_retrieve (a_session: STRING; a_request_project_name: STRING): DS_HASH_TABLE [ANY, STRING] -- Get project request information. local l_msg: O_PROJECT_REQUEST_RETRIEVE_MESSAGE l_project_reply_msg: O_PROJECT_REQUEST_RETRIEVE_REPLY_MESSAGE l_rid_ref: INTEGER_REF l_project_type: INTEGER_REF l_rcs: INTEGER_REF l_project_visibility: INTEGER_REF 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_project (a_request_project_name) then last_fault := err_invalid_project else create l_msg.make (a_session, a_request_project_name) send_and_wait_for_reply (l_msg) if is_ok then l_project_reply_msg ?= last_reply check project_reply_message: l_project_reply_msg /= Void end create Result.make (9) create l_rid_ref l_rid_ref.set_item (l_project_reply_msg.request_id.value.to_integer) Result.force (l_rid_ref, "request_id") Result.force (l_project_reply_msg.user_name.value, "user_name") Result.force (l_project_reply_msg.user_email.value, "user_email") Result.force (l_project_reply_msg.name.value, "name") Result.force (l_project_reply_msg.description.value, "description") create l_project_type l_project_type.set_item (l_project_reply_msg.project_type.value.to_integer_32) Result.force (l_project_type, "project_type") create l_rcs l_rcs.set_item (l_project_reply_msg.rcs_type.value.to_integer_32) Result.force (l_rcs, "rcs_type") create l_project_visibility l_project_visibility.set_item (l_project_reply_msg.project_visibility.value.to_integer_32) Result.force (l_project_visibility, "project_visibility") Result.force (l_project_reply_msg.message.value, "message") end end end project_members (a_session: STRING; a_project: INTEGER_REF; an_access_group: INTEGER_REF): ARRAY [DS_HASH_TABLE [ANY, STRING]] -- List all users that are in an_access_group for a_project. local l_msg: O_PROJECT_MEMBERS_MESSAGE l_user_list_msg: O_USER_LIST_MESSAGE l_user_map: DS_HASH_TABLE [A_STRING_VALUE, A_STRING_VALUE] l_user: 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_project.item <= 0 then last_fault := err_invalid_project elseif not (an_access_group.item > 0) then last_fault := err_invalid_group else create l_msg.make (a_session, a_project.item, an_access_group.item) send_and_wait_for_reply (l_msg) if is_ok then l_user_list_msg ?= last_reply check user_list_message: l_user_list_msg /= Void end l_user_map := l_user_list_msg.user_list.map create Result.make (0, l_user_map.count-1) from l_user_map.start i := 0 until l_user_map.after loop create l_user.make (1) l_user.force (l_user_map.item_for_iteration.value, "name") Result.force (l_user, i) i := i + 1 l_user_map.forth end end end end project_change_group (a_session: STRING; a_project_id: INTEGER_REF; a_user: STRING; an_access_group: INTEGER_REF): BOOLEAN_REF -- Change access group of a_user in a_project to an_access_group (0=no rights, 3=administrator, 4=developer) local l_msg: O_PROJECT_CHANGE_GROUP_MESSAGE do -- argument validiation check_anonymous_session (a_session) if not is_valid_session (a_session) then last_fault := err_invalid_session elseif a_user.is_empty then last_fault := err_invalid_user elseif a_project_id <= 0 then last_fault := err_invalid_project elseif an_access_group.item < 0 then last_fault := err_invalid_group else -- generate and send message create l_msg.make (a_session, a_project_id.item, a_user, an_access_group.item) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end project_change_description (a_session: STRING; a_project_id: INTEGER_REF; a_description: STRING): BOOLEAN_REF -- Change description of a project. local l_msg: O_PROJECT_CHANGE_DESCRIPTION_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 elseif a_description = Void or else a_description.is_empty then last_fault := err_invalid_description else -- generate and send message create l_msg.make (create {A_STRING_VALUE}.make (a_session), create {A_INTEGER_VALUE}.make (a_project_id.item), create {A_STRING_VALUE}.make (a_description)) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end project_change_logo (a_session: STRING; a_project_id: INTEGER_REF; a_logo: STRING): BOOLEAN_REF -- Change logo of a project. local l_msg: O_PROJECT_CHANGE_LOGO_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 elseif a_logo = Void or else a_logo.is_empty then last_fault := err_invalid_logo else -- generate and send message create l_msg.make (create {A_STRING_VALUE}.make (a_session), create {A_INTEGER_VALUE}.make (a_project_id.item), create {A_STRING_VALUE}.make (a_logo)) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end project_list_bookmarkers (a_session: STRING; a_project: INTEGER_REF): ARRAY [DS_HASH_TABLE [ANY, STRING]] -- List all bookmarkers for a_project. local l_msg: O_PROJECT_LIST_BOOKMARKERS_MESSAGE l_user_list_msg: O_USER_LIST_MESSAGE l_user_map: DS_HASH_TABLE[A_STRING_VALUE, A_STRING_VALUE] l_user: 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_project <= 0 then last_fault := err_invalid_project else create l_msg.make (create {A_STRING_VALUE}.make (a_session), create {A_INTEGER_VALUE}.make (a_project.item)) send_and_wait_for_reply (l_msg) if is_ok then l_user_list_msg ?= last_reply check user_list_message: l_user_list_msg /= Void end l_user_map := l_user_list_msg.user_list.map create Result.make (0, l_user_map.count-1) from l_user_map.start i := 0 until l_user_map.after loop create l_user.make (2) l_user.force (l_user_map.item_for_iteration.value, "name") Result.force (l_user, i) i := i + 1 l_user_map.forth end end end end project_list_communities (a_session: STRING; a_project_id: INTEGER_REF): ARRAY [DS_HASH_TABLE [ANY, STRING]] -- List communities of user a_username. local l_msg: O_PROJECT_LIST_COMMUNITIES_MESSAGE l_reply: O_COMMUNITY_LIST_REPLY_MESSAGE l_communitiy_list: DS_ARRAYED_LIST [A_STRING_VALUE] 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_project_id <= 0 then last_fault := err_invalid_project else create l_msg.make (create {A_STRING_VALUE}.make (a_session), create {A_INTEGER_VALUE}.make (a_project_id.item)) 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.sequence 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.value, "name") Result.force (l_community, i) i := i + 1 l_communitiy_list.forth end end end end project_change_settings (a_session: STRING; a_project_id: INTEGER_REF; a_settings: ARRAY [ANY]): BOOLEAN_REF -- Set new settings for project with id project_id. local l_msg: O_PROJECT_CHANGE_SETTINGS_MESSAGE -- l_settings: ARRAYED_LIST [TUPLE [setting_type: STRING; setting_value: STRING]] l_settings: DS_ARRAYED_LIST[O_PROJECT_SETTING_MESSAGE] -- l_tuple: TUPLE [setting_type: STRING; setting_value: STRING] l_setting: DS_HASH_TABLE [ANY, STRING] l_setting_type: STRING l_setting_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_project_id <= 0 then last_fault := err_invalid_project elseif a_settings = Void or else a_settings.is_empty then last_fault := err_invalid_information else 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_setting else l_setting_type := l_setting.item ("setting_type").out l_setting_value := l_setting.item ("setting_value").out l_setting_value.left_adjust l_setting_value.right_adjust l_setting_type.left_adjust l_setting_type.right_adjust if l_setting_type.is_equal ("svn_path_doc") then if l_setting_value.is_equal ("/") or l_setting_value.count > 255 then last_fault := err_invalid_settings end elseif l_setting_type.is_equal ("logo") then if l_setting_value.count > 255 then last_fault := err_invalid_settings end elseif l_setting_type.is_equal ("project_pretty_name") then if l_setting_value.count > 50 then last_fault := err_invalid_settings end else -- invalid argument. last_fault := err_invalid_settings end l_settings.force ( create {O_PROJECT_SETTING_MESSAGE}.make ( create {A_STRING_VALUE}.make (l_setting_type), create {A_STRING_VALUE}.make (l_setting_value)) , i) end i := i + 1 end if last_fault = Void then create l_msg.make ( create {A_STRING_VALUE}.make (a_session), create {A_INTEGER_VALUE}.make (a_project_id.item), create {A_SEQUENCE_VALUE[O_PROJECT_SETTING_MESSAGE]}.make (l_settings)) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end end project_retrieve_settings (a_session: STRING; a_project_id: INTEGER_REF): DS_HASH_TABLE [ANY, STRING] -- Retrieve project settings of project with a_project_id. local l_msg: O_PROJECT_RETRIEVE_SETTINGS_MESSAGE l_project_settings_reply_msg: O_PROJECT_RETRIEVE_SETTINGS_REPLY_MESSAGE l_project_type: INTEGER_REF l_rcs_type: INTEGER_REF l_project_visibility: 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_id = Void or else a_project_id.item.is_equal (0) then last_fault := err_invalid_name else -- generate and send message create l_msg.make (create {A_STRING_VALUE}.make (a_session), create {A_INTEGER_VALUE}.make (a_project_id.item)) send_and_wait_for_reply (l_msg) if is_ok then l_project_settings_reply_msg ?= last_reply check l_project_settings_reply_msg: l_project_settings_reply_msg /= Void end create Result.make (9) Result.force (l_project_settings_reply_msg.project_id.value.out, "project_id") Result.force (l_project_settings_reply_msg.name.value, "name") Result.force (l_project_settings_reply_msg.logo.value, "logo") create l_project_type l_project_type.set_item (l_project_settings_reply_msg.project_type.value.to_integer_32) Result.force (l_project_type, "project_type") create l_rcs_type l_rcs_type.set_item (l_project_settings_reply_msg.rcs_type.value.to_integer_32) Result.force (l_rcs_type, "rcs_type") create l_project_visibility l_project_visibility.set_item (l_project_settings_reply_msg.project_visibility.value.to_integer_32) Result.force (l_project_visibility, "project_visibility") Result.force (l_project_settings_reply_msg.svn_path_doc.value, "svn_path_doc") Result.force (l_project_settings_reply_msg.project_pretty_name.value, "project_pretty_name") Result.force (l_project_settings_reply_msg.creation_time.value.out, "creation_time") end end end project_change_information (a_session: STRING; a_project_id: INTEGER_REF; a_information: ARRAY [ANY]): BOOLEAN_REF -- Set new information for project with id project_id. local l_msg: O_PROJECT_CHANGE_INFORMATION_MESSAGE l_information_list: DS_ARRAYED_LIST[O_PROJECT_INFORMATION_MESSAGE] 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_project_id <= 0 then last_fault := err_invalid_project elseif a_information = Void or else a_information.is_empty then last_fault := err_invalid_information else from i := 1 create l_information_list.make (a_information.count) until i > a_information.count loop l_information ?= a_information.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 l_information_value.left_adjust l_information_value.right_adjust l_information_type.left_adjust l_information_type.right_adjust if l_information_type.is_equal ("description") then -- description must fit in MEDIUMTEXT if l_information_value.count > 16777216 then last_fault := err_invalid_information end elseif l_information_type.is_equal ("short_description") or l_information_type.is_equal ("operating_system") or l_information_type.is_equal ("programming_language") or l_information_type.is_equal ("category") or l_information_type.is_equal ("license") then if l_information_value.count > 255 then last_fault := err_invalid_information end else last_fault := err_invalid_information end l_information_list.force (create {O_PROJECT_INFORMATION_MESSAGE}.make ( create {A_STRING_VALUE}.make (l_information_type), create {A_STRING_VALUE}.make (l_information_value)), i) end i := i + 1 end if last_fault = Void then create l_msg.make ( create {A_STRING_VALUE}.make (a_session), create {A_INTEGER_VALUE}.make (a_project_id.item), create {A_SEQUENCE_VALUE[O_PROJECT_INFORMATION_MESSAGE]}.make (l_information_list)) send_and_wait_for_reply (l_msg) if is_ok then create Result Result.set_item (True) end end end end project_retrieve_information (a_session: STRING; a_project_id: INTEGER_REF): DS_HASH_TABLE [ANY, STRING] -- Retrieve project information of project with a_project_id. local l_msg: O_PROJECT_RETRIEVE_INFORMATION_MESSAGE l_project_information_reply_msg: O_PROJECT_RETRIEVE_INFORMATION_REPLY_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 = Void or else a_project_id.item.is_equal (0) then last_fault := err_invalid_name else -- generate and send message create l_msg.make (create {A_STRING_VALUE}.make (a_session), create {A_INTEGER_VALUE}.make (a_project_id.item)) send_and_wait_for_reply (l_msg) if is_ok then l_project_information_reply_msg ?= last_reply check l_project_information_reply_msg: l_project_information_reply_msg /= Void end create Result.make (2) -- Result.force (a_project_id, "project_id") Result.force (l_project_information_reply_msg.project_id.value.out, "project_id") Result.force (l_project_information_reply_msg.short_description.value, "short_description") Result.force (l_project_information_reply_msg.description.value, "description") Result.force (l_project_information_reply_msg.programming_language.value, "programming_language") Result.force (l_project_information_reply_msg.operating_system.value, "operating_system") Result.force (l_project_information_reply_msg.license.value, "license") Result.force (l_project_information_reply_msg.category.value, "category") 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 (project_create_name) then create {TUPLE [STRING, STRING, STRING, STRING, INTEGER_REF, INTEGER_REF, INTEGER_REF]}Result elseif a_name.is_equal (project_remove_name) then create {TUPLE [STRING, INTEGER_REF]}Result elseif a_name.is_equal (project_retrieve_id_name) then create {TUPLE [STRING, STRING]}Result elseif a_name.is_equal (project_request_add_name) then create {TUPLE [STRING, STRING, STRING, INTEGER_REF, INTEGER_REF, INTEGER_REF, STRING]}Result elseif a_name.is_equal (project_retrieve_name) then create {TUPLE [STRING, INTEGER_REF]}Result elseif a_name.is_equal (project_retrieve_statistics_name) then create {TUPLE [STRING]}Result elseif a_name.is_equal (project_request_retrieve_name) then create {TUPLE [STRING, STRING]}Result elseif a_name.is_equal (project_list_of_user_name) then create {TUPLE [STRING, STRING]}Result elseif a_name.is_equal (project_members_name) then create {TUPLE [STRING, INTEGER_REF, INTEGER_REF]}Result elseif a_name.is_equal (project_change_group_name) then create {TUPLE [STRING, INTEGER_REF, STRING, INTEGER_REF]}Result elseif a_name.is_equal (project_change_description_name) then create {TUPLE [STRING, INTEGER_REF, STRING]}Result elseif a_name.is_equal (project_change_logo_name) then create {TUPLE [STRING, INTEGER_REF, STRING]}Result elseif a_name.is_equal (project_list_bookmarkers_name) then create {TUPLE [STRING, INTEGER_REF]}Result elseif a_name.is_equal (project_list_communities_name) then create {TUPLE [STRING, INTEGER_REF]}Result elseif a_name.is_equal (project_change_settings_name) then create {TUPLE [STRING, INTEGER_REF, ARRAY [ANY]]}Result elseif a_name.is_equal (project_retrieve_settings_name) then create {TUPLE [STRING, INTEGER_REF]}Result elseif a_name.is_equal (project_change_information_name) then create {TUPLE [STRING, INTEGER_REF, ARRAY [ANY]]}Result elseif a_name.is_equal (project_retrieve_information_name) then create {TUPLE [STRING, INTEGER_REF]}Result end end feature -- Initialisation self_register -- Register all actions for this service do register_with_help (agent project_create, project_create_name, "Create a new project. (needs project_create permission)") register_with_help (agent project_remove, project_remove_name, "Remove a project. (needs project_remove permission)") register_with_help (agent project_retrieve_id, project_retrieve_id_name, "Retrieve project id for project. (needs project_list permission)") register_with_help (agent project_request_add, project_request_add_name, "Add a new project request. (needs project_request_add permission)") register_with_help (agent project_retrieve, project_retrieve_name, "Retrieve a project.") register_with_help (agent project_retrieve_statistics, project_retrieve_statistics_name, "Retrieve Origo-wide project statistics") register_with_help (agent project_request_retrieve, project_request_retrieve_name, "Retrieve a project request.") register_with_help (agent project_list_of_user, project_list_of_user_name, "List all projects of which a_user is developer or owner. group_id 3 is a project owner and 4 is project developer. (needs project_list_of_user permission)") register_with_help (agent project_members, project_members_name, "List project members with a certain access group. access_group 3 is project owner and 4 is project developer. (needs project_members_list permission)") register_with_help (agent project_change_group, project_change_group_name, "Change access group of user in project to access_group (0=no rights, 3=administrator, 4=developer).") register_with_help (agent project_change_description, project_change_description_name, "Change description of a project.") register_with_help (agent project_change_logo, project_change_logo_name, "Change logo of a project.") register_with_help (agent project_list_bookmarkers, project_list_bookmarkers_name, "List all bookmarkers of a project.") register_with_help (agent project_list_communities, project_list_communities_name, "List all communities associated with a project.") register_with_help (agent project_change_settings, project_change_settings_name, "Change the project settings.") register_with_help (agent project_retrieve_settings, project_retrieve_settings_name, "Retrieve project settings.") register_with_help (agent project_change_information, project_change_information_name, "Change the project information.") register_with_help (agent project_retrieve_information, project_retrieve_information_name, "Retrieve project information.") end feature {NONE} -- Implementation project_create_name: STRING = "add" project_remove_name: STRING = "remove" project_retrieve_id_name: STRING = "retrieve_id" project_request_add_name: STRING = "request_add" project_retrieve_name: STRING = "retrieve" project_retrieve_statistics_name: STRING = "retrieve_statistics" project_request_retrieve_name: STRING = "request_retrieve" project_members_name: STRING = "members" project_change_group_name: STRING = "change_group" project_list_of_user_name: STRING = "list_of_user" project_change_description_name: STRING = "change_description" project_change_logo_name: STRING = "change_logo" project_list_bookmarkers_name: STRING = "list_bookmarkers" project_list_communities_name: STRING = "list_communities" project_change_settings_name: STRING = "change_settings" project_retrieve_settings_name: STRING = "retrieve_settings" project_change_information_name: STRING = "change_information" project_retrieve_information_name: STRING = "retrieve_information" end