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.5.2.4 -r1.5.2.4.2.1 --- openacs-4/packages/lorsm/tcl/lorsm-install-procs.tcl 24 May 2006 17:23:31 -0000 1.5.2.4 +++ openacs-4/packages/lorsm/tcl/lorsm-install-procs.tcl 22 Nov 2006 12:24:12 -0000 1.5.2.4.2.1 @@ -58,17 +58,17 @@ 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') + insert into lorsm_course_presentation_fmts 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') + insert into lorsm_course_presentation_fmts 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') + insert into lorsm_course_presentation_fmts values (-3,:pretty_name,'bottom_navigation_bar','delivery-bottom-bar') } # Service contract implementations - fts Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/tcl/lorsm-menu-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/tcl/lorsm-menu-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/lorsm/tcl/lorsm-menu-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/tcl/Attic/lorsm-menu-procs.tcl,v diff -u -r1.1.2.1 -r1.1.2.1.2.1 --- openacs-4/packages/lorsm/tcl/lorsm-menu-procs.tcl 5 May 2006 16:57:26 -0000 1.1.2.1 +++ openacs-4/packages/lorsm/tcl/lorsm-menu-procs.tcl 22 Nov 2006 12:24:13 -0000 1.1.2.1.2.1 @@ -59,34 +59,12 @@ # Check if portal page with the same name exists # Can't use portal::get_page_id coz that'll create a portal # page if it doesn't exist - if { [db_0or1row portal_page { - select page_id, sort_key - from portal_pages - where portal_id = :portal_id - and pretty_name = :fs_link - }] } { + if { [db_0or1row portal_page {}] } { # Check if the fs folder exists - if { [db_0or1row folder { - select m.element_id, value as folder_id, p.page_id as current_page_id - from portal_element_parameters ep, - portal_element_map m, - portal_pages p - where ep.element_id = m.element_id - and m.page_id = p.page_id - and p.portal_id = :portal_id - and ep.key = 'folder_id' - and m.pretty_name = :fs_link - - limit 1 - }] } { + if { [db_0or1row folder {}] } { # If portlet isn't in the right page, place it there if { $page_id != $current_page_id } { - db_dml update_portlet { - update portal_element_map - set page_id = :page_id, - state = 'full' - where element_id = :element_id - } + db_dml update_portlet {} } # Folder exists, see if it has contents @@ -99,65 +77,13 @@ } } - db_foreach mans { - select - cp.man_id, cp.fs_package_id, cp.folder_id - from - ims_cp_manifests cp, - -- acs_objects acs, - ims_cp_manifest_class cpmc - 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' - order by cp.man_id desc -- acs.creation_date desc - } { - foreach org_id [db_list organizations { - select - org.org_id, - org.org_title as org_title, - org.hasmetadata, - tree_level(cr.tree_sortkey) as indent - from - ims_cp_organizations org, - -- acs_objects o - cr_items cr - where - cr.item_id = ( select item_id from cr_revisions where revision_id = org.org_id) - and - man_id = :man_id - order by - org_id - }] { + db_foreach mans {} { + foreach org_id [db_list organizations {}] { set items_list [list] set indent_list [lorsm::get_items_indent -org_id $org_id] template::util::list_of_lists_to_array $indent_list indent_array - db_foreach sql { - SELECT - i.ims_item_id as item_id, - i.item_title as item_title - FROM - ims_cp_items i - WHERE - i.org_id = :org_id - - AND - EXISTS - (select 1 - from acs_object_party_privilege_map p - where p.object_id = i.ims_item_id - and p.party_id = :user_id - and p.privilege = 'read') - - ORDER BY - i.ims_item_id --, tree_sortkey - } { + db_foreach sql {} { # FIXME DAVEB I think this is rather fragile, but it seems to be working right now to set the indent. I guess we need to really have the indent of the org_id item as well set indent [expr $indent_array($item_id) -1 ] set item_url [export_vars -base "${lorsm_url}/delivery3/record-view" {man_id item_id}] @@ -176,9 +102,9 @@ set item_id $item(id) set folder_id $item(folder_id) - set url2 "[db_string select_folder_key {select key from fs_folders where folder_id = :folder_id}]/" + set url2 "[db_string select_folder_key {}]/" - set href [db_string href "select href from ims_cp_resources r, ims_cp_items_to_resources ir where ir.ims_item_id = :item_id and ir.res_id = r.res_id" -default ""] +set href [db_string href {} -default ""] set fs_item_id [fs::get_item_id -folder_id $folder_id -name $href] Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/tcl/lorsm-menu-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/tcl/lorsm-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/lorsm/tcl/lorsm-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/tcl/lorsm-procs-postgresql.xql,v diff -u -r1.1 -r1.1.6.1 --- openacs-4/packages/lorsm/tcl/lorsm-procs-postgresql.xql 4 Sep 2004 14:51:20 -0000 1.1 +++ openacs-4/packages/lorsm/tcl/lorsm-procs-postgresql.xql 22 Nov 2006 12:24:13 -0000 1.1.6.1 @@ -2,6 +2,25 @@ postgresql7.1 + + + select + org.org_id, + org.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 + + + + 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.6.2.12 -r1.6.2.12.2.1 --- openacs-4/packages/lorsm/tcl/lorsm-procs.tcl 24 May 2006 11:26:19 -0000 1.6.2.12 +++ openacs-4/packages/lorsm/tcl/lorsm-procs.tcl 22 Nov 2006 12:24:13 -0000 1.6.2.12.2.1 @@ -106,7 +106,7 @@ default { set url1 "[apm_package_url_from_id $fs_local_package_id]view/" - set url2 "[db_string select_folder_key {select key from fs_folders where folder_id = :folder_id}]" + set url2 "[db_string select_folder_key {}]" set url3 [lorsm::fix_url -url $identifierref] set content_root [fs::get_root_folder -package_id $fs_package_id] set url "$item_title" @@ -132,7 +132,7 @@ @author Ernie Ghiglione (ErnieG@mm.st) } { - return [db_string course_name {select course_name from ims_cp_manifests where man_id = :manifest_id}] + return [db_string course_name {}] } @@ -217,7 +217,7 @@ default { set url1 "[apm_package_url_from_id $fs_local_package_id]view/" set folder_id $folder_id - set url2 "[db_string select_folder_key {select key from fs_folders where folder_id = :folder_id}]/" + set url2 "[db_string select_folder_key {}]/" set url3 [lorsm::fix_url -url $identifierref] set content_root [fs::get_root_folder -package_id $fs_package_id] set item_id $item_id @@ -336,48 +336,9 @@ ad_proc -public get_item_list { man_id user_id } { set item_list [list] - db_foreach organizations { - select - org.org_id, - org.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 organizations {} { - db_foreach sql { - SELECT - i.parent_item, - i.ims_item_id, - i.item_title as item_title - FROM - acs_objects o, ims_cp_items i, cr_items cr - WHERE - o.object_type = 'ims_item_object' - AND - i.org_id = :org_id - AND - o.object_id = i.ims_item_id - AND - cr.item_id = ( select item_id from cr_revisions where revision_id = i.ims_item_id) - AND - EXISTS - (select 1 - from acs_object_party_privilege_map p - where p.object_id = i.ims_item_id - and p.party_id = :user_id - and p.privilege = 'read') - - ORDER BY - i.sort_order, o.object_id, cr.tree_sortkey - } { + db_foreach sql {} { lappend item_list $ims_item_id } } @@ -392,14 +353,14 @@ 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" + db_1row manifest_info {} 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 url2 "[db_string select_folder_key {}]/" - set href [db_string href "select href from ims_cp_resources r, ims_cp_items_to_resources ir where ir.ims_item_id = :item_id and ir.res_id = r.res_id" -default ""] + set href [db_string href {} -default ""] - db_1row item_info "select item_title from ims_cp_items where ims_item_id = :item_id" + db_1row item_info {} set fs_item_id [fs::get_item_id -folder_id $folder_id -name $href] @@ -581,13 +542,13 @@ } 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' } -default ""] + return [db_string get_root_folder {} -default ""] } ad_proc -public lorsm::get_folder_id { -name:required } { - return [db_string get_root_folder { select folder_id from cr_folders where label = :name } -default ""] + return [db_string get_root_folder {} -default ""] } ad_proc -public lorsm::get_items_indent { @@ -597,15 +558,11 @@ } { # 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 - }] + set items_count [db_string get_items_count {}] # 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 } { + db_foreach get_root_item { } { lappend items_list [list $ims_item_id 1] set items_array($ims_item_id) 1 incr count @@ -616,7 +573,7 @@ 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 } { + db_foreach get_items {} { if { ![info exist items_array($ims_item_id)] } { lappend items_list [list $ims_item_id $indent] set items_array($ims_item_id) $indent @@ -668,7 +625,7 @@ # Get the package_id associated with the current community # FIXME this is a hack until I figure out how to get the # package_id of the current community - ad_conn -set package_id [db_string get_package_id {select dotlrn_community_applets.package_id from dotlrn_community_applets join apm_packages on (dotlrn_community_applets.package_id=apm_packages.package_id) where community_id = :community_id and package_key='lorsm'}] + ad_conn -set package_id [db_string get_package_id {}] set object_id [lorsm::import_imscp -upload_file $xml_file -tmp_dir $tmp_dir] 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 -r1.2.2.4 -r1.2.2.4.2.1 --- openacs-4/packages/lorsm/tcl/lorsm-procs.xql 5 May 2006 16:57:26 -0000 1.2.2.4 +++ openacs-4/packages/lorsm/tcl/lorsm-procs.xql 22 Nov 2006 12:24:13 -0000 1.2.2.4.2.1 @@ -1,6 +1,79 @@ + + + select key + from fs_folders + where folder_id = :folder_id + + + + + + select course_name + from ims_cp_manifests + where man_id = :manifest_id + + + + + + + select key + from fs_folders + where folder_id = :folder_id + + + + + + select i.parent_item, i.ims_item_id, i.item_title as item_title + from acs_objects o, ims_cp_items i, cr_items cr + where o.object_type = 'ims_item_object' + and i.org_id = :org_id and o.object_id = i.ims_item_id + and cr.item_id = ( select item_id from cr_revisions where revision_id = i.ims_item_id) + and exists (select 1 + from acs_object_party_privilege_map p + where p.object_id = i.ims_item_id + and p.party_id = :user_id + and p.privilege = 'read') + order by i.sort_order, o.object_id --, cr.tree_sortkey + + + + + + select fs_package_id, folder_id + from ims_cp_manifests + where man_id = :man_id + + + + + + select key + from fs_folders + where folder_id = :folder_id + + + + + + select href + from ims_cp_resources r, ims_cp_items_to_resources ir + where ir.ims_item_id = :item_id and ir.res_id = r.res_id + + + + + + select item_title + from ims_cp_items + where ims_item_id = :item_id + + + @@ -69,12 +142,64 @@ + + + select content_type + from cr_items + where item_id=:item_id + + + + + + select item_id, content_type + from cr_items + where item_id = :item_id + + + + select folder_id from cr_folders where label = 'LORSM Root Folder' + + + select folder_id + from cr_folders + where label = :name + + + + + + 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 + + + + + + select ims_item_id + from ims_cp_items + where parent_item = :org_id and org_id = :org_id + + + + + + select ims_item_id + from ims_cp_items + where parent_item = :item_id and org_id = :org_id + + + select track_id from @@ -106,5 +231,15 @@ where user_id = :from_user_id + + + + select dotlrn_community_applets.package_id + from dotlrn_community_applets, apm_packages + where dotlrn_community_applets.package_id=apm_packages.package_id + and community_id = :community_id and package_key='lorsm' + + + \ No newline at end of file Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/tcl/lorsm-tracking-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/tcl/lorsm-tracking-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/lorsm/tcl/lorsm-tracking-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/tcl/lorsm-tracking-procs.tcl,v diff -u -r1.2.2.1 -r1.2.2.1.2.1 --- openacs-4/packages/lorsm/tcl/lorsm-tracking-procs.tcl 5 May 2006 16:57:26 -0000 1.2.2.1 +++ openacs-4/packages/lorsm/tcl/lorsm-tracking-procs.tcl 22 Nov 2006 12:24:13 -0000 1.2.2.1.2.1 @@ -43,16 +43,7 @@ } { db_transaction { - set track_id [db_exec_plsql track_st_new { - - select lorsm_student_track__new ( - :user_id, - :community_id, - :course_id - ); - - } - ] + set track_id [db_exec_plsql track_st_new {} ] } return $track_id @@ -69,14 +60,7 @@ } { db_transaction { - set track_id [db_exec_plsql track_st_exit { - - select lorsm_student_track__exit ( - :track_id - ); - - } - ] + set track_id [db_exec_plsql track_st_exit {} ] } return $track_id