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
document
parameters

Partial Call Graph (max 5 caller/called nodes):
%3 test_auth_sync_process_ims_implementations auth_sync_process_ims_implementations (test acs-authentication) auth::sync::process_doc::ims::ProcessDocument auth::sync::process_doc::ims::ProcessDocument test_auth_sync_process_ims_implementations->auth::sync::process_doc::ims::ProcessDocument auth::sync::job::action auth::sync::job::action (public) auth::sync::process_doc::ims::ProcessDocument->auth::sync::job::action xml_doc_get_first_node xml_doc_get_first_node (public) auth::sync::process_doc::ims::ProcessDocument->xml_doc_get_first_node xml_get_child_node_content_by_path xml_get_child_node_content_by_path (public) auth::sync::process_doc::ims::ProcessDocument->xml_get_child_node_content_by_path xml_node_get_attribute xml_node_get_attribute (public) auth::sync::process_doc::ims::ProcessDocument->xml_node_get_attribute xml_node_get_children_by_name xml_node_get_children_by_name (public) auth::sync::process_doc::ims::ProcessDocument->xml_node_get_children_by_name AcsSc.auth_sync_process.processdocument.ims_enterprise_v_1p1 AcsSc.auth_sync_process.processdocument.ims_enterprise_v_1p1 (private) AcsSc.auth_sync_process.processdocument.ims_enterprise_v_1p1->auth::sync::process_doc::ims::ProcessDocument auth::sync::process_doc::ims::register_impl auth::sync::process_doc::ims::register_impl (private) auth::sync::process_doc::ims::register_impl->auth::sync::process_doc::ims::ProcessDocument

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" } {
        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
    }
Generic 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

[ hide source ] | [ make this the default ]
Show another procedure: