%3 ::xo::Package ::xo::Package initialize reply_to_user require_root_folder ::xo::db::Object ::xo::db::Object delete save save_new update ::xo::Package->::xo::db::Object ::xo::db::chat_transcript ::xo::db::chat_transcript save_new ::xo::db::chat_transcript->::xo::db::Object ::xo::db::chat_room ::xo::db::chat_room ban_user count_messages create_transcript delete delete_messages flush grant_creator grant_moderator grant_user post_message revoke_moderator revoke_user save_new transcript_messages unban_user ::xo::db::chat_room->::xo::db::Object ::xo::db::CrItem ::xo::db::CrItem delete is_package_root_folder privilege=creator rename save save_new set_live_revision update_attribute_from_slot update_item_index ::xo::db::CrItem->::xo::db::Object ::xo::db::CrCache::Item ::xo::db::CrCache::Item ::xo::db::CrItem->::xo::db::CrCache::Item instmixin ::xo::db::apm_parameter ::xo::db::apm_parameter ::xo::db::apm_parameter->::xo::db::Object ::xo::parameter ::xo::parameter ::xo::db::apm_parameter->::xo::parameter instmixin ::xotcl::Object ::xotcl::Object ::xo::db::Object->::xotcl::Object ::xo::oauth::Package ::xo::oauth::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 external_name folder_path get_ids_for_bulk_actions get_parameter get_parameter_from_parameter_page import invoke item_info_from_url item_ref lookup make_link normalize_path pretty_link reparent require_root_folder resolve_page 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::Package->::xo::Package ::xowiki::ParameterCache ::xowiki::ParameterCache ::xowiki::Package->::xowiki::ParameterCache instmixin ::xolirc::Package ::xolirc::Package → create-page-from-log → process-all-logs ::xolirc::Package->::xowiki::Package ::s5::Package ::s5::Package ::s5::Package->::xowiki::Package ::xowf::Package ::xowf::Package → create_new_workflow_page destroy initialize ::xowf::Package->::xowiki::Package

Class ::xo::Package

::xo::Package[i] create ... \
           [ -context (default "::xo::cc") ] \
           [ -force_refresh_login (default "false") ] \
           [ -id:integer id:integer ] \
           [ -package_url package_url ] \
           [ -url url ]

Defined in

Class Relations

  • class: ::xo::PackageMgr[i]
  • superclass: ::xo::db::Object[i]
  • subclass: ::xo::oauth::Package[i], ::xowiki::Package[i]
::xo::PackageMgr create ::xo::Package \
     -superclass ::xo::db::Object

Methods (to be applied on instances)

  • initialize (scripted)

     <instance of xo::Package[i]> initialize

    Testcases:
    create_form_with_form_instance, xowiki
    # Empty hook for OpenACS package level initialization.  This is
    # used e.g. by xowf for adding the work flow mixin classes.
  • reply_to_user (scripted)

     <instance of xo::Package[i]> reply_to_user

    Testcases:
    create_folder_with_page, xowf, create_workflow_with_instance, create_form_with_form_instance
    
    :handle_http_caching
    
    #:log "REPLY [::xo::cc exists __continuation]"
    if {[::xo::cc exists __continuation]} {
      #:log "REPLY [::xo::cc set __continuation]"
      eval [::xo::cc set __continuation]
    } else {
      if {[string length $text] > 1} {
        set default_status_code 200
      } else {
        set default_status_code 204
      }
      set status_code [expr {[::xo::cc exists status_code]
                             ? [::xo::cc set status_code]
                             : $default_status_code}]
      #:log "REPLY ${:delivery} $status_code ${:mime_type} - length: [string length $text] - [ad_conn peeraddr]"
      ${:delivery} $status_code ${:mime_type} $text
    }
  • require_root_folder (scripted, 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 (optional, defaults to "-100")
    -content_types (optional)
    -name (required)
    Returns:
    folder_id

    Testcases:
    xowiki_test_cases
    set folder_id [::xo::xotcl_package_cache eval root_folder-${:id} {
    
      set folder_id [::xo::db::CrClass lookup -name $name -parent_id $parent_id]
      if {$folder_id == 0} {
        :log "folder with name '$name' and parent $parent_id does NOT EXIST"
        set folder_id [::acs::dc call content_folder new  -name $name  -label ${:instance_name}  -parent_id $parent_id  -package_id ${:id}  -context_id ${:id}]
        :log "CREATED folder '$name' and parent $parent_id ==> $folder_id"
      }
    
      # Register all specified content types
      ::xo::db::CrFolder register_content_types  -folder_id $folder_id  -content_types $content_types
      #:log "returning from cache folder_id $folder_id"
      return $folder_id
    }]
    #:log "returning from require folder_id $folder_id"
    return $folder_id

Variables

::xo::Package set __default_metaclass ::xotcl::Class
::xo::Package set __default_superclass ::xotcl::Object
::xo::Package set abstract_p f
::xo::Package set auto_save false
::xo::Package array set db_constraints {}
::xo::Package array set db_slot \
       {default_locale ::xo::Package::slot::default_locale package_key \
       ::xo::Package::slot::package_key package_id ::xo::Package::slot::package_id instance_name \
       ::xo::Package::slot::instance_name}
::xo::Package set default_package_parameter_page_info {}
::xo::Package set default_package_parameters {}
::xo::Package set id_column package_id
::xo::Package set name_method {}
::xo::Package set object_type apm_package
::xo::Package set object_type_key 0000000000000101
::xo::Package set package_key apm_package
::xo::Package set pretty_name Package
::xo::Package set pretty_plural Package
::xo::Package set security_inherit_p t
::xo::Package set site_wide_package_parameter_page_info {}
::xo::Package set site_wide_package_parameters {}
::xo::Package set site_wide_pages {}
::xo::Package set sql_package_name ::xo::Package
::xo::Package set supertype acs_object
::xo::Package set table_name apm_packages
::xo::Package set with_table true