auth::sync::process_doc::ims::GetAcknowledgementDocument (private)

 auth::sync::process_doc::ims::GetAcknowledgementDocument job_id \
    document parameters

Defined in packages/acs-authentication/tcl/sync-procs.tcl

Generates an record-wise acknowledgement document in home-brewed adaptation of the IMS Enterprise v 1.1 spec.

Parameters:
job_id (required)
document (required)
parameters (required)

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::GetAcknowledgementDocument auth::sync::process_doc::ims::GetAcknowledgementDocument test_auth_sync_process_ims_implementations->auth::sync::process_doc::ims::GetAcknowledgementDocument db_foreach db_foreach (public) auth::sync::process_doc::ims::GetAcknowledgementDocument->db_foreach xml_doc_get_first_node xml_doc_get_first_node (public) auth::sync::process_doc::ims::GetAcknowledgementDocument->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::GetAcknowledgementDocument->xml_get_child_node_content_by_path xml_node_get_name xml_node_get_name (public) auth::sync::process_doc::ims::GetAcknowledgementDocument->xml_node_get_name xml_parse xml_parse (public) auth::sync::process_doc::ims::GetAcknowledgementDocument->xml_parse AcsSc.auth_sync_process.getacknowledgementdocument.ims_enterprise_v_1p1 AcsSc.auth_sync_process.getacknowledgementdocument.ims_enterprise_v_1p1 (private) AcsSc.auth_sync_process.getacknowledgementdocument.ims_enterprise_v_1p1->auth::sync::process_doc::ims::GetAcknowledgementDocument 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::GetAcknowledgementDocument

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

    set timestamp [xml_get_child_node_content_by_path $root_node { { properties datetime } }]
    $tree delete

    append doc {<?xml version="1.0" encoding="} [ns_config "ns/parameters" OutputCharset] {"?>} \n
    append doc {<enterprise>} \n
    append doc {  <properties>} \n
    append doc {    <type>acknowledgement</type>} \n
    append doc {    <datetime>} $timestamp {</datetime>} \n
    append doc {  </properties>} \n

    array set recstatus {
        insert 1
        update 2
        delete 3
    }

    # Loop over successful actions
    db_foreach select_success_actions {
        select entry_id,
               operation,
               username
        from   auth_batch_job_entries
        where  job_id = :job_id
        and    success_p = 't'
        order  by entry_id
    } {
        if { [info exists recstatus($operation)] } {
            append doc {  <person recstatus="} $recstatus($operation)  {">} \n
            append doc {    <sourcedid><source>OpenACS</source><id>} $username {</id></sourcedid>} \n
            append doc {  </person>} \n
        } else {
            ns_log Error "Illegal operation encountered in job action log: '$operation'. Entry_id is '$entry_id'."
        }
    }

    append doc {</enterprise>} \n

    return $doc
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: