- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xo::Package
::xo::Package 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
- superclass: ::xo::db::Object
- subclass: ::xo::oauth::Package, ::xowiki::Package
::xo::PackageMgr create ::xo::Package \ -superclass ::xo::db::ObjectMethods (to be applied on instances)
initialize (scripted)
<instance of xo::Package> 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> reply_to_user: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> 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. 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
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables