Index: openacs-4/packages/acs-tcl/tcl/apm-xml-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-xml-procs.tcl,v diff -u -r1.31 -r1.32 --- openacs-4/packages/acs-tcl/tcl/apm-xml-procs.tcl 27 Oct 2014 16:40:06 -0000 1.31 +++ openacs-4/packages/acs-tcl/tcl/apm-xml-procs.tcl 7 Aug 2017 23:47:59 -0000 1.32 @@ -23,10 +23,9 @@ } ad_proc -private apm_attribute_value { - { - -default "" - } - element attribute } { + {-default ""} + element attribute +} { Parses the XML element to return the value for the specified attribute. @@ -67,44 +66,44 @@ append spec " - - [ad_quotehtml $pretty_name] - [ad_quotehtml $pretty_plural] + + [ns_quotehtml $pretty_name] + [ns_quotehtml $pretty_plural] $initial_install_p $singleton_p $implements_subsite_p $inherit_templates_p ${auto_mount_tag} - \n" + \n" db_foreach owner_info {} { append spec " [ad_quotehtml $owner_name]\n" + append spec ">[ns_quotehtml $owner_name]\n" } apm_log APMDebug "APM: Writing Version summary and description" if { $summary ne "" } { - append spec " [ad_quotehtml $summary]\n" + append spec " [ns_quotehtml $summary]\n" } if { $release_date ne "" } { - append spec " [ad_quotehtml [string range $release_date 0 9]]\n" + append spec " [ns_quotehtml [string range $release_date 0 9]]\n" } if { $vendor ne "" || $vendor_uri ne "" } { append spec " [ad_quotehtml $vendor]\n" + append spec ">[ns_quotehtml $vendor]\n" } if { $description ne "" } { append spec " [ad_quotehtml $description]\n" + append spec ">[ns_quotehtml $description]\n" } append spec [apm::package_version::attributes::generate_xml \ @@ -115,16 +114,16 @@ apm_log APMDebug "APM: Writing Dependencies." db_foreach dependency_info {} { - append spec " <$dependency_type url=\"[ad_quotehtml $service_uri]\" version=\"[ad_quotehtml $service_version]\"/>\n" + append spec " <$dependency_type url=\"[ns_quotehtml $service_uri]\" version=\"[ns_quotehtml $service_version]\"/>\n" } else { append spec " \n" } append spec "\n \n" apm_log APMDebug "APM: Writing callbacks" db_foreach callback_info {} { - append spec " \n" + append spec " \n" } append spec " " append spec "\n \n" @@ -133,20 +132,20 @@ set parent_package_keys [lrange [apm_one_package_inherit_order $package_key] 0 end-1] db_foreach parameter_info {} { - append spec " \n" @@ -202,7 +201,9 @@ vendor, group, vendor.url, and - description.format. + description.format, + maturity, + maturity_text. @@ -236,7 +237,11 @@ set xml_data [read $file] close $file - set tree [xml_parse -persist $xml_data] + if {[catch {set tree [xml_parse -persist $xml_data]} errorMsg]} { + ns_log error "parsing XML file $path lead to error: $errorMsg" + return -code error "file: $path\n$errorMsg" + } + set root_node [xml_doc_get_first_node $tree] apm_log APMDebug "XML: root node is [xml_node_get_name $root_node]" set package $root_node @@ -276,9 +281,11 @@ set properties(url) [apm_required_attribute_value $version url] # Set an entry in the properties array for each of these tags. - foreach property_name { summary description release-date vendor } { + set properties(maturity) "" + foreach property_name { summary description release-date vendor maturity } { set properties($property_name) [apm_tag_value $version $property_name] } + set properties(maturity_text) [apm::package_version::attributes::maturity_int_to_text $properties(maturity)] apm::package_version::attributes::parse_xml \ -parent_node $version \ @@ -420,3 +427,9 @@ return $return_value } + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: