%3 ::xo::oauth::Package ::xo::oauth::Package → fill → reset index init insert ::xo::Package ::xo::Package ::xo::oauth::Package->::xo::Package ::xowiki::Package ::xowiki::Package → get_package_id_from_page_id → get_url_from_id → google_sitemapindex → instantiate_page_from_id → is_xowiki_p → preferredCSSToolkit → reparent_site_wide_pages call check_permissions clipboard-copy condition=has_class condition=has_name create_new_snippet default_language default_locale delete_revision error_msg external_name flush_name_cache flush_page_fragment_cache flush_references folder_path get_adp_template get_ids_for_bulk_actions get_lang_and_name get_package_id_from_page_name get_page_from_item_or_revision_id get_page_from_item_ref get_page_from_name get_page_from_super get_parameter get_parameter_from_parameter_page get_parent_and_name import init insert invoke item_info_from_id item_info_from_url item_ref join_name lookup make_form_link make_link normalize_name normalize_path package_path prefixed_lookup pretty_link query_parameter_return_url reparent require_folder_object require_root_folder resolve_package_path resolve_page resolve_page_name resolve_page_name_and_init_context show_page_order simple_item_ref split_name validate_tag www-change-page-order www-delete www-edit-category-tree www-edit-new www-google-sitemap www-google-sitemapindex www-import-prototype-page www-manage-categories www-refresh-login www-reindex www-rss www-update-references ::xowiki::ParameterCache ::xowiki::ParameterCache get_parameter ::xowiki::Package->::xowiki::ParameterCache instmixin ::xowiki::Package->::xo::Package ::xotcl::Object ::xotcl::Object ::xowiki::ParameterCache->::xotcl::Object ::xolirc::Package ::xolirc::Package → create-page-from-log → process-all-logs dash-date get-html-from-log initialize insert query-actual-log ::xolirc::Package->::xowiki::Package ::s5::Package ::s5::Package init insert ::s5::Package->::xowiki::Package ::xowf::Package ::xowf::Package → create_new_workflow_page call destroy initialize insert ::xowf::Package->::xowiki::Package

Class ::xowiki::Package

::xowiki::Package[i] create ... \
           [ -folder_id (default "0") ] \
           [ -force_refresh_login (default "false") ]

Defined in

Class Relations

  • class: ::xo::PackageMgr[i]
  • superclass: ::xo::Package[i]
  • instmixin: ::xowiki::ParameterCache[i]
  • subclass: ::xolirc::Package[i], ::s5::Package[i], ::xowf::Package[i]

Methods (to be applied on the object)

  • get_package_id_from_page_id (scripted, public)

     xowiki::Package[i] 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[i] 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[i] 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[i] 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[i] is_xowiki_p package_id

    A small stunt to detect if a package is a descendant of xowiki.

    Parameters:
    package_id (required)
    Returns:
    boolean

    Testcases:
    parameter__check_procs
  • preferredCSSToolkit (scripted)

  • reparent_site_wide_pages (scripted)

