acs_sc::impl::get_options (public)

 acs_sc::impl::get_options -contract_name contract_name \
    [ -exclude_names exclude_names ] [ -empty_label empty_label ]

Defined in packages/acs-service-contract/tcl/implementation-procs.tcl

Get a list of service contract implementation options for an HTML multiple choice widget.

Switches:
-contract_name (required)
The name of the service contract to return options for.
-exclude_names (optional)
A list of implementation names to exclude
-empty_label (optional, defaults to "-")
If provided an option with id empty string and the provided label will be added.
Returns:
A list of lists with the inner lists having label in first element and id in second.
Author:
Peter Marklund

Partial Call Graph (max 5 caller/called nodes):
%3 test_acs_sc_impl_new_from_spec acs_sc_impl_new_from_spec (test acs-service-contract) acs_sc::impl::get_options acs_sc::impl::get_options test_acs_sc_impl_new_from_spec->acs_sc::impl::get_options db_list_of_lists db_list_of_lists (public) acs_sc::impl::get_options->db_list_of_lists packages/acs-admin/www/auth/authority.tcl packages/acs-admin/ www/auth/authority.tcl packages/acs-admin/www/auth/authority.tcl->acs_sc::impl::get_options

Testcases:
acs_sc_impl_new_from_spec
Source code:
    set full_list [db_list_of_lists select_impl_options {
        select case when impl_pretty_name is not null then impl_pretty_name else impl_name end as impl_name,
               impl_id
        from acs_sc_impls
        where impl_contract_name = :contract_name
    }]

    set impl_list [list]

    if { $empty_label ne "" } {
        lappend impl_list [list $empty_label ""]
    }

    if { [llength $exclude_names] > 0 } {
        # There are exclude names
        foreach element $full_list {
            set impl_name [lindex $element 0]
            if {$impl_name ni $exclude_names} {
                # Name is not in exclude list so add option
                lappend impl_list $element
            }
        }
    } else {
        # No exclude names, use all options
        lappend impl_list {*}$full_list
    }

    return $impl_list
Generic XQL file:
packages/acs-service-contract/tcl/implementation-procs.xql

PostgreSQL XQL file:
packages/acs-service-contract/tcl/implementation-procs-postgresql.xql

Oracle XQL file:
packages/acs-service-contract/tcl/implementation-procs-oracle.xql

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