richtext::ckeditor4::download (private)

 richtext::ckeditor4::download [ -ck_package ck_package ] \
    [ -version version ]

Defined in packages/richtext-ckeditor4/tcl/richtext-procs.tcl

Download the CKeditor package in the specified version and put it into a directory structure similar to the CDN structure to allow installation of multiple versions. When the local structure is available, it will be used by initialize_widget. Notice, that for this automated download, the "unzip" program must be installed and $::acs::rootdir/packages/www must be writable by the web server.

Switches:
-ck_package
(optional)
-version
(optional)

Partial Call Graph (max 5 caller/called nodes):
%3 packages/richtext-ckeditor4/www/sitewide-admin/download.tcl packages/richtext-ckeditor4/ www/sitewide-admin/download.tcl richtext::ckeditor4::download richtext::ckeditor4::download packages/richtext-ckeditor4/www/sitewide-admin/download.tcl->richtext::ckeditor4::download packages/richtext-ckeditor5/www/sitewide-admin/download.tcl packages/richtext-ckeditor5/ www/sitewide-admin/download.tcl packages/richtext-ckeditor5/www/sitewide-admin/download.tcl->richtext::ckeditor4::download richtext::ckeditor4::resource_info richtext::ckeditor4::resource_info (public) richtext::ckeditor4::download->richtext::ckeditor4::resource_info util::resources::download util::resources::download (public) richtext::ckeditor4::download->util::resources::download util::unzip util::unzip (public) richtext::ckeditor4::download->util::unzip util::which util::which (public) richtext::ckeditor4::download->util::which

Testcases:
No testcase defined.
Source code:
        #
        # If no version or ck_package are specified, use the
        # namespaced variables as default.
        #
        if {$version eq ""} {
            set version ${::richtext::ckeditor4::version}
        }
        if {$ck_package eq ""} {
            set ck_package ${::richtext::ckeditor4::ck_package}
        }


        set resource_info [::richtext::ckeditor4::resource_info  -ck_package $ck_package  -version $version]

        ::util::resources::download  -resource_info $resource_info  -version_dir $version

        set resourceDir [dict get $resource_info resourceDir]

        #
        # Do we have unzip installed?
        #
        set unzip [::util::which unzip]
        if {$unzip eq ""} {
            error "can't install CKeditor locally; no unzip program found on PATH"
        }

        #
        # Do we have a writable output directory under resourceDir?
        #
        if {![file isdirectory $resourceDir/$version]} {
            file mkdir $resourceDir/$version
        }
        if {![file writable $resourceDir/$version]} {
            error "directory $resourceDir/$version is not writable"
        }

        #
        # So far, everything is fine, unpack the editor package.
        #
        foreach url [dict get $resource_info downloadURLs] {
            set fn [file tail $url]
            util::unzip -overwrite -source $resourceDir/$version/$fn -destination $resourceDir/$version
            file rename --  $resourceDir/$version/ckeditor  $resourceDir/$version/$ck_package
        }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: