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 -r1.2 -r1.3 --- openacs-4/packages/lorsm/catalog/lorsm.en_US.ISO-8859-1.xml 3 Dec 2004 17:52:47 -0000 1.2 +++ openacs-4/packages/lorsm/catalog/lorsm.en_US.ISO-8859-1.xml 21 Apr 2005 16:03:52 -0000 1.3 @@ -1,5 +1,5 @@ - + Classification Intended End User Role @@ -97,6 +97,7 @@ Catalog-Entries: Catalog Change + Classic Style Classification Entry Classification MD Classifications: @@ -111,6 +112,7 @@ Copyright Info Cost: Cost + Presentation Format: course. course_id Course Index @@ -123,6 +125,7 @@ Coverage Created By: Creation Date + Current Format Current Status: Date: Date @@ -435,6 +438,7 @@ Copyrighted Description: Course already part of your class Course Delivery System for LORS + Course Presentation Style Courses in your Repository Date and Time description Deleting temporary folder... @@ -614,6 +618,7 @@ SCORM complaint package Search for Learninng Objects in the Repository Search Learning Objects + Set Course Presentation Format Set Course Track Options Share Course/Learning Object Shared Courses in the Repository @@ -654,7 +659,8 @@ 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' View Annotation Metadata @@ -675,6 +681,7 @@ We're sorry, but it appears that you do not have the permission to perform this operation. Whether copyright or other restrictions apply Whether use of the resource requires payment + Without LORSM Index Style You are about to add %course_name% to your class. You can add courses already existing in the repository You have seen this course 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 -r1.5 -r1.6 --- openacs-4/packages/lorsm/lib/user-lorsm.tcl 24 Feb 2005 08:58:36 -0000 1.5 +++ openacs-4/packages/lorsm/lib/user-lorsm.tcl 21 Apr 2005 16:03:52 -0000 1.6 @@ -29,11 +29,8 @@ course_name { label "[_ lorsm.Course_Name_1]" display_col course_name - html { width 70% } - - link_url_eval {javascript:void window.open('[site_node::get_url_from_object_id -object_id $lorsm_instance_id]$delivery_folder/?[export_vars man_id]','lorsm','directories=0,width='+(screen.width-10)+',height='+(screen.height-77)+',status=no,toolbar=no,resizable=yes,location=no,left=0,top=0,menubar=no,scrollbars=yes');} - - + html { width 70% } + 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]"} } subject { @@ -69,11 +66,12 @@ cp.folder_id, acs.creation_user, acs.creation_date, + pf.folder_name, acs.context_id, cpmc.community_id, cpmc.lorsm_instance_id from - ims_cp_manifests cp, acs_objects acs, ims_cp_manifest_class cpmc + 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 @@ -83,9 +81,12 @@ cpmc.lorsm_instance_id = :package and cpmc.isenabled = 't' + and + cp.course_presentation_format = pf.format_id order by acs.creation_date desc } { set ims_md_id $man_id + # DEDS: these are expensive # and for demo purposes only db_0or1row get_last_viewed { @@ -117,9 +118,5 @@ set viewed_item_count [llength $viewed_items] set viewed_percent [expr [expr $viewed_item_count * 1.00] / $total_item_count * 100] - if { [ db_0or1row get_folder " - select folder_name as delivery_folder from lors_available_presentation_formats as a, ims_cp_manifests as c where c.presentation_id=a.presentation_id and c.man_id=:man_id; - "] } { } else { set delivery_folder "delivery"} - + } } -} Index: openacs-4/packages/lorsm/sql/postgresql/lorsm-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/sql/postgresql/lorsm-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/sql/postgresql/lorsm-create.sql 4 Sep 2004 14:51:20 -0000 1.1 +++ openacs-4/packages/lorsm/sql/postgresql/lorsm-create.sql 21 Apr 2005 16:03:52 -0000 1.2 @@ -89,4 +89,23 @@ Multiplicity: One bookmark per course/class/student '; +-- Course presentation formats + +create table lorsm_course_presentation_formats ( + format_id integer + constraint lorsm_cpformats_pk + primary key, + format_pretty_name varchar(200), + format_name varchar(100), + folder_name varchar(100) +); + +create index lorsm_cpformats__format_id_idx on lorsm_course_presentation_formats (format_id); + +comment on table lorsm_course_presentation_formats is ' +This table stores the available presentation formats for the courses. Its contains the pretty name +for the format, an id, and the folder in packages/lorsm/www/ where the presentation format is stored. +Currently just two presentation formats exists, delivery and delivery-wihout-index, which we store on creation'; + + \i lorsm-packages.sql Index: openacs-4/packages/lorsm/tcl/lorsm-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/tcl/lorsm-install-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/tcl/lorsm-install-procs.tcl 27 Oct 2004 07:45:07 -0000 1.2 +++ openacs-4/packages/lorsm/tcl/lorsm-install-procs.tcl 21 Apr 2005 16:03:52 -0000 1.3 @@ -46,11 +46,22 @@ } - foreach file [glob -nocomplain [file join $temp_location lors-*]] { + foreach file [glob -nocomplain [file join $temp_location lorsm-*]] { file copy -force $file $temp_dir } + set pretty_name "[_ lorsm.Classic_Style]" + # Insert default values for the course presentation formats + db_dml create_default_format { + insert into lorsm_course_presentation_formats values (-1,:pretty_name,'default','delivery') + } + set pretty_name "[_ lorsm.lt_Without_LORSM_Index_S]" + db_dml create_no_index_format { + insert into lorsm_course_presentation_formats values (-2,:pretty_name,'without_index','delivery-without-index') + } + + } 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 -r1.4 -r1.5 --- openacs-4/packages/lorsm/tcl/lorsm-procs.tcl 3 Dec 2004 17:52:49 -0000 1.4 +++ openacs-4/packages/lorsm/tcl/lorsm-procs.tcl 21 Apr 2005 16:03:53 -0000 1.5 @@ -334,7 +334,113 @@ } +ad_proc -public get_item_list { man_id user_id } { + set item_list [list] + db_foreach organizations { + select + org.org_id, + org.title as org_title, + org.hasmetadata, + tree_level(o.tree_sortkey) as indent + from + ims_cp_organizations org, acs_objects o + where + org.org_id = o.object_id + and + man_id = :man_id + order by + org_id + } { + db_foreach sql { + SELECT + (tree_level(tree_sortkey) - :indent) as indent, + i.item_id, + i.title as item_title + FROM + acs_objects o, ims_cp_items i + WHERE + o.object_type = 'ims_item' + AND + i.org_id = :org_id + AND + o.object_id = i.item_id + AND + EXISTS + (select 1 + from acs_object_party_privilege_map p + where p.object_id = i.item_id + and p.party_id = :user_id + and p.privilege = 'read') + + ORDER BY + o.object_id, tree_sortkey + } { + lappend item_list $item_id + } + } + return $item_list +} + +ad_proc -public record_view { item_id man_id } { + + set viewer_id [ad_conn user_id] + + set views [views::record_view -object_id $item_id -viewer_id $viewer_id] + + set revision_id [item::get_best_revision $item_id] + + db_1row manifest_info "select fs_package_id, folder_id from ims_cp_manifests where man_id = :man_id" + set content_root [fs::get_root_folder -package_id $fs_package_id] + + set url2 "[db_string select_folder_key {select key from fs_folders where folder_id = :folder_id}]/" + + set href [db_string href "select href from ims_cp_resources r, ims_cp_items_to_resources ir where ir.item_id = :item_id and ir.res_id = r.res_id" -default ""] + + db_1row item_info "select title from ims_cp_items where item_id = :item_id" + + set fs_item_id [fs::get_item_id -folder_id $folder_id -name $href] + + # If no fs_item_id, this item is probably a folder + # Else deliver the page + if { ![empty_string_p $fs_item_id] } { + + set fs_revision_id [item::get_best_revision $fs_item_id] + set fs_item_mime [item::get_mime_info $fs_revision_id mime_info] + + + if { [string equal -length 4 "text" $mime_info(mime_type)] } { + + set imsitem_id $item_id + + # lorsm::set_content_root content_root + lorsm::set_ims_item_id $item_id + + # we use nsv variables to set the delivery environment this is a + # temporary solution until we find something a bit better + + if {[nsv_exists delivery_vars [ad_conn session_id]]} { + nsv_unset delivery_vars [ad_conn session_id] + } + + nsv_set delivery_vars [ad_conn session_id] [list] + + nsv_lappend delivery_vars [ad_conn session_id] $content_root + + } + } else { + lorsm::set_ims_item_id $item_id + + # We have no content, so wipe item_id from the lorsm namespace + # This fixes a strange bug if you click a 'no content' menu item + # repeatedly and different content appears! + if { [info exists lorsm::item_id] } { + set lorsm::item_id "" + } + } + +} + ad_proc -public init { urlvar rootvar {content_root ""} {template_root ""} {context "public"} {rev_id ""} {content_type ""} } { upvar $urlvar url $rootvar root_path 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 -r1.2 -r1.3 --- openacs-4/packages/lorsm/templates/lorsm-default.adp 25 Nov 2004 20:16:57 -0000 1.2 +++ openacs-4/packages/lorsm/templates/lorsm-default.adp 21 Apr 2005 16:03:53 -0000 1.3 @@ -1,6 +1,6 @@ + @title;noquote@ -