apm_guess_file_type (public)

 apm_guess_file_type package_key path

Defined in packages/acs-bootstrap-installer/tcl/30-apm-load-procs.tcl

Guesses and returns the file type key corresponding to a particular path (or an empty string if none is known). $path should be relative to the package directory (e.g., www/index.tcl) for /packages/bboard/admin-www/index.tcl. We use the following rules:

  1. Files with extension .sql are considered data-model files,
  2. Files with extension .dat are considered SQL data files.
  3. Files with extension .ctl are considered sql data loader control files. or if any path contains the substring upgrade, data-model upgrade files.
  4. Files with extension .sqlj are considered sqlj_code files.
  5. Files with extension .info are considered package specification files.
  6. Files with extension .xql are considered query files.
  7. Files with extension .java are considered java code files.
  8. Files with extension .jar are considered java archive files.
  9. Files with a path component named doc are considered documentation files.
  10. Files with extension .pl or .sh or which have a path component named bin, are considered shell-executable files.
  11. Files with a path component named templates are considered template files.
  12. Files with extension .html or .adp, in the top level of the package, are considered documentation files.
  13. Files with a path component named www or admin-www are considered content-page files.
  14. Files with a path component named lib are considered include_page files.
  15. Files under package-key/tcl ending in -procs(-)+()*.tcl) or -init.tcl are considered Tcl procedure or Tcl initialization files, respectively.
  16. File ending in .tcl are considered Tcl utility script files (normally found only in the bootstrap installer).
  17. Files with extension .xml in the directory catalog are considered message catalog files.
  18. Tcl procs or init files under package-key/tcl in a test directory are of type test_procs and test_init respectively.
Rules are applied in this order (stopping with the first match).

Parameters:
package_key
path

Partial Call Graph (max 5 caller/called nodes):
%3 test_apm_guess_file_type apm_guess_file_type (test acs-bootstrap-installer) apm_guess_file_type apm_guess_file_type test_apm_guess_file_type->apm_guess_file_type ad_file ad_file (public) apm_guess_file_type->ad_file apm_is_catalog_file apm_is_catalog_file (public) apm_guess_file_type->apm_is_catalog_file apm_data_model_scripts_find apm_data_model_scripts_find (public) apm_data_model_scripts_find->apm_guess_file_type apm_file_watchable_p apm_file_watchable_p (public) apm_file_watchable_p->apm_guess_file_type apm_get_package_files apm_get_package_files (public) apm_get_package_files->apm_guess_file_type apm_guess_db_type apm_guess_db_type (public) apm_guess_db_type->apm_guess_file_type apm_load_queries apm_load_queries (private) apm_load_queries->apm_guess_file_type

Testcases:
apm_guess_file_type
[ show source ]
Show another procedure: