Index: openacs-4/packages/lorsm/catalog/lorsm.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/catalog/lorsm.en_US.ISO-8859-1.xml,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/lorsm/catalog/lorsm.en_US.ISO-8859-1.xml 22 Apr 2005 11:14:23 -0000 1.5 +++ openacs-4/packages/lorsm/catalog/lorsm.en_US.ISO-8859-1.xml 17 May 2005 17:03:39 -0000 1.6 @@ -600,6 +600,7 @@ Number in the Catalog i.e.: '1.3.1' Number of Organizations: number of times and have covered + One Course Versions Organizational structure of the resource Other Platform Requirements: Preliminary information @@ -659,7 +660,7 @@ Upload an IMS/SCORM Content Package Course Upload IMS Content Package Uploading and processing your course, please wait ... - Use the "Browse..." button to locate your file, then click "Open" + Use the \"Browse...\" button to locate your file, then click \"Open\" Use the Classic Style if your course does not provide an index by itself and you want us to provide it. Otherwise use the Without LORSM Index Style. valign="top" align="left">%isscorm;noquote% Version of the Schema. i.e.: '1.2.1' @@ -785,7 +786,6 @@ Size Source: Source - Begin with the Course Start Course Status: Status Index: openacs-4/packages/lorsm/catalog/lorsm.es_ES.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/catalog/lorsm.es_ES.ISO-8859-1.xml,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/lorsm/catalog/lorsm.es_ES.ISO-8859-1.xml 24 Feb 2005 13:33:21 -0000 1.2 +++ openacs-4/packages/lorsm/catalog/lorsm.es_ES.ISO-8859-1.xml 17 May 2005 17:03:39 -0000 1.3 @@ -596,6 +596,7 @@ N�mero en el Cat�logo, por ejemplo: '1.3.1' N�mero de Organizaciones: N�mero de Veces que ha sido cubierto + Versiones de un curso Estructura Organizacional del recurso Otros Requerimientos de Plataforma Informaci�n Preliminar Index: openacs-4/packages/lorsm/catalog/lorsm.es_GT.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/catalog/lorsm.es_GT.ISO-8859-1.xml,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/lorsm/catalog/lorsm.es_GT.ISO-8859-1.xml 24 Feb 2005 13:33:21 -0000 1.2 +++ openacs-4/packages/lorsm/catalog/lorsm.es_GT.ISO-8859-1.xml 17 May 2005 17:03:39 -0000 1.3 @@ -596,6 +596,7 @@ N�mero en el Cat�logo, por ejemplo: '1.3.1' N�mero de Organizaciones: N�mero de Veces que ha sido cubierto + Versiones de un curso Estructura Organizacional del recurso Otros Requerimientos de Plataforma Informaci�n Preliminar Index: openacs-4/packages/lorsm/lib/user-lorsm.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/lib/user-lorsm.tcl,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/lorsm/lib/user-lorsm.tcl 26 Apr 2005 08:56:23 -0000 1.7 +++ openacs-4/packages/lorsm/lib/user-lorsm.tcl 17 May 2005 17:03:39 -0000 1.8 @@ -1,4 +1,4 @@ -#packages/lorsm/www/test.tcl +# packages/lorsm/www/test.tcl ad_page_contract { @@ -15,24 +15,17 @@ } -errors { } -#set package_id $list_of_packages_ids - -# link_url_eval {[site_node::get_url_from_object_id -object_id $lorsm_instance_id]${folder_name}/?[export_vars man_id]} -# link_html {title "[_ lorsm.Access_Course]" target "_blank"} - - template::list::create \ -name d_courses \ - -pass_properties delivery_folder \ -multirow d_courses \ -html {width 100%} \ -key man_id \ -no_data "[_ lorsm.No_Courses]" \ -elements { course_name { label "[_ lorsm.Course_Name_1]" - display_template {@d_courses.course_url;noquote@} - html { width 70% } + display_template {@d_courses.course_url;noquote@} + html { width 70% } } subject { label "[_ lorsm.Subject]" @@ -54,76 +47,28 @@ } set user_id [ad_conn user_id] - +set community_id [dotlrn_community::get_community_id] +set extra_query "" +if {![empty_string_p $community_id]} { + set extra_query "and cpmc.community_id = :community_id" +} foreach package $package_id { - - db_multirow -extend { ims_md_id last_viewed total_item_count viewed_item_count viewed_percent course_url } -append d_courses select_d_courses { - select - cp.man_id, - cp.course_name, - cp.identifier, - cp.version, - cp.fs_package_id, - cp.folder_id, - acs.creation_user, - acs.creation_date, - pf.folder_name, - pf.format_name, - acs.context_id, - cpmc.community_id, - cpmc.lorsm_instance_id - from - ims_cp_manifests cp, acs_objects acs, ims_cp_manifest_class cpmc, lorsm_course_presentation_formats pf - where - cp.man_id = acs.object_id - and - cp.man_id = cpmc.man_id - and --- acs.context_id = :package - cpmc.lorsm_instance_id = :package - and - cpmc.isenabled = 't' - and - cp.course_presentation_format = pf.format_id - order by acs.creation_date desc - } { + db_multirow -extend { ims_md_id last_viewed total_item_count viewed_item_count viewed_percent course_url } -append d_courses select_d_courses { } { set ims_md_id $man_id - if { [string eq $format_name "default"] } { + if { [string eq $format_name "default"] } { set course_url "$course_name" - } else { + } else { set course_url "$course_name" - } - + } # DEDS: these are expensive # and for demo purposes only - db_0or1row get_last_viewed { - select v.last_viewed - from views v, - ims_cp_items i, - ims_cp_organizations o - where v.viewer_id = :user_id - and v.object_id = i.item_id - and i.org_id = o.org_id - and o.man_id = :man_id - order by v.last_viewed desc - limit 1 - } - set all_items [db_list get_total_items { - select i.item_id - from ims_cp_items i, - ims_cp_organizations o - where o.man_id = :man_id - and i.org_id = o.org_id - }] + db_0or1row get_last_viewed { } + set all_items [db_list get_total_items { }] set total_item_count [llength $all_items] - set viewed_items [db_list get_viewed_items " - select v.object_id - from views v - where v.viewer_id = :user_id - and v.object_id in ([join $all_items ,]) - "] + set viewed_items [db_list get_viewed_items { }] set viewed_item_count [llength $viewed_items] set viewed_percent [expr [expr $viewed_item_count * 1.00] / $total_item_count * 100] - - } + } } + + Index: openacs-4/packages/lorsm/tcl/lorsm-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/tcl/lorsm-procs.tcl,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/lorsm/tcl/lorsm-procs.tcl 21 Apr 2005 16:03:53 -0000 1.5 +++ openacs-4/packages/lorsm/tcl/lorsm-procs.tcl 17 May 2005 17:03:39 -0000 1.6 @@ -327,7 +327,7 @@ variable ims_item_id $ims_it_id } -ad_proc -public get_ims_item_id {} { +ad_proc -public get_ims_item_id { } { variable ims_item_id return $ims_item_id @@ -445,7 +445,7 @@ upvar $urlvar url $rootvar root_path - variable item_id + variable ims_item_id variable revision_id # if a .tcl file exists at this url, then don't do any queries @@ -456,8 +456,8 @@ # cache this query persistently for 1 hour # this is faster than 1 query because a pl/sql function in the # where clause is a very bad idea - db_0or1row get_item_id "" + db_0or1row get_item_id "" db_0or1row get_item_type "" # No item found, so do not handle this request if { ![info exists item_id] } { @@ -478,8 +478,8 @@ # Make sure that a live revision exists if { [empty_string_p $rev_id] } { - set live_revision [db_string get_live_revision ""] - + + set live_revision [db_string get_live_revision ""] if { [template::util::is_nil live_revision] } { ns_log notice "content::init: no live revision found for content item $item_id" return 0 @@ -536,12 +536,15 @@ variable revision_id variable ims_item_id variable ims_item_title + +set item_id $ims_item_id if { [template::util::is_nil item_id] } { - ns_log warning "content::get_content: No active item in content::get_content" + ns_log warning "content::get_content: No active item in content::get_content" return } + # Get the live revision set revision_id [db_string get_revision ""] @@ -570,7 +573,78 @@ } +} +ad_proc -public lorsm::get_root_folder_id { } { } { + return [db_string get_root_folder { select folder_id from cr_folders where label = 'LORSM Root Folder' }] +} + +ad_proc -public lorsm::get_folder_id { + -name:required +} { + return [db_string get_root_folder { select folder_id from cr_folders where label = :name }] +} + +ad_proc -public lorsm::get_items_indent { + -org_id:required +} { + Returns a list of the form \{ims_item_id indent\} from one org_id +} { + + # We need all the count of all items (just live revisions) + set items_count [db_string get_items_count { select count(ims_item_id) + from ims_cp_items where ims_item_id in ( select live_revision + from cr_items where content_type = 'ims_item_object') and + org_id = :org_id + }] + + # Get the root items + set count 0 + db_foreach get_root_item { select ims_item_id from ims_cp_items where parent_item = :org_id and org_id = :org_id } { + lappend items_list [list $ims_item_id 1] + set items_array($ims_item_id) 1 + incr count + } + + + while { $count < $items_count } { + foreach item $items_list { + set item_id [lindex $item 0] + set indent [expr [lindex $item 1] + 1] + db_foreach get_items {select ims_item_id from ims_cp_items where parent_item = :item_id and org_id = :org_id } { + if { ![info exist items_array($ims_item_id)] } { + lappend items_list [list $ims_item_id $indent] + set items_array($ims_item_id) $indent + incr count + } + } + } + } + return $items_list } + +ad_proc -public lorsm::get_item_delivery_url { + -man_id:required + -item_id:required + -community_id +} { + Get delivery URL + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2005-03-30 + + @param man_id + @param item_id + + @return + + @error +} { + set base_url "" + if {[exists_and_not_null community_id]} { + append base_url "FIXME" + } + set url [export_vars -base ${base_url}lorsm {man_id item_id}] + return $url +} Index: openacs-4/packages/lorsm/tcl/lorsm-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/tcl/lorsm-procs.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/lorsm/tcl/lorsm-procs.xql 4 Sep 2004 14:51:20 -0000 1.1 +++ openacs-4/packages/lorsm/tcl/lorsm-procs.xql 17 May 2005 17:03:39 -0000 1.2 @@ -4,7 +4,7 @@ - select live_revision from cr_items where item_id = :item_id + select live_revision from cr_items where item_id = :ims_item_id @@ -64,7 +64,7 @@ - select live_revision from cr_items where item_id = :item_id + select live_revision from cr_items where item_id = :ims_item_id @@ -77,4 +77,10 @@ - + + + select folder_id from cr_folders where label = 'LORSM Root Folder' + + + + \ No newline at end of file Index: openacs-4/packages/lorsm/templates/lorsm-default.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/templates/lorsm-default.adp,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/lorsm/templates/lorsm-default.adp 21 Apr 2005 16:03:53 -0000 1.3 +++ openacs-4/packages/lorsm/templates/lorsm-default.adp 17 May 2005 17:03:40 -0000 1.4 @@ -1,6 +1,6 @@ - @title;noquote@ +