- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xolirc::Package
::xolirc::Package create ...
Defined in
Class Relations
::xo::PackageMgr create ::xolirc::Package \ -superclass ::xowiki::PackageMethods (to be applied on the object)
create-page-from-log (scripted, public)
xolirc::Package create-page-from-log [ -overwrite overwrite ] \ [ -date date ]
- Switches:
- -overwrite (optional, defaults to
"1"
)- Indicates if the content of the page will be overwritted in case the page exists already.
- -date (optional)
- Indicates the date of the log html files to read from.
- Testcases:
- No testcase defined.
set package_id [apm_package_ids_from_key -mounted -package_key xolirc] ::xolirc::Package initialize -package_id $package_id -init_url 0 -actual_query "" if {$date ne ""} { regsub -all -- "-" $date {} date } else { set date [parameter::get -package_id $package_id -parameter "date2process" -default [clock format [clock seconds] -format "%Y%m%d"]] #ns_log notice "about to process $date" parameter::set_value -package_id $package_id -parameter "date2process" -value [clock format [clock seconds] -format "%Y%m%d"] } #ns_log notice "vguerra the date is $date" set text [$package_id get-html-from-log -date $date] if { $text eq "" } { ns_log Warning "xolirc: Nothing has been logged yet for the date [$package_id dash-date $date]" return "" } set page [$package_id resolve_page_name "en:$date"] if {$page eq ""} { set page [::xowiki::Page new -title "Conversation log in #openacs on [$package_id dash-date $date]" -name "en:$date" -package_id $package_id -parent_id [$package_id folder_id] -destroy_on_cleanup -text [list $text]] $page initialize_loaded_object $page save_new } elseif { $overwrite } { $page set text [list $text] $page save } set creation_date "[$package_id dash-date $date]" db_dml update_date "update acs_objects set creation_date = :creation_date where object_id = [$page set revision_id]"process-all-logs (scripted, public)
xolirc::Package process-all-logs [ -overwrite overwrite ]Goes through all the log files and creates the respective xowiki Page.
- Switches:
- -overwrite (optional, defaults to
"1"
)- In case that the page exists for the processing date, this parameter if overwrite it (1) or not (0).
- Testcases:
- No testcase defined.
#my instvar logs_path set logs_path "/usr/local/eggdrop/html/" foreach log [glob -nocomplain -directory $logs_path "openacs*_pg1.html"] { regexp {.*openacs(\d{8})_pg1\.html} $log match date ns_log notice "working on $date" ::xolirc::Package create-page-from-log -overwrite $overwrite -date $date }
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables