richtext::xinha::download (private)

 richtext::xinha::download [ -version version ]

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

Download the Xinha 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:
-version
(optional)

Partial Call Graph (max 5 caller/called nodes):
%3 richtext::xinha::resource_info richtext::xinha::resource_info (public) util::resources::download util::resources::download (public) util::unzip util::unzip (public) util::which util::which (public) richtext::xinha::download richtext::xinha::download richtext::xinha::download->richtext::xinha::resource_info richtext::xinha::download->util::resources::download richtext::xinha::download->util::unzip richtext::xinha::download->util::which

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

        set resource_info [::richtext::xinha::resource_info  -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 Xinha 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
        }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: