highcharts::resource_info (public)

 highcharts::resource_info [ -version version ]

Defined in packages/highcharts/tcl/resource-procs.tcl

Get information about available version(s) of Highcharts, from the local filesystem, or from CDN.

Switches:
-version (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 highcharts::download highcharts::download (private) highcharts::resource_info highcharts::resource_info highcharts::download->highcharts::resource_info packages/highcharts/www/sitewide-admin/index.tcl packages/highcharts/ www/sitewide-admin/index.tcl packages/highcharts/www/sitewide-admin/index.tcl->highcharts::resource_info acs_package_root_dir acs_package_root_dir (public) highcharts::resource_info->acs_package_root_dir parameter::get_global_value parameter::get_global_value (public) highcharts::resource_info->parameter::get_global_value

Testcases:
No testcase defined.
Source code:
        variable parameter_info
        #
        # If no version is specified, use the configured value.
        #
        if {$version eq ""} {
             dict with parameter_info {
                 set version [::parameter::get_global_value  -package_key $package_key  -parameter $parameter_name  -default $default_value]
             }
        }

        #
        # Setup variables for access via CDN vs. local resources.
        #
        set resourceDir [acs_package_root_dir highcharts/www/resources]
        set cdnHost     cdnjs.cloudflare.com
        set cdn         //$cdnHost/

        if {[file exists $resourceDir/$version]} {
            #
            # Local version is installed
            #
            set prefix /resources/highcharts/$version/code
            set cdnHost ""
            set cspMap ""
            dict set URNs urn:ad:js:highcharts highcharts.js
            dict set URNs urn:ad:js:highcharts-more highcharts-more.js
            dict set URNs urn:ad:js:highcharts/modules/exporting modules/exporting.js
            dict set URNs urn:ad:js:highcharts/modules/accessibility modules/accessibility.js

        } else {
            #
            # Use CDN
            #
            set prefix ${cdn}ajax/libs/highcharts/$version
            #
            # Use minified versions from CDN
            #
            dict set URNs urn:ad:js:highcharts highcharts.min.js
            dict set URNs urn:ad:js:highcharts-more highcharts-more.min.js
            dict set URNs urn:ad:js:highcharts/modules/exporting modules/exporting.min.js
            dict set URNs urn:ad:js:highcharts/modules/accessibility modules/accessibility.min.js
            
            dict set cspMap urn:ad:js:highcharts script-src $cdnHost
        }

        #
        # Return the dict with at least the required fields
        #
        lappend result  resourceName "Highcharts"  resourceDir $resourceDir  cdn $cdn  cdnHost $cdnHost  prefix $prefix  cssFiles {}  jsFiles  {}  extraFiles {}  downloadURLs [subst {
                https://code.highcharts.com/zips/Highcharts-$version.zip
            }]  cspMap $cspMap  urnMap $URNs  versionCheckAPI {cdn cdnjs library highcharts count 5}  vulnerabilityCheck {service snyk library highcharts}  parameterInfo $parameter_info  configuredVersion $version

        return $result
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: