download_repository_info (public)

 download_repository_info [ package_id ] [ do_redirect ]

Defined in packages/download/tcl/download-procs.tcl

Get information about the repository mounted for package_id.

Parameters:
package_id (optional)
do_redirect (optional, defaults to "1")

Partial Call Graph (max 5 caller/called nodes):
%3 download_repository_id download_repository_id (public) download_repository_info download_repository_info download_repository_id->download_repository_info packages/download/www/admin/approve-or-reject-2.tcl packages/download/ www/admin/approve-or-reject-2.tcl packages/download/www/admin/approve-or-reject-2.tcl->download_repository_info packages/download/www/admin/index.tcl packages/download/ www/admin/index.tcl packages/download/www/admin/index.tcl->download_repository_info packages/download/www/archive-add.tcl packages/download/ www/archive-add.tcl packages/download/www/archive-add.tcl->download_repository_info packages/download/www/help.tcl packages/download/ www/help.tcl packages/download/www/help.tcl->download_repository_info ad_conn ad_conn (public) download_repository_info->ad_conn ad_return_exception_page ad_return_exception_page (public) download_repository_info->ad_return_exception_page ad_script_abort ad_script_abort (public) download_repository_info->ad_script_abort db_0or1row db_0or1row (public) download_repository_info->db_0or1row db_nextval db_nextval (public) download_repository_info->db_nextval

Testcases:
No testcase defined.
Source code:
    if {$package_id eq ""} {
        set package_id [ad_conn package_id]
    }
    if { ![db_0or1row repository_info {
        select repository_id, title, description, help_text from download_repository_obj where parent_id = :package_id
    } -column_array repository ] } {
        #Package not setup
        if { $do_redirect } {
            set admin_p [permission::permission_p -object_id $package_id -privilege "admin"]
            if { $admin_p } {
                set repository_id [db_nextval acs_object_id_seq]
                set return_url "[ad_conn package_url]admin/repository-types"
                set href [export_vars -base [ad_conn package_url]admin/repository-ae {repository_id return_url}]
                ad_return_exception_page 200 "Not setup" [subst {Please <a href="[ns_quotehtml $href]">configure
                    this instance of the download module</a>.}]
            } else {
                ad_return_exception_page 200 "Not setup" "Please have an admin configure this instance of the download module."
            }
            ad_script_abort
        }
    } else {
        if { $do_redirect } {
            set repository_id $repository(repository_id)
            set count [db_string type_info {
                select count(*) from download_archive_types where repository_id = :repository_id
            }]
            if { $count == 0 } {
                set return_url "[ad_conn url]?[ad_conn query]"
                set href [export_vars -base [ad_conn package_url]admin/repository-types {repository_id return_url}]
                ad_return_exception_page 200 "Not setup" [subst {Please <a href="[ns_quotehtml $href]">add a download type</a>.}]
                ad_script_abort
            }
        }
    }
    return [array get repository]
Generic XQL file:
<fullquery name="download_repository_info.repository_info">
    <querytext>

select repository_id, title, description, help_text 
from download_repository_obj 
where parent_id = :package_id

</querytext>
</fullquery>

<fullquery name="download_repository_info.type_info">
    <querytext>

select count(*) from download_archive_types 
where repository_id = :repository_id
            
</querytext>
</fullquery>
packages/download/tcl/download-procs.xql

PostgreSQL XQL file:
packages/download/tcl/download-procs-postgresql.xql

Oracle XQL file:
packages/download/tcl/download-procs-oracle.xql

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