apm_get_repository_channels (public)

 apm_get_repository_channels [ repository_url ]

Defined in packages/acs-tcl/tcl/apm-install-procs.tcl

Returns the channels and URLs from a repository

Parameters:
repository_url (optional, defaults to "https://openacs.org/repository/")

Partial Call Graph (max 5 caller/called nodes):
%3 test_apm_respositories_api apm_respositories_api (test acs-tcl) apm_get_repository_channels apm_get_repository_channels test_apm_respositories_api->apm_get_repository_channels dom dom apm_get_repository_channels->dom util::http::get util::http::get (public) apm_get_repository_channels->util::http::get packages/acs-admin/www/install/install.tcl packages/acs-admin/ www/install/install.tcl packages/acs-admin/www/install/install.tcl->apm_get_repository_channels

Testcases:
apm_respositories_api
Source code:
    set result [util::http::get -url $repository_url]
    set status [dict get $result status]
    #ns_log notice "GOT\n$repository_url\n[dict get $result page]"
    if {$status != 200} {
        return -code error "unexpected result code $status from url $repository_url"
    }
    set repositories ""

    dom parse -html -- [dict get $result page] doc
    $doc documentElement root
    foreach node [$root selectNodes {//ul/li/a}] {
        set href [$node getAttribute href]
        if {[regexp {^(\d+[-]\d+)} $href . version]} {
            set name $version
            set tag oacs-$version
            lappend repositories [list $name $tag]
        } else {
            #set txt [string trim [$node asText]]
            #ns_log warning "unexpected href found in repository $repository_url: $txt ($href)"
            #continue
        }
    }
    return $repositories
Generic XQL file:
packages/acs-tcl/tcl/apm-install-procs.xql

PostgreSQL XQL file:
packages/acs-tcl/tcl/apm-install-procs-postgresql.xql

Oracle XQL file:
packages/acs-tcl/tcl/apm-install-procs-oracle.xql

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