acs_mail_lite::section_id_of (private)

 acs_mail_lite::section_id_of section_ref

Defined in packages/acs-mail-lite/tcl/email-inbound-procs.tcl

Returns section_id representing a section_ref. Section_ref has format of counting numbers separated by dot. Section_id is an integer. First used here by ns_imap body and adopted for general email part refs.

Parameters:
section_ref (required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_acs_mail_lite_inbound_procs_check acs_mail_lite_inbound_procs_check (test acs-mail-lite) acs_mail_lite::section_id_of acs_mail_lite::section_id_of test_acs_mail_lite_inbound_procs_check->acs_mail_lite::section_id_of db_0or1row db_0or1row (public) acs_mail_lite::section_id_of->db_0or1row db_dml db_dml (public) acs_mail_lite::section_id_of->db_dml db_flush_cache db_flush_cache (public) acs_mail_lite::section_id_of->db_flush_cache db_nextval db_nextval (public) acs_mail_lite::section_id_of->db_nextval acs_mail_lite::imap_email_parse acs_mail_lite::imap_email_parse (private) acs_mail_lite::imap_email_parse->acs_mail_lite::section_id_of acs_mail_lite::maildir_email_parse acs_mail_lite::maildir_email_parse (private) acs_mail_lite::maildir_email_parse->acs_mail_lite::section_id_of

Testcases:
acs_mail_lite_inbound_procs_check
Source code:
    set section_id ""
    if { [regexp -- {^[0-9\.]*$} $section_ref ] } {

        if { $section_ref eq "" } {
            set section_id -1
        } else {
            set ckey aml_section_ref_
            append ckey $section_ref
            set exists_p [db_0or1row -cache_key $ckey  acs_mail_lite_ie_section_ref_map_r1 {
                                  select section_id
                                  from acs_mail_lite_ie_section_ref_map
                                  where section_ref=:section_ref
                              } ]
            if { !$exists_p } {
                db_flush_cache -cache_key_pattern $ckey
                set section_id [db_nextval acs_mail_lite_in_id_seq]
                db_dml acs_mail_lite_ie_section_ref_map_c1 {
                    insert into acs_mail_lite_ie_section_ref_map
                    (section_ref,section_id)
                    values (:section_ref,:section_id)
                }
            }
        }
    }
    return $section_id
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-mail-lite/tcl/email-inbound-procs.xql

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