• Publicity: Public Only All

extra-args-procs.tcl

Handle extra arguments not defined in service contract. Preliminary support for package_ids and object_type as an example

Location:
packages/search/tcl/extra-args-procs.tcl
Created:
2009-03-13
Author:
Dave Bauer <dave@thedesignexperience.org>
CVS Identification:
$Id: extra-args-procs.tcl,v 1.2.2.2 2022/01/27 09:23:59 antoniop Exp $

Procedures in this file

Detailed information

[ hide source ] | [ make this the default ]

Content File Source



ad_library {
    
    Handle extra arguments not defined in service contract.
    Preliminary support for package_ids and object_type as an example
    
    @author Dave Bauer (dave@thedesignexperience.org)
    @creation-date 2009-03-13
    @cvs-id $Id: extra-args-procs.tcl,v 1.2.2.2 2022/01/27 09:23:59 antoniop Exp $
}

d_proc -callback search::extra_arg -impl object_type {
    -value
    -object_table_alias
} {
    Implement per object type search
} {
    if {$object_table_alias eq "" || ![info exists object_table_alias] || $value eq ""} {
        return [list]
    }
    return [list from_clause {} where_clause "$object_table_alias.object_type = [ns_dbquotevalue $value]"]

}

d_proc -callback search::extra_arg -impl package_ids {
    -value
    -object_table_alias
} {
    Implement per package_id search
} {
    if {$object_table_alias eq "" || ![info exists object_table_alias] || $value eq ""} {
        return [list]
    }
    return [list from_clause {} where_clause "$object_table_alias.package_id in ([ns_dbquotelist $value])"]
}
# Local variables:
#    mode: tcl
#    tcl-indent-level: 4
#    indent-tabs-mode: nil
# End: