• Publicity: Public Only All

06-package-procs.tcl

Definition of a package manager for creating XOTcl package objects

Location:
packages/xotcl-core/tcl/06-package-procs.tcl
Created:
2007-09-24
Author:
Gustaf Neumann <neumann@wu-wien.ac.at>
CVS Identification:
$Id: 06-package-procs.tcl,v 1.41.2.57 2023/03/07 09:48:20 gustafn Exp $

Procedures in this file

Detailed information

xo::Package instproc require_root_folder (public)

 <instance of xo::Package[i]> require_root_folder \
    [ -parent_id parent_id ] [ -content_types content_types ] \
    -name name 

Make sure, the root folder for the given package exists. If not, create it and register all allowed content types. Note that xowiki (and derived packages) define their own version of "require_root_folder" based on form pages. Therefore, this function is just for packages not based on xowiki.

Switches:
-parent_id
(defaults to "-100") (optional)
-content_types
(optional)
-name
(required)
Returns:
folder_id

Partial Call Graph (max 5 caller/called nodes):
%3 test_xowiki_test_cases xowiki_test_cases (test xowiki) xo::Package instproc require_root_folder xo::Package instproc require_root_folder test_xowiki_test_cases->xo::Package instproc require_root_folder

Testcases:
xowiki_test_cases

xo::PackageMgr instproc first_instance (public)

 <instance of xo::PackageMgr[i]> first_instance \
    [ -privilege privilege ] [ -party_id party_id ]

Returns the first mounted instance of this Package. When a privilege and a party are specified, will return the first instance where the party has such privilege.

Switches:
-privilege
(optional)
-party_id
(optional)
the party we are checking the privilege for
Returns:
integer package_id, empty string when none is found

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_form_with_form_instance create_form_with_form_instance (test xowiki) xo::PackageMgr instproc first_instance xo::PackageMgr instproc first_instance test_create_form_with_form_instance->xo::PackageMgr instproc first_instance test_xowiki_test_cases xowiki_test_cases (test xowiki) test_xowiki_test_cases->xo::PackageMgr instproc first_instance db_driverkey db_driverkey (public) xo::PackageMgr instproc first_instance->db_driverkey

Testcases:
xowiki_test_cases, create_form_with_form_instance

xo::PackageMgr instproc import_prototype_page (public)

 <instance of xo::PackageMgr[i]> import_prototype_page \
    [ -package_key package_key ] -name name  -parent_id parent_id  \
    -package_id package_id  [ -lang lang ] [ -add_revision on|off ]

