Index: openacs-4/packages/lorsm/lorsm.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/lorsm.info,v
diff -u -r1.5.2.2 -r1.5.2.3
--- openacs-4/packages/lorsm/lorsm.info 2 Feb 2005 16:13:27 -0000 1.5.2.2
+++ openacs-4/packages/lorsm/lorsm.info 27 May 2005 15:16:22 -0000 1.5.2.3
@@ -8,13 +8,13 @@
f
lorsm
-
+
Ernie Ghiglione
Application to manage the services from the Learning Object Repository.
- 2005-01-19
+ 2005-05-27
This application manages the services from the Learning Object Repository: upload courses, manage and create metadata, delete resources and courses.
-
+
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.4.2.1 -r1.4.2.2
--- openacs-4/packages/lorsm/lib/user-lorsm.tcl 5 Jan 2005 17:01:50 -0000 1.4.2.1
+++ openacs-4/packages/lorsm/lib/user-lorsm.tcl 27 May 2005 15:16:22 -0000 1.4.2.2
@@ -17,7 +17,6 @@
#set package_id $list_of_packages_ids
-
template::list::create \
-name d_courses \
-multirow d_courses \
@@ -27,9 +26,9 @@
-elements {
course_name {
label "[_ lorsm.Course_Name_1]"
- display_col course_name
+ display_template {@d_courses.course_url;noquote@}
html { width 70% }
- link_url_eval {[site_node::get_url_from_object_id -object_id $lorsm_instance_id]delivery/?[export_vars man_id]}
+
link_html {title "[_ lorsm.Access_Course]"}
}
subject {
@@ -55,7 +54,7 @@
foreach package $package_id {
- db_multirow -extend { ims_md_id last_viewed total_item_count viewed_item_count viewed_percent} -append d_courses select_d_courses {
+ 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,
@@ -65,11 +64,14 @@
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
+ 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
@@ -79,9 +81,16 @@
cpmc.lorsm_instance_id = :package
and
cpmc.isenabled = 't'
+ and
+ pf.format_id = cp.course_presentation_format
order by acs.creation_date desc
} {
set ims_md_id $man_id
+ if { [string eq $format_name "default"] } {
+ set course_url "$course_name"
+ } else {
+ set course_url "$course_name"
+ }
# DEDS: these are expensive
# and for demo purposes only
db_0or1row get_last_viewed {
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.2.1 -r1.1.2.2
--- openacs-4/packages/lorsm/sql/postgresql/lorsm-create.sql 5 Jan 2005 17:01:50 -0000 1.1.2.1
+++ openacs-4/packages/lorsm/sql/postgresql/lorsm-create.sql 27 May 2005 15:16:23 -0000 1.1.2.2
@@ -89,4 +89,22 @@
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
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/sql/postgresql/upgrade/upgrade-0.6d2-0.6d3.sql'.
Fisheye: No comparison available. Pass `N' to diff?
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.2.2 -r1.2.2.3
--- openacs-4/packages/lorsm/tcl/lorsm-install-procs.tcl 22 Apr 2005 10:20:40 -0000 1.2.2.2
+++ openacs-4/packages/lorsm/tcl/lorsm-install-procs.tcl 27 May 2005 15:16:23 -0000 1.2.2.3
@@ -52,5 +52,20 @@
}
+ 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-no-index')
+ }
+
+ set pretty_name "[_ lorsm.lt_With_Bottom_Navigatio]"
+ db_dml create_no_index_format {
+ insert into lorsm_course_presentation_formats values (-3,:pretty_name,'bottom_navigation_bar','delivery-bottom-bar')
+ }
}
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.2.1 -r1.4.2.2
--- openacs-4/packages/lorsm/tcl/lorsm-procs.tcl 5 Jan 2005 17:01:51 -0000 1.4.2.1
+++ openacs-4/packages/lorsm/tcl/lorsm-procs.tcl 27 May 2005 15:16:23 -0000 1.4.2.2
@@ -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.2.1 -r1.2.2.2
--- openacs-4/packages/lorsm/templates/lorsm-default.adp 5 Jan 2005 17:01:51 -0000 1.2.2.1
+++ openacs-4/packages/lorsm/templates/lorsm-default.adp 27 May 2005 15:16:23 -0000 1.2.2.2
@@ -1,6 +1,6 @@
+
@title;noquote@
-