apm-xml-procs.tcl

Functions that APM uses to parse and generate XML.

Location:
packages/acs-tcl/tcl/apm-xml-procs.tcl
Created:
Fri Oct 6 21:47:39 2000
Authors:
Bryan Quinn <bquinn@arsdigita.com>
Ben Adida <ben@mit.edu>
Bart Teeuwisse <bart.teeuwisse@thecodemill.biz>
CVS Identification:
$Id: apm-xml-procs.tcl,v 1.35 2024/09/11 06:15:48 gustafn Exp $

Procedures in this file

Detailed information

apm_attribute_value (public)

 apm_attribute_value [ -default default ] element attribute

Parses the XML element to return the value for the specified attribute.

Switches:
-default (optional)
Parameters:
element (required)
attribute (required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_apm__test_info_file apm__test_info_file (test acs-tcl) apm_attribute_value apm_attribute_value test_apm__test_info_file->apm_attribute_value xml_node_get_attribute xml_node_get_attribute (public) apm_attribute_value->xml_node_get_attribute apm::process_install_xml apm::process_install_xml (public) apm::process_install_xml->apm_attribute_value apm_get_package_repository apm_get_package_repository (public) apm_get_package_repository->apm_attribute_value apm_read_package_info_file apm_read_package_info_file (public) apm_read_package_info_file->apm_attribute_value apm_required_attribute_value apm_required_attribute_value (public) apm_required_attribute_value->apm_attribute_value install::xml::action::add-subsite-admin install::xml::action::add-subsite-admin (public) install::xml::action::add-subsite-admin->apm_attribute_value

Testcases:
apm__test_info_file

apm_generate_package_spec (public)

 apm_generate_package_spec version_id

Generates an XML-formatted specification for a version of a package.

Parameters:
version_id (required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_apm__test_info_file apm__test_info_file (test acs-tcl) apm_generate_package_spec apm_generate_package_spec test_apm__test_info_file->apm_generate_package_spec apm::package_version::attributes::generate_xml apm::package_version::attributes::generate_xml (private) apm_generate_package_spec->apm::package_version::attributes::generate_xml apm_log apm_log (public) apm_generate_package_spec->apm_log apm_one_package_inherit_order apm_one_package_inherit_order (public) apm_generate_package_spec->apm_one_package_inherit_order db_1row db_1row (public) apm_generate_package_spec->db_1row db_foreach db_foreach (public) apm_generate_package_spec->db_foreach apm_package_install_spec apm_package_install_spec (public) apm_package_install_spec->apm_generate_package_spec packages/acs-admin/www/apm/version-generate-info.tcl packages/acs-admin/ www/apm/version-generate-info.tcl packages/acs-admin/www/apm/version-generate-info.tcl->apm_generate_package_spec

Testcases:
apm__test_info_file

apm_read_package_info_file (public)

 apm_read_package_info_file path

Reads a .info file, returning an array containing the following items:

  • path: a path to the file read
  • mtime: the mtime of the file read
  • provides, embeds, extends, and requires:

    lists of dependency information, containing elements of the form [list $url $version]

  • owners: a list of owners containing elements of the form [list $url $name]
  • files: a list of files in the package, containing elements of the form [list $path $type] NOTE: Files are no longer stored in info files but are always retrieved directly from the filesystem. This element in the array will always be the empty list.
  • callbacks: an array list of callbacks of the package on the form [list callback_type1 proc_name1 callback_type2 proc_name2 ...]
  • Element and attribute values directly from the XML specification: package.key, package.url, package.type package-name, pretty-plural initial-install-p singleton-p auto-mount name (the version name, e.g., 3.3a1), url (the version URL), option, summary, description, release-date, vendor, group, vendor.url, and description.format, maturity, maturity_text.
This routine will typically be called like so:
array set version_properties [apm_read_package_info_file $path]
to populate the version_properties array.

If the .info file cannot be read or parsed, this routine throws a descriptive error.

Parameters:
path (required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_apm__test_info_file apm__test_info_file (test acs-tcl) apm_read_package_info_file apm_read_package_info_file test_apm__test_info_file->apm_read_package_info_file test_files__check_info_files files__check_info_files (test acs-tcl) test_files__check_info_files->apm_read_package_info_file aa_test_running_p aa_test_running_p (public) apm_read_package_info_file->aa_test_running_p ad_file ad_file (public) apm_read_package_info_file->ad_file apm::package_version::attributes::maturity_int_to_text apm::package_version::attributes::maturity_int_to_text (public) apm_read_package_info_file->apm::package_version::attributes::maturity_int_to_text apm::package_version::attributes::parse_xml apm::package_version::attributes::parse_xml (private) apm_read_package_info_file->apm::package_version::attributes::parse_xml apm_attribute_value apm_attribute_value (public) apm_read_package_info_file->apm_attribute_value ad_core_docs_uninstalled_packages_internal ad_core_docs_uninstalled_packages_internal (private) ad_core_docs_uninstalled_packages_internal->apm_read_package_info_file apm::package_version::attributes::set_all_instances_names apm::package_version::attributes::set_all_instances_names (private) apm::package_version::attributes::set_all_instances_names->apm_read_package_info_file apm_build_repository apm_build_repository (private) apm_build_repository->apm_read_package_info_file apm_dependency_check apm_dependency_check (private) apm_dependency_check->apm_read_package_info_file apm_get_package_repository apm_get_package_repository (public) apm_get_package_repository->apm_read_package_info_file

Testcases:
apm__test_info_file, files__check_info_files

apm_required_attribute_value (public)

 apm_required_attribute_value element attribute

Returns an attribute of an XML element, throwing an error if the attribute is not set.

Parameters:
element (required)
attribute (required)

Partial Call Graph (max 5 caller/called nodes):
%3 apm::process_install_xml apm::process_install_xml (public) apm_required_attribute_value apm_required_attribute_value apm::process_install_xml->apm_required_attribute_value apm_read_package_info_file apm_read_package_info_file (public) apm_read_package_info_file->apm_required_attribute_value install::xml::action::call-tcl-proc install::xml::action::call-tcl-proc (private) install::xml::action::call-tcl-proc->apm_required_attribute_value install::xml::action::create-package install::xml::action::create-package (public) install::xml::action::create-package->apm_required_attribute_value install::xml::action::create-user install::xml::action::create-user (public) install::xml::action::create-user->apm_required_attribute_value apm_attribute_value apm_attribute_value (public) apm_required_attribute_value->apm_attribute_value xml_node_get_name xml_node_get_name (public) apm_required_attribute_value->xml_node_get_name

Testcases:
No testcase defined.

apm_tag_value (private)

 apm_tag_value [ -default default ] root property_name

Parses the XML element and returns the associated property name if it exists.

Switches:
-default (optional)
Parameters:
root (required)
property_name (required)

Partial Call Graph (max 5 caller/called nodes):
%3 apm_read_package_info_file apm_read_package_info_file (public) apm_tag_value apm_tag_value apm_read_package_info_file->apm_tag_value xml_node_get_content xml_node_get_content (public) apm_tag_value->xml_node_get_content xml_node_get_first_child_by_name xml_node_get_first_child_by_name (public) apm_tag_value->xml_node_get_first_child_by_name

Testcases:
No testcase defined.
[ show source ]