- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xowiki::Package
::xowiki::Package create ... \
[ -folder_id (default "0") ] \
[ -force_refresh_login (default "false") ]
Defined in
Class Relations
- class: ::xo::PackageMgr
- superclass: ::xo::Package
- instmixin: ::xowiki::ParameterCache
- subclass: ::xolirc::Package, ::s5::Package, ::xowf::Package
Methods (to be applied on the object)
get_package_id_from_page_id (scripted, public)
xowiki::Package get_package_id_from_page_id \ [ -revision_id revision_id ] [ -item_id item_id ]Obtain the package_id from either the item_id or the revision_id of a page
- Switches:
- -revision_id (optional, defaults to
"0"
)- -item_id (optional, defaults to
"0"
)- Testcases:
- create_workflow_with_instance
get_url_from_id (scripted, public)
xowiki::Package get_url_from_id [ -item_id item_id ] \ [ -revision_id revision_id ]Get the full URL from a page in situations, where the context is not set up.
- Switches:
- -item_id (optional, defaults to
"0"
)- -revision_id (optional, defaults to
"0"
)- See Also:
- instantiate_page_from_id
- Testcases:
- No testcase defined.
google_sitemapindex (scripted, public)
xowiki::Package google_sitemapindex [ -changefreq changefreq ] \ [ -priority priority ] [ -package package ]This method provides a sitemap index of all xowiki instances in google site map format https://www.google.com/webmasters/sitemaps/docs/en/protocol.html
- Switches:
- -changefreq (optional, defaults to
"daily"
)- changefreq as defined by google
- -priority (optional, defaults to
"priority"
)- priority as defined by google
- -package (optional, object)
- to determine the delivery instance
- Testcases:
- No testcase defined.
instantiate_page_from_id (scripted, public)
xowiki::Package instantiate_page_from_id [ -revision_id revision_id ] \ [ -item_id item_id ] [ -user_id user_id ] [ -parameter parameter ]Instantiate a page in situations, where the connection context is not set up (e.g. we have no package object). This call is convenient when testing e.g. from the developer shell.
- Switches:
- -revision_id (optional, defaults to
"0"
)- -item_id (optional, defaults to
"0"
)- -user_id (optional, defaults to
"-1"
)- -parameter (optional)
- Testcases:
- create_workflow_with_instance
is_xowiki_p (scripted, public)
xowiki::Package is_xowiki_p package_idA small stunt to detect if a package is a descendant of xowiki.
- Parameters:
- package_id (required)
- Returns:
- boolean
- Testcases:
- parameter__check_procs
Methods (to be applied on instances)
external_name (scripted, public)
<instance of xowiki::Package> external_name \ [ -parent_id parent_id ] nameGenerate a name with a potentially inserted parent name
- Switches:
- -parent_id (optional)
- parent_id (for now just for download)
- Parameters:
- name (required)
- name of the wiki page
- Testcases:
- xowiki_test_cases
folder_path (scripted, public)
<instance of xowiki::Package> folder_path \ [ -parent_id parent_id ] [ -context_url context_url ] \ [ -folder_ids folder_ids ] [ -path_encode on|off ]Construct a folder path from a hierarchy of xowiki objects. It is designed to work with linked objects, respecting logical and physical parent IDs. The result is URL encoded, unless path_encode is set to false.
- Switches:
- -parent_id (optional)
- -context_url (optional)
- -folder_ids (optional)
- -path_encode (optional, boolean, defaults to
"true"
)- Testcases:
- link_tests
get_ids_for_bulk_actions (scripted, public)
<instance of xowiki::Package> get_ids_for_bulk_actions \ [ -parent_id parent_id ] page_referencesThe page_reference is either an item_id, a fully qualified URL path or the name exactly as stored in the content repository ("name" attribute in the database, requires parent_id to be provided as well)
- Switches:
- -parent_id (optional)
- optional, only needed in legacy cases, when page_reference is provided as page name
- Parameters:
- page_references (required)
- item_ids, paths or names to be resolved as item_ids
- Returns:
- list of valid item_ids
- Testcases:
- No testcase defined.
get_parameter (scripted, public)
<instance of xowiki::Package> get_parameter \ [ -check_query_parameter check_query_parameter ] [ -nocache ] \ [ -type type ] attribute [ default ]Resolves configurable parameters according to the following precedence: (1) values specifically set per page {{set-parameter ...}} (2) query parameter (3) form fields from the parameter_page FormPage (4) standard OpenACS package parameter The specified attribute can be of the form "name:value_constraint"
- Switches:
- -check_query_parameter (optional, defaults to
"true"
)- -nocache (optional)
- -type (optional)
- Parameters:
- attribute (required)
- default (optional)
- Testcases:
- create_form_with_form_instance
get_parameter_from_parameter_page (scripted, public)
<instance of xowiki::Package> get_parameter_from_parameter_page \ [ -parameter_page_name parameter_page_name ] parameter [ default ]Try to get the parameter from the named parameter_page.
- Switches:
- -parameter_page_name (optional)
- Parameters:
- parameter (required)
- default (optional)
- Returns:
- parameter value or empty
- Testcases:
- xowiki_test_cases
import (scripted, public)
<instance of xowiki::Package> import [ -user_id user_id ] \ [ -parent_id parent_id ] [ -replace replace ] [ -objects objects ] \ [ -create_user_ids create_user_ids ]import the specified pages into the xowiki instance
- Switches:
- -user_id (optional)
- -parent_id (optional, defaults to
"0"
)- -replace (optional, defaults to
"0"
)- -objects (optional)
- -create_user_ids (optional, defaults to
"0"
)- Testcases:
- No testcase defined.
invoke (scripted)
<instance of xowiki::Package> invokeitem_info_from_url (scripted)
<instance of xowiki::Package> item_info_from_url
- Testcases:
- path_resolve, xowiki
item_ref (scripted, public)
<instance of xowiki::Package> item_ref \ [ -use_package_path use_package_path ] \ [ -use_site_wide_pages use_site_wide_pages ] \ [ -normalize_name normalize_name ] -default_lang default_lang \ -parent_id parent_id linkAn item_ref refers to an item (existing or non-existing) in the content repository relative to some parent_id. The item might be either a folder or some kind of "page" (e.g. a file). An item_ref might be complex, i.e. consist of a path of simple_item_refs, separated by "/". An item_ref stops at the first unknown part in the path and returns item_id == 0 and the appropriate parent_id (and name etc.) for insertion.
- Switches:
- -use_package_path (optional, defaults to
"false"
)- -use_site_wide_pages (optional, defaults to
"false"
)- -normalize_name (optional, defaults to
"true"
)- -default_lang (required)
- -parent_id (required)
- Parameters:
- link (required)
- Returns:
- item info containing link_type form prefix stripped_name item_id parent_id
- Testcases:
- xowiki_test_cases, path_resolve
lookup (scripted, public)
<instance of xowiki::Package> lookup \ [ -use_package_path use_package_path ] \ [ -use_site_wide_pages use_site_wide_pages ] \ [ -default_lang default_lang ] -name name \ [ -parent_id parent_id ]Lookup name (with maybe cross-package references) from a given parent_id or from the list of configured instances (obtained via package_path).
- Switches:
- -use_package_path (optional, defaults to
"true"
)- -use_site_wide_pages (optional, defaults to
"false"
)- -default_lang (optional)
- -name (required)
- -parent_id (optional)
- Testcases:
- path_resolve
make_link (scripted, public)
<instance of xowiki::Package> make_link \ [ -with_entities with_entities ] [ -privilege privilege ] \ [ -link link ] object [ method ] args [ args... ]Creates conditionally a link for use in xowiki. When the generated link will be activated, the specified method of the object will be invoked. make_link checks in advance, whether the actual user has enough rights to invoke the method. If not, this method returns empty.
- Switches:
- -with_entities (optional, defaults to
"0"
)- -privilege (optional)
- When provided, the privilege can be "public" (do not check rights) or a privilege to be checked on the package_id and the current user. When this parameter is not specified, the policy is used to determine the rights to be checked.
- -link (optional)
- When this parameter is specified, is used used as base link for export_vars when applied on pages (or for packages as next segment under the package url). When not specified, the base url for pages is the current url, and for packages it is the package url.
- Parameters:
- object (required, object)
- The object to which the link refers to. If it is a package_id it will base to the root_url of the package_id. If it is a page, it will base to the page_url
- method (optional)
- Which method to use. This will be appended as "m=method" to the url. Examples for methods:
- view: To view and existing page
- edit: To edit an existing page
- revisions: To view the revisions of an existing page
- args (required)
- List of attributes to be append to the link. Every element can be an attribute name, or a "name value" pair. Behaves like export_vars.
- Returns:
- The link or empty
- See Also:
- Testcases:
- xowiki_test_cases
normalize_path (scripted)
<instance of xowiki::Package> normalize_path
- Testcases:
- package_normalize_path, xowiki
pretty_link (scripted, public)
<instance of xowiki::Package> pretty_link [ -anchor anchor ] \ [ -query query ] [ -absolute on|off ] [ -siteurl siteurl ] \ [ -lang lang ] [ -parent_id parent_id ] [ -download on|off ] \ [ -context_url context_url ] [ -folder_ids folder_ids ] \ [ -path_encode on|off ] [ -page page ] nameGenerate a (minimal) link to a wiki page with the specified name. Practically all links in the xowiki systems are generated through this method. The method returns the URL path urlencoded, unless "-path_encode" is set to false.
- Switches:
- -anchor (optional)
- anchor to be added to the link
- -query (optional)
- query parameters to be added literally to the resulting URL
- -absolute (optional, boolean, defaults to
"false"
)- make an absolute link (including protocol and host)
- -siteurl (optional)
- -lang (optional)
- use the specified 2 character language code (rather than computing the value)
- -parent_id (optional)
- parent_id
- -download (optional, boolean, defaults to
"false"
)- create download link (without m=download)
- -context_url (optional)
- -folder_ids (optional)
- -path_encode (optional, boolean, defaults to
"true"
)- control URL encoding of the path segmemts
- -page (optional)
- Parameters:
- name (required)
- name of the wiki page
- Testcases:
- link_tests
reparent (scripted, public)
<instance of xowiki::Package> reparent -item_id item_id \ -new_parent_id new_parent_id \ [ -allowed_parent_types allowed_parent_types ]Reparent a wiki page from one parent page to another one. The function changes the parent_id in cr_items, updates the cr-child-rels, and clears the caches. The function does not require the item to be instantiated. Limitations: The method does not perform permission checks (whether the actual user has rights to move the page to another parent folder), which should be implemented by the calling methods. Currently, the method does not perform cycle checks. It might be recommended to make sure the target parent is in the same package instance.
- Switches:
- -item_id (required, integer)
- item_id of the item to be moved
- -new_parent_id (required, integer)
- item_id of the target parent
- -allowed_parent_types (optional, defaults to
"::xowiki::FormPage ::xowiki::Page"
)- Testcases:
- No testcase defined.
require_root_folder (scripted, public)
<instance of xowiki::Package> require_root_folder \ [ -parent_id parent_id ] [ -content_types content_types ] \ -name nameMake sure, the root folder for the given package exists. If not, create it and register all allowed content types.
- Switches:
- -parent_id (optional, defaults to
"-100"
)- -content_types (optional)
- -name (required)
- Returns:
- folder_id
- Testcases:
- package_normalize_path, create_form_with_form_instance
resolve_page (scripted, public)
<instance of xowiki::Package> resolve_page \ [ -use_package_path use_package_path ] [ -simple on|off ] \ [ -lang lang ] object method_varTry to resolve from object (path) and query parameter the called object (might be a package or page) and the method to be called.
- Switches:
- -use_package_path (optional, defaults to
"true"
)- -simple (optional, boolean, defaults to
"false"
)- when set, do not try to resolve using item refs, prototype pages or package_path
- -lang (optional)
- language used for resolving
- Parameters:
- object (required)
- element name to be resolved (not an XOTcl object)
- method_var (required)
- output variable for method to be called on the object
- Returns:
- instantiated object (Page or Package) or empty
- Testcases:
- xowiki_test_cases, path_resolve
www-change-page-order (scripted, public)
<instance of xowiki::Package> www-change-page-orderThis web-callable method changes the page order for pages by renumbering and filling gaps. The parameter "clean" is just used for page inserts. This method is typically called via AJAX.
- Testcases:
- No testcase defined.
www-delete (scripted, public)
<instance of xowiki::Package> www-delete [ -item_id item_id ] \ [ -name name ] [ -parent_id parent_id ] [ -return_url return_url ]This web-callable "delete" method does not require an instantiated object, while the class-specific delete methods in xowiki-procs need these. If a (broken) object can't be instantiated, it cannot be deleted. Therefore, we need this package level delete method. While the class specific methods are used from the application pages, the package_level method is used from the admin pages. If no "item_id", "name" or "return_url" are given, take it from the query parameters.
- Switches:
- -item_id (optional)
- -name (optional)
- -parent_id (optional)
- -return_url (optional)
- Testcases:
- xowiki_test_cases
www-edit-category-tree (scripted, public)
<instance of xowiki::Package> www-edit-category-treeThis web-callable method redirects the caller to the category admin page for a certain category tree. The "object_id" and "tree_id" have to be provided as a query parameter.
- Testcases:
- No testcase defined.
www-edit-new (scripted, public)
<instance of xowiki::Package> www-edit-newThis web-callable method can be used to create new pages in the current package. The behavior can be influenced by the query parameters "object_type", "autoname", "parent_id" and "source_item_id". Finally, it calls "www-edit" for the freshly created page.
- Testcases:
- create_form_with_form_instance
www-google-sitemap (scripted, public)
<instance of xowiki::Package> www-google-sitemap \ [ -max_entries max_entries ] [ -changefreq changefreq ] \ [ -priority priority ]This web-callable method reports the content of xowiki folder in google site map format https://www.google.com/webmasters/sitemaps/docs/en/protocol.html
- Switches:
- -max_entries (optional)
- maximum number of entries retrieved
- -changefreq (optional, defaults to
"daily"
)- changefreq as defined by google
- -priority (optional, defaults to
"0.5"
)- priority as defined by google
- Testcases:
- No testcase defined.
www-google-sitemapindex (scripted, public)
<instance of xowiki::Package> www-google-sitemapindexThis web-callable method calls "google_sitemapindex" for producing a sitemap index.
- Testcases:
- No testcase defined.
www-import-prototype-page (scripted, public)
<instance of xowiki::Package> www-import-prototype-page \ [ -add_revision on|off ] [ -lang lang ] [ -parent_id parent_id ] \ [ prototype_name ]This web-callable method is designed for admin to ease the import of prototpye pages. When called via web, the query parameter "import-prototype-page" determines the page for the import.
- Switches:
- -add_revision (optional, boolean, defaults to
"true"
)- -lang (optional, defaults to
"en"
)- -parent_id (optional)
- Parameters:
- prototype_name (optional)
- Testcases:
- create_form_with_form_instance
www-manage-categories (scripted, public)
<instance of xowiki::Package> www-manage-categoriesThis web-callable method redirects the caller to the category admin page configured for the current package. The "object_id" has to be provided as a query parameter.
- Testcases:
- No testcase defined.
www-refresh-login (scripted, public)
<instance of xowiki::Package> www-refresh-loginThis web-callable method forces a refresh of a login and do a redirect. Intended for use from ajax.
- Testcases:
- No testcase defined.
www-reindex (scripted, public)
<instance of xowiki::Package> www-reindexThis web-callable method can be used to reindex all items of this package by adding all pages of this package to the search queue.
- Testcases:
- No testcase defined.
www-rss (scripted, public)
<instance of xowiki::Package> www-rss [ -maxentries maxentries ] \ [ -name_filter name_filter ] [ -entries_of entries_of ] \ [ -title title ] [ -days days ]This web-callable method reports the content of xowiki folder in rss 2.0 format. The reporting order is descending by date. The title of the feed is taken from the title, the description is taken from the description field of the folder object.
- Switches:
- -maxentries (optional)
- maximum number of entries retrieved
- -name_filter (optional)
- -entries_of (optional)
- -title (optional)
- -days (optional)
- report entries changed in specified last days
- Testcases:
- No testcase defined.
www-update-references (scripted, public)
<instance of xowiki::Package> www-update-referencesThis web-callable method can be used to update the page references between all items of this package instance. Call with e.g. xowiki/?update-references
- Testcases:
- No testcase defined.
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables