::xowiki::Includelet ::xowiki::Includelet → available_includelets → describe_includelets → glob_clause → html_encode → html_id → html_to_text → js_encode → js_name → listing → locale_clause → parent_id_clause → publish_status_clause → require_YUI_CSS → require_YUI_JS category_clause get_current_folder get_page_order include_head_entries initialize js_name resolve_page_name screen_name tableWidget ::xo::Context ::xo::Context exists_query_parameter export_vars get_all_query_parameter get_parameters initialize original_url_and_query process_query_parameter query_parameter set_query_parameter unset_query_parameter ::xowiki::Includelet->::xo::Context ::xo::ConnectionContext ::xo::ConnectionContext → require → require_package_id_from_url cache cache_exists cache_get cache_set cache_unset eval_as_user exists_form_parameter exists_parameter form_parameter get_all_form_parameter get_parameter get_user_id init lang load_form_parameter load_form_parameter_from_values perconnection_parameter_get_all perconnection_parameter_set_all permission query_parameter requestor require_form_parameter returnredirect role=admin role=all role=app_group_member role=community_member role=creator role=registered_user role=swa role=unregistered_user set_parameter set_user_id unset_parameter ::xo::ConnectionContext->::xo::Context ::xotcl::Object ::xotcl::Object → getExitHandler → setExitHandler → unsetExitHandler __object_configureparameter __timediff abstract ad_doc ad_forward ad_proc asHTML check class db_0or1row db_1row debug destroy_on_cleanup ds extractConfigureArg filter filtersearch forward hasclass init invar isclass ismetaclass ismixin isobject istype log method mixin mset msg parametercmd proc procsearch qn self serialize set_instance_vars_defaults unknown vwait www-show-object ::xo::Context->::xotcl::Object

Class ::xo::ConnectionContext

::xo::ConnectionContext[i] create ... \
           [ -mobile mobile ] \
           [ -requester requester ] \
           [ -url url ] \
           [ -user user ] \
           [ -user_id user_id ]

Defined in

Class Relations

  • class: ::xotcl::Class[i]
  • superclass: ::xo::Context[i]

Methods (to be applied on the object)

  • require (scripted, private)

     xo::ConnectionContext[i] require [ -url url ] [ -package_id package_id ] \
        [ -parameter parameter ] [ -user_id user_id ] \
        [ -actual_query actual_query ] [ -keep_cc keep_cc ]

    Create or reconfigure the current connection context, ::xo::cc.

    Switches:
    -url (optional)
    Request URL. Supply a valid URL outside a connection thread.
    -package_id (optional, defaults to "0")
    Package ID, or 0 to infer it from the URL.
    -parameter (optional)
    Query parameter declarations.
    -user_id (optional, defaults to "-1")
    User ID, or -1 to derive it from the request.
    -actual_query (optional, defaults to " ")
    Query string, or a single space to read it from the connection.
    -keep_cc (optional, defaults to "false")
    Keep the existing context when one is already present.

    Testcases:
    test_xo_cc
  • require_package_id_from_url (scripted)

