lang::catalog::last_sync_messages (private)

 lang::catalog::last_sync_messages -package_key package_key \
    -locale locale

Defined in packages/acs-lang/tcl/lang-catalog-procs.tcl

For a certain package, and locale, return the messages in the database the last time catalog files and db were in sync. This is the message that we use as merge base during message catalog upgrades.

Switches:
-package_key (required)
-locale (required)
Returns:
An array list with message keys as keys and messages as values.
Author:
Peter Marklund

Partial Call Graph (max 5 caller/called nodes):
%3 lang::catalog::import_messages lang::catalog::import_messages (private) lang::catalog::last_sync_messages lang::catalog::last_sync_messages lang::catalog::import_messages->lang::catalog::last_sync_messages db_foreach db_foreach (public) lang::catalog::last_sync_messages->db_foreach

Testcases:
No testcase defined.
Source code:
    set message_list [list]
    db_foreach last_sync_messages {} {
        if { ![string is true -strict $deleted_p] } {
            lappend message_list $message_key $message
        }
    }

    return $message_list
Generic XQL file:
packages/acs-lang/tcl/lang-catalog-procs.xql

PostgreSQL XQL file:
<fullquery name="lang::catalog::last_sync_messages.last_sync_messages">
    <querytext>
        select message_key,
               message,
               deleted_p
        from   lang_messages
        where  package_key = :package_key
        and    locale = :locale
        and    sync_time is not null
        union
        select lma1.message_key,
               lma1.old_message,
               lma1.deleted_p
        from   lang_messages_audit lma1
        where  lma1.package_key = :package_key
        and    lma1.locale = :locale
        and    lma1.sync_time is not null
        and    lma1.audit_id = (select max(lma2.audit_id)
                                      from lang_messages_audit lma2
                                      where lma2.package_key = lma1.package_key
                                        and lma2.message_key = lma1.message_key
                                        and lma2.locale = :locale
                                        and lma2.sync_time is not null
                                      )
        and    not exists (select 1
                           from lang_messages
                           where package_key = lma1.package_key
                             and message_key = lma1.message_key
                             and locale = :locale
                             and sync_time is not null
                           )
    </querytext>
</fullquery>
packages/acs-lang/tcl/lang-catalog-procs-postgresql.xql

Oracle XQL file:
<fullquery name="lang::catalog::last_sync_messages.last_sync_messages">
    <querytext>
        select message_key,
               dbms_lob.substr(message) as message,
               deleted_p
        from   lang_messages
        where  package_key = :package_key
        and    locale = :locale
        and    sync_time is not null
        union
        select lma1.message_key,
               dbms_lob.substr(lma1.old_message) as message,
               lma1.deleted_p
        from   lang_messages_audit lma1
        where  lma1.package_key = :package_key
        and    lma1.locale = :locale
        and    lma1.sync_time is not null
        and    lma1.audit_id = (select max(lma2.audit_id)
                                      from lang_messages_audit lma2
                                      where lma2.package_key = lma1.package_key
                                        and lma2.message_key = lma1.message_key
                                        and lma2.locale = :locale
                                        and lma2.sync_time is not null
                                      )
        and    not exists (select 1
                           from lang_messages
                           where package_key = lma1.package_key
                             and message_key = lma1.message_key
                             and locale = :locale
                             and sync_time is not null
                           )
    </querytext>
</fullquery>
packages/acs-lang/tcl/lang-catalog-procs-oracle.xql

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