Methods (to be applied on instances)

  • call (scripted)

  • check_permissions (forward)

  • clipboard-copy (scripted)

  • condition=has_class (scripted)

  • condition=has_name (scripted)

  • create_new_snippet (scripted)

  • default_language (scripted)

  • default_locale (scripted)

  • delete_revision (scripted)

  • error_msg (scripted)

  • external_name (scripted, public)

     <instance of xowiki::Package[i]> external_name \
        [ -parent_id parent_id ] name

    Generate 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
  • flush_name_cache (scripted)

  • flush_page_fragment_cache (scripted)

  • flush_references (scripted)

  • folder_id (setter)

  • folder_path (scripted, public)

     <instance of xowiki::Package[i]> 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
  • force_refresh_login (setter)

  • get_adp_template (scripted)

  • get_ids_for_bulk_actions (scripted, public)

     <instance of xowiki::Package[i]> get_ids_for_bulk_actions \
        [ -parent_id parent_id ] page_references

    The 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_lang_and_name (scripted)

  • get_package_id_from_page_name (scripted)

  • get_page_from_item_or_revision_id (scripted)

  • get_page_from_item_ref (scripted)

  • get_page_from_name (scripted)

  • get_page_from_super (scripted)

  • get_parameter (scripted, public)

     <instance of xowiki::Package[i]> 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[i]> 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
  • get_parent_and_name (scripted)

  • import (scripted, public)

     <instance of xowiki::Package[i]> 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.
  • init (scripted)

  • insert (scripted)

  • invoke (scripted)

     <instance of xowiki::Package[i]> invoke

    Testcases:
    create_folder_with_page, xowf, create_workflow_with_instance, create_form_with_form_instance
  • item_info_from_id (scripted)

  • item_info_from_url (scripted)

     <instance of xowiki::Package[i]> item_info_from_url

    Testcases:
    path_resolve, xowiki
  • item_ref (scripted, public)

     <instance of xowiki::Package[i]> 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  link

    An 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
  • join_name (scripted)

  • lookup (scripted, public)

     <instance of xowiki::Package[i]> 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_form_link (scripted)

  • make_link (scripted, public)

     <instance of xowiki::Package[i]> 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_name (scripted)

  • normalize_path (scripted)

     <instance of xowiki::Package[i]> normalize_path

    Testcases:
    package_normalize_path, xowiki
  • package_id (setter)

  • package_path (scripted)

  • prefixed_lookup (scripted)

  • pretty_link (scripted, public)

     <instance of xowiki::Package[i]> 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 ] name

    Generate 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
  • query_parameter_return_url (scripted)

  • reparent (scripted, public)

     <instance of xowiki::Package[i]> 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_folder_object (scripted)

  • require_root_folder (scripted, public)

     <instance of xowiki::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.

    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_package_path (scripted)

  • resolve_page (scripted, public)

     <instance of xowiki::Package[i]> resolve_page \
        [ -use_package_path use_package_path ] [ -simple on|off ] \
        [ -lang lang ] object method_var

    Try 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
  • resolve_page_name (scripted)

  • resolve_page_name_and_init_context (scripted)

  • show_page_order (scripted)

  • simple_item_ref (scripted)

  • split_name (scripted)

  • validate_tag (scripted)

  • www-change-page-order (scripted, public)

     <instance of xowiki::Package[i]> www-change-page-order

    This 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[i]> 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[i]> www-edit-category-tree

    This 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[i]> www-edit-new

    This 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[i]> 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[i]> www-google-sitemapindex

    This 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[i]> 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[i]> www-manage-categories

    This 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[i]> www-refresh-login

    This 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[i]> www-reindex

    This 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[i]> 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[i]> www-update-references

    This 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.

Variables

::xowiki::Package set __default_metaclass ::xotcl::Class
::xowiki::Package set __default_superclass ::xotcl::Object
::xowiki::Package set abstract_p f
::xowiki::Package set auto_save false
::xowiki::Package array set db_constraints {}
::xowiki::Package array set db_slot {package_id ::xowiki::Package::slot::package_id}
::xowiki::Package set default_package_parameter_page_info {}
::xowiki::Package set default_package_parameters {}
::xowiki::Package array set delegate_link_to_target {download 1 list 1 csv-dump 1}
::xowiki::Package set id_column package_id
::xowiki::Package set name_method {}
::xowiki::Package set object_type ::xowiki::Package
::xowiki::Package set object_type_key 000000000000010100000010
::xowiki::Package set package_key xowiki
::xowiki::Package set pretty_name XoWiki
::xowiki::Package set pretty_plural XoWiki
::xowiki::Package set security_inherit_p t
::xowiki::Package set site_wide_info {folder_id 5443814 instance_id 5443766}
::xowiki::Package set site_wide_package_parameter_page_info {}
::xowiki::Package set site_wide_package_parameters {
    MenuBar 1
    index_page table-of-contents
    top_includelet ""
    with_general_comments 0
    with_notifications 0
    with_tags 0
    with_user_tracking 0
  }
::xowiki::Package set site_wide_pages {
    folder.form
    link.form
    page.form
    form.form
    import-archive.form
    photo.form
  }
::xowiki::Package set sql_package_name ::xowiki::Package
::xowiki::Package set supertype acs_object
::xowiki::Package set table_name xowiki_package
::xowiki::Package set with_table true
::xowiki::Package array set www-file \
       {admin 1 error-template 1 resources 1 view-plain 1 view-book-no-ajax 1 oacs-view 1 edit 1 \
       download 1 oacs-view2 1 prototypes 1 oacs-view3 1 view-links 1 diff 1 revisions 1 portlet 1 \
       portlet-ajax 1 view-book 1 view-oacs-docs 1 view-default 1 portlets 1 doc 1}