application_group::group_id_from_package_id (public)

 application_group::group_id_from_package_id [ -no_complain ] \
    [ -package_id package_id ]

Defined in packages/acs-subsite/tcl/application-group-procs.tcl

Get the application_group of a package. By default, if no application group exists, we throw an error. The -no_complain flag will prevent the error from being thrown, in which case you'll just get an empty string if the application group doesn't exist.

Switches:
-no_complain (optional, boolean)
-package_id (optional)

Testcases:
acs_subsite_expose_bug_1144, subsite_api, test_inheritance_and_custom_permissions
Source code:

    if { [ns_conn isconnected] && $package_id eq "" } {
        set package_id [ad_conn package_id]
    }

    if {$package_id eq ""} {
        error "application_group::group_id_from_package_id - no package_id specified."
    }

    set group_id [db_string application_group_from_package_id_query {
        select group_id
        from application_groups
        where package_id = :package_id
    } -default ""]

    if {!$no_complain_p && $group_id eq ""} {
        error "No group_id found for package $package_id ([acs_object_name $package_id])"
    }

    return $group_id
XQL Not present:
Generic
PostgreSQL XQL file:
packages/acs-subsite/tcl/application-group-procs-postgresql.xql

Oracle XQL file:
packages/acs-subsite/tcl/application-group-procs-oracle.xql

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