Methods (to be applied on instances)

  • cache (scripted)

  • cache_exists (scripted)

  • cache_get (scripted)

  • cache_set (scripted)

  • cache_unset (scripted)

  • eval_as_user (scripted, public)

     <instance of xo::ConnectionContext[i]> eval_as_user \
        [ -user_id user_id ] cmd

    Run a command as the specified different user. Essentially, this method updates xo::cc and the ad_conn array array with the specified user, runs the command and resets the user to the previous value.

    Switches:
    -user_id (optional, integer)
    switch temporarily to this user
    Parameters:
    cmd (required)
    command to be exevuted

    Testcases:
    create_test_items
  • exists_form_parameter (scripted)

  • exists_parameter (scripted)

  • form_parameter (scripted, public)

     <instance of xo::ConnectionContext[i]> form_parameter spec \
        [ default ]

    Read a form parameter, loading the request form on demand.

    Parameters:
    spec (required)
    Parameter name, optionally followed by :constraint.
    default (optional)
    Value to return when the parameter is absent.
    Returns:
    The value, or a list for a parameter marked as multiple.

    Testcases:
    create_workflow_with_instance, xowiki_test_cases
  • get_all_form_parameter (scripted, public)

     <instance of xo::ConnectionContext[i]> get_all_form_parameter

    Load the request form if necessary and return all form parameter name and value pairs.

    Testcases:
    xowiki_test_cases, create_form_with_form_instance
  • get_parameter (scripted, public)

     <instance of xo::ConnectionContext[i]> get_parameter name \
        [ default ]

    Read a per-connection parameter override.

    Parameters:
    name (required)
    Parameter name.
    default (optional)
    Value to return when no override is set.

    Testcases:
    xowiki_test_cases, link_tests
  • get_user_id (scripted)

  • init (scripted)

  • lang (scripted)

  • load_form_parameter (scripted)

  • load_form_parameter_from_values (scripted)

  • mobile (setter, public)

     <instance of xo::ConnectionContext[i]> mobile

    Get or set the mobile-client flag for this request. The initial value is based on the request user agent.

    Testcases:
    create_workflow_with_instance
  • perconnection_parameter_get_all (scripted)

  • perconnection_parameter_set_all (scripted)

  • permission (scripted, public)

     <instance of xo::ConnectionContext[i]> permission \
        -object_id object_id  -privilege privilege  [ -party_id party_id ]

    Call ::permission::permission_p but avoid multiple calls in the same request through caching in the connection context

    Switches:
    -object_id (required, integer)
    -privilege (required)
    -party_id (optional, integer)

    Testcases:
    xowiki_test_cases
  • query_parameter (scripted, public)

     <instance of xo::ConnectionContext[i]> query_parameter __spec \
        [ default ]

    Get query parameter with default and optional value constraints. In case the value check for the query parameter fails, and no further precautions are performed (::aa_test_noabort is set), the method raises an exception with "ad_return_complaint" and aborts the script.

    Parameters:
    __spec (required)
    has the formname or name:value_constraint
    default (optional)
    default value
    Returns:
    actual value of the query parameter

    Testcases:
    api__context, test_xo_cc, path_resolve
  • requester (setter)

  • requestor (scripted)

  • require_form_parameter (scripted)

  • returnredirect (scripted, public)

     <instance of xo::ConnectionContext[i]> returnredirect \
        [ -allow_complete_url ] url

    Schedule a redirect to be sent when the package replies.

    Switches:
    -allow_complete_url (optional)
    Allow a complete URL as the redirect target.
    Parameters:
    url (required)
    Redirect target.
    Returns:
    The empty string.

    Testcases:
    xowiki_test_cases
  • role=admin (scripted)

  • role=all (scripted)

  • role=app_group_member (scripted)

  • role=community_member (scripted)

  • role=creator (scripted)

  • role=registered_user (scripted)

  • role=swa (scripted)

  • role=unregistered_user (scripted)

  • set_parameter (scripted, public)

     <instance of xo::ConnectionContext[i]> set_parameter name value

    Set a per-connection parameter override and invalidate its cached lookup.

    Parameters:
    name (required)
    Parameter name.
    value (required)
    Value to store.

    Testcases:
    create_workflow_with_instance
  • set_user_id (scripted)

  • unset_parameter (scripted)

  • url (setter, public)

     <instance of xo::ConnectionContext[i]> url

    Get or set the request URL stored in the connection context.

    Testcases:
    create_workflow_with_instance, xowiki_test_cases
  • user (setter)

  • user_id (setter, public)

     <instance of xo::ConnectionContext[i]> user_id

    Get or set the user ID stored on the connection context.

    See Also:
    • {xo::ConnectionContext instproc set_user_id}

    Testcases:
    xotcl_core_tutorial_2, create_workflow_with_instance, package_normalize_path, xowiki_test_cases, link_tests, slot_interactions, path_resolve, create_form_with_form_instance