+
+#lorsm.Welcome_to# @course_name@
+
+
+ #lorsm.Your_Stats#
+
+ #lorsm.lt_You_have_seen_this_co# @viewed_times@ #lorsm.lt_number_of_times_and_h# @viewed_percent@ % #lorsm.of_the_content#
+
+
+
+ #lorsm.lt_The_last_page_you_vie# @last_page_viewed;noquote@
+
+
+ #lorsm.Start#
+
+
Index: openacs-4/packages/lorsm/www/delivery-no-index/body.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-no-index/Attic/body.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/delivery-no-index/body.tcl 22 Apr 2005 09:10:55 -0000 1.1
@@ -0,0 +1,80 @@
+# packages/lorsm/www/delivery/body.tcl
+
+ad_page_contract {
+
+ Course Delivery Body
+
+ @author Ernie Ghiglione (ErnieG@mm.st)
+ @creation-date 2004-04-09
+ @arch-tag a20dffe3-6d54-4ece-858c-4529e82c163b
+ @cvs-id $Id: body.tcl,v 1.1 2005/04/22 09:10:55 josee Exp $
+} {
+ man_id:notnull
+} -properties {
+} -validate {
+} -errors {
+}
+
+set user_id [ad_conn user_id]
+set community_id [dotlrn_community::get_community_id]
+db_0or1row get_last_viewed {
+ select item_id as imsitem_id, coalesce(acs_object__name(object_id),'Item '||object_id) as last_page_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
+}]
+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_item_count [llength $viewed_items]
+set viewed_percent [lc_numeric [expr [expr $viewed_item_count * 1.00] / $total_item_count * 100] "%.2f"]
+
+#Get times viewed
+
+set viewed_times [db_string select_viewed_times "
+ select count(*)
+ from lorsm_student_track
+ where community_id = :community_id
+ and course_id = :man_id
+ and user_id = :user_id "]
+
+# Get the course name
+if {[db_0or1row manifest "
+ select
+ cp.course_name,
+ cp.fs_package_id
+ from
+ ims_cp_manifests cp
+ where
+ cp.man_id = :man_id
+ and cp.parent_man_id = 0"]} {
+
+ # Course Name
+ if {[empty_string_p $course_name]} {
+ set course_name "[_ lorsm.No_Course_Name]"
+ }
+} else {
+ set course_name "[_ lorsm.No_Course_Name]"
+}
+
+if { !$viewed_item_count } {
+ set first_item_id [lindex [lorsm::get_item_list $man_id $user_id] 1]
+}
\ No newline at end of file
Index: openacs-4/packages/lorsm/www/delivery-no-index/exit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-no-index/exit.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/delivery-no-index/exit.tcl 22 Apr 2005 09:10:55 -0000 1.1
@@ -0,0 +1,26 @@
+# packages/lorsm/www/delivery/exit.tcl
+
+ad_page_contract {
+
+ Student tracking exit
+
+ @author Ernie Ghiglione (ErnieG@mm.st)
+ @creation-date 2004-05-25
+ @arch-tag 04aa013e-2a53-45eb-825d-d576ea35cd14
+ @cvs-id $Id: exit.tcl,v 1.1 2005/04/22 09:10:55 josee Exp $
+} {
+ track_id:integer
+ return_url
+} -properties {
+} -validate {
+} -errors {
+}
+
+# stamps the time when leaving the delivery environment
+
+if {$track_id != 0} {
+ lorsm::track::exit -track_id $track_id
+}
+
+# redirects
+ad_returnredirect $return_url
Index: openacs-4/packages/lorsm/www/delivery-no-index/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-no-index/index.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/delivery-no-index/index.adp 22 Apr 2005 09:10:55 -0000 1.1
@@ -0,0 +1,8 @@
+
+
+@course_name@
+
+
Index: openacs-4/packages/lorsm/www/delivery-no-index/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-no-index/index.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/delivery-no-index/index.tcl 22 Apr 2005 09:10:55 -0000 1.1
@@ -0,0 +1,57 @@
+# packages/lorsm/www/delivery4/index.tcl
+
+ad_page_contract {
+
+ New index file using new tree menu
+
+ @author Roel Canicula (roelmc@info.com.ph)
+ @creation-date 2004-08-07
+ @arch-tag: 64f3397b-4558-4298-a995-fc63e472f2a1
+ @cvs-id $Id: index.tcl,v 1.1 2005/04/22 09:10:55 josee Exp $
+} {
+ man_id:integer,notnull
+ ims_id:integer,notnull,optional
+} -properties {
+} -validate {
+} -errors {
+}
+
+if { [info exists ims_id] } {
+ set item_id $ims_id
+
+ set body_url [export_vars -base "record-view" -url {item_id man_id}]
+}
+
+# Get the course name
+if {[db_0or1row manifest "
+ select
+ cp.course_name,
+ cp.fs_package_id
+ from
+ ims_cp_manifests cp
+ where
+ cp.man_id = :man_id
+ and cp.parent_man_id = 0"]} {
+
+ # Course Name
+ if {[empty_string_p $course_name]} {
+ set course_name "[_ lorsm.No_Course_Name]"
+ }
+} else {
+ set course_name "[_ lorsm.No_Course_Name]"
+}
+
+# Student tracking
+set package_id [ad_conn package_id]
+set community_id [dotlrn_community::get_community_id]
+set user_id [ad_conn user_id]
+
+if {[lorsm::track::istrackable -course_id $man_id -package_id $package_id]} {
+
+ set track_id [lorsm::track::new \
+ -user_id $user_id \
+ -community_id $community_id \
+ -course_id $man_id]
+} else {
+ set track_id 0
+}
Index: openacs-4/packages/lorsm/www/delivery-no-index/record-view.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-no-index/record-view.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/delivery-no-index/record-view.tcl 22 Apr 2005 09:10:55 -0000 1.1
@@ -0,0 +1,85 @@
+# packages/lorsm/www/delivery4/record-view.tcl
+
+ad_page_contract {
+
+ records a view for this ims_cp_item and redirects to its url
+
+ @author Deds Castillo (deds@i-manila.com.ph)
+ @author Ernie Ghiglione (ErnieG@mm.st)
+ @creation-date 2004-07-04
+ @arch-tag: a7aba567-c4c1-4f1c-b5f3-ebc1ab277515
+ @cvs-id $Id: record-view.tcl,v 1.1 2005/04/22 09:10:55 josee Exp $
+} {
+ item_id:notnull
+ man_id:notnull
+} -properties {
+} -validate {
+} -errors {
+}
+
+
+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)] } {
+
+ # It's a file.
+ cr_write_content -revision_id $fs_revision_id
+ ad_script_abort
+
+ } else {
+
+ set href $url2$href
+ regsub -all {//} $href {/} href
+ 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
+
+ ad_returnredirect [export_vars -base view/$href {imsitem_id} ]
+ }
+} 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 ""
+ }
+
+ rp_internal_redirect -absolute_path [acs_root_dir]/templates/lorsm-default
+}
Index: openacs-4/packages/lorsm/www/delivery-no-index/top.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-no-index/Attic/top.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/delivery-no-index/top.adp 22 Apr 2005 09:10:55 -0000 1.1
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+ #lorsm.Exit_Course#
#lorsm.return_to_LRN#
+
+
+
+
Index: openacs-4/packages/lorsm/www/delivery-no-index/top.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-no-index/Attic/top.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/delivery-no-index/top.tcl 22 Apr 2005 09:10:55 -0000 1.1
@@ -0,0 +1,21 @@
+# packages/lorsm/www/delivery/index.tcl
+
+ad_page_contract {
+
+ Course Delivery Table of Content
+
+ @author Ernie Ghiglione (ErnieG@mm.st)
+ @creation-date 2004-04-09
+ @arch-tag 553390f0-450e-48db-99f0-c5dcb17978b8
+ @cvs-id $Id: top.tcl,v 1.1 2005/04/22 09:10:55 josee Exp $
+} {
+ man_id:integer,notnull
+ ims_id:integer,notnull,optional
+ track_id:integer,notnull
+} -properties {
+} -validate {
+} -errors {
+}
+
+# return_url
+set return_url [dotlrn_community::get_community_url [dotlrn_community::get_community_id]]
Index: openacs-4/packages/lorsm/www/delivery-no-index/view/index-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-no-index/view/index-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/delivery-no-index/view/index-oracle.xql 22 Apr 2005 09:10:55 -0000 1.1
@@ -0,0 +1,15 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ select content_template.get_root_folder from dual
+
+
+
+
+
+
Index: openacs-4/packages/lorsm/www/delivery-no-index/view/index-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-no-index/view/index-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/delivery-no-index/view/index-postgresql.xql 22 Apr 2005 09:10:55 -0000 1.1
@@ -0,0 +1,15 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select content_template__get_root_folder()
+
+
+
+
+
+
Index: openacs-4/packages/lorsm/www/delivery-no-index/view/index.vuh
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-no-index/view/index.vuh,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/delivery-no-index/view/index.vuh 22 Apr 2005 09:10:55 -0000 1.1
@@ -0,0 +1,46 @@
+#################################################
+ad_page_contract {
+
+ @author Unknown
+ @creation-date Unknown
+ @cvs-id $Id: index.vuh,v 1.1 2005/04/22 09:10:55 josee Exp $
+} {
+}
+
+# check if the nsv variable exists
+if {![nsv_exists delivery_vars [ad_conn session_id]]} {
+ ad_returnredirect [dotlrn_community::get_community_url [dotlrn_community::get_community_id -package_id [ad_conn package_id]]]
+}
+
+
+# Get the paths
+set the_root [ns_info pageroot]
+set the_url [ad_conn path_info]
+set content_type "content_revision"
+
+set content_root [lindex [nsv_get delivery_vars [ad_conn session_id]] 0]
+
+set template_root [db_string template_root ""]
+
+# Serve the page
+
+# DRB: Note that content::init modifies the local variable the_root, which is treated
+# as though it's been passed by reference. This requires that the redirect treat the
+# path as an absolute path within the filesystem.
+
+if { [lorsm::init the_url the_root $content_root $template_root public "" $content_type] } {
+
+ # we introduced our own template
+ rp_internal_redirect -absolute_path [acs_root_dir]/templates/lorsm-no-index
+
+} else {
+ # ns_returnnotfound
+ set page "[ad_header {Content Item Not Found}]"
+ append page "Content Item Not Found
"
+ append page "The requested item is not available for viewing. "
+ append page "The item is either not available on this server or it is not in a publishable state "
+ append page "Unpublished items can be viewed via the CMS interface if the CMS package is installed.
"
+ append page "[ad_footer]"
+ doc_return 200 text/html $page
+}
+