Import a named page from the prototypes folder of the package, i.e. under www/prototypes/*.page of the package.

Switches:
-package_key
(optional)
when provided, the package_key used to locate the page. When not provided, use the package_key of the class, on which this function is called.
-name
(required)
name of the page to be loaded (not including the language prefix)
-parent_id
(required)
place to where the page should be loaded
-package_id
(required)
package instance to which the page should be loaded
-lang
(defaults to "en") (optional)
-add_revision
(boolean) (defaults to "true") (optional)
When the page to be loaded exists already, add a new revision. When the page exists already, and the flag is not set, no change happens.

Partial Call Graph (max 5 caller/called nodes):
%3 test_xowiki_test_cases xowiki_test_cases (test xowiki) xo::PackageMgr instproc import_prototype_page xo::PackageMgr instproc import_prototype_page test_xowiki_test_cases->xo::PackageMgr instproc import_prototype_page ad_file ad_file (public) xo::PackageMgr instproc import_prototype_page->ad_file

Testcases:
xowiki_test_cases

xo::PackageMgr instproc initialize (public)

 <instance of xo::PackageMgr[i]> initialize [ -ad_doc ad_doc ] \
    [ -parameter parameter ] [ -package_id package_id ] [ -url url ] \
    [ -user_id user_id ] [ -actual_query actual_query ] \
    [ -original_url_and_query original_url_and_query ] \
    [ -init_url init_url ] [ -keep_cc keep_cc ] \
    [ -form_parameter form_parameter ] [ -export_vars export_vars ]

Create the connection context ::xo::cc and a package object if these are none defined yet. The connection context ::xo::cc and the package object will be destroyed on cleanup, when the global variables are reclaimed. As a side effect this method sets in the calling context the query parameters and package_id as variables, using the "defaults" for default values. init_url false requires the package_id to be specified and a call to Package instproc set_url to complete initialization. keep_cc true means that the original connection context is preserved (i.e. not altered) in case it exists already.

Switches:
-ad_doc
(optional)
-parameter
(optional)
-package_id
(defaults to "0") (optional)
-url
(optional)
-user_id
(defaults to "-1") (optional)
-actual_query
(defaults to " ") (optional)
-original_url_and_query
(optional)
-init_url
(defaults to "true") (optional)
-keep_cc
(defaults to "false") (optional)
-form_parameter
(optional)
-export_vars
(defaults to "true") (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_form_with_form_instance create_form_with_form_instance (test xowiki) xo::PackageMgr instproc initialize xo::PackageMgr instproc initialize test_create_form_with_form_instance->xo::PackageMgr instproc initialize test_includelet_childresources includelet_childresources (test xowiki) test_includelet_childresources->xo::PackageMgr instproc initialize test_includelet_toc includelet_toc (test xowiki) test_includelet_toc->xo::PackageMgr instproc initialize test_link_tests link_tests (test xowiki) test_link_tests->xo::PackageMgr instproc initialize test_package_normalize_path package_normalize_path (test xowiki) test_package_normalize_path->xo::PackageMgr instproc initialize acs::root_of_host acs::root_of_host (public) xo::PackageMgr instproc initialize->acs::root_of_host ad_host ad_host (public) xo::PackageMgr instproc initialize->ad_host ad_parse_documentation_string ad_parse_documentation_string xo::PackageMgr instproc initialize->ad_parse_documentation_string api_page_documentation_mode_p api_page_documentation_mode_p (public) xo::PackageMgr instproc initialize->api_page_documentation_mode_p auth::require_login auth::require_login (public) xo::PackageMgr instproc initialize->auth::require_login

Testcases:
package_normalize_path, includelet_toc, includelet_childresources, xowiki_test_cases, link_tests, slot_interactions, path_resolve, create_form_with_form_instance

xo::PackageMgr instproc instances (public)

 <instance of xo::PackageMgr[i]> instances \
    [ -include_unmounted include_unmounted ] [ -closure closure ]
Switches:
-include_unmounted
(defaults to "false") (optional)
include unmounted package instances
-closure
(defaults to "false") (optional)
include instances of subclasses of the package
Returns:
list of package_ids of xowiki instances

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

xo::PackageMgr instproc require (public)

 <instance of xo::PackageMgr[i]> require [ -url url ] package_id

Create package object if needed.

Switches:
-url
(optional)
Parameters:
package_id

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_folder_with_page create_folder_with_page (test xowf) xo::PackageMgr instproc require xo::PackageMgr instproc require test_create_folder_with_page->xo::PackageMgr instproc require test_create_form_with_form_instance create_form_with_form_instance (test xowiki) test_create_form_with_form_instance->xo::PackageMgr instproc require test_xowiki_test_cases xowiki_test_cases (test xowiki) test_xowiki_test_cases->xo::PackageMgr instproc require apm_package_key_from_id apm_package_key_from_id (public) xo::PackageMgr instproc require->apm_package_key_from_id

Testcases:
create_folder_with_page, xowiki_test_cases, create_form_with_form_instance

xo::PackageMgr instproc require_site_wide_pages (public)

 <instance of xo::PackageMgr[i]> require_site_wide_pages \
    [ -refetch on|off ] [ -refetch_if_modified on|off ] \
    [ -pages pages ]

Load site-wide pages from the prototype page directory. The pages are loaded into to site-wide instance. When a page to be loaded exists already, a new revision is added. If no pages are provided, use the list of pages as defined for the package.

Switches:
-refetch
(boolean) (defaults to "false") (optional)
force fresh loading of prototype pages
-refetch_if_modified
(boolean) (defaults to "false") (optional)
refetch when modification date of file is new than the version in the content repository
-pages
(optional)
list of pages (without languages prefix) or empty to refer to per-package definition.

Partial Call Graph (max 5 caller/called nodes):
%3 test_xowiki_test_cases xowiki_test_cases (test xowiki) xo::PackageMgr instproc require_site_wide_pages xo::PackageMgr instproc require_site_wide_pages test_xowiki_test_cases->xo::PackageMgr instproc require_site_wide_pages ad_file ad_file (public) xo::PackageMgr instproc require_site_wide_pages->ad_file xo::db::tcl_date xo::db::tcl_date (public) xo::PackageMgr instproc require_site_wide_pages->xo::db::tcl_date

Testcases:
xowiki_test_cases

xo::PackageMgr proc get_package_class_from_package_key (public)

 xo::PackageMgr[i] get_package_class_from_package_key package_key

Obtain the package class from a package key

Parameters:
package_key

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_form_with_form_instance create_form_with_form_instance (test xowiki) xo::PackageMgr proc get_package_class_from_package_key xo::PackageMgr proc get_package_class_from_package_key test_create_form_with_form_instance->xo::PackageMgr proc get_package_class_from_package_key test_link_tests link_tests (test xowiki) test_link_tests->xo::PackageMgr proc get_package_class_from_package_key test_package_normalize_path package_normalize_path (test xowiki) test_package_normalize_path->xo::PackageMgr proc get_package_class_from_package_key test_path_resolve path_resolve (test xowiki) test_path_resolve->xo::PackageMgr proc get_package_class_from_package_key test_xowiki_test_cases xowiki_test_cases (test xowiki) test_xowiki_test_cases->xo::PackageMgr proc get_package_class_from_package_key

Testcases:
package_normalize_path, xowiki_test_cases, link_tests, path_resolve, create_form_with_form_instance
[ show source ]