auth::sync::process_doc::ims::ProcessDocument (private)
auth::sync::process_doc::ims::ProcessDocument job_id document \ parameters
Defined in packages/acs-authentication/tcl/sync-procs.tcl
Process IMS Enterprise 1.1 document.
- Parameters:
- job_id (required)
- document (required)
- parameters (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- auth_sync_process_ims_implementations
Source code: set tree [xml_parse -persist $document] set root_node [xml_doc_get_first_node $tree] if { [xml_node_get_name $root_node] ne "enterprise" } { $tree delete error "Root node was not <enterprise>" } # Loop over <person> records foreach person_node [xml_node_get_children_by_name $root_node "person"] { switch [xml_node_get_attribute $person_node "recstatus"] { 1 { set operation "insert" } 2 { set operation "update" } 3 { set operation "delete" } default { set operation "snapshot" } } # Initialize this record array unset user_info set username [xml_get_child_node_content_by_path $person_node { { userid } { sourcedid id } }] set user_info(email) [xml_get_child_node_content_by_path $person_node { { email } }] set user_info(url) [xml_get_child_node_content_by_path $person_node { { url } }] # We need a little more logic to deal with first_names/last_name, since they may not be split up in the XML set user_info(first_names) [xml_get_child_node_content_by_path $person_node { { name n given } }] set user_info(last_name) [xml_get_child_node_content_by_path $person_node { { name n family } }] if { $user_info(first_names) eq "" || $user_info(last_name) eq "" } { set formatted_name [xml_get_child_node_content_by_path $person_node { { name fn } }] if { $formatted_name ne "" || [string first " " $formatted_name] > -1 } { # Split, so everything up to the last space goes to first_names, the rest to last_name regexp {^(.+) ([^ ]+)$} $formatted_name match user_info(first_names) user_info(last_name) } } auth::sync::job::action -job_id $job_id -operation $operation -username $username -array user_info } $tree deleteGeneric XQL file: packages/acs-authentication/tcl/sync-procs.xql
PostgreSQL XQL file: packages/acs-authentication/tcl/sync-procs-postgresql.xql
Oracle XQL file: packages/acs-authentication/tcl/sync-procs-oracle.xql