Index: openacs-4/packages/acs-authentication/tcl/apm-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/apm-callback-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/acs-authentication/tcl/apm-callback-procs.tcl 16 Sep 2003 13:07:42 -0000 1.8 +++ openacs-4/packages/acs-authentication/tcl/apm-callback-procs.tcl 17 Sep 2003 11:26:53 -0000 1.9 @@ -357,7 +357,7 @@ ad_proc -private auth::get_doc::delete_contract {} { Delete service contract for account registration. } { - acs_sc::contract::delete -name "GetDocument" + acs_sc::contract::delete -name "auth_sync_retrieve" } @@ -385,6 +385,20 @@ parameters:string,multiple } } + GetElements { + description { + Get an list of the elements handled by this batch synchronization + (first_names, last_name, username, email, etc). These elements will + not be editable by the user, so as not to risk overwriting the user's + changes with a later synchronization. + } + input { + parameters:string,multiple + } + output { + elements:string,multiple + } + } GetParameters { description { Get an array-list of the parameters required by this service contract implementation. Index: openacs-4/packages/acs-authentication/tcl/sync-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/sync-procs.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/acs-authentication/tcl/sync-procs.tcl 17 Sep 2003 09:45:28 -0000 1.14 +++ openacs-4/packages/acs-authentication/tcl/sync-procs.tcl 17 Sep 2003 11:26:53 -0000 1.15 @@ -514,10 +514,35 @@ -call_args [list $job_id $document $parameters]] } +ad_proc -private auth::sync::GetElements { + {-authority_id:required} +} { + Wrapper for the GetElements operation of the auth_sync_process service contract. +} { + set impl_id [auth::authority::get_element -authority_id $authority_id -element "process_doc_impl_id"] + if { [empty_string_p $impl_id] } { + # No implementation of auth_sync_process + set authority_pretty_name [auth::authority::get_element -authority_id $authority_id -element "pretty_name"] + error "The authority '$authority_pretty_name' doesn't support auth_sync_process" + } + set parameters [auth::driver::get_parameter_values \ + -authority_id $authority_id \ + -impl_id $impl_id] + return [acs_sc::invoke \ + -error \ + -contract "auth_sync_process" \ + -impl_id $impl_id \ + -operation GetElements \ + -call_args [list $parameters]] +} + + + + ##### # # auth::sync::get_doc::http namespace @@ -611,6 +636,7 @@ pretty_name "IMS Enterprise 1.1" aliases { ProcessDocument auth::sync::process_doc::ims::ProcessDocument + GetElements auth::sync::process_doc::ims::GetElements GetParameters auth::sync::process_doc::ims::GetParameters } } @@ -622,7 +648,7 @@ ad_proc -private auth::sync::process_doc::ims::unregister_impl {} { Unregister this implementation } { - acs_sc::impl::delete -contract_name "auth_sync_process" -impl_name "IMS Enterprise 1.1" + acs_sc::impl::delete -contract_name "auth_sync_process" -impl_name "IMS_Enterprise_v_1p1" } ad_proc -private auth::sync::process_doc::ims::GetParameters {} { @@ -631,6 +657,15 @@ return {} } + +ad_proc -private auth::sync::process_doc::ims::GetElements { + parameters +} { + Elements controlled by IMS Enterprise 1.1 auth_sync_process implementation. +} { + return { username email first_names last_name url } +} + ad_proc -private auth::sync::process_doc::ims::ProcessDocument { job_id document Index: openacs-4/packages/acs-authentication/tcl/test/sync-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/test/sync-test-procs.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/acs-authentication/tcl/test/sync-test-procs.tcl 17 Sep 2003 07:07:52 -0000 1.11 +++ openacs-4/packages/acs-authentication/tcl/test/sync-test-procs.tcl 17 Sep 2003 11:26:53 -0000 1.12 @@ -920,6 +920,17 @@ aa_false "member_state not banned" [string equal $user(member_state) "banned"] # Check that first_user_id has had username/email changed + + ##### + # + # Test GetElements + # + ##### + + set elements [auth::sync::GetElements -authority_id $authority_id] + + aa_true "Elements are usernaem, email, first_names, last_name, url" [util_sets_equal_p { username email first_names last_name url } $elements] + } }