Index: openacs-4/packages/lors/lib/course-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/lib/course-new.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/lors/lib/course-new.tcl 8 Oct 2008 13:01:05 -0000 1.5 +++ openacs-4/packages/lors/lib/course-new.tcl 17 Nov 2008 13:35:00 -0000 1.6 @@ -16,43 +16,49 @@ if {![info exists package_id]} { set package_id [ad_conn package_id] } -ad_form -name course-new -export {return_url package_id folder_id} -form { - man_id:key - {name:text(text) {label "Course Name"} {size 50}} -} -new_data { - # FIXME only works with dotlrn, lame, should just create a lors - # folder as a child of the package_id of the manifest object +ad_form \ + -name course-new \ + -export {return_url package_id folder_id} \ + -form { + man_id:key + {name:text(text) + {label "Course Name"} {size 50}} - set new_parent_id [lors::cr::add_folder \ - -parent_id $folder_id \ - -folder_name $name] - set new_items_parent_id [lors::cr::add_folder \ - -parent_id $folder_id \ - -folder_name "${name}_items"] - - lors::imscp::manifest_add \ - -man_id $man_id \ - -course_name $name \ - -identifier [util_text_to_url -text $name] \ - -hasmetadata f \ - -isscorm f \ - -package_id $package_id \ - -community_id $community_id \ - -folder_id $new_items_parent_id \ - -content_folder_id $new_parent_id + } -new_data { + # FIXME only works with dotlrn, lame, should just create a lors + # folder as a child of the package_id of the manifest object - lors::imscp::organization_add \ - -man_id $man_id \ - -identifier [util_text_to_url -text $name] \ - -org_folder_id $new_items_parent_id - - if {[info exists return_url_base] && $return_url_base ne ""} { - set return_url [export_vars -base $return_url_base {man_id}] - } - if {![info exists return_url] || $return_url eq ""} { - set return_url [export_vars -base course-structure {man_id}] - } - ad_returnredirect -message "[_ lors.Course_created]" $return_url + set new_parent_id [lors::cr::add_folder \ + -parent_id $folder_id \ + -folder_name $name] + set new_items_parent_id [lors::cr::add_folder \ + -parent_id $folder_id \ + -folder_name "${name}_items"] -} + lors::imscp::manifest_add \ + -man_id $man_id \ + -course_name $name \ + -identifier [util_text_to_url -text $name] \ + -hasmetadata f \ + -isscorm f \ + -package_id $package_id \ + -community_id $community_id \ + -folder_id $new_items_parent_id \ + -content_folder_id $new_parent_id + + lors::imscp::organization_add \ + -man_id $man_id \ + -identifier [util_text_to_url -text $name] \ + -org_folder_id $new_items_parent_id + + if {[info exists return_url_base] && $return_url_base ne ""} { + set return_url [export_vars -base $return_url_base {man_id}] + } + + if {![info exists return_url] || $return_url eq ""} { + set return_url [export_vars -base course-structure {man_id}] + } + + ad_returnredirect -message "[_ lors.Course_created]" $return_url + } Index: openacs-4/packages/lors/lib/course-structure.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/lib/course-structure.adp,v diff -u -r1.8 -r1.9 --- openacs-4/packages/lors/lib/course-structure.adp 8 Oct 2008 13:01:05 -0000 1.8 +++ openacs-4/packages/lors/lib/course-structure.adp 17 Nov 2008 13:35:01 -0000 1.9 @@ -1,153 +1,103 @@ - + - - - - - + + + + + + + + + +
- #lorsm.Course_Information# - #lorsm.Course_Information#
- #lorsm.Course_Name# - - @course_name;noquote@ - (@identifier@) - #lorsm.Course_Versions# -
#lors.Rename_Course# -
More Info 
#lorsm.Course_Name#@course_name;noquote@(@identifier@)#lorsm.Course_Versions#
+ #lors.Rename_Course# +
+ More Info +  
+ + @extra_admin_html;noquote@
- @orgs_list;noquote@ - +@orgs_list;noquote@ Index: openacs-4/packages/lors/lib/course-structure.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/lib/course-structure.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/lors/lib/course-structure.tcl 8 Oct 2008 13:01:05 -0000 1.12 +++ openacs-4/packages/lors/lib/course-structure.tcl 17 Nov 2008 13:35:01 -0000 1.13 @@ -1,9 +1,9 @@ # packages/lorsm/www/course_structure.tcl ad_page_contract { - + View Manifest Course Structure - + @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 2004-03-31 @arch-tag 208f2801-d110-45d3-9401-d5eae1f72c93 @@ -13,21 +13,23 @@ @param exclude list of cr_items.item_ids of ims_cp_items to exclude from the display (optional) } + set package_id [ad_conn package_id] set community_id [dotlrn_community::get_community_id] set return_url [ad_return_url] ad_proc -public getFolderKey { {-object_id:required} -} { - Gets the Folderkey for a file-storage folder_id + } { + Gets the Folderkey for a file-storage folder_id - @option object_id Folder_id for file-storage folder - @author Ernie Ghiglione (ErnieG@mm.st) + @option object_id Folder_id for file-storage folder + @author Ernie Ghiglione (ErnieG@mm.st) -} { - return [db_string select_folder_key "select key from fs_folders where object_id = :object_id"] -} + } { + return [db_string select_folder_key "select key + from fs_folders where object_id = :object_id"] + } # set context & title set context [list "[_ lorsm.Course_Structure]"] @@ -36,36 +38,36 @@ if {[db_0or1row manifest { }]} { - # Sets the variable for display. + # Sets the variable for display. set display 1 - + # Course Name if {[empty_string_p $course_name]} { set course_name "[_ lorsm.No_course_Name]" - } + } # Version set version [db_string get_versions { } -default 0] if {[string equal $version "0"]} { set version_msg "[_ lorsm.No_version_Available]" - } - + } + if { ![empty_string_p $fs_package_id] } { # Folder set folder [apm_package_url_from_id $fs_package_id]?[export_vars folder_id] # Instance set instance [apm_package_key_from_id $fs_package_id] } else { set fs_package_id [site_node_apm_integration::get_child_package_id \ - -package_id [dotlrn_community::get_package_id $community_id] \ - -package_key "file-storage"] + -package_id [dotlrn_community::get_package_id $community_id] \ + -package_key "file-storage"] # Instance set instance [lorsm::get_course_name -manifest_id $man_id] + # Folder - set root_folder [lorsm::get_root_folder_id] - - set folder_id [db_string get_folder_id { }] + set root_folder [lorsm::get_root_folder_id] + set folder_id [db_string get_folder_id { }] set folder [apm_package_url_from_id $fs_package_id]?[export_vars folder_id] } @@ -81,24 +83,28 @@ set submanifests 0 } - } else { - set display 0 - } -append orgs_list "" +append orgs_list \ + "
" set pretty_types_map {} if { [apm_package_installed_p assessment] } { - append pretty_types_map "as_sections Questions" + append pretty_types_map "as_sections Questions" } + if { [apm_package_installed_p xowiki] } { - append pretty_types_map "::xowiki::Page Content" + append pretty_types_map "::xowiki::Page Content" } -template::multirow create items course_name delete down folder_id fs_package_id hasmetadata href identifierref indent isshared item_id item_title object_id org_id res_identifier type up + +template::multirow create items \ + course_name delete down folder_id fs_package_id hasmetadata href \ + identifierref indent isshared item_id item_title object_id org_id \ + res_identifier type up + db_multirow organizations organizations { } { } if {[info exists exclude] && [llength $exclude]} { @@ -109,21 +115,33 @@ } template::multirow foreach organizations { - - set total_items [db_string items_count "select count(*) from ims_cp_items i where org_id=:org_id $exclude_where" -default 0] + set total_items [db_string items_count \ + "select count(*) + from ims_cp_items i + where org_id=:org_id $exclude_where" -default 0] # We get the indent of the items in this org_id set indent_list [lorsm::get_items_indent -org_id $org_id -exclude $exclude] template::util::list_of_lists_to_array $indent_list indent_array - + db_multirow items get_items "" { if {[info exists indent_array($item_id)]} { set indent [string repeat "  " [expr {$indent_array($item_id)-1}]] - } else { set indent 1 } - if {$type eq "webcontent" && ![string equal $identifierref {}]} { - set href "[apm_package_url_from_id_mem $fs_package_id]view/[db_string select_folder_key {select key from fs_folders where folder_id = :folder_id}]/[lorsm::fix_url -url $identifierref]" - } else { - set href "[lors::object_url -url admin -object_id $res_identifier -man_id $man_id]" - } + } else { + set indent 1 + } + + if {$type eq "webcontent" && ![string equal $identifierref {}]} { + set href "[apm_package_url_from_id_mem $fs_package_id]view/ + [db_string select_folder_key {select key from fs_folders + where folder_id = :folder_id}]/[lorsm::fix_url + -url $identifierref]" + } else { + set href "[lors::object_url \ + -url admin \ + -object_id $res_identifier \ + -man_id $man_id]" + } + set type [string map $pretty_types_map $type] set delete [export_vars -base object-delete {item_id return_url}] set up [export_vars -base reorder-items {item_id {dir up} return_url}] @@ -145,33 +163,48 @@ set add_type_options [list] if { [apm_package_installed_p assessment] } { - lappend add_type_options [list Questions assessment] + lappend add_type_options [list Questions assessment] } + if { [apm_package_installed_p xowiki] } { - lappend add_type_options [list Content wiki] + lappend add_type_options [list Content wiki] } -ad_form -name add-new -action object-new -export {man_id} -form { - {add_type:text(select) {label ""} {options $add_type_options}} - {add_new:text(submit) {label {[_ acs-kernel.common_Add]}}} -} +ad_form \ + -name add-new \ + -action object-new \ + -export {man_id} \ + -form { + {add_type:text(select) + {label ""} + {options $add_type_options}} + {add_new:text(submit) + {label {[_ acs-kernel.common_Add]}}} + } + template::list::create \ -name items \ -multirow items \ -elements { item_title { label "\#lorsm.Items\#" link_url_col href - } - type { + + } type { label "Type" - } - actions { + + } actions { label "Actions" display_template { - Up DownRemove + \ + Up \ + \ + \ + Down \ + + Remove } } } -set rename_url [export_vars -base course-rename {man_id}] \ No newline at end of file +set rename_url [export_vars -base course-rename {man_id}] Index: openacs-4/packages/lors/lib/object-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/lib/object-new.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lors/lib/object-new.tcl 6 Apr 2007 19:27:00 -0000 1.3 +++ openacs-4/packages/lors/lib/object-new.tcl 17 Nov 2008 13:35:01 -0000 1.4 @@ -7,34 +7,41 @@ switch $add_type { assessment { # get a list of assessment - set dotlrn_package_id [dotlrn_community::get_community_id] - set assessment_package_id [dotlrn_community::get_applet_package_id -community_id $dotlrn_package_id -applet_key dotlrn_assessment] - set options [db_list_of_lists get_assessments "select o.title,a.assessment_id from as_assessments a, cr_items i, acs_objects o where o.object_id=a.assessment_id and i.latest_revision=a.assessment_id and o.package_id=:assessment_package_id"] - } - wiki { + set dotlrn_package_id [dotlrn_community::get_community_id] + set assessment_package_id [dotlrn_community::get_applet_package_id \ + -community_id $dotlrn_package_id \ + -applet_key dotlrn_assessment] + set options [db_list_of_lists get_assessments \ + "select o.title,a.assessment_id + from as_assessments a, cr_items i, acs_objects o + where o.object_id=a.assessment_id + and i.latest_revision=a.assessment_id + and o.package_id=:assessment_package_id"] + } wiki { # get a list of all the wiki pages # find xowiki package array set xowiki_node [site_node::get_from_url -url /wiki] - + # get the folder_id - set folder_id [::xowiki::Page require_folder -package_id $xowiki_node(object_id) -name xowiki] + set folder_id [::xowiki::Page require_folder \ + -package_id $xowiki_node(object_id) \ + -name xowiki] + set options [list] set order_clause "order by ci.name" db_foreach instance_select \ [::xowiki::Page instance_select_query \ - -folder_id $folder_id \ - -with_subtypes t \ - -select_attributes [list title last_modified] \ - -order_clause $order_clause \ - ] { - lappend options [list $title $item_id] - } + -folder_id $folder_id \ + -with_subtypes t \ + -select_attributes [list title last_modified] \ + -order_clause $order_clause] \ + { lappend options [list $title $item_id] } + + } webcontent { + ad_returnredirect [export_vars -base item-add-edit {man_id}] + ad_script_abort } - webcontent { - ad_returnredirect [export_vars -base item-add-edit {man_id}] - ad_script_abort - } } set search_p 0 @@ -48,109 +55,138 @@ # show available objects set options [concat [list [list "-- Choose --" ""]] $options] -ad_form -name choose -export {man_id add_type} -form { - {existing_object:text(select) {label "[_ acs-kernel.common_Add]"} {options $options}} -} -on_submit { - # FIXME pretend we can only have one organization per course - # this is fine since we are not supporting a user interface to - # create more than one way to organize the items in one manifest - set org_id [db_string get_org_id "select org_id from ims_cp_organizations where man_id=:man_id"] - set item_folder_id [db_string get_folder_id "select parent_id from cr_items where latest_revision=:org_id"] - switch $add_type { - assessment { - # we want one lors item per section +ad_form \ + -name choose \ + -export {man_id add_type} \ + -form { + {existing_object:text(select) + {label "[_ acs-kernel.common_Add]"} + {options $options}} - - set sections [db_list_of_lists get_sections "select a.item_id as section_item_id,a.name,a.title from cr_items ci, as_sectionsx a, as_assessment_section_map m where m.assessment_id=:existing_object and a.section_id=m.section_id and ci.latest_revision=m.assessment_id"] + } -on_submit { + # FIXME pretend we can only have one organization per course + # this is fine since we are not supporting a user interface to + # create more than one way to organize the items in one manifest + set org_id [db_string get_org_id \ + "select org_id + from ims_cp_organizations + where man_id=:man_id"] + set item_folder_id [db_string get_folder_id \ + "select parent_id + from cr_items + where latest_revision=:org_id"] + switch $add_type { + assessment { + # we want one lors item per section + set sections [db_list_of_lists get_sections \ + "select a.item_id as section_item_id,a.name,a.title + from cr_items ci, as_sectionsx a, as_assessment_section_map m + where m.assessment_id=:existing_object + and a.section_id=m.section_id + and ci.latest_revision=m.assessment_id"] - foreach {section} $sections { + foreach {section} $sections { + foreach {section_item_id section_name section_title} \ + [lrange $section 0 2] {break} + # ad_return_complaint 1 "$section_name $section_title" + # make sure this section isn't already associated with this course + # we'll just let an admin add the assessment as many times + # as they like, if there a new sections they will get added - foreach {section_item_id section_name section_title} [lrange $section 0 2] {break} -# ad_return_complaint 1 "$section_name $section_title" - # make sure this section isn't already associated with this course - # we'll just let an admin add the assessment as many times - # as they like, if there a new sections they will get added - - if {![db_0or1row section_exists "select res_id from ims_cp_resources where identifier=:section_item_id and man_id=:man_id"]} { + if {![db_0or1row section_exists \ + "select res_id + from ims_cp_resources + where identifier=:section_item_id + and man_id=:man_id"]} { + set res_id [lors::imscp::resource_add_from_object \ + -man_id $man_id \ + -object_id $section_item_id \ + -folder_id $item_folder_id] + } + + if {![db_0or1row item_exists \ + "select ims_item_id as item_id + from ims_cp_items + where org_id=:org_id + and identifier='as_sections_' || :section_item_id"]} { + set item_id [lors::imscp::item_add_from_object \ + -object_id $section_item_id \ + -org_id $org_id \ + -folder_id $item_folder_id \ + -title $section_title] + lors::imscp::item_to_resource_add \ + -item_id $item_id \ + -res_id $res_id + } + + # FIXME see if anyone is using this resource + # already. objects should be # able to be resources + # without being tied to one manifest, # since you can use + # a resource in more than one course and # it doesn't make + # sense to have a seperate row every time # we reuse an + # object DAVEB 2070321 - of course, it adds complexity and + # special handling, and this works for now. + } + + } wiki { + set page [::Generic::CrItem instantiate \ + -item_id $existing_object] + $page instvar {title page_title} {name page_name} + if {![db_0or1row res_exists \ + "select res_id + from ims_cp_resources + where identifier=:existing_object + and man_id=:man_id"]} { set res_id [lors::imscp::resource_add_from_object \ -man_id $man_id \ - -object_id $section_item_id \ + -object_id $existing_object \ -folder_id $item_folder_id] - } - if {![db_0or1row item_exists "select ims_item_id as item_id from ims_cp_items where org_id=:org_id and identifier='as_sections_' || :section_item_id"]} { + } + + if {![db_0or1row item_exists \ + "select ims_item_id + from ims_cp_items + where org_id=:org_id + and identifier='::xowiki::Page_' || :existing_object"]} { set item_id [lors::imscp::item_add_from_object \ - -object_id $section_item_id \ - -org_id $org_id \ - -folder_id $item_folder_id \ - -title $section_title] - lors::imscp::item_to_resource_add \ - -item_id $item_id \ - -res_id $res_id + -object_id $existing_object \ + -org_id $org_id \ + -folder_id $item_folder_id \ + -title $page_title] + } + # FIXME see if anyone is using this resource + # already. objects should be # able to be resources + # without being tied to one manifest, # since you can use + # a resource in more than one course and # it doesn't make + # sense to have a seperate row every time # we reuse an + # object - } - - # FIXME see if anyone is using this resource - # already. objects should be # able to be resources - # without being tied to one manifest, # since you can use - # a resource in more than one course and # it doesn't make - # sense to have a seperate row every time # we reuse an - # object DAVEB 2070321 - of course, it adds complexity and - # special handling, and this works for now. - - } + lors::imscp::item_to_resource_add \ + -item_id $item_id \ + -res_id $res_id + } } - wiki { - - set page [::Generic::CrItem instantiate \ - -item_id $existing_object] - $page instvar {title page_title} {name page_name} - if {![db_0or1row res_exists "select res_id from ims_cp_resources where identifier=:existing_object and man_id=:man_id"]} { - set res_id [lors::imscp::resource_add_from_object \ - -man_id $man_id \ - -object_id $existing_object \ - -folder_id $item_folder_id] - } - if {![db_0or1row item_exists "select ims_item_id from ims_cp_items where org_id=:org_id and identifier='::xowiki::Page_' || :existing_object"]} { - set item_id [lors::imscp::item_add_from_object \ - -object_id $existing_object \ - -org_id $org_id \ - -folder_id $item_folder_id \ - -title $page_title] - } - # FIXME see if anyone is using this resource - # already. objects should be # able to be resources - # without being tied to one manifest, # since you can use - # a resource in more than one course and # it doesn't make - # sense to have a seperate row every time # we reuse an - # object - - lors::imscp::item_to_resource_add \ - -item_id $item_id \ - -res_id $res_id + ad_returnredirect $return_url + ad_script_abort + } - } - } - ad_returnredirect $return_url - ad_script_abort -} +ad_form \ + -name new \ + -export {man_id add_type} \ + -form { + {name:text(text) {label "Name"}} -ad_form -name new -export {man_id add_type} -form { - {name:text(text) {label "Name"}} -} -on_submit { - switch $add_type { - wiki { - set url [export_vars -base /wiki/edit {name return_url}] + } -on_submit { + switch $add_type { + wiki { + set url [export_vars -base /wiki/edit {name return_url}] + + } assessment { + set url [export_vars -base ../assessment/asm-admin/assessment-form { name return_url}] + } } - assessment { - set url [export_vars -base ../assessment/asm-admin/assessment-form { name return_url}] - } + ad_returnredirect $url + ad_script_abort } - ad_returnredirect $url - ad_script_abort -} - - - - Index: openacs-4/packages/lors/tcl/apm-callbacks-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/tcl/apm-callbacks-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lors/tcl/apm-callbacks-procs.tcl 7 Jun 2006 13:45:20 -0000 1.2 +++ openacs-4/packages/lors/tcl/apm-callbacks-procs.tcl 17 Nov 2008 13:35:02 -0000 1.3 @@ -14,349 +14,300 @@ Makes the upgrade of lors-central package } { apm_upgrade_logic \ - -from_version_name $from_version_name \ - -to_version_name $to_version_name \ - -spec { - 0.6d3 0.6d4 { - lors::apm_callback::upgrade_code - } - } + -from_version_name $from_version_name \ + -to_version_name $to_version_name \ + -spec { + 0.6d3 0.6d4 { + lors::apm_callback::upgrade_code + } + } } -ad_proc -public lors::apm_callback::upgrade_code { +ad_proc -public lors::apm_callback::upgrade_code { } { set user_id [ad_conn user_id] set creation_ip [ad_conn peeraddr] - + # We get all manifest from copy table so we can create a new cr_item and revision for each one of them - set manifests_list [db_list_of_lists get_all_manifests { select * from ims_cp_manifests_copy }] - + set manifests_list [db_list_of_lists get_all_manifests { + select * + from ims_cp_manifests_copy }] + foreach man_info $manifests_list { - set original_man_id [lindex $man_info 0] - set course_name [lindex $man_info 1] - set man_identifier [lindex $man_info 2] - set version [lindex $man_info 3] - set orgs_default [lindex $man_info 4] - set hasmetadata [lindex $man_info 5] - set parent_man_id [lindex $man_info 6] - set isscorm [lindex $man_info 7] - set folder_id [lindex $man_info 8] - set fs_package_id [lindex $man_info 9] - set isshared [lindex $man_info 10] - set package_id [lindex $man_info 11] - - # First we create the folder that will hold all new cr_items - db_1row get_folder_info { - select - name as cr_dir, - parent_id - from - cr_items - where - item_id = :folder_id - } + set original_man_id [lindex $man_info 0] + set course_name [lindex $man_info 1] + set man_identifier [lindex $man_info 2] + set version [lindex $man_info 3] + set orgs_default [lindex $man_info 4] + set hasmetadata [lindex $man_info 5] + set parent_man_id [lindex $man_info 6] + set isscorm [lindex $man_info 7] + set folder_id [lindex $man_info 8] + set fs_package_id [lindex $man_info 9] + set isshared [lindex $man_info 10] + set package_id [lindex $man_info 11] - set items_parent_id [lors::cr::add_folder -parent_id $parent_id -folder_name "${cr_dir}_items"] - - # Now we have to create a new cr_item and revision for the man_id - set new_man_item_id [content::item::new \ - -name $man_identifier \ - -content_type "ims_manifest_object" \ - -parent_id $items_parent_id \ - -creation_date [dt_sysdate] \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -context_id $package_id] + # First we create the folder that will hold all new cr_items + db_1row get_folder_info { + select name as cr_dir, parent_id + from cr_items + where item_id = :folder_id + } - set new_man_revision_id [content::revision::new \ - -item_id $new_man_item_id \ - -title $man_identifier \ - -description "Upgraded using lors" \ - -creation_date [dt_sysdate] \ - -creation_ip $creation_ip \ - -creation_user $user_id \ - -is_live "t"] - - # We Update the extra information - db_dml update_new_manifest { - update ims_cp_manifests - set - course_name = :course_name, - identifier = :man_identifier, - version = :version, - orgs_default = :orgs_default, - hasmetadata = :hasmetadata, - parent_man_id = :parent_man_id, - isscorm = :isscorm, - folder_id = :folder_id, - fs_package_id = :fs_package_id, - isshared = :isshared - where - man_id = :new_man_revision_id - } + set items_parent_id [lors::cr::add_folder \ + -parent_id $parent_id \ + -folder_name "${cr_dir}_items"] - # We are going to associate the new manifest to classes - db_dml update_manifest_class { - update ims_cp_manifest_class_copy - set - man_id = :new_man_revision_id - where - man_id = :original_man_id - } - db_dml insert_manifest_class { - insert into ims_cp_manifest_class( - man_id, - lorsm_instance_id, - community_id, - class_key, - isenabled, - istrackable - ) select * from ims_cp_manifest_class_copy where man_id = :new_man_revision_id - } + # Now we have to create a new cr_item and revision for the man_id + set new_man_item_id [content::item::new \ + -name $man_identifier \ + -content_type "ims_manifest_object" \ + -parent_id $items_parent_id \ + -creation_date [dt_sysdate] \ + -creation_user $user_id \ + -creation_ip $creation_ip \ + -context_id $package_id] - # Now we want to do the same thing for resources but we need to keep the references to the original man_id - set resources_list [db_list_of_lists get_resources { select * from ims_cp_resources_copy where man_id = :original_man_id }] - foreach res_info $resources_list { - set original_res_id [lindex $res_info 0] - set man_id $new_man_revision_id - set res_identifier [lindex $res_info 2] - set type [lindex $res_info 3] - set href [lindex $res_info 4] - set hasmetadata [lindex $res_info 5] - set scorm_type [lindex $res_info 6] + set new_man_revision_id [content::revision::new \ + -item_id $new_man_item_id \ + -title $man_identifier \ + -description "Upgraded using lors" \ + -creation_date [dt_sysdate] \ + -creation_ip $creation_ip \ + -creation_user $user_id \ + -is_live "t"] - - # Now we have to create a new cr_item and revision for the res_id - set new_res_item_id [content::item::new \ - -name $res_identifier \ - -content_type "ims_resource_object" \ - -parent_id $items_parent_id \ - -creation_date [dt_sysdate] \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -context_id $package_id] - - set new_res_revision_id [content::revision::new \ - -item_id $new_res_item_id \ - -title $res_identifier \ - -description "Upgraded using lors" \ - -creation_date [dt_sysdate] \ - -creation_ip $creation_ip \ - -creation_user $user_id \ - -is_live "t"] - - # We Update the extra information - db_dml update_new_resource { - update ims_cp_resources - set - man_id = :man_id, - identifier = :res_identifier, - type = :type, - href = :href, - hasmetadata = :hasmetadata, - scorm_type = :scorm_type - where - res_id = :new_res_revision_id - } + # We Update the extra information + db_dml update_new_manifest { + update ims_cp_manifests + set course_name = :course_name, + identifier = :man_identifier, + version = :version, + orgs_default = :orgs_default, + hasmetadata = :hasmetadata, + parent_man_id = :parent_man_id, + isscorm = :isscorm, + folder_id = :folder_id, + fs_package_id = :fs_package_id, + isshared = :isshared + where man_id = :new_man_revision_id + } - db_dml update_ims_item_to_resources_copy_res { - update ims_cp_items_to_resources_copy - set - new_res_id = :new_res_revision_id - where - res_id = :original_res_id - } + # We are going to associate the new manifest to classes + db_dml update_manifest_class { + update ims_cp_manifest_class_copy + set man_id = :new_man_revision_id + where man_id = :original_man_id + } - # Now we need to relate all files that are stored on the db - db_dml update_ims_cp_files_copy { - update ims_cp_files_copy - set - res_id = :new_res_revision_id - where - res_id = :original_res_id - } - - db_dml insert_ims_cp_files { - insert into ims_cp_files ( - file_id, - res_id, - pathtofile, - filename, - hasmetadata - ) - select - cr.live_revision as file_id, - if.res_id, - if.pathtofile, - if.filename, - if.hasmetadata - from - ims_cp_files_copy if, - cr_items cr - where - if.res_id = :new_res_revision_id and - if.file_id = cr.item_id - } - - # END foreach res_info - } - - # Now we want to do the same thing for organizations but we need to keep the references to the original man_id - set organizations_list [db_list_of_lists get_organizations { select * from ims_cp_organizations_copy where man_id = :original_man_id }] - foreach org_info $organizations_list { - set original_org_id [lindex $org_info 0] - set org_man_id $new_man_revision_id - set org_identifier [lindex $org_info 2] - set structure [lindex $org_info 3] - set org_title [lindex $org_info 4] - set hasmetadata [lindex $org_info 5] - set isshared [lindex $org_info 6] + db_dml insert_manifest_class { + insert into ims_cp_manifest_class( man_id, lorsm_instance_id, community_id, class_key, isenabled,istrackable) + select * + from ims_cp_manifest_class_copy + where man_id = :new_man_revision_id + } - # Now we have to create a new cr_item and revision for the org_id - set new_org_item_id [content::item::new \ - -name $org_identifier \ - -content_type "ims_organization_object" \ - -parent_id $items_parent_id \ - -creation_date [dt_sysdate] \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -context_id $package_id] - - set new_org_revision_id [content::revision::new \ - -item_id $new_org_item_id \ - -title $org_identifier \ - -description "Upgraded using lors" \ - -creation_date [dt_sysdate] \ - -creation_ip $creation_ip \ - -creation_user $user_id \ - -is_live "t"] - - # We Update the extra information - db_dml update_new_organization { - update ims_cp_organizations - set - man_id = :org_man_id, - identifier = :org_identifier, - structure = :structure, - org_title = :org_title, - hasmetadata = :hasmetadata, - isshared = :isshared - where - org_id = :new_org_revision_id - } + # Now we want to do the same thing for resources but we need to keep the references to the original man_id + set resources_list [db_list_of_lists get_resources { select * from ims_cp_resources_copy where man_id = :original_man_id }] + foreach res_info $resources_list { + set original_res_id [lindex $res_info 0] + set man_id $new_man_revision_id + set res_identifier [lindex $res_info 2] + set type [lindex $res_info 3] + set href [lindex $res_info 4] + set hasmetadata [lindex $res_info 5] + set scorm_type [lindex $res_info 6] - # Now we process the ims_items - set items_list [db_list_of_lists get_items { select * from ims_cp_items_copy where org_id = :original_org_id }] - set sort_order 0 - foreach item_info $items_list { - set original_item_id [lindex $item_info 0] - set org_id $new_org_revision_id - set item_identifier [lindex $item_info 2] - set identifierref [lindex $item_info 3] - set isvisible [lindex $item_info 4] - set parameters [lindex $item_info 5] - set ims_item_title [lindex $item_info 6] - set parent_item [lindex $item_info 7] - set hasmetadata [lindex $item_info 8] - set prerequisites_t [lindex $item_info 9] - set prerequisites_s [lindex $item_info 10] - set type [lindex $item_info 11] - set maxtimeallowed [lindex $item_info 12] - set timelimitaction [lindex $item_info 13] - set datafromlms [lindex $item_info 14] - set masteryscore [lindex $item_info 15] - set isshared [lindex $item_info 16] - incr sort_order - # Now we have to create a new cr_item and revision for the ims_item_id - set new_ims_item_id [content::item::new \ - -name $item_identifier \ - -content_type "ims_item_object" \ - -parent_id $items_parent_id \ - -creation_date [dt_sysdate] \ - -creation_user $user_id \ - -creation_ip $creation_ip \ - -context_id $package_id] - - set new_ims_revision_id [content::revision::new \ - -item_id $new_ims_item_id \ - -title $item_identifier \ - -description "Upgraded using lors" \ - -creation_date [dt_sysdate] \ - -creation_ip $creation_ip \ - -creation_user $user_id \ - -is_live "t"] - - # We Update the extra information - db_dml update_new_ims_item { - update ims_cp_items - set - org_id = :new_org_revision_id, - identifier = :item_identifier, - identifierref = :identifierref, - isvisible = :isvisible, - parameters = :parameters, - ims_item_title = :ims_item_title, - parent_item = :parent_item, - hasmetadata = :hasmetadata, - prerequisites_t = :prerequisites_t, - prerequisites_s = :prerequisites_s, - type = :type, - maxtimeallowed = :maxtimeallowed, - timelimitaction = :timelimitaction, - datafromlms = :datafromlms, - masteryscore = :masteryscore, - isshared = :isshared, - sort_order = :sort_order - where - ims_item_id = :new_ims_revision_id - } + # Now we have to create a new cr_item and revision for the res_id + set new_res_item_id [content::item::new \ + -name $res_identifier \ + -content_type "ims_resource_object" \ + -parent_id $items_parent_id \ + -creation_date [dt_sysdate] \ + -creation_user $user_id \ + -creation_ip $creation_ip \ + -context_id $package_id] - db_dml update_ims_item_to_resources_copy { - update ims_cp_items_to_resources_copy - set - new_ims_item_id = :new_ims_revision_id - where - item_id = :original_item_id - } - - # END foreach item_info - } - # END foreach org_info - } - # END foreach man_info - } + set new_res_revision_id [content::revision::new \ + -item_id $new_res_item_id \ + -title $res_identifier \ + -description "Upgraded using lors" \ + -creation_date [dt_sysdate] \ + -creation_ip $creation_ip \ + -creation_user $user_id \ + -is_live "t"] + # We Update the extra information + db_dml update_new_resource { + update ims_cp_resources + set man_id = :man_id, + identifier = :res_identifier, + type = :type, + href = :href, + hasmetadata = :hasmetadata, + scorm_type = :scorm_type + where res_id = :new_res_revision_id + } + + db_dml update_ims_item_to_resources_copy_res { + update ims_cp_items_to_resources_copy + set new_res_id = :new_res_revision_id + where res_id = :original_res_id + } + + # Now we need to relate all files that are stored on the db + db_dml update_ims_cp_files_copy { + update ims_cp_files_copy + set res_id = :new_res_revision_id + where res_id = :original_res_id + } + + db_dml insert_ims_cp_files { + insert into ims_cp_files (file_id, res_id, pathtofile, filename, hasmetadata) + select cr.live_revision as file_id, if.res_id, if.pathtofile, if.filename,if.hasmetadata + from ims_cp_files_copy if, cr_items cr + where if.res_id = :new_res_revision_id + and if.file_id = cr.item_id + } + }; # END foreach res_info + + # Now we want to do the same thing for organizations but we need to keep the references to the original man_id + set organizations_list [db_list_of_lists get_organizations { select * + from ims_cp_organizations_copy where man_id = :original_man_id }] + foreach org_info $organizations_list { + set original_org_id [lindex $org_info 0] + set org_man_id $new_man_revision_id + set org_identifier [lindex $org_info 2] + set structure [lindex $org_info 3] + set org_title [lindex $org_info 4] + set hasmetadata [lindex $org_info 5] + set isshared [lindex $org_info 6] + + # Now we have to create a new cr_item and revision for the org_id + set new_org_item_id [content::item::new \ + -name $org_identifier \ + -content_type "ims_organization_object" \ + -parent_id $items_parent_id \ + -creation_date [dt_sysdate] \ + -creation_user $user_id \ + -creation_ip $creation_ip \ + -context_id $package_id] + + set new_org_revision_id [content::revision::new \ + -item_id $new_org_item_id \ + -title $org_identifier \ + -description "Upgraded using lors" \ + -creation_date [dt_sysdate] \ + -creation_ip $creation_ip \ + -creation_user $user_id \ + -is_live "t"] + + # We Update the extra information + db_dml update_new_organization { + update ims_cp_organizations + set man_id = :org_man_id, + identifier = :org_identifier, + structure = :structure, + org_title = :org_title, + hasmetadata = :hasmetadata, + isshared = :isshared + where org_id = :new_org_revision_id + } + + # Now we process the ims_items + set items_list [db_list_of_lists get_items { select * + from ims_cp_items_copy where org_id = :original_org_id }] + set sort_order 0 + foreach item_info $items_list { + set original_item_id [lindex $item_info 0] + set org_id $new_org_revision_id + set item_identifier [lindex $item_info 2] + set identifierref [lindex $item_info 3] + set isvisible [lindex $item_info 4] + set parameters [lindex $item_info 5] + set ims_item_title [lindex $item_info 6] + set parent_item [lindex $item_info 7] + set hasmetadata [lindex $item_info 8] + set prerequisites_t [lindex $item_info 9] + set prerequisites_s [lindex $item_info 10] + set type [lindex $item_info 11] + set maxtimeallowed [lindex $item_info 12] + set timelimitaction [lindex $item_info 13] + set datafromlms [lindex $item_info 14] + set masteryscore [lindex $item_info 15] + set isshared [lindex $item_info 16] + incr sort_order + + # Now we have to create a new cr_item and revision for the ims_item_id + set new_ims_item_id [content::item::new \ + -name $item_identifier \ + -content_type "ims_item_object" \ + -parent_id $items_parent_id \ + -creation_date [dt_sysdate] \ + -creation_user $user_id \ + -creation_ip $creation_ip \ + -context_id $package_id] + + set new_ims_revision_id [content::revision::new \ + -item_id $new_ims_item_id \ + -title $item_identifier \ + -description "Upgraded using lors" \ + -creation_date [dt_sysdate] \ + -creation_ip $creation_ip \ + -creation_user $user_id \ + -is_live "t"] + + # We Update the extra information + db_dml update_new_ims_item { + update ims_cp_items + set org_id = :new_org_revision_id, + identifier = :item_identifier, + identifierref = :identifierref, + isvisible = :isvisible, + parameters = :parameters, + ims_item_title = :ims_item_title, + parent_item = :parent_item, + hasmetadata = :hasmetadata, + prerequisites_t = :prerequisites_t, + prerequisites_s = :prerequisites_s, + type = :type, + maxtimeallowed = :maxtimeallowed, + timelimitaction = :timelimitaction, + datafromlms = :datafromlms, + masteryscore = :masteryscore, + isshared = :isshared, + sort_order = :sort_order + where ims_item_id = :new_ims_revision_id + } + + db_dml update_ims_item_to_resources_copy { + update ims_cp_items_to_resources_copy + set new_ims_item_id = :new_ims_revision_id + where item_id = :original_item_id + } + }; # END foreach item_info + }; # END foreach org_info + }; # END foreach man_info + # Now relate the new ims_item_id to the new res_id - db_dml update_ims_cp_itr { - insert - into ims_cp_items_to_resources ( - ims_item_id, - res_id - ) select new_ims_item_id as ims_item_id, new_res_id as res_id from ims_cp_items_to_resources_copy + db_dml update_ims_cp_itr { + insert into ims_cp_items_to_resources (ims_item_id, res_id) + select new_ims_item_id as ims_item_id, new_res_id as res_id + from ims_cp_items_to_resources_copy } - - db_dml drop_tables { - drop table ims_cp_items_to_resources_copy - } - db_dml drop_tables { - drop table ims_cp_items_copy - } - db_dml drop_tables { - drop table ims_cp_files_copy - } - db_dml drop_tables { - drop table ims_cp_resources_copy - } - db_dml drop_tables { - drop table ims_cp_organizations_copy - } - db_dml drop_tables { - drop table ims_cp_manifest_class_copy - } - db_dml drop_tables { - drop table ims_cp_manifests_copy - } - -# END ad_proc -} \ No newline at end of file + + db_dml drop_tables {drop table ims_cp_items_to_resources_copy} + + db_dml drop_tables {drop table ims_cp_items_copy} + + db_dml drop_tables {drop table ims_cp_files_copy} + + db_dml drop_tables {drop table ims_cp_resources_copy} + + db_dml drop_tables {drop table ims_cp_organizations_copy} + + db_dml drop_tables {drop table ims_cp_manifest_class_copy} + + db_dml drop_tables {drop table ims_cp_manifests_copy} +} Index: openacs-4/packages/lors/tcl/lors-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/tcl/lors-callback-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lors/tcl/lors-callback-procs.tcl 7 Jun 2006 13:45:20 -0000 1.2 +++ openacs-4/packages/lors/tcl/lors-callback-procs.tcl 17 Nov 2008 13:35:02 -0000 1.3 @@ -6,6 +6,7 @@ @cvs-id $Id$ } + ad_proc -public -callback lors::import { -res_type -res_href @@ -22,48 +23,46 @@ #Callbacks for application-track -ad_proc -callback application-track::getApplicationName -impl lorsm {} { - callback implementation - } { - return "lorsm" - } - -ad_proc -callback application-track::getGeneralInfo -impl lorsm {} { - callback implementation - } { - db_1row my_query { - select count(1) as result - from ( - select distinct l.course_id - from lorsm_student_track l - where l.community_id=:comm_id - group by l.course_id) as t - } - - return "$result" +ad_proc -callback application-track::getApplicationName -impl lorsm {} { + callback implementation +} { + return "lorsm" +} + + +ad_proc -callback application-track::getGeneralInfo -impl lorsm {} { + callback implementation +} { + db_1row my_query { + select count(1) as result + from ( + select distinct l.course_id + from lorsm_student_track l + where l.community_id=:comm_id + group by l.course_id) as t } -ad_proc -callback application-track::getSpecificInfo -impl lorsm {} { - callback implementation - } { - - upvar $query_name my_query - upvar $elements_name my_elements + return "$result" +} - set my_query { - select d.id,i.course_name,l.start_time,l.end_time - from lorsm_student_track l, dotlrn_users d, ims_cp_manifests i - where l.course_id IN - ( - select distinct l.course_id - from lorsm_student_track l - where l.community_id=:class_instance_id - group by l.course_id) - and l.user_id = d.user_id - and l.course_id = i.man_id - } - - set my_elements "" - return "OK" +ad_proc -callback application-track::getSpecificInfo -impl lorsm {} { + callback implementation +} { + upvar $query_name my_query + upvar $elements_name my_elements + + set my_query { + select d.id,i.course_name,l.start_time,l.end_time + from lorsm_student_track l, dotlrn_users d, ims_cp_manifests i + where l.course_id IN + (select distinct l.course_id + from lorsm_student_track l + where l.community_id=:class_instance_id + group by l.course_id) + and l.user_id = d.user_id + and l.course_id = i.man_id } - \ No newline at end of file + + set my_elements "" + return "OK" +} Index: openacs-4/packages/lors/tcl/lors-cr-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/tcl/lors-cr-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/lors/tcl/lors-cr-procs.tcl 7 Jun 2006 13:52:01 -0000 1.6 +++ openacs-4/packages/lors/tcl/lors-cr-procs.tcl 17 Nov 2008 13:35:02 -0000 1.7 @@ -1,6 +1,6 @@ ad_library { - + @creation-date 2003-10-13 @author Ernie Ghiglione (ErnieG@mm.st) @cvs-id $Id$ @@ -33,14 +33,14 @@ @param fs_dir File System directory } { set files [list] - foreach f [glob -no complain [file join $fs_dir * ]] { - set type [file type $f] - switch $type { - file { - lappend files $f - } - } - } + foreach f [glob -no complain [file join $fs_dir * ]] { + set type [file type $f] + switch $type { + file { + lappend files $f + } + } + } return $files } @@ -55,14 +55,14 @@ @param fs_dir File System directory } { set directories [list] - foreach dir [glob -no complain [file join $fs_dir * ]] { - set type [file type $dir] - switch $type { - directory { - lappend directories $dir - } - } - } + foreach dir [glob -no complain [file join $fs_dir * ]] { + set type [file type $dir] + switch $type { + directory { + lappend directories $dir + } + } + } return $directories } @@ -94,30 +94,32 @@ # regsub -all { +} [string tolower $folder_name] {_} name #return [list $name $folder_name $parent_id $user_id $creation_ip] + # create the folder -# db_transaction { + set folder_id [db_exec_plsql folder_create { + select lors__new_folder (:name, :folder_name, :parent_id, :user_id, :creation_ip); + }] - # create the folder + content::folder::register_content_type \ + -folder_id $folder_id \ + -content_type "content_revision" \ + -include_subtypes "t" - set folder_id [db_exec_plsql folder_create { - select lors__new_folder (:name, :folder_name, :parent_id, :user_id, :creation_ip); - }] + content::folder::register_content_type \ + -folder_id $folder_id \ + -content_type "content_folder" \ + -include_subtypes "t" - content::folder::register_content_type -folder_id $folder_id -content_type "content_revision" \ - -include_subtypes "t" - content::folder::register_content_type -folder_id $folder_id -content_type "content_folder" \ - -include_subtypes "t" - content::folder::register_content_type -folder_id $folder_id -content_type "content_symlink" \ - -include_subtypes "t" - content::folder::register_content_type -folder_id $folder_id -content_type "content_extlink" \ - -include_subtypes "t" + content::folder::register_content_type \ + -folder_id $folder_id \ + -content_type "content_symlink" \ + -include_subtypes "t" - -# } on_error { -# ad_return_error "[_ lors.lt_Error_inserting_folde]" "[_ lors.The_error_was_errmsg]" -# error "[_ lors.The_error_was_errmsg]" -# ad_script_abort -# } + content::folder::register_content_type \ + -folder_id $folder_id \ + -content_type "content_extlink" \ + -include_subtypes "t" + return $folder_id } @@ -128,51 +130,60 @@ {-indb_p:required} } { Adds a bunch of files to a folder in the CR - Returns a list with full_path_to_file, mime-type, parent_id, + Returns a list with full_path_to_file, mime-type, parent_id, file_id, version_id, cr_file, file size. @param parent_id Folder's parent_id where the files will be put @param files All files for the parent_id folder come in one list @param indb_p Whether this file-storage instance (we are about to use) stores files in the file system or in the db - + } { # Get the user set user_id [ad_conn user_id] - + # Get the ip set creation_ip [ad_conn peeraddr] set retlist [list] foreach fle $files { - regexp {[^//\\]+$} $fle filename - set title $filename + regexp {[^//\\]+$} $fle filename + set title $filename set mime_type [cr_filename_to_mime_type -create $fle] # insert file into the CR -# db_transaction { - set description "uploaded using LORs" + set description "uploaded using LORs" - # add file - set file_id [content::item::new -name $title -parent_id $parent_id -creation_user $user_id \ - -creation_ip $creation_ip] + # add file + set file_id [content::item::new \ + -name $title \ + -parent_id $parent_id \ + -creation_user $user_id \ + -creation_ip $creation_ip] - # add revision - set version_id [content::revision::new -title $title -description $description -mime_type $mime_type \ - -creation_user $user_id -creation_ip $creation_ip -item_id $file_id -is_live "t"] + # add revision + set version_id [content::revision::new \ + -title $title \ + -description $description \ + -mime_type $mime_type \ + -creation_user $user_id \ + -creation_ip $creation_ip \ + -item_id $file_id \ + -is_live "t"] - # move the actual file into the CR - set cr_file [cr_create_content_file $file_id $version_id $fle] - # get the size - set file_size [cr_file_size $cr_file] - - # update the file path in the CR and the size on cr_revisions - db_dml update_revi "update cr_revisions set content = '$cr_file', content_length = $file_size where revision_id = :version_id" + # move the actual file into the CR + set cr_file [cr_create_content_file $file_id $version_id $fle] -# } + # get the size + set file_size [cr_file_size $cr_file] + # update the file path in the CR and the size on cr_revisions + db_dml update_revi \ + "update cr_revisions set content = '$cr_file', + content_length = $file_size where revision_id = :version_id" + lappend retlist [list $fle $mime_type $parent_id $file_id $version_id $cr_file $file_size] } return $retlist @@ -183,11 +194,12 @@ -name:required -folder_id:required } { - Get the item_id of a file + Get the item_id of a file } { if {[empty_string_p $folder_id]} { - set package_id [ad_conn package_id] - set folder_id [fs_get_root_folder -package_id $package_id] + set package_id [ad_conn package_id] + set folder_id [fs_get_root_folder -package_id $package_id] } - return [db_exec_plsql get_item_id "select content_item__get_id ( :name, :folder_id, 'f' )"] -} \ No newline at end of file + return [db_exec_plsql get_item_id \ + "select content_item__get_id ( :name, :folder_id, 'f' )"] +} Index: openacs-4/packages/lors/tcl/lors-imscp-blackboard5-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/tcl/lors-imscp-blackboard5-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/lors/tcl/lors-imscp-blackboard5-procs.tcl 18 May 2005 17:13:55 -0000 1.5 +++ openacs-4/packages/lors/tcl/lors-imscp-blackboard5-procs.tcl 17 Nov 2008 13:35:03 -0000 1.6 @@ -69,7 +69,9 @@ if {![empty_string_p dates_node]} { set created [$dates_node child all CREATED] set updated [$dates_node child all UPDATED] - return [list [lors::imsmd::getAtt $created value] [lors::imsmd::getAtt $updated value]] + return [list \ + [lors::imsmd::getAtt $created value] \ + [lors::imsmd::getAtt $updated value]] } else { return "" } @@ -107,7 +109,7 @@ @option name Name of the attribute to get @option node XML node - + @author Ernie Ghiglione (ErnieG@mm.st) } { set navigation [$node child all [string toupper NAVIGATION]] @@ -158,7 +160,7 @@ ad_proc -public lors::imscp::bb::getUsers { -file:required } { - Gets the Blackboard users from the XML resource file where the user info is. + Gets the Blackboard users from the XML resource file where the user info is. Returns a list of user attributes @option file File and filepath to XML file @@ -171,42 +173,45 @@ set userlist [list] set emails [list] foreach user [$usersnode child all USER] { - set user_id [$user getAttribute id] set login_id [[$user getElementsByTagName LOGINID] getAttribute value] set passphrase [[$user getElementsByTagName PASSPHRASE] getAttribute value] set last_names [[$user getElementsByTagName FAMILY] getAttribute value] set first_names [[$user getElementsByTagName GIVEN] getAttribute value] set email [[$user getElementsByTagName EMAIL] getAttribute value] -# For testing purpose only... has to be removed later - + # For testing purpose only... has to be removed later set email $login_id@box.com -# - set creation_date [[$user getElementsByTagName CREATED] getAttribute value] set updated_date [[$user getElementsByTagName UPDATED] getAttribute value] set active [[$user getElementsByTagName ISAVAILABLE] getAttribute value] - set role_value [string tolower [[$user getElementsByTagName ROLE] getAttribute value]] + set role_value [string tolower [ + [$user getElementsByTagName ROLE] getAttribute value]] switch $role_value { instructor { set role "professor" - } - default { + } default { set role "student" } } - set role_description [[$user getElementsByTagName ROLE] getAttribute description] - - lappend userlist [list "user_id" $user_id "login_id" $login_id "passphrase" $passphrase "last_names" $last_names "first_names" $first_names "email" $email \ - "creation_date" $creation_date "updated_date" $updated_date "active" $active "role" $role "role_description" $role_description] + set role_description [ + [$user getElementsByTagName ROLE] getAttribute description] + lappend userlist [list "user_id" $user_id \ + "login_id" $login_id \ + "passphrase" $passphrase \ + "last_names" $last_names \ + "first_names" $first_names \ + "email" $email \ + "creation_date" $creation_date \ + "updated_date" $updated_date \ + "active" $active \ + "role" $role \ + "role_description" $role_description] } - return $userlist - } Index: openacs-4/packages/lors/tcl/lors-imscp-blackboard6-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/tcl/lors-imscp-blackboard6-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/lors/tcl/lors-imscp-blackboard6-procs.tcl 18 May 2005 17:19:46 -0000 1.7 +++ openacs-4/packages/lors/tcl/lors-imscp-blackboard6-procs.tcl 17 Nov 2008 13:35:03 -0000 1.8 @@ -1,7 +1,7 @@ ad_library { IMS Content Packaging functions - for Blackboard 6 + for Blackboard 6 @creation-date 2003-10-13 @author Ernie Ghiglione (ErnieG@mm.st) @@ -40,12 +40,12 @@ @author Ernie Ghiglione (ErnieG@mm.st) } { - return [file exists $tmp_dir/.bb-package-info] + return [file exists $tmp_dir/.bb-package-info] } ad_proc -public lors::imscp::bb6::getItems { - {tree} + {tree} {parent ""} } { Extracts data from Items @@ -59,36 +59,32 @@ set itemx [$tree child all item] if { ![empty_string_p $itemx] } { - if {[empty_string_p $parent]} { set parent 0 } - set it_list "" + set it_list "" foreach itemx [$tree child all item] { - set cc "" - #{$parent}" + # gets item identifier set cc "[lors::imsmd::getAtt $itemx identifier]" # gets item identifierref set cc [concat $cc "[lors::imsmd::getAtt $itemx identifierref]"] - # gets xml node - set cc [concat $cc $itemx] + # gets xml node + set cc [concat $cc $itemx] + set it_list [concat $it_list [list $cc]] - set it_list [concat $it_list [list $cc]] - set itemxx [$itemx child all item] if { ![empty_string_p $itemxx] } { - set it_list [concat $it_list [getItems $itemx]] - } + set it_list [concat $it_list [getItems $itemx]] + } set items [concat $items $cc] } } return $it_list - #$items } @@ -109,6 +105,7 @@ } } + ad_proc -public lors::imscp::bb6::getDescription { -node:required } { @@ -138,7 +135,8 @@ if {![empty_string_p dates_node]} { set created [$dates_node child all CREATED] set updated [$dates_node child all UPDATED] - return [list [lors::imsmd::getAtt $created value] [lors::imsmd::getAtt $updated value]] + return [list \ + [lors::imsmd::getAtt $created value] [lors::imsmd::getAtt $updated value]] } else { return "" } @@ -163,7 +161,6 @@ } else { return "" } - } else { return "" } @@ -176,7 +173,7 @@ @option name Name of the attribute to get @option node XML node - + @author Ernie Ghiglione (ErnieG@mm.st) } { set navigation [$node child all [string toupper NAVIGATION]] @@ -212,7 +209,7 @@ # coursetoc set coursetoc [$doc documentElement] - set list_items [list] + set list_items [list] # gets coursetoc elements and values lappend list_items {id} [lors::imsmd::getAtt $coursetoc id] @@ -231,7 +228,6 @@ # return list return $list_items - } @@ -245,11 +241,11 @@ } { # open xml file set doc [dom parse [::tDOM::xmlReadFile $file]] + # content set content [$doc documentElement] + set list_items [list] - set list_items [list] - # gets content elements and values lappend list_items {id} [lors::imsmd::getAtt $content id] lappend list_items {TITLE} [lors::imsmd::getAtt [$content getElementsByTagName TITLE] value] @@ -275,28 +271,22 @@ set files [list] foreach file [[$content selectNodes /CONTENT/FILES] childNodes] { + set file_list [list] + lappend file_list {file_id} [lors::imsmd::getAtt $file id] + lappend file_list {NAME} [lors::imsmd::getElement [$file getElementsByTagName NAME]] + lappend file_list {FILEACTION} [lors::imsmd::getAtt [$file getElementsByTagName FILEACTION] value] + lappend file_list {LINKNAME} [lors::imsmd::getAtt [$file getElementsByTagName LINKNAME] value] + lappend file_list {SIZE} [lors::imsmd::getAtt [$file getElementsByTagName SIZE] value] + lappend file_list {CREATED} [lors::imsmd::getAtt [$file getElementsByTagName CREATED] value] + lappend file_list {UPDATED} [lors::imsmd::getAtt [$file getElementsByTagName UPDATED] value] - set file_list [list] - lappend file_list {file_id} [lors::imsmd::getAtt $file id] - lappend file_list {NAME} [lors::imsmd::getElement [$file getElementsByTagName NAME]] - lappend file_list {FILEACTION} [lors::imsmd::getAtt [$file getElementsByTagName FILEACTION] value] - lappend file_list {LINKNAME} [lors::imsmd::getAtt [$file getElementsByTagName LINKNAME] value] - lappend file_list {SIZE} [lors::imsmd::getAtt [$file getElementsByTagName SIZE] value] - lappend file_list {CREATED} [lors::imsmd::getAtt [$file getElementsByTagName CREATED] value] - lappend file_list {UPDATED} [lors::imsmd::getAtt [$file getElementsByTagName UPDATED] value] + foreach registryentry [[$file getElementsByTagName REGISTRY] childNodes] { + if {[$registryentry getAttribute key] == "entry_point"} { + lappend file_list {REGISTRY_ENTRY_POINT} [lors::imsmd::getAtt $registryentry value] + } + } - foreach registryentry [[$file getElementsByTagName REGISTRY] childNodes] { - - if {[$registryentry getAttribute key] == "entry_point"} { - - lappend file_list {REGISTRY_ENTRY_POINT} [lors::imsmd::getAtt $registryentry value] - - } - - } - - lappend files $file_list - + lappend files $file_list } lappend list_items {FILES} $files @@ -325,27 +315,26 @@ # check if directory exists if { ![file exists $dirname] } { - # create dir - file mkdir $dirname + file mkdir $dirname } # transforms text into html if {[lors::imscp::bb6::looks_like_html_p -text $txt]} { -# set txt [ad_text_to_html -includes_html $txt] + # set txt [ad_text_to_html -includes_html $txt] } else { - set txt [ad_text_to_html -includes_html $txt] -# set txt [ad_html_text_convert -from "text/plain" -to "text/html" $txt] + set txt [ad_text_to_html -includes_html $txt] + # set txt [ad_html_text_convert -from "text/plain" -to "text/html" $txt] } # saves it on a new html file set f_handler [open $filename w+] fconfigure $f_handler -encoding utf-8 - puts -nonewline $f_handler " \ $txt \" + puts -nonewline $f_handler " \ $txt \" close $f_handler # returns what is is an href for resources return $filename - } @@ -360,10 +349,12 @@ @author Ernie Ghiglione (ErnieG@mm.st) } { - if { [regexp -nocase {

} $text] || [regexp -nocase {
} $text] || [regexp -nocase {} $text] || [regexp -nocase {} $text] } { - return 1 + if { [regexp -nocase {

} $text] || [regexp -nocase {
} $text] || \ + [regexp -nocase {} $text] || \ + [regexp -nocase {} $text] } { + return 1 } else { - return 0 + return 0 } } @@ -381,9 +372,8 @@ set doc [dom parse [::tDOM::xmlReadFile $file]] # content set announcement [$doc documentElement] + set list_items [list] - set list_items [list] - # gets announcement elements and values lappend list_items {id} [lors::imsmd::getAtt $announcement id] lappend list_items {TITLE} [lors::imsmd::getAtt [$announcement getElementsByTagName TITLE] value] @@ -416,12 +406,10 @@ } { if {[lsearch -exact [lindex $resource_files 0] PACKAGE] == -1} { - return 0 + return 0 } else { - return 1 + return 1 } - - } ad_proc -private lors::imscp::bb6::process_package { @@ -431,7 +419,7 @@ -resource:required -entry_point:required } { - Process the BB Packages: makes it IMS CP + Process the BB Packages: makes it IMS CP compliant (rather than BB's weird interpretation of IMS CP). @@ -450,78 +438,71 @@ # file name), then collect all the # unzipped file and # add them as files in the resource. - + # additionally, we need to change the # resource to # point out to the entry_point on the # package. - set path "$tmp_dir/$res_identifier" - + ns_log Notice "WE GOTTA PACKAGE PATH: $path FILE: $zipfile" - + ## ## Unzip file and add those to the # resource and point the href to # the entry_point ## - + # Now we unzip the package file # into the exact directory where # the resource - set errp [catch { exec unzip -jd $path $path/$zipfile } errmsg] - + # catch any errors if {$errp} { - ns_log Notice "lors::imscp::bb6::extract_html doc_bb: package zip error ($errmsg)" - return -code error "lors::imscp::bb6::extract_html doc_bb: package zip error ($errmsg)" + ns_log Notice "lors::imscp::bb6::extract_html doc_bb: package zip error ($errmsg)" + return -code error "lors::imscp::bb6::extract_html doc_bb: package zip error ($errmsg)" } - + # Now we delete the zip file as we # don't need it any more - exec rm -fr $path/$zipfile - + # Also we remove the actual file # children for the resource as # they exist in the BB XMl file as # we are going to replace them now - $resource removeChild [$resource firstChild] - + # now we get all the files in the - # directory. - + # directory. set all_packaged_files [lors::imscp::dir_walk $path] - + foreach filex $all_packaged_files { - # we add the files to the - # resource - - # create the file XML node - set file_doc [dom createDocument file] - set file_nodex [$file_doc documentElement] - - # we get rid of the /tmp/xyz - # part of the path and only - # put the relative href - - regsub $tmp_dir $filex {} filex - - # set the href to the file node - $file_nodex setAttribute href $filex - - # append the file node as child - # for the resource - - $resource appendChild $file_nodex - + # we add the files to the + # resource + + # create the file XML node + set file_doc [dom createDocument file] + set file_nodex [$file_doc documentElement] + + # we get rid of the /tmp/xyz + # part of the path and only + # put the relative href + regsub $tmp_dir $filex {} filex + + # set the href to the file node + $file_nodex setAttribute href $filex + + # append the file node as child + # for the resource + + $resource appendChild $file_nodex } - + # now let's reference the resource # to point to the BB entry_point - + $resource setAttribute href "/$res_identifier/$entry_point" } @@ -541,7 +522,7 @@ # content set forum [$doc documentElement] - set list_items [list] + set list_items [list] # gets forum elements and values lappend list_items {id} [lors::imsmd::getAtt $forum id] @@ -556,7 +537,6 @@ # return list return $list_items - } @@ -566,11 +546,11 @@ -tmp_dir:required -file:required } { - Blackboard 6 by default does not create manifest metadata. - However, it does have some sort of metadata in the res00001.dat + Blackboard 6 by default does not create manifest metadata. + However, it does have some sort of metadata in the res00001.dat file, so we extract that information and create a LOM metadata record - @param tmp_dir temporary directory where the imsmanifest.xml is located. + @param tmp_dir temporary directory where the imsmanifest.xml is located. @option file filename @author Ernie Ghiglione (ErnieG@mm.st) } { @@ -584,53 +564,50 @@ # Check if it has a metadata node for the manifest # If it doesn't let's create one with the description we get from # res00001.dat - + set metadata [$manifest child all metadata] if {[empty_string_p $metadata]} { - - set filex res00001.dat - set docx [dom parse [::tDOM::xmlReadFile $tmp_dir/$filex]] - # gets BB's course info - set course [$docx documentElement] - - set title [lors::imsmd::getAtt [$course selectNodes /COURSE/TITLE] value] - set description [lindex [lors::imsmd::getElement [$course selectNodes /COURSE/DESCRIPTION]] 0] - $docx delete + set filex res00001.dat + set docx [dom parse [::tDOM::xmlReadFile $tmp_dir/$filex]] + # gets BB's course info + set course [$docx documentElement] - # create a metadata node - set docx [dom createDocument metadata] - set metadata [$docx documentElement] + set title [lors::imsmd::getAtt [$course selectNodes /COURSE/TITLE] value] + set description [lindex [lors::imsmd::getElement [$course selectNodes /COURSE/DESCRIPTION]] 0] + $docx delete - set general_node [lors::imsmd::create::lom_general \ - -owner $metadata \ - -title [list en $title] \ - -description [list en $description] \ - ] + # create a metadata node + set docx [dom createDocument metadata] + set metadata [$docx documentElement] - set lom_node [lors::imsmd::create::lom \ - -owner $metadata \ - -general $general_node \ - ] - set md [lors::imsmd::create::md -owner $metadata \ - -schema "IMS Content" \ - -schemaversion "1.1.2" \ - -lom $lom_node \ - ] + set general_node [lors::imsmd::create::lom_general \ + -owner $metadata \ + -title [list en $title] \ + -description [list en $description]] - $manifest insertBefore $md [$manifest child all organizations] + set lom_node [lors::imsmd::create::lom \ + -owner $metadata \ + -general $general_node] - set f_handler [open /tmp/imsmanifest.xml w+] - puts -nonewline $f_handler [$manifest asXML -indent 1 -escapeNonASCII] - close $f_handler - - $doc delete + set md [lors::imsmd::create::md \ + -owner $metadata \ + -schema "IMS Content" \ + -schemaversion "1.1.2" \ + -lom $lom_node] - file copy -force /tmp/imsmanifest.xml $tmp_dir/$file + $manifest insertBefore $md [$manifest child all organizations] + set f_handler [open /tmp/imsmanifest.xml w+] + puts -nonewline $f_handler [$manifest asXML -indent 1 -escapeNonASCII] + close $f_handler + + $doc delete + + file copy -force /tmp/imsmanifest.xml $tmp_dir/$file } } @@ -640,9 +617,9 @@ -tmp_dir:required -file:required } { - This function cleans up a lot of the unused and empty ims_items that Blackboard has when exporting their courses. Apparently Blackboard exports all their application information and sets the availability of these applications within the .dat files. This function looks into some of the Blackboard specific resource types and based on their availability or data, we adapt it to a purer IMS CP standards. + This function cleans up a lot of the unused and empty ims_items that Blackboard has when exporting their courses. Apparently Blackboard exports all their application information and sets the availability of these applications within the .dat files. This function looks into some of the Blackboard specific resource types and based on their availability or data, we adapt it to a purer IMS CP standards. - @param tmp_dir temporary directory where the imsmanifest.xml is located. + @param tmp_dir temporary directory where the imsmanifest.xml is located. @option file filename @author Ernie Ghiglione (ErnieG@mm.st) } { @@ -657,18 +634,14 @@ set organizations [$manifest child all organizations] if { ![empty_string_p $organizations] } { - - set num_organizations [$organizations child all organization] + set num_organizations [$organizations child all organization] - set items 0 + set items 0 - set items_list [list] - foreach organization $num_organizations { - - set items_list [lors::imscp::bb6::getItems $organization] - - } - + set items_list [list] + foreach organization $num_organizations { + set items_list [lors::imscp::bb6::getItems $organization] + } } @@ -677,190 +650,162 @@ # Complain if there's no resources if {[empty_string_p $resources]} { - ad_return_complaint 1 "The package you are trying to upload doesn't have resources. Please check the $file and try again" - ad_script_abort - } + ad_return_complaint 1 "The package you are trying to upload + doesn't have resources. Please check the $file and try again" + ad_script_abort + } set resourcex [$resources child all resource] - set resources_list [list] foreach resource $resourcex { + set res_identifier [lors::imsmd::getResource -node $resource -att identifier] + set res_type [lors::imsmd::getResource -node $resource -att type] + set res_href [lors::imsmd::getResource -node $resource -att href] + set res_dependencies [lors::imsmd::getResource -node $resource -att dependencies] + set res_hasmetadata [lors::imsmd::hasMetadata $resource] + set res_files [lors::imsmd::getResource -node $resource -att files] + set res_scormtype [lors::imsmd::getAtt $resource adlcp:scormtype] - set res_identifier [lors::imsmd::getResource -node $resource -att identifier] - set res_type [lors::imsmd::getResource -node $resource -att type] - set res_href [lors::imsmd::getResource -node $resource -att href] - set res_dependencies [lors::imsmd::getResource -node $resource -att dependencies] - set res_hasmetadata [lors::imsmd::hasMetadata $resource] - set res_files [lors::imsmd::getResource -node $resource -att files] - set res_scormtype [lors::imsmd::getAtt $resource adlcp:scormtype] - - switch $res_type { - - "course/x-bb-coursetoc" { - - set file [lors::imsmd::getAtt $resource bb:file] - array set ernie [lors::imscp::bb6::get_coursetoc -file $tmp_dir/$file] + switch $res_type { + "course/x-bb-coursetoc" { + set file [lors::imsmd::getAtt $resource bb:file] + array set ernie [lors::imscp::bb6::get_coursetoc -file $tmp_dir/$file] + set enabled_p $ernie(ISENABLED) - set enabled_p $ernie(ISENABLED) - - } - - "resource/x-bb-document" { + } "resource/x-bb-document" { + set file [lors::imsmd::getAtt $resource bb:file] + array set ernie [lors::imscp::bb6::get_bb_doc -file $tmp_dir/$file] + set enabled_p $ernie(ISAVAILABLE) - set file [lors::imsmd::getAtt $resource bb:file] - array set ernie [lors::imscp::bb6::get_bb_doc -file $tmp_dir/$file] + } default { + set enabled_p "no_type" + } + } - set enabled_p $ernie(ISAVAILABLE) - - } - - default { - set enabled_p "no_type" - } - - - - } - - lappend resources_list [list [lors::imsmd::getAtt $resource identifier] [lors::imsmd::getAtt $resource type] $resource $enabled_p] - + lappend resources_list [list [lors::imsmd::getAtt $resource identifier] \ + [lors::imsmd::getAtt $resource type] $resource $enabled_p] } # ns_log Notice "HERE IS THE LIST OF ITEMS: ([llength $items_list]) $items_list \nResource list ([llength $resources_list]) $resources_list" - + ns_log Notice "\n\n" foreach item $items_list { - - ns_log Notice "\n------Begin-----\nItem identifier [lindex $item 0]\n" - ns_log Notice "Item resource reference: [lindex $item 1]\n" + ns_log Notice "\n------Begin-----\nItem identifier [lindex $item 0]\n" + ns_log Notice "Item resource reference: [lindex $item 1]\n" + ns_log Notice "Lsearch result: [lsearch -regexp $resources_list [lindex $item 1]]\n" - ns_log Notice "Lsearch result: [lsearch -regexp $resources_list [lindex $item 1]]\n" + set resource [lindex $resources_list [lsearch -regexp $resources_list [lindex $item 1]]] - set resource [lindex $resources_list [lsearch -regexp $resources_list [lindex $item 1]]] + ns_log Notice "is Resource enabled?: [lindex $resource 3]\n" - ns_log Notice "is Resource enabled?: [lindex $resource 3]\n" + if {[lindex $resource 3] == "false"} { + switch [lindex $resource 1] { + "resource/x-bb-document" { + # if the resource is a document and also is false or + # disable, that means (according to my interpretation + # of Blackboard XML files, that these documents are + # only to be rendered to admins, but not to students. - if {[lindex $resource 3] == "false"} { + # Since IMS doesn't have anything to support + # permissions within their own items, then we added an + # attribute as an extension: dotLRN:permission. - switch [lindex $resource 1] { + ns_log Notice "\tDocument Type\n" + ns_log Notice "\tAdding attribute to [lindex $item 2] \n" + [lindex $item 2] setAttributeNS dotLRN dotLRN:permission admin + } "course/x-bb-coursetoc" { - "resource/x-bb-document" { - # if the resource is a document and also is false or - # disable, that means (according to my interpretation - # of Blackboard XML files, that these documents are - # only to be rendered to admins, but not to students. + ns_log Notice "\Coursetoc Type \n" + ns_log Notice "\tAdding attribute to [lindex $item 2] \n" + if {![empty_string_p [[lindex $item 2] child all item]]} { + [lindex $item 2] setAttributeNS dotLRN dotLRN:permission admin + } else { + ns_log Notice "\tdeleting [lindex $item 0] - [lindex $item 2] as it is false\n" + ns_log Notice "\tdeleting node [lindex $item 2] \n" - # Since IMS doesn't have anything to support - # permissions within their own items, then we added an - # attribute as an extension: dotLRN:permission. + [lindex $item 2] delete - ns_log Notice "\tDocument Type\n" - ns_log Notice "\tAdding attribute to [lindex $item 2] \n" - [lindex $item 2] setAttributeNS dotLRN dotLRN:permission admin - } + ns_log Notice "\tand its corresponding resource [lindex $resource 2]\n" + ns_log Notice "\tDeleting files from FS: [lors::imsmd::getResource -node [lindex $resource 2] -att files]\n" + ns_log Notice "\tDeleting dat file: [lors::imsmd::getAtt [lindex $resource 2] bb:file]\n" + exec rm -fr $tmp_dir/[lors::imsmd::getAtt [lindex $resource 2] bb:file] + [lindex $resource 2] delete + } - "course/x-bb-coursetoc" { + } default { - ns_log Notice "\Coursetoc Type \n" - ns_log Notice "\tAdding attribute to [lindex $item 2] \n" - if {![empty_string_p [[lindex $item 2] child all item]]} { - [lindex $item 2] setAttributeNS dotLRN dotLRN:permission admin - } else { - ns_log Notice "\tdeleting [lindex $item 0] - [lindex $item 2] as it is false\n" - ns_log Notice "\tdeleting node [lindex $item 2] \n" - - [lindex $item 2] delete - - ns_log Notice "\tand its corresponding resource [lindex $resource 2]\n" - ns_log Notice "\tDeleting files from FS: [lors::imsmd::getResource -node [lindex $resource 2] -att files]\n" - ns_log Notice "\tDeleting dat file: [lors::imsmd::getAtt [lindex $resource 2] bb:file]\n" - exec rm -fr $tmp_dir/[lors::imsmd::getAtt [lindex $resource 2] bb:file] - [lindex $resource 2] delete - } + if {[empty_string_p [[lindex $item 2] child all item]]} { + ns_log Notice "\tdeleting [lindex $item 0] - [lindex $item 2] as it is false\n" + ns_log Notice "\tdeleting node [lindex $item 2] \n" - } + [lindex $item 2] delete - default { + ns_log Notice "\tand its corresponding resource [lindex $resource 2]\n" + ns_log Notice "\tDeleting files from FS: [lors::imsmd::getResource -node [lindex $resource 2] -att files]\n" + ns_log Notice "\tDeleting dat file: [lors::imsmd::getAtt [lindex $resource 2] bb:file]\n" + exec rm -fr $tmp_dir/[lors::imsmd::getAtt [lindex $resource 2] bb:file] + [lindex $resource 2] delete + } + } + } + } else { + ns_log Notice "\tResource is enabled... therefore nothing to do here\n" + switch [lindex $resource 1] { + "course/x-bb-coursetoc" { + ns_log Notice "Item: [lindex $item 0] [lindex $item 1] + ([lindex $item 2]) has [llength [[lindex $item 2] + child all item]]] items" + if {[empty_string_p [[lindex $item 2] child all item]]} { + # this corsetoc item is childless, + # therefore we nuke it (as it is an + # empty folder + ns_log Notice "Therefore [lindex $item 0] [lindex $item 1] ([lindex $item 2]) we delete it.." - if {[empty_string_p [[lindex $item 2] child all item]]} { - ns_log Notice "\tdeleting [lindex $item 0] - [lindex $item 2] as it is false\n" - ns_log Notice "\tdeleting node [lindex $item 2] \n" - - [lindex $item 2] delete - - ns_log Notice "\tand its corresponding resource [lindex $resource 2]\n" - ns_log Notice "\tDeleting files from FS: [lors::imsmd::getResource -node [lindex $resource 2] -att files]\n" - ns_log Notice "\tDeleting dat file: [lors::imsmd::getAtt [lindex $resource 2] bb:file]\n" - exec rm -fr $tmp_dir/[lors::imsmd::getAtt [lindex $resource 2] bb:file] - [lindex $resource 2] delete - } + [lindex $item 2] delete - } - } - - } else { - ns_log Notice "\tResource is enabled... therefore nothing to do here\n" - switch [lindex $resource 1] { + ns_log Notice "\tand its corresponding resource [lindex $resource 2]\n" + ns_log Notice "\tDeleting files from FS: [lors::imsmd::getResource -node + [lindex $resource 2] -att files]\n" + ns_log Notice "\tDeleting dat file: [lors::imsmd::getAtt [lindex $resource 2] bb:file]\n" + exec rm -fr $tmp_dir/[lors::imsmd::getAtt [lindex $resource 2] bb:file] + [lindex $resource 2] delete + } - "course/x-bb-coursetoc" { - - ns_log Notice "Item: [lindex $item 0] [lindex $item 1] ([lindex $item 2]) has [llength [[lindex $item 2] child all item]]] items" - if {[empty_string_p [[lindex $item 2] child all item]]} { - # this corsetoc item is childless, - # therefore we nuke it (as it is an - # empty folder - ns_log Notice "Therefore [lindex $item 0] [lindex $item 1] ([lindex $item 2]) we delete it.." - - [lindex $item 2] delete - - ns_log Notice "\tand its corresponding resource [lindex $resource 2]\n" - ns_log Notice "\tDeleting files from FS: [lors::imsmd::getResource -node [lindex $resource 2] -att files]\n" - ns_log Notice "\tDeleting dat file: [lors::imsmd::getAtt [lindex $resource 2] bb:file]\n" - exec rm -fr $tmp_dir/[lors::imsmd::getAtt [lindex $resource 2] bb:file] - [lindex $resource 2] delete - } - - } - default { - # this item has good content - ns_log Notice "\t we can't delete [lindex $item 0] - [lindex $item 2] as it has child items -- [[lindex $item 2] child all item]\n" - - } - - } - - } - ns_log Notice "------End------\n" - + } default { + # this item has good content + ns_log Notice "\t we can't delete [lindex $item 0] - [lindex $item 2] as it has child items -- [[lindex $item 2] child all item]\n" + } + } + } + ns_log Notice "------End------\n" } set f_handler [open /tmp/imsmanifest.xml w+] puts -nonewline $f_handler [$manifest asXML -indent 1 -escapeNonASCII] close $f_handler - + $doc delete - + file copy -force /tmp/imsmanifest.xml $tmp_dir/imsmanifest.xml - } ad_proc -public lors::imscp::bb6::extract_html { -tmp_dir:required -file:required } { - This is a massive function that does a lot of things. + This is a massive function that does a lot of things. It extracts the HTML from Blackboard's proprietary .dat files - Cleans ups a lot of unused application data and resources. + Cleans ups a lot of unused application data and resources. (this should be customizable in a different functions) Now it also handles BB packages (a weird way of zipping files) that suppose to be declared in the imsmanifest, but of course they are not. Thanks Blackboard for making interoperability possible (NOT!) - @param tmp_dir temporary directory where the imsmanifest.xml is located. + @param tmp_dir temporary directory where the imsmanifest.xml is located. @option file filename @author Ernie Ghiglione (ErnieG@mm.st) } { @@ -870,344 +815,306 @@ # gets the manifest tree set manifest [$doc documentElement] - # Gets the organizations set organizations [$manifest child all organizations] - if { ![empty_string_p $organizations] } { + set num_organizations [$organizations child all organization] + set items 0 - set num_organizations [$organizations child all organization] - - set items 0 - - foreach organization $num_organizations { - - set items [expr $items + [lors::imscp::countItems $organization]] - - } - + foreach organization $num_organizations { + set items [expr $items + [lors::imscp::countItems $organization]] + } } # gets the resources set resources [$manifest child all resources] # Complain if there's no resources if {[empty_string_p $resources]} { - ad_return_complaint 1 "The package you are trying to upload doesn't have resources. Please check the $file and try again" - ad_script_abort - } + ad_return_complaint 1 "The package you are trying to upload doesn't + have resources. Please check the $file and try again" + ad_script_abort + } set resourcex [$resources child all resource] foreach resource $resourcex { - set res_identifier [lors::imsmd::getResource -node $resource -att identifier] - set res_type [lors::imsmd::getResource -node $resource -att type] - set res_href [lors::imsmd::getResource -node $resource -att href] - set res_dependencies [lors::imsmd::getResource -node $resource -att dependencies] - set res_hasmetadata [lors::imsmd::hasMetadata $resource] - set res_files [lors::imsmd::getResource -node $resource -att files] - set res_scormtype [lors::imsmd::getAtt $resource adlcp:scormtype] + set res_identifier [lors::imsmd::getResource \ + -node $resource \ + -att identifier] + set res_type [lors::imsmd::getResource -node $resource -att type] + set res_href [lors::imsmd::getResource -node $resource -att href] + set res_dependencies [lors::imsmd::getResource \ + -node $resource \ + -att dependencies] + set res_hasmetadata [lors::imsmd::hasMetadata $resource] + set res_files [lors::imsmd::getResource -node $resource -att files] + set res_scormtype [lors::imsmd::getAtt $resource adlcp:scormtype] - switch $res_type { + switch $res_type { + "course/x-bb-coursetoc" { - "course/x-bb-coursetoc" { + set file [lors::imsmd::getAtt $resource bb:file] + array set resourcext [lors::imscp::bb6::get_coursetoc -file $tmp_dir/$file] - set file [lors::imsmd::getAtt $resource bb:file] - array set resourcext [lors::imscp::bb6::get_coursetoc -file $tmp_dir/$file] + ns_log Notice "\n\n$file ($resourcext(ISENABLED)) $resourcext(LABEL)\n" - ns_log Notice "\n\n$file ($resourcext(ISENABLED)) $resourcext(LABEL)\n" + # set content folder to be the appropiate IMS webcontent + # type instead of "couse/x-bb-coursetoc" BB's propietary type + $resource removeAttribute type + $resource removeAttribute bb:file + $resource removeAttribute bb:title + $resource setAttribute type webcontent - # set content folder to be the appropiate IMS webcontent - # type instead of "couse/x-bb-coursetoc" BB's propietary type - $resource removeAttribute type - $resource removeAttribute bb:file - $resource removeAttribute bb:title - $resource setAttribute type webcontent + } "resource/x-bb-document" { + set file [lors::imsmd::getAtt $resource bb:file] + array set resourcext [lors::imscp::bb6::get_bb_doc -file $tmp_dir/$file] - } - "resource/x-bb-document" { + ns_log Notice "\n--resource document Begin\n" + ns_log Notice " ISFOLDER: $resourcext(ISFOLDER)" + ns_log Notice "\n\n $file [llength $resourcext(FILES)] $resourcext(FILES)" - set file [lors::imsmd::getAtt $resource bb:file] - array set resourcext [lors::imscp::bb6::get_bb_doc -file $tmp_dir/$file] + # change the resources type from proprietary BB's + # "resource/x-bb-document" to webcontent as defined by IMS + $resource removeAttribute type + $resource removeAttribute bb:title + $resource setAttribute type webcontent - ns_log Notice "\n--resource document Begin\n" - ns_log Notice " ISFOLDER: $resourcext(ISFOLDER)" - ns_log Notice "\n\n $file [llength $resourcext(FILES)] $resourcext(FILES)" - - # change the resources type from proprietary BB's - # "resource/x-bb-document" to webcontent as defined by IMS - $resource removeAttribute type - $resource removeAttribute bb:title - $resource setAttribute type webcontent - - if { $resourcext(ISFOLDER) == "true" } { + if { $resourcext(ISFOLDER) == "true" } { + if {$resourcext(TEXT) != "{}"} { + ns_log Notice "\n it has text" + set folder [lors::imsmd::getAtt $resource identifier] + set filename $resourcext(id).html + set res_href [lors::imscp::bb6::txt_to_html \ + -txt [lindex $resourcext(TEXT) 0] \ + -filename $tmp_dir/$folder/$filename] - if {$resourcext(TEXT) != "{}"} { + regsub $tmp_dir $res_href {} res_href + ns_log Notice " \n And we set up the attribute to: href $res_href\n" - ns_log Notice "\n it has text" - set folder [lors::imsmd::getAtt $resource identifier] + $resource setAttribute href $res_href - set filename $resourcext(id).html + } else { + ns_log Notice "\n doesn't have text\n" + } - set res_href [lors::imscp::bb6::txt_to_html -txt [lindex $resourcext(TEXT) 0] -filename $tmp_dir/$folder/$filename] + } else { + # if it ain't a folder - regsub $tmp_dir $res_href {} res_href - ns_log Notice " \n And we set up the attribute to: href $res_href\n" + # check if the content of TEXT tag is HTML or not + # If it is, then we need to assume that TEXT has + # embedded HTML code that references to the files + # under the FILES tag (this could be a bit tricky, but + # there's not much we can do for now) - $resource setAttribute href $res_href + ns_log Notice "\nlist of files: [lindex $resourcext(FILES) 0]\n" - } else { - ns_log Notice "\n doesn't have text\n" + if { $resourcext(TYPE) == "H" } { + if {$resourcext(TEXT) != "{}"} { + ns_log Notice "\n it has text" + set content [lindex $resourcext(TEXT) 0] - - } - - } else { - # if it ain't a folder + # we transform the text into HTML if required + if {![lors::imscp::bb6::looks_like_html_p \ + -text [lindex $resourcext(TEXT) 0]]} { + set content [ad_html_text_convert \ + -from "text/plain" \ + -to "text/html" [lindex $resourcext(TEXT) 0]] + } else { + set content [lindex $resourcext(TEXT) 0] + } - # check if the content of TEXT tag is HTML or not - # If it is, then we need to assume that TEXT has - # embedded HTML code that references to the files - # under the FILES tag (this could be a bit tricky, but - # there's not much we can do for now) + set folder [lors::imsmd::getAtt $resource identifier] - ns_log Notice "\nlist of files: [lindex $resourcext(FILES) 0]\n" - - if { $resourcext(TYPE) == "H" } { + set filename $resourcext(id).html + set counter 0 + set files_lister "" + set has_packages [lors::imscp::bb6::has_packages \ + -resource_files $resourcext(FILES)] - if {$resourcext(TEXT) != "{}"} { - - ns_log Notice "\n it has text" - set content [lindex $resourcext(TEXT) 0] + foreach file $resourcext(FILES) { + ns_log Notice "\n\t We gotta file: $file\n " - # we transform the text into HTML if required - if {![lors::imscp::bb6::looks_like_html_p -text [lindex $resourcext(TEXT) 0]]} { - set content [ad_html_text_convert -from "text/plain" -to "text/html" [lindex $resourcext(TEXT) 0]] - } else { - set content [lindex $resourcext(TEXT) 0] - } + # We need to find out whether this + # file is a package or just a file to + # be added to the end of the HTML + # TODO - set folder [lors::imsmd::getAtt $resource identifier] + # Here's where we handle BB packages. BB packages + # are a painful thing that BB engineers use to + # complicate the life of other people + # -like me- to get access to their + # files - set filename $resourcext(id).html + # A BB package is a zip file that + # contains a bunch of other file + # within it. There's really *no* + # reason for the BB people to package + # them, but I guess it's just to make + # it more difficult for to inter + # exchange content with other systems. - set counter 0 - set files_lister "" - set has_packages [lors::imscp::bb6::has_packages -resource_files $resourcext(FILES)] + # Does it have a package? - foreach file $resourcext(FILES) { - ns_log Notice "\n\t We gotta file: $file\n " + if {$has_packages != 0} { + lors::imscp::bb6::process_package \ + -tmp_dir $tmp_dir \ + -zipfile [lindex $file 3] \ + -res_identifier $res_identifier \ + -resource $resource \ + -entry_point [lindex $file 15] - # We need to find out whether this - # file is a package or just a file to - # be added to the end of the HTML - # TODO + } else { - # Here's where we handle BB packages. BB packages - # are a painful thing that BB engineers use to - # complicate the life of other people - # -like me- to get access to their - # files + # if this is not a package, then + # it checks whether the files are + # referenced in the content and + # otherwise it adds them - # A BB package is a zip file that - # contains a bunch of other file - # within it. There's really *no* - # reason for the BB people to package - # them, but I guess it's just to make - # it more difficult for to inter - # exchange content with other systems. + if {[regexp [lindex $file 3] $content]} { + ns_log Notice "\t [lindex $file 7]: [lindex $file 3] is referenced\n" + } else { + if {$counter == 0} { + append files_lister "

Files:

\n\n" + regsub -nocase "" $content $files_lister content + } - lors::imscp::bb6::process_package -tmp_dir $tmp_dir \ - -zipfile [lindex $file 3] \ - -res_identifier $res_identifier \ - -resource $resource \ - -entry_point [lindex $file 15] + set res_href [lors::imscp::bb6::txt_to_html \ + -txt $content -filename $tmp_dir/$folder/$filename] - } else { - - # if this is not a package, then - # it checks whether the files are - # referenced in the content and - # otherwise it adds them + regsub $tmp_dir $res_href {} res_href + ns_log Notice " \n And we set up the attribute to: href $res_href\n" - if {[regexp [lindex $file 3] $content]} { - ns_log Notice "\t [lindex $file 7]: [lindex $file 3] is referenced\n" - } else { - if {$counter == 0} { - - append files_lister "

Files:

\n\n" - regsub -nocase "" $content $files_lister content - } + if {$file_href(FILEACTION) == "PACKAGE"} { + lors::imscp::bb6::process_package \ + -tmp_dir $tmp_dir \ + -zipfile $file_href(NAME) \ + -res_identifier $res_identifier \ + -resource $resource \ + -entry_point $file_href(REGISTRY_ENTRY_POINT) + } else { + ns_log Notice "\n the HREF for this file should + be /$res_identifier/$file_href(NAME)\n" + set res_href "/$res_identifier/$file_href(NAME)" + $resource setAttribute href $res_href + } + } else { + set folder [lors::imsmd::getAtt $resource identifier] + set filename $resourcext(id).html - set res_href [lors::imscp::bb6::txt_to_html -txt $content -filename $tmp_dir/$folder/$filename] + # in the case this is type "S" and also + # the resource CONTENTHANDLER = + # resource/x-bb-externallink and + # RENDERTYPE = URL, then we add this link + # to the TEXT (if any) as part of the + # content - regsub $tmp_dir $res_href {} res_href - ns_log Notice " \n And we set up the attribute to: href $res_href\n" + set partial_content [lindex $resourcext(TEXT) 0] - $resource setAttribute href $res_href - } - } + if {$resourcext(CONTENTHANDLER) == "resource/x-bb-externallink" \ + && $resourcext(RENDERTYPE) == "URL"} { + append partial_content "\n

\n\t$resourcext(TITLE)\n

" + } - } else { + set res_href [lors::imscp::bb6::txt_to_html \ + -txt $partial_content \ + -filename $tmp_dir/$folder/$filename] + regsub $tmp_dir $res_href {} res_href + ns_log Notice " \n And we set up the attribute to: href $res_href\n" - if {![empty_string_p [lindex $resourcext(FILES) 0]]} { + $resource setAttribute href $res_href + } + } + } - array set file_href [lindex $resourcext(FILES) 0] + exec rm -fr $tmp_dir/[lors::imsmd::getAtt $resource bb:file] + ns_log Notice "\n--DELETED FILE $tmp_dir/[lors::imsmd::getAtt $resource bb:file]--\n" + $resource removeAttribute bb:file + ns_log Notice "\n--resource document END--\n" - if {$file_href(FILEACTION) == "PACKAGE"} { - lors::imscp::bb6::process_package -tmp_dir $tmp_dir \ - -zipfile $file_href(NAME) \ - -res_identifier $res_identifier \ - -resource $resource \ - -entry_point $file_href(REGISTRY_ENTRY_POINT) - } else { - - ns_log Notice "\n the HREF for this file should be /$res_identifier/$file_href(NAME)\n" - - set res_href "/$res_identifier/$file_href(NAME)" - - $resource setAttribute href $res_href - } + } "assessment/x-bb-qti-survey" { + # if it's not content, then we delete the resource and the + # dat file. + ns_log Notice "\n--resource qti-survey: [lors::imsmd::getAtt $resource bb:file] deleted\n" + exec rm -fr $tmp_dir/[lors::imsmd::getAtt $resource bb:file] + ns_log Notice "Deleting qti-survey resource $resource" + $resource delete - } else { - set folder [lors::imsmd::getAtt $resource identifier] + } "resource/x-bb-announcement" { + ns_log Notice "\n--resource ANNOUNCEMENT \n" + exec rm -fr $tmp_dir/[lors::imsmd::getAtt $resource bb:file] + $resource delete + ns_log Notice "Deleting Announcement resource $resource" + ns_log Notice "Deleting Announcement resource $resource" - set filename $resourcext(id).html + } "resource/x-bb-discussionboard" { + ns_log Notice "\n--resource FORUM POSTING \n" + exec rm -fr $tmp_dir/[lors::imsmd::getAtt $resource bb:file] + $resource delete - # in the case this is type "S" and also - # the resource CONTENTHANDLER = - # resource/x-bb-externallink and - # RENDERTYPE = URL, then we add this link - # to the TEXT (if any) as part of the - # content + } "course/x-bb-gradebook" { + ns_log Notice "\n--resource gradebook: [lors::imsmd::getAtt $resource bb:file] deleted\n" + exec rm -fr $tmp_dir/[lors::imsmd::getAtt $resource bb:file] + $resource delete - set partial_content [lindex $resourcext(TEXT) 0] + } "course/x-bb-coursenavsetting" { + ns_log Notice "\n--resource navsettings: [lors::imsmd::getAtt $resource bb:file] deleted\n" + exec rm -fr $tmp_dir/[lors::imsmd::getAtt $resource bb:file] + $resource delete + } "course/x-bb-courseappsetting" { + ns_log Notice "\n--resource courseappsetting: [lors::imsmd::getAtt $resource bb:file] deleted\n" + exec rm -fr $tmp_dir/[lors::imsmd::getAtt $resource bb:file] + $resource delete - if {$resourcext(CONTENTHANDLER) == "resource/x-bb-externallink" && $resourcext(RENDERTYPE) == "URL"} { - append partial_content "\n

\n\t$resourcext(TITLE)\n

" - } + } "course/x-bb-coursesetting" { + ns_log Notice "\n--resource coursesetting: [lors::imsmd::getAtt $resource bb:file] deleted\n" + exec rm -fr $tmp_dir/[lors::imsmd::getAtt $resource bb:file] + $resource delete - set res_href [lors::imscp::bb6::txt_to_html -txt $partial_content \ - -filename $tmp_dir/$folder/$filename] + } "resource/x-bb-conference" { - regsub $tmp_dir $res_href {} res_href - ns_log Notice " \n And we set up the attribute to: href $res_href\n" + ns_log Notice "\n--resource conference: [lors::imsmd::getAtt $resource bb:file] deleted\n" + exec rm -fr $tmp_dir/[lors::imsmd::getAtt $resource bb:file] + $resource delete - $resource setAttribute href $res_href - - - } - } - } - - exec rm -fr $tmp_dir/[lors::imsmd::getAtt $resource bb:file] - ns_log Notice "\n--DELETED FILE $tmp_dir/[lors::imsmd::getAtt $resource bb:file]--\n" - $resource removeAttribute bb:file - ns_log Notice "\n--resource document END--\n" - - } - "assessment/x-bb-qti-survey" { - - # if it's not content, then we delete the resource and the - # dat file. - ns_log Notice "\n--resource qti-survey: [lors::imsmd::getAtt $resource bb:file] deleted\n" - exec rm -fr $tmp_dir/[lors::imsmd::getAtt $resource bb:file] - ns_log Notice "Deleting qti-survey resource $resource" - $resource delete - - - } - "resource/x-bb-announcement" { - ns_log Notice "\n--resource ANNOUNCEMENT \n" - exec rm -fr $tmp_dir/[lors::imsmd::getAtt $resource bb:file] - $resource delete - ns_log Notice "Deleting Announcement resource $resource" - ns_log Notice "Deleting Announcement resource $resource" - - } - "resource/x-bb-discussionboard" { - ns_log Notice "\n--resource FORUM POSTING \n" - exec rm -fr $tmp_dir/[lors::imsmd::getAtt $resource bb:file] - $resource delete - - } - "course/x-bb-gradebook" { - - ns_log Notice "\n--resource gradebook: [lors::imsmd::getAtt $resource bb:file] deleted\n" - exec rm -fr $tmp_dir/[lors::imsmd::getAtt $resource bb:file] - $resource delete - - } - "course/x-bb-coursenavsetting" { - - ns_log Notice "\n--resource navsettings: [lors::imsmd::getAtt $resource bb:file] deleted\n" - exec rm -fr $tmp_dir/[lors::imsmd::getAtt $resource bb:file] - $resource delete - - } - "course/x-bb-courseappsetting" { - - ns_log Notice "\n--resource courseappsetting: [lors::imsmd::getAtt $resource bb:file] deleted\n" - exec rm -fr $tmp_dir/[lors::imsmd::getAtt $resource bb:file] - $resource delete - - } - "course/x-bb-coursesetting" { - - ns_log Notice "\n--resource coursesetting: [lors::imsmd::getAtt $resource bb:file] deleted\n" - exec rm -fr $tmp_dir/[lors::imsmd::getAtt $resource bb:file] - $resource delete - - } - "resource/x-bb-conference" { - - ns_log Notice "\n--resource conference: [lors::imsmd::getAtt $resource bb:file] deleted\n" - exec rm -fr $tmp_dir/[lors::imsmd::getAtt $resource bb:file] - $resource delete - - } - } - - + } + } } - set f_handler [open /tmp/imsmanifest.xml w+] puts -nonewline $f_handler [$manifest asXML -indent 1 -escapeNonASCII] close $f_handler $doc delete - file copy -force /tmp/imsmanifest.xml $tmp_dir/imsmanifest.xml - } - - -### End Cleanup Functions \ No newline at end of file Index: openacs-4/packages/lors/tcl/lors-imscp-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/tcl/lors-imscp-procs.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/lors/tcl/lors-imscp-procs.tcl 8 Oct 2008 13:01:05 -0000 1.17 +++ openacs-4/packages/lors/tcl/lors-imscp-procs.tcl 17 Nov 2008 13:35:03 -0000 1.18 @@ -23,12 +23,11 @@ namespace eval lors::imscp {} -## begin IMS CP XML extraction and processing +# begin IMS CP XML extraction and processing +# IMS CP XML extraction - # IMS CP XML extraction - ad_proc -public lors::imscp::getItems { - {tree} + {tree} {parent ""} } { Extracts data from Items @@ -43,7 +42,7 @@ set itemx [$tree child all item] if { ![empty_string_p $itemx] } { - + if {[empty_string_p $parent]} { set parent 0 } @@ -62,7 +61,7 @@ # parameters set cc [concat $cc "{[lors::imsmd::getAtt $itemx parameters]}"] - + # gets item title set title [$itemx child all title] if {![empty_string_p $title]} { @@ -77,7 +76,7 @@ } else { set cc [concat $cc 0] } - # set cc [concat $cc [lors::imsmd::hasMetadata $itemx]] + # set cc [concat $cc [lors::imsmd::hasMetadata $itemx]] ## SCORM Extensions # prerequisites @@ -126,18 +125,18 @@ set cc [concat $cc "{}"] } - ## .LRN extensions - # I have added an extensions to IMS items as an attribute - # so we can define permission on different ims_items. The - # attribute is dotLRN:permission. - # if it doesn't exists it keeps default - # permissions. Otherwise it takes the permission as sets - # it accordingly + ## .LRN extensions + # I have added an extensions to IMS items as an attribute + # so we can define permission on different ims_items. The + # attribute is dotLRN:permission. + # if it doesn't exists it keeps default + # permissions. Otherwise it takes the permission as sets + # it accordingly # dotLRN:permission set dotlrn_permission [lors::imsmd::getAtt $itemx dotLRN:permission] - ns_log Notice "lorsm ims_item dotLRN:permission $dotlrn_permission" + ns_log Notice "lorsm ims_item dotLRN:permission $dotlrn_permission" if {![empty_string_p $dotlrn_permission]} { set cc [concat $cc "$dotlrn_permission"] @@ -157,11 +156,11 @@ return $items } - # end IMS CP XML extraction + # end IMS CP XML extraction ad_proc -public lors::imscp::countItems { - {tree} + {tree} } { Counts number of items. Returns an integer. @@ -171,7 +170,6 @@ } { return [llength [$tree getElementsByTagName item]] - } @@ -195,13 +193,12 @@ {-course_presentation_format "-1"} {-man_folder_id ""} {-content_folder_id ""} - } { Inserts a new manifest according to the imsmanifest.xml file. @option man_id manifest id to be inserted. @option course_name the actual name of the course (or resource). - @option identifier intrinsic manifest identifier. + @option identifier intrinsic manifest identifier. @option version version. @option orgs_default default organizations value. @option hasmetadata whether the manifest has metadata (boolean). @@ -216,22 +213,26 @@ @option course_presentation_format course presentation format ID @author Ernie Ghiglione (ErnieG@mm.st) } { - - if {[empty_string_p $user_id]} { + if {[empty_string_p $user_id]} { set user_id [ad_conn user_id] } + if {[empty_string_p $creation_ip]} { set creation_ip [ad_conn peeraddr] } + if {[empty_string_p $package_id]} { set package_id [ad_conn package_id] } + if {[empty_string_p $parent_man_id]} { set parent_man_id 0 } + if {[empty_string_p $isscorm]} { set isscorm 0 } + if {[empty_string_p $content_folder_id]} { set content_folder_id $folder_id } @@ -244,65 +245,79 @@ # in orther to use the CR API. if { ![empty_string_p $man_folder_id]} { - # Get LORSM Manifest Folder folder_id - set parent_id $man_folder_id + # Get LORSM Manifest Folder folder_id + set parent_id $man_folder_id } else { - set parent_id $folder_id + set parent_id $folder_id } - set content_type "ims_manifest_object" + + set content_type "ims_manifest_object" set name "$course_name" if {[empty_string_p $version_id]} { - set item_id [content::item::new -name $name -content_type $content_type -parent_id $parent_id \ - -creation_date [dt_sysdate] -creation_user $user_id -creation_ip $creation_ip -context_id $package_id] - + set item_id [content::item::new \ + -name $name \ + -content_type $content_type \ + -parent_id $parent_id \ + -creation_date [dt_sysdate] \ + -creation_user $user_id \ + -creation_ip $creation_ip \ + -context_id $package_id] + # We give the user_id admin privilege over the item_id so only he/she can make changes to # this course, unless it grants other user privileges - permission::grant -party_id $user_id -object_id $item_id -privilege admin - + permission::grant \ + -party_id $user_id \ + -object_id $item_id \ + -privilege admin + # The new course has for default its isshared value false set isshared f } else { set item_id $version_id - set isshared [db_string get_isshared "select im.isshared from ims_cp_manifests im where im.man_id = ( - select live_revision from cr_items where item_id = :version_id - ) "] + set isshared [db_string get_isshared \ + "select im.isshared + from ims_cp_manifests im + where im.man_id = ( + select live_revision + from cr_items + where item_id = :version_id) "] } - set revision_id [content::revision::new -revision_id $man_id -title $name -content_type $content_type -creation_user $user_id \ - -creation_ip $creation_ip -item_id $item_id -is_live "t"] + set revision_id [content::revision::new \ + -revision_id $man_id \ + -title $name \ + -content_type $content_type \ + -creation_user $user_id \ + -creation_ip $creation_ip \ + -item_id $item_id \ + -is_live "t"] - # Now the new revision_id will be sent to the sql function with the + # Now the new revision_id will be sent to the sql function with the # additional information as before -# db_transaction { - set manifest_id [db_exec_plsql new_manifest { - select ims_manifest__new ( - :course_name, - :identifier, - :version, - :orgs_default, - :hasmetadata, - :parent_man_id, - :isscorm, - :content_folder_id, - :fs_package_id, - current_timestamp, - :user_id, - :creation_ip, - :package_id, - :community_id, - :class_key, - :revision_id, - :isshared, - :course_presentation_format - ); + set manifest_id [db_exec_plsql new_manifest { + select ims_manifest__new ( + :course_name, + :identifier, + :version, + :orgs_default, + :hasmetadata, + :parent_man_id, + :isscorm, + :content_folder_id, + :fs_package_id, + current_timestamp, + :user_id, + :creation_ip, + :package_id, + :community_id, + :class_key, + :revision_id, + :isshared, + :course_presentation_format + );}] - } - ] - -# } - return $manifest_id } @@ -318,15 +333,20 @@ } { db_transaction { if {$delete_all} { - + # FIXME remove ims metadata - # metadata should have on delete casacade - + # metadata should have on delete casacade + # To delete a course we need to # remove file storage items - foreach file_item_id [db_list get_files "select item_id from cr_revisions cr, ims_cp_files f, ims_cp_resources r where f.res_id=r.res_id and r.man_id=:man_id and cr.revision_id=f.file_id"] { + foreach file_item_id [db_list get_files \ + "select item_id + from cr_revisions cr, ims_cp_files f, ims_cp_resources r + where f.res_id=r.res_id + and r.man_id=:man_id + and cr.revision_id=f.file_id"] { # delete related file_storage files content::item::delete -item_id $file_item_id } @@ -335,47 +355,67 @@ # is removed (on delete cascade on res_id) # remove ims_cp_items - foreach item_id [db_list get_items "select cr.item_id from cr_revisions cr, ims_cp_items i, ims_cp_items_to_resources ir, ims_cp_resources r - where - r.man_id=:man_id - and - r.res_id=ir.res_id - and - i.ims_item_id=ir.ims_item_id - and - cr.revision_id=i.ims_item_id"] { - db_dml delete_map "delete from ims_cp_items_map where ims_item_id in (select revision_id from cr_revisions where item_id=:item_id)" -# ad_return_complaint 1 "item_id $item_id ims_item_id $ims_item_id" - content::item::delete -item_id $item_id + foreach item_id [db_list get_items \ + "select cr.item_id + from cr_revisions cr, ims_cp_items i, ims_cp_items_to_resources ir, ims_cp_resources r + where r.man_id=:man_id + and r.res_id=ir.res_id + and i.ims_item_id=ir.ims_item_id + and cr.revision_id=i.ims_item_id"] { + db_dml delete_map \ + "delete from ims_cp_items_map + where ims_item_id in + (select revision_id + from cr_revisions + where item_id=:item_id)" + # ad_return_complaint 1 "item_id $item_id ims_item_id $ims_item_id" + content::item::delete -item_id $item_id } # remove rows in ims_cp_items_to_resources # rows in ims_cp_items_to_resources should be deleted when the # ims_cp_items row is deleted (on delete cascade) - - # remove ims_cp_resources - foreach res_item_id [db_list get_res "select item_id from cr_revisions, ims_cp_resources where revision_id=res_id and man_id=:man_id"] { - content::item::delete -item_id $res_item_id + + # remove ims_cp_resources + foreach res_item_id [db_list get_res \ + "select item_id + from cr_revisions, ims_cp_resources + where revision_id=res_id + and man_id=:man_id"] { + content::item::delete -item_id $res_item_id } + # remove rows in lorsm_cmi_core db_dml delete_cmi "delete from lorsm_cmi_core where man_id=:man_id" + # remove rows in lorsm_student_track db_dml delete_track "delete from lorsm_student_track where course_id = :man_id" # FIXME see if other lorms tables need to be cleaned out # remove ims_cp_organization - foreach org_item_id [db_list get_org "select item_id from cr_revisions, ims_cp_organizations where revision_id=org_id and man_id=:man_id"] { - db_dml delete_map "delete from ims_cp_items_map where org_id in (select revision_id from cr_revisions where item_id=:org_item_id)" - content::item::delete -item_id $org_item_id + foreach org_item_id [db_list get_org \ + "select item_id + from cr_revisions, ims_cp_organizations + where revision_id=org_id + and man_id=:man_id"] { + + db_dml delete_map \ + "delete from ims_cp_items_map + where org_id in (select revision_id + from cr_revisions + where item_id=:org_item_id)" + content::item::delete -item_id $org_item_id } # remove ims_cp_manifest_class # this deletes the association between the course and all dotlrn # classes where it was used - db_dml delete_manifest_class "delete from ims_cp_manifest_class where man_id=:man_id" - + db_dml delete_manifest_class \ + "delete from ims_cp_manifest_class + where man_id=:man_id" } - - set ret [content::item::delete -item_id [content::revision::item_id -revision_id $man_id]] + set ret [content::item::delete \ + -item_id [content::revision::item_id \ + -revision_id $man_id]] } return $ret } @@ -397,7 +437,7 @@ @option org_id organization id to be inserted. @option man_id manifest_id the organization belogs to. - @option identifier intrinsic organization identifier. + @option identifier intrinsic organization identifier. @option structure organization structure. @option title organization title. @option hasmetadata whether the organization has metadata (boolean). @@ -410,49 +450,58 @@ if {[empty_string_p $user_id]} { set user_id [ad_conn user_id] } + if {[empty_string_p $creation_ip]} { set creation_ip [ad_conn peeraddr] } + if {[empty_string_p $package_id]} { set package_id [ad_conn package_id] } - + #--------------------------------------------------------------------------------------# # Since now we dont use acs-objects for the organizations, then a new cr_item and revision # needs to be done to store it. The cr_item and cr_revision are created here # in orther to use the CR API. The item name probably has to change - + # Get LORSM Organizations Folder folder_id set parent_id $org_folder_id - set content_type "ims_organization_object" + set content_type "ims_organization_object" set name "$identifier" - set item_id [content::item::new -name $name -item_id $org_id -content_type $content_type -parent_id $parent_id \ - -creation_date [dt_sysdate] -creation_user $user_id -creation_ip $creation_ip -context_id $package_id] + set item_id [content::item::new \ + -name $name \ + -item_id $org_id \ + -content_type $content_type \ + -parent_id $parent_id \ + -creation_date [dt_sysdate] \ + -creation_user $user_id \ + -creation_ip $creation_ip \ + -context_id $package_id] + set revision_id [content::revision::new \ + -title $name \ + -content_type $content_type \ + -creation_user $user_id \ + -creation_ip $creation_ip \ + -item_id $item_id \ + -is_live "t"] - set revision_id [content::revision::new -title $name -content_type $content_type -creation_user $user_id \ - -creation_ip $creation_ip -item_id $item_id -is_live "t"] + set organization_id [db_exec_plsql new_organization { + select ims_organization__new ( + :org_id, + :man_id, + :identifier, + :structure, + :title, + :hasmetadata, + current_timestamp, + :user_id, + :creation_ip, + :package_id, + :revision_id + ); -# db_transaction { - set organization_id [db_exec_plsql new_organization { - select ims_organization__new ( - :org_id, - :man_id, - :identifier, - :structure, - :title, - :hasmetadata, - current_timestamp, - :user_id, - :creation_ip, - :package_id, - :revision_id - ); - - } - ] - -# } + }] return $organization_id } @@ -464,16 +513,10 @@ @option org_id organization id to be inserted. @author Ernie Ghiglione (ErnieG@mm.st) } { -# db_transaction { - set ret [db_exec_plsql delete_organization { - select ims_organization__delete ( - :org_id - ); - } - ] + set ret [db_exec_plsql delete_organization { + select ims_organization__delete (:org_id);}] -# } return $ret } @@ -505,7 +548,7 @@ @option item_id item id to be inserted. @option org_id organization_id the item belogs to. - @option identifier intrinsic item identifier. + @option identifier intrinsic item identifier. @option identifierref items indentifier reference (use to map with resources) @option isvisible is the item visible?. @option parameters items parameters @@ -526,21 +569,26 @@ @author Ernie Ghiglione (ErnieG@mm.st) } { - if {[empty_string_p $user_id]} { + if {[empty_string_p $user_id]} { set user_id [ad_conn user_id] } + if {[empty_string_p $creation_ip]} { set creation_ip [ad_conn peeraddr] } + if {[empty_string_p $package_id]} { set package_id [ad_conn package_id] } + if {[empty_string_p $isvisible]} { set isvisible 1 } + if {$parent_item == 0} { set parent_item $org_id } + if {[empty_string_p $title]} { set title "No Title" } @@ -552,87 +600,95 @@ # Get LORSM Item Folder folder_id set parent_id $itm_folder_id - set content_type "ims_item_object" + set content_type "ims_item_object" set sysdate [dt_sysdate] set name "$identifier" - set cr_item_id [content::item::new -name $name -item_id $item_id -content_type $content_type -parent_id $parent_id \ - -creation_date [dt_sysdate] -creation_user $user_id -creation_ip $creation_ip \ - -context_id $package_id -description $title] + set cr_item_id [content::item::new \ + -name $name \ + -item_id $item_id \ + -content_type $content_type \ + -parent_id $parent_id \ + -creation_date [dt_sysdate] \ + -creation_user $user_id \ + -creation_ip $creation_ip \ + -context_id $package_id \-description $title] + set revision_id [content::revision::new \ + -title $name \ + -content_type $content_type \ + -creation_user $user_id \ + -creation_ip $creation_ip \ + -item_id $cr_item_id \ + -is_live "t"] - set revision_id [content::revision::new -title $name -content_type $content_type -creation_user $user_id \ - -creation_ip $creation_ip -item_id $cr_item_id -is_live "t"] + set item_id [db_exec_plsql new_item { + select ims_item__new ( + :item_id, + :org_id, + :identifier, + :identifierref, + :isvisible, + :parameters, + :title, + :parent_item, + :hasmetadata, + :prerequisites_t, + :prerequisites_s, + :type, + :maxtimeallowed, + :timelimitaction, + :datafromlms, + :masteryscore, + current_timestamp, + :user_id, + :creation_ip, + :package_id, + :revision_id + ); -# db_transaction { - set item_id [db_exec_plsql new_item { - select ims_item__new ( - :item_id, - :org_id, - :identifier, - :identifierref, - :isvisible, - :parameters, - :title, - :parent_item, - :hasmetadata, - :prerequisites_t, - :prerequisites_s, - :type, - :maxtimeallowed, - :timelimitaction, - :datafromlms, - :masteryscore, - current_timestamp, - :user_id, - :creation_ip, - :package_id, - :revision_id - ); + }] - } - ] + set next_sort_order [db_string get_max \ + "select coalesce(max(sort_order)+1,1) + from ims_cp_items + where org_id=:org_id"] + db_dml set_sort_order \ + "update ims_cp_items + set sort_order = :next_sort_order + where ims_item_id = :item_id" - set next_sort_order [db_string get_max "select coalesce(max(sort_order)+1,1) from ims_cp_items where org_id=:org_id"] - db_dml set_sort_order "update ims_cp_items set sort_order = :next_sort_order where ims_item_id = :item_id" -# } - if {![empty_string_p $dotlrn_permission]} { - - permission::toggle_inherit -object_id $item_id + permission::toggle_inherit -object_id $item_id + #set community_id [dotlrn_community::get_community_id] - #set community_id [dotlrn_community::get_community_id] + # Set read permissions for community/class dotlrn_admin_rel - # Set read permissions for community/class dotlrn_admin_rel + #set party_id_admin [db_string party_id {select segment_id from rel_segments \ + where group_id = :community_id \ + and rel_type = 'dotlrn_admin_rel'}] - #set party_id_admin [db_string party_id {select segment_id from rel_segments \ - where group_id = :community_id \ - and rel_type = 'dotlrn_admin_rel'}] + #permission::grant -party_id $party_id_admin -object_id $item_id -privilege read - #permission::grant -party_id $party_id_admin -object_id $item_id -privilege read - - # Set read permissions for *all* other professors within .LRN - # (so they can see the content) + # Set read permissions for *all* other professors within .LRN + # (so they can see the content) - #set party_id_professor [db_string party_id {select segment_id from rel_segments \ - where rel_type = 'dotlrn_professor_profile_rel'}] + #set party_id_professor [db_string party_id {select segment_id from rel_segments \ + where rel_type = 'dotlrn_professor_profile_rel'}] - #permission::grant -party_id $party_id_professor -object_id $item_id -privilege read + #permission::grant -party_id $party_id_professor -object_id $item_id -privilege read - # Set read permissions for *all* other admins within .LRN - # (so they can see the content) + # Set read permissions for *all* other admins within .LRN + # (so they can see the content) - #set party_id_admins [db_string party_id {select segment_id from rel_segments \ - where rel_type = 'dotlrn_admin_profile_rel'}] + #set party_id_admins [db_string party_id {select segment_id from rel_segments \ + where rel_type = 'dotlrn_admin_profile_rel'}] - #permission::grant -party_id $party_id_admins -object_id $item_id -privilege read + #permission::grant -party_id $party_id_admins -object_id $item_id -privilege read - #ns_log Notice "ims_item_id ($item_id) read permissions granted for community admins" - - + #ns_log Notice "ims_item_id ($item_id) read permissions granted for community admins" } - return $item_id } @@ -645,30 +701,28 @@ @author Ernie Ghiglione (ErnieG@mm.st) } { db_transaction { - content::item::delete -item_id [content::revision::item_id -revision_id $item_id] + content::item::delete \ + -item_id [content::revision::item_id -revision_id $item_id] set ret [db_exec_plsql delete_item { select ims_item__delete ( :item_id ); - - } - ] - -# } + }] + } return $ret } ad_proc -public lors::imscp::addItems { -itm_folder_id:required {-org_id:required} - {itemlist} + {itemlist} {parent ""} {tmp_dir ""} } { - Bulk addition of items. + Bulk addition of items. Returns a list with the item_id and the identifierref of each item. - @option org_id Organization Id that the item belongs to. + @option org_id Organization Id that the item belongs to. @option itemlist list of items to be uploaded @option parent parent item node (items can have subitems). @author Ernie Ghiglione (ErnieG@mm.st) @@ -693,29 +747,29 @@ set p_timelimitaction [lindex $item 9] set p_datafromlms [lindex $item 10] set p_masteryscore [lindex $item 11] - set p_dotlrn_permission [lindex $item 12] + set p_dotlrn_permission [lindex $item 12] if {$p_hasmetadata != 0} { set md_node $p_hasmetadata set p_hasmetadata 1 } set item_id [lors::imscp::item_add \ - -org_id $p_org_id \ - -parent_item $p_parent_item \ - -identifier $p_identifier \ - -identifierref $p_identifierref \ - -isvisible $p_isvisible \ - -title $p_title \ - -hasmetadata $p_hasmetadata \ - -prerequisites_t $p_prerequisites_type \ - -prerequisites_s $p_prerequisites_string \ - -maxtimeallowed $p_maxtimeallowed \ - -timelimitaction $p_timelimitaction \ - -datafromlms $p_datafromlms \ - -masteryscore $p_masteryscore \ - -dotlrn_permission $p_dotlrn_permission \ - -itm_folder_id $itm_folder_id] + -org_id $p_org_id \ + -parent_item $p_parent_item \ + -identifier $p_identifier \ + -identifierref $p_identifierref \ + -isvisible $p_isvisible \ + -title $p_title \ + -hasmetadata $p_hasmetadata \ + -prerequisites_t $p_prerequisites_type \ + -prerequisites_s $p_prerequisites_string \ + -maxtimeallowed $p_maxtimeallowed \ + -timelimitaction $p_timelimitaction \ + -datafromlms $p_datafromlms \ + -masteryscore $p_masteryscore \ + -dotlrn_permission $p_dotlrn_permission \ + -itm_folder_id $itm_folder_id] if {$p_hasmetadata == 1} { set aa [lors::imsmd::addMetadata \ @@ -727,8 +781,9 @@ lappend retlist [list $item_id $p_identifierref] if { [llength $item] > 13} { - set subitem [lors::imscp::addItems -itm_folder_id $itm_folder_id \ - -org_id $p_org_id [lindex $item 13] $item_id $tmp_dir] + set subitem [lors::imscp::addItems \ + -itm_folder_id $itm_folder_id \ + -org_id $p_org_id [lindex $item 13] $item_id $tmp_dir] set retlist [concat $retlist $subitem] } } @@ -766,12 +821,14 @@ @author Ernie Ghiglione (ErnieG@mm.st) } { - if {[empty_string_p $user_id]} { + if {[empty_string_p $user_id]} { set user_id [ad_conn user_id] } + if {[empty_string_p $creation_ip]} { set creation_ip [ad_conn peeraddr] } + if {[empty_string_p $package_id]} { set package_id [ad_conn package_id] } @@ -783,17 +840,26 @@ # Get LORSM Resource Folder folder_id set parent_id $res_folder_id - set content_type "ims_resource_object" + set content_type "ims_resource_object" set name "$identifier" - set item_id [content::item::new -name $name -content_type $content_type -parent_id $parent_id \ - -creation_date [dt_sysdate] -creation_user $user_id -creation_ip $creation_ip -context_id $package_id] + set item_id [content::item::new \ + -name $name \ + -content_type $content_type \ + -parent_id $parent_id \ + -creation_date [dt_sysdate] \ + -creation_user $user_id \ + -creation_ip $creation_ip \ + -context_id $package_id] + set revision_id [content::revision::new \ + -title $name \ + -content_type $content_type \ + -creation_user $user_id \ + -creation_ip $creation_ip \ + -item_id $item_id \ + -is_live "t"] - set revision_id [content::revision::new -title $name -content_type $content_type -creation_user $user_id \ - -creation_ip $creation_ip -item_id $item_id -is_live "t"] - -# db_transaction { - set resource_id [db_exec_plsql new_resource { + set resource_id [db_exec_plsql new_resource { select ims_resource__new ( :res_id, :man_id, @@ -806,16 +872,14 @@ :user_id, :creation_ip, :package_id, - :revision_id + :revision_id ); - } - ] - -# } + }] return $resource_id } + ad_proc -public lors::imscp::resource_delete { -res_id:required } { @@ -825,18 +889,19 @@ @author Ernie Ghiglione (ErnieG@mm.st) } { db_transaction { - content::item::delete -item_id [content::revision::item_id -revision_id $res_id] + content::item::delete \ + -item_id [content::revision::item_id -revision_id $res_id] set ret [db_exec_plsql delete_resource { select ims_resource__delete ( :res_id ); - } - ] + }] } return $ret } + ad_proc -public lors::imscp::item_to_resource_add { -item_id:required -res_id:required @@ -870,17 +935,14 @@ @option identifier dependency identifier. @author Ernie Ghiglione (ErnieG@mm.st) } { -# db_transaction { - set dep_id [db_nextval ims_cp_dependencies_seq] - set dependency [db_exec_plsql dependency_add { - select ims_dependency__new ( - :dep_id, - :res_id, - :identifierref - ); - } - ] -# } + set dep_id [db_nextval ims_cp_dependencies_seq] + set dependency [db_exec_plsql dependency_add { + select ims_dependency__new ( + :dep_id, + :res_id, + :identifierref + ); + }] return $dep_id } @@ -892,15 +954,13 @@ @option dep_id dependency id to be removed. @author Ernie Ghiglione (ErnieG@mm.st) } { -# db_transaction { - set ret [db_exec_plsql delete_resource { - select ims_dependency__delete ( - :dep_id - ); - } - ] -# } + set ret [db_exec_plsql delete_resource { + select ims_dependency__delete ( + :dep_id + ); + + }] return $ret } @@ -921,7 +981,7 @@ @option hasmetadata file metadata (boolean). @author Ernie Ghiglione (ErnieG@mm.st) } { - if {[empty_string_p $hasmetadata]} { + if {[empty_string_p $hasmetadata]} { set hasmetadata 0 } @@ -930,40 +990,37 @@ # catch that before we try to insert them again under the same # resource - set file_exists [db_0or1row file_ex "select file_id from ims_cp_files where file_id = :file_id and res_id = :res_id"] + set file_exists [db_0or1row file_ex \ + "select file_id + from ims_cp_files + where file_id = :file_id + and res_id = :res_id"] if {$file_exists == 0} { -# db_transaction { - set file [db_exec_plsql file_add { - select ims_file__new ( + set file [db_exec_plsql file_add { + select ims_file__new ( :file_id, :res_id, :pathtofile, :filename, :hasmetadata ); - } - ] -# } + }] } return $file_id } - # end IMS CP database transaction functions +# end IMS CP database transaction functions -## end IMS CP XML extraction and processing +# end IMS CP XML extraction and processing +# CP procedures that deal with file processing -### CP procedures that deal with file processing - ad_proc -public lors::imscp::open {} { - Installing IMS/SCORM Service Contracts - } { return " [_ lors.lt_this_thing_is_open_no]" - } ad_proc -public lors::imscp::expand_file { @@ -974,7 +1031,7 @@ Given an uploaded file in file tmpfile with original name upload_file extract the archive and put in a tmp directory which is the return value of the function - + @param upload_file path to the uploaded file @param tmpfile temporary file name @option dest_dir_base name of the directory where the files will be extracted to @@ -983,75 +1040,75 @@ } { set tmp_dir [file join [file dirname $tmpfile] [ns_mktemp "$dest_dir_base-XXXXXX"]] if [catch { ns_mkdir $tmp_dir } errMsg ] { - ns_log Notice "LORS::imscp::expand_file: Error creating directory $tmp_dir: $errMsg" - return -code error "LORS::imscp::expand_file: Error creating directory $tmp_dir: $errMsg" + ns_log Notice "LORS::imscp::expand_file: Error creating directory $tmp_dir: $errMsg" + return -code error "LORS::imscp::expand_file: Error creating directory $tmp_dir: $errMsg" } set upload_file [string trim [string tolower $upload_file]] - + if {[regexp {(.tar.gz|.tgz)$} $upload_file]} { - set type tgz + set type tgz } elseif {[regexp {.tar.z$} $upload_file]} { - set type tgZ + set type tgZ } elseif {[regexp {.tar$} $upload_file]} { - set type tar + set type tar } elseif {[regexp {(.tar.bz2|.tbz2)$} $upload_file]} { - set type tbz2 + set type tbz2 } elseif {[regexp {.zip$} $upload_file]} { - set type zip + set type zip } else { - set type "Uknown type" + set type "Uknown type" } - + switch $type { - tar { - set errp [ catch { exec tar --directory $tmp_dir -xvf $tmpfile } errMsg] - } - tgZ { - set errp [ catch { exec tar --directory $tmp_dir -xZvf $tmpfile } errMsg] - } - tgz { - set errp [ catch { exec tar --directory $tmp_dir -xzvf $tmpfile } errMsg] - } - tbz2 { - set errp [ catch { exec tar --directory $tmp_dir -xjvf $tmpfile } errMsg] - } - zip { - set errp [ catch { exec unzip -d $tmp_dir $tmpfile } errMsg] + tar { + set errp [ catch { exec tar --directory $tmp_dir -xvf $tmpfile } errMsg] - ## According to man unzip: - # unzip exit status: - # - # 0 normal; no errors or warnings - # detected. + } tgZ { + set errp [ catch { exec tar --directory $tmp_dir -xZvf $tmpfile } errMsg] - # 1 one or more warning errors were encountered, but process- - # ing completed successfully anyway. This includes zip- - # files where one or more files was skipped due to unsup- - # ported compression method or encryption with an unknown - # password. + } tgz { + set errp [ catch { exec tar --directory $tmp_dir -xzvf $tmpfile } errMsg] - # Therefor it if it is 1, then it concluded successfully - # but with warnings, so we switch it back to 0 + } tbz2 { + set errp [ catch { exec tar --directory $tmp_dir -xjvf $tmpfile } errMsg] - if {$errp == 1} { - set errp 0 - } - } - default { - set errp 1 - set errMsg " [_ lors.lt_dont_know_how_to_extr] $upload_file" - } + } zip { + set errp [ catch { exec unzip -d $tmp_dir $tmpfile } errMsg] + ## According to man unzip: + # unzip exit status: + # + # 0 normal; no errors or warnings + # detected. + + # 1 one or more warning errors were encountered, but process- + # ing completed successfully anyway. This includes zip- + # files where one or more files was skipped due to unsup- + # ported compression method or encryption with an unknown + # password. + + # Therefor it if it is 1, then it concluded successfully + # but with warnings, so we switch it back to 0 + + if {$errp == 1} { + set errp 0 + } + + } default { + set errp 1 + set errMsg " [_ lors.lt_dont_know_how_to_extr] $upload_file" + } } - + if {$errp} { exec rm -fr $tmp_dir - ns_log Notice "lors::imscp::expand_file: extract type $type failed $errMsg" - return -code error "lors::imscp::expand_file: extract type $type failed $errMsg" + ns_log Notice "lors::imscp::expand_file: extract type $type failed $errMsg" + return -code error "lors::imscp::expand_file: extract type $type failed $errMsg" } return $tmp_dir } + ad_proc -public lors::imscp::dir_walk { dir } { @@ -1064,18 +1121,18 @@ } { set files [list] foreach f [glob -nocomplain [file join $dir *]] { - set type [file type $f] - switch $type { - directory { - set files [concat $files [lors::imscp::dir_walk $f]] - } - file { - lappend files $f - } - default { - # Goofy file types -- just ignore them - } - } + set type [file type $f] + switch $type { + directory { + set files [concat $files [lors::imscp::dir_walk $f]] + + } file { + lappend files $f + + } default { + # Goofy file types -- just ignore them + } + } } return $files } @@ -1087,7 +1144,7 @@ } { Find the manifest file or other file that contains the information about the course. - if it finds it, then it returns the file location. Otherwise it + if it finds it, then it returns the file location. Otherwise it returns 0 @param tmp_dir Temporary directory where the course is located @@ -1096,9 +1153,9 @@ } { if {[file exist $tmp_dir/$file]} { - return "$tmp_dir/$file" + return "$tmp_dir/$file" } else { - return 0 + return 0 } } @@ -1113,8 +1170,8 @@ } { #Now that we are done working on the upload we delete the tmp directory and files if [info exists tmp_dir] { - ns_log Notice "lors::imscp: Deleting $tmp_dir" - exec rm -fr $tmp_dir + ns_log Notice "lors::imscp: Deleting $tmp_dir" + exec rm -fr $tmp_dir } } @@ -1157,43 +1214,53 @@ {-title ""} } { Create an ims cp item from an existing acs_object - + @author Dave Bauer (dave@thedesignexperience.org) @creation-date 2006-06-06 - + @param object_id @param org_id @param folder_id @param parent_item @param title @return ims_item_id - @error + @error } { if {$parent_item eq ""} { set parent_item $org_id } # get the title from acs objects - db_1row get_object "select object_type, title from acs_objects where object_id=:object_id" -column_array object + db_1row get_object \ + "select object_type, title + from acs_objects + where object_id=:object_id" -column_array object + if {$title eq ""} { set title $object(title) } + if {$object(object_type) eq "content_item"} { set object(object_type) [content::item::content_type -item_id $object_id] - } + } + set item_id [lors::imscp::item_add \ -org_id $org_id \ -itm_folder_id $folder_id \ -identifier ${object(object_type)}_${object_id} \ -identifierref $object_id \ -parent_item $parent_item \ -title $title] - db_dml set_sort_order "update ims_cp_items set sort_order = (select coalesce(max(sort_order),0) from ims_cp_items where parent_item=:parent_item) + 1 where ims_item_id=:item_id" + db_dml set_sort_order \ + "update ims_cp_items + set sort_order = (select coalesce(max(sort_order),0) + from ims_cp_items + where parent_item=:parent_item) + 1 + where ims_item_id=:item_id" return $item_id - } ad_proc -public lors::imscp::resource_add_from_object { @@ -1206,19 +1273,22 @@ TODO since resources can be used for any course, we don't need to add a seperate resource for each time an object is used. We should return the existing res_id we just don't do that yet. - + @author Dave Bauer (dave@thedesignexperience.org) @creation-date 2006-06-06 - + @param object_id @param man_id @return res_id - - @error + + @error } { - db_1row get_object "select object_type, title from acs_objects where object_id=:object_id" -column_array object + db_1row get_object \ + "select object_type, title + from acs_objects + where object_id=:object_id" -column_array object if {$object(object_type) eq "content_item"} { set object(object_type) [content::item::content_type -item_id $object_id] } @@ -1239,4 +1309,4 @@ Get indentifier which should help us resolve what object his points to } { return [db_string get_indentifier "" -default ""] -} \ No newline at end of file +} Index: openacs-4/packages/lors/tcl/lors-imsmd-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/tcl/lors-imsmd-procs.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/lors/tcl/lors-imsmd-procs.tcl 17 Oct 2008 10:35:28 -0000 1.10 +++ openacs-4/packages/lors/tcl/lors-imsmd-procs.tcl 17 Nov 2008 13:35:03 -0000 1.11 @@ -29,7 +29,6 @@ @param doc Document @param attr_name Attribute we want to fetch - } { if {[$doc hasAttribute $attr_name] == 1} { $doc getAttribute $attr_name @@ -38,6 +37,7 @@ } } + ad_proc -public HasPrefix { {tree} } { @@ -49,14 +49,15 @@ } { set prefix [$tree prefix] return $prefix - } - + } + + ad_proc -public hasMetadata { {tree} } { Checks if the XML node contains a metadata element returns 1 if true; 0 if false. - Later addition: checks also if the metadata record has + Later addition: checks also if the metadata record has child nodes } { if { ![empty_string_p [$tree child all metadata]] } { @@ -69,7 +70,8 @@ return 0 } } - + + ad_proc -public getMDNode { {tree} } { @@ -81,6 +83,7 @@ return [$tree child all metadata] } + ad_proc -public getMDSchema { {tree} } { @@ -97,15 +100,17 @@ if { ![empty_string_p [$tree child all schema]] } { lappend retlist [getElement [$tree child all schema] asXML] } + if { ![empty_string_p [$tree child all schemaversion]] } { - lappend retlist [getElement [$tree child all schemaversion]] + lappend retlist [getElement [$tree child all schemaversion]] } return $retlist } else { return [list 0 0] } } + ad_proc -public getLOM { {tree} {dir} @@ -125,24 +130,30 @@ set var_lom "lom" set prefix "" set lom [$tree child all $var_lom] + } elseif { ![empty_string_p [$tree child all imsmd:lom]] } { set var_lom "imsmd:lom" set prefix [[$tree child all imsmd:lom] prefix] set lom [$tree child all $var_lom] + } elseif { ![empty_string_p [$tree child all record]] } { - # used mostly for IMS Metadata + # used mostly for IMS Metadata set var_lom "record" set prefix "" set lom [$tree child all $var_lom] + } elseif { ![empty_string_p [$tree child all imsmd:record]] } { - # used mostly for IMS Metadata + # used mostly for IMS Metadata set var_lom "imsmd:record" set prefix [[$tree child all imsmd:record] prefix] set lom [$tree child all $var_lom] + } elseif { ![empty_string_p [$tree child all adlcp:location]] } { - set doc [dom parse [::tDOM::xmlReadFile $dir/[ns_urldecode [[$tree child all adlcp:location] text]]]] - set lom [$doc documentElement] + set doc [dom parse [::tDOM::xmlReadFile $dir/[ns_urldecode \ + [[$tree child all adlcp:location] text]]]] + set lom [$doc documentElement] set prefix [$lom prefix] + } else { set lom 0 set prefix 0 @@ -152,7 +163,8 @@ return 0 } } - + + # xmlExtractor extras ad_proc -public xmlExtractor { {element} @@ -163,7 +175,7 @@ } { XML Metadata extractor This is the key MD extractor. - + It uses some different datatypes to extract MD: datatype1 = langstrings @@ -177,7 +189,7 @@ @param element @param tree @param prefix - @param datatype + @param datatype @param att @author Ernie Ghiglione (ErnieG@mm.st) @@ -187,6 +199,7 @@ } else { set md_g_title [$tree child all $prefix:$element] } + if { ![empty_string_p $md_g_title] } { set retlist [list] if {$datatype == 1} { @@ -195,36 +208,42 @@ set retlist "$retlist [getLangStr $one $prefix]" } return $retlist + } elseif {$datatype == 2} { foreach one $md_g_title { #get sources and values set retlist "$retlist [getSourceValue $one $prefix]" } return $retlist + } elseif {$datatype == 3} { foreach one $md_g_title { #get catalogentry set retlist "$retlist [getCatalogEntry $one $prefix]" } return $retlist + } elseif {$datatype == 4} { foreach one $md_g_title { #get date set retlist "$retlist [getDate $one $prefix]" } return $retlist + } elseif {$datatype == 5} { foreach one $md_g_title { #get person / Vcard set retlist "$retlist [getVcard $one $prefix]" } return $retlist + } elseif {$datatype == 6} { foreach one $md_g_title { #get element attribute only. set retlist "$retlist [getAtt $one $att]" } return $retlist + } else { foreach one $md_g_title { #get simple element @@ -233,12 +252,10 @@ return $retlist } } - } ### Datatypes ad_procedures - ad_proc -public getLangStr { {tree} {prefix {}} @@ -255,6 +272,7 @@ } else { set var "langstring" } + set aa [list] set ab [list] set mult 0 @@ -265,13 +283,15 @@ lappend ab $aa incr mult } + if { $mult > 1} { return $ab } else { return $ab } } + ad_proc -public getSourceValue { {tree} {prefix {}} @@ -286,16 +306,19 @@ if { ![empty_string_p $prefix] } { set var_source "$prefix:source" set var_value "$prefix:value" + } else { set var_source "source" set var_value "value" } + set source [$tree child all $var_source] set sv [list] if { ![empty_string_p $source] } { #Gets all the langstrings set sv "$sv [getLangStr $source $prefix]" } + set value [$tree child all $var_value] if { ![empty_string_p $value] } { #Gets all the langstrings @@ -306,8 +329,8 @@ ad_proc -public getCatalogEntry { - {tree} - {prefix {}} + {tree} + {prefix {}} } { Datatype CatalogEntry extractor @@ -319,16 +342,19 @@ if { ![empty_string_p $prefix] } { set var_catalog "$prefix:catalog" set var_entry "$prefix:entry" + } else { set var_catalog "catalog" set var_entry "entry" } + set catalog [$tree child all $var_catalog] set ce [list] if { ![empty_string_p $catalog] } { #Gets all the langstrings set ce "$ce [getElement $catalog $prefix]" } + set entry [$tree child all $var_entry] if { ![empty_string_p $entry] } { #Gets all the langstrings @@ -337,9 +363,10 @@ return [list $ce] } + ad_proc -public getDate { - {tree} - {prefix {}} + {tree} + {prefix {}} } { Datatype Date @@ -351,16 +378,19 @@ if { ![empty_string_p $prefix] } { set var_datetime "$prefix:datetime" set var_description "$prefix:description" + } else { set var_datetime "datetime" set var_description "description" } + set datetime [$tree descendant all $var_datetime] set dt "" if { ![empty_string_p $datetime] } { #Gets all the langstrings set dt [getElement $datetime $prefix] } + set description [$tree descendant all $var_description] if { ![empty_string_p $description] } { #Gets all the langstrings @@ -370,11 +400,10 @@ } - ad_proc -public getElement { - {tree} - {prefix {}} - {att {}} + {tree} + {prefix {}} + {att {}} } { Datatype Element extractor @@ -408,13 +437,14 @@ } else { set var_vcard "vcard" } - + foreach child [$tree child all $var_vcard] { set aa "[$child text]" } return [list $aa] } - + + ## Special Datatypes ad_procedures ad_proc -public getTaxon { {tree} @@ -428,28 +458,26 @@ } { if { ![empty_string_p $prefix] } { set var_taxon $prefix:taxon - } else { set var_taxon taxon } - + set taxon [$tree child all $var_taxon] - if { ![empty_string_p $taxon]} { set taxons $taxon foreach one $taxon { if { ![empty_string_p [$one descendant all $var_taxon]] } { set taxons "$taxons [getTaxon $one $prefix]" - } + } return $taxons } } } ad_proc -public getContribute { - {tree} - {prefix {}} + {tree} + {prefix {}} } { Special extraction of Contributors @@ -463,12 +491,14 @@ set var_role "$prefix:role" set var_centity "$prefix:centity" set var_date "$prefix:date" + } else { set var_contribute "contribute" set var_role "role" set var_centity "centity" set var_date "date" } + set lom_lc_contribute [$tree child all $var_contribute] if { ![empty_string_p $lom_lc_contribute] } { set cont_list [list] @@ -477,6 +507,7 @@ if { ![empty_string_p $role] } { set cont_x [xmlExtractor role $contribute $prefix 2] } + set centity [$contribute child all $var_centity] if { ![empty_string_p $centity] } { set cc [list] @@ -485,6 +516,7 @@ } set cont_x "$cont_x [list $cc]" } + set date [$contribute child all $var_date] if { ![empty_string_p $date] } { set cont_x "$cont_x [list [xmlExtractor date $contribute $prefix 4]]" @@ -495,9 +527,10 @@ } } + ad_proc -public getRequirement { - {tree} - {prefix {}} + {tree} + {prefix {}} } { Gets requirements @@ -511,7 +544,7 @@ } else { set var_requirement "requirement" } - + set lom_te_req [$tree child all $var_requirement] if { ![empty_string_p $lom_te_req] } { # there could be multiple req @@ -527,6 +560,7 @@ } } + ad_proc -public namechild { {a} } { @@ -535,27 +569,26 @@ } { set lix {} foreach node $a { - foreach child [$node child all] {lappend lix [$child localName] [$child prefix]} + foreach child [$node child all] { + lappend lix [$child localName] [$child prefix] + } } return $lix } - ## Metadata extractor function - - ad_proc -public mdGeneral { {-element:required} {-node:required} {-prefix {}} {-att {}} - } { + } { General Metadata extractor returns a list with the attributes and elements if it doesn't exists returns 0 @param element element to retrieve - @param node Node + @param node Node @param prefix Prefix @param att Attribute @author Ernie Ghiglione (ErnieG@mm.st) @@ -566,42 +599,43 @@ } else { set lom_g [$node child all general] } + if { ![empty_string_p $lom_g] } { set retlist [list] switch $element { title { #gets title set retlist [xmlExtractor title $lom_g $prefix 1] - } - catalogentry { + + } catalogentry { #gets catalogentry set retlist [xmlExtractor catalogentry $lom_g $prefix 3] - } - language { + + } language { #gets language set retlist [xmlExtractor language $lom_g $prefix] - } - description { + + } description { #gets description set retlist [xmlExtractor description $lom_g $prefix 1] - } - keyword { + + } keyword { #gets keyword set retlist [xmlExtractor keyword $lom_g $prefix 1] - } - coverage { + + } coverage { #gets coverage set retlist [xmlExtractor coverage $lom_g $prefix 1] - } - structure { + + } structure { #gets structure set retlist [xmlExtractor structure $lom_g $prefix 2] - } - aggregationlevel { + + } aggregationlevel { #gets aggregationlevel set retlist [xmlExtractor aggregationlevel $lom_g $prefix 2] - } - default { + + } default { return 0 } } @@ -610,18 +644,19 @@ return 0 } + ad_proc -public mdLifeCycle { {-element:required} {-node:required} {-prefix {}} {-att {}} - } { + } { Life Cycle Metadata extractor returns a list with the attributes and elements if it doesn't exists returns 0 @param element element to retrieve - @param node Node + @param node Node @param prefix Prefix @param att Attribute @author Ernie Ghiglione (ErnieG@mm.st) @@ -632,22 +667,23 @@ } else { set lom_lc [$node child all lifecycle] } + if { ![empty_string_p $lom_lc] } { set retlist [list] switch $element { version { #gets version set retlist [xmlExtractor version $lom_lc $prefix 1] - } - status { + + } status { #gets status set retlist [xmlExtractor status $lom_lc $prefix 2] - } - contribute { + + } contribute { #gets contribute set retlist [getContribute $lom_lc $prefix] - } - default { + + } default { return 0 } } @@ -656,25 +692,26 @@ return 0 } + ad_proc -public mdMetadata { {-element:required} {-node:required} {-prefix {}} {-att {}} - } { + } { Meta Metadata extractor returns a list with the attributes and elements if it doesn't exists returns 0 @param element element to retrieve - @param node Node + @param node Node @param prefix Prefix @param att Attribute @author Ernie Ghiglione (ErnieG@mm.st) } { if { ![empty_string_p $prefix] } { - set lom_md [$node child all $prefix:metametadata] + set lom_md [$node child all $prefix:metametadata] } else { set lom_md [$node child all metametadata] } @@ -684,16 +721,16 @@ contribute { #gets contribute set retlist [getContribute $lom_md $prefix] - } - catalogentry { + + } catalogentry { #get catalogentry set retlist [xmlExtractor catalogentry $lom_md $prefix 3] - } - metadatascheme { + + } metadatascheme { #get metadatascheme set retlist [xmlExtractor metadatascheme $lom_md $prefix] - } - language { + + } language { #get language set retlist [xmlExtractor language $lom_md $prefix] } @@ -709,13 +746,13 @@ {-node:required} {-prefix {}} {-att {}} - } { + } { Technical Metadata extractor returns a list with the attributes and elements if it doesn't exists returns 0 @param element element to retrieve - @param node Node + @param node Node @param prefix Prefix @param att Attribute @author Ernie Ghiglione (ErnieG@mm.st) @@ -732,32 +769,32 @@ format { #gets format set retlist [xmlExtractor format $lom_te $prefix] - } - location { + + } location { #gets location set retlist [xmlExtractor location $lom_te $prefix 0 type] - } - requirement { + + } requirement { #gets requiremets set retlist [getRequirement $lom_te $prefix] - } - size { + + } size { #gets size set retlist [xmlExtractor size $lom_te $prefix 0] - } - installationremarks { + + } installationremarks { #gets installationremarks set retlist [xmlExtractor installationremarks $lom_te $prefix 1] - } - otherplatformrequirements { + + } otherplatformrequirements { #gets otherplatformrequirements set retlist [xmlExtractor otherplatformrequirements $lom_te $prefix 1] - } - duration { + + } duration { #gets duration set retlist [xmlExtractor duration $lom_te $prefix 4] - } - default { + + } default { return 0 } } @@ -772,13 +809,13 @@ {-node:required} {-prefix {}} {-att {}} - } { + } { Educational Metadata extractor returns a list with the attributes and elements if it doesn't exists returns 0 @param element element to retrieve - @param node Node + @param node Node @param prefix Prefix @param att Attribute @author Ernie Ghiglione (ErnieG@mm.st) @@ -794,70 +831,74 @@ switch $element { interactivitytype { #gets format - set retlist [xmlExtractor interactivitytype $lom_ed $prefix 2] - } - learningresourcetype { + set retlist [xmlExtractor interactivitytype \ + $lom_ed $prefix 2] + + } learningresourcetype { #gets learningresourcetype - set retlist [xmlExtractor learningresourcetype $lom_ed $prefix 2] - } - interactivitylevel { + set retlist [xmlExtractor learningresourcetype \ + $lom_ed $prefix 2] + + } interactivitylevel { #gets interactivitylevel - set retlist [xmlExtractor interactivitylevel $lom_ed $prefix 2] - } - semanticdensity { + set retlist [xmlExtractor interactivitylevel \ + $lom_ed $prefix 2] + + } semanticdensity { #gets semanticdensity set retlist [xmlExtractor semanticdensity $lom_ed $prefix 2] - } - intendedenduserrole { + + } intendedenduserrole { #gets intendedenduserrole - set retlist [xmlExtractor intendedenduserrole $lom_ed $prefix 2] - } - context { + set retlist [xmlExtractor intendedenduserrole \ + $lom_ed $prefix 2] + + } context { #gets context set retlist [xmlExtractor context $lom_ed $prefix 2] - } - typicalagerange { + + } typicalagerange { #gets typicalagerange set retlist [xmlExtractor typicalagerange $lom_ed $prefix 1] - } - difficulty { + + } difficulty { #gets difficulty set retlist [xmlExtractor difficulty $lom_ed $prefix 2] - } - typicallearningtime { + + } typicallearningtime { #gets typicallearningtime set retlist [xmlExtractor typicallearningtime $lom_ed $prefix 4] - } - description { + + } description { #gets description set retlist [xmlExtractor description $lom_ed $prefix 1] - } - language { + + } language { #gets language set retlist [xmlExtractor language $lom_ed $prefix] - } - default { + + } default { return 0 } } return $retlist } return 0 } - + ad_proc -public mdRights { {-element:required} {-node:required} {-prefix {}} {-att {}} - } { + } { Rights Metadata extractor returns a list with the attributes and elements if it doesn't exists returns 0 @param element element to retrieve - @param node Node + @param node Node @param prefix Prefix @param att Attribute @author Ernie Ghiglione (ErnieG@mm.st) @@ -868,40 +909,42 @@ } else { set lom_ri [$node child all rights] } + if { ![empty_string_p $lom_ri] } { set retlist [list] switch $element { cost { #gets cost set retlist [xmlExtractor cost $lom_ri $prefix 2] - } - copyrightandotherrestrictions { + + } copyrightandotherrestrictions { #gets copyrightandotherrestrictions - set retlist [xmlExtractor copyrightandotherrestrictions $lom_ri $prefix 2] - } - description { + set retlist [xmlExtractor copyrightandotherrestrictions \ + $lom_ri $prefix 2] + + } description { #gets description set retlist [xmlExtractor description $lom_ri $prefix 1] - } - default { + + } default { return 0 } } return $retlist } return 0 } - + ad_proc -public mdRelation { {-node:required} {-prefix {}} - } { + } { Relation Metadata extractor returns a list with the attributes and elements if it doesn't exists returns 0 - @param node Node + @param node Node @param prefix Prefix @author Ernie Ghiglione (ErnieG@mm.st) @@ -911,6 +954,7 @@ } else { set lom_re [$node child all relation] } + if { ![empty_string_p $lom_re] } { set retlist [list] foreach relation $lom_re { @@ -923,16 +967,19 @@ } else { set resource [$relation child all resource] } + #printx "Resource ([llength $resource]) " $resource foreach res $resource { # gets resource description - set aa "$aa {[lors::imsmd::xmlExtractor description $res $prefix 1]}" + set aa "$aa {[lors::imsmd::xmlExtractor description + $res $prefix 1]}" # gets resource catalogentry - set aa "$aa {[lors::imsmd::xmlExtractor catalogentry $res $prefix 3]}" + set aa "$aa {[lors::imsmd::xmlExtractor catalogentry + $res $prefix 3]}" } lappend retlist $aa } - return $retlist + return $retlist } return 0 } @@ -941,12 +988,12 @@ ad_proc -public mdAnnotation { {-node:required} {-prefix {}} - } { + } { Annotation Metadata extractor returns a list with the attributes and elements if it doesn't exists returns 0 - @param node Node + @param node Node @param prefix Prefix @author Ernie Ghiglione (ErnieG@mm.st) @@ -956,6 +1003,7 @@ } else { set lom_an [$node child all annotation] } + if { ![empty_string_p $lom_an] } { set retlist [list] foreach annotation $lom_an { @@ -967,24 +1015,23 @@ set aa "$aa {[lors::imsmd::xmlExtractor description $annotation $prefix 1]}" lappend retlist $aa } - return $retlist + return $retlist } return 0 } - + ad_proc -public mdClassification { {-node:required} {-prefix {}} - } { + } { Classification Metadata extractor returns a list with the attributes and elements if it doesn't exists returns 0 - @param node Node + @param node Node @param prefix Prefix @author Ernie Ghiglione (ErnieG@mm.st) - } { if { ![empty_string_p $prefix] } { set lom_cl [$node child all $prefix:classification] @@ -997,20 +1044,21 @@ foreach classification $lom_cl { #gets purpose set aa "{[lors::imsmd::xmlExtractor purpose $classification $prefix 2]}" - + #gets description set aa "$aa {[lors::imsmd::xmlExtractor description $classification $prefix 1]}" - + #gets taxonpath if { ![empty_string_p $prefix] } { set tax [$classification child all $prefix:taxonpath] } else { set tax [$classification child all taxonpath] } + foreach taxonpath $tax { # gets source set bb [lors::imsmd::xmlExtractor source $taxonpath $prefix 1] - + # gets taxons if { ![empty_string_p [lors::imsmd::getTaxon $taxonpath $prefix]] } { set hierarchy 0 @@ -1027,16 +1075,15 @@ } # gets keywords set dd "{[lors::imsmd::xmlExtractor keyword $classification $prefix 1]}" - + lappend retlist "{$aa [list $bbcc] $dd}" } - return $retlist + return $retlist } return 0 } - ad_proc -public getResource { {-node:required} {-att:required} @@ -1045,7 +1092,7 @@ -node the XML node -att the attribute to be extracted - @param node Node + @param node Node @param att Attribute @author Ernie Ghiglione (ErnieG@mm.st) @@ -1054,25 +1101,26 @@ scormtype { # gets the type of resource return [string tolower [lors::imsmd::getAtt $node adlcp:scormtype]] - } - identifier { + + } identifier { # gets identifier return [lors::imsmd::getAtt $node identifier] - } - type { + + } type { # gets type return [lors::imsmd::getAtt $node type] - } - href { + + } href { # gets href return [lors::imsmd::getAtt $node href] - } - files { + + } files { set files [list] # gets files set filex [$node child all file] if { ![empty_string_p $filex] } { foreach file $filex { + # checks for file metadata set file_hasmetadata [lors::imsmd::hasMetadata $file] if {$file_hasmetadata == 1} { @@ -1082,12 +1130,15 @@ #otherwise, just pass 0 (No metadata found) set file_hasmetadata 0 } - lappend files [list [lors::imsmd::getAtt $file href] $file_hasmetadata] + + lappend files [list \ + [lors::imsmd::getAtt $file href] \ + $file_hasmetadata] } } return $files - } - dependencies { + + } dependencies { set dependencies [list] # gets dependencies set depende [$node child all dependency] @@ -1097,42 +1148,40 @@ } } return $dependencies - } - default { + + } default { return [lors::imsmd::getAtt $node $att] } } } - - - + + ad_proc -public getItem { - {tree} + {tree} } { Extracts data from resource\item - @param tree Node + @param tree Node @author Ernie Ghiglione (ErnieG@mm.st) } { set itemx [$tree child all item] - + if { ![empty_string_p $itemx] } { set items [list] foreach itemx [$tree child all item] { - # gets item identifier printx "item identifier: " [getAtt $itemx identifier] - + # gets item identifierref printx "item identifierref: " [getAtt $itemx identifierref] - + # gets item isvisible ? printx "item isvisible: " [getAtt $itemx isvisible] - + # gets item title printx "item title: " [getElement [$itemx child all title]] - + set itemxx [$itemx child all item] if { ![empty_string_p $itemxx] } { printx "

" " " @@ -1145,1108 +1194,1148 @@ ad_proc -public addLOM { - {-lom:required} - {-prefix} - {-acs_object:required} - {-dir {}} + {-lom:required} + {-prefix} + {-acs_object:required} + {-dir {}} } { - Adds LOM metadata for a learning resource. - This is the master function for adding metadata. - This is the MD mama function for entering LOM into the db. + Adds LOM metadata for a learning resource. + This is the master function for adding metadata. + This is the MD mama function for entering LOM into the db. - @param lom the LOM node (XML) for the learning resource - @param acs_object acs object for resource (element) that contains metadata - @param dir dir directory where the imsmanifest.xml file is located. This is use in the case the metadata is in a different file location (adlcp:location). - @author Ernie Ghiglione (ErnieG@mm.st) + @param lom the LOM node (XML) for the learning resource + @param acs_object acs object for resource (element) that contains metadata + @param dir dir directory where the imsmanifest.xml file is located. \ + This is use in the case the metadata is in a different file \ + location (adlcp:location). + @author Ernie Ghiglione (ErnieG@mm.st) } { - set p_ims_md_id $acs_object - set path_to_file $dir + set p_ims_md_id $acs_object + set path_to_file $dir -# db_transaction { - # General + # General - # Title - set titles [lors::imsmd::mdGeneral -element title -node $lom -prefix $prefix] + # Title + set titles [lors::imsmd::mdGeneral -element title -node $lom -prefix $prefix] - # Structure - set structure_s [lindex [lindex [lindex [lors::imsmd::mdGeneral -element structure -node $lom -prefix $prefix] 0] 0] 1] - set structure_v [lindex [lindex [lindex [lors::imsmd::mdGeneral -element structure -node $lom -prefix $prefix] 0] 1] 1] + # Structure + set structure_s [lindex \ + [lindex \ + [lindex [lors::imsmd::mdGeneral \ + -element structure \ + -node $lom \ + -prefix $prefix] 0] 0] 1] + set structure_v [lindex \ + [lindex \ + [lindex [lors::imsmd::mdGeneral \ + -element structure \ + -node $lom \ + -prefix $prefix] 0] 1] 1] - # Aggregation level - set agg_level_s [lindex [lindex [lindex [lors::imsmd::mdGeneral -element aggregationlevel -node $lom -prefix $prefix] 0] 0] 1] - set agg_level_v [lindex [lindex [lindex [lors::imsmd::mdGeneral -element aggregationlevel -node $lom -prefix $prefix] 0] 1] 1] + # Aggregation level + set agg_level_s [lindex \ + [lindex \ + [lindex [lors::imsmd::mdGeneral \ + -element aggregationlevel \ + -node $lom \ + -prefix $prefix] 0] 0] 1] - # Catalogentry - set catalogentries [lors::imsmd::mdGeneral -element catalogentry -node $lom -prefix $prefix] + set agg_level_v [lindex \ + [lindex \ + [lindex [lors::imsmd::mdGeneral \ + -element aggregationlevel \ + -node $lom \ + -prefix $prefix] 0] 1] 1] - # Languages - set languages [lors::imsmd::mdGeneral -element language -node $lom -prefix $prefix] - - # Descriptions - set descriptions [lors::imsmd::mdGeneral -element description -node $lom -prefix $prefix] + # Catalogentry + set catalogentries [lors::imsmd::mdGeneral \ + -element catalogentry \ + -node $lom \ + -prefix $prefix] - # Keywords - set keywords [lors::imsmd::mdGeneral -element keyword -node $lom -prefix $prefix] + # Languages + set languages [lors::imsmd::mdGeneral \ + -element language \ + -node $lom \ + -prefix $prefix] - # Coverages - set coverages [lors::imsmd::mdGeneral -element coverage -node $lom -prefix $prefix] + # Descriptions + set descriptions [lors::imsmd::mdGeneral \ + -element description \ + -node $lom \ + -prefix $prefix] - # Now we insert the values into the DB - db_dml add_new_general { - insert into ims_md_general (ims_md_id, structure_s, structure_v, agg_level_s, agg_level_v) - values - (:p_ims_md_id, :structure_s, :structure_v, :agg_level_s, :agg_level_v) - } + # Keywords + set keywords [lors::imsmd::mdGeneral \ + -element keyword \ + -node $lom \ + -prefix $prefix] + # Coverages + set coverages [lors::imsmd::mdGeneral \ + -element coverage \ + -node $lom \ + -prefix $prefix] - # Adds General Titles + # Now we insert the values into the DB + db_dml add_new_general { + insert into ims_md_general (ims_md_id, structure_s, structure_v, agg_level_s, agg_level_v) + values (:p_ims_md_id, :structure_s, :structure_v, :agg_level_s, :agg_level_v) + } - foreach title $titles { - set p_ims_md_ge_ti_id [db_nextval ims_md_general_title_seq] - set p_title_l [lindex $title 0] - set p_title_s [lindex $title 1] - - db_dml add_new_general_titles { - insert into ims_md_general_title (ims_md_ge_ti_id, ims_md_id, title_l, title_s) - values - (:p_ims_md_ge_ti_id, :p_ims_md_id, :p_title_l, :p_title_s) - } - } + # Adds General Titles - # Adds General Catalog Entries - foreach catalogentry $catalogentries { - set p_ims_md_ge_cata_id [db_nextval ims_md_general_cata_seq] - set p_catalog [lindex $catalogentry 0] - set p_entry_l [lindex [lindex $catalogentry 1] 0] - set p_entry_s [lindex [lindex $catalogentry 1] 1] - - db_dml add_new_general_catalogentries { - - insert into ims_md_general_cata (ims_md_ge_cata_id, ims_md_id, catalog, entry_l, entry_s) - values - (:p_ims_md_ge_cata_id, :p_ims_md_id, :p_catalog, :p_entry_l, :p_entry_s) - } - } + foreach title $titles { + set p_ims_md_ge_ti_id [db_nextval ims_md_general_title_seq] + set p_title_l [lindex $title 0] + set p_title_s [lindex $title 1] - # Adds General Languages - foreach language $languages { - set p_ims_md_ge_lang_id [db_nextval ims_md_general_lang_seq] + db_dml add_new_general_titles { + insert into ims_md_general_title (ims_md_ge_ti_id, ims_md_id, title_l, title_s) + values (:p_ims_md_ge_ti_id, :p_ims_md_id, :p_title_l, :p_title_s) + } - db_dml add_new_general_language { - insert into ims_md_general_lang (ims_md_ge_lang_id, ims_md_id, language) - values - (:p_ims_md_ge_lang_id, :p_ims_md_id, :language) - } - } + } - # Adds General Description - foreach description $descriptions { - set p_ims_md_ge_desc_id [db_nextval ims_md_general_desc_seq] - set p_descrip_l [lindex $description 0] - set p_descrip_s [lindex $description 1] - - db_dml add_new_general_description { - insert into ims_md_general_desc (ims_md_ge_desc_id, ims_md_id, descrip_l, descrip_s) - values - (:p_ims_md_ge_desc_id, :p_ims_md_id, :p_descrip_l, :p_descrip_s) - } - } - - # Adds General Keywords - foreach keyword $keywords { - set p_ims_md_ge_key_id [db_nextval ims_md_general_key_seq] - set p_keyword_l [lindex $keyword 0] - set p_keyword_s [lindex $keyword 1] - - db_dml add_new_general_keyword { - insert into ims_md_general_key (ims_md_ge_key_id, ims_md_id, keyword_l, keyword_s) - values - (:p_ims_md_ge_key_id, :p_ims_md_id, :p_keyword_l, :p_keyword_s) - } - } + # Adds General Catalog Entries + foreach catalogentry $catalogentries { + set p_ims_md_ge_cata_id [db_nextval ims_md_general_cata_seq] + set p_catalog [lindex $catalogentry 0] + set p_entry_l [lindex [lindex $catalogentry 1] 0] + set p_entry_s [lindex [lindex $catalogentry 1] 1] - # Adds General Coverage - foreach coverage $coverages { - set p_ims_md_ge_cove_id [db_nextval ims_md_general_cover_seq] - set p_cover_l [lindex $coverage 0] - set p_cover_s [lindex $coverage 1] - - db_dml add_new_general_coverage { - insert into ims_md_general_cover (ims_md_ge_cove_id, ims_md_id, cover_l, cover_s) - values - (:p_ims_md_ge_cove_id, :p_ims_md_id, :p_cover_l, :p_cover_s) - } - } + db_dml add_new_general_catalogentries { + insert into ims_md_general_cata (ims_md_ge_cata_id, ims_md_id, catalog, entry_l, entry_s) + values (:p_ims_md_ge_cata_id, :p_ims_md_id, :p_catalog, :p_entry_l, :p_entry_s) + } + } - # Lifecycle + # Adds General Languages + foreach language $languages { + set p_ims_md_ge_lang_id [db_nextval ims_md_general_lang_seq] - # Version - set version [lors::imsmd::mdLifeCycle -element version -node $lom -prefix $prefix] - set version_l [lindex [lindex $version 0] 0] - set version_s [lindex [lindex $version 0] 1] - - # Status - set status [lors::imsmd::mdLifeCycle -element status -node $lom -prefix $prefix] - set status_s [lindex [lindex [lindex $status 0] 0] 1] - set status_v [lindex [lindex [lindex $status 0] 1] 1] - - # Contribute - set contributes [lors::imsmd::mdLifeCycle -element contribute -node $lom -prefix $prefix] - - # Adds Lifecycle Version and Status - db_dml add_new_lifecycle { - insert into ims_md_life_cycle (ims_md_id, version_l, version_s, status_s, status_v) - values - (:p_ims_md_id, :version_l, :version_s, :status_s, :status_v) - } + db_dml add_new_general_language { + insert into ims_md_general_lang (ims_md_ge_lang_id, ims_md_id, language) + values (:p_ims_md_ge_lang_id, :p_ims_md_id, :language) + } + } - # Adds Lifecycle Contributes - foreach contribute $contributes { - set p_ims_md_lf_cont_id [db_nextval ims_md_life_cycle_contrib_seq] - set p_role_s [lindex [lindex [lindex $contribute 0] 0] 1] - set p_role_v [lindex [lindex [lindex $contribute 0] 1] 1] - set p_cont_date [lindex [lindex $contribute 2] 0] - set p_cont_date_l [lindex [lindex [lindex $contribute 2] 1] 0] - set p_cont_date_s [lindex [lindex [lindex $contribute 2] 1] 1] - - set p_entities [lindex $contribute 1] - - db_dml add_new_lifecycle_contrib { - insert into ims_md_life_cycle_contrib (ims_md_lf_cont_id, ims_md_id, role_s, role_v, cont_date, cont_date_l, cont_date_s) - values - (:p_ims_md_lf_cont_id, :p_ims_md_id, :p_role_s, :p_role_v, :p_cont_date, :p_cont_date_l, :p_cont_date_s) - } + # Adds General Description + foreach description $descriptions { + set p_ims_md_ge_desc_id [db_nextval ims_md_general_desc_seq] + set p_descrip_l [lindex $description 0] + set p_descrip_s [lindex $description 1] + db_dml add_new_general_description { + insert into ims_md_general_desc (ims_md_ge_desc_id, ims_md_id, descrip_l, descrip_s) + values (:p_ims_md_ge_desc_id, :p_ims_md_id, :p_descrip_l, :p_descrip_s) + } + } - foreach entity $p_entities { - set p_ims_md_lf_cont_enti_id [db_nextval ims_md_life_cycle_contrib_entity_seq] - set p_entity $entity - - db_dml add_new_lifecycle_contrib_entity { - insert into ims_md_life_cycle_contrib_entity (ims_md_lf_cont_enti_id, ims_md_lf_cont_id, entity) - values - (:p_ims_md_lf_cont_enti_id, :p_ims_md_lf_cont_id, :p_entity) - } - } - - } - - # Metadata + # Adds General Keywords + foreach keyword $keywords { + set p_ims_md_ge_key_id [db_nextval ims_md_general_key_seq] + set p_keyword_l [lindex $keyword 0] + set p_keyword_s [lindex $keyword 1] - # Language - set p_language [lors::imsmd::mdMetadata -element language -node $lom -prefix $prefix] - - # Catalogentry - set catalogentries [lors::imsmd::mdMetadata -element catalogentry -node $lom -prefix $prefix] - - # Contribute - set contributes [lors::imsmd::mdMetadata -element contribute -node $lom -prefix $prefix] - - # Metadatascheme - set metadataschemes [lors::imsmd::mdMetadata -element metadatascheme -node $lom -prefix $prefix] + db_dml add_new_general_keyword { + insert into ims_md_general_key (ims_md_ge_key_id, ims_md_id, keyword_l, keyword_s) + values (:p_ims_md_ge_key_id, :p_ims_md_id, :p_keyword_l, :p_keyword_s) + } + } - # Adds Metadata Language - db_dml add_new_metadata { - insert into ims_md_metadata (ims_md_id, language) - values - (:p_ims_md_id, :p_language) - } + # Adds General Coverage + foreach coverage $coverages { + set p_ims_md_ge_cove_id [db_nextval ims_md_general_cover_seq] + set p_cover_l [lindex $coverage 0] + set p_cover_s [lindex $coverage 1] - # Adds Catalogentry - foreach catalogentry $catalogentries { - set p_ims_md_md_cata_id [db_nextval ims_md_metadata_cata_seq] - set p_catalog [lindex $catalogentry 0] - set p_entry_l [lindex [lindex $catalogentry 1] 0] - set p_entry_s [lindex [lindex $catalogentry 1] 1] + db_dml add_new_general_coverage { + insert into ims_md_general_cover (ims_md_ge_cove_id, ims_md_id, cover_l, cover_s) + values (:p_ims_md_ge_cove_id, :p_ims_md_id, :p_cover_l, :p_cover_s) + } + } - db_dml add_new_metadata_catalogentries { - insert into ims_md_metadata_cata (ims_md_md_cata_id, ims_md_id, catalog, entry_l, entry_s) - values - (:p_ims_md_md_cata_id, :p_ims_md_id, :p_catalog, :p_entry_l, :p_entry_s) - } - } + # Lifecycle - # Adds Lifecycle Contributes - foreach contribute $contributes { - set p_ims_md_md_cont_id [db_nextval ims_md_metadata_contrib_seq] - set p_role_s [lindex [lindex [lindex $contribute 0] 0] 1] - set p_role_v [lindex [lindex [lindex $contribute 0] 1] 1] - set p_cont_date [lindex [lindex $contribute 2] 0] - set p_cont_date_l [lindex [lindex [lindex $contribute 2] 1] 0] - set p_cont_date_s [lindex [lindex [lindex $contribute 2] 1] 1] + # Version + set version [lors::imsmd::mdLifeCycle \ + -element version \ + -node $lom \ + -prefix $prefix] + set version_l [lindex [lindex $version 0] 0] + set version_s [lindex [lindex $version 0] 1] - set p_ims_md_md_cont_enti_id [db_nextval ims_md_metadata_contrib_entity_seq] - set p_entity [lindex [lindex $contribute 1] 0] + # Status + set status [lors::imsmd::mdLifeCycle \ + -element status \ + -node $lom \ + -prefix $prefix] + set status_s [lindex [lindex [lindex $status 0] 0] 1] + set status_v [lindex [lindex [lindex $status 0] 1] 1] - db_dml add_new_metadata_contrib { - insert into ims_md_metadata_contrib (ims_md_md_cont_id, ims_md_id, role_s, role_v, cont_date, cont_date_l, cont_date_s) - values - (:p_ims_md_md_cont_id, :p_ims_md_id, :p_role_s, :p_role_v, :p_cont_date, :p_cont_date_l, :p_cont_date_s) - } + # Contribute + set contributes [lors::imsmd::mdLifeCycle \ + -element contribute \ + -node $lom \ + -prefix $prefix] - db_dml add_new_metadata_contrib_entity { - insert into ims_md_metadata_contrib_entity (ims_md_md_cont_enti_id, ims_md_md_cont_id, entity) - values - (:p_ims_md_md_cont_enti_id, :p_ims_md_md_cont_id, :p_entity) - } + # Adds Lifecycle Version and Status + db_dml add_new_lifecycle { + insert into ims_md_life_cycle (ims_md_id, version_l, version_s, status_s, status_v) + values (:p_ims_md_id, :version_l, :version_s, :status_s, :status_v) + } - } + # Adds Lifecycle Contributes + foreach contribute $contributes { + set p_ims_md_lf_cont_id [db_nextval ims_md_life_cycle_contrib_seq] + set p_role_s [lindex [lindex [lindex $contribute 0] 0] 1] + set p_role_v [lindex [lindex [lindex $contribute 0] 1] 1] + set p_cont_date [lindex [lindex $contribute 2] 0] + set p_cont_date_l [lindex [lindex [lindex $contribute 2] 1] 0] + set p_cont_date_s [lindex [lindex [lindex $contribute 2] 1] 1] - # Adds Metadata Schemes - foreach metadatascheme $metadataschemes { - set p_ims_md_md_sch_id [db_nextval ims_md_metadata_scheme_seq] - set p_scheme $metadatascheme - - db_dml add_new_metadata_metadatascheme { - insert into ims_md_metadata_scheme (ims_md_md_sch_id, ims_md_id, scheme) - values - (:p_ims_md_md_sch_id, :p_ims_md_id, :p_scheme) - } - } + set p_entities [lindex $contribute 1] - # Technical + db_dml add_new_lifecycle_contrib { + insert into ims_md_life_cycle_contrib (ims_md_lf_cont_id, ims_md_id, role_s, role_v, cont_date, cont_date_l, cont_date_s) + values (:p_ims_md_lf_cont_id, :p_ims_md_id, :p_role_s, :p_role_v, :p_cont_date, :p_cont_date_l, :p_cont_date_s) + } - # format - set formats [lors::imsmd::mdTechnical -element format -node $lom -prefix $prefix] - - # location - set locations [lors::imsmd::mdTechnical -element location -node $lom -prefix $prefix] - # size, installation remarks, otherplatformrequirements, duration - set p_size [lors::imsmd::mdTechnical -element size -node $lom -prefix $prefix] - set p_instl_rmks [lors::imsmd::mdTechnical -element installationremarks -node $lom -prefix $prefix] - set p_instl_rmks_l [lindex [lindex $p_instl_rmks 0] 0] - set p_instl_rmks_s [lindex [lindex $p_instl_rmks 0] 1] - set p_otr_plt [lors::imsmd::mdTechnical -element otherplatformrequirements -node $lom -prefix $prefix] - set p_otr_plt_l [lindex [lindex $p_otr_plt 0] 0] - set p_otr_plt_s [lindex [lindex $p_otr_plt 0] 1] - set p_durat [lors::imsmd::mdTechnical -element duration -node $lom -prefix $prefix] - set p_duration [lindex $p_durat 0] - set p_duration_l [lindex [lindex $p_durat 1] 0] - set p_duration_s [lindex [lindex $p_durat 1] 1] + foreach entity $p_entities { + set p_ims_md_lf_cont_enti_id [db_nextval ims_md_life_cycle_contrib_entity_seq] + set p_entity $entity - # requirement - set requirements [lors::imsmd::mdTechnical -element requirement -node $lom -prefix $prefix] + db_dml add_new_lifecycle_contrib_entity { + insert into ims_md_life_cycle_contrib_entity (ims_md_lf_cont_enti_id, ims_md_lf_cont_id, entity) + values (:p_ims_md_lf_cont_enti_id, :p_ims_md_lf_cont_id, :p_entity) + } + } + } - # Adds Technical size, installation remarks, otherplatformrequirements, duration - db_dml add_new_technical { - insert into ims_md_technical (ims_md_id, t_size, instl_rmrks_l, instl_rmrks_s, otr_plt_l, otr_plt_s, duration, duration_l, duration_s) - values - (:p_ims_md_id, :p_size, :p_instl_rmks_l, :p_instl_rmks_s, :p_otr_plt_l, :p_otr_plt_s, :p_duration, :p_duration_l, :p_duration_s) - } + # Metadata - # Adds Technical Format + # Language + set p_language [lors::imsmd::mdMetadata \ + -element language \ + -node $lom \ + -prefix $prefix] - foreach format $formats { - set p_ims_md_te_fo_id [db_nextval ims_md_technical_format_seq] - set p_format $format - - db_dml add_new_technical_format { - insert into ims_md_technical_format (ims_md_te_fo_id, ims_md_id, format) - values - (:p_ims_md_te_fo_id, :p_ims_md_id, :p_format) - } - } - - # Adds Technical Location - - foreach location $locations { - set p_ims_md_te_lo_id [db_nextval ims_md_technical_location_seq] - set p_type [lindex $location 1] - set p_location [lindex $location 0] + # Catalogentry + set catalogentries [lors::imsmd::mdMetadata \ + -element catalogentry \ + -node $lom \ + -prefix $prefix] - db_dml add_new_technical_location { - insert into ims_md_technical_location (ims_md_te_lo_id, ims_md_id, type, location) - values - (:p_ims_md_te_lo_id, :p_ims_md_id, :p_type, :p_location) - } - } + # Contribute + set contributes [lors::imsmd::mdMetadata \ + -element contribute \ + -node $lom \ + -prefix $prefix] - # Adds Technical Requirements + # Metadatascheme + set metadataschemes [lors::imsmd::mdMetadata \ + -element metadatascheme \ + -node $lom \ + -prefix $prefix] - foreach requirement $requirements { - set p_ims_md_te_rq_id [db_nextval ims_md_technical_requirement_seq] - set p_type_s [lindex [lindex [lindex $requirement 0] 0] 1] - set p_type_v [lindex [lindex [lindex $requirement 0] 1] 1] - set p_name_s [lindex [lindex [lindex $requirement 1] 0] 1] - set p_name_v [lindex [lindex [lindex $requirement 1] 1] 1] - set p_min_version [lindex $requirement 2] - set p_max_version [lindex $requirement 3] + # Adds Metadata Language + db_dml add_new_metadata { + insert into ims_md_metadata (ims_md_id, language) + values (:p_ims_md_id, :p_language) + } - db_dml add_new_technical_requirement { - insert into ims_md_technical_requirement (ims_md_te_rq_id, ims_md_id, type_s, type_v, name_s, name_v, min_version, max_version) - values - (:p_ims_md_te_rq_id, :p_ims_md_id, :p_type_s, :p_type_v, :p_name_s, :p_name_v, :p_min_version, :p_max_version) - } - } + # Adds Catalogentry + foreach catalogentry $catalogentries { + set p_ims_md_md_cata_id [db_nextval ims_md_metadata_cata_seq] + set p_catalog [lindex $catalogentry 0] + set p_entry_l [lindex [lindex $catalogentry 1] 0] + set p_entry_s [lindex [lindex $catalogentry 1] 1] + db_dml add_new_metadata_catalogentries { + insert into ims_md_metadata_cata (ims_md_md_cata_id, ims_md_id, catalog, entry_l, entry_s) + values (:p_ims_md_md_cata_id, :p_ims_md_id, :p_catalog, :p_entry_l, :p_entry_s) + } + } - # Educational + # Adds Lifecycle Contributes + foreach contribute $contributes { + set p_ims_md_md_cont_id [db_nextval ims_md_metadata_contrib_seq] + set p_role_s [lindex [lindex [lindex $contribute 0] 0] 1] + set p_role_v [lindex [lindex [lindex $contribute 0] 1] 1] + set p_cont_date [lindex [lindex $contribute 2] 0] + set p_cont_date_l [lindex [lindex [lindex $contribute 2] 1] 0] + set p_cont_date_s [lindex [lindex [lindex $contribute 2] 1] 1] - # interactivitytype, interactivitylevel, semanticdensity, difficulty, typical_learning_time, description - set p_int_type [lors::imsmd::mdEducational -element interactivitytype -node $lom -prefix $prefix] - set p_int_type_s [lindex [lindex [lindex $p_int_type 0] 0] 1] - set p_int_type_v [lindex [lindex [lindex $p_int_type 0] 1] 1] - set p_int_level [lors::imsmd::mdEducational -element interactivitylevel -node $lom -prefix $prefix] - set p_int_level_s [lindex [lindex [lindex $p_int_level 0] 0] 1] - set p_int_level_v [lindex [lindex [lindex $p_int_level 0] 1] 1] - set p_sem_density [lors::imsmd::mdEducational -element semanticdensity -node $lom -prefix $prefix] - set p_sem_density_s [lindex [lindex [lindex $p_sem_density 0] 0] 1] - set p_sem_density_v [lindex [lindex [lindex $p_sem_density 0] 1] 1] - set p_difficulty [lors::imsmd::mdEducational -element difficulty -node $lom -prefix $prefix] - set p_difficulty_s [lindex [lindex [lindex $p_difficulty 0] 0] 1] - set p_difficulty_v [lindex [lindex [lindex $p_difficulty 0] 1] 1] - set p_type_lrn_tim [lors::imsmd::mdEducational -element typicallearningtime -node $lom -prefix $prefix] - set p_type_lrn_time [lindex $p_type_lrn_tim 0] - set p_type_lrn_time_l [lindex [lindex $p_type_lrn_tim 1] 0] - set p_type_lrn_time_s [lindex [lindex $p_type_lrn_tim 1] 1] - set descrips [lors::imsmd::mdEducational -element description -node $lom -prefix $prefix] + set p_ims_md_md_cont_enti_id [db_nextval ims_md_metadata_contrib_entity_seq] + set p_entity [lindex [lindex $contribute 1] 0] - # learningresourcetype - set learningresourcetypes [lors::imsmd::mdEducational -element learningresourcetype -node $lom -prefix $prefix] + db_dml add_new_metadata_contrib { + insert into ims_md_metadata_contrib (ims_md_md_cont_id, ims_md_id, role_s, role_v, cont_date, cont_date_l, cont_date_s) + values (:p_ims_md_md_cont_id, :p_ims_md_id, :p_role_s, :p_role_v, :p_cont_date, :p_cont_date_l, :p_cont_date_s) + } + db_dml add_new_metadata_contrib_entity { + insert into ims_md_metadata_contrib_entity (ims_md_md_cont_enti_id, ims_md_md_cont_id, entity) + values (:p_ims_md_md_cont_enti_id, :p_ims_md_md_cont_id, :p_entity) + } + } - # intendedenduserrole - set intendedenduserroles [lors::imsmd::mdEducational -element intendedenduserrole -node $lom -prefix $prefix] + # Adds Metadata Schemes + foreach metadatascheme $metadataschemes { + set p_ims_md_md_sch_id [db_nextval ims_md_metadata_scheme_seq] + set p_scheme $metadatascheme - # context - set contexts [lors::imsmd::mdEducational -element context -node $lom -prefix $prefix] + db_dml add_new_metadata_metadatascheme { + insert into ims_md_metadata_scheme (ims_md_md_sch_id, ims_md_id, scheme) + values (:p_ims_md_md_sch_id, :p_ims_md_id, :p_scheme) + } + } - # typicalagerange - set typicalageranges [lors::imsmd::mdEducational -element typicalagerange -node $lom -prefix $prefix] + # Technical - # language - set languages [lors::imsmd::mdEducational -element language -node $lom -prefix $prefix] + # format + set formats [lors::imsmd::mdTechnical \ + -element format \ + -node $lom \ + -prefix $prefix] + # location + set locations [lors::imsmd::mdTechnical \ + -element location \ + -node $lom \ + -prefix $prefix] - # Adds Educational interactivitytype, interactivitylevel, semanticdensity, difficulty, typical_learning_time - db_dml add_new_educational { - insert into ims_md_educational (ims_md_id, int_type_s, int_type_v, int_level_s, int_level_v, sem_density_s, sem_density_v, difficulty_s, difficulty_v, type_lrn_time, type_lrn_time_l, type_lrn_time_s) - values - (:p_ims_md_id, :p_int_type_s, :p_int_type_v, :p_int_level_s, :p_int_level_v, :p_sem_density_s, :p_sem_density_v, :p_difficulty_s, :p_difficulty_v, :p_type_lrn_time, :p_type_lrn_time_l, :p_type_lrn_time_s) - } + # size, installation remarks, otherplatformrequirements, duration + set p_size [lors::imsmd::mdTechnical -element size \ + -node $lom \ + -prefix $prefix] - # Adds descriptions - foreach descrip $descrips { - set p_ims_md_ed_de_id [db_nextval ims_md_educational_descrip_seq] - set p_descrip_l [lindex $descrip 0] - set p_descrip_s [lindex $descrip 1] + set p_instl_rmks [lors::imsmd::mdTechnical \ + -element installationremarks \ + -node $lom \ + -prefix $prefix] - db_dml add_new_descriptions { - insert into ims_md_educational_descrip (ims_md_ed_de_id, ims_md_id, descrip_l, descrip_s) - values - (:p_ims_md_ed_de_id, :p_ims_md_id, :p_descrip_l, :p_descrip_s) - } - } + set p_instl_rmks_l [lindex [lindex $p_instl_rmks 0] 0] + set p_instl_rmks_s [lindex [lindex $p_instl_rmks 0] 1] + set p_otr_plt [lors::imsmd::mdTechnical \ + -element otherplatformrequirements \ + -node $lom \ + -prefix $prefix] - # Adds learningresourcetype - foreach lrt $learningresourcetypes { - set p_ims_md_ed_lr_id [db_nextval ims_md_educational_lrt_seq] - set p_lrt_s [lindex [lindex $lrt 0] 1] - set p_lrt_v [lindex [lindex $lrt 1] 1] - - db_dml add_new_learningresourcetypes { - insert into ims_md_educational_lrt (ims_md_ed_lr_id, ims_md_id, lrt_s, lrt_v) - values - (:p_ims_md_ed_lr_id, :p_ims_md_id, :p_lrt_s, :p_lrt_v) - } - } + set p_otr_plt_l [lindex [lindex $p_otr_plt 0] 0] + set p_otr_plt_s [lindex [lindex $p_otr_plt 0] 1] + set p_durat [lors::imsmd::mdTechnical \ + -element duration \ + -node $lom \ + -prefix $prefix] - # Adds intendedenduserrole - foreach ieur $intendedenduserroles { - set p_ims_md_ed_ie_id [db_nextval ims_md_educational_ieur_seq] - set p_ieur_s [lindex [lindex $ieur 0] 1] - set p_ieur_v [lindex [lindex $ieur 1] 1] + set p_duration [lindex $p_durat 0] + set p_duration_l [lindex [lindex $p_durat 1] 0] + set p_duration_s [lindex [lindex $p_durat 1] 1] - db_dml add_new_intendedenduserroles { - insert into ims_md_educational_ieur (ims_md_ed_ie_id, ims_md_id, ieur_s, ieur_v) - values - (:p_ims_md_ed_ie_id, :p_ims_md_id, :p_ieur_s, :p_ieur_v) - } - } + # requirement + set requirements [lors::imsmd::mdTechnical \ + -element requirement \ + -node $lom \ + -prefix $prefix] - # Adds context - foreach context $contexts { - set p_ims_md_ed_co_id [db_nextval ims_md_educational_context_seq] - set p_context_s [lindex [lindex $context 0] 1] - set p_context_v [lindex [lindex $context 1] 1] - - db_dml add_new_context { - insert into ims_md_educational_context (ims_md_ed_co_id, ims_md_id, context_s, context_v) - values - (:p_ims_md_ed_co_id, :p_ims_md_id, :p_context_s, :p_context_v) - } - } + # Adds Technical size, installation remarks, otherplatformrequirements, duration + db_dml add_new_technical { + insert into ims_md_technical (ims_md_id, t_size, instl_rmrks_l, instl_rmrks_s, otr_plt_l, otr_plt_s, duration, duration_l, duration_s) + values (:p_ims_md_id, :p_size, :p_instl_rmks_l, :p_instl_rmks_s, :p_otr_plt_l, :p_otr_plt_s, :p_duration, :p_duration_l, :p_duration_s) + } - # Adds typicalagerange - foreach tar $typicalageranges { - set p_ims_md_ed_ta_id [db_nextval ims_md_educational_tar_seq] - set p_tar_l [lindex $tar 0] - set p_tar_s [lindex $tar 1] + # Adds Technical Format - db_dml add_new_typicalagerange { - insert into ims_md_educational_tar (ims_md_ed_ta_id, ims_md_id, tar_l, tar_s) - values - (:p_ims_md_ed_ta_id, :p_ims_md_id, :p_tar_l, :p_tar_s) - } - } + foreach format $formats { + set p_ims_md_te_fo_id [db_nextval ims_md_technical_format_seq] + set p_format $format - # Adds Languages - foreach lang $languages { - set p_ims_md_ed_la_id [db_nextval ims_md_educational_lang_seq] - set p_language $lang - - db_dml add_new_language { - insert into ims_md_educational_lang (ims_md_ed_la_id, ims_md_id, language) - values - (:p_ims_md_ed_la_id, :p_ims_md_id, :p_language) - } - } + db_dml add_new_technical_format { + insert into ims_md_technical_format (ims_md_te_fo_id, ims_md_id, format) + values (:p_ims_md_te_fo_id, :p_ims_md_id, :p_format) + } + } - # Rights - # cost, copyrightsandotherrights, description - set p_cost [lors::imsmd::mdRights -element cost -node $lom -prefix $prefix] - set p_caor [lors::imsmd::mdRights -element copyrightandotherrestrictions -node $lom -prefix $prefix] - set p_descrip [lors::imsmd::mdRights -element description -node $lom -prefix $prefix] - - set p_cost_s [lindex [lindex [lindex $p_cost 0] 0] 1] - set p_cost_v [lindex [lindex [lindex $p_cost 0] 1] 1] + # Adds Technical Location - set p_caor_s [lindex [lindex [lindex $p_caor 0] 0] 1] - set p_caor_v [lindex [lindex [lindex $p_caor 0] 1] 1] + foreach location $locations { + set p_ims_md_te_lo_id [db_nextval ims_md_technical_location_seq] + set p_type [lindex $location 1] + set p_location [lindex $location 0] - set p_descrip_l [lindex [lindex $p_descrip 0] 0] - set p_descrip_s [lindex [lindex $p_descrip 0] 1] + db_dml add_new_technical_location { + insert into ims_md_technical_location (ims_md_te_lo_id, ims_md_id, type, location) + values (:p_ims_md_te_lo_id, :p_ims_md_id, :p_type, :p_location) + } + } - db_dml add_new_rights { - insert into ims_md_rights (ims_md_id, cost_s, cost_v, caor_s, caor_v, descrip_l, descrip_s) - values - (:p_ims_md_id, :p_cost_s, :p_cost_v, :p_caor_s, :p_caor_v, :p_descrip_l, :p_descrip_s) - } + # Adds Technical Requirements - # Relation + foreach requirement $requirements { + set p_ims_md_te_rq_id [db_nextval ims_md_technical_requirement_seq] + set p_type_s [lindex [lindex [lindex $requirement 0] 0] 1] + set p_type_v [lindex [lindex [lindex $requirement 0] 1] 1] + set p_name_s [lindex [lindex [lindex $requirement 1] 0] 1] + set p_name_v [lindex [lindex [lindex $requirement 1] 1] 1] + set p_min_version [lindex $requirement 2] + set p_max_version [lindex $requirement 3] - # Relation returns all in one large list - set relations [lors::imsmd::mdRelation -node $lom -prefix $prefix] - - foreach relation $relations { - - set p_ims_md_re_id [db_nextval ims_md_relation_seq] - set p_kind_s [lindex [lindex [lindex [lindex $relation 0] 0] 0] 1] - set p_kind_v [lindex [lindex [lindex [lindex $relation 0] 0] 1] 1] - - # Adds kind - db_dml add_new_relation { - insert into ims_md_relation (ims_md_re_id, ims_md_id, kind_s, kind_v) - values - (:p_ims_md_re_id, :p_ims_md_id, :p_kind_s, :p_kind_v) - } - - set p_ims_md_re_re_id [db_nextval ims_md_relation_resource_seq] - set p_descrip_l [lindex [lindex [lindex $relation 1] 0] 0] - set p_descrip_s [lindex [lindex [lindex $relation 1] 0] 1] + db_dml add_new_technical_requirement { + insert into ims_md_technical_requirement (ims_md_te_rq_id, ims_md_id, type_s, type_v, name_s, name_v, min_version, max_version) + values (:p_ims_md_te_rq_id, :p_ims_md_id, :p_type_s, :p_type_v, :p_name_s, :p_name_v, :p_min_version, :p_max_version) + } + } - # adds description to resource - db_dml add_new_relation_descrip { - insert into ims_md_relation_resource (ims_md_re_re_id, ims_md_re_id, identifier, descrip_l, descrip_s) - values - (:p_ims_md_re_re_id, :p_ims_md_re_id, null, :p_descrip_l, :p_descrip_s) - } + # Educational - # catalogentries - set catalogentries [lindex $relation 2] + # interactivitytype, interactivitylevel, semanticdensity, difficulty, typical_learning_time, description + set p_int_type [lors::imsmd::mdEducational \ + -element interactivitytype \ + -node $lom \ + -prefix $prefix] - # adds catalogentries - foreach catalogentry $catalogentries { + set p_int_type_s [lindex [lindex [lindex $p_int_type 0] 0] 1] + set p_int_type_v [lindex [lindex [lindex $p_int_type 0] 1] 1] + set p_int_level [lors::imsmd::mdEducational \ + -element interactivitylevel \ + -node $lom \ + -prefix $prefix] - set p_ims_md_re_re_ca_id [db_nextval ims_md_relation_resource_catalog_seq] - set p_catalog [lindex $catalogentry 0] - set p_entry_l [lindex [lindex $catalogentry 1] 0] - set p_entry_s [lindex [lindex $catalogentry 1] 1] - - db_dml add_new_catalogentry { - - insert into ims_md_relation_resource_catalog (ims_md_re_re_ca_id, ims_md_re_re_id, catalog, entry_l, entry_s) - values - (:p_ims_md_re_re_ca_id, :p_ims_md_re_re_id, :p_catalog, :p_entry_l, :p_entry_s) - } - } + set p_int_level_s [lindex [lindex [lindex $p_int_level 0] 0] 1] + set p_int_level_v [lindex [lindex [lindex $p_int_level 0] 1] 1] + set p_sem_density [lors::imsmd::mdEducational \ + -element semanticdensity \ + -node $lom \ + -prefix $prefix] - } + set p_sem_density_s [lindex [lindex [lindex $p_sem_density 0] 0] 1] + set p_sem_density_v [lindex [lindex [lindex $p_sem_density 0] 1] 1] + set p_difficulty [lors::imsmd::mdEducational \ + -element difficulty \ + -node $lom \ + -prefix $prefix] - # Annotation - - set annotations [lors::imsmd::mdAnnotation -node $lom -prefix $prefix] + set p_difficulty_s [lindex [lindex [lindex $p_difficulty 0] 0] 1] + set p_difficulty_v [lindex [lindex [lindex $p_difficulty 0] 1] 1] + set p_type_lrn_tim [lors::imsmd::mdEducational \ + -element typicallearningtime \ + -node $lom \ + -prefix $prefix] - foreach annotation $annotations { - set p_ims_md_an_id [db_nextval ims_md_annotation_seq] - set p_entity [lindex [lindex $annotation 0] 0] - set p_date [lindex [lindex $annotation 1] 0] - set p_date_l [lindex [lindex [lindex $annotation 1] 1] 0] - set p_date_s [lindex [lindex [lindex $annotation 1] 1] 1] + set p_type_lrn_time [lindex $p_type_lrn_tim 0] + set p_type_lrn_time_l [lindex [lindex $p_type_lrn_tim 1] 0] + set p_type_lrn_time_s [lindex [lindex $p_type_lrn_tim 1] 1] + set descrips [lors::imsmd::mdEducational \ + -element description \ + -node $lom \ + -prefix $prefix] - set p_descriptions [lindex $annotation 2] + # learningresourcetype + set learningresourcetypes [lors::imsmd::mdEducational \ + -element learningresourcetype \ + -node $lom \ + -prefix $prefix] - db_dml add_new_annotation { - insert into ims_md_annotation (ims_md_an_id, ims_md_id, entity, date, date_l, date_s) - values - (:p_ims_md_an_id, :p_ims_md_id, :p_entity, :p_date, :p_date_l, :p_date_s) - } + # intendedenduserrole + set intendedenduserroles [lors::imsmd::mdEducational \ + -element intendedenduserrole \ + -node $lom \ + -prefix $prefix] - foreach description $p_descriptions { + # context + set contexts [lors::imsmd::mdEducational \ + -element context \ + -node $lom \ + -prefix $prefix] - set p_ims_md_an_de_id [db_nextval ims_md_annotation_descrip_seq] - set p_descrip_l [lindex $description 0] - set p_descrip_s [lindex $description 1] - - db_dml add_new_ann_descriptions { - insert into ims_md_annotation_descrip (ims_md_an_de_id, ims_md_an_id, descrip_l, descrip_s) - values - (:p_ims_md_an_de_id, :p_ims_md_an_id, :p_descrip_l, :p_descrip_s) - } + # typicalagerange + set typicalageranges [lors::imsmd::mdEducational \ + -element typicalagerange \ + -node $lom \ + -prefix $prefix] - } + # language + set languages [lors::imsmd::mdEducational \ + -element language \ + -node $lom \ + -prefix $prefix] - } + # Adds Educational interactivitytype, interactivitylevel, semanticdensity, difficulty, typical_learning_time + db_dml add_new_educational { + insert into ims_md_educational (ims_md_id, int_type_s, int_type_v, int_level_s, int_level_v, sem_density_s, sem_density_v, difficulty_s, difficulty_v, type_lrn_time, type_lrn_time_l, type_lrn_time_s) + values (:p_ims_md_id, :p_int_type_s, :p_int_type_v, :p_int_level_s, :p_int_level_v, :p_sem_density_s, :p_sem_density_v, :p_difficulty_s, :p_difficulty_v, :p_type_lrn_time, :p_type_lrn_time_l, :p_type_lrn_time_s) + } - # Classification + # Adds descriptions + foreach descrip $descrips { + set p_ims_md_ed_de_id [db_nextval ims_md_educational_descrip_seq] + set p_descrip_l [lindex $descrip 0] + set p_descrip_s [lindex $descrip 1] - set classifications [lors::imsmd::mdClassification -node $lom -prefix $prefix] + db_dml add_new_descriptions { + insert into ims_md_educational_descrip (ims_md_ed_de_id, ims_md_id, descrip_l, descrip_s) + values (:p_ims_md_ed_de_id, :p_ims_md_id, :p_descrip_l, :p_descrip_s) + } + } - foreach class $classifications { + # Adds learningresourcetype + foreach lrt $learningresourcetypes { + set p_ims_md_ed_lr_id [db_nextval ims_md_educational_lrt_seq] + set p_lrt_s [lindex [lindex $lrt 0] 1] + set p_lrt_v [lindex [lindex $lrt 1] 1] - # purpose - set p_ims_md_cl_id [db_nextval ims_md_classification_seq] - set p_purpose_s [lindex [lindex [lindex [lindex [lindex $class 0] 0] 0] 0] 1] - set p_purpose_v [lindex [lindex [lindex [lindex [lindex $class 0] 0] 0] 1] 1] - - db_dml add_new_classification { - insert into ims_md_classification (ims_md_cl_id, ims_md_id, purpose_s, purpose_v) - values - (:p_ims_md_cl_id, :p_ims_md_id, :p_purpose_s, :p_purpose_v) - } + db_dml add_new_learningresourcetypes { + insert into ims_md_educational_lrt (ims_md_ed_lr_id, ims_md_id, lrt_s, lrt_v) + values (:p_ims_md_ed_lr_id, :p_ims_md_id, :p_lrt_s, :p_lrt_v) + } + } - # description - set descriptions [lindex [lindex $class 0] 1] + # Adds intendedenduserrole + foreach ieur $intendedenduserroles { + set p_ims_md_ed_ie_id [db_nextval ims_md_educational_ieur_seq] + set p_ieur_s [lindex [lindex $ieur 0] 1] + set p_ieur_v [lindex [lindex $ieur 1] 1] - foreach desc $descriptions { - set p_ims_md_cl_de_id [db_nextval ims_md_classification_desc_seq] - set p_descrip_l [lindex $desc 0] - set p_descrip_s [lindex $desc 1] - - db_dml add_new_description { - insert into ims_md_classification_descrip (ims_md_cl_de_id, ims_md_cl_id, descrip_l, descrip_s) - values - (:p_ims_md_cl_de_id, :p_ims_md_cl_id, :p_descrip_l, :p_descrip_s) - } - } + db_dml add_new_intendedenduserroles { + insert into ims_md_educational_ieur (ims_md_ed_ie_id, ims_md_id, ieur_s, ieur_v) + values (:p_ims_md_ed_ie_id, :p_ims_md_id, :p_ieur_s, :p_ieur_v) + } + } - # taxonpath - set taxonpaths [lindex [lindex $class 0] 2] + # Adds context + foreach context $contexts { + set p_ims_md_ed_co_id [db_nextval ims_md_educational_context_seq] + set p_context_s [lindex [lindex $context 0] 1] + set p_context_v [lindex [lindex $context 1] 1] - foreach taxonpath $taxonpaths { - - set p_source [lindex $taxonpath 0] - - set p_source_l [lindex [lindex $p_source 0] 0] - set p_source_s [lindex [lindex $p_source 0] 1] - set p_ims_md_cl_ta_id [db_nextval ims_md_classification_taxpath_seq] + db_dml add_new_context { + insert into ims_md_educational_context (ims_md_ed_co_id, ims_md_id, context_s, context_v) + values (:p_ims_md_ed_co_id, :p_ims_md_id, :p_context_s, :p_context_v) + } + } - set taxons [lindex $taxonpath 1] + # Adds typicalagerange + foreach tar $typicalageranges { + set p_ims_md_ed_ta_id [db_nextval ims_md_educational_tar_seq] + set p_tar_l [lindex $tar 0] + set p_tar_s [lindex $tar 1] - db_dml add_new_taxonpaths { - insert into ims_md_classification_taxpath (ims_md_cl_ta_id, ims_md_cl_id, source_l, source_v) - values - (:p_ims_md_cl_ta_id, :p_ims_md_cl_id, :p_source_l, :p_source_s) - } + db_dml add_new_typicalagerange { + insert into ims_md_educational_tar (ims_md_ed_ta_id, ims_md_id, tar_l, tar_s) + values (:p_ims_md_ed_ta_id, :p_ims_md_id, :p_tar_l, :p_tar_s) + } + } - foreach taxon $taxons { + # Adds Languages + foreach lang $languages { + set p_ims_md_ed_la_id [db_nextval ims_md_educational_lang_seq] + set p_language $lang - set p_ims_md_cl_ta_ta_id [db_nextval ims_md_classification_taxpath_taxon_seq] - set p_hierarchy [lindex $taxon 0] - set p_identifier [lindex $taxon 1] - set p_entry_l [lindex [lindex $taxon 2] 0] - set p_entry_s [lindex [lindex $taxon 2] 1] - - db_dml add_new_taxons { - insert into ims_md_classification_taxpath_taxon (ims_md_cl_ta_ta_id, ims_md_cl_ta_id, hierarchy, identifier, entry_l, entry_s) - values - (:p_ims_md_cl_ta_ta_id, :p_ims_md_cl_ta_id, :p_hierarchy, :p_identifier, :p_entry_l, :p_entry_s) - } + db_dml add_new_language { + insert into ims_md_educational_lang (ims_md_ed_la_id, ims_md_id, language) + values (:p_ims_md_ed_la_id, :p_ims_md_id, :p_language) + } + } - } - } + # Rights + # cost, copyrightsandotherrights, description + set p_cost [lors::imsmd::mdRights \ + -element cost \ + -node $lom \ + -prefix $prefix] - # keywords - set keywords [lindex [lindex $class 0] 3] - - foreach keyword $keywords { - set p_ims_md_cl_ke_id [db_nextval ims_md_classification_keyword_seq] - set p_keyword_l [lindex $keyword 0] - set p_keyword_s [lindex $keyword 1] - - db_dml add_new_keywords { - insert into ims_md_classification_keyword (ims_md_cl_ke_id, ims_md_cl_id, keyword_l, keyword_s) - values - (:p_ims_md_cl_ke_id, :p_ims_md_cl_id, :p_keyword_l, :p_keyword_s) - } - } - } -# } on_error { -# ad_return_error "[_ lors.lt_Transaction_Error_in_]" "[_ lors._The] $errmsg" -# } -# -# } + set p_caor [lors::imsmd::mdRights \ + -element copyrightandotherrestrictions \ + -node $lom \ + -prefix $prefix] + set p_descrip [lors::imsmd::mdRights \ + -element description \ + -node $lom \ + -prefix $prefix] - ad_proc -public addMetadata { - {-acs_object:required} - {-node:required} - {-dir {}} - } { - Adds metadata for a learning resource. - - @option acs_object acs object for resource (element) that contains metadata. - @option node XML node that contains the metadata - @option dir directory where the imsmanifest.xml file is located. This is use in the case the metadata is in a different file location (adlcp:location). - @author Ernie Ghiglione (ErnieG@mm.st). + set p_cost_s [lindex [lindex [lindex $p_cost 0] 0] 1] + set p_cost_v [lindex [lindex [lindex $p_cost 0] 1] 1] - } { - set p_ims_md_id $acs_object - set mdnode $node - set path_to_file $dir - #[lors::imsmd::getMDNode $manifest] - - set p_schema [lindex [lindex [lors::imsmd::getMDSchema $mdnode] 0] 0] - set p_schemaversion [lindex [lors::imsmd::getMDSchema $mdnode] 1] + set p_caor_s [lindex [lindex [lindex $p_caor 0] 0] 1] + set p_caor_v [lindex [lindex [lindex $p_caor 0] 1] 1] - set lom [lindex [lors::imsmd::getLOM $mdnode $path_to_file] 0] - set prefix [lindex [lors::imsmd::getLOM $mdnode $path_to_file] 1] + set p_descrip_l [lindex [lindex $p_descrip 0] 0] + set p_descrip_s [lindex [lindex $p_descrip 0] 1] - - # inserts into db -# db_transaction { + db_dml add_new_rights { + insert into ims_md_rights (ims_md_id, cost_s, cost_v, caor_s, caor_v, descrip_l, descrip_s) + values (:p_ims_md_id, :p_cost_s, :p_cost_v, :p_caor_s, :p_caor_v, :p_descrip_l, :p_descrip_s) + } - # Checks if there's a LOM record - if {$lom != 0} { + # Relation - # Adds new MD record to ims_md - - lors::imsmd::addMDSchemaVersion -acs_object $p_ims_md_id -schema $p_schema -schemaversion $p_schemaversion + # Relation returns all in one large list + set relations [lors::imsmd::mdRelation -node $lom -prefix $prefix] - lors::imsmd::addLOM -lom $lom -prefix $prefix -acs_object $p_ims_md_id -dir $path_to_file + foreach relation $relations { - } -# } on_error { -# ad_return_error "[_ lors.lt_Transaction_Error_whi]" "[_ lors.The_error_was] $errmsg" -# } - return 1 - } - + set p_ims_md_re_id [db_nextval ims_md_relation_seq] + set p_kind_s [lindex [lindex [lindex [lindex $relation 0] 0] 0] 1] + set p_kind_v [lindex [lindex [lindex [lindex $relation 0] 0] 1] 1] - ad_proc -public addMDSchemaVersion { - {-acs_object:required} - {-schema:required} - {-schemaversion:required} + # Adds kind + db_dml add_new_relation { + insert into ims_md_relation (ims_md_re_id, ims_md_id, kind_s, kind_v) + values (:p_ims_md_re_id, :p_ims_md_id, :p_kind_s, :p_kind_v) + } - } { - Adds MD schema and schema version to db - If the metedata record already exists, then it deletes it - and creates a new one. + set p_ims_md_re_re_id [db_nextval ims_md_relation_resource_seq] + set p_descrip_l [lindex [lindex [lindex $relation 1] 0] 0] + set p_descrip_s [lindex [lindex [lindex $relation 1] 0] 1] - @param acs_object acs object for resource (element) that contains metadata. - @param schema MD schema used for the learning resource. - @param schemaversion MD schemaversion used for the learning resource. - @author Ernie Ghiglione (ErnieG@mm.st) - } { - set p_ims_md_id $acs_object - set p_schema $schema - set p_schemaversion $schemaversion + # adds description to resource + db_dml add_new_relation_descrip { + insert into ims_md_relation_resource (ims_md_re_re_id, ims_md_re_id, identifier, descrip_l, descrip_s) + values (:p_ims_md_re_re_id, :p_ims_md_re_id, null, :p_descrip_l, :p_descrip_s) + } - # we check if the MD record we are about to insert already - # exists. If that is the case, then we delete it first. - # Yes, we are not versioning metadata (as I believe there's no - # real point on doing so. + # catalogentries + set catalogentries [lindex $relation 2] - lors::imsmd::delMD -acs_object $p_ims_md_id + # adds catalogentries + foreach catalogentry $catalogentries { + set p_ims_md_re_re_ca_id [db_nextval ims_md_relation_resource_catalog_seq] + set p_catalog [lindex $catalogentry 0] + set p_entry_l [lindex [lindex $catalogentry 1] 0] + set p_entry_s [lindex [lindex $catalogentry 1] 1] -# db_transaction { - db_dml add_md { - insert into ims_md (ims_md_id, schema, schemaversion) - values - (:p_ims_md_id, :p_schema, :p_schemaversion) + db_dml add_new_catalogentry { + + insert into ims_md_relation_resource_catalog (ims_md_re_re_ca_id, ims_md_re_re_id, catalog, entry_l, entry_s) + values(:p_ims_md_re_re_ca_id, :p_ims_md_re_re_id, :p_catalog, :p_entry_l, :p_entry_s) + } } -# } on_error { -# ad_return_error "[_ lors.lt_Transaction_Error_in__1] " " [_ lors._The] $errmsg" -# } - } + } - ad_proc -public delMD { - {-acs_object:required} - } { - Deletes an MD record (deletes it ALL from the db). - - @param acs_object the acs object metadata we are deleting. - @author Ernie Ghiglione (ErnieG@mm.st). - } { - set p_ims_md_id $acs_object + # Annotation - # if record exists... - if {[db_0or1row check_md_record {select ims_md_id from ims_md where ims_md_id = :p_ims_md_id}]} { + set annotations [lors::imsmd::mdAnnotation -node $lom -prefix $prefix] - # ... then delete it -# db_transaction { - db_dml add_md { - delete from ims_md where ims_md_id = :p_ims_md_id - } -# } on_error { -# ad_return_error "[_ lors.lt_Transaction_deleting_]" "[_ lors.The_error_was] $errmsg" -# } - } + foreach annotation $annotations { + set p_ims_md_an_id [db_nextval ims_md_annotation_seq] + set p_entity [lindex [lindex $annotation 0] 0] + set p_date [lindex [lindex $annotation 1] 0] + set p_date_l [lindex [lindex [lindex $annotation 1] 1] 0] + set p_date_s [lindex [lindex [lindex $annotation 1] 1] 1] - } + set p_descriptions [lindex $annotation 2] - ad_proc -public mdExist { - {-ims_md_id:required} - } { - Checks whether the acs_object (ims_md_id) does exist. - Returns 1 if that's the case, 0 otherwise - - @param ims_md_id the acs object id - @author Ernie Ghiglione (ErnieG@mm.st). - } { - set p_ims_md_id $ims_md_id + db_dml add_new_annotation { + insert into ims_md_annotation (ims_md_an_id, ims_md_id, entity, date, date_l, date_s) + values (:p_ims_md_an_id, :p_ims_md_id, :p_entity, :p_date, :p_date_l, :p_date_s) + } - # if record exists... returns 1 - return [db_0or1row check_md_record {select ims_md_id from ims_md where ims_md_id = :p_ims_md_id}] + foreach description $p_descriptions { + set p_ims_md_an_de_id [db_nextval ims_md_annotation_descrip_seq] + set p_descrip_l [lindex $description 0] + set p_descrip_s [lindex $description 1] - } + db_dml add_new_ann_descriptions { + insert into ims_md_annotation_descrip (ims_md_an_de_id, ims_md_an_id, descrip_l, descrip_s) + values (:p_ims_md_an_de_id, :p_ims_md_an_id, :p_descrip_l, :p_descrip_s) + } + } + } + # Classification + set classifications [lors::imsmd::mdClassification -node $lom -prefix $prefix] + foreach class $classifications { + # purpose + set p_ims_md_cl_id [db_nextval ims_md_classification_seq] + set p_purpose_s [lindex \ + [lindex \ + [lindex \ + [lindex \ + [lindex $class 0] 0] 0] 0] 1] + set p_purpose_v [lindex \ + [lindex \ + [lindex \ + [lindex \ + [lindex $class 0] 0] 0] 1] 1] + db_dml add_new_classification { + insert into ims_md_classification (ims_md_cl_id, ims_md_id, purpose_s, purpose_v) + values (:p_ims_md_cl_id, :p_ims_md_id, :p_purpose_s, :p_purpose_v) + } + # description + set descriptions [lindex [lindex $class 0] 1] - -} + foreach desc $descriptions { + set p_ims_md_cl_de_id [db_nextval ims_md_classification_desc_seq] + set p_descrip_l [lindex $desc 0] + set p_descrip_s [lindex $desc 1] + db_dml add_new_description { + insert into ims_md_classification_descrip (ims_md_cl_de_id, ims_md_cl_id, descrip_l, descrip_s) + values (:p_ims_md_cl_de_id, :p_ims_md_cl_id, :p_descrip_l, :p_descrip_s) + } + } + # taxonpath + set taxonpaths [lindex [lindex $class 0] 2] -namespace eval lors::imsmd::xml { + foreach taxonpath $taxonpaths { + set p_source [lindex $taxonpath 0] -### Generic XML creating tDOM functions -# Created just to make the super-tedious XML creation with tDOM a bit -# easier + set p_source_l [lindex [lindex $p_source 0] 0] + set p_source_s [lindex [lindex $p_source 0] 1] + set p_ims_md_cl_ta_id [db_nextval ims_md_classification_taxpath_seq] - ad_proc -public newElement { - {-owner:required} - {-name:required} - } { - Creates an XML element node - - @param owner owner node - @param name element name - @author Ernie Ghiglione (ErnieG@mm.st). - } { + set taxons [lindex $taxonpath 1] - return [[$owner ownerDocument] createElement $name] + db_dml add_new_taxonpaths { + insert into ims_md_classification_taxpath (ims_md_cl_ta_id, ims_md_cl_id, source_l, source_v) + values (:p_ims_md_cl_ta_id, :p_ims_md_cl_id, :p_source_l, :p_source_s) + } + foreach taxon $taxons { + set p_ims_md_cl_ta_ta_id [db_nextval ims_md_classification_taxpath_taxon_seq] + set p_hierarchy [lindex $taxon 0] + set p_identifier [lindex $taxon 1] + set p_entry_l [lindex [lindex $taxon 2] 0] + set p_entry_s [lindex [lindex $taxon 2] 1] + + db_dml add_new_taxons { + insert into ims_md_classification_taxpath_taxon (ims_md_cl_ta_ta_id, ims_md_cl_ta_id, hierarchy, identifier, entry_l, entry_s) + values (:p_ims_md_cl_ta_ta_id, :p_ims_md_cl_ta_id, :p_hierarchy, :p_identifier, :p_entry_l, :p_entry_s) + } + } + } + + # keywords + set keywords [lindex [lindex $class 0] 3] + + foreach keyword $keywords { + set p_ims_md_cl_ke_id [db_nextval ims_md_classification_keyword_seq] + set p_keyword_l [lindex $keyword 0] + set p_keyword_s [lindex $keyword 1] + + db_dml add_new_keywords { + insert into ims_md_classification_keyword (ims_md_cl_ke_id, ims_md_cl_id, keyword_l, keyword_s) + values (:p_ims_md_cl_ke_id, :p_ims_md_cl_id, :p_keyword_l, :p_keyword_s) + } + } + } } - ad_proc -public newElementText { - {-owner:required} - {-name:required} - {-text:required} + + ad_proc -public addMetadata { + {-acs_object:required} + {-node:required} + {-dir {}} } { - Creates an XML element with a text node - - @param owner owner node - @param name element name - @param text text - @author Ernie Ghiglione (ErnieG@mm.st). + Adds metadata for a learning resource. + + @option acs_object acs object for resource (element) that contains metadata. + @option node XML node that contains the metadata + @option dir directory where the imsmanifest.xml file is located. This is use in the case the metadata is in a different file location (adlcp:location). + @author Ernie Ghiglione (ErnieG@mm.st). + } { - - set node_text [lors::imsmd::xml::newText -owner $owner -text $text] - set node [lors::imsmd::xml::newElement -owner $owner -name $name] - $node appendChild $node_text - - return $node + set p_ims_md_id $acs_object + set mdnode $node + set path_to_file $dir + #[lors::imsmd::getMDNode $manifest] + set p_schema [lindex [lindex [lors::imsmd::getMDSchema $mdnode] 0] 0] + set p_schemaversion [lindex [lors::imsmd::getMDSchema $mdnode] 1] + + set lom [lindex [lors::imsmd::getLOM $mdnode $path_to_file] 0] + set prefix [lindex [lors::imsmd::getLOM $mdnode $path_to_file] 1] + + + # inserts into db + # Checks if there's a LOM record + if {$lom != 0} { + # Adds new MD record to ims_md + lors::imsmd::addMDSchemaVersion \ + -acs_object $p_ims_md_id \ + -schema $p_schema \ + -schemaversion $p_schemaversion + + lors::imsmd::addLOM \ + -lom $lom \ + -prefix $prefix \ + -acs_object $p_ims_md_id \ + -dir $path_to_file + } + return 1 } - ad_proc -public newText { - {-owner:required} - {-text:required} + + ad_proc -public addMDSchemaVersion { + {-acs_object:required} + {-schema:required} + {-schemaversion:required} } { - Creates an XML Text node - - @param owner owner node - @param text text - @author Ernie Ghiglione (ErnieG@mm.st). + Adds MD schema and schema version to db + If the metedata record already exists, then it deletes it + and creates a new one. + + @param acs_object acs object for resource (element) that contains metadata. + @param schema MD schema used for the learning resource. + @param schemaversion MD schemaversion used for the learning resource. + @author Ernie Ghiglione (ErnieG@mm.st) } { + set p_ims_md_id $acs_object + set p_schema $schema + set p_schemaversion $schemaversion - return [[$owner ownerDocument] createTextNode $text] + # we check if the MD record we are about to insert already + # exists. If that is the case, then we delete it first. + # Yes, we are not versioning metadata (as I believe there's no + # real point on doing so. + lors::imsmd::delMD -acs_object $p_ims_md_id + db_dml add_md { + insert into ims_md (ims_md_id, schema, schemaversion) + values (:p_ims_md_id, :p_schema, :p_schemaversion) + } } - ad_proc -public newComment { - {-owner:required} - {-comment:required} + + ad_proc -public delMD { + {-acs_object:required} } { - Creates an XML Text node - - @param owner owner node - @param comment Comment - @author Ernie Ghiglione (ErnieG@mm.st). + Deletes an MD record (deletes it ALL from the db). + + @param acs_object the acs object metadata we are deleting. + @author Ernie Ghiglione (ErnieG@mm.st). } { + set p_ims_md_id $acs_object - return [[$owner ownerDocument] createComment $comment] - + # if record exists... + if {[db_0or1row check_md_record {select ims_md_id from ims_md where ims_md_id = :p_ims_md_id}]} { + # ... then delete it + db_dml add_md { + delete from ims_md where ims_md_id = :p_ims_md_id + } + } } -### End Generic XML creating tDOM functions -} + ad_proc -public mdExist { + {-ims_md_id:required} + } { + Checks whether the acs_object (ims_md_id) does exist. + Returns 1 if that's the case, 0 otherwise + @param ims_md_id the acs object id + @author Ernie Ghiglione (ErnieG@mm.st). + } { + set p_ims_md_id $ims_md_id + # if record exists... returns 1 + return [db_0or1row check_md_record {select ims_md_id from ims_md where ims_md_id = :p_ims_md_id}] + } +} -namespace eval lors::imsmd::create { +namespace eval lors::imsmd::xml { -### IMS MD XML creation + ### Generic XML creating tDOM functions + # Created just to make the super-tedious XML creation with tDOM a bit + # easier + ad_proc -public newElement { + {-owner:required} + {-name:required} + } { + Creates an XML element node -## LOM data types + @param owner owner node + @param name element name + @author Ernie Ghiglione (ErnieG@mm.st). + } { + return [[$owner ownerDocument] createElement $name] + } -# langstring - ad_proc -public newLangString { - {-owner:required} - {-lang:required} - {-string:required} + ad_proc -public newElementText { + {-owner:required} + {-name:required} + {-text:required} } { - Creates an LangString data type XML node - - @param owner owner node - @param lang language - @param string String - @author Ernie Ghiglione (ErnieG@mm.st). + Creates an XML element with a text node + + @param owner owner node + @param name element name + @param text text + @author Ernie Ghiglione (ErnieG@mm.st). } { + set node_text [lors::imsmd::xml::newText -owner $owner -text $text] + set node [lors::imsmd::xml::newElement -owner $owner -name $name] + $node appendChild $node_text + return $node + } - set ls_string [lors::imsmd::xml::newText -owner $owner -text $string] - set lang_string_node [lors::imsmd::xml::newElement -owner $owner -name langstring] - $lang_string_node setAttribute xml:lang $lang - $lang_string_node appendChild $ls_string - return $lang_string_node + ad_proc -public newText { + {-owner:required} + {-text:required} + } { + Creates an XML Text node + + @param owner owner node + @param text text + @author Ernie Ghiglione (ErnieG@mm.st). + } { + return [[$owner ownerDocument] createTextNode $text] } - ad_proc -public md { - {-owner:required} - {-schema:required} - {-schemaversion:required} - {-lom:required} + ad_proc -public newComment { + {-owner:required} + {-comment:required} } { - Creates a metadata node. + Creates an XML Text node - @param owner Owner node - @param schema schema - @param schemaversion schemaversion - @param lom lom node - @author Ernie Ghiglione (ErnieG@mm.st). + @param owner owner node + @param comment Comment + @author Ernie Ghiglione (ErnieG@mm.st). } { + return [[$owner ownerDocument] createComment $comment] + } - set metadata [lors::imsmd::xml::newElement -owner $owner -name metadata] + ### End Generic XML creating tDOM functions +} - $metadata appendChild [lors::imsmd::xml::newComment -owner $owner -comment "Generated by LORSm"] +namespace eval lors::imsmd::create { - set schema [lors::imsmd::xml::newElementText -owner $owner -name schema -text $schema] - set schemaversion [lors::imsmd::xml::newElementText -owner $owner -name schemaversion -text $schemaversion] + ## IMS MD XML creation + ## LOM data types - $metadata appendChild $schema - $metadata appendChild $schemaversion - $metadata appendChild $lom - - return $metadata + # langstring + ad_proc -public newLangString { + {-owner:required} + {-lang:required} + {-string:required} + } { + Creates an LangString data type XML node + + @param owner owner node + @param lang language + @param string String + @author Ernie Ghiglione (ErnieG@mm.st). + } { + set ls_string [lors::imsmd::xml::newText -owner $owner \ + -text $string] + set lang_string_node [lors::imsmd::xml::newElement -owner $owner \ + -name langstring] + $lang_string_node setAttribute xml:lang $lang + $lang_string_node appendChild $ls_string + return $lang_string_node } - ad_proc -public lom { - {-owner:required} - {-general {}} - {-lifecycle {}} - {-metametadata {}} - {-technical {}} - {-educational {}} - {-rights {}} - {-relation {}} - {-annotation {}} - {-classification {}} + ad_proc -public md { + {-owner:required} + {-schema:required} + {-schemaversion:required} + {-lom:required} } { - Creates a LOM node. - It puts together all the nodes and returns a LOMs node. - - @param owner ownerDocument node - @param general General node - @param lifecycle Lifecycle node - @param metametadata Metametadata node - @param technical Technical node - @param educational Educational node - @param rights Rights node - @param relation Relation node - @param annotation Annotation node - @param classification Classification node + Creates a metadata node. - @author Ernie Ghiglione (ErnieG@mm.st). + @param owner Owner node + @param schema schema + @param schemaversion schemaversion + @param lom lom node + @author Ernie Ghiglione (ErnieG@mm.st). } { + set metadata [lors::imsmd::xml::newElement \ + -owner $owner \ + -name metadata] - set lom [lors::imsmd::xml::newElement -owner $owner -name lom] + $metadata appendChild [lors::imsmd::xml::newComment \ + -owner $owner \ + -comment "Generated by LORSm"] - if {![empty_string_p $general]} { - $lom appendChild $general - } + set schema [lors::imsmd::xml::newElementText \ + -owner $owner \ + -name schema \ + -text $schema] - if {![empty_string_p $lifecycle]} { - $lom appendChild $lifecycle - } + set schemaversion [lors::imsmd::xml::newElementText \ + -owner $owner \ + -name schemaversion \ + -text $schemaversion] - if {![empty_string_p $metametadata]} { - $lom appendChild $metametadata - } + $metadata appendChild $schema + $metadata appendChild $schemaversion + $metadata appendChild $lom - if {![empty_string_p $technical]} { - $lom appendChild $technical - } - - if {![empty_string_p $educational]} { - $lom appendChild $educational - } - - if {![empty_string_p $rights]} { - $lom appendChild $rights - } - - if {![empty_string_p $relation]} { - $lom appendChild $relation - } - - if {![empty_string_p $annotation]} { - $lom appendChild $annotation - } - - if {![empty_string_p $classification]} { - $lom appendChild $classification - } - - return $lom - - + return $metadata } - ad_proc -public lom_general { - {-owner:required} - {-identifier {}} - {-title {}} - {-catalogentry {}} - {-language {}} - {-description {}} - {-keyword {}} - {-coverage {}} - {-structure {}} - {-aggregationlevel {}} + ad_proc -public lom { + {-owner:required} + {-general {}} + {-lifecycle {}} + {-metametadata {}} + {-technical {}} + {-educational {}} + {-rights {}} + {-relation {}} + {-annotation {}} + {-classification {}} } { - Creates a LOM general node. - It puts together all the general nodes + Creates a LOM node. + It puts together all the nodes and returns a LOMs node. - refer to http://www.imsglobal.org/metadata/imsmdv1p2p1/imsmd_bindv1p2p1.html - for further details. + @param owner ownerDocument node + @param general General node + @param lifecycle Lifecycle node + @param metametadata Metametadata node + @param technical Technical node + @param educational Educational node + @param rights Rights node + @param relation Relation node + @param annotation Annotation node + @param classification Classification node + @author Ernie Ghiglione (ErnieG@mm.st). + } { - @param owner ownerDocument node - @param identifier identifier - @param title Name given to the learning object. element occurs 0 or 1 time within the element. - @param catalogentry This data element defines an entry within a catalog. element occurs 0 or more times. - @param language The primary human language or languages used within this learning object to communicate to the intended user.element occurs 0 or more times - @param description A textual description of the content of this learning object.element occurs 0 or more times - @param keyword A collection of keywords or phrases describing this learning object. element occurs 0 or more times - @param coverage The span or extent of such things as time, culture, geography or region that applies to this learning object.element occurs 0 or more times - @param structure Underlying organizational structure element occur 0 or 1 time - @param aggregationlevel The functional granularity. element occurs 0 or 1 time + set lom [lors::imsmd::xml::newElement \ + -owner $owner \ + -name lom] - @author Ernie Ghiglione (ErnieG@mm.st). - } { + if {![empty_string_p $general]} { + $lom appendChild $general + } + if {![empty_string_p $lifecycle]} { + $lom appendChild $lifecycle + } - set general [lors::imsmd::xml::newElement -owner $owner -name general] + if {![empty_string_p $metametadata]} { + $lom appendChild $metametadata + } - # identifier + if {![empty_string_p $technical]} { + $lom appendChild $technical + } - if {![empty_string_p $identifier]} { + if {![empty_string_p $educational]} { + $lom appendChild $educational + } - set identifier_node [lors::imsmd::xml::newElementText \ - -owner $owner \ - -name indentifier \ - -text $identifier] + if {![empty_string_p $rights]} { + $lom appendChild $rights + } - $general appendChild $identifier_node - } + if {![empty_string_p $relation]} { + $lom appendChild $relation + } + if {![empty_string_p $annotation]} { + $lom appendChild $annotation + } - # title + if {![empty_string_p $classification]} { + $lom appendChild $classification + } + return $lom + } - if {![empty_string_p $title]} { - set title_node [lors::imsmd::xml::newElement -owner $owner -name title] - - foreach {y z} $title { - set langstring_node [lors::imsmd::create::newLangString \ - -owner $owner \ - -lang $y \ - -string $z \ - ] - - - $title_node appendChild $langstring_node + ad_proc -public lom_general { + {-owner:required} + {-identifier {}} + {-title {}} + {-catalogentry {}} + {-language {}} + {-description {}} + {-keyword {}} + {-coverage {}} + {-structure {}} + {-aggregationlevel {}} + } { + Creates a LOM general node. + It puts together all the general nodes - } + refer to http://www.imsglobal.org/metadata/imsmdv1p2p1/imsmd_bindv1p2p1.html + for further details. - $general appendChild $title_node - } - - # description - if {![empty_string_p $description]} { + @param owner ownerDocument node + @param identifier identifier + @param title Name given to the learning object. element occurs 0 or 1 time within the element. + @param catalogentry This data element defines an entry within a catalog. element occurs 0 or more times. + @param language The primary human language or languages used within this learning object to communicate to the intended user.element occurs 0 or more times + @param description A textual description of the content of this learning object.element occurs 0 or more times + @param keyword A collection of keywords or phrases describing this learning object. element occurs 0 or more times + @param coverage The span or extent of such things as time, culture, geography or region that applies to this learning object.element occurs 0 or more times + @param structure Underlying organizational structure element occur 0 or 1 time + @param aggregationlevel The functional granularity. element occurs 0 or 1 time - set description_node [lors::imsmd::xml::newElement -owner $owner -name description] - - foreach {y z} $description { - set langstring_node [lors::imsmd::create::newLangString \ - -owner $owner \ - -lang $y \ - -string $z \ - ] - - - $description_node appendChild $langstring_node + @author Ernie Ghiglione (ErnieG@mm.st). + } { + set general [lors::imsmd::xml::newElement \ + -owner $owner \ + -name general] - } + # identifier + if {![empty_string_p $identifier]} { + set identifier_node [lors::imsmd::xml::newElementText \ + -owner $owner \ + -name indentifier \ + -text $identifier] + $general appendChild $identifier_node + } - $general appendChild $description_node - } + # title + if {![empty_string_p $title]} { + set title_node [lors::imsmd::xml::newElement \ + -owner $owner \ + -name title] - return $general + foreach {y z} $title { + set langstring_node [lors::imsmd::create::newLangString \ + -owner $owner \ + -lang $y \ + -string $z] + $title_node appendChild $langstring_node + } + $general appendChild $title_node + } - } + # description + if {![empty_string_p $description]} { + set description_node [lors::imsmd::xml::newElement \ + -owner $owner \ + -name description] + foreach {y z} $description { + set langstring_node [lors::imsmd::create::newLangString \ + -owner $owner \ + -lang $y \ + -string $z] + $description_node appendChild $langstring_node + } + $general appendChild $description_node + } + return $general + } } - Index: openacs-4/packages/lors/tcl/lors-imsmd-sc-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/tcl/lors-imsmd-sc-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lors/tcl/lors-imsmd-sc-procs.tcl 7 Jun 2006 13:45:20 -0000 1.3 +++ openacs-4/packages/lors/tcl/lors-imsmd-sc-procs.tcl 17 Nov 2008 13:35:04 -0000 1.4 @@ -1,9 +1,9 @@ # packages/lors/tcl/lorsm-imsmd-sc-procs.tcl ad_library { - + LORS metadata search procedures - + @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 2004-05-21 @arch-tag c74bf9d3-ec3b-423f-808b-fc41e6f32cc5 @@ -14,94 +14,101 @@ namespace eval lors::imsmd::sc { ad_proc mdrecord__datasource { - {ims_md_id} + {ims_md_id} } { - @param ims_md_id Metadata Record Identifier - @author Ernie Ghiglione (ErnieG@mm.st) + @param ims_md_id Metadata Record Identifier + @author Ernie Ghiglione (ErnieG@mm.st) } { - # Get Object_id - set object_id $ims_md_id + # Get Object_id + set object_id $ims_md_id - # Get Titles - # LOM General Title can have a bunch of titles in different - # languages. We get them all here. - set titles "" + # Get Titles + # LOM General Title can have a bunch of titles in different + # languages. We get them all here. + set titles "" - db_foreach title {select title_l, title_s from ims_md_general_title where ims_md_id = :ims_md_id} { + db_foreach title { + select title_l, title_s + from ims_md_general_title + where ims_md_id = :ims_md_id} { - if {![empty_string_p $title_l]} { - append titles "$title_s ($title_l) " - } else { - append titles "$title_s " - } - } + if {![empty_string_p $title_l]} { + append titles "$title_s ($title_l) " + } else { + append titles "$title_s " + } + } - # Get content - # we will pass LOM General description as content (we should - # improve this a bit more in the future with feedback + # Get content + # we will pass LOM General description as content (we should + # improve this a bit more in the future with feedback - set descriptions "" + set descriptions "" - db_foreach description {select descrip_l, descrip_s from ims_md_general_desc where ims_md_id = :ims_md_id} { + db_foreach description { + select descrip_l, descrip_s + from ims_md_general_desc + where ims_md_id = :ims_md_id} { - if {![empty_string_p $descrip_l]} { - append descriptions "$descrip_s ($descrip_l) " - } else { - append descriptions "$descrip_s " - } - } + if {![empty_string_p $descrip_l]} { + append descriptions "$descrip_s ($descrip_l) " + } else { + append descriptions "$descrip_s " + } + } + # Get MIME + # LOM is just text therefore.. + set mime "text/plain" - # Get MIME - # LOM is just text therefore.. - set mime "text/plain" + # Get Keywords + # LOM General Keywords - # Get Keywords - # LOM General Keywords + set keywords "" + db_foreach keyword { + select keyword_l, keyword_s + from ims_md_general_key + where ims_md_id = :ims_md_id} { + if {![empty_string_p $keyword_l]} { + append keywords "$keyword_s ($keyword_l) " + } else { + append keywords "$keyword_s " + } + } - set keywords "" - db_foreach keyword {select keyword_l, keyword_s from ims_md_general_key where ims_md_id = :ims_md_id} { + # Storage type + set storage_type "text" - if {![empty_string_p $keyword_l]} { - append keywords "$keyword_s ($keyword_l) " - } else { - append keywords "$keyword_s " - } - } + # the contact of titles and descriptions is because the search + # functionality only indexes content (for some reasons), so I + # put the titles as well so they can be indexes too. Sames as + # keywords, actually. - # Storage type - set storage_type "text" + set data_list [list object_id $object_id \ + title $titles \ + content [concat $titles $descriptions $keywords] \ + mime $mime \ + keywords $keywords \ + storage_type $storage_type] + array set datasource $data_list - # the contact of titles and descriptions is because the search - # functionality only indexes content (for some reasons), so I - # put the titles as well so they can be indexes too. Sames as - # keywords, actually. - - set data_list [list object_id $object_id title $titles content [concat $titles $descriptions $keywords] mime $mime keywords $keywords storage_type $storage_type] - array set datasource $data_list - - - return [array get datasource] - + return [array get datasource] } - ad_proc mdrecord__url { - {ims_md_id} + {ims_md_id} } { - @param ims_md_id Metadata Record Identifier - @author Ernie Ghiglione (ErnieG@mm.st) + @param ims_md_id Metadata Record Identifier + @author Ernie Ghiglione (ErnieG@mm.st) } { -# set url_stub [apm_package_url_from_id [apm_package_id_from_key "lorsm"]] -# set url "${url_stub}md/?ims_md_id=$ims_md_id" + # set url_stub [apm_package_url_from_id [apm_package_id_from_key "lorsm"]] + # set url "${url_stub}md/?ims_md_id=$ims_md_id" + set url "/lorsm/md/?ims_md_id=$ims_md_id" - set url "/lorsm/md/?ims_md_id=$ims_md_id" - - return $url - + return $url } } Index: openacs-4/packages/lors/tcl/lors-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/tcl/lors-procs.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/lors/tcl/lors-procs.tcl 8 Oct 2008 13:01:05 -0000 1.10 +++ openacs-4/packages/lors/tcl/lors-procs.tcl 17 Nov 2008 13:35:04 -0000 1.11 @@ -1,9 +1,9 @@ # packages/lors/tcl/lors-procs.tcl ad_library { - + Helper procedures for LORS - + @author Dave Bauer (dave@thedesignexperience.org) @creation-date 2006-06-06 @cvs-id $Id$ @@ -17,17 +17,15 @@ {-url "view"} } { Generate a URL for an acs_object as a learning object - + @author Dave Bauer (dave@thedesignexperience.org) @creation-date 2006-06-06 - - @param object_id + @param object_id @param url - @return - - @error + @return + @error } { #view is easy @@ -38,48 +36,59 @@ ns_log notice "lors::object_Url object_id='${object_id}'" switch $url { admin { - switch $object_type { as_sections { # FIXME either 1) make this magically work - # or 2) find the assessment_id and use + # or 2) find the assessment_id and use # page anchor - set assessment_id "" - set sort_order "" - db_0or1row get_assessment_id "select ci.item_id as assessment_id, sort_order from cr_items ci, cr_revisions cr, as_assessment_section_map m where cr.item_id=:object_id and cr.revision_id=m.section_id and ci.latest_revision=assessment_id" + set assessment_id "" + set sort_order "" + db_0or1row get_assessment_id \ + "select ci.item_id as assessment_id, sort_order + from cr_items ci, cr_revisions cr, as_assessment_section_map m + where cr.item_id=:object_id + and cr.revision_id=m.section_id + and ci.latest_revision=assessment_id" return [export_vars \ -base questions \ - {man_id assessment_id}][ad_decode {$sort_order eq ""} 0 "\#${sort_order}" ""] - } - "::xowiki::Page" { - set url [::xowiki::Package get_url_from_id -item_id $object_id] - set page [::xowiki::Package instantiate_page_from_id -item_id $object_id] - if {[catch {set url [[$page set package_id] make_link -privilege public -link $url $page edit ""]} errmsg]} { - set url [$page make_link -privilege public -url $url $page edit ""] + {man_id assessment_id}]\ + [ad_decode {$sort_order eq ""} 0 "\#${sort_order}" ""] + } "::xowiki::Page" { + set url [::xowiki::Package get_url_from_id \ + -item_id $object_id] + + set page [::xowiki::Package instantiate_page_from_id \ + -item_id $object_id] + + if {[catch {set url [[$page set package_id] make_link \ + -privilege public \ + -link $url $page edit ""]} errmsg]} { + set url [$page make_link \ + -privilege public \ + -url $url $page edit ""] } + return "${url}&return_url=[ad_urlencode [ad_return_url]]" - return "${url}&return_url=[ad_urlencode [ad_return_url]]" - - } - default { - set item_id [content::revision::item_id -revision_id $object_id] - return [export_vars -base "item-add-edit" {man_id item_id {return_url [ad_return_url]}}] - } + } default { + set item_id [content::revision::item_id \ + -revision_id $object_id] + return [export_vars \ + -base "item-add-edit" \ + {man_id item_id {return_url [ad_return_url]}}] + } } - - } - default { + + } default { return "/o/${object_id}" } - } } ad_proc lors::items_select_options { -man_id } { - Generate a list of lists of names and ims_item_ids of + Generate a list of lists of names and ims_item_ids of items in one course @param man_id Manifst id for one course Index: openacs-4/packages/lors/tcl/lors-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/tcl/lors-test-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lors/tcl/lors-test-procs.tcl 7 Jun 2006 13:45:20 -0000 1.2 +++ openacs-4/packages/lors/tcl/lors-test-procs.tcl 17 Nov 2008 13:35:04 -0000 1.3 @@ -1,9 +1,9 @@ -# +# ad_library { - + Test lorsm-manifest procs - + @author devopenacs5 (devopenacs5@www) @creation-date 2005-08-20 @arch-tag: /usr/local/bin/bash: line 1: uuidgen: command not found @@ -18,17 +18,22 @@ -test_code { # get folder_id (where?) set folder_id [content::folder::new -name "__lors_test__"] + content::folder::register_content_type \ -folder_id $folder_id \ -content_type content_revision \ -include_subtypes t # get fs_package_id (where?) set fs_package_id "" + # get package_id - set __package_id [db_string get_package "select package_id from apm_packages where package_key='lorsm' limit 1"] + set __package_id [db_string get_package \ + "select package_id + from apm_packages + where package_key='lorsm' limit 1"] # get community_id - + # create a new manifest set man_id \ [db_exec_plsql man { @@ -68,7 +73,7 @@ :__package_id ) }] - + # create some resources set res_id \ [db_exec_plsql res { @@ -86,7 +91,7 @@ :__package_id ) }] - + # create some items set item_id \ [db_exec_plsql item { @@ -113,6 +118,7 @@ :__package_id ) }] + # create some files set file_id \ [package_exec_plsql \ @@ -134,17 +140,21 @@ } # create item_to_resource mapping - db_dml i_to_r "insert into ims_cp_items_to_resources - (item_id,res_id) values (:item_id,:res_id)" + db_dml i_to_r \ + "insert into ims_cp_items_to_resources (item_id,res_id) + values (:item_id,:res_id)" # create student_tracking - + # create cmi_core (whatever that is) - + # create some metadata # try to delete the whole couse lors::imscp::manifest_delete -man_id $man_id -delete_all t } - aa_false "Manifest $man_id deleted" [db_0or1row get_man "select man_id from ims_cp_manifests where man_id=:man_id"] -} \ No newline at end of file + aa_false "Manifest $man_id deleted" [db_0or1row get_man \ + "select man_id + from ims_cp_manifests + where man_id=:man_id"] +} Index: openacs-4/packages/lors/tcl/test/lors-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/tcl/test/lors-test-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lors/tcl/test/lors-test-procs.tcl 7 Jun 2006 13:45:20 -0000 1.2 +++ openacs-4/packages/lors/tcl/test/lors-test-procs.tcl 17 Nov 2008 13:35:56 -0000 1.3 @@ -1,419 +1,445 @@ -# - ad_library { - + Test lorsm-manifest procs - + @author devopenacs5 (devopenacs5@www) @creation-date 2005-08-20 @arch-tag: /usr/local/bin/bash: line 1: uuidgen: command not found @cvs-id $Id$ } + aa_register_case lors_manifest { lors ims manifest test } { - aa_run_with_teardown \ - -rollback \ - -test_code { - if {[set man_id [db_string get_man_id "select man_id from ims_cp_manifests where course_name='__test_course__'" -default ""]] ne ""} { + aa_run_with_teardown -rollback -test_code { + if {[set man_id [db_string get_man_id \ + "select man_id + from ims_cp_manifests + where course_name='__test_course__'" -default ""]] ne ""} { + lors::imscp::manifest_delete -man_id $man_id -delete_all t + set man_id "" + } - lors::imscp::manifest_delete -man_id $man_id -delete_all t - set man_id "" - } - if {[set folder_id [db_string get_folder_id "select folder_id from cr_folders where label='__lors_test__'" -default ""]] ne ""} { - content::folder::delete -folder_id $folder_id - set folder_id "" - } - set folder_id [content::folder::new -name "__lors_test__"] - set resources_folder_id [content::folder::new -name "__lors_test_resources__"] - set orgs_folder_id [content::folder::new -name "__lors_test_orgs__"] - set items_folder_id [content::folder::new -name "__lors_test_items__"] - content::folder::register_content_type \ - -folder_id $folder_id \ - -content_type content_revision \ - -include_subtypes t - content::folder::register_content_type \ - -folder_id $items_folder_id \ - -content_type content_revision \ - -include_subtypes t - content::folder::register_content_type \ - -folder_id $resources_folder_id \ - -content_type content_revision \ - -include_subtypes t - content::folder::register_content_type \ - -folder_id $orgs_folder_id \ - -content_type content_revision \ - -include_subtypes t - aa_log "folder_id='${folder_id}'" - # get fs_package_id (where?) - set fs_package_id "" - # get package_id - set __package_id [db_string get_package "select package_id from apm_packages where package_key='lorsm' limit 1"] - # get community_id - set community_id [db_string get_community_id "select community_id from dotlrn_communities_all limit 1"] - # create a new manifest - set man_id \ - [lors::imscp::manifest_add \ - -man_id "" \ - -identifier "__identifier__" \ - -course_name "__test_course__" \ - -version "__version__" \ - -orgs_default "__orgs_default__" \ - -hasmetadata f \ - -isscorm f \ - -folder_id $folder_id \ - -fs_package_id $fs_package_id \ - -package_id $__package_id \ - -community_id $community_id] - + if {[set folder_id [db_string get_folder_id \ + "select folder_id + from cr_folders + where label='__lors_test__'" -default ""]] ne ""} { + content::folder::delete -folder_id $folder_id + set folder_id "" + } - # create organization - set org_id \ - [lors::imscp::organization_add \ - -man_id $man_id \ - -identifier "__identifier__" \ - -structure "__structure__" \ - -title "__title__" \ - -hasmetadata "f" \ - -package_id $__package_id \ - -org_folder_id $orgs_folder_id] + set folder_id [content::folder::new -name "__lors_test__"] + set resources_folder_id [content::folder::new -name "__lors_test_resources__"] + set orgs_folder_id [content::folder::new -name "__lors_test_orgs__"] + set items_folder_id [content::folder::new -name "__lors_test_items__"] - # create some resources - set res_id \ - [lors::imscp::resource_add \ - -man_id $man_id \ - -identifier "res__identifier__" \ - -type "__type__" \ - -href "__href__" \ - -scorm_type "__scorm_type__" \ - -hasmetadata f \ - -package_id $__package_id \ - -res_folder_id $resources_folder_id] - - # create some items - set item_id [lors::imscp::item_add \ - -org_id $org_id \ - -identifier "__identifier__" \ - -identifierref "__identifier_href__" \ - -isvisible true \ - -parameters "__parameters__" \ - -title "__title__" \ - -hasmetadata false \ - -prerequisites_t "__prereq_t__" \ - -prerequisites_s "__prereq_s__" \ - -type "__type__" \ - -maxtimeallowed "__maxtimeallowed__" \ - -timelimitaction "__timelimitaction__" \ - -datafromlms "__datafromlms__" \ - -masteryscore "__masteryscore__" \ - -package_id $__package_id \ - -itm_folder_id $items_folder_id] + content::folder::register_content_type \ + -folder_id $folder_id \ + -content_type content_revision \ + -include_subtypes t - # create some files - set file_id \ - [package_exec_plsql \ - -var_list [list \ - [list name "__content_item_name__"] \ - [list parent_id $folder_id] \ - [list content_type "file_storage_object"] \ - [list title "__title__"]] \ - content_item new] - set file_rev_id [content::item::get_latest_revision -item_id $file_id] - db_exec_plsql file { - select ims_file__new ( - :file_rev_id, - :res_id, - '__path_to_filename__', - '__filename__', - false --hasmetadata - ) - } + content::folder::register_content_type \ + -folder_id $items_folder_id \ + -content_type content_revision \ + -include_subtypes t - # create item_to_resource mapping - db_dml i_to_r "insert into ims_cp_items_to_resources - (ims_item_id,res_id) values (:item_id,:res_id)" + content::folder::register_content_type \ + -folder_id $resources_folder_id \ + -content_type content_revision \ + -include_subtypes t - # create student_tracking - - # create cmi_core (whatever that is) - - # create some metadata + content::folder::register_content_type \ + -folder_id $orgs_folder_id \ + -content_type content_revision \ + -include_subtypes t - # try to delete the whole couse - lors::imscp::manifest_delete -man_id $man_id -delete_all t + aa_log "folder_id='${folder_id}'" + # get fs_package_id (where?) + set fs_package_id "" + + # get package_id + set __package_id [db_string get_package \ + "select package_id + from apm_packages + where package_key='lorsm' limit 1"] + + # get community_id + set community_id [db_string get_community_id \ + "select community_id + from dotlrn_communities_all limit 1"] + + # create a new manifest + set man_id [lors::imscp::manifest_add \ + -man_id "" \ + -identifier "__identifier__" \ + -course_name "__test_course__" \ + -version "__version__" \ + -orgs_default "__orgs_default__" \ + -hasmetadata f \ + -isscorm f \ + -folder_id $folder_id \ + -fs_package_id $fs_package_id \ + -package_id $__package_id \ + -community_id $community_id] + + # create organization + set org_id [lors::imscp::organization_add \ + -man_id $man_id \ + -identifier "__identifier__" \ + -structure "__structure__" \ + -title "__title__" \ + -hasmetadata "f" \ + -package_id $__package_id \ + -org_folder_id $orgs_folder_id] + + # create some resources + set res_id [lors::imscp::resource_add \ + -man_id $man_id \ + -identifier "res__identifier__" \ + -type "__type__" \ + -href "__href__" \ + -scorm_type "__scorm_type__" \ + -hasmetadata f \ + -package_id $__package_id \ + -res_folder_id $resources_folder_id] + + # create some items + set item_id [lors::imscp::item_add \ + -org_id $org_id \ + -identifier "__identifier__" \ + -identifierref "__identifier_href__" \ + -isvisible true \ + -parameters "__parameters__" \ + -title "__title__" \ + -hasmetadata false \ + -prerequisites_t "__prereq_t__" \ + -prerequisites_s "__prereq_s__" \ + -type "__type__" \ + -maxtimeallowed "__maxtimeallowed__" \ + -timelimitaction "__timelimitaction__" \ + -datafromlms "__datafromlms__" \ + -masteryscore "__masteryscore__" \ + -package_id $__package_id \ + -itm_folder_id $items_folder_id] + + # create some files + set file_id [package_exec_plsql \ + -var_list [list \ + [list name "__content_item_name__"] \ + [list parent_id $folder_id] \ + [list content_type "file_storage_object"] \ + [list title "__title__"]] \ + content_item new] + + set file_rev_id [content::item::get_latest_revision -item_id $file_id] + db_exec_plsql file { + select ims_file__new ( + :file_rev_id, + :res_id, + '__path_to_filename__', + '__filename__', + false --hasmetadata + ) } - aa_false "Manifest $man_id deleted" [db_0or1row get_man "select man_id from ims_cp_manifests where man_id=:man_id"] + + # create item_to_resource mapping + db_dml i_to_r "insert into ims_cp_items_to_resources + (ims_item_id,res_id) values (:item_id,:res_id)" + + # create student_tracking + + # create cmi_core (whatever that is) + + # create some metadata + + # try to delete the whole couse + lors::imscp::manifest_delete -man_id $man_id -delete_all t + } + aa_false "Manifest $man_id deleted" [db_0or1row get_man "select man_id from + ims_cp_manifests where man_id=:man_id"] } + aa_register_case lors_scorm_1_2 { lors ims manifest test } { - aa_run_with_teardown \ - -rollback \ - -test_code { - set folder_name [ns_mktemp lors_folderXXXXXX] - set folder_id [content::folder::new -name $folder_name] -# set folder_id 458507 - aa_log "Created folder $folder_name '${folder_id}'" - aa_log "[db_string q "select parent_id from cr_items where item_id=:folder_id"]" - aa_log "[db_string q "select content_item__get_root_folder(:folder_id)"]" - content::folder::register_content_type \ - -folder_id $folder_id \ - -content_type content_revision \ - -include_subtypes t - content::folder::register_content_type \ - -folder_id $folder_id \ - -content_type content_folder \ - -include_subtypes t - set format_id [db_string get_format_id \ - "select format_id from - lorsm_course_presentation_formats - limit 1" -default ""] - set root_dir [acs_root_dir]/packages/lors/tcl/test/Courses/ - set course_id 1 - set indp_p 0 - set fs_package_id [site_node::instantiate_and_mount \ - -node_name [ns_mktemp fs_nodeXXXXXX] \ - -package_key file-storage] - aa_log "FS Package ID = '${fs_package_id}'" + aa_run_with_teardown -rollback -test_code { + set folder_name [ns_mktemp lors_folderXXXXXX] + set folder_id [content::folder::new -name $folder_name] - set community_id [db_string get_community_id "select community_id from dotlrn_communities_all limit 1"] - - foreach fname [list LMSTestCourse01 LMSTestCourse02] { - set course_name [ns_mktemp lors_courseXXXXXX] - set tmp_dir ${root_dir}/${course_name} - file mkdir $tmp_dir - exec /usr/bin/unzip ${root_dir}${fname}.zip -d ${tmp_dir} + aa_log "Created folder $folder_name '${folder_id}'" + aa_log "[db_string q "select parent_id from cr_items where item_id=:folder_id"]" + aa_log "[db_string q "select content_item__get_root_folder(:folder_id)"]" - aa_true "Course ${fname} exists in filesystem" [file exists $tmp_dir] - set vars [list folder_id $folder_id format_id $format_id tmp_dir $tmp_dir course_id $course_id course_name $course_name indb_p 0 fs_package_id $fs_package_id __test 1 community_id $community_id] - set status [catch {template::adp_include /packages/lorsm/lib/course-add-3 $vars} errmsg] -# template::adp_include /packages/lorsm/lib/course-add-3 $vars - aa_false "Imported Course $fname" $status - aa_log "Results $errmsg" - } - aa_log "Imported [db_list get_contents "select name from cr_items where parent_id=:folder_id"]" - } - + content::folder::register_content_type \ + -folder_id $folder_id \ + -content_type content_revision \ + -include_subtypes t + + content::folder::register_content_type \ + -folder_id $folder_id \ + -content_type content_folder \ + -include_subtypes t + + set format_id [db_string get_format_id "select format_id from + lorsm_course_presentation_formats limit 1" -default ""] + set root_dir [acs_root_dir]/packages/lors/tcl/test/Courses/ + set course_id 1 + set indp_p 0 + set fs_package_id [site_node::instantiate_and_mount \ + -node_name [ns_mktemp fs_nodeXXXXXX] \ + -package_key file-storage] + + aa_log "FS Package ID = '${fs_package_id}'" + set community_id [db_string get_community_id \ + "select community_id + from dotlrn_communities_all limit 1"] + + foreach fname [list LMSTestCourse01 LMSTestCourse02] { + set course_name [ns_mktemp lors_courseXXXXXX] + set tmp_dir ${root_dir}/${course_name} + file mkdir $tmp_dir + exec /usr/bin/unzip ${root_dir}${fname}.zip -d ${tmp_dir} + + aa_true "Course ${fname} exists in filesystem" [file exists $tmp_dir] + set vars [list \ + folder_id $folder_id \ + format_id $format_id \ + tmp_dir $tmp_dir \ + course_id $course_id \ + course_name $course_name \ + indb_p 0 \ + fs_package_id $fs_package_id \ + __test 1 \ + community_id $community_id] + set status [catch {template::adp_include /packages/lorsm/lib/course-add-3 $vars} errmsg] + # template::adp_include /packages/lorsm/lib/course-add-3 $vars + aa_false "Imported Course $fname" $status + aa_log "Results $errmsg" + } + + aa_log "Imported [db_list get_contents "select name from cr_items where + parent_id=:folder_id"]" + } } + aa_register_case lors_scorm_check { Check if a manifest is scorm compliant } { - aa_run_with_teardown \ - -rollback \ - -test_code { - set xml { - + aa_run_with_teardown -rollback -test_code { + set xml { + + - - - LMS Test Suite - Course 1 - - LMS Test Suite - Lesson 1 - - LMS Test Suite - SCO 1 - SCO1LaunchData - - - LMS Test Suite - SCO 2 - I_SCO1 - - - LMS Test Suite - SCO 3 - I_SCO2 - - - LMS Test Suite - SCO 4 - I_SCO3 - - - LMS Test Suite - SCO 5 - I_SCO4 - 00:00:05 - continue,message - 80 - - - LMS Test Suite - SCO 6 - I_SCO5 - - - LMS Test Suite - SCO 7 - I_SCO6 - - - LMS Test Suite - SCO 8 - I_SCO7 - - - LMS Test Suite - SCO 9 - I_SCO8 - 02:00:00.00 - continue,message - SCORMTROOPERS - 80 - - - ADL SCORM - 1.2 - Lesson01/Lesson01.xml - - - - ADL SCORM - 1.2 - LMSTestCourse01.xml - + + + LMS Test Suite - Course 1 + + LMS Test Suite - Lesson 1 + + LMS Test Suite - SCO 1 + SCO1LaunchData + - - - + + LMS Test Suite - SCO 2 + I_SCO1 + - - - ADL SCORM - 1.2 - Lesson01/Meta-data/sco01.xml - - - - - + + LMS Test Suite - SCO 3 + I_SCO2 + - - - ADL SCORM - 1.2 - Lesson01/Meta-data/sco%2002.xml - - - - - + + LMS Test Suite - SCO 4 + I_SCO3 + - - - ADL SCORM - 1.2 - Lesson01/Meta-data/sco03.xml - - - - - + + LMS Test Suite - SCO 5 + I_SCO4 + 00:00:05 + continue,message + 80 + - - - ADL SCORM - 1.2 - Lesson01/Meta-data/sco04.xml - - - - - + + LMS Test Suite - SCO 6 + I_SCO5 + - - - ADL SCORM - 1.2 - Lesson01/Meta-data/sco05.xml - - - - - + + LMS Test Suite - SCO 7 + I_SCO6 + - - - ADL SCORM - 1.2 - Lesson01/Meta-data/sco06.xml - - - - - + + LMS Test Suite - SCO 8 + I_SCO7 + - - - ADL SCORM - 1.2 - Lesson01/Meta-data/sco07.xml - - - - - + + LMS Test Suite - SCO 9 + I_SCO8 + 02:00:00.00 + continue,message + SCORMTROOPERS + 80 + - - - ADL SCORM - 1.2 - Lesson01/Meta-data/sco08.xml - - - - - + + ADL SCORM + 1.2 + Lesson01/Lesson01.xml + + - - - ADL SCORM - 1.2 - Lesson01/Meta-data/sco09.xml - - - - - + + ADL SCORM + 1.2 + LMSTestCourse01.xml + - - - + + - - - + + + + ADL SCORM + 1.2 + Lesson01/Meta-data/sco01.xml + + + + + - - - } - + + + ADL SCORM + 1.2 + Lesson01/Meta-data/sco%2002.xml + + + + + - # open manifest file with tDOM - set doc [dom parse $xml] - # gets the manifest tree - set manifest [$doc documentElement] + + + ADL SCORM + 1.2 + Lesson01/Meta-data/sco03.xml + + + + + - set isSCORM [lors::imscp::isSCORM -node $manifest] - - aa_true "isscorm (${isSCORM})" $isSCORM + + + ADL SCORM + 1.2 + Lesson01/Meta-data/sco04.xml + + + + + - set metadata [lindex [$manifest getElementsByTagName metadata] 0] - aa_log "${metadata}" - set MetadataSchema "" - catch {set MetadataSchema [lindex [lindex [lors::imsmd::getMDSchema $metadata] 0] 0]} errmsg - aa_log "${MetadataSchema}" - aa_log [lors::imsmd::getMDSchema $metadata] - } -} \ No newline at end of file + + + ADL SCORM + 1.2 + Lesson01/Meta-data/sco05.xml + + + + + + + + + ADL SCORM + 1.2 + Lesson01/Meta-data/sco06.xml + + + + + + + + + ADL SCORM + 1.2 + Lesson01/Meta-data/sco07.xml + + + + + + + + + ADL SCORM + 1.2 + Lesson01/Meta-data/sco08.xml + + + + + + + + + ADL SCORM + 1.2 + Lesson01/Meta-data/sco09.xml + + + + + + + + + + + + + + + + + } + + # open manifest file with tDOM + set doc [dom parse $xml] + # gets the manifest tree + set manifest [$doc documentElement] + + set isSCORM [lors::imscp::isSCORM -node $manifest] + + aa_true "isscorm (${isSCORM})" $isSCORM + + set metadata [lindex [$manifest getElementsByTagName metadata] 0] + aa_log "${metadata}" + set MetadataSchema "" + catch {set MetadataSchema [lindex \ + [lindex \ + [lors::imsmd::getMDSchema $metadata] 0] 0]} errmsg + aa_log "${MetadataSchema}" + aa_log [lors::imsmd::getMDSchema $metadata] + } +} Index: openacs-4/packages/lorsm/lib/custom-page-admin.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/lib/custom-page-admin.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/lib/custom-page-admin.adp 6 Mar 2008 11:50:43 -0000 1.2 +++ openacs-4/packages/lorsm/lib/custom-page-admin.adp 17 Nov 2008 13:36:42 -0000 1.3 @@ -1,22 +1,26 @@ -

- - - - - - + + + + + +
-@custom_pages.pretty_name@ - - - @custom_pages.item_title@ Edit -None - | -Change -Choose - @custom_pages.type@ page | - - Remove - -
@custom_pages.pretty_name@ + + @custom_pages.item_title@ Edit + + + None + + + | + + Change + Choose + @custom_pages.type@ page + | + + + Remove + +
Index: openacs-4/packages/lorsm/lib/include.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/lib/include.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/lib/include.adp 12 Jun 2006 02:06:09 -0000 1.1 +++ openacs-4/packages/lorsm/lib/include.adp 17 Nov 2008 13:36:43 -0000 1.2 @@ -1,9 +1,9 @@ - - - - - - - - \ No newline at end of file + + + + + + + + Index: openacs-4/packages/lorsm/lib/md-record.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/lib/md-record.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/lib/md-record.tcl 31 Dec 2006 00:36:04 -0000 1.1 +++ openacs-4/packages/lorsm/lib/md-record.tcl 17 Nov 2008 13:36:43 -0000 1.2 @@ -1,17 +1,42 @@ set actions [list] -lappend actions "[_ lorsm._General]" [export_vars -base generalmd {ims_md_id}] "[_ lorsm.lt_View_General_Metadata]" -lappend actions "[_ lorsm.Lifecycle_MD]" [export_vars -base lifecyclemd {ims_md_id}] "[_ lorsm.lt_View_Lifecycle_Metada]" -lappend actions "[_ lorsm.Meta_MD]" [export_vars -base metamd {ims_md_id}] "[_ lorsm.View_Meta_Metadata]" -lappend actions "[_ lorsm.Technical_MD]" [export_vars -base technicalmd {ims_md_id}] "[_ lorsm.lt_View_Technical_Metada]" -lappend actions "[_ lorsm.Educational_MD]" [export_vars -base educationalmd {ims_md_id}] "[_ lorsm.lt_View_Educational_Meta]" -lappend actions "[_ lorsm.Rights_MD]" [export_vars -base rightsmd {ims_md_id}] "[_ lorsm.View_Rights_Metadata]" -lappend actions "[_ lorsm.Relation_MD]" [export_vars -base relationmd {ims_md_id}] "[_ lorsm.lt_View_Relation_Metadat]" -lappend actions "[_ lorsm.Annotation_MD]" [export_vars -base annotationmd {ims_md_id}] "[_ lorsm.lt_View_Annotation_Metad]" -lappend actions "[_ lorsm.Classification_MD]" [export_vars -base classificationmd {ims_md_id}] "[_ lorsm.lt_View_Classification_M_1]" +lappend actions "[_ lorsm._General]" \ + [export_vars -base generalmd {ims_md_id}] \ + "[_ lorsm.lt_View_General_Metadata]" +lappend actions "[_ lorsm.Lifecycle_MD]" \ + [export_vars -base lifecyclemd {ims_md_id}] \ + "[_ lorsm.lt_View_Lifecycle_Metada]" -# Presentation +lappend actions "[_ lorsm.Meta_MD]" \ + [export_vars -base metamd {ims_md_id}] \ + "[_ lorsm.View_Meta_Metadata]" + +lappend actions "[_ lorsm.Technical_MD]" \ + [export_vars -base technicalmd {ims_md_id}] \ + "[_ lorsm.lt_View_Technical_Metada]" + +lappend actions "[_ lorsm.Educational_MD]" \ + [export_vars -base educationalmd {ims_md_id}] \ + "[_ lorsm.lt_View_Educational_Meta]" + +lappend actions "[_ lorsm.Rights_MD]" \ + [export_vars -base rightsmd {ims_md_id}] \ + "[_ lorsm.View_Rights_Metadata]" + +lappend actions "[_ lorsm.Relation_MD]" \ + [export_vars -base relationmd {ims_md_id}] \ + "[_ lorsm.lt_View_Relation_Metadat]" + +lappend actions "[_ lorsm.Annotation_MD]" \ + [export_vars -base annotationmd {ims_md_id}] \ + "[_ lorsm.lt_View_Annotation_Metad]" + +lappend actions "[_ lorsm.Classification_MD]" \ + [export_vars -base classificationmd {ims_md_id}] \ + "[_ lorsm.lt_View_Classification_M_1]" + +# Presentation template::list::create \ -name d_pres \ -multirow d_pres \ @@ -20,42 +45,28 @@ -elements { object_type { label "[_ lorsm.Object_Type]" - } - schema_and_version { - label "[_ lorsm.lt_MD_Schema_and_Version]" + } schema_and_version { + label "[_ lorsm.lt_MD_Schema_and_Version]" html { align center } - } - admin { + } admin { label "[_ lorsm.Edit_Schema_Details]" display_eval {Modify Schema} link_url_eval {[export_vars -base "addmd" ims_md_id]} link_html {title "[_ lorsm.Admin_Course]" class button} html { align center } } - } db_multirow d_pres select_ge_titles { - select - object_type - from - acs_objects - where - object_id = :ims_md_id -} + select object_type + from acs_objects + where object_id = :ims_md_id +} db_multirow -extend { schema_and_version } d_pres select_schema_details { - - select - ims_md_id, - schema, - schemaversion - from - ims_md - where - ims_md_id = :ims_md_id - + select ims_md_id, schema, schemaversion + from ims_md + where ims_md_id = :ims_md_id } { set schema_and_version [concat $schema " " $schemaversion] } - Index: openacs-4/packages/lorsm/lib/repository-shared-courses.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/lib/repository-shared-courses.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/lib/repository-shared-courses.adp 31 Dec 2006 00:36:04 -0000 1.1 +++ openacs-4/packages/lorsm/lib/repository-shared-courses.adp 17 Nov 2008 13:36:43 -0000 1.2 @@ -1,3 +1,3 @@ - + - + Index: openacs-4/packages/lorsm/lib/repository-shared-courses.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/lib/repository-shared-courses.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/lorsm/lib/repository-shared-courses.tcl 8 Oct 2008 13:01:05 -0000 1.5 +++ openacs-4/packages/lorsm/lib/repository-shared-courses.tcl 17 Nov 2008 13:36:43 -0000 1.6 @@ -1,16 +1,16 @@ # packages/lorsm/www/lib/repository-shared-courses.tcl ad_page_contract { - + List all the shared courses in the repository View shared courses - + @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 2004-07-09 @arch-tag: 9dd389d3-195f-49ed-b610-ee893cde06d6 @cvs-id $Id$ } { - + } -properties { } -validate { } -errors { @@ -35,44 +35,43 @@ course_name { label "[_ lorsm.Available_Courses]" display_col course_name - link_url_eval {[export_vars -base $community_url/lorsm/admin/shared/course-info {man_id fs_package_id folder_id}]} + link_url_eval {[export_vars \ + -base $community_url/lorsm/admin/shared/course-info \ + {man_id fs_package_id folder_id}]} link_html {title "[_ lorsm.Access_Course]"} - } - hasmetadata { + } hasmetadata { label "[_ lorsm.Metadata_1]" link_url_eval {[export_vars -base $community_url/lorsm/md {ims_md_id}]} link_html {title "[_ lorsm.See_metadata]" } - html { align center } - } - creation_user { + html { align center } + + } creation_user { label "[_ lorsm.Owner]" display_eval {[person::name -person_id $creation_user]} link_url_eval {[acs_community_member_url -user_id $creation_user]} - } - creation_date { + } creation_date { label "[_ lorsm.Creation_Date]" display_eval {[lc_time_fmt $creation_date "%x %X"]} - } - add { - label "" - display_eval {[_ lorsm.Add_Course]} - link_url_eval {[export_vars -base $community_url/lorsm/admin/add-shared-course {man_id}]} - link_html {title "[_ lorsm.lt_Add_course_to_my_clas]" class button} - } - admin { + } add { + label "" + display_eval {[_ lorsm.Add_Course]} + link_url_eval {[export_vars \ + -base $community_url/lorsm/admin/add-shared-course {man_id}]} + link_html {title "[_ lorsm.lt_Add_course_to_my_clas]" class button} + + } admin { label "[_ lorsm.Course_Info]" - display_eval {Info/View} + display_eval {Info/View} link_url_eval {[export_vars -base $community_url/lorsm/admin/shared/course-info man_id]} link_html {title "[_ lorsm.Info]" class button} - html { align center } + html { align center } } } - db_multirow -extend { ims_md_id community_url } d_courses select_d_courses { - select + select cp.man_id, cp.course_name, cp.identifier, @@ -83,20 +82,18 @@ end as hasmetadata, cp.fs_package_id, cp.folder_id, - acs.creation_user, - acs.creation_date, - acs.context_id - from - ims_cp_manifests cp, acs_objects acs - where - cp.man_id = acs.object_id - and - cp.isshared = 't' - and cp.man_id in ( select cr.live_revision from cr_items cr - where content_type = 'ims_manifest_object' ) + acs.creation_user, + acs.creation_date, + acs.context_id + from ims_cp_manifests cp, acs_objects acs + where cp.man_id = acs.object_id + and cp.isshared = 't' + and cp.man_id in ( select cr.live_revision + from cr_items cr + where content_type = 'ims_manifest_object' ) order by acs.creation_date desc } { set ims_md_id $man_id set community_url $com_url } - + 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.24 -r1.25 --- openacs-4/packages/lorsm/lib/user-lorsm.tcl 17 Oct 2008 10:46:09 -0000 1.24 +++ openacs-4/packages/lorsm/lib/user-lorsm.tcl 17 Nov 2008 13:36:43 -0000 1.25 @@ -1,15 +1,14 @@ # packages/lorsm/www/test.tcl ad_page_contract { - + testing background - + @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 2004-06-15 @arch-tag: 9d893919-9a02-45cd-b6ad-19e3a34ba747 @cvs-id $Id$ } { - } -properties { } -validate { } -errors { @@ -23,79 +22,79 @@ set elements_list { course_name { - label "[_ lorsm.Course_Name_1]" - display_template { - @d_courses.course_url;noquote@ - - - -          - #lors-central.add_mat# - - + label "[_ lorsm.Course_Name_1]" + display_template { + @d_courses.course_url;noquote@ + + + +          + #lors-central.add_mat# + + - } - html { style "width:70%" } + } + html { style "width:70%" } } } if { [empty_string_p $community_id] } { - append elements_list { - subject { - label "[_ lorsm.Subject]" - display_eval {[dotlrn_community::get_community_name $community_id]} - html { align center style "width:20%" } - link_url_eval {[dotlrn_community::get_community_url $community_id]} - link_html {title "[_ lorsm.Access_Course]"} + append elements_list { + subject { + label "[_ lorsm.Subject]" + display_eval {[dotlrn_community::get_community_name $community_id]} + html { align center style "width:20%" } + link_url_eval {[dotlrn_community::get_community_url $community_id]} + link_html {title "[_ lorsm.Access_Course]"} + } } - } } append elements_list { last_viewed { - label "[_ lorsm.Last_Viewed_On]" - html { align center style "width:10%" } - display_eval {[lc_time_fmt $last_viewed "%x"]} + label "[_ lorsm.Last_Viewed_On]" + html { align center style "width:10%" } + display_eval {[lc_time_fmt $last_viewed "%x"]} + + } viewed_percent { + label "[_ lorsm._Viewed]" + html { align right } + display_eval {[lc_numeric $viewed_percent "%.2f"]} + } lesson_status { + label "Completed" + html { align center } + display_template { @d_courses.lesson_status;noquote@ } } - - viewed_percent { - label "[_ lorsm._Viewed]" - html { align right } - display_eval {[lc_numeric $viewed_percent "%.2f"]} - } - - lesson_status { - label "Completed" - html { align center } - display_template { - @d_courses.lesson_status;noquote@ - } - } } #label "[_ lorsm._CourseStatus]" if { ![string equal $lors_central_package_id 0] && ![empty_string_p $community_id] } { if { [lors_central::check_inst -user_id $user_id -community_id $community_id] } { - append elements_list " - grant_permissions { - label \"[_ lors-central.grant_permissions]\" - display_template { -
- [_ lors-central.manage] -
- } - }" + append elements_list " + grant_permissions { + label \"[_ lors-central.grant_permissions]\" + display_template { +
+ + [_ lors-central.manage] + +
+ } + }" + } else { - set lors_central_p 0 + set lors_central_p 0 } set lors_central_p 1 } else { - set lors_central_p 0 + set lors_central_p 0 } - template::list::create \ -name d_courses \ -multirow d_courses \ @@ -110,134 +109,161 @@ } foreach package $package_id { - db_multirow -extend { admin_p item_id ims_md_id last_viewed total_item_count viewed_item_count viewed_percent course_url lesson_status } -append d_courses select_d_courses { } { - set ims_md_id $man_id + db_multirow \ + -extend { admin_p item_id ims_md_id last_viewed \ + total_item_count viewed_item_count viewed_percent course_url \ + lesson_status + } -append d_courses select_d_courses { } { + set ims_md_id $man_id - if { [string eq $format_name "default"] } { + if { [string eq $format_name "default"] } { - # micheles - set context [site_node::get_url_from_object_id -object_id $lorsm_instance_id] - if ([db_0or1row query " - select - cp.man_id, - case - when upper(scorm_type) = 'SCO' then 'delivery-scorm' - else 'delivery' - end as needscorte - from - ims_cp_manifests cp left join (select man_id, max(scorm_type) as scorm_type from ims_cp_resources group by man_id ) as cpr using (man_id) - where - cp.man_id = :man_id " - ]) { - ns_log Debug "lorsm - $needscorte" - set delivery_method delivery - set course_url_url [export_vars -base "[lindex $context 0]$delivery_method/" -url {man_id}] - #this popup shouldn't affect delivery should popup blocker be in place - if { [string eq $needscorte "delivery-scorm"] } { - set course_url "> $course_name" - } else { - set course_url "$course_name" - } - ns_log Debug "lorsm - course_url: $course_url" - } else { - set course_url "NO RESOURCES ERROR" - } - } else { - set course_url "$course_name" - } + # micheles + set context [site_node::get_url_from_object_id -object_id $lorsm_instance_id] + if ([db_0or1row query " + select + cp.man_id, + case + when upper(scorm_type) = 'SCO' then 'delivery-scorm' + else 'delivery' + end as needscorte + from ims_cp_manifests cp left join (select man_id, max(scorm_type) as scorm_type from ims_cp_resources group by man_id ) as cpr using (man_id) + where cp.man_id = :man_id "]) { + ns_log Debug "lorsm - $needscorte" + set delivery_method delivery + set course_url_url [export_vars \ + -base "[lindex $context 0]$delivery_method/" \ + -url {man_id}] - #LET's CHECK IF delivery is RTE, so there should be some tracking. - #the code, differentely than above, check the delivery method as per above - - # Get the course name - if {[db_0or1row manifest " - select - cp.course_name, - cp.fs_package_id, - isscorm, - pf.folder_name, - pf.format_name, - case - when upper(scorm_type) = 'SCO' then 'delivery-scorm' - else 'delivery' - end as deliverymethod - from - ims_cp_manifests cp left join (select man_id, max(scorm_type) as scorm_type from ims_cp_resources group by man_id ) as cpr using (man_id) , - lorsm_course_presentation_formats pf - where - cp.man_id = :man_id - and cp.parent_man_id = 0 - and cp.course_presentation_format = pf.format_id "]} { - # Course Name - if {[empty_string_p $course_name]} { - set course_name "No Course Name" - } - } else { - set course_name "No Course Name" - } + #this popup shouldn't affect delivery should popup blocker be in place + if { [string eq $needscorte "delivery-scorm"] } { + set course_url "> $course_name" + } else { + set course_url "$course_name" + } + ns_log Debug "lorsm - course_url: $course_url" - set lesson_status "N/A" - - if { [string equal $deliverymethod "delivery-scorm"] } { - set icon "" - if { ! [ db_0or1row isanysuspendedsession "select lorsm.track_id as track_id, - cmi.lesson_status as lesson_status from - lorsm_student_track lorsm, lorsm_cmi_core cmi - where - lorsm.user_id = $user_id - and - lorsm.community_id = $community_id - and - lorsm.course_id = $man_id - and - lorsm.track_id = cmi.track_id - and - cmi.man_id = $man_id - and - cmi.item_id = $man_id - order by - lorsm.track_id desc - limit 1" ] } { - #item has no track for the user - #the icon should be the same as per "not yet visited" - append icon "\"Not" - } else { - switch -regexp $lesson_status { - null { append icon "\"Not" } - incomplete { append icon "\"Incomplete\"" } - complete { append icon "\"Completed\"" } - failed { append icon "\"Failed\"" } - "not attempted" { append icon "\"Not" } - passed { append icon "\"Passed\"" } - default { append icon " $lesson_status ** \"$lesson_status\""} - } - } - set lesson_status $icon - } - - # DEDS: these are expensive - # and for demo purposes only - - db_0or1row get_last_viewed { } - set all_items [db_list get_total_items { }] - set total_item_count [llength $all_items] - if {$total_item_count > 0} { - set viewed_items [db_list get_viewed_items { }] - } else { - set viewed_items {} - } - set viewed_item_count [llength $viewed_items] + } else { + set course_url "NO RESOURCES ERROR" + } + } else { + set course_url "$course_name" + } - ns_log Debug "lorsm - viewed_item_count: $viewed_item_count" + #LET's CHECK IF delivery is RTE, so there should be some tracking. + #the code, differentely than above, check the delivery method as per above - if { $total_item_count == 0 } { - set viewed_percent 0 - } else { - set viewed_percent [expr [expr $viewed_item_count * 1.00] / $total_item_count * 100] - } - set item_id [db_string get_item_id { }] - set admin_p [permission::permission_p -party_id $user_id -object_id $item_id -privilege "admin"] - } + # Get the course name + if {[db_0or1row manifest " + select + cp.course_name, + cp.fs_package_id, + isscorm, + pf.folder_name, + pf.format_name, + case + when upper(scorm_type) = 'SCO' then 'delivery-scorm' + else 'delivery' + end as deliverymethod + from ims_cp_manifests cp left join (select man_id, max(scorm_type) + as scorm_type from ims_cp_resources group by man_id ) + as cpr using (man_id) , + lorsm_course_presentation_formats pf + where cp.man_id = :man_id + and cp.parent_man_id = 0 + and cp.course_presentation_format = pf.format_id "]} { + # Course Name + if {[empty_string_p $course_name]} { + set course_name "No Course Name" + } + } else { + set course_name "No Course Name" + } + + set lesson_status "N/A" + + if { [string equal $deliverymethod "delivery-scorm"] } { + set icon "" + if { ! [ db_0or1row isanysuspendedsession "select lorsm.track_id as track_id, + cmi.lesson_status as lesson_status from + lorsm_student_track lorsm, lorsm_cmi_core cmi + where lorsm.user_id = $user_id + and lorsm.community_id = $community_id + and lorsm.course_id = $man_id + and lorsm.track_id = cmi.track_id + and cmi.man_id = $man_id + and cmi.item_id = $man_id + order by lorsm.track_id desc + limit 1" ] } { + #item has no track for the user + #the icon should be the same as per "not yet visited" + append icon "\"Not" + } else { + switch -regexp $lesson_status { + null { + append icon "\"Not" + + } incomplete { + append icon "\"Incomplete\"" + + } complete { + append icon "\"Completed\"" + + } failed { + append icon "\"Failed\"" + + } "not attempted" { + append icon "\"Not" + + } passed { + append icon "\"Passed\"" + } default { + append icon " $lesson_status + ** \"$lesson_status\"" + } + } + } + set lesson_status $icon + } + + # DEDS: these are expensive + # and for demo purposes only + + db_0or1row get_last_viewed { } + set all_items [db_list get_total_items { }] + set total_item_count [llength $all_items] + if {$total_item_count > 0} { + set viewed_items [db_list get_viewed_items { }] + } else { + set viewed_items {} + } + set viewed_item_count [llength $viewed_items] + + ns_log Debug "lorsm - viewed_item_count: $viewed_item_count" + + if { $total_item_count == 0 } { + set viewed_percent 0 + } else { + set viewed_percent [expr \ + [expr $viewed_item_count * 1.00] / $total_item_count * 100] + } + + set item_id [db_string get_item_id { }] + set admin_p [permission::permission_p -party_id $user_id -object_id $item_id -privilege "admin"] + } } Index: openacs-4/packages/lorsm/tcl/lorsm-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/tcl/lorsm-callback-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/tcl/lorsm-callback-procs.tcl 30 May 2006 16:23:25 -0000 1.3 +++ openacs-4/packages/lorsm/tcl/lorsm-callback-procs.tcl 17 Nov 2008 13:36:43 -0000 1.4 @@ -7,27 +7,28 @@ @cvs-id $Id$ } + ad_proc -callback application-track::getApplicationName -impl lorsm {} { callback implementation } { return "lorsm" } + ad_proc -callback application-track::getGeneralInfo -impl lorsm {} { callback implementation } { db_1row my_query { - select count(1) as result - from ( - select distinct l.course_id - from lorsm_student_track l - where l.community_id=:comm_id - group by l.course_id) as t - } + select count(1) as result + from (select distinct l.course_id + from lorsm_student_track l + where l.community_id=:comm_id + group by l.course_id) as t} return "$result" } + ad_proc -callback application-track::getSpecificInfo -impl lorsm {} { callback implementation } { @@ -36,30 +37,29 @@ upvar $elements_name my_elements set my_query { - select d.id,i.course_name,l.start_time,l.end_time - from lorsm_student_track l, dotlrn_users d, ims_cp_manifests i - where l.course_id IN - ( - select distinct l.course_id - from lorsm_student_track l - where l.community_id=:class_instance_id - group by l.course_id) - and l.user_id = d.user_id - and l.course_id = i.man_id - } - + select d.id,i.course_name,l.start_time,l.end_time + from lorsm_student_track l, dotlrn_users d, ims_cp_manifests i + where l.course_id IN ( + select distinct l.course_id + from lorsm_student_track l + where l.community_id=:class_instance_id + group by l.course_id) + and l.user_id = d.user_id + and l.course_id = i.man_id + } set my_elements "" return "OK" } + ad_proc -public -callback imsld::import -impl lors {} { this is the imsld lors importer } { - if {$res_type == "imscp_xmlv1p0"} { - return [lorsm::register_xml_object_id \ - -xml_file $tmp_dir/$res_href \ - -tmp_dir $tmp_dir \ - -community_id $community_id] - } + if {$res_type == "imscp_xmlv1p0"} { + return [lorsm::register_xml_object_id \ + -xml_file $tmp_dir/$res_href \ + -tmp_dir $tmp_dir \ + -community_id $community_id] + } } Index: openacs-4/packages/lorsm/tcl/lorsm-delivery-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/tcl/lorsm-delivery-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/tcl/lorsm-delivery-procs.tcl 17 May 2005 17:23:27 -0000 1.1 +++ openacs-4/packages/lorsm/tcl/lorsm-delivery-procs.tcl 17 Nov 2008 13:36:43 -0000 1.2 @@ -1,7 +1,7 @@ # packages/lorsm/tcl/lorsm-delivery-procs.tcl ad_library { LORS Management Procedures for delivery pages - + @author Miguel Mairn (miguelmarin@viaro.net) @author Viaro Networks www.viaro.net } @@ -19,19 +19,22 @@ # We get a list of all folders that have name equal to folder_part set content_folders [db_list_of_lists get_folders { }] - + # Foreach folder that has that name we are going to check for the file name inside foreach folder $content_folders { set parent_folder [db_string get_parent_folder { } -default ""] - set aux [content::item::get_id -item_path $url -root_folder_id $parent_folder -resolve_index "f"] + set aux [content::item::get_id -item_path $url \ + -root_folder_id $parent_folder \ + -resolve_index "f"] if { ![empty_string_p $aux] } { - # This is a match + # This is a match set item_id $aux } - } + } return $item_id } + ad_proc -private lorsm::delivery::get_item_id { -revision_id:required } { @@ -40,6 +43,7 @@ return [db_string get_item_id { }] } + ad_proc -private lorsm::delivery::get_folder_id_from_man_id { -man_id:required } { @@ -48,6 +52,7 @@ return [db_string manifest_info { } -default ""] } + ad_proc -private lorsm::delivery::get_folder_name { -folder_id:required } { @@ -56,6 +61,7 @@ return [db_string get_folder_name { } -default ""] } + ad_proc -private lorsm::delivery::get_item_id_from_name_parent { -parent_id:required -name:required @@ -65,6 +71,7 @@ return [db_string get_content_root { } -default ""] } + ad_proc -private lorsm::delivery::get_href { -ims_item_id:required } { @@ -73,6 +80,7 @@ return [db_string href { } -default ""] } + ad_proc -private lorsm::delivery::get_ims_item_title { -ims_item_id:required } { @@ -81,6 +89,7 @@ return [db_string get_item_title { } -default ""] } + ad_proc -private lorsm::delivery::get_res_id { -ims_item_id:required } { @@ -89,26 +98,27 @@ return [db_string get_res_id { } -default ""] } + ad_proc -private lorsm::delivery::get_file_id { -res_id:required } { Returns the associated file_id to one resource (res_id) } { return [db_string get_file_id { } -default ""] - } -ad_proc -private lorsm::delivery::get_file_id_from_ims_item_id { + +ad_proc -private lorsm::delivery::get_file_id_from_ims_item_id { -ims_item_id:required -item_id:required } { Returns the file associated to @item_id@ and @ims_item_id@, returns empty string if nothing found - + @ims_item_id@ The ims_item_id that is associated to this file (This is the one comming from the - menu on delivery pages ) + menu on delivery pages ) @item_id@ The item_id that has all revisions of one file ( This is fetch from the url and content root variables ) returns file_id or empty string } { return [db_string get_file { } -default ""] -} \ No newline at end of file +} Index: openacs-4/packages/lorsm/tcl/lorsm-delivery-scorm-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/tcl/lorsm-delivery-scorm-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/tcl/lorsm-delivery-scorm-procs.tcl 13 Aug 2007 09:20:15 -0000 1.2 +++ openacs-4/packages/lorsm/tcl/lorsm-delivery-scorm-procs.tcl 17 Nov 2008 13:36:43 -0000 1.3 @@ -1,12 +1,12 @@ # packages/lorsm/tcl/lorsm-delivery-scorm-procs.tcl ad_library { - - LORSM Scorm delivery procedures - + + LORSM Scorm delivery procedures + @author Michele Slocovich (m.s@sii.it) @creation-date 2007-07-02 - @cvs-id + @cvs-id } # @@ -25,235 +25,187 @@ namespace eval lorsm::delivery::scorm { - ad_proc -public check_parents { - -ims_item_id:required - } { - - Given a lesson status checks whether to propagate the status change - to upper levels. Lesson statuses are kept within lorsm_cmi_core table. - Differing from "standard" tracks, folders, organisations and manifests - are used as keys to propagate status, so that once a course is finished, - the corresponding manifest level track in lorsm_cmi_core would show it. - - @param - @author Michele Slocovich (m.s@sii.it) - + ad_proc -public check_parents { + -ims_item_id:required } { + Given a lesson status checks whether to propagate the status change + to upper levels. Lesson statuses are kept within lorsm_cmi_core table. + Differing from "standard" tracks, folders, organisations and manifests + are used as keys to propagate status, so that once a course is finished, + the corresponding manifest level track in lorsm_cmi_core would show it. - upvar currentcourse currentcourse - upvar community_id community_id - upvar user_id user_id - upvar username username - upvar name name - - ns_log debug "SCORM parents: LOOKING FOR PARENTS FOR $ims_item_id" - - set father 0 - - if { ! [ db_0or1row someinfo { - select - parent_item as father, - o.object_type as father_type - from - ims_cp_items i, - ims_cp_manifest_class im, - acs_objects o - WHERE - ( o.object_type = 'ims_item_object' OR - o.object_type= 'ims_organization_object' ) - AND - o.object_id = i.parent_item - AND - i.ims_item_id=:ims_item_id - AND - im.man_id= :currentcourse - AND - im.isenabled='t' - AND - im.community_id=:community_id } ] } { - ns_log warning "Parents: no parent " - #should look harder: the calling items should be ORG - #as a parent and set it so. - if { [db_0or1row isanorg { - select - i.man_id as father, - o.object_type as father_type - from - ims_cp_organizations i, - ims_cp_manifest_class im, - acs_objects o - WHERE - o.object_id = i.man_id - AND - i.org_id=:ims_item_id - AND - im.man_id= i.man_id - AND - im.man_id= :currentcourse - AND - im.isenabled='t' - AND - im.community_id=:community_id - } ] } { - ns_log debug "SCORM parents: father is man: $father" - #we should now do something to set the thing ok - } else { - ns_log warning "SCORM parents: no father found at all" - } - } - - if { $father > 0 } { - ns_log debug "SCORM parents: Found parent: $father which is $father_type " - #the following query should include "self" where self is current ims_item_id - - if { [ string equal $father_type "ims_manifest_object" ] } { - #since we have a manifest i will check all orgs below. - if { [ db_0or1row hasmanincompletedchildren { - select * from ( - select - o.man_id, org_title as item_title, org_id as item_id - from - ims_cp_organizations o, ims_cp_manifest_class im - where - o.man_id=:currentcourse - and im.man_id=o.man_id - and im.community_id=:community_id) as allitems where item_id - not in - ( select cmi.item_id from lorsm_cmi_core cmi, lorsm_student_track track - where - cmi.man_id=:currentcourse - and - track.user_id=:user_id - and - cmi.track_id=track.track_id - and - track.community_id=:community_id - and - lesson_status in - ( 'completed', 'passed' )) - limit 1 } ] } { - ns_log debug "SCORM parents: at least one incomplete sub-org ($item_id)" - set target_status "incomplete" - set target_comment "MAN TRACKING" - } else { - ns_log debug "SCORM parents: no incompleted sub-orgs" - set target_status "completed" - set target_comment "MAN TRACKING" - } - } else { - if { [ db_0or1row hasblockincompletedchildren { - select * from ( - select - o.man_id, item_title, ims_item_id as item_id - from - ims_cp_items i, ims_cp_organizations o, ims_cp_manifest_class im - where - i.org_id=o.org_id - and im.man_id=o.man_id - and o.man_id= :currentcourse - and im.community_id= :community_id - and i.parent_item= :father - ) as allitems where item_id - not in - ( select cmi.item_id from lorsm_cmi_core cmi, lorsm_student_track track - where - cmi.man_id=:currentcourse - and - track.user_id=:user_id - and - cmi.track_id=track.track_id - and - track.community_id=:community_id - and - lesson_status in - ( 'completed', 'passed' )) - limit 1 } ] } { - ns_log debug "BLOCK: at least 1 incomplete children (see $item_id)" - set target_status "incomplete" - set target_comment "BLOCK TRACKING" - } else { - ns_log debug "BLOCK: no incomplete or unvisited children" - set target_status "completed" - set target_comment "BLOCK TRACKING" - } - } - - ns_log debug "SCORM Parents: We are going to (check) set: $target_status on $father " - - if { [ db_0or1row isanysuspendedsession " - select lorsm.track_id as block_track_id, lesson_status as lesson_status_old - from lorsm_student_track lorsm, lorsm_cmi_core cmi - where - lorsm.user_id = $user_id - and - lorsm.community_id = $community_id - and - lorsm.course_id = $currentcourse - and - lorsm.track_id = cmi.track_id - and - cmi.man_id = $currentcourse - and - cmi.item_id = $father - order by - lorsm.track_id desc limit 1 " ] } { - if { ! [ string equal lesson_status_old target_status ] } { - #UPDATE - set todo "UPDATE lorsm_cmi_core SET lesson_status = '$target_status' " - append todo " WHERE track_id=$block_track_id" - db_dml todo $todo - if { [db_resultrows] == 1 } { - ns_log debug "SCORM: lesson_status processing UPDATE: '$todo' successfull" - #POST PROCESSING - if { ! [string equal $father_type "ims_manifest_object" ] } { - ns_log debug "SCORM parents: calling self" - lorsm::delivery::scorm::check_parents -ims_item_id $father - ns_log debug "SCORM parents: end calling self" - } - - } else { - ns_log warning "SCORM parents: lesson_status processing UPDATE: '$todo' not successfull -> please check" - } - - } else { - ns_log debug "SCORM Parents: not updating, upper status already set" - } - } else { - #fresh tracking record - set block_track_id [lorsm::track::new \ - -user_id $user_id \ - -community_id $community_id \ - -course_id $currentcourse] - #INSERT NEW TRACK FOR ITEM - db_dml lmsinitialize { insert into lorsm_cmi_core(track_id,man_id,item_id,student_id,student_name, - lesson_location, - lesson_status, - launch_data, - comments,comments_from_lms, session_time, total_time, time_stamp) - values(:block_track_id,:currentcourse,:father,:username,:name, - :currentcourse, - :target_status, - '', - '',:target_comment,0,0,CURRENT_TIMESTAMP) } - if { [db_resultrows] == 1 } { - ns_log debug "SCORM: lesson_status processing INSERT: $block_track_id to $target_status successfull" - #POST PROCESSING - if { ! [string equal $father_type "ims_manifest_object" ] } { - ns_log debug "SCORM parents: calling self" - lorsm::delivery::scorm::check_parents -ims_item_id $father - ns_log debug "SCORM parents: end calling self" - } - } else { - ns_log warning "SCORM parents: lesson_status processing INSERT: '$block_track_id' to $target_status not successfull -> please check" - } - - } - - } else { - ns_log Warning "SCORM parents: no father found" - } - #} - return 0 - } - + @param + @author Michele Slocovich (m.s@sii.it) + + } { + + upvar currentcourse currentcourse + upvar community_id community_id + upvar user_id user_id + upvar username username + upvar name name + + ns_log debug "SCORM parents: LOOKING FOR PARENTS FOR $ims_item_id" + + set father 0 + + if { ! [ db_0or1row someinfo { select parent_item as father, + o.object_type as father_type + from ims_cp_items i, ims_cp_manifest_class im, acs_objects o + WHERE ( o.object_type = 'ims_item_object' OR + o.object_type= 'ims_organization_object' ) + AND o.object_id = i.parent_item + AND i.ims_item_id=:ims_item_id + AND im.man_id= :currentcourse + AND im.isenabled='t' + AND im.community_id=:community_id } ] } { + ns_log warning "Parents: no parent " + #should look harder: the calling items should be ORG + #as a parent and set it so. + if { [db_0or1row isanorg { select i.man_id as father, + o.object_type as father_type + from ims_cp_organizations i, ims_cp_manifest_class im, + acs_objects o + WHERE o.object_id = i.man_id + AND i.org_id=:ims_item_id + AND im.man_id= i.man_id + AND im.man_id= :currentcourse + AND im.isenabled='t' + AND im.community_id=:community_id}] } { + + ns_log debug "SCORM parents: father is man: $father" + #we should now do something to set the thing ok + } else { + ns_log warning "SCORM parents: no father found at all" + } + } + + if { $father > 0 } { + ns_log debug "SCORM parents: Found parent: $father which is $father_type " + #the following query should include "self" where self is current ims_item_id + + if { [ string equal $father_type "ims_manifest_object" ] } { + #since we have a manifest i will check all orgs below. + if { [ db_0or1row hasmanincompletedchildren { select * from ( + select o.man_id, org_title as item_title, org_id as item_id + from ims_cp_organizations o, ims_cp_manifest_class im + where o.man_id=:currentcourse + and im.man_id=o.man_id + and im.community_id=:community_id) as allitems where item_id + not in + ( select cmi.item_id from lorsm_cmi_core cmi, lorsm_student_track track + where cmi.man_id=:currentcourse + and track.user_id=:user_id + and cmi.track_id=track.track_id + and track.community_id=:community_id + and lesson_status in + ( 'completed', 'passed' )) + limit 1 } ] } { + + ns_log debug "SCORM parents: at least one incomplete sub-org ($item_id)" + set target_status "incomplete" + set target_comment "MAN TRACKING" + + } else { + ns_log debug "SCORM parents: no incompleted sub-orgs" + set target_status "completed" + set target_comment "MAN TRACKING" + } + + } else { + if { [ db_0or1row hasblockincompletedchildren { + select * from (select o.man_id, item_title, ims_item_id as item_id + from ims_cp_items i, ims_cp_organizations o, ims_cp_manifest_class im + where i.org_id=o.org_id + and im.man_id=o.man_id + and o.man_id= :currentcourse + and im.community_id= :community_id + and i.parent_item= :father) as allitems where item_id + not in ( select cmi.item_id + from lorsm_cmi_core cmi, lorsm_student_track track + where cmi.man_id=:currentcourse + and track.user_id=:user_id + and cmi.track_id=track.track_id + and track.community_id=:community_id + and lesson_status in ( 'completed', 'passed' )) + limit 1 }] } { + + ns_log debug "BLOCK: at least 1 incomplete children (see $item_id)" + set target_status "incomplete" + set target_comment "BLOCK TRACKING" + + } else { + ns_log debug "BLOCK: no incomplete or unvisited children" + set target_status "completed" + set target_comment "BLOCK TRACKING" + } + } + ns_log debug "SCORM Parents: We are going to (check) set: + $target_status on $father " + + if { [ db_0or1row isanysuspendedsession "select lorsm.track_id + as block_track_id, lesson_status as lesson_status_old + from lorsm_student_track lorsm, lorsm_cmi_core cmi + where lorsm.user_id = $user_id + and lorsm.community_id = $community_id + and lorsm.course_id = $currentcourse + and lorsm.track_id = cmi.track_id + and cmi.man_id = $currentcourse + and cmi.item_id = $father + order by + lorsm.track_id desc limit 1 "] } { + + if { ! [ string equal lesson_status_old target_status ] } { + #UPDATE + set todo "UPDATE lorsm_cmi_core SET lesson_status = '$target_status' " + append todo " WHERE track_id=$block_track_id" + db_dml todo $todo + if { [db_resultrows] == 1 } { + ns_log debug "SCORM: lesson_status processing UPDATE: '$todo' successfull" + + #POST PROCESSING + if { ! [string equal $father_type "ims_manifest_object" ] } { + ns_log debug "SCORM parents: calling self" + lorsm::delivery::scorm::check_parents -ims_item_id $father + ns_log debug "SCORM parents: end calling self" + } + } else { + ns_log warning "SCORM parents: lesson_status processing UPDATE: '$todo' not successfull -> please check" + } + + } else { + ns_log debug "SCORM Parents: not updating, upper status already set" + } + } else { + #fresh tracking record + set block_track_id [lorsm::track::new \ + -user_id $user_id \ + -community_id $community_id \ + -course_id $currentcourse] + #INSERT NEW TRACK FOR ITEM + db_dml lmsinitialize { + insert into lorsm_cmi_core(track_id,man_id,item_id,student_id,student_name, + lesson_location, lesson_status, launch_data, + comments,comments_from_lms, session_time, total_time, time_stamp) + values(:block_track_id,:currentcourse,:father,:username,:name, + :currentcourse, :target_status,'','',:target_comment,0,0,CURRENT_TIMESTAMP) } + + if { [db_resultrows] == 1 } { + ns_log debug "SCORM: lesson_status processing INSERT: $block_track_id to $target_status successfull" + #POST PROCESSING + if { ! [string equal $father_type "ims_manifest_object" ] } { + ns_log debug "SCORM parents: calling self" + lorsm::delivery::scorm::check_parents -ims_item_id $father + ns_log debug "SCORM parents: end calling self" + } + } else { + ns_log warning "SCORM parents: lesson_status processing INSERT: '$block_track_id' to $target_status not successfull -> please check" + } + } + + } else { + ns_log Warning "SCORM parents: no father found" + } + return 0 + } } Index: openacs-4/packages/lorsm/tcl/lorsm-import-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/tcl/lorsm-import-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/tcl/lorsm-import-procs.tcl 17 Oct 2008 10:46:09 -0000 1.3 +++ openacs-4/packages/lorsm/tcl/lorsm-import-procs.tcl 17 Nov 2008 13:36:43 -0000 1.4 @@ -29,791 +29,874 @@ } { } { -set user_id [ad_conn user_id] -set community_id [dotlrn_community::get_community_id] + set user_id [ad_conn user_id] + set community_id [dotlrn_community::get_community_id] -# Gets file-storage root folder_id -# eventually, we should provide an option so it can be imported in -# different subfolders -set fs_package_id [site_node_apm_integration::get_child_package_id \ - -package_id [dotlrn_community::get_package_id $community_id] \ - -package_key "file-storage"\ - ] + # Gets file-storage root folder_id + # eventually, we should provide an option so it can be imported in + # different subfolders + set fs_package_id [site_node_apm_integration::get_child_package_id \ + -package_id [dotlrn_community::get_package_id $community_id] \ + -package_key "file-storage"] -#set fs_package_id [apm_package_id_from_key "file-storage"] -- if used -# with OpenACS + #set fs_package_id [apm_package_id_from_key "file-storage"] -- if used + # with OpenACS -# Gets root folder and root folder name -set folder_id [fs::get_root_folder -package_id $fs_package_id] -set folder_name [fs::get_object_name -object_id $folder_id] + # Gets root folder and root folder name + set folder_id [fs::get_root_folder -package_id $fs_package_id] + set folder_name [fs::get_object_name -object_id $folder_id] -# Gets whether the file-storage instance is a indb_p or file system -# (StoreFilesInDatabaseP) one not that we use it now -since we are -# currently putting everything on the file system, but eventually we -# will have the option to put it on the db. + # Gets whether the file-storage instance is a indb_p or file system + # (StoreFilesInDatabaseP) one not that we use it now -since we are + # currently putting everything on the file system, but eventually we + # will have the option to put it on the db. -set indb_p [parameter::get -parameter "StoreFilesInDatabaseP" -package_id $fs_package_id] + set indb_p [parameter::get -parameter "StoreFilesInDatabaseP" \ + -package_id $fs_package_id] -# Gets URL for file-storage package + # Gets URL for file-storage package -set fs_url [apm_package_url_from_id $fs_package_id] + set fs_url [apm_package_url_from_id $fs_package_id] -set user_id [ad_conn user_id] -set package_id [ad_conn package_id] -# check for admin permission on folder -set admin_p [permission::permission_p -party_id $user_id -object_id $package_id -privilege admin] + set user_id [ad_conn user_id] + set package_id [ad_conn package_id] + # check for admin permission on folder + set admin_p [permission::permission_p \ + -party_id $user_id \ + -object_id $package_id \ + -privilege admin] -# set course id -set course_id 1 + # set course id + set course_id 1 -set tmpfile $upload_file -set upload_file [file tail $upload_file] + set tmpfile $upload_file + set upload_file [file tail $upload_file] -# if it is not blank... -if {![empty_string_p $upload_file]} { - ns_log Debug "LORS Package: made directory $tmp_dir to extract from $tmpfile ($upload_file)\n" - set allfiles [lors::imscp::dir_walk $tmp_dir] + # if it is not blank... + if {![empty_string_p $upload_file]} { + ns_log Debug "LORS Package: made directory $tmp_dir to extract from + $tmpfile ($upload_file)\n" + set allfiles [lors::imscp::dir_walk $tmp_dir] -} else { - set allfiles [lors::imscp::dir_walk $directory] + } else { + set allfiles [lors::imscp::dir_walk $directory] + } -} + # Permissions on target folder + ad_require_permission $folder_id admin + # unzips the file + if { ![empty_string_p $upload_file] && + [ catch {set tmp_dir [lors::imscp::expand_file $upload_file $tmpfile \ + lors-imscp-$course_id] } errMsg] } { + ad_return_complaint 1 "[_ lorsm.lt_The_uploaded_file_doe]" + ad_script_abort + } -# Permissions on target folder -ad_require_permission $folder_id admin + # search for manifest file + set file imsmanifest.xml + set manifest [lors::imscp::findmanifest $tmp_dir $file] -# unzips the file -if { ![empty_string_p $upload_file] && - [ catch {set tmp_dir [lors::imscp::expand_file $upload_file $tmpfile lors-imscp-$course_id] } errMsg] } { - ad_return_complaint 1 "[_ lorsm.lt_The_uploaded_file_doe]" - ad_script_abort -} - -# search for manifest file -set file imsmanifest.xml - -set manifest [lors::imscp::findmanifest $tmp_dir $file] - -# see if the file actually is where it suppose to be. Othewise abort -if {$manifest == 0} { + # see if the file actually is where it suppose to be. Othewise abort + if {$manifest == 0} { lors::imscp::deltmpdir $tmp_dir ad_return_complaint 1 "[_ lorsm.lt_There_is_no_file_with_1]" -} + } + # Is this a Blackboard6 package? + set isBB [lors::imscp::bb6::isBlackboard6 -tmp_dir $tmp_dir] -# Is this a Blackboard6 package? -set isBB [lors::imscp::bb6::isBlackboard6 -tmp_dir $tmp_dir] + if {$isBB == 1} { + # we generate metadata for the file + ns_log Notice "Generating MD record from Blackboard6 package $tmp_dir --" + lors::imscp::bb6::create_MD -tmp_dir $tmp_dir -file $file + ns_log Notice "Done!" -if {$isBB == 1} { - # we generate metadata for the file - ns_log Notice "Generating MD record from Blackboard6 package $tmp_dir --" - lors::imscp::bb6::create_MD -tmp_dir $tmp_dir -file $file - ns_log Notice "Done!" + } -} + ## adds folder to the CR + set parent_id $folder_id + set fs_dir $tmp_dir -## adds folder to the CR -set parent_id $folder_id -set fs_dir $tmp_dir + # checks for write permission on the parent folder + ad_require_permission $parent_id write -# checks for write permission on the parent folder -ad_require_permission $parent_id write + # get their IP + set creation_ip [ad_conn peeraddr] -# get their IP -set creation_ip [ad_conn peeraddr] + # checks whether the directory given actually exists + if {[file exists $fs_dir]} { + set all_files [list] + # now that exists, let's create it on the CR -# checks whether the directory given actually exists -if {[file exists $fs_dir]} { - set all_files [list] - # now that exists, let's create it on the CR + ## Opens imsmanifest.xml - ## Opens imsmanifest.xml + # open manifest file with tDOM + dom parse [::tDOM::xmlReadFile $manifest] doc + # gets the manifest tree + set manifest [$doc documentElement] - # open manifest file with tDOM - dom parse [::tDOM::xmlReadFile $manifest] doc - # gets the manifest tree - set manifest [$doc documentElement] + # gets metadata node + set metadata [$manifest child all metadata] - # gets metadata node - set metadata [$manifest child all metadata] + # DETECT SCORM OR IMS CP + set isSCORM [lors::imscp::isSCORM -node $manifest] - # DETECT SCORM OR IMS CP - set isSCORM [lors::imscp::isSCORM -node $manifest] + ## Gets manifest title + if { ![empty_string_p $metadata] } { + # gets metadataschema + set MetadataSchema [lindex [lindex [lors::imsmd::getMDSchema $metadata] 0] 0] + set MetadataSchemaVersion [lindex [lors::imsmd::getMDSchema $metadata] 1] + set lom [lindex [lors::imsmd::getLOM $metadata $tmp_dir] 0] + set prefix [lindex [lors::imsmd::getLOM $metadata $tmp_dir] 1] - ## Gets manifest title + if { $lom != 0 } { + # Get title + set manifest_title_lang [lindex \ + [lindex [lors::imsmd::mdGeneral \ + -element title \ + -node $lom \ + -prefix $prefix] 0] 0] - if { ![empty_string_p $metadata] } { + set manifest_title [lindex + [lindex [lors::imsmd::mdGeneral \ + -element title \ + -node $lom \ + -prefix $prefix] 0] 1] + # set context + set context "[_ lorsm.lt_Importing_manifest_ti]" - # gets metadataschema - set MetadataSchema [lindex [lindex [lors::imsmd::getMDSchema $metadata] 0] 0] - set MetadataSchemaVersion [lindex [lors::imsmd::getMDSchema $metadata] 1] - set lom [lindex [lors::imsmd::getLOM $metadata $tmp_dir] 0] - set prefix [lindex [lors::imsmd::getLOM $metadata $tmp_dir] 1] + ## Gets manifest description - if { $lom != 0 } { - # Get title - set manifest_title_lang [lindex [lindex [lors::imsmd::mdGeneral -element title -node $lom -prefix $prefix] 0] 0] - set manifest_title [lindex [lindex [lors::imsmd::mdGeneral -element title -node $lom -prefix $prefix] 0] 1] - # set context - set context "[_ lorsm.lt_Importing_manifest_ti]" + set manifest_descrip_lang [lindex \ + [lindex [lors::imsmd::mdGeneral \ + -element description \ + -node $lom \ + -prefix $prefix] 0] 0] - ## Gets manifest description - - set manifest_descrip_lang [lindex [lindex [lors::imsmd::mdGeneral -element description -node $lom -prefix $prefix] 0] 0] - set manifest_descrip [lindex [lindex [lors::imsmd::mdGeneral -element description -node $lom -prefix $prefix] 0] 1] + set manifest_descrip [lindex \ + [lindex [lors::imsmd::mdGeneral \ + -element description \ + -node $lom \ + -prefix $prefix] 0] 1] - # Gets Rights info - set copyright [lors::imsmd::mdRights -element copyrightandotherrestrictions -node $lom -prefix $prefix] - if { $copyright != 0 } { - set copyright_s [lindex [lindex [lindex $copyright 0] 0] 1] - set copyright_v [lindex [lindex [lindex $copyright 0] 1] 1] - set cr_descrip [lors::imsmd::mdRights -element description -node $lom -prefix $prefix] - set cr_descrip_s [lindex [lindex $cr_descrip 0] 1] + # Gets Rights info + set copyright [lors::imsmd::mdRights \ + -element copyrightandotherrestrictions \ + -node $lom \ + -prefix $prefix] + + if { $copyright != 0 } { + set copyright_s [lindex [lindex [lindex $copyright 0] 0] 1] + set copyright_v [lindex [lindex [lindex $copyright 0] 1] 1] + set cr_descrip [lors::imsmd::mdRights \ + -element description \ + -node $lom \ + -prefix $prefix] + set cr_descrip_s [lindex [lindex $cr_descrip 0] 1] + } + } else { + # Didn't find LOM although it did find the Metadata schema and + # version + regexp {([^/\\]+)$} $tmp_dir match manifest_title + set context "[_ lorsm.lt_Importing_No_Metadata]" } } else { - # Didn't find LOM although it did find the Metadata schema and - # version - regexp {([^/\\]+)$} $tmp_dir match manifest_title - set context "[_ lorsm.lt_Importing_No_Metadata]" - } - } else { - # manifest title doesn't exist, so we create one for it. - regexp {([^/\\]+)$} $tmp_dir match manifest_title - set context "[_ lorsm.lt_Importing_No_Metadata]" - } + # manifest title doesn't exist, so we create one for it. + regexp {([^/\\]+)$} $tmp_dir match manifest_title + set context "[_ lorsm.lt_Importing_No_Metadata]" + } + # Gets the organizations - # Gets the organizations + set organizations [$manifest child all organizations] + if { ![empty_string_p $organizations] } { + set num_organizations [$organizations child all organization] + set items 0 - set organizations [$manifest child all organizations] + foreach organization $num_organizations { + set items [expr $items + [lors::imscp::countItems $organization]] + } + } - if { ![empty_string_p $organizations] } { + # gets the resources + set resources [$manifest child all resources] - set num_organizations [$organizations child all organization] - - set items 0 - - foreach organization $num_organizations { - - set items [expr $items + [lors::imscp::countItems $organization]] - + # Complain if there's no resources + if {[empty_string_p $resources]} { + ad_return_complaint 1 "[_ lorsm.lt_The_package_you_are_t_1]" + ad_script_abort } - } - # gets the resources - set resources [$manifest child all resources] + set resourcex [$resources child all resource] + if { $isSCORM == 1 } { + # The imsmanifest.xml file contains a SCORM course - # Complain if there's no resources - if {[empty_string_p $resources]} { - ad_return_complaint 1 "[_ lorsm.lt_The_package_you_are_t_1]" - ad_script_abort - } + # extract all the resources and files + set scos 0 + set assets 0 + set sharableresources 0 + set files 0 - set resourcex [$resources child all resource] + if { ![empty_string_p $resources] } { + foreach resourcex [$resources child all resource] { + # gets the type of resource + set resource_scormtype [string tolower [lors::imsmd::getAtt \ + $resourcex adlcp:scormtype]] - if { $isSCORM == 1 } { - # The imsmanifest.xml file contains a SCORM course - - # extract all the resources and files - set scos 0 - set assets 0 - set sharableresources 0 - set files 0 - - if { ![empty_string_p $resources] } { - - foreach resourcex [$resources child all resource] { - - # gets the type of resource - set resource_scormtype [string tolower [lors::imsmd::getAtt $resourcex adlcp:scormtype]] + switch $resource_scormtype { + sco { + incr scos - switch $resource_scormtype { - sco { - incr scos + } asset { + incr assets + + } sharableresource { + incr sharableresources + } } - asset { - incr assets - } - sharableresource { - incr sharableresources - } + + set files [expr $files + [llength [lors::imsmd::getResource \ + -node $resourcex \ + -att files]]] } + } - set files [expr $files + [llength [lors::imsmd::getResource -node $resourcex -att files]]] + # end isSCORM if + } else { + # The imsmanifest.xml file corresponds to a IMS CP (but not SCORM) + set files 0 + if { ![empty_string_p $resourcex] } { + foreach resource $resourcex { + set files [expr $files + [llength [lors::imsmd::getResource \ + -node $resource \ + -att files]]] + } } } - # end isSCORM if } else { - # The imsmanifest.xml file corresponds to a IMS CP (but not SCORM) + # Error MSG here + ad_return_complaint 1 "[_ lorsm.lt_There_has_been_a_prob]" + ad_script_abort + } - set files 0 - if { ![empty_string_p $resourcex] } { + # Is this a Blackboard6 package? + set isBB [lors::imscp::bb6::isBlackboard6 -tmp_dir $tmp_dir] - foreach resource $resourcex { - set files [expr $files + [llength [lors::imsmd::getResource -node $resource -att files]]] - } - } + if {$isBB == 1} { + ns_write "

[_ lorsm.lt_Blackboard6_Content_P].
[_ lorsm.lt_Modifying_package_to_]" + ns_write "


[_ lorsm.lt_Cleaning_up_unused_ap]" + lors::imscp::bb6::clean_items -tmp_dir $tmp_dir -file "imsmanifest.xml" + ns_write "[_ lorsm.Done]" + ns_write "
[_ lorsm.lt_Renaming_content_type]" + lors::imscp::bb6::extract_html -tmp_dir $tmp_dir -file "imsmanifest.xml" + ns_write "[_ lorsm.Done]

" } + ns_write "

[_ lorsm.lt_Starting_File_Process]

" -} else { - # Error MSG here - ad_return_complaint 1 "[_ lorsm.lt_There_has_been_a_prob]" - ad_script_abort + db_transaction { -} + ## adds folder to the CR + set parent_id $folder_id + set fs_dir $tmp_dir + # get their IP + set creation_ip [ad_conn peeraddr] + # checks whether the directory given actually exists + if {[file exists $fs_dir]} { + set all_files [list] + # now that exists, let's create it on the CR + # gets rid of the path and leaves the name of the directory + # if course_name is changed, then use that name. Otherwise it will use the default folder name given + #set course_name $upload_file + # FIX ME: the course name is taken from the uploaded file, it should be taken somewhere else + regsub {(\.[a-zA-Z0-9]+)$} $upload_file "" course_name + regsub -all {_} $course_name " " course_name + regexp {([^/\\]+)$} $fs_dir match cr_dir + # We need to separate folders (since now all are cr_items) one for the files (content) and the other + # one for the created cr_items + set new_parent_id [lors::cr::add_folder \ + -parent_id $parent_id \ + -folder_name $cr_dir] + set new_items_parent_id [lors::cr::add_folder \ + -parent_id $parent_id \ + -folder_name "${cr_dir}_items"] + # PERMISSIONS FOR FILE-STORAGE -# Is this a Blackboard6 package? -set isBB [lors::imscp::bb6::isBlackboard6 -tmp_dir $tmp_dir] + # Before we go about anything else, lets just set permissions straight. + # Disable folder permissions inheritance + permission::toggle_inherit -object_id $new_parent_id + permission::toggle_inherit -object_id $new_items_parent_id -if {$isBB == 1} { - ns_write "

[_ lorsm.lt_Blackboard6_Content_P].
[_ lorsm.lt_Modifying_package_to_]" - ns_write "


[_ lorsm.lt_Cleaning_up_unused_ap]" - lors::imscp::bb6::clean_items -tmp_dir $tmp_dir -file "imsmanifest.xml" - ns_write "[_ lorsm.Done]" - ns_write "
[_ lorsm.lt_Renaming_content_type]" - lors::imscp::bb6::extract_html -tmp_dir $tmp_dir -file "imsmanifest.xml" - ns_write "[_ lorsm.Done]

" + # Set read permissions for community/class dotlrn_member_rel -} + set community_id [dotlrn_community::get_community_id] + set party_id_member [db_string party_id {select segment_id + from rel_segments + where group_id = :community_id + and rel_type = 'dotlrn_member_rel'}] -ns_write "

[_ lorsm.lt_Starting_File_Process]

" + permission::grant \ + -party_id $party_id_member \ + -object_id $new_parent_id \ + -privilege read + permission::grant \ + -party_id $party_id_member \ + -object_id $new_items_parent_id \ + -privilege read -db_transaction { + # Set read permissions for community/class dotlrn_admin_rel - ## adds folder to the CR - set parent_id $folder_id - set fs_dir $tmp_dir + set party_id_admin [db_string party_id {select segment_id + from rel_segments + where group_id = :community_id + and rel_type = 'dotlrn_admin_rel'}] - # get their IP - set creation_ip [ad_conn peeraddr] + permission::grant \ + -party_id $party_id_admin \ + -object_id $new_parent_id \ + -privilege read - # checks whether the directory given actually exists - if {[file exists $fs_dir]} { - set all_files [list] - # now that exists, let's create it on the CR + permission::grant \ + -party_id $party_id_admin \ + -object_id $new_items_parent_id \ + -privilege read - # gets rid of the path and leaves the name of the directory - # if course_name is changed, then use that name. Otherwise it will use the default folder name given - #set course_name $upload_file - # FIX ME: the course name is taken from the uploaded file, it should be taken somewhere else - regsub {(\.[a-zA-Z0-9]+)$} $upload_file "" course_name - regsub -all {_} $course_name " " course_name - - regexp {([^/\\]+)$} $fs_dir match cr_dir + # Set read permissions for *all* other professors within .LRN + # (so they can see the content) - # We need to separate folders (since now all are cr_items) one for the files (content) and the other - # one for the created cr_items - set new_parent_id [lors::cr::add_folder -parent_id $parent_id -folder_name $cr_dir] - set new_items_parent_id [lors::cr::add_folder -parent_id $parent_id -folder_name "${cr_dir}_items"] + set party_id_professor [db_string party_id {select segment_id + from rel_segments + where rel_type = 'dotlrn_professor_profile_rel'}] - # PERMISSIONS FOR FILE-STORAGE + permission::grant \ + -party_id $party_id_professor \ + -object_id $new_parent_id \ + -privilege read - # Before we go about anything else, lets just set permissions straight. - # Disable folder permissions inheritance - permission::toggle_inherit -object_id $new_parent_id - permission::toggle_inherit -object_id $new_items_parent_id + permission::grant \ + -party_id $party_id_professor \ + -object_id $new_items_parent_id \ + -privilege read - # Set read permissions for community/class dotlrn_member_rel + # Set read permissions for *all* other admins within .LRN + # (so they can see the content) - set community_id [dotlrn_community::get_community_id] + set party_id_admins [db_string party_id {select segment_id + from rel_segments + where rel_type = 'dotlrn_admin_profile_rel'}] - set party_id_member [db_string party_id {select segment_id from rel_segments \ - where group_id = :community_id \ - and rel_type = 'dotlrn_member_rel'}] + permission::grant \ + -party_id $party_id_admins \ + -object_id $new_parent_id \ + -privilege read - permission::grant -party_id $party_id_member -object_id $new_parent_id -privilege read - permission::grant -party_id $party_id_member -object_id $new_items_parent_id -privilege read + permission::grant \ + -party_id $party_id_admins \ + -object_id $new_items_parent_id \ + -privilege read - # Set read permissions for community/class dotlrn_admin_rel + set filesx [lors::cr::add_files \ + -parent_id $new_parent_id \ + -indb_p $indb_p \ + -files [lors::cr::has_files -fs_dir $fs_dir]] - set party_id_admin [db_string party_id {select segment_id from rel_segments \ - where group_id = :community_id \ - and rel_type = 'dotlrn_admin_rel'}] + set all_files [concat $all_files $filesx] - permission::grant -party_id $party_id_admin -object_id $new_parent_id -privilege read - permission::grant -party_id $party_id_admin -object_id $new_items_parent_id -privilege read + # get all the directories and files under those dirs - # Set read permissions for *all* other professors within .LRN - # (so they can see the content) + set dirs [lors::cr::has_dirs -fs_dir $fs_dir] - set party_id_professor [db_string party_id {select segment_id from rel_segments \ - where rel_type = 'dotlrn_professor_profile_rel'}] + set base_parent_id $new_parent_id - permission::grant -party_id $party_id_professor -object_id $new_parent_id -privilege read - permission::grant -party_id $party_id_professor -object_id $new_items_parent_id -privilege read + # dirx = directory loop + set dirx [list "$base_parent_id [list $dirs]"] - # Set read permissions for *all* other admins within .LRN - # (so they can see the content) + # for each directory found.. + while {[llength $dirx] != 0} { + set collector [list] + foreach dir $dirx { + # if the dirx loop is 0... + set base_parent_id [lindex $dir 0] - set party_id_admins [db_string party_id {select segment_id from rel_segments \ - where rel_type = 'dotlrn_admin_profile_rel'}] + foreach subdir [lindex $dir 1] { + # remove all path + regexp {([^/\\]+)$} $subdir match cr_dir - permission::grant -party_id $party_id_admins -object_id $new_parent_id -privilege read - permission::grant -party_id $party_id_admins -object_id $new_items_parent_id -privilege read + # add the folder to the CR + ns_write "[_ lorsm.Processing_folder]: $cr_dir
" + set new_cr_folder_id [lors::cr::add_folder \ + -parent_id $base_parent_id \ + -folder_name $cr_dir] + lappend collector "$new_cr_folder_id [list + [lors::cr::has_dirs -fs_dir $subdir]]" + # add files (if any) + set files [lors::cr::has_files -fs_dir $subdir] + #For display purposes + ns_write "[_ lorsm.Processing_files]

" + foreach file $files { + set tempval [regsub $tmp_dir $file {}] + ns_write " + $tempval[_ lorsm.OK]
" + } + ns_write "

" + # - set filesx [lors::cr::add_files -parent_id $new_parent_id -indb_p $indb_p -files [lors::cr::has_files -fs_dir $fs_dir]] + if ![empty_string_p $files] { + set filesx [lors::cr::add_files \ + -parent_id $new_cr_folder_id \ + -files $files \ + -indb_p $indb_p] + set all_files [concat $all_files $filesx] + } - set all_files [concat $all_files $filesx] + } + } + if {[llength $collector] == 0} { + # then just add the name of the directories + set dirx $collector + } else { + # otherwise, then just add the new directories to the queue + set dirx + set dirx $collector + } + } - # get all the directories and files under those dirs + ## Finish adding files to the CR. + ## Now we start processing the imsmanifest.xml file - set dirs [lors::cr::has_dirs -fs_dir $fs_dir] + ns_write "

[_ lorsm.Now_processing]imsmanifest.xml [_ lorsm.file]" + ## Opens imsmanifest.xml - set base_parent_id $new_parent_id + # open manifest file with tDOM + dom parse [::tDOM::xmlReadFile $tmp_dir/imsmanifest.xml] doc + # gets the manifest tree + set manifest [$doc documentElement] - # dirx = directory loop - set dirx [list "$base_parent_id [list $dirs]"] + # Gets manifest characteristics + set man_identifier [lors::imsmd::getAtt $manifest identifier] + set man_version [lors::imsmd::getAtt $manifest version] - # for each directory found.. - while {[llength $dirx] != 0} { - set collector [list] - foreach dir $dirx { - # if the dirx loop is 0... - set base_parent_id [lindex $dir 0] + # DETECT SCORM OR IMS CP + # NOTE: it requires that the manifest contains a metadata record (which is not always the case) :-( + ## - foreach subdir [lindex $dir 1] { + # gets metadata node + set metadata [$manifest child all metadata] - # remove all path - regexp {([^/\\]+)$} $subdir match cr_dir - - # add the folder to the CR - ns_write "[_ lorsm.Processing_folder]: $cr_dir
" - set new_cr_folder_id [lors::cr::add_folder -parent_id $base_parent_id -folder_name $cr_dir] - lappend collector "$new_cr_folder_id [list [lors::cr::has_dirs -fs_dir $subdir]]" - - # add files (if any) - set files [lors::cr::has_files -fs_dir $subdir] - - #For display purposes - ns_write "[_ lorsm.Processing_files]

" - foreach file $files { - set tempval [regsub $tmp_dir $file {}] - ns_write " $tempval[_ lorsm.OK]
" - } - ns_write "

" - # - - if ![empty_string_p $files] { - set filesx [lors::cr::add_files -parent_id $new_cr_folder_id -files $files -indb_p $indb_p] - set all_files [concat $all_files $filesx] - } - + if { ![empty_string_p $metadata] } { + # gets metadataschema + set MetadataSchema [lindex [lindex [lors::imsmd::getMDSchema $metadata] 0] 0] + set MetadataSchemaVersion [lindex [lors::imsmd::getMDSchema $metadata] 1] + if {![empty_string_p $MetadataSchema]} { + set isSCORM [regexp -nocase scorm $MetadataSchema] } + if {$isSCORM == 1} { + set man_isscorm 1 + } else { + set man_isscorm 0 + } + } else { + set man_isscorm 0 } - if {[llength $collector] == 0} { - # then just add the name of the directories - set dirx $collector + + if { ![empty_string_p $metadata] } { + set man_hasmetadata 1 } else { - # otherwise, then just add the new directories to the queue - set dirx - set dirx $collector + set man_hasmetadata 0 } - } - ## Finish adding files to the CR. - ## Now we start processing the imsmanifest.xml file + ## Gets manifest title - ns_write "

[_ lorsm.Now_processing]imsmanifest.xml [_ lorsm.file]" - ## Opens imsmanifest.xml + if { ![empty_string_p $metadata] } { + set lom [lindex [lors::imsmd::getLOM $metadata $tmp_dir] 0] + set prefix [lindex [lors::imsmd::getLOM $metadata $tmp_dir] 1] + if { $lom != 0 } { + # Get title + set manifest_title_lang [lindex \ + [lindex \ + [lors::imsmd::mdGeneral \ + -element title \ + -node $lom \ + -prefix $prefix] 0] 0] - # open manifest file with tDOM - dom parse [::tDOM::xmlReadFile $tmp_dir/imsmanifest.xml] doc - # gets the manifest tree - set manifest [$doc documentElement] + set manifest_title [lindex \ + [lindex \ + [lors::imsmd::mdGeneral \ + -element title \ + -node $lom \ + -prefix $prefix] 0] 1] + # set context + set context "[_ lorsm.lt_Importing_manifest_ti]" - # Gets manifest characteristics - set man_identifier [lors::imsmd::getAtt $manifest identifier] - set man_version [lors::imsmd::getAtt $manifest version] + ## Gets manifest description - # DETECT SCORM OR IMS CP - # NOTE: it requires that the manifest contains a metadata record (which is not always the case) :-( - ## + set manifest_descrip_lang [lindex \ + [lindex [lors::imsmd::mdGeneral \ + -element description \ + -node $lom \ + -prefix $prefix] 0] 0] + set manifest_descrip [lindex + [lindex [lors::imsmd::mdGeneral \ + -element description \ + -node $lom \ + -prefix $prefix] 0] 1] - # gets metadata node - set metadata [$manifest child all metadata] + # adds course information for display - if { ![empty_string_p $metadata] } { - # gets metadataschema - set MetadataSchema [lindex [lindex [lors::imsmd::getMDSchema $metadata] 0] 0] - set MetadataSchemaVersion [lindex [lors::imsmd::getMDSchema $metadata] 1] - if {![empty_string_p $MetadataSchema]} { - set isSCORM [regexp -nocase scorm $MetadataSchema] - } - if {$isSCORM == 1} { - set man_isscorm 1 - } else { - set man_isscorm 0 - } - } else { - set man_isscorm 0 - } - if { ![empty_string_p $metadata] } { - set man_hasmetadata 1 - } else { - set man_hasmetadata 0 - } + # Gets Rights info + set copyright [lors::imsmd::mdRights \ + -element copyrightandotherrestrictions \ + -node $lom \ + -prefix $prefix] - - ## Gets manifest title + if { ![empty_string_p $copyright] } { + set copyright_s [lindex + [lindex + [lindex $copyright 0] 0] 1] + set copyright_v [lindex + [lindex + [lindex $copyright 0] 1] 1] + set cr_descrip [lors::imsmd::mdRights \ + -element description \ + -node $lom \ + -prefix $prefix] + set cr_descrip_s [lindex [lindex $cr_descrip 0] 1] + } + } else { + set context "[_ lorsm.lt_Importing_No_Metadata]" + } + } - if { ![empty_string_p $metadata] } { - set lom [lindex [lors::imsmd::getLOM $metadata $tmp_dir] 0] - set prefix [lindex [lors::imsmd::getLOM $metadata $tmp_dir] 1] - if { $lom != 0 } { - # Get title - set manifest_title_lang [lindex [lindex [lors::imsmd::mdGeneral -element title -node $lom -prefix $prefix] 0] 0] - set manifest_title [lindex [lindex [lors::imsmd::mdGeneral -element title -node $lom -prefix $prefix] 0] 1] - # set context - set context "[_ lorsm.lt_Importing_manifest_ti]" + # Gets the organizations - ## Gets manifest description - - set manifest_descrip_lang [lindex [lindex [lors::imsmd::mdGeneral -element description -node $lom -prefix $prefix] 0] 0] - set manifest_descrip [lindex [lindex [lors::imsmd::mdGeneral -element description -node $lom -prefix $prefix] 0] 1] + set organizations [$manifest child all organizations] + set man_orgs_default [lors::imsmd::getAtt $organizations default] - # adds course information for display + set man_id [lors::imscp::manifest_add \ + -course_name $course_name \ + -identifier $man_identifier \ + -version $man_version \ + -orgs_default $man_orgs_default \ + -hasmetadata $man_hasmetadata \ + -isscorm $man_isscorm \ + -folder_id $new_items_parent_id \ + -fs_package_id $fs_package_id \ + -community_id $community_id \ + -content_folder_id $new_parent_id] + ns_write "[_ lorsm.lt_Granting_permissions__1]
" - # Gets Rights info - set copyright [lors::imsmd::mdRights -element copyrightandotherrestrictions -node $lom -prefix $prefix] - if { ![empty_string_p $copyright] } { - set copyright_s [lindex [lindex [lindex $copyright 0] 0] 1] - set copyright_v [lindex [lindex [lindex $copyright 0] 1] 1] - set cr_descrip [lors::imsmd::mdRights -element description -node $lom -prefix $prefix] - set cr_descrip_s [lindex [lindex $cr_descrip 0] 1] + # PERMISSIONS FOR MANIFEST and learning objects + # set up in the same way as permissions for the file storage + # objects. As we want to maintain consistency btw the + # learnining objects and their content - } + # Disable folder permissions inheritance + permission::toggle_inherit -object_id $man_id + # Set read permissions for community/class dotlrn_member_rel - } else { - set context "[_ lorsm.lt_Importing_No_Metadata]" - } + set community_id [dotlrn_community::get_community_id] - } + set party_id_member [db_string party_id { + select segment_id + from rel_segments \ + where group_id = :community_id \ + and rel_type = 'dotlrn_member_rel'}] + permission::grant \ + -party_id $party_id_member \ + -object_id $man_id \ + -privilege read + # Set read permissions for community/class dotlrn_admin_rel - # Gets the organizations + set party_id_admin [db_string party_id {select segment_id + from rel_segments \ + where group_id = :community_id \ + and rel_type = 'dotlrn_admin_rel'}] - set organizations [$manifest child all organizations] - set man_orgs_default [lors::imsmd::getAtt $organizations default] + permission::grant \ + -party_id $party_id_admin \ + -object_id $man_id \ + -privilege read - set man_id [lors::imscp::manifest_add \ - -course_name $course_name \ - -identifier $man_identifier \ - -version $man_version \ - -orgs_default $man_orgs_default \ - -hasmetadata $man_hasmetadata \ - -isscorm $man_isscorm \ - -folder_id $new_items_parent_id \ - -fs_package_id $fs_package_id \ - -community_id $community_id \ - -content_folder_id $new_parent_id] + # Set read permissions for *all* other professors within .LRN + # (so they can see the content) + set party_id_professor [db_string party_id {select segment_id + from rel_segments \ + where rel_type = 'dotlrn_professor_profile_rel'}] - ns_write "[_ lorsm.lt_Granting_permissions__1]
" + permission::grant \ + -party_id $party_id_professor \ + -object_id $man_id \ + -privilege read - # PERMISSIONS FOR MANIFEST and learning objects + # Set read permissions for *all* other admins within .LRN + # (so they can see the content) - # set up in the same way as permissions for the file storage - # objects. As we want to maintain consistency btw the - # learnining objects and their content + set party_id_admins [db_string party_id {select segment_id + from rel_segments \ + where rel_type = 'dotlrn_admin_profile_rel'}] - # Disable folder permissions inheritance - permission::toggle_inherit -object_id $man_id + permission::grant \ + -party_id $party_id_admins \ + -object_id $man_id \ + -privilege read - # Set read permissions for community/class dotlrn_member_rel + # Done with Manifest and learning object Permissions + ns_write "[_ lorsm.lt_Adding_course_name_Ma]
" - set community_id [dotlrn_community::get_community_id] + if {$man_hasmetadata == 1} { + # adds manifest metadata + set aa [lors::imsmd::addMetadata \ + -acs_object $man_id \ + -node $metadata \ + -dir $tmp_dir] - set party_id_member [db_string party_id {select segment_id from rel_segments \ - where group_id = :community_id \ - and rel_type = 'dotlrn_member_rel'}] + ns_write "[_ lorsm.lt_Adding_Manifest_Metad]
" + } - permission::grant -party_id $party_id_member -object_id $man_id -privilege read + if { ![empty_string_p $organizations] } { + # for multiple organizations + set add [list] - # Set read permissions for community/class dotlrn_admin_rel + foreach organization [$organizations child all organization] { + set org_identifier [lors::imsmd::getResource \ + -node $organization \ + -att identifier] + set org_identifier [lors::imsmd::getResource \ + -node $organization \ + -att identifier] + set org_structure [lors::imsmd::getResource \ + -node $organization \ + -att structure] - set party_id_admin [db_string party_id {select segment_id from rel_segments \ - where group_id = :community_id \ - and rel_type = 'dotlrn_admin_rel'}] + if {![empty_string_p [$organization child all title]]} { + set org_title [lors::imsmd::getElement \ + [$organization child all title]] + } else { + set org_title "" + } - permission::grant -party_id $party_id_admin -object_id $man_id -privilege read + set org_hasmetadata [lors::imsmd::hasMetadata $organization] + set org_id [lors::imscp::organization_add \ + -man_id $man_id \ + -identifier $org_identifier \ + -structure $org_structure \ + -title $org_title \ + -hasmetadata $org_hasmetadata\ + -org_folder_id $new_items_parent_id] - # Set read permissions for *all* other professors within .LRN - # (so they can see the content) + ns_write "[_ lorsm.lt_Adding_Organization_o]
" - set party_id_professor [db_string party_id {select segment_id from rel_segments \ - where rel_type = 'dotlrn_professor_profile_rel'}] - permission::grant -party_id $party_id_professor -object_id $man_id -privilege read + if {$org_hasmetadata == 1} { + # adds manifest metadata + set aa [lors::imsmd::addMetadata \ + -acs_object $org_id \ + -node [lors::imsmd::getMDNode $organization] \ + -dir $tmp_dir] + } - # Set read permissions for *all* other admins within .LRN - # (so they can see the content) + set list_items [lors::imscp::getItems $organization] - set party_id_admins [db_string party_id {select segment_id from rel_segments \ - where rel_type = 'dotlrn_admin_profile_rel'}] + # ns_write "[_ lorsm.lt_here_is_list_items_li]" + set add [concat $add [lors::imscp::addItems \ + -itm_folder_id $new_items_parent_id \ + -org_id $org_id $list_items 0 $tmp_dir]] - permission::grant -party_id $party_id_admins -object_id $man_id -privilege read + set tempval [llength $add] + ns_write "[_ lorsm.lt_Adding_tempval_items_]
" + } + } + set l_files [list] + set resources [$manifest child all resources] + set resourcex [$resources child all resource] - # Done with Manifest and learning object Permissions + if { ![empty_string_p $resourcex] } { + set res_list [list] + foreach resource $resourcex { + set res_identifier [lors::imsmd::getResource \ + -node $resource \ + -att identifier] + set res_type [lors::imsmd::getResource \ + -node $resource \ + -att type] + set res_href [lors::imsmd::getResource \ + -node $resource \ + -att href] + set res_dependencies [lors::imsmd::getResource \ + -node $resource \ + -att dependencies] + set res_hasmetadata [lors::imsmd::hasMetadata $resource] + set res_files [lors::imsmd::getResource \ + -node $resource \ + -att files] + set res_scormtype [lors::imsmd::getAtt $resource adlcp:scormtype] - ns_write "[_ lorsm.lt_Adding_course_name_Ma]
" + # Integration with other packages + # This callback gets the href of the imported content (if some package imported it) + set res_href_tmp [callback \ + -catch lors::import \ + -res_type $res_type \ + -res_href $res_href \ + -tmp_dir $tmp_dir \ + -community_id $community_id] - if {$man_hasmetadata == 1} { - # adds manifest metadata - set aa [lors::imsmd::addMetadata \ - -acs_object $man_id \ - -node $metadata \ - -dir $tmp_dir] + if {![empty_string_p $res_href_tmp]} { + set res_href $res_href_tmp + } - ns_write "[_ lorsm.lt_Adding_Manifest_Metad]
" + set resource_id [lors::imscp::resource_add \ + -man_id $man_id \ + -identifier $res_identifier \ + -type $res_type \ + -href $res_href \ + -scorm_type $res_scormtype \ + -hasmetadata $res_hasmetadata \ + -res_folder_id $new_items_parent_id] - } + ns_write "[_ lorsm.lt_Adding_resource_res_i_2]
" + lappend res_list [concat "$resource_id $res_identifier"] - if { ![empty_string_p $organizations] } { + if {$res_hasmetadata == 1} { + set res_md_add [lors::imsmd::addMetadata \ + -acs_object $resource_id \ + -node [lors::imsmd::getMDNode $resource] \ + -dir $tmp_dir] - # for multiple organizations - set add [list] + ns_write "[_ lorsm.lt_Adding_resource_res_i_3]
" + } - foreach organization [$organizations child all organization] { + foreach dependency $res_dependencies { + set dep_id [lors::imscp::dependency_add \ + -res_id $resource_id \ + -identifierref $dependency] - set org_identifier [lors::imsmd::getResource -node $organization -att identifier] + ns_write "[_ lorsm.lt_Adding_resource_depen]
" + } - set org_identifier [lors::imsmd::getResource -node $organization -att identifier] - set org_structure [lors::imsmd::getResource -node $organization -att structure] - if {![empty_string_p [$organization child all title]]} { - set org_title [lors::imsmd::getElement [$organization child all title]] - } else { - set org_title "" - } - set org_hasmetadata [lors::imsmd::hasMetadata $organization] - - set org_id [lors::imscp::organization_add \ - -man_id $man_id \ - -identifier $org_identifier \ - -structure $org_structure \ - -title $org_title \ - -hasmetadata $org_hasmetadata\ - -org_folder_id $new_items_parent_id] - - ns_write "[_ lorsm.lt_Adding_Organization_o]
" - - - if {$org_hasmetadata == 1} { - # adds manifest metadata - set aa [lors::imsmd::addMetadata \ - -acs_object $org_id \ - -node [lors::imsmd::getMDNode $organization] \ - -dir $tmp_dir] + foreach file $res_files { + lappend l_files [list + [lindex $file 0] $resource_id + [lindex $file 1]] + # ns_write "[_ lorsm.lt_resource_id_res_ident]" + # ns_write "\t$file \n" + } } + } - set list_items [lors::imscp::getItems $organization] + # gets the resources + set resources [$manifest child all resources] -# ns_write "[_ lorsm.lt_here_is_list_items_li]" + } else { + # Error MSG here + #ns_write "[_ lorsm.no_page]" + } - set add [concat $add [lors::imscp::addItems -itm_folder_id $new_items_parent_id -org_id $org_id $list_items 0 $tmp_dir]] - set tempval [llength $add] - ns_write "[_ lorsm.lt_Adding_tempval_items_]
" + # Here's where we link items and resources. Take into + # account that a resources can have 1 to many items - } + # So first, let's create a list of only item_identifierrefs + # [lindex $add 1]. Therefore we can do a lsearch -exact instead of + # a -regexp + foreach ref $add { + lappend i_identref [lindex $ref 1] } - set l_files [list] + foreach resource $res_list { + set find_item_id [lsearch -all -exact $i_identref \ + [lindex $resource 1]] - set resources [$manifest child all resources] + if {$find_item_id != -1} { - set resourcex [$resources child all resource] - - if { ![empty_string_p $resourcex] } { - - set res_list [list] - foreach resource $resourcex { - set res_identifier [lors::imsmd::getResource -node $resource -att identifier] - set res_type [lors::imsmd::getResource -node $resource -att type] - set res_href [lors::imsmd::getResource -node $resource -att href] - set res_dependencies [lors::imsmd::getResource -node $resource -att dependencies] - set res_hasmetadata [lors::imsmd::hasMetadata $resource] - set res_files [lors::imsmd::getResource -node $resource -att files] - set res_scormtype [lors::imsmd::getAtt $resource adlcp:scormtype] - - # Integration with other packages - # This callback gets the href of the imported content (if some package imported it) - set res_href_tmp [callback -catch lors::import -res_type $res_type -res_href $res_href -tmp_dir $tmp_dir -community_id $community_id] - if {![empty_string_p $res_href_tmp]} { - set res_href $res_href_tmp + foreach item_to_res $find_item_id { + set item_to_resource [lors::imscp::item_to_resource_add \ + -item_id [lindex [lindex $add $item_to_res] 0] \ + -res_id [lindex $resource 0]] } + } + } - set resource_id [lors::imscp::resource_add \ - -man_id $man_id \ - -identifier $res_identifier \ - -type $res_type \ - -href $res_href \ - -scorm_type $res_scormtype \ - -hasmetadata $res_hasmetadata \ - -res_folder_id $new_items_parent_id] + ns_write "[_ lorsm.lt_Now_we_are_almost_don]
" - ns_write "[_ lorsm.lt_Adding_resource_res_i_2]
" - - lappend res_list [concat "$resource_id $res_identifier"] + foreach file $l_files { + set filename [lindex $file 0] + set found_file [lsearch -all -regexp $all_files $filename] - + if {[llength $found_file] > 1} { + # we are suppose to get only one element back, so we have + # to refine the search a bit more. + set found_file [lsearch -all -regexp $all_files $tmp_dir/$filename] + } + if {![empty_string_p $found_file]} { + set file_id [lindex [lindex $all_files $found_file] 3] + set file_rev_id [content::item::get_live_revision \ + -item_id $file_id] + set res_id [lindex $file 1] + set file_hasmetadata [lindex $file 2] - if {$res_hasmetadata == 1} { - set res_md_add [lors::imsmd::addMetadata \ - -acs_object $resource_id \ - -node [lors::imsmd::getMDNode $resource] \ - -dir $tmp_dir] + regexp {([^/\\]+)$} $filename match filex - ns_write "[_ lorsm.lt_Adding_resource_res_i_3]
" - + if {$file_hasmetadata != 0} { + set hasmetadata 1 + } else { + set hasmetadata 0 } + set fileadd [lors::imscp::file_add \ + -file_id $file_rev_id \ + -res_id $res_id \ + -pathtofile $filename \ + -filename $filex \ + -hasmetadata $hasmetadata] - foreach dependency $res_dependencies { + ns_write "[_ lorsm.Adding_file_filex]
" - set dep_id [lors::imscp::dependency_add \ - -res_id $resource_id \ - -identifierref $dependency] - ns_write "[_ lorsm.lt_Adding_resource_depen]
" - + if {$file_hasmetadata != 0} { + set add_file_metadata [lors::imsmd::addMetadata \ + -acs_object $file_id \ + -node $file_hasmetadata \ + -dir $tmp_dir] + ns_write "[_ lorsm.lt_Adding_file_filex_met_1]
" } - - - foreach file $res_files { - lappend l_files [list [lindex $file 0] $resource_id [lindex $file 1]] - - # ns_write "[_ lorsm.lt_resource_id_res_ident]" - # ns_write "\t$file \n" - } } } - # gets the resources - set resources [$manifest child all resources] - - } else { - # Error MSG here - #ns_write "[_ lorsm.no_page]" + # Delete temporary directory + ns_write "[_ lorsm.lt_Deleting_temporary_fo]
" + ns_log Debug "Delete temporary folder $tmp_dir" + lors::imscp::deltmpdir $tmp_dir + ns_write "[_ lorsm.Done]


" } - - - # Here's where we link items and resources. Take into - # account that a resources can have 1 to many items - - - # So first, let's create a list of only item_identifierrefs - # [lindex $add 1]. Therefore we can do a lsearch -exact instead of - # a -regexp - - foreach ref $add { - lappend i_identref [lindex $ref 1] - } - - foreach resource $res_list { - - set find_item_id [lsearch -all -exact $i_identref [lindex $resource 1]] - - if {$find_item_id != -1} { - - foreach item_to_res $find_item_id { - - set item_to_resource [lors::imscp::item_to_resource_add \ - -item_id [lindex [lindex $add $item_to_res] 0] \ - -res_id [lindex $resource 0] - ] - } - - } - - } - - ns_write "[_ lorsm.lt_Now_we_are_almost_don]
" - - foreach file $l_files { - - set filename [lindex $file 0] - - set found_file [lsearch -all -regexp $all_files $filename] - - if {[llength $found_file] > 1} { - # we are suppose to get only one element back, so we have - # to refine the search a bit more. - set found_file [lsearch -all -regexp $all_files $tmp_dir/$filename] - } - - if {![empty_string_p $found_file]} { - set file_id [lindex [lindex $all_files $found_file] 3] - set file_rev_id [content::item::get_live_revision -item_id $file_id] - set res_id [lindex $file 1] - set file_hasmetadata [lindex $file 2] - - regexp {([^/\\]+)$} $filename match filex - - if {$file_hasmetadata != 0} { - set hasmetadata 1 - } else { - set hasmetadata 0 - } - - set fileadd [lors::imscp::file_add \ - -file_id $file_rev_id \ - -res_id $res_id \ - -pathtofile $filename \ - -filename $filex \ - -hasmetadata $hasmetadata] - - ns_write "[_ lorsm.Adding_file_filex]
" - - - if {$file_hasmetadata != 0} { - set add_file_metadata [lors::imsmd::addMetadata \ - -acs_object $file_id \ - -node $file_hasmetadata \ - -dir $tmp_dir] - - ns_write "[_ lorsm.lt_Adding_file_filex_met_1]
" - } - } - - } - - - # Delete temporary directory - ns_write "[_ lorsm.lt_Deleting_temporary_fo]
" - ns_log Debug "Delete temporary folder $tmp_dir" - lors::imscp::deltmpdir $tmp_dir - - ns_write "[_ lorsm.Done]
" + return $man_id } - - return $man_id - -} 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.12 -r1.13 --- openacs-4/packages/lorsm/tcl/lorsm-install-procs.tcl 17 Oct 2008 10:46:09 -0000 1.12 +++ openacs-4/packages/lorsm/tcl/lorsm-install-procs.tcl 17 Nov 2008 13:36:43 -0000 1.13 @@ -1,9 +1,9 @@ # packages/lorsm/tcl/lorsm-install-procs.tcl ad_library { - + LORSM Installation procedures - + @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 2004-08-19 @arch-tag: 535eebaf-8414-4703-8a39-e115a34b68f1 @@ -30,9 +30,8 @@ ad_proc -private lorsm::install::package_install {} { Install the lorsm-templates - + } { - lorsm::install::templates # by the moment we only have tree format presentations and there is no @@ -41,25 +40,25 @@ 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_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') - } - + 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') - } + insert into lorsm_course_presentation_formats + values (-3,:pretty_name,'bottom_navigation_bar','delivery-bottom-bar')} set pretty_name "[_ lorsm.lt_With_Progress_Bar]" db_dml create_no_index_format { - insert into lorsm_course_presentation_formats values (-4,:pretty_name,'progress-bar','delivery-progress-bar') - } + insert into lorsm_course_presentation_formats + values (-4,:pretty_name,'progress-bar','delivery-progress-bar')} - # Service contract implementations - fts + # Service contract implementations - fts lorsm::sc::register_implementations } @@ -69,37 +68,37 @@ } { Upgrade logic - + } { apm_upgrade_logic \ - -from_version_name $from_version_name \ - -to_version_name $to_version_name \ - -spec { - 0.7d 0.8d { - set pretty_name "[_ lorsm.lt_With_Progress_Bar]" - db_dml create_no_index_format { - insert into lorsm_course_presentation_formats values (-4,:pretty_name,'progress-bar','delivery-progress-bar') + -from_version_name $from_version_name \ + -to_version_name $to_version_name \ + -spec { + 0.7d 0.8d { + set pretty_name "[_ lorsm.lt_With_Progress_Bar]" + db_dml create_no_index_format { + insert into lorsm_course_presentation_formats + values (-4,:pretty_name,'progress-bar','delivery-progress-bar')} + + } 0.8d1 0.8d2 { + lorsm::install::templates + + } 0.8d3 0.8d4 { + lorsm::install::templates } - } - 0.8d1 0.8d2 { - lorsm::install::templates } - 0.8d3 0.8d4 { - lorsm::install::templates - } - } } ad_proc -private lorsm::install::templates { } { # location where the templates file are set temp_location "[acs_root_dir]/packages/lorsm/templates" - # location where we are going to copy the files to + # location where we are going to copy the files to set temp_dir "[acs_root_dir]/templates" # check if the template directory exists - # Otherwise create it. + # Otherwise create it. if {![file exists $temp_dir]} { file mkdir $temp_dir } 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.20 -r1.21 --- openacs-4/packages/lorsm/tcl/lorsm-procs.tcl 8 Oct 2008 13:01:05 -0000 1.20 +++ openacs-4/packages/lorsm/tcl/lorsm-procs.tcl 17 Nov 2008 13:36:43 -0000 1.21 @@ -1,9 +1,9 @@ # packages/lorsm/tcl/lorsm-procs.tcl ad_library { - + LORS Management Procedures - + @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 2004-04-16 @arch-tag daf81eac-5543-4f92-b06a-547313205683 @@ -26,576 +26,557 @@ namespace eval lorsm { -variable item_id -variable item_url -variable template_url -variable revision_id + variable item_id + variable item_url + variable template_url + variable revision_id -variable content_root -variable ims_item_id -variable ims_item_title -variable ims_man_id + variable content_root + variable ims_item_id + variable ims_item_title + variable ims_man_id ad_proc -public fix_url { - -url:required + -url:required } { - Function use to fix URLs for course that use whitespaces for their directories, - since the file-storage renames the directories and put a _ instead of a whitespace. - This function should be gone when the file-storage can add folders with whitespaces. - - @param url The identifier reference that we need to modify. - @author Ernie Ghiglione (ErnieG@mm.st) - - } { - set filename [file tail $url] - - if {!([string length $filename] == [string length $url])} { - - set path [string trimright $url $filename] - regsub -all { } $path {_} newpath - return $newpath$filename - } else { - return $url - } - } + Function use to fix URLs for course that use whitespaces for their directories, + since the file-storage renames the directories and put a _ instead of a whitespace. + This function should be gone when the file-storage can add folders with whitespaces. - ad_proc -public fix_href { - -item_title:required - -identifierref:required - -fs_package_id:required - -fs_local_package_id:required - -folder_id:required - -type:required - -track_id:required - } { - Function use to fix the HREF of resources. - It could be that the reference to a resource is outside the - scope of the learning object (somewhere on the web) instead - of a file or resource in the course. + @param url The identifier reference that we need to modify. + @author Ernie Ghiglione (ErnieG@mm.st) - Therefore, this function determines whether ther link to the - resource is within the course materials. If that is the case - it created the link to where the file is stored in the file- - storage. Otherwise, if the resource needs to be fetched from - the web (http://) then we use that href instead. - - @param item_title The title of the item in question - @param identifierref The resource's identifierref - @param fs_package_id the file-storage package id - @param fs_local_package_id the local file-storage package id - @param folder_id file-storage folder id - @param type type of resource - @param track_id whether the ims_cp_item should be tracked or not. - @author Ernie Ghiglione (ErnieG@mm.st) - } { + set filename [file tail $url] - if {![empty_string_p $identifierref]} { - - if {[regexp "http://" $identifierref]} { - - return "$item_title" + if {!([string length $filename] == [string length $url])} { + set path [string trimright $url $filename] + regsub -all { } $path {_} newpath + return $newpath$filename + } else { + return $url + } + } - } else { - switch $type { - "ims-qti-package" { - set url "$item_title" + ad_proc -public fix_href { + -item_title:required + -identifierref:required + -fs_package_id:required + -fs_local_package_id:required + -folder_id:required + -type:required + -track_id:required + } { + Function use to fix the HREF of resources. + It could be that the reference to a resource is outside the + scope of the learning object (somewhere on the web) instead + of a file or resource in the course. - } - default { + Therefore, this function determines whether ther link to the + resource is within the course materials. If that is the case + it created the link to where the file is stored in the file- + storage. Otherwise, if the resource needs to be fetched from + the web (http://) then we use that href instead. - 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 url3 [lorsm::fix_url -url $identifierref] - set content_root [fs::get_root_folder -package_id $fs_package_id] - set url "$item_title" - } - } + @param item_title The title of the item in question + @param identifierref The resource's identifierref + @param fs_package_id the file-storage package id + @param fs_local_package_id the local file-storage package id + @param folder_id file-storage folder id + @param type type of resource + @param track_id whether the ims_cp_item should be tracked or not. + @author Ernie Ghiglione (ErnieG@mm.st) + } { + if {![empty_string_p $identifierref]} { - return $url - } - - } else { - return $item_title - } + if {[regexp "http://" $identifierref]} { + return "$item_title" + } else { + switch $type { + "ims-qti-package" { + set url "$item_title" + } 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 url3 [lorsm::fix_url -url $identifierref] + set content_root [fs::get_root_folder \ + -package_id $fs_package_id] + set url "$item_title" + } + } + return $url + } + } else { + return $item_title + } } + ad_proc -public get_course_name { - -manifest_id:required + -manifest_id:required } { - Given a man_id, it returns the name of the course + Given a man_id, it returns the name of the course - @param manifest_id the Id for the course - @author Ernie Ghiglione (ErnieG@mm.st) + @param manifest_id the Id for the course + @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 {select course_name from ims_cp_manifests where man_id = :manifest_id}] + ad_proc -public dates_calc { + -start_date + -end_date + -seconds + } { + Returns the number of minutes, hours or dates given a start + and end date or a number of seconds. If seconds is specified + date is ignored. + + @param start_date Starting date + @param end_date Ending date + @author Ernie Ghiglione (ErnieG@mm.st) + } { + if {[info exists seconds]} { + if {$seconds ne ""} { + set difference $seconds + } else { + return "" + } + } else { + set start [clock scan "$start_date"] + set end [clock scan "$end_date"] + set difference [expr {$end - $start}] + } + + if {$difference >= 0 && $difference < 60} { + return "[_ lorsm.difference_seconds]" + } elseif {$difference >= 60 && $difference < 3600} { + set tempval [expr {$difference / 60}] + return "[_ lorsm.tempval_minutes]" + } elseif {$difference >= 3600 && $difference < 86400} { + set tempval [expr {$difference / 3600 }] + return "[_ lorsm.tempval_hours]" + } else { + set tempval [expr {$difference / 86400}] + return "[_ lorsm.tempval_days]" + } } - ad_proc -public dates_calc { - -start_date - -end_date - -seconds + + ad_proc -public fix_href2 { + -item_id:required + -identifierref:required + -fs_package_id:required + -fs_local_package_id:required + -folder_id:required + -type:required + -track_id:required } { - Returns the number of minutes, hours or dates given a start - and end date or a number of seconds. If seconds is specified - date is ignored. + Function use to fix the HREF of resources. + It could be that the reference to a resource is outside the + scope of the learning object (somewhere on the web) instead + of a file or resource in the course. - @param start_date Starting date - @param end_date Ending date - @author Ernie Ghiglione (ErnieG@mm.st) + Therefore, this function determines whether ther link to the + resource is within the course materials. If that is the case + it created the link to where the file is stored in the file- + storage. Otherwise, if the resource needs to be fetched from + the web (http://) then we use that href instead. + + @param item_title The title of the item in question + @param identifierref The resource's identifierref + @param fs_package_id the file-storage package id + @param fs_local_package_id the local file-storage package id + @param folder_id file-storage folder id + @param type type of resource + @param track_id whether the ims_cp_item should be tracked or not. + @author Ernie Ghiglione (ErnieG@mm.st) } { - if {[info exists seconds]} { - if {$seconds ne ""} { - set difference $seconds - } else { - return "" - } - } else { - set start [clock scan "$start_date"] - set end [clock scan "$end_date"] - set difference [expr {$end - $start}] - } - if {$difference >= 0 && $difference < 60} { - return "[_ lorsm.difference_seconds]" - } elseif {$difference >= 60 && $difference < 3600} { - set tempval [expr {$difference / 60}] - return "[_ lorsm.tempval_minutes]" - } elseif {$difference >= 3600 && $difference < 86400} { - set tempval [expr {$difference / 3600 }] - return "[_ lorsm.tempval_hours]" + if {![empty_string_p $identifierref]} { + # if the href is already a link to another site, then just + # let it be that + if {[regexp "http://" $identifierref]} { + set identifierref $identifierref + } else { + # otherwise, let the fun begin! + # we need to construct the right URL for this item and + # the instance of the class that is trying to deploy + # it. Further explanation in the documentation. + switch $type { + 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 url3 [lorsm::fix_url -url $identifierref] + set content_root [fs::get_root_folder -package_id $fs_package_id] + set item_id $item_id + set identifierref [export_vars -base [concat $url1$url2$url3] {content_root}] - } else { - set tempval [expr {$difference / 86400}] - return "[_ lorsm.tempval_days]" - } + # if the course is trackable, we need to make + # sure we record the items the user has + # seen. These are ims_items type of objects + if {$track_id != 0} { + set redirect_url $identifierref + set identifierref [export_vars -base record-view {item_id}] + } + } + } + } + return $identifierref + } else { + return "" + } } +### Testing ground - ad_proc -public fix_href2 { - -item_id:required - -identifierref:required - -fs_package_id:required - -fs_local_package_id:required - -folder_id:required - -type:required - -track_id:required + ad_proc -public fix_href3 { + -man_id:required + -item_id:required + -identifierref:required + -fs_package_id:required + -fs_local_package_id:required + -folder_id:required + -type:required + -track_id:required } { - Function use to fix the HREF of resources. - It could be that the reference to a resource is outside the - scope of the learning object (somewhere on the web) instead - of a file or resource in the course. + Function use to fix the HREF of resources. + It could be that the reference to a resource is outside the + scope of the learning object (somewhere on the web) instead + of a file or resource in the course. - Therefore, this function determines whether ther link to the - resource is within the course materials. If that is the case - it created the link to where the file is stored in the file- - storage. Otherwise, if the resource needs to be fetched from - the web (http://) then we use that href instead. - - @param item_title The title of the item in question - @param identifierref The resource's identifierref - @param fs_package_id the file-storage package id - @param fs_local_package_id the local file-storage package id - @param folder_id file-storage folder id - @param type type of resource - @param track_id whether the ims_cp_item should be tracked or not. - @author Ernie Ghiglione (ErnieG@mm.st) - + Therefore, this function determines whether ther link to the + resource is within the course materials. If that is the case + it created the link to where the file is stored in the file- + storage. Otherwise, if the resource needs to be fetched from + the web (http://) then we use that href instead. + + @param man_id manifest Id + @param item_title The title of the item in question + @param identifierref The resource's identifierref + @param fs_package_id the file-storage package id + @param fs_local_package_id the local file-storage package id + @param folder_id file-storage folder id + @param type type of resource + @param track_id whether the ims_cp_item should be tracked or not. + @author Ernie Ghiglione (ErnieG@mm.st) } { + if {![empty_string_p $identifierref]} { - if {![empty_string_p $identifierref]} { - - # if the href is already a link to another site, then just - # let it be that - if {[regexp "http://" $identifierref]} { - set identifierref $identifierref - } else { - # otherwise, let the fun begin! - # we need to construct the right URL for this item and - # the instance of the class that is trying to deploy - # it. Further explanation in the documentation. - switch $type { - 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 url3 [lorsm::fix_url -url $identifierref] - set content_root [fs::get_root_folder -package_id $fs_package_id] - set item_id $item_id - set identifierref [export_vars -base [concat $url1$url2$url3] {content_root}] + # if the href is already a link to another site, then just + # let it be that + if {[regexp "http://" $identifierref]} { + set identifierref $identifierref + } else { + # otherwise, let the fun begin! + # we need to construct the right URL for this item and + # the instance of the class that is trying to deploy + # it. Further explanation in the documentation. + switch $type { + default { + set url1 "view/" + #CM creating url2 in record-view + # set folder_id $folder_id + # set url2 "[db_string select_folder_key {select key from fs_folders where folder_id = :folder_id}]/" + #CM Not using url3 anymore + # set url3 [lorsm::fix_url -url $identifierref] + set content_root [fs::get_root_folder -package_id $fs_package_id] + set item_id $item_id + # set identifierref [export_vars -base record-view {content_root url2 url3 item_id man_id}] + set identifierref [export_vars -base record-view {item_id man_id content_root}] - # if the course is trackable, we need to make - # sure we record the items the user has - # seen. These are ims_items type of objects - if {$track_id != 0} { + # if the course is trackable, we need to make + # sure we record the items the user has + # seen. These are ims_items type of objects + if {$track_id != 0} { + # set redirect_url $identifierref + # set identifierref [export_vars -base record-view {redirect_url item_id}] + } + } + } + } + return $identifierref + } else { + return "" + } + } - set redirect_url $identifierref - set identifierref [export_vars -base record-view {item_id}] - } - } - } - } - return $identifierref - } else { - return "" - } + ad_proc -public set_ims_item_id { ims_it_id } { + variable ims_item_id $ims_it_id + } + + ad_proc -public get_ims_item_id { } { + variable ims_item_id + return $ims_item_id } + 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 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.live_revision=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') + and not exists (select 1 + from lorsm_custom_pages + where page_id=cr.item_id + and man_id=:man_id) + ORDER BY i.sort_order, o.object_id, cr.tree_sortkey + } { + lappend item_list $ims_item_id + } + } + return $item_list + } -### Testing ground - ad_proc -public fix_href3 { - -man_id:required - -item_id:required - -identifierref:required - -fs_package_id:required - -fs_local_package_id:required - -folder_id:required - -type:required - -track_id:required + ad_proc -public record_view { + item_id man_id } { - Function use to fix the HREF of resources. - It could be that the reference to a resource is outside the - scope of the learning object (somewhere on the web) instead - of a file or resource in the course. - Therefore, this function determines whether ther link to the - resource is within the course materials. If that is the case - it created the link to where the file is stored in the file- - storage. Otherwise, if the resource needs to be fetched from - the web (http://) then we use that href instead. - - @param man_id manifest Id - @param item_title The title of the item in question - @param identifierref The resource's identifierref - @param fs_package_id the file-storage package id - @param fs_local_package_id the local file-storage package id - @param folder_id file-storage folder id - @param type type of resource - @param track_id whether the ims_cp_item should be tracked or not. - @author Ernie Ghiglione (ErnieG@mm.st) - - } { + 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] - if {![empty_string_p $identifierref]} { - - # if the href is already a link to another site, then just - # let it be that - if {[regexp "http://" $identifierref]} { - set identifierref $identifierref - } else { - # otherwise, let the fun begin! - # we need to construct the right URL for this item and - # the instance of the class that is trying to deploy - # it. Further explanation in the documentation. - switch $type { - default { - set url1 "view/" -#CM creating url2 in record-view -# set folder_id $folder_id -# set url2 "[db_string select_folder_key {select key from fs_folders where folder_id = :folder_id}]/" -#CM Not using url3 anymore -# set url3 [lorsm::fix_url -url $identifierref] - set content_root [fs::get_root_folder -package_id $fs_package_id] - set item_id $item_id -# set identifierref [export_vars -base record-view {content_root url2 url3 item_id man_id}] - set identifierref [export_vars -base record-view {item_id man_id content_root}] + db_1row manifest_info "select fs_package_id, folder_id + from ims_cp_manifests + where man_id = :man_id" - # if the course is trackable, we need to make - # sure we record the items the user has - # seen. These are ims_items type of objects - if {$track_id != 0} { + 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.ims_item_id = :item_id + and ir.res_id = r.res_id" -default ""] -# set redirect_url $identifierref -# set identifierref [export_vars -base record-view {redirect_url item_id}] + db_1row item_info \ + "select item_title + from ims_cp_items + where ims_item_id = :item_id" - } - } - } - } - return $identifierref - } else { - return "" - } - - } + 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] -ad_proc -public set_ims_item_id { ims_it_id } { - - variable ims_item_id $ims_it_id -} + 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 -ad_proc -public get_ims_item_id { } { + # we use nsv variables to set the delivery environment this is a + # temporary solution until we find something a bit better - variable ims_item_id - return $ims_item_id - -} + if {[nsv_exists delivery_vars [ad_conn session_id]]} { + nsv_unset delivery_vars [ad_conn session_id] + } -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 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.live_revision=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') - and not exists (select 1 from lorsm_custom_pages - where page_id=cr.item_id and man_id=:man_id) - ORDER BY - i.sort_order, o.object_id, cr.tree_sortkey - } { - lappend item_list $ims_item_id - } - } - return $item_list -} + 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 -ad_proc -public record_view { item_id man_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 "" + } + } + } - set viewer_id [ad_conn user_id] - set views [views::record_view -object_id $item_id -viewer_id $viewer_id] + ad_proc -public init { + urlvar rootvar + {content_root ""} + {template_root ""} + {context "public"} + {rev_id ""} + {content_type ""} + } { - set revision_id [item::get_best_revision $item_id] + upvar $urlvar url $rootvar root_path - 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] + variable ims_item_id + variable revision_id - set url2 "[db_string select_folder_key {select key from fs_folders where folder_id = :folder_id}]/" + # if a .tcl file exists at this url, then don't do any queries + if { [file exists [ns_url2file "$url.tcl"]] } { + return 0 + } - 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 ""] + # 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_1row item_info "select item_title from ims_cp_items where ims_item_id = :item_id" + db_0or1row get_item_id "" + db_0or1row get_item_type "" + # No item found, so do not handle this request + if { ![exists_and_not_null item_id] } { + db_0or1row get_template_info "" -column_array item_info - set fs_item_id [fs::get_item_id -folder_id $folder_id -name $href] + if { ![info exists item_info] } { + ns_log warning "lorsm - init: no content found for url $url" + return 0 + } + } - # If no fs_item_id, this item is probably a folder - # Else deliver the page - if { ![empty_string_p $fs_item_id] } { + variable item_url + set item_url $url - 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 "" - } - } - -} + if { [empty_string_p $content_type] } { + set content_type $item_info(content_type) + } -ad_proc -public init { urlvar rootvar {content_root ""} {template_root ""} {context "public"} {rev_id ""} {content_type ""} } { + # ns_log debug "lorsm - init: urlvar rootvar rev_id item_id ims_item_id- $urlvar $rootvar $rev_id $item_id $ims_item_id" + # Make sure that a live revision exists + if { [empty_string_p $rev_id] } { + set live_revision [db_string get_live_revision "" -default ""] - upvar $urlvar url $rootvar root_path - - variable ims_item_id - variable revision_id - - # if a .tcl file exists at this url, then don't do any queries - if { [file exists [ns_url2file "$url.tcl"]] } { - return 0 - } - - # 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 + if { [template::util::is_nil live_revision] } { + ns_log warning "lorsm - init: no live revision found for content item $item_id" + return 0 + } + set revision_id $live_revision + } else { + set revision_id $rev_id + } - db_0or1row get_item_id "" - db_0or1row get_item_type "" - # No item found, so do not handle this request - if { ![exists_and_not_null item_id] } { + variable template_path - db_0or1row get_template_info "" -column_array item_info - - if { ![info exists item_info] } { - ns_log warning "lorsm - init: no content found for url $url" - return 0 - } - } - - variable item_url - set item_url $url + # Get the template + set template_found_p [db_0or1row get_template_url "" -column_array info] - if { [empty_string_p $content_type] } { - set content_type $item_info(content_type) - } - - # ns_log debug "lorsm - init: urlvar rootvar rev_id item_id ims_item_id- $urlvar $rootvar $rev_id $item_id $ims_item_id" - - # Make sure that a live revision exists - if { [empty_string_p $rev_id] } { - set live_revision [db_string get_live_revision "" -default ""] - if { [template::util::is_nil live_revision] } { - ns_log warning "lorsm - init: no live revision found for content item $item_id" - return 0 - } - set revision_id $live_revision - } else { - set revision_id $rev_id - } + if { !$template_found_p || [string equal $info(template_url) {}] } { + ns_log warning "lorsm - init: No template found to render content item $item_id in context '$context'" + return 0 + } - variable template_path - - # Get the template - set template_found_p [db_0or1row get_template_url "" -column_array info] - - if { !$template_found_p || [string equal $info(template_url) {}] } { - ns_log warning "lorsm - init: No template found to render content item $item_id in context '$context'" - return 0 - } - - set url $info(template_url) - set root_path [get_template_root] - - return 1 -} + set url $info(template_url) + set root_path [get_template_root] -ad_proc -public get_template_root {} { - - # Look for package-defined root - set package_id [ad_conn package_id] - set template_root \ - [ad_parameter -package_id $package_id TemplateRoot dummy ""] - - if { [empty_string_p $template_root] } { - # Look for template root defined in the CR - set package_id [apm_package_id_from_key "acs-content-repository"] - - set template_root [ad_parameter -package_id $package_id \ - TemplateRoot dummy "templates"] + return 1 } - - if { [string index $template_root 0] != "/" } { - # Relative path, prepend server_root - set template_root "[acs_root_dir]/$template_root" - } - return [ns_normalizepath $template_root] - -} + ad_proc -public get_template_root {} { + # Look for package-defined root + set package_id [ad_conn package_id] + set template_root [ad_parameter -package_id $package_id TemplateRoot dummy ""] -ad_proc -public get_content { { content_type {} } } { - - variable item_id - variable revision_id - variable ims_item_id - variable ims_item_title - + if { [empty_string_p $template_root] } { + # Look for template root defined in the CR + set package_id [apm_package_id_from_key "acs-content-repository"] + set template_root [ad_parameter -package_id $package_id TemplateRoot dummy "templates"] + } -set item_id $ims_item_id - if { [template::util::is_nil item_id] } { - ns_log warning "lorsm - get_content: No active item in lorsm - get_content" - return + if { [string index $template_root 0] != "/" } { + # Relative path, prepend server_root + set template_root "[acs_root_dir]/$template_root" + } + return [ns_normalizepath $template_root] } - ns_log notice "lorsm::get_content item_id $item_id" - # Get the live revision - set revision_id [db_string get_revision ""] - if { [template::util::is_nil revision_id] } { - ns_log warning "lorsm - get_content: No live revision for item $item_id" - return - } + ad_proc -public get_content { + { content_type {} } + } { + variable item_id + variable revision_id + variable ims_item_id + variable ims_item_title - # Get the mime type, decide if we want the text - set mime_type [db_string get_mime_type ""] - - if { [template::util::is_nil mime_type] } { - ns_log warning "lorsm - get_content: No such revision: $revision_id" - return - } + set item_id $ims_item_id + if { [template::util::is_nil item_id] } { + ns_log warning "lorsm - get_content: No active item in lorsm - get_content" + return + } - # Get the content type - if { [empty_string_p $content_type] } { - set content_type [db_string get_content_type ""] - } + ns_log notice "lorsm::get_content item_id $item_id" + # Get the live revision + set revision_id [db_string get_revision ""] - upvar content content + if { [template::util::is_nil revision_id] } { + ns_log warning "lorsm - get_content: No live revision for item $item_id" + return + } - array set content "item_id $item_id revision_id $revision_id mime_type $mime_type content_type $content_type" - -} + # Get the mime type, decide if we want the text + set mime_type [db_string get_mime_type ""] + if { [template::util::is_nil mime_type] } { + ns_log warning "lorsm - get_content: No such revision: $revision_id" + return + } + # Get the content type + if { [empty_string_p $content_type] } { + set content_type [db_string get_content_type ""] + } + + upvar content content + array set content "item_id $item_id + revision_id $revision_id + mime_type $mime_type + content_type $content_type" + } } 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 { select folder_id + from cr_folders + where label = 'LORSM Root Folder' } -default ""] +} -ad_proc -public lorsm::get_folder_id { + +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 { select folder_id + from cr_folders + where label = :name } -default ""] +} + ad_proc -public lorsm::get_items_indent { -org_id:required {-exclude {}} @@ -604,49 +585,63 @@ } { if {[info exists exclude] && [llength $exclude]} { - set exclude_where " and ims_cp_items.ims_item_id not in ([template::util::tcl_to_sql_list $exclude]) " + set exclude_where " and ims_cp_items.ims_item_id + not in ([template::util::tcl_to_sql_list $exclude]) " } else { - set exclude_where "" + set exclude_where "" } # 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, cr_items cr where ims_item_id = live_revision - and org_id = :org_id $exclude_where - "] - + set items_count [db_string get_items_count \ + "select count(ims_item_id) + from ims_cp_items, cr_items cr + where ims_item_id = live_revision + and org_id = :org_id $exclude_where"] + # Get the root items set count 0 set items_list [list] - foreach ims_item_id [db_list get_root_item "select ims_item_id from ims_cp_items where parent_item = :org_id and org_id = :org_id $exclude_where"] { - lappend items_list [list $ims_item_id 1] - set items_array($ims_item_id) 1 - incr count + foreach ims_item_id [db_list get_root_item \ + "select ims_item_id + from ims_cp_items + where parent_item = :org_id + and org_id = :org_id $exclude_where"] { + lappend items_list [list $ims_item_id 1] + set items_array($ims_item_id) 1 + incr count } + set i 0 # setup an array so we don't have to visit items twice # that could be expensive if the tree is long or deep. array set visited_items [list] while { $count < $items_count } { ns_log debug "lorsm::get_items_indent loop [incr i]" if {$i > 2} {break} - foreach item $items_list { - set item_id [lindex $item 0] + + foreach item $items_list { + set item_id [lindex $item 0] ns_log debug "lorsm::get_items_indent item_id $item_id [info exists visited_items($item_id)]" + if {![info exists visited_items($item_id)]} { - ns_log debug "lorsm::get_items_indent adding to array item_id $item_id" + ns_log debug "lorsm::get_items_indent adding to array item_id $item_id" set visited_items($item_id) $item_id set indent [expr [lindex $item 1] + 1] - foreach ims_item_id [db_list get_items "select ims_item_id from ims_cp_items where parent_item = :item_id and org_id = :org_id $exclude_where"] { + + foreach ims_item_id [db_list get_items \ + "select ims_item_id + from ims_cp_items + where parent_item = :item_id + and org_id = :org_id $exclude_where"] { 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 } } } - } + } # FIXME, basically this is a hack otherwise the while loop # will be infinite if parent_item is not set correctly in # ims_cp_items @@ -663,23 +658,22 @@ 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 man_id @param item_id - @return - - @error + @return + @error } { set base_url "" if {[exists_and_not_null community_id]} { @@ -689,6 +683,7 @@ return $url } + ad_proc -public lorsm::register_xml_object_id { {-xml_file:required} {-tmp_dir:required} @@ -703,56 +698,60 @@ # 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 { + 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'}] + set object_id [lorsm::import_imscp -upload_file $xml_file -tmp_dir $tmp_dir] # Restore the package_id ad_conn -set package_id $current_package_id - + return $object_id } # namespace eval lorsm::merge { # ad_proc -callback MergeShowUserInfo -impl lorsm { -# -user_id:required +# -user_id:required # } { -# Show lors items of one user +# Show lors items of one user # } { -# set msg "lors items" -# set result [list $msg] +# set msg "lors items" +# set result [list $msg] -# lappend result [list "Student tracks : [db_list sel_student_track { *SQL* }] " ] -# lappend result [list "Student bookmarks: [db_list sel_student_bookmark { *SQL* }] "] - -# return $result +# lappend result [list "Student tracks : [db_list sel_student_track { *SQL* }] " ] +# lappend result [list "Student bookmarks: [db_list sel_student_bookmark { *SQL* }] "] + +# return $result # } # ad_proc -callback MergePackageUser -impl lorsm { -# -from_user_id:required -# -to_user_id:required +# -from_user_id:required +# -to_user_id:required # } { -# Merge the lors items of two users. -# The from_user_id is the user that will be -# deleted and all the entries of this user -# will be mapped to the to_user_id. - +# Merge the lors items of two users. +# The from_user_id is the user that will be +# deleted and all the entries of this user +# will be mapped to the to_user_id. + # } { -# set msg "Merging lors" -# ns_log Notice $msg -# set result [list $msg] +# set msg "Merging lors" +# ns_log Notice $msg +# set result [list $msg] -# db_transaction { -# db_dml student_track { *SQL* } -# db_dml student_bookmark { *SQL* } -# } +# db_transaction { +# db_dml student_track { *SQL* } +# db_dml student_bookmark { *SQL* } +# } -# set result "lors merge is done" -# return $result +# set result "lors merge is done" +# return $result # } # } + ad_proc lorsm::set_custom_page { -man_id -item_id @@ -765,22 +764,37 @@ @item_id cr_items.item_id of the ims_cp_item page to use @type start or end for start or end page } { - if {![db_0or1row get_page "select 1 from lorsm_custom_pages where man_id=:man_id and type=:type"]} { - db_dml add_page "insert into lorsm_custom_pages (man_id,page_id,type) values (:man_id,:item_id,:type)" + if {![db_0or1row get_page \ + "select 1 + from lorsm_custom_pages + where man_id=:man_id + and type=:type"]} { + + db_dml add_page \ + "insert into lorsm_custom_pages (man_id,page_id,type) + values (:man_id,:item_id,:type)" + } else { - db_dml update_page "update lorsm_custom_pages -set man_id=:man_id, -page_id=:item_id, -type=:type" + db_dml update_page \ + "update lorsm_custom_pages + set man_id=:man_id, + page_id=:item_id, + type=:type" } } + ad_proc lorsm::get_custom_page_ims_item_id { -man_id -type } { Get the ims_item_id for a custom page if it exists or empty string if it does not } { - return [db_string get_custom_page "select live_revision from cr_items, lorsm_custom_pages where page_id=item_id and man_id=:man_id and type=:type" -default ""] + return [db_string get_custom_page \ + "select live_revision + from cr_items, lorsm_custom_pages + where page_id=item_id + and man_id=:man_id + and type=:type" -default ""] } Index: openacs-4/packages/lorsm/tcl/lorsm-sc-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/tcl/lorsm-sc-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/tcl/lorsm-sc-procs.tcl 30 May 2006 16:32:52 -0000 1.2 +++ openacs-4/packages/lorsm/tcl/lorsm-sc-procs.tcl 17 Nov 2008 13:36:43 -0000 1.3 @@ -22,34 +22,42 @@ returns the url for the lorsm man } { - # TODO find a better way to lookup the package_id to get the URL - set package_id [db_string package_id { - select context_id from acs_objects where object_id=(select context_id from acs_objects where object_id=:man_id) - }] - set url [apm_package_url_from_id $package_id] - return "${url}delivery-no-index/?man_id=$man_id" + # TODO find a better way to lookup the package_id to get the URL + set package_id [db_string package_id { + select context_id + from acs_objects + where object_id= + (select context_id + from acs_objects + where object_id=:man_id)}] + + set url [apm_package_url_from_id $package_id] + return "${url}delivery-no-index/?man_id=$man_id" } + ad_proc -private lorsm::sc::register_implementations {} { Register the ims_manifest_object content type fts contract } { lorsm::sc::register_fts_impl } + ad_proc -private lorsm::sc::unregister_implementations {} { - acs_sc::impl::delete -contract_name FtsContentProvider -impl_name ims_manifest_object + acs_sc::impl::delete \ + -contract_name FtsContentProvider \ + -impl_name ims_manifest_object } ad_proc -private lorsm::sc::register_fts_impl {} { - set spec { - name "ims_manifest_object" - aliases { - datasource lorsm::datasource - url lorsm::url - } + set spec \ + {name "ims_manifest_object" + aliases { + datasource lorsm::datasource + url lorsm::url + } contract_name FtsContentProvider owner lorsm } - acs_sc::impl::new_from_spec -spec $spec } 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.6 -r1.7 --- openacs-4/packages/lorsm/tcl/lorsm-tracking-procs.tcl 8 Oct 2008 13:01:05 -0000 1.6 +++ openacs-4/packages/lorsm/tcl/lorsm-tracking-procs.tcl 17 Nov 2008 13:36:43 -0000 1.7 @@ -1,9 +1,9 @@ # packages/lorsm/tcl/lorsm-tracking-procs.tcl ad_library { - - LORSM Student Tracking - + + LORSM Student Tracking + @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 2004-05-24 @arch-tag b8bbe245-6535-4ea9-a4a6-2be2d888b36d @@ -27,146 +27,153 @@ namespace eval lorsm::track { ad_proc -public new { - -user_id:required - -community_id:required - -course_id:required + -user_id:required + -community_id:required + -course_id:required } { - Tracks everytime a student gets deliver a course. - The aim of tracking is to see how many time a user has seen a - course as well as the time he/she has spent on it. - - @param user_id User ID - @param community_id Class or Club ID - @param course_id Course ID (Manifest ID) - @author Ernie Ghiglione (ErnieG@mm.st) - - } { + Tracks everytime a student gets deliver a course. + The aim of tracking is to see how many time a user has seen a + course as well as the time he/she has spent on it. - db_transaction { - set track_id [db_exec_plsql track_st_new { + @param user_id User ID + @param community_id Class or Club ID + @param course_id Course ID (Manifest ID) + @author Ernie Ghiglione (ErnieG@mm.st) - select lorsm_student_track__new ( - :user_id, - :community_id, - :course_id - ); + } { - } - ] - - } - return $track_id + db_transaction { + set track_id [db_exec_plsql track_st_new { + + select lorsm_student_track__new ( + :user_id, + :community_id, + :course_id + ); + }]} + return $track_id } + ad_proc -public exit { - -track_id:required + -track_id:required } { - Sets the time when the student leaves the delivery environment - - @param track_id Track ID given when the delivery session opened - @author Ernie Ghiglione (ErnieG@mm.st) - + Sets the time when the student leaves the delivery environment + + @param track_id Track ID given when the delivery session opened + @author Ernie Ghiglione (ErnieG@mm.st) + } { - - db_transaction { - set track_id [db_exec_plsql track_st_exit { - - select lorsm_student_track__exit ( - :track_id - ); - - } - ] - if {$track_id ne ""} { - db_0or1row get_track "select * from lorsm_student_track where track_id=:track_id" - if {[ad_conn -connected_p]} { - set package_id [ad_conn package_id] - } else { - set package_id "" - } - callback lorsm::track::update -course_id $course_id -user_id $user_id -package_id $package_id -credit $credit_earned -track_id $track_id -start_time $start_time -end_time $end_time -elapsed_time $elapsed_seconds - } - } - return $track_id + + db_transaction { + set track_id [db_exec_plsql track_st_exit { + + select lorsm_student_track__exit ( + :track_id + ); + + }] + + if {$track_id ne ""} { + db_0or1row get_track "select * from lorsm_student_track where track_id=:track_id" + if {[ad_conn -connected_p]} { + set package_id [ad_conn package_id] + } else { + set package_id "" + } + callback lorsm::track::update \ + -course_id $course_id \ + -user_id $user_id \ + -package_id $package_id \ + -credit $credit_earned \ + -track_id $track_id \ + -start_time $start_time \ + -end_time $end_time \ + -elapsed_time $elapsed_seconds + } + } + return $track_id } ad_proc -public istrackable { - -course_id:required - -package_id:required + -course_id:required + -package_id:required } { - Checks whether the instance of this course in the specified + Checks whether the instance of this course in the specified community is trackable. - - If it is, then it returns 1. Otherwise, 0. - - @param course_id Course ID (or manifest_id) - @param community_id Commuinity ID. - @author Ernie Ghiglione (ErnieG@mm.st) - + + If it is, then it returns 1. Otherwise, 0. + + @param course_id Course ID (or manifest_id) + @param community_id Commuinity ID. + @author Ernie Ghiglione (ErnieG@mm.st) + } { - - set istrackable [db_string trackable { - select istrackable from ims_cp_manifest_class - where man_id = :course_id and lorsm_instance_id = :package_id - }] - - if {$istrackable == "f"} { - return 0 - } else { - return 1 - } - + + set istrackable [db_string trackable {select istrackable + from ims_cp_manifest_class + where man_id = :course_id + and lorsm_instance_id = :package_id}] + + if {$istrackable == "f"} { + return 0 + } else { + return 1 + } } ad_proc -private update_elapsed_seconds { - -track_id + -track_id } { - - set last_item_viewed [db_string select_last_item_viewed { - select to_char(v.last_viewed,'YYYY-MM-DD HH24:MI:SS') as last_viewed - from views_views v, - ims_cp_items i, - ims_cp_organizations o, - lorsm_student_track t - where t.track_id = :track_id - and v.viewer_id = t.user_id - and v.object_id = i.ims_item_id - and i.org_id = o.org_id - and o.man_id = t.course_id - order by v.last_viewed desc - limit 1 - } -default ""] - if {$last_item_viewed ne ""} { - set current_seconds [clock seconds] - set last_seconds [clock scan $last_item_viewed] - set elapsed_seconds [expr {$current_seconds - $last_seconds}] - if {$elapsed_seconds > 600} { - set elapsed_seconds 600 - } - db_dml update_elapsed_seconds "update lorsm_student_track set elapsed_seconds = coalesce(elapsed_seconds,0) + :elapsed_seconds where track_id = :track_id" - } + + set last_item_viewed [db_string select_last_item_viewed { + select to_char(v.last_viewed,'YYYY-MM-DD HH24:MI:SS') as last_viewed + from views_views v, + ims_cp_items i, + ims_cp_organizations o, + lorsm_student_track t + where t.track_id = :track_id + and v.viewer_id = t.user_id + and v.object_id = i.ims_item_id + and i.org_id = o.org_id + and o.man_id = t.course_id + order by v.last_viewed desc + limit 1 } -default ""] + + if {$last_item_viewed ne ""} { + set current_seconds [clock seconds] + set last_seconds [clock scan $last_item_viewed] + set elapsed_seconds [expr {$current_seconds - $last_seconds}] + if {$elapsed_seconds > 600} { + set elapsed_seconds 600 + } + db_dml update_elapsed_seconds "update lorsm_student_track + set elapsed_seconds = coalesce(elapsed_seconds,0) + :elapsed_seconds + where track_id = :track_id" + } } + ad_proc -private get_track_id { - -user_id - -man_id - -community_id + -user_id + -man_id + -community_id } { - Get an existing tracking id from either a client property - or the database is a session has not been completed but - they have logged out or their session has expired. + Get an existing tracking id from either a client property + or the database is a session has not been completed but + they have logged out or their session has expired. } { - set track_id [ad_get_client_property lorsm studenttrack] - ns_log notice "lors::tack::get_track_id client_property '${track_id}'" - if {$track_id eq "" || $track_id eq "0"} { - set track_id [db_string get_track_id {} -default ""] - ns_log notice "lors::tack::get_track_id database '${track_id}'" - } - return $track_id + set track_id [ad_get_client_property lorsm studenttrack] + ns_log notice "lors::tack::get_track_id client_property '${track_id}'" + if {$track_id eq "" || $track_id eq "0"} { + set track_id [db_string get_track_id {} -default ""] + ns_log notice "lors::tack::get_track_id database '${track_id}'" + } + return $track_id } - } + ad_proc -callback lorsm::track::exit_course { -course_id -user_id @@ -177,6 +184,7 @@ Notify listeners that a user has exited a course } - + ad_proc -callback lorsm::track::update { -course_id -user_id @@ -185,10 +193,9 @@ -start_time -end_time -elapsed_time - -package_id + -package_id } { Notify listeners that someting interesting happeneed with this course tracking } - - \ 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 -r1.9 -r1.10 --- openacs-4/packages/lorsm/templates/lorsm-default.adp 17 Oct 2008 10:46:30 -0000 1.9 +++ openacs-4/packages/lorsm/templates/lorsm-default.adp 17 Nov 2008 13:36:43 -0000 1.10 @@ -1,51 +1,45 @@ - - - - - - + + + + + - - - + + + + - + + image + - image + + image + - - - image - +

Open Item@title;noquote@

+ @text;noquote@ -

Open Item@title;noquote@

- - - @text;noquote@ - + - - -
- - - Back to Parent - - +
+ + + Back to Parent + + Index: openacs-4/packages/lorsm/templates/lorsm-default.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/templates/lorsm-default.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/lorsm/templates/lorsm-default.tcl 13 Aug 2007 09:20:16 -0000 1.10 +++ openacs-4/packages/lorsm/templates/lorsm-default.tcl 17 Nov 2008 13:36:44 -0000 1.11 @@ -1,7 +1,7 @@ # this is only called for items with no content of their own. This # means we want to see whats inside this item. -set imsitem_id [lorsm::get_ims_item_id] +set imsitem_id [lorsm::get_ims_item_id] # We set all this blank variables in the case that the ims_item does # not have a resource id @@ -13,7 +13,7 @@ set community_url "" # There are pages that are not necesarily part of one ims_item_id -# but are part of a particular resource. +# but are part of a particular resource. if { [info exists content(item_id)] } { set write_p [fs::item_editable_p -item_id $content(item_id)] @@ -24,121 +24,118 @@ if {![empty_string_p $imsitem_id]} { set live_imsitem_id [content::item::get_live_revision -item_id $imsitem_id] - if {![empty_string_p $live_imsitem_id]} { - set imsitem_id $live_imsitem_id + if {![empty_string_p $live_imsitem_id]} { + set imsitem_id $live_imsitem_id } else { - ns_log warning "no live revision for item $imsitem_id" - } + ns_log warning "no live revision for item $imsitem_id" + } # See if they have write and the object is browser editable to offer an edit link. if { [info exists content(item_id)] } { - set write_p [permission::write_permission_p -object_id $imsitem_id] - if { $write_p } { - set write_p [fs::item_editable_p -item_id $content(item_id)] - } + set write_p [permission::write_permission_p -object_id $imsitem_id] + if { $write_p } { + set write_p [fs::item_editable_p -item_id $content(item_id)] + } } else { - # No content to edit - set write_p 0 + # No content to edit + set write_p 0 } set package_id [ad_conn package_id] set package_url [apm_package_url_from_id $package_id] - set man_id [db_string get_man_id "select man_id from ims_cp_items i, ims_cp_organizations o where i.ims_item_id = :imsitem_id and i.org_id = o.org_id"] + set man_id [db_string get_man_id "select man_id + from ims_cp_items i, ims_cp_organizations o + where i.ims_item_id = :imsitem_id and i.org_id = o.org_id"] - set folder_id [db_string get_folder__id "select folder_id from ims_cp_manifests where man_id = :man_id"] + set folder_id [db_string get_folder__id "select folder_id + from ims_cp_manifests + where man_id = :man_id"] # We display children - db_1row item_info "select item_title, parent_item from ims_cp_items where ims_item_id = :imsitem_id" + db_1row item_info "select item_title, parent_item + from ims_cp_items + where ims_item_id = :imsitem_id" # Selected fields are renamed to avoid conflict with existing variables db_multirow -extend {href} children children { - select - ims_cp_items.ims_item_id as child_item_id, - ims_cp_items.item_title as child_title - from - acs_objects, - ims_cp_items - where - acs_objects.object_id = ims_cp_items.ims_item_id and - parent_item = :imsitem_id - order by - acs_objects.object_id, - acs_objects.tree_sortkey + select ims_cp_items.ims_item_id as child_item_id, + ims_cp_items.item_title as child_title + from acs_objects, ims_cp_items + where acs_objects.object_id = ims_cp_items.ims_item_id + and parent_item = :imsitem_id + order by acs_objects.object_id, acs_objects.tree_sortkey } { - - # Let record-view display the page - set href ${package_url}delivery/record-view - set href "[export_vars -base $href \ - -url {man_id}]&item_id=$child_item_id" - + # Let record-view display the page + set href ${package_url}delivery/record-view + set href "[export_vars \ + -base $href \ + -url {man_id}]&item_id=$child_item_id" } # See if this item only has one child, if so, load that instead - if { [template::multirow size children] == 1 && - [db_string grandchildren " - select count(*) - from ims_cp_items - where parent_item = [template::multirow get children 1 child_item_id] - "] == 0 } { - set href ${package_url}delivery/record-view - set href "[export_vars -base $href \ - -url {man_id}]&item_id=[template::multirow get children 1 child_item_id]" - ad_returnredirect $href - ad_script_abort + if { [template::multirow size children] == 1 && [db_string grandchildren " + select count(*) + from ims_cp_items + where parent_item = [template::multirow get children 1 child_item_id]"] == 0 } { + + set href ${package_url}delivery/record-view + set href "[export_vars \ + -base $href \ + -url {man_id}]&item_id= \ + [template::multirow get children 1 child_item_id]" + ad_returnredirect $href + ad_script_abort } if { [exists_and_not_null parent_item] } { - # See if the parent has a resource mapped, if none, then this is a - # top leve item, send it to the welcome page + # See if the parent has a resource mapped, if none, then this is a + # top leve item, send it to the welcome page - # Also, see if item is a lone leaf node, if so, the parent was - # probably skipped and the grandparent link should be used - # instead + # Also, see if item is a lone leaf node, if so, the parent was + # probably skipped and the grandparent link should be used + # instead - # See if I'm a leaf node first - if { [template::multirow size children] == 0 } { - # Now see if I'm a lone leaf node - if { [db_string siblings { - select count(*) - from ims_cp_items - where parent_item = :parent_item}] == 1 } { - # I'm a lone leaf, go to grandparent if it exists - # Join to resources just to make sure it exists and - # get href while we're at it, might be useful - db_0or1row grandparent { - select - ims_cp_items.parent_item as grandparent_item, - ims_cp_resources.href as grandparent_href - from - ims_cp_items, - ims_cp_resources, - ims_cp_items_to_resources - where - ims_cp_items.ims_item_id = :parent_item and - ims_cp_items.parent_item = ims_cp_items_to_resources.ims_item_id and - ims_cp_items_to_resources.res_id = ims_cp_resources.res_id - } - } - } + # See if I'm a leaf node first + if { [template::multirow size children] == 0 } { + # Now see if I'm a lone leaf node + if { [db_string siblings { + select count(*) + from ims_cp_items + where parent_item = :parent_item}] == 1 } { + # I'm a lone leaf, go to grandparent if it exists + # Join to resources just to make sure it exists and + # get href while we're at it, might be useful + db_0or1row grandparent { + select ims_cp_items.parent_item as grandparent_item, + ims_cp_resources.href as grandparent_href + from ims_cp_items, ims_cp_resources, ims_cp_items_to_resources + where ims_cp_items.ims_item_id = :parent_item + and ims_cp_items.parent_item = ims_cp_items_to_resources.ims_item_id + and ims_cp_items_to_resources.res_id = ims_cp_resources.res_id + } + } + } - if { [db_0or1row href "select href as parent_href from ims_cp_resources r, ims_cp_items_to_resources ir where ir.ims_item_id = :parent_item and ir.res_id = r.res_id"] || [info exists grandparent_item] } { - # Let record-view render this page so the child items are - # shown - set parent_href ${package_url}delivery/record-view - set parent_href "[export_vars -base $parent_href {man_id}]&item_id=[expr {"[info exists grandparent_item]"?$grandparent_item:$parent_item}]" - } else { - # Go to the welcome page - set parent_href [export_vars \ - -base ${package_url}delivery/body \ - -url {man_id} - ] - } + if { [db_0or1row href "select href as parent_href from ims_cp_resources r, ims_cp_items_to_resources ir where ir.ims_item_id = :parent_item and ir.res_id = r.res_id"] || [info exists grandparent_item] } { + # Let record-view render this page so the child items are + # shown + set parent_href ${package_url}delivery/record-view + set parent_href \ + "[export_vars -base $parent_href {man_id}]&item_id=\ + [expr {"[info exists grandparent_item]"?\ + $grandparent_item:$parent_item}]" + } else { + # Go to the welcome page + set parent_href [export_vars \ + -base ${package_url}delivery/body \ + -url {man_id}] + } } ns_log Notice "Content root on lors-default.tcl: ims_item_id $imsitem_id --" set ims_id $imsitem_id set return_url "[export_vars -base ${package_url}delivery/ {man_id ims_id}]" set return_url "[export_vars -url {return_url}]" -} +} -ad_return_template \ No newline at end of file +ad_return_template Index: openacs-4/packages/lorsm/templates/lorsm-no-index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/templates/lorsm-no-index.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/lorsm/templates/lorsm-no-index.tcl 16 Jan 2008 16:54:45 -0000 1.6 +++ openacs-4/packages/lorsm/templates/lorsm-no-index.tcl 17 Nov 2008 13:36:44 -0000 1.7 @@ -6,93 +6,90 @@ if { [info exists content(item_id)] } { if { ![string equal -length 4 "text" $content(mime_type)] } { - # It's a file. - cr_write_content -revision_id $content(revision_id) - ad_script_abort - } elseif { [string equal "text/css" $content(mime_type)] || [string equal "text/xml" $content(mime_type) ]} { - # we treat CSS files as if they would be binaries and deliver - # them straight to the browser (maybe we should do the same - # thing for XML files (?) - cr_write_content -revision_id $content(revision_id) - ad_script_abort + # It's a file. + cr_write_content -revision_id $content(revision_id) + ad_script_abort + } elseif { [string equal "text/css" $content(mime_type)] || \ + [string equal "text/xml" $content(mime_type) ]} { + # we treat CSS files as if they would be binaries and deliver + # them straight to the browser (maybe we should do the same + # thing for XML files (?) + cr_write_content -revision_id $content(revision_id) + ad_script_abort } - + # Ordinary text/* mime type. template::util::array_to_vars content - + set text [cr_write_content -string -revision_id $revision_id] - - if { ![string equal "text/html" $content(mime_type)] || ![string equal "text/xml" $content(mime_type)]} { - set text [ad_html_text_convert -from $mime_type -to text/html $text] + if { ![string equal "text/html" $content(mime_type)] || \ + ![string equal "text/xml" $content(mime_type)]} { + set text [ad_html_text_convert -from $mime_type -to text/html $text] } } -if { [string eq $content(mime_type) "text/html"] && [regexp -nocase {} $text match] } { - - if { [db_0or1row get_imsitem_id { - select map.item_id as viewed_item_id, o.man_id - from ims_cp_items_to_resources map, ims_cp_files f, ims_cp_organizations o, ims_cp_items i - where f.file_id = :item_id - and f.res_id = map.res_id - and map.item_id = i.item_id - and i.org_id = o.org_id - }] } { - # record view - set item_list [lorsm::get_item_list $man_id $user_id] - set litem_list [llength $item_list] +if { [string eq $content(mime_type) "text/html"] && \ + [regexp -nocase {} $text match] } { - if { ![expr $litem_list - [lsearch -exact $item_list $viewed_item_id] -1] } { - # last item, it's a special case - set last_item_viewed [db_string select_last_item_viewed { - select item_id - from views_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 - } -default "no item"] - if { !([lsearch -exact [lrange $item_list [expr $litem_list - 2] $litem_list] $last_item_viewed] != -1) && ![string eq $last_item_viewed "no item"] } { - set viewed_item_id [lindex $item_list [expr [lsearch -exact $item_list $viewed_item_id] - 1]] - } - } else { - set viewed_item_id [lindex $item_list [expr [lsearch -exact $item_list $viewed_item_id] - 1]] - } - if { [lsearch -exact $item_list $viewed_item_id] >= 0 } { - lorsm::record_view $viewed_item_id $man_id - } + if { [db_0or1row get_imsitem_id { + select map.item_id as viewed_item_id, o.man_id + from ims_cp_items_to_resources map, ims_cp_files f, ims_cp_organizations o, ims_cp_items i + where f.file_id = :item_id + and f.res_id = map.res_id + and map.item_id = i.item_id + and i.org_id = o.org_id}] } { + # record view + set item_list [lorsm::get_item_list $man_id $user_id] + set litem_list [llength $item_list] - # Student tracking - set package_id [ad_conn package_id] - set community_id [dotlrn_community::get_community_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] - lorsm::track::exit -track_id $track_id - } + if { ![expr $litem_list - [lsearch -exact $item_list $viewed_item_id] -1] } { + # last item, it's a special case + set last_item_viewed [db_string select_last_item_viewed { + select item_id + from views_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 } -default "no item"] + if { !([lsearch -exact [lrange $item_list [expr $litem_list - 2] $litem_list] $last_item_viewed] != -1) && ![string eq $last_item_viewed "no item"] } { + set viewed_item_id [lindex $item_list [expr [lsearch -exact $item_list $viewed_item_id] - 1]] + } + } else { + set viewed_item_id [lindex $item_list [expr [lsearch -exact $item_list $viewed_item_id] - 1]] + } - # refresh the page every 300 seconds so we can have an estimate of the time when the user viewed the course for the last time - if { ![regsub -nocase {<\/head>} $text { - - - } text] } { - regsub -nocase {} $text { - - - - - } text - } - } + if { [lsearch -exact $item_list $viewed_item_id] >= 0 } { + lorsm::record_view $viewed_item_id $man_id + } + # Student tracking + set package_id [ad_conn package_id] + set community_id [dotlrn_community::get_community_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] + lorsm::track::exit -track_id $track_id + } + + # refresh the page every 300 seconds so we can have an estimate of the time when the user viewed the course for the last time + if { ![regsub -nocase {<\/head>} $text { + + + } text] } { + regsub -nocase {} $text { + + + + + } text + } + } } ad_return_template Index: openacs-4/packages/lorsm/www/edit-content.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/edit-content.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/edit-content.tcl 17 May 2005 17:03:40 -0000 1.3 +++ openacs-4/packages/lorsm/www/edit-content.tcl 17 Nov 2008 13:36:44 -0000 1.4 @@ -1,7 +1,7 @@ # packages/lorsm/www/edit-content.tcl ad_page_contract { - + Online content editor for LORSm Uses htmlarea to edit html/txt file-storage @@ -23,8 +23,13 @@ set user_id [ad_conn user_id] -set folder [db_string select_folder_key {select key from fs_folders where folder_id = :folder_id}] -set fs_root_folder [db_string sql {select file_storage__get_root_folder(:fs_package_id)}] +set folder [db_string select_folder_key {select key + from fs_folders + where folder_id = :folder_id}] + +set fs_root_folder [db_string sql {select + file_storage__get_root_folder(:fs_package_id)}] + set identifierref [lorsm::fix_url -url $identifierref] set pather $folder/$identifierref @@ -33,12 +38,16 @@ # get rid of it regsub -all {//} $pather {/} pather -set file_id [content::item::get_id -item_path $pather -root_folder_id $fs_root_folder] +set file_id [content::item::get_id \ + -item_path $pather \ + -root_folder_id $fs_root_folder] # check for permissions # By default, only the creator has admin access to content -permission::require_write_permission -object_id $file_id -creation_user $user_id +permission::require_write_permission \ + -object_id $file_id \ + -creation_user $user_id #ns_write "[_ lorsm.lt_folder_foldern_pather]" #ad_script_abort Index: openacs-4/packages/lorsm/www/admin/course-add-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/course-add-2.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/course-add-2.adp 17 Oct 2008 10:46:30 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/course-add-2.adp 17 Nov 2008 13:36:44 -0000 1.3 @@ -6,27 +6,36 @@ -

#lorsm.lt_The_uploaded_file_is_# #lorsm.lt_SCORM_complaint_packa#

+

+ #lorsm.lt_The_uploaded_file_is_# + #lorsm.lt_SCORM_complaint_packa# +

-

#lorsm.SCORM_Package_Info#

- +

#lorsm.SCORM_Package_Info#

+
-

#lorsm.IMS_Package_Info#

- -

#lorsm.lt_The_uploaded_file_is_# #lorsm.lt_Blackboard_6_complain#.

-
+

#lorsm.IMS_Package_Info#

+ +

+ #lorsm.lt_The_uploaded_file_is_# + #lorsm.lt_Blackboard_6_complain#. +

+
- - +
-

#lorsm.Note##lorsm._the_package_has# #lorsm.not_yet# #lorsm.lt_being_added_to_the_Le#

+

+ #lorsm.Note# + #lorsm._the_package_has# + #lorsm.not_yet# + #lorsm.lt_being_added_to_the_Le# +

- Index: openacs-4/packages/lorsm/www/admin/course-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/course-add-2.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/course-add-2.tcl 13 Aug 2007 09:20:16 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/course-add-2.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -21,7 +21,9 @@ } -validate { non_empty -requires {upload_file.tmpfile:notnull} { - if {![empty_string_p $upload_file] && (![file exists ${upload_file.tmpfile}] || [file size ${upload_file.tmpfile}] < 4)} { + if {![empty_string_p $upload_file] && \ + (![file exists ${upload_file.tmpfile}] || \ + [file size ${upload_file.tmpfile}] < 4)} { ad_complain "[_ lorsm.lt_The_upload_failed_or_]" } } @@ -36,30 +38,34 @@ # unzips the file if { ![empty_string_p $upload_file] && - [ catch {set tmp_dir [lors::imscp::expand_file $upload_file ${upload_file.tmpfile} lors-imscp-$course_id] } errMsg] } { + [ catch {set tmp_dir [lors::imscp::expand_file \ + $upload_file \ + ${upload_file.tmpfile} \ + lors-imscp-$course_id] } errMsg ] } { ad_return_complaint 1 "[_ lorsm.lt_The_uploaded_file_doe]" ad_script_abort } # if it is not blank... if {![empty_string_p $upload_file]} { - ns_log Debug "LORS Package: made directory $tmp_dir to extract from ${upload_file.tmpfile} ($upload_file)\n" - #checks for nested imsmanifest.xml and sets root there - while { [llength [glob -nocomplain [file join $tmp_dir *]]] == 1 } { - set tmp_dir [lindex [glob -nocomplain [file join $tmp_dir *]] 0] - set allfiles [lors::imscp::dir_walk $tmp_dir] - } + ns_log Debug "LORS Package: made directory $tmp_dir to extract + from ${upload_file.tmpfile} ($upload_file)\n" + #checks for nested imsmanifest.xml and sets root there + while { [llength [glob -nocomplain [file join $tmp_dir *]]] == 1 } { + set tmp_dir [lindex [glob -nocomplain [file join $tmp_dir *]] 0] + set allfiles [lors::imscp::dir_walk $tmp_dir] + } } else { set allfiles [lors::imscp::dir_walk $directory] } #unusefully duplicates, leaving unzips around # unzips the file -#if { ![empty_string_p $upload_file] && +#if { ![empty_string_p $upload_file] && # [ catch {set tmp_dir [lors::imscp::expand_file $upload_file ${upload_file.tmpfile} lors-imscp-$course_id] } errMsg] } { # ad_return_complaint 1 "[_ lorsm.lt_The_uploaded_file_doe]" # ad_script_abort -#} +#} # search for manifest file set file imsmanifest.xml @@ -81,7 +87,6 @@ ns_log Notice "Generating MD record from Blackboard6 package $tmp_dir --" lors::imscp::bb6::create_MD -tmp_dir $tmp_dir -file $file ns_log Notice "Done!" - } ## adds folder to the CR @@ -109,11 +114,13 @@ -elements { col1 { label "" - html {valign top style "background-color: #e0e0e0; font-weight: bold;"} - } - col2 { + html {valign top style "background-color: #e0e0e0; + font-weight: bold;"} + + } col2 { label "" - html {valign top style "background-color: #f0f0f0; font-weight: bold;"} + html {valign top style "background-color: #f0f0f0; + font-weight: bold;"} } } @@ -128,16 +135,16 @@ organizations { label "[_ lorsm.Organizations]" html {valign top align center} - } - items { + + } items { label "[_ lorsm.Items]" html {valign top align center} - } - resources { + + } resources { label "[_ lorsm.Resources]" html {valign top align center} - } - files { + + } files { label "[_ lorsm.Files]" html {valign top align center} } @@ -153,16 +160,16 @@ scos { label "[_ lorsm.SCOs]" html {valign top} - } - assets { + + } assets { label "[_ lorsm.Assets]" html {valign top} - } - sharableresources { + + } sharableresources { label "[_ lorsm.Sharable_Resources]" html {valign top} - } - files { + + } files { label "[_ lorsm.files]" html {valign top} } @@ -187,73 +194,102 @@ if { ![empty_string_p $metadata] } { - # gets metadataschema - set MetadataSchema [lindex [lindex [lors::imsmd::getMDSchema $metadata] 0] 0] - set MetadataSchemaVersion [lindex [lors::imsmd::getMDSchema $metadata] 1] + # gets metadataschema + set MetadataSchema [lindex \ + [lindex [lors::imsmd::getMDSchema $metadata] 0] 0] + + set MetadataSchemaVersion [lindex [lors::imsmd::getMDSchema $metadata] 1] set lom [lindex [lors::imsmd::getLOM $metadata $tmp_dir] 0] set prefix [lindex [lors::imsmd::getLOM $metadata $tmp_dir] 1] if { $lom != 0 } { # Get title - set manifest_title_lang [lindex [lindex [lors::imsmd::mdGeneral -element title -node $lom -prefix $prefix] 0] 0] - set manifest_title [lindex [lindex [lors::imsmd::mdGeneral -element title -node $lom -prefix $prefix] 0] 1] + set manifest_title_lang [lindex \ + [lindex [lors::imsmd::mdGeneral \ + -element title \ + -node $lom \ + -prefix $prefix] 0] 0] + + set manifest_title [lindex \ + [lindex [lors::imsmd::mdGeneral \ + -element title \ + -node $lom \ + -prefix $prefix] 0] 1] # set context set context "[_ lorsm.lt_Importing_manifest_ti]" ## Gets manifest description - - set manifest_descrip_lang [lindex [lindex [lors::imsmd::mdGeneral -element description -node $lom -prefix $prefix] 0] 0] - set manifest_descrip [lindex [lindex [lors::imsmd::mdGeneral -element description -node $lom -prefix $prefix] 0] 1] + set manifest_descrip_lang [lindex \ + [lindex [lors::imsmd::mdGeneral \ + -element description \ + -node $lom \ + -prefix $prefix] 0] 0] + + set manifest_descrip [lindex \ + [lindex [lors::imsmd::mdGeneral \ + -element description \ + -node $lom \ + -prefix $prefix] 0] 1] + # adds course information for display - multirow append d_info "Manifest Title: " "\[$manifest_title_lang\] $manifest_title " - multirow append d_info "Metadata Type: " [concat $MetadataSchema $MetadataSchemaVersion] + multirow append d_info "Manifest Title: " "\[$manifest_title_lang\] + $manifest_title " + multirow append d_info "Metadata Type: " \ + [concat $MetadataSchema $MetadataSchemaVersion] if {![empty_string_p $manifest_descrip]} { - multirow append d_info "Description: " "\[$manifest_descrip_lang\] $manifest_descrip" + multirow append d_info "Description: " "\[$manifest_descrip_lang\] + $manifest_descrip" } # Gets Rights info - set copyright [lors::imsmd::mdRights -element copyrightandotherrestrictions -node $lom -prefix $prefix] + set copyright [lors::imsmd::mdRights \ + -element copyrightandotherrestrictions \ + -node $lom \ + -prefix $prefix] + if { $copyright != 0 } { set copyright_s [lindex [lindex [lindex $copyright 0] 0] 1] set copyright_v [lindex [lindex [lindex $copyright 0] 1] 1] - set cr_descrip [lors::imsmd::mdRights -element description -node $lom -prefix $prefix] + set cr_descrip [lors::imsmd::mdRights \ + -element description \ + -node $lom \ + -prefix $prefix] + set cr_descrip_s [lindex [lindex $cr_descrip 0] 1] - multirow append d_info "Copyrighted?: " "\[$copyright_s\] $copyright_v" - multirow append d_info "Copyrighted Description: " "$cr_descrip_s" + multirow append d_info "Copyrighted?: " "\[$copyright_s\] + $copyright_v" + multirow append d_info "Copyrighted Description: " \ + "$cr_descrip_s" } else { - multirow append d_info "Copyrighted?: " "Information not available" + multirow append d_info "Copyrighted?: " \ + "Information not available" } + } else { - # Didn't find LOM although it did find the Metadata schema and - # version - regexp {([^/\\]+)$} $tmp_dir match manifest_title - set context "[_ lorsm.lt_Importing_No_Metadata]" - } + # Didn't find LOM although it did find the Metadata schema and + # version + regexp {([^/\\]+)$} $tmp_dir match manifest_title + set context "[_ lorsm.lt_Importing_No_Metadata]" + } + } else { - # manifest title doesn't exist, so we create one for it. - regexp {([^/\\]+)$} $tmp_dir match manifest_title + # manifest title doesn't exist, so we create one for it. + regexp {([^/\\]+)$} $tmp_dir match manifest_title set context "[_ lorsm.lt_Importing_No_Metadata]" } # Gets the organizations - set organizations [$manifest child all organizations] - if { ![empty_string_p $organizations] } { - - set num_organizations [$organizations child all organization] - - multirow append d_info "Number of Organizations: " [llength $num_organizations] - + set num_organizations [$organizations child all organization] + multirow append d_info "Number of Organizations: " \ + [llength $num_organizations] set items 0 - foreach organization $num_organizations { - set items [expr $items + [lors::imscp::countItems $organization]] - } multirow append d_info "Number of Items: " $items } @@ -263,108 +299,130 @@ # Complain if there's no resources if {[empty_string_p $resources]} { - ad_return_complaint 1 "[_ lorsm.lt_The_package_you_are_t_1]" - ad_script_abort - } + ad_return_complaint 1 "[_ lorsm.lt_The_package_you_are_t_1]" + ad_script_abort + } set resourcex [$resources child all resource] if { $isSCORM == 1 } { - # The imsmanifest.xml file contains a SCORM course - + # The imsmanifest.xml file contains a SCORM course # extract all the resources and files set scos 0 set assets 0 set sharableresources 0 set files 0 - + if { ![empty_string_p $resources] } { - foreach resourcex [$resources child all resource] { - # gets the type of resource - set resource_scormtype [string tolower [lors::imsmd::getAtt $resourcex adlcp:scormtype]] + set resource_scormtype [string tolower \ + [lors::imsmd::getAtt $resourcex adlcp:scormtype]] switch $resource_scormtype { sco { incr scos - } - asset { + + } asset { incr assets - } - sharableresource { + + } sharableresource { incr sharableresources } } - - set files [expr $files + [llength [lors::imsmd::getResource -node $resourcex -att files]]] - + set files [expr $files + [llength [lors::imsmd::getResource \ + -node $resourcex \ + -att files]]] } } - multirow append d_SCORM_package_info $scos $assets $sharableresources $files + multirow append d_SCORM_package_info $scos $assets \ + $sharableresources $files - - # end isSCORM if } else { # The imsmanifest.xml file corresponds to a IMS CP (but not SCORM) set files 0 if { ![empty_string_p $resourcex] } { - foreach resource $resourcex { - set files [expr $files + [llength [lors::imsmd::getResource -node $resource -att files]]] + set files [expr $files + [llength [lors::imsmd::getResource \ + -node $resource \ + -att files]]] } } - multirow append d_IMS_package_info [llength $num_organizations] $items [llength $resourcex] $files - + multirow append d_IMS_package_info [llength $num_organizations] \ + $items [llength $resourcex] $files } - } else { # Error MSG here ad_return_complaint 1 "[_ lorsm.lt_There_has_been_a_prob]" ad_script_abort } -template::form create course_upload -action course-add-3 \ - -display_buttons { {"[_ lorsm.Upload_Course]" upload_course} } \ +template::form create course_upload \ + -action course-add-3 \ + -display_buttons { {"[_ lorsm.Upload_Course]" upload_course} } \ -html {enctype multipart/form-data} \ -mode edit \ - -cancel_url "[_ lorsm.index]" + -cancel_url "[_ lorsm.index]" +template::element create course_upload course_name \ + -label "[_ lorsm.Course_Name]" \ + -datatype text \ + -widget text \ + -help_text "[_ lorsm.lt_This_is_the_name_the_]" \ + -maxlength 200 -template::element create course_upload course_name \ - -label "[_ lorsm.Course_Name]" -datatype text -widget text -help_text "[_ lorsm.lt_This_is_the_name_the_]" \ - -maxlength 200 +template::element create course_upload format_id \ + -label "[_ lorsm.lt_Course_Presentation_S]" \ + -datatype text \ + -widget select \ + -options [db_list_of_lists select_formats_for_select_widget { + select format_pretty_name, + format_id + from lorsm_course_presentation_formats + order by format_pretty_name}] \ + -help_text "[_ lorsm.lt_Use_the_Classic_Style]" \ + -value [db_string default_format { + select format_id + from lorsm_course_presentation_formats + where format_name = 'default'}] -template::element create course_upload format_id \ - -label "[_ lorsm.lt_Course_Presentation_S]" -datatype text -widget select -options [db_list_of_lists select_formats_for_select_widget {select format_pretty_name, - format_id - from lorsm_course_presentation_formats - order by format_pretty_name}] \ - -help_text "[_ lorsm.lt_Use_the_Classic_Style]" -value [db_string default_format {select format_id from lorsm_course_presentation_formats where format_name = 'default'}] +template::element create course_upload course_id \ + -label "[_ lorsm.course_id]" \ + -datatype integer \ + -widget hidden -template::element create course_upload course_id \ - -label "[_ lorsm.course_id]" -datatype integer -widget hidden +template::element create course_upload indb_p \ + -label "[_ lorsm.indb_p]" \ + -datatype integer \ + -widget hidden -template::element create course_upload indb_p \ - -label "[_ lorsm.indb_p]" -datatype integer -widget hidden +template::element create course_upload tmp_dir \ + -label "[_ lorsm.tmp_dir]" \ + -datatype text \ + -widget hidden \ + -optional -template::element create course_upload tmp_dir \ - -label "[_ lorsm.tmp_dir]" -datatype text -widget hidden -optional +template::element create course_upload folder_id \ + -label "[_ lorsm.folder_id]" \ + -datatype integer \ + -widget hidden -template::element create course_upload folder_id \ - -label "[_ lorsm.folder_id]" -datatype integer -widget hidden +template::element create course_upload isSCORM \ + -label "[_ lorsm.isSCORM]" \ + -datatype integer \ + -widget hidden \ + -optional -template::element create course_upload isSCORM \ - -label "[_ lorsm.isSCORM]" -datatype integer -widget hidden -optional +template::element create course_upload fs_package_id \ + -label "[_ lorsm.fs_package_id]" \ + -datatype integer \ + -widget hidden -template::element create course_upload fs_package_id \ - -label "[_ lorsm.fs_package_id]" -datatype integer -widget hidden - template::element set_properties course_upload course_name -value $manifest_title template::element set_properties course_upload course_id -value $course_id @@ -377,10 +435,5 @@ template::element set_properties course_upload isSCORM -value $isSCORM -template::element set_properties course_upload fs_package_id -value $fs_package_id - - - - - - +template::element set_properties course_upload fs_package_id \ + -value $fs_package_id Index: openacs-4/packages/lorsm/www/admin/course-add-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/course-add-3.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/lorsm/www/admin/course-add-3.tcl 17 Oct 2008 10:46:31 -0000 1.9 +++ openacs-4/packages/lorsm/www/admin/course-add-3.tcl 17 Nov 2008 13:36:44 -0000 1.10 @@ -22,7 +22,9 @@ } -validate { non_empty -requires {upload_file.tmpfile:notnull} { - if {![empty_string_p $upload_file] && (![file exists ${upload_file.tmpfile}] || [file size ${upload_file.tmpfile}] < 4)} { + if {![empty_string_p $upload_file] && \ + (![file exists ${upload_file.tmpfile}] || \ + [file size ${upload_file.tmpfile}] < 4)} { ad_complain "[_ lorsm.lt_The_upload_failed_or_]" } } @@ -48,22 +50,25 @@ set isBB [lors::imscp::bb6::isBlackboard6 -tmp_dir $tmp_dir] if {$isBB == 1} { - ns_write "

[_ lorsm.lt_Blackboard6_Content_P].
[_ lorsm.lt_Modifying_package_to_]

" + ns_write \ + "

+ + [_ lorsm.lt_Blackboard6_Content_P] + .
+ [_ lorsm.lt_Modifying_package_to_] +

" + ns_write "
[_ lorsm.lt_Cleaning_up_unused_ap]" lors::imscp::bb6::clean_items -tmp_dir $tmp_dir -file "imsmanifest.xml" ns_write "[_ lorsm.Done]" ns_write "
[_ lorsm.lt_Renaming_content_type]" lors::imscp::bb6::extract_html -tmp_dir $tmp_dir -file "imsmanifest.xml" - ns_write "[_ lorsm.Done]" - + ns_write "[_ lorsm.Done]" } - ns_write "

[_ lorsm.lt_Starting_File_Process]

" - db_transaction { - ## adds folder to the CR set parent_id $folder_id set fs_dir $tmp_dir @@ -80,73 +85,112 @@ # now that exists, let's create it on the CR # gets rid of the path and leaves the name of the directory - # if course_name is changed, then use that name. Otherwise it will use the default folder name given + # if course_name is changed, then use that name. Otherwise it will use the default folder name given if {![empty_string_p $course_name]} { regexp {([^/\\]+)$} $course_name match cr_dir } else { regexp {([^/\\]+)$} $fs_dir match cr_dir + } + # We need to separate folders (since now all are cr_items) one for the files (content) and the other + # one for the created cr_items + + if { [ catch {set new_parent_id [lors::cr::add_folder \ + -parent_id $parent_id \ + -folder_name $cr_dir]} errMsg] } { + ns_write "

Unfortunately the same context contains a course with + same exact name. hit back and change name.

" + ad_script_abort } - # We need to separate folders (since now all are cr_items) one for the files (content) and the other - # one for the created cr_items - - if { [ catch {set new_parent_id [lors::cr::add_folder -parent_id $parent_id -folder_name $cr_dir]} errMsg] } { - ns_write "

Unfortunately the same context contains a course with same exact name. hit back and change name.

" - ad_script_abort - } - - set new_items_parent_id [lors::cr::add_folder -parent_id $parent_id -folder_name "${cr_dir}_items"] + set new_items_parent_id [lors::cr::add_folder \ + -parent_id $parent_id \ + -folder_name "${cr_dir}_items"] - # PERMISSIONS FOR FILE-STORAGE + # PERMISSIONS FOR FILE-STORAGE # Before we go about anything else, lets just set permissions straight. - # Disable folder permissions inheritance - permission::toggle_inherit -object_id $new_parent_id - permission::toggle_inherit -object_id $new_items_parent_id + # Disable folder permissions inheritance + permission::toggle_inherit -object_id $new_parent_id + permission::toggle_inherit -object_id $new_items_parent_id - # Set read permissions for community/class dotlrn_member_rel + # Set read permissions for community/class dotlrn_member_rel - set community_id [dotlrn_community::get_community_id] + set community_id [dotlrn_community::get_community_id] + set party_id_member [db_string party_id {select segment_id \ + from rel_segments \ + where group_id = :community_id \ + and rel_type = 'dotlrn_member_rel'}] - set party_id_member [db_string party_id {select segment_id from rel_segments \ - where group_id = :community_id \ - and rel_type = 'dotlrn_member_rel'}] + permission::grant \ + -party_id $party_id_member \ + -object_id $new_parent_id \ + -privilege read - permission::grant -party_id $party_id_member -object_id $new_parent_id -privilege read - permission::grant -party_id $party_id_member -object_id $new_items_parent_id -privilege read + permission::grant \ + -party_id $party_id_member \ + -object_id $new_items_parent_id \ + -privilege read - # Set read permissions for community/class dotlrn_admin_rel + # Set read permissions for community/class dotlrn_admin_rel - set party_id_admin [db_string party_id {select segment_id from rel_segments \ - where group_id = :community_id \ - and rel_type = 'dotlrn_admin_rel'}] + set party_id_admin [db_string party_id { + select segment_id + from rel_segments + where group_id = :community_id + and rel_type = 'dotlrn_admin_rel'}] - permission::grant -party_id $party_id_admin -object_id $new_parent_id -privilege read - permission::grant -party_id $party_id_admin -object_id $new_items_parent_id -privilege read + permission::grant \ + -party_id $party_id_admin \ + -object_id $new_parent_id \ + -privilege read - # Set read permissions for *all* other professors within .LRN - # (so they can see the content) + permission::grant \ + -party_id $party_id_admin \ + -object_id $new_items_parent_id \ + -privilege read - set party_id_professor [db_string party_id {select segment_id from rel_segments \ - where rel_type = 'dotlrn_professor_profile_rel'}] + # Set read permissions for *all* other professors within .LRN + # (so they can see the content) - permission::grant -party_id $party_id_professor -object_id $new_parent_id -privilege read - permission::grant -party_id $party_id_professor -object_id $new_items_parent_id -privilege read + set party_id_professor [db_string party_id { + select segment_id + from rel_segments + where rel_type = 'dotlrn_professor_profile_rel'}] - # Set read permissions for *all* other admins within .LRN - # (so they can see the content) + permission::grant \ + -party_id $party_id_professor \ + -object_id $new_parent_id \ + -privilege read - set party_id_admins [db_string party_id {select segment_id from rel_segments \ - where rel_type = 'dotlrn_admin_profile_rel'}] + permission::grant \ + -party_id $party_id_professor \ + -object_id $new_items_parent_id \ + -privilege read - permission::grant -party_id $party_id_admins -object_id $new_parent_id -privilege read - permission::grant -party_id $party_id_admins -object_id $new_items_parent_id -privilege read + # Set read permissions for *all* other admins within .LRN + # (so they can see the content) + set party_id_admins [db_string party_id { + select segment_id + from rel_segments + where rel_type = 'dotlrn_admin_profile_rel'}] + permission::grant \ + -party_id $party_id_admins \ + -object_id $new_parent_id \ + -privilege read - set filesx [lors::cr::add_files -parent_id $new_parent_id -indb_p $indb_p -files [lors::cr::has_files -fs_dir $fs_dir]] + permission::grant \ + -party_id $party_id_admins \ + -object_id $new_items_parent_id \ + -privilege read + set filesx [lors::cr::add_files \ + -parent_id $new_parent_id \ + -indb_p $indb_p \ + -files [lors::cr::has_files -fs_dir $fs_dir]] + set all_files [concat $all_files $filesx] # get all the directories and files under those dirs @@ -161,39 +205,49 @@ # for each directory found.. while {[llength $dirx] != 0} { set collector [list] + foreach dir $dirx { # if the dirx loop is 0... set base_parent_id [lindex $dir 0] foreach subdir [lindex $dir 1] { - - # remove all path + # remove all path regexp {([^/\\]+)$} $subdir match cr_dir # add the folder to the CR - ns_write "[_ lorsm.Processing_folder]: $cr_dir
" - set new_cr_folder_id [lors::cr::add_folder -parent_id $base_parent_id -folder_name $cr_dir] - lappend collector "$new_cr_folder_id [list [lors::cr::has_dirs -fs_dir $subdir]]" + ns_write "[_ lorsm.Processing_folder]: $cr_dir
" + set new_cr_folder_id [lors::cr::add_folder \ + -parent_id $base_parent_id \ + -folder_name $cr_dir] + lappend collector "$new_cr_folder_id + [list [lors::cr::has_dirs -fs_dir $subdir]]" + # add files (if any) set files [lors::cr::has_files -fs_dir $subdir] - #For display purposes - ns_write "[_ lorsm.Processing_files]

" - foreach file $files { - set tempval [regsub $tmp_dir $file {}] - ns_write " $tempval[_ lorsm.OK]
" - } - ns_write "

" - # + #For display purposes + ns_write "[_ lorsm.Processing_files]

" + foreach file $files { + set tempval [regsub $tmp_dir $file {}] + ns_write " $tempval[_ lorsm.OK]
" + } + ns_write "

" + # if ![empty_string_p $files] { - set filesx [lors::cr::add_files -parent_id $new_cr_folder_id -files $files -indb_p $indb_p] + set filesx [lors::cr::add_files \ + -parent_id $new_cr_folder_id \ + -files $files \ + -indb_p $indb_p] set all_files [concat $all_files $filesx] } - } } + if {[llength $collector] == 0} { # then just add the name of the directories set dirx $collector @@ -204,11 +258,12 @@ } } - ## Finish adding files to the CR. + ## Finish adding files to the CR. - ## Now we start processing the imsmanifest.xml file + ## Now we start processing the imsmanifest.xml file - ns_write "

[_ lorsm.Now_processing]imsmanifest.xml [_ lorsm.file]" + ns_write "

[_ lorsm.Now_processing]imsmanifest.xml + [_ lorsm.file]" ## Opens imsmanifest.xml # open manifest file with tDOM @@ -231,156 +286,200 @@ set metadata [$manifest child all metadata] set man_hasmetadata [expr {$metadata ne ""}] - + ## Gets manifest title if { $metadata ne "" } { set lom [lindex [lors::imsmd::getLOM $metadata $tmp_dir] 0] set prefix [lindex [lors::imsmd::getLOM $metadata $tmp_dir] 1] + if { $lom != 0 } { # Get title - set manifest_title_lang [lindex [lindex [lors::imsmd::mdGeneral -element title -node $lom -prefix $prefix] 0] 0] - set manifest_title [lindex [lindex [lors::imsmd::mdGeneral -element title -node $lom -prefix $prefix] 0] 1] + set manifest_title_lang [lindex \ + [lindex [lors::imsmd::mdGeneral \ + -element title \ + -node $lom \ + -prefix $prefix] 0] 0] + + set manifest_title [lindex \ + [lindex [lors::imsmd::mdGeneral \ + -element title \ + -node $lom \ + -prefix $prefix] 0] 1] # set context set context "[_ lorsm.lt_Importing_manifest_ti]" ## Gets manifest description - - set manifest_descrip_lang [lindex [lindex [lors::imsmd::mdGeneral -element description -node $lom -prefix $prefix] 0] 0] - set manifest_descrip [lindex [lindex [lors::imsmd::mdGeneral -element description -node $lom -prefix $prefix] 0] 1] - # adds course information for display + set manifest_descrip_lang [lindex \ + [lindex [lors::imsmd::mdGeneral \ + -element description \ + -node $lom \ + -prefix $prefix] 0] 0] + set manifest_descrip [lindex \ + [lindex [lors::imsmd::mdGeneral \ + -element description \ + -node $lom \ + -prefix $prefix] 0] 1] + # adds course information for display + # Gets Rights info - set copyright [lors::imsmd::mdRights -element copyrightandotherrestrictions -node $lom -prefix $prefix] + set copyright [lors::imsmd::mdRights \ + -element copyrightandotherrestrictions \ + -node $lom \ + -prefix $prefix] + if { ![empty_string_p $copyright] } { set copyright_s [lindex [lindex [lindex $copyright 0] 0] 1] set copyright_v [lindex [lindex [lindex $copyright 0] 1] 1] - set cr_descrip [lors::imsmd::mdRights -element description -node $lom -prefix $prefix] + set cr_descrip [lors::imsmd::mdRights \ + -element description \ + -node $lom \ + -prefix $prefix] set cr_descrip_s [lindex [lindex $cr_descrip 0] 1] - - } - - } else { set context "[_ lorsm.lt_Importing_No_Metadata]" } } - - # Gets the organizations set organizations [$manifest child all organizations] set man_orgs_default [lors::imsmd::getAtt $organizations default] set man_id [lors::imscp::manifest_add \ - -course_name $course_name \ - -identifier $man_identifier \ - -version $man_version \ - -orgs_default $man_orgs_default \ - -hasmetadata $man_hasmetadata \ - -course_presentation_format $format_id \ - -isscorm $man_isscorm \ - -folder_id $new_items_parent_id \ + -course_name $course_name \ + -identifier $man_identifier \ + -version $man_version \ + -orgs_default $man_orgs_default \ + -hasmetadata $man_hasmetadata \ + -course_presentation_format $format_id \ + -isscorm $man_isscorm \ + -folder_id $new_items_parent_id \ -fs_package_id $fs_package_id \ - -community_id $community_id \ - -content_folder_id $new_parent_id] + -community_id $community_id \ + -content_folder_id $new_parent_id] + ns_write "[_ lorsm.lt_Granting_permissions__1]
" - ns_write "[_ lorsm.lt_Granting_permissions__1]
" + # PERMISSIONS FOR MANIFEST and learning objects - # PERMISSIONS FOR MANIFEST and learning objects + # set up in the same way as permissions for the file storage + # objects. As we want to maintain consistency btw the + # learnining objects and their content - # set up in the same way as permissions for the file storage - # objects. As we want to maintain consistency btw the - # learnining objects and their content + # Disable folder permissions inheritance + permission::toggle_inherit -object_id $man_id - # Disable folder permissions inheritance - permission::toggle_inherit -object_id $man_id + # Set read permissions for community/class dotlrn_member_rel - # Set read permissions for community/class dotlrn_member_rel + set community_id [dotlrn_community::get_community_id] - set community_id [dotlrn_community::get_community_id] + set party_id_member [db_string party_id { + select segment_id + from rel_segments + where group_id = :community_id + and rel_type = 'dotlrn_member_rel'}] - set party_id_member [db_string party_id {select segment_id from rel_segments \ - where group_id = :community_id \ - and rel_type = 'dotlrn_member_rel'}] + permission::grant \ + -party_id $party_id_member \ + -object_id $man_id \ + -privilege read - permission::grant -party_id $party_id_member -object_id $man_id -privilege read + # Set read permissions for community/class dotlrn_admin_rel - # Set read permissions for community/class dotlrn_admin_rel + set party_id_admin [db_string party_id { + select segment_id + from rel_segments + where group_id = :community_id + and rel_type = 'dotlrn_admin_rel'}] - set party_id_admin [db_string party_id {select segment_id from rel_segments \ - where group_id = :community_id \ - and rel_type = 'dotlrn_admin_rel'}] + permission::grant \ + -party_id $party_id_admin \ + -object_id $man_id \ + -privilege read - permission::grant -party_id $party_id_admin -object_id $man_id -privilege read + # Set read permissions for *all* other professors within .LRN + # (so they can see the content) - # Set read permissions for *all* other professors within .LRN - # (so they can see the content) + set party_id_professor [db_string party_id { + select segment_id + from rel_segments + where rel_type = 'dotlrn_professor_profile_rel'}] - set party_id_professor [db_string party_id {select segment_id from rel_segments \ - where rel_type = 'dotlrn_professor_profile_rel'}] + permission::grant \ + -party_id $party_id_professor \ + -object_id $man_id \ + -privilege read - permission::grant -party_id $party_id_professor -object_id $man_id -privilege read + # Set read permissions for *all* other admins within .LRN + # (so they can see the content) - # Set read permissions for *all* other admins within .LRN - # (so they can see the content) + set party_id_admins [db_string party_id { + select segment_id + from rel_segments + where rel_type = 'dotlrn_admin_profile_rel'}] - set party_id_admins [db_string party_id {select segment_id from rel_segments \ - where rel_type = 'dotlrn_admin_profile_rel'}] + permission::grant \ + -party_id $party_id_admins \ + -object_id $man_id \ + -privilege read - permission::grant -party_id $party_id_admins -object_id $man_id -privilege read + # Done with Manifest and learning object Permissions - # Done with Manifest and learning object Permissions + ns_write "[_ lorsm.lt_Adding_course_name_Ma]
" - ns_write "[_ lorsm.lt_Adding_course_name_Ma]
" - if {$man_hasmetadata == 1} { # adds manifest metadata set aa [lors::imsmd::addMetadata \ -acs_object $man_id \ -node $metadata \ -dir $tmp_dir] - - ns_write "[_ lorsm.lt_Adding_Manifest_Metad]
" - + ns_write "[_ lorsm.lt_Adding_Manifest_Metad]
" } if { ![empty_string_p $organizations] } { - - # for multiple organizations + # for multiple organizations set add [list] foreach organization [$organizations child all organization] { + set org_identifier [lors::imsmd::getResource \ + -node $organization \ + -att identifier] - set org_identifier [lors::imsmd::getResource -node $organization -att identifier] + set org_identifier [lors::imsmd::getResource \ + -node $organization \ + -att identifier] - set org_identifier [lors::imsmd::getResource -node $organization -att identifier] - set org_structure [lors::imsmd::getResource -node $organization -att structure] - if {![empty_string_p [$organization child all title]]} { - set org_title [lors::imsmd::getElement [$organization child all title]] - } else { - set org_title "" - } + set org_structure [lors::imsmd::getResource \ + -node $organization \ + -att structure] + + if {![empty_string_p [$organization child all title]]} { + set org_title [lors::imsmd::getElement \ + [$organization child all title]] + } else { + set org_title "" + } + set org_hasmetadata [lors::imsmd::hasMetadata $organization] - + set org_id [lors::imscp::organization_add \ -man_id $man_id \ -identifier $org_identifier \ -structure $org_structure \ -title $org_title \ - -hasmetadata $org_hasmetadata\ - -org_folder_id $new_items_parent_id] + -hasmetadata $org_hasmetadata \ + -org_folder_id $new_items_parent_id] - ns_write "[_ lorsm.lt_Adding_Organization_o]
" + ns_write "[_ lorsm.lt_Adding_Organization_o]
" if {$org_hasmetadata == 1} { @@ -393,93 +492,108 @@ set list_items [lors::imscp::getItems $organization] -# ns_write "[_ lorsm.lt_here_is_list_items_li]" + # ns_write "[_ lorsm.lt_here_is_list_items_li]" - set add [concat $add [lors::imscp::addItems -itm_folder_id $new_items_parent_id -org_id $org_id $list_items 0 $tmp_dir]] + set add [concat $add [lors::imscp::addItems \ + -itm_folder_id $new_items_parent_id \ + -org_id $org_id $list_items 0 $tmp_dir]] - set tempval [llength $add] - ns_write "[_ lorsm.lt_Adding_tempval_items_]
" - + set tempval [llength $add] + ns_write "[_ lorsm.lt_Adding_tempval_items_]
" } - } set l_files [list] - set resources [$manifest child all resources] - set resourcex [$resources child all resource] if { ![empty_string_p $resourcex] } { - set res_list [list] + foreach resource $resourcex { - set res_identifier [lors::imsmd::getResource -node $resource -att identifier] - set res_type [lors::imsmd::getResource -node $resource -att type] - set res_href [lors::imsmd::getResource -node $resource -att href] - set res_dependencies [lors::imsmd::getResource -node $resource -att dependencies] + set res_identifier [lors::imsmd::getResource \ + -node $resource \ + -att identifier] + + set res_type [lors::imsmd::getResource \ + -node $resource \ + -att type] + + set res_href [lors::imsmd::getResource \ + -node $resource \ + -att href] + + set res_dependencies [lors::imsmd::getResource \ + -node $resource \ + -att dependencies] + set res_hasmetadata [lors::imsmd::hasMetadata $resource] - set res_files [lors::imsmd::getResource -node $resource -att files] + set res_files [lors::imsmd::getResource \ + -node $resource \ + -att files] + set res_scormtype [lors::imsmd::getAtt $resource adlcp:scormtype] # Integration with other packages # This callback gets the href of the imported content (if some package imported it) - set res_href_tmp [callback -catch lors::import -res_type $res_type -res_href $res_href -tmp_dir $tmp_dir -community_id $community_id] + set res_href_tmp [callback \ + -catch lors::import \ + -res_type $res_type \ + -res_href $res_href \ + -tmp_dir $tmp_dir \ + -community_id $community_id] + if {![empty_string_p $res_href_tmp]} { set res_href $res_href_tmp } set resource_id [lors::imscp::resource_add \ - -man_id $man_id \ - -identifier $res_identifier \ - -type $res_type \ - -href $res_href \ - -scorm_type $res_scormtype \ - -hasmetadata $res_hasmetadata \ - -res_folder_id $new_items_parent_id] + -man_id $man_id \ + -identifier $res_identifier \ + -type $res_type \ + -href $res_href \ + -scorm_type $res_scormtype \ + -hasmetadata $res_hasmetadata \ + -res_folder_id $new_items_parent_id] - ns_write "[_ lorsm.lt_Adding_resource_res_i_2]
" - - lappend res_list [concat "$resource_id $res_identifier"] + ns_write "[_ lorsm.lt_Adding_resource_res_i_2]
" - + lappend res_list [concat "$resource_id $res_identifier"] - if {$res_hasmetadata == 1} { set res_md_add [lors::imsmd::addMetadata \ -acs_object $resource_id \ -node [lors::imsmd::getMDNode $resource] \ -dir $tmp_dir] - ns_write "[_ lorsm.lt_Adding_resource_res_i_3]
" - + ns_write "[_ lorsm.lt_Adding_resource_res_i_3]
" } foreach dependency $res_dependencies { - set dep_id [lors::imscp::dependency_add \ -res_id $resource_id \ -identifierref $dependency] - ns_write "[_ lorsm.lt_Adding_resource_depen]
" - + ns_write "[_ lorsm.lt_Adding_resource_depen]
" } foreach file $res_files { - lappend l_files [list [lindex $file 0] $resource_id [lindex $file 1]] - - # ns_write "[_ lorsm.lt_resource_id_res_ident]" - # ns_write "\t$file \n" + lappend l_files [list \ + [lindex $file 0] \ + $resource_id \ + [lindex $file 1]] + # ns_write "[_ lorsm.lt_resource_id_res_ident]" + # ns_write "\t$file \n" } } } # gets the resources set resources [$manifest child all resources] - + } else { # Error MSG here #ns_write "[_ lorsm.no_page]" @@ -495,75 +609,67 @@ # a -regexp foreach ref $add { - lappend i_identref [lindex $ref 1] + lappend i_identref [lindex $ref 1] } foreach resource $res_list { + set find_item_id [lsearch -all -exact $i_identref [lindex $resource 1]] - set find_item_id [lsearch -all -exact $i_identref [lindex $resource 1]] - - if {$find_item_id != -1} { - - foreach item_to_res $find_item_id { - - set item_to_resource [lors::imscp::item_to_resource_add \ - -item_id [lindex [lindex $add $item_to_res] 0] \ - -res_id [lindex $resource 0] - ] - } - - } - + if {$find_item_id != -1} { + foreach item_to_res $find_item_id { + set item_to_resource [lors::imscp::item_to_resource_add \ + -item_id [lindex \ + [lindex $add $item_to_res] 0] \ + -res_id [lindex $resource 0]] + } + } } ns_write "[_ lorsm.lt_Now_we_are_almost_don]
" foreach file $l_files { set filename [lindex $file 0] - set found_file [lsearch -all -regexp $all_files $filename] - if {[llength $found_file] > 1} { - # we are suppose to get only one element back, so we have - # to refine the search a bit more. - set found_file [lsearch -all -regexp -exact $all_files $tmp_dir/$filename] - } - - if {![empty_string_p $found_file]} { - set file_id [lindex [lindex $all_files $found_file] 3] + if {[llength $found_file] > 1} { + # we are suppose to get only one element back, so we have + # to refine the search a bit more. + set found_file [lsearch -all -regexp \ + -exact $all_files $tmp_dir/$filename] + } + + if {![empty_string_p $found_file]} { + set file_id [lindex [lindex $all_files $found_file] 3] set file_rev_id [content::item::get_live_revision -item_id $file_id] - set res_id [lindex $file 1] - set file_hasmetadata [lindex $file 2] + set res_id [lindex $file 1] + set file_hasmetadata [lindex $file 2] - regexp {([^/\\]+)$} $filename match filex + regexp {([^/\\]+)$} $filename match filex - if {$file_hasmetadata != 0} { - set hasmetadata 1 - } else { - set hasmetadata 0 - } + if {$file_hasmetadata != 0} { + set hasmetadata 1 + } else { + set hasmetadata 0 + } - set fileadd [lors::imscp::file_add \ - -file_id $file_rev_id \ - -res_id $res_id \ - -pathtofile $filename \ - -filename $filex \ - -hasmetadata $hasmetadata] + set fileadd [lors::imscp::file_add \ + -file_id $file_rev_id \ + -res_id $res_id \ + -pathtofile $filename \ + -filename $filex \ + -hasmetadata $hasmetadata] - ns_write "[_ lorsm.Adding_file_filex]
" + ns_write "[_ lorsm.Adding_file_filex]
" - - if {$file_hasmetadata != 0} { - set add_file_metadata [lors::imsmd::addMetadata \ - -acs_object $file_id \ - -node $file_hasmetadata \ - -dir $tmp_dir] - - ns_write "[_ lorsm.lt_Adding_file_filex_met_1]
" - } - } - + if {$file_hasmetadata != 0} { + set add_file_metadata [lors::imsmd::addMetadata \ + -acs_object $file_id \ + -node $file_hasmetadata \ + -dir $tmp_dir] + ns_write "[_ lorsm.lt_Adding_file_filex_met_1]
" + } + } } @@ -576,6 +682,4 @@ # jump to the front page ad_progress_bar_end -url [apm_package_url_from_id [ad_conn package_id]]/admin - - } Index: openacs-4/packages/lorsm/www/admin/course-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/course-add.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/course-add.adp 17 Oct 2008 10:46:31 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/course-add.adp 17 Nov 2008 13:36:44 -0000 1.3 @@ -4,30 +4,28 @@ - - - - - - - - - - + + + + + + + + + - + +
-

#lorsm.lt_Shared_Courses_in_the#

-
-

#lorsm.lt_You_can_add_courses_a# - -

-

#lorsm.Create_a_new_course#

-
+

#lorsm.lt_Shared_Courses_in_the#

+

#lorsm.lt_You_can_add_courses_a# + +

#lorsm.Create_a_new_course#

+ +

#lorsm.or_upload_existing_course#

- -
Index: openacs-4/packages/lorsm/www/admin/course-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/course-add.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/course-add.tcl 31 Dec 2006 00:36:04 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/course-add.tcl 17 Nov 2008 13:36:44 -0000 1.2 @@ -13,33 +13,34 @@ set user_id [ad_conn user_id] set community_id [dotlrn_community::get_community_id] -if { ![info exists man_id] } { +if { ![info exists man_id] } { set man_id "" } # Gets file-storage root folder_id # eventually, we should provide an option so it can be imported in # different subfolders set fs_package_id [site_node_apm_integration::get_child_package_id \ - -package_id [dotlrn_community::get_package_id $community_id] \ - -package_key "file-storage"\ - ] + -package_id [dotlrn_community::get_package_id $community_id] \ + -package_key "file-storage"] #set fs_package_id [apm_package_id_from_key "file-storage"] -- if used -# with OpenACS +# with OpenACS -# Gets root folder and root folder name +# Gets root folder and root folder name set folder_id [fs::get_root_folder -package_id $fs_package_id] set folder_name [fs::get_object_name -object_id $folder_id] # Gets whether the file-storage instance is a indb_p or file system # (StoreFilesInDatabaseP) one not that we use it now -since we are # currently putting everything on the file system, but eventually we -# will have the option to put it on the db. +# will have the option to put it on the db. -set indb_p [parameter::get -parameter "StoreFilesInDatabaseP" -package_id $fs_package_id] +set indb_p [parameter::get \ + -parameter "StoreFilesInDatabaseP" \ + -package_id $fs_package_id] -# Gets URL for file-storage package +# Gets URL for file-storage package set fs_url [apm_package_url_from_id $fs_package_id] @@ -52,34 +53,48 @@ # set context set context [list "[_ lorsm.lt_Upload_IMS_Content_Pa]"] -template::form create course_upload -action course-add-2 -html {enctype multipart/form-data} +template::form create course_upload \ + -action course-add-2 \ + -html {enctype multipart/form-data} -template::element create course_upload course_id \ - -label "[_ lorsm.course_id]" -datatype integer -widget hidden +template::element create course_upload course_id \ + -label "[_ lorsm.course_id]" \ + -datatype integer \ + -widget hidden -template::element create course_upload indb_p \ - -label "[_ lorsm.indb_p]" -datatype integer -widget hidden +template::element create course_upload indb_p \ + -label "[_ lorsm.indb_p]" \ + -datatype integer \ + -widget hidden -template::element create course_upload fs_package_id \ - -label "[_ lorsm.fs_package_id]" -datatype integer -widget hidden +template::element create course_upload fs_package_id \ + -label "[_ lorsm.fs_package_id]" \ + -datatype integer \ + -widget hidden -template::element create course_upload folder_id \ - -label "[_ lorsm.folder_id]" -datatype integer -widget hidden +template::element create course_upload folder_id \ + -label "[_ lorsm.folder_id]" \ + -datatype integer \ + -widget hidden -template::element create course_upload upload_file \ - -label "[_ lorsm.lt_Choose_the_course_zip]" -help_text "[_ lorsm.lt_Use_the_Browse_button]" -datatype text -widget file +template::element create course_upload upload_file \ + -label "[_ lorsm.lt_Choose_the_course_zip]" \ + -help_text "[_ lorsm.lt_Use_the_Browse_button]" \ + -datatype text \ + -widget file # To support course versions -template::element create course_upload man_id \ - -datatype integer -widget hidden +template::element create course_upload man_id \ + -datatype integer \ + -widget hidden template::element set_properties course_upload course_id -value $course_id template::element set_properties course_upload folder_id -value $folder_id template::element set_properties course_upload indb_p -value $indb_p -template::element set_properties course_upload fs_package_id -value $fs_package_id +template::element set_properties course_upload fs_package_id \ + -value $fs_package_id template::element set_properties course_upload man_id -value $man_id - ad_return_template Index: openacs-4/packages/lorsm/www/admin/course-structure.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/course-structure.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/course-structure.adp 6 Apr 2007 15:52:23 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/course-structure.adp 17 Nov 2008 13:36:44 -0000 1.3 @@ -1,5 +1,5 @@ - @title;noquote@ - @context;noquote@ +@title;noquote@ +@context;noquote@ - \ No newline at end of file + Index: openacs-4/packages/lorsm/www/admin/course-structure.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/course-structure.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/course-structure.tcl 6 Apr 2007 15:52:23 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/course-structure.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -1,45 +1,58 @@ # # packages/lorsm/www/course_structure.tcl ad_page_contract { - + View Manifest Course Structure - + @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 2004-03-31 @arch-tag 208f2801-d110-45d3-9401-d5eae1f72c93 @cvs-id $Id$ - } { - man_id:integer,notnull - } -properties { - } -validate { - } -errors { - } +} { + man_id:integer,notnull +} -properties { +} -validate { +} -errors { +} - set context [list "[_ lorsm.Course_Structure]"] - set title "[_ lorsm.Course_Structure]" +set context [list "[_ lorsm.Course_Structure]"] +set title "[_ lorsm.Course_Structure]" set custom_page_types [list start end] -array set custom_page_pretty_names [list start "[_ lorsm.Start_Page]" end "[_ lorsm.End_Page]"] +array set custom_page_pretty_names [list \ + start "[_ lorsm.Start_Page]" \ + end "[_ lorsm.End_Page]"] + array set custom_page_order [list start 0 end 1] + set lorsm_custom_page_ids [list] set existing_custom_page_types [list] -db_multirow -extend {order pretty_name} custom_pages get_custom_pages "select i.ims_item_id, i.item_title, lcp.type, ci.item_id from lorsm_custom_pages lcp, ims_cp_manifests m, ims_cp_organizations o, ims_cp_items i, cr_items ci where -ci.item_id=lcp.page_id -and m.man_id=:man_id -and m.man_id=o.man_id -and o.org_id=i.org_id -and i.ims_item_id=ci.live_revision" { +db_multirow -extend {order pretty_name} custom_pages get_custom_pages \ + "select i.ims_item_id, i.item_title, lcp.type, ci.item_id + from lorsm_custom_pages lcp, ims_cp_manifests m, ims_cp_organizations o, ims_cp_items i, cr_items ci + where ci.item_id=lcp.page_id + and m.man_id=:man_id + and m.man_id=o.man_id + and o.org_id=i.org_id + and i.ims_item_id=ci.live_revision" { + lappend lorsm_custom_page_ids $ims_item_id lappend existing_custom_page_types $type set order $custom_page_order($type) } + foreach type $custom_page_types { if {[lsearch $existing_custom_page_types $type] <0} { - template::multirow append custom_pages "" "" $type "" $custom_page_order($type) $custom_page_pretty_names($type) + template::multirow append custom_pages \ + "" \ + "" \ + $type \ + "" \ + $custom_page_order($type) \ + $custom_page_pretty_names($type) } } template::multirow sort custom_pages order -set extra_admin_html [template::adp_include /packages/lorsm/lib/custom-page-admin [list &custom_pages custom_pages man_id $man_id]] - - +set extra_admin_html [template::adp_include /packages/lorsm/lib/custom-page-admin \ + [list &custom_pages custom_pages man_id $man_id]] Index: openacs-4/packages/lorsm/www/admin/enabler.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/enabler.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/enabler.adp 31 Dec 2006 00:36:04 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/enabler.adp 17 Nov 2008 13:36:44 -0000 1.2 @@ -1,5 +1,5 @@ - @title@ - @context@ +@title@ +@context@ - + Index: openacs-4/packages/lorsm/www/admin/enabler.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/enabler.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/enabler.tcl 31 Dec 2006 00:36:04 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/enabler.tcl 17 Nov 2008 13:36:44 -0000 1.2 @@ -1,9 +1,9 @@ # packages/lorsm/www/enabler.tcl ad_page_contract { - + enable/disable courses for a class - + @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 2004-05-19 @arch-tag ebea2a9b-b6d6-4083-83c5-58686ba9e201 @@ -25,38 +25,39 @@ ad_form -name enabler \ -export {package_id} \ -form { - {man_id:key} - {project:text(inform) - {label "[_ lorsm.Course_Name]"} - {value {[lorsm::get_course_name -manifest_id $man_id]}} - } - {isenabled:text(inform) - {label "[_ lorsm.Current_Status]"} - } - {enable:text(radio) - {label "[_ lorsm.Status_3]"} - {options {{"[_ lorsm.Enable]" t} {"[_ lorsm.Disable]" f}}} - } + {man_id:key} + + {project:text(inform) + {label "[_ lorsm.Course_Name]"} + {value {[lorsm::get_course_name -manifest_id $man_id]}} + } + + {isenabled:text(inform) + {label "[_ lorsm.Current_Status]"} + } + + {enable:text(radio) + {label "[_ lorsm.Status_3]"} + {options {{"[_ lorsm.Enable]" t} {"[_ lorsm.Disable]" f}}} + } + } -select_query { - select + select case when isenabled = 't' then 'Enabled' - else 'Disabled' + else 'Disabled' end as isenabled - from ims_cp_manifest_class - where man_id = :man_id and - lorsm_instance_id = :package_id + from ims_cp_manifest_class + where man_id = :man_id + and lorsm_instance_id = :package_id + } -edit_data { db_dml do_update " update ims_cp_manifest_class set isenabled = :enable - where man_id = :man_id and - lorsm_instance_id = :package_id" + where man_id = :man_id + and lorsm_instance_id = :package_id" + } -after_submit { ad_returnredirect [site_node::get_url_from_object_id -object_id package_id] ad_script_abort } - - - - - Index: openacs-4/packages/lorsm/www/admin/formater.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/formater.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/formater.adp 31 Dec 2006 00:36:04 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/formater.adp 17 Nov 2008 13:36:44 -0000 1.2 @@ -1,5 +1,5 @@ - @title@ - @context@ +@title@ +@context@ - + Index: openacs-4/packages/lorsm/www/admin/formater.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/formater.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/formater.tcl 9 Apr 2007 21:43:51 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/formater.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/formater.tcl ad_page_contract { - + Change course format presentation - + @author jopezku@gmail.com @cvs-id $Id$ } { @@ -27,39 +27,46 @@ ad_form -name formater \ -export {return_url} \ -form { - {man_id:key} - {project:text(inform) - {label "[_ lorsm.Course_Name]"} - {value {[lorsm::get_course_name -manifest_id $man_id]}} - } - {format_pretty_name:text(inform) - {label "[_ lorsm.Current_Format]"} - } - {format:text(select) - {label "[_ lorsm.Format_1]"} - {options {[lang::util::localize_list_of_lists -list [db_list_of_lists select_formats_for_select_widget {select format_pretty_name, - format_id - from lorsm_course_presentation_formats - order by format_pretty_name}]]}} - } - } -edit_request { - db_1row get_data " select cp.course_presentation_format as format, pf.format_pretty_name - from ims_cp_manifests cp, lorsm_course_presentation_formats pf - where cp.man_id = :man_id - and cp.course_presentation_format = pf.format_id" - set format_pretty_name [lang::util::localize $format_pretty_name] + {man_id:key} - } -edit_data { - db_transaction { - db_dml do_update { - update ims_cp_manifests - set course_presentation_format = :format - where man_id = :man_id } - } - } -after_submit { - ad_returnredirect $return_url - } + {project:text(inform) + {label "[_ lorsm.Course_Name]"} + {value {[lorsm::get_course_name -manifest_id $man_id]}} + } + {format_pretty_name:text(inform) + {label "[_ lorsm.Current_Format]"} + } + {format:text(select) + {label "[_ lorsm.Format_1]"} + {options {[lang::util::localize_list_of_lists \ + -list [db_list_of_lists select_formats_for_select_widget {\ + select format_pretty_name, format_id + from lorsm_course_presentation_formats + order by format_pretty_name}]]}} + } + } -edit_request { + db_1row get_data \ + "select cp.course_presentation_format as format, pf.format_pretty_name + from ims_cp_manifests cp, lorsm_course_presentation_formats pf + where cp.man_id = :man_id + and cp.course_presentation_format = pf.format_id" + set format_pretty_name [lang::util::localize $format_pretty_name] + } -edit_data { + db_transaction { + db_dml do_update { + update ims_cp_manifests + set course_presentation_format = :format + where man_id = :man_id } + } + + } -after_submit { + ad_returnredirect $return_url + } + + + + Index: openacs-4/packages/lorsm/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/index.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/index.adp 31 Dec 2006 00:36:04 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/index.adp 17 Nov 2008 13:36:44 -0000 1.2 @@ -1,16 +1,12 @@ - @title@ - @context@ +@title@ +@context@ - - - - - + + + + +
-

#lorsm.lt_Courses_in_your_Repos#

-
- -

#lorsm.lt_Courses_in_your_Repos#

Index: openacs-4/packages/lorsm/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/index.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/index.tcl 6 Mar 2008 14:00:28 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/index.tcl 17 Nov 2008 13:36:44 -0000 1.4 @@ -20,10 +20,18 @@ set actions [list] -lappend actions "[_ lorsm.Add_Course]" [export_vars -base "course-add"] "[_ lorsm.lt_Add_a_IMSSCORM_Compli]" -lappend actions "[_ lorsm.lt_Search_Learning_Objec]" [export_vars -base "/search"] "[_ lorsm.lt_Search_for_Learninng_]" -lappend actions "[_ lorsm.Available_Courses]" [export_vars -base "shared/"] "[_ lorsm.lt_View_Available_Course]" - +lappend actions "[_ lorsm.Add_Course]" \ + [export_vars -base "course-add"] \ + "[_ lorsm.lt_Add_a_IMSSCORM_Compli]" + +lappend actions "[_ lorsm.lt_Search_Learning_Objec]" \ + [export_vars -base "/search"] \ + "[_ lorsm.lt_Search_for_Learninng_]" + +lappend actions "[_ lorsm.Available_Courses]" \ + [export_vars -base "shared/"] \ + "[_ lorsm.lt_View_Available_Course]" + template::list::create \ -name d_courses \ -multirow d_courses \ @@ -34,161 +42,162 @@ -elements { course_name { label "[_ lorsm.Available_Courses]" - display_template {@d_courses.course_url;noquote@} + display_template {@d_courses.course_url;noquote@} display_col course_name link_html {title "Access Course"} - } - hasmetadata { + + } hasmetadata { label "[_ lorsm.Metadata_1]" display_template { - -

- @d_courses.hasmetadata@ -
-
- -
@d_courses.hasmetadata@
-
- } - } - isscorm { + +
+ @d_courses.hasmetadata@ +
+
+ +
@d_courses.hasmetadata@
+
+ } + + } isscorm { label "[_ lorsm.SCORM]" - html { align center } - } - isenabled { + html { align center } + + } isenabled { label "[_ lorsm.Status_1]" - html { align center } - } - istrackable { + html { align center } + + } istrackable { label "[_ lorsm.Tracking]" link_url_eval {tracking/?[export_vars man_id]} - link_html {title "[_ lorsm.lt_Track_Students_Progre]" class button} - html { align center } - } - deliverymethod { + link_html {title "[_ lorsm.lt_Track_Students_Progre]" class button} + html { align center } + + } deliverymethod { label "[_ lorsm.Default_delivery]" - html { align center } - } - hasrtedata { + html { align center } + + } hasrtedata { label "[_ lorsm.SCORM_session]" display_template { - -
- @d_courses.hasrtedata@ -
-
- } - } - creation_user { + +
+ @d_courses.hasrtedata@ +
+
+ } + + } creation_user { label "[_ lorsm.Owner]" display_eval {[person::name -person_id $creation_user]} link_url_eval {[acs_community_member_url -user_id $creation_user]} - } - creation_date { + + } creation_date { label "[_ lorsm.Creation_Date]" display_eval {[lc_time_fmt $creation_date "%x %X"]} - } - export { + + } export { label "[_ lorsm.Export]" - display_template { - -
- \[zip\] -
+ display_template { + +
+ \[zip\] +
- } - } - admin { + } + + } admin { label "[_ lorsm.Admin_Course]" - display_eval {Admin} + display_eval {Admin} link_url_eval {[export_vars -base course-structure man_id]} link_html {title "[_ lorsm.Admin_Course]" class button} - html { align center } + html { align center } + + } permissions { + label "Permissions" + display_eval {Permissions} + link_url_eval {[export_vars -base permissions {{object_id $man_id}}]} + link_html {class button} } - permissions { - label "Permissions" - display_eval {Permissions} - link_url_eval {[export_vars -base permissions {{object_id $man_id}}]} - link_html {class button} - } } db_multirow -extend { ims_md_id course_url } d_courses select_d_courses { - select - cp.man_id, - cp.course_name, - cp.identifier, - cp.version, - case - when cp.hasmetadata = 't' then 'Yes' - else 'No' - end as hasmetadata, - case - when isscorm = 't' then 'Yes' - else 'No' - end as isscorm, - cp.fs_package_id, - case when fs_package_id is null then 'f' - else 't' - end as lorsm_p, - cp.folder_id, - acs.creation_user, - acs.creation_date, - pf.folder_name, - pf.format_name, - acs.context_id, - case - when cpmc.isenabled = 't' then 'Enabled' - else 'Disabled' - end as isenabled, - case - when cpmc.istrackable = 't' then 'Yes' - else 'No' - end as istrackable, - -- micheles - -- addition for rte stuff --- 'Click here' as hasrtedata, - case - when - upper(scorm_type) = 'SCO' - then 'Click here' - else '' - end as hasrtedata, - case - when - upper(scorm_type) = 'SCO' - then 'delivery-scorm' - else 'delivery' - end as deliverymethod + select + cp.man_id, + cp.course_name, + cp.identifier, + cp.version, + case + when cp.hasmetadata = 't' then 'Yes' + else 'No' + end as hasmetadata, + case + when isscorm = 't' then 'Yes' + else 'No' + end as isscorm, + + cp.fs_package_id, + case + when fs_package_id is null then 'f' + else 't' + end as lorsm_p, + + cp.folder_id, + acs.creation_user, + acs.creation_date, + pf.folder_name, + pf.format_name, + acs.context_id, + case + when cpmc.isenabled = 't' then 'Enabled' + else 'Disabled' + end as isenabled, + + case + when cpmc.istrackable = 't' then 'Yes' + else 'No' + end as istrackable, + + -- micheles + -- addition for rte stuff + -- 'Click here' as hasrtedata, + case + when upper(scorm_type) = 'SCO' then 'Click here' + else '' + end as hasrtedata, + + case + when upper(scorm_type) = 'SCO' then 'delivery-scorm' + else 'delivery' + end as deliverymethod + from - acs_objects acs, - ims_cp_manifest_class cpmc, + acs_objects acs, + ims_cp_manifest_class cpmc, lorsm_course_presentation_formats pf, -- micheles - ims_cp_manifests cp left join (select man_id, max(scorm_type) as scorm_type from ims_cp_resources group by man_id ) as cpr using (man_id) + ims_cp_manifests cp left join (select man_id, max(scorm_type) as scorm_type + from ims_cp_resources + group by man_id ) as cpr using (man_id) - where - cp.man_id = acs.object_id - and - cp.man_id = cpmc.man_id - and - cpmc.community_id = :community_id - and - cp.course_presentation_format = pf.format_id - and - cp.man_id in (select cr.live_revision - from cr_items cr where content_type = 'ims_manifest_object') + where cp.man_id = acs.object_id + and cp.man_id = cpmc.man_id + and cpmc.community_id = :community_id + and cp.course_presentation_format = pf.format_id + and cp.man_id in (select cr.live_revision + from cr_items cr + where content_type = 'ims_manifest_object') order by acs.creation_date desc, cp.man_id asc } { set ims_md_id $man_id -# if { [string eq $format_name "default"] } { - set course_url "$course_name" +# if { [string eq $format_name "default"] } { + set course_url "$course_name" # } else { -# set course_url "$course_name" +# set course_url "$course_name" # } } - + Index: openacs-4/packages/lorsm/www/admin/item-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/item-add-edit.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/lorsm/www/admin/item-add-edit.tcl 8 Oct 2008 13:01:06 -0000 1.4 +++ openacs-4/packages/lorsm/www/admin/item-add-edit.tcl 17 Nov 2008 13:36:44 -0000 1.5 @@ -8,76 +8,86 @@ {return_url ""} } -ad_form -name item -export {man_id type} -form { - item_id:key - {title:text {label "[_ acs-content-repository.Title]"}} - {content:richtext(richtext) {label "[_ acs-content-repository.Content]"} {html {cols 80 style {width: 100%}}}} -} -edit_request { - set content [template::util::richtext::create \ - [cr_write_content -string -item_id $item_id] \ - text/html] - set title [db_string get_title ""] -} -new_data { - set content [template::util::richtext::get_property text $content] - set org_id [db_string get_org_id ""] - set item_folder_id [db_string get_folder_id ""] -# ad_return_complaint 1 "folder_id '${item_folder_id}'" - # TODO i bet we can make a generic webcontent - # a subset of lors::itemcp::item_add_from_object - # and handle all adding of objects from anywhere - # to a lors course, for now, this works, and is consistent - # with generic ims_cp webcontent objects - set ims_item_id [lors::imscp::item_add \ - -org_id $org_id \ - -item_id $item_id \ - -itm_folder_id $item_folder_id \ - -identifier $item_id \ - -title $title \ - -parent_item $org_id] - db_dml set_sort_order "" - - set revision_id [content::item::get_live_revision -item_id $item_id] - content::revision::update_content \ - -revision_id $revision_id \ - -item_id $item_id \ - -content $content \ - -mime_type text/html \ - -storage_type [db_string get_storage_type ""] - - set res_id [lors::imscp::resource_add \ - -identifier $revision_id \ - -man_id $man_id \ - -res_folder_id $item_folder_id] - - lors::imscp::item_to_resource_add \ - -item_id $ims_item_id \ - -res_id $res_id +ad_form \ + -name item \ + -export {man_id type} \ + -form { + item_id:key + {title:text {label "[_ acs-content-repository.Title]"}} -} -edit_data { - set content [template::util::richtext::get_property text $content] - set ims_item_id [content::item::get_latest_revision -item_id $item_id] - content::revision::update_content \ - -revision_id $ims_item_id \ - -item_id $item_id \ - -content $content \ - -mime_type text/html \ - -storage_type [db_string get_storage_type ""] - db_dml set_title "" -} -after_submit { - if {[info exists type]} { - lorsm::set_custom_page \ - -man_id $man_id \ - -item_id $item_id \ - -type $type + {content:richtext(richtext) + {label "[_ acs-content-repository.Content]"} + {html {cols 80 style {width: 100%}}} + } + + } -edit_request { + set content [template::util::richtext::create \ + [cr_write_content -string -item_id $item_id] text/html] + set title [db_string get_title ""] + + } -new_data { + set content [template::util::richtext::get_property text $content] + set org_id [db_string get_org_id ""] + set item_folder_id [db_string get_folder_id ""] + # ad_return_complaint 1 "folder_id '${item_folder_id}'" + # TODO i bet we can make a generic webcontent + # a subset of lors::itemcp::item_add_from_object + # and handle all adding of objects from anywhere + # to a lors course, for now, this works, and is consistent + # with generic ims_cp webcontent objects + set ims_item_id [lors::imscp::item_add \ + -org_id $org_id \ + -item_id $item_id \ + -itm_folder_id $item_folder_id \ + -identifier $item_id \ + -title $title \ + -parent_item $org_id] + db_dml set_sort_order "" + + set revision_id [content::item::get_live_revision -item_id $item_id] + content::revision::update_content \ + -revision_id $revision_id \ + -item_id $item_id \ + -content $content \ + -mime_type text/html \ + -storage_type [db_string get_storage_type ""] + + set res_id [lors::imscp::resource_add \ + -identifier $revision_id \ + -man_id $man_id \ + -res_folder_id $item_folder_id] + + lors::imscp::item_to_resource_add \ + -item_id $ims_item_id \ + -res_id $res_id + + + } -edit_data { + set content [template::util::richtext::get_property text $content] + set ims_item_id [content::item::get_latest_revision -item_id $item_id] + content::revision::update_content \ + -revision_id $ims_item_id \ + -item_id $item_id \ + -content $content \ + -mime_type text/html \ + -storage_type [db_string get_storage_type ""] + db_dml set_title "" + + } -after_submit { + if {[info exists type]} { + lorsm::set_custom_page \ + -man_id $man_id \ + -item_id $item_id \ + -type $type + } + + if {$return_url eq ""} { + set return_url [export_vars -base course-structure {man_id}] + } + + ad_returnredirect -message "" $return_url } - if {$return_url eq ""} { - set return_url [export_vars -base course-structure {man_id}] - } - ad_returnredirect -message "" $return_url -} set page_title [_ lorsm.Add_Content] set context [list $page_title] - - Index: openacs-4/packages/lorsm/www/admin/object-new.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/object-new.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/object-new.adp 31 Dec 2006 00:36:04 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/object-new.adp 17 Nov 2008 13:36:44 -0000 1.2 @@ -1,5 +1,5 @@ - @page_title@ - @context@ - - \ No newline at end of file +@page_title@ +@context@ + + Index: openacs-4/packages/lorsm/www/admin/object-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/object-new.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/object-new.tcl 31 Dec 2006 00:36:04 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/object-new.tcl 17 Nov 2008 13:36:44 -0000 1.2 @@ -1,9 +1,9 @@ # packages/lorsm/www/add-new.tcl ad_page_contract { - + add a new learning object - + @author Dave Bauer (dave@thedesignexperience.org) @creation-date 2006-06-05 @cvs-id $Id$ @@ -15,6 +15,5 @@ } -errors { } - set page_title "Add New" set context [list $page_title] Index: openacs-4/packages/lorsm/www/admin/remove-custom-page.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/remove-custom-page.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/remove-custom-page.tcl 6 Apr 2007 15:52:23 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/remove-custom-page.tcl 17 Nov 2008 13:36:44 -0000 1.2 @@ -4,9 +4,12 @@ man_id type {return_url ""} -} +} -db_dml remove_page "delete from lorsm_custom_pages where man_id=:man_id and type=:type" +db_dml remove_page \ + "delete from lorsm_custom_pages + where man_id=:man_id + and type=:type" if {$return_url eq ""} { set return_url [export_vars -base course-structure {man_id}] Index: openacs-4/packages/lorsm/www/admin/reorder-items.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/reorder-items.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/reorder-items.tcl 15 May 2007 20:14:43 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/reorder-items.tcl 17 Nov 2008 13:36:44 -0000 1.4 @@ -3,36 +3,34 @@ } { item_id:integer,notnull dir:notnull -} +} set ims_item_id $item_id set man_id [db_string get_man_id ""] db_1row get_item_sort_and_parent { } db_transaction { - db_list lock_rows "select ims_item_id from ims_cp_items where parent_item=:parent_item for update" + db_list lock_rows "select ims_item_id + from ims_cp_items + where parent_item=:parent_item for update" if { $dir eq "up" } { set next_sort_order [db_string get_prev_sort_order "" -default 1] } else { set next_sort_order [db_string get_next_sort_order "" -default 1] } - db_dml swap_sort_orders " -update ims_cp_items -set sort_order = (case when sort_order = :sort_order :: integer then :next_sort_order :: integer when sort_order = :next_sort_order ::integer then :sort_order end) -where parent_item=:parent_item -and sort_order in (:sort_order, :next_sort_order) -" + db_dml swap_sort_orders "update ims_cp_items + set sort_order = + (case when sort_order = :sort_order :: integer then + :next_sort_order :: integer when sort_order = :next_sort_order ::integer then + :sort_order end) + where parent_item=:parent_item + and sort_order in (:sort_order, :next_sort_order)" - } on_error { - +} on_error { ad_return_error "Database error" "A database error occured while trying -to swap your items. Here's the error: -
-$errmsg
-
-" + to swap your items. Here's the error:
$errmsg
" ad_script_abort } Index: openacs-4/packages/lorsm/www/admin/set-custom-page.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/set-custom-page.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/set-custom-page.tcl 6 Apr 2007 15:53:05 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/set-custom-page.tcl 17 Nov 2008 13:36:44 -0000 1.2 @@ -13,24 +13,28 @@ set options [lors::items_select_options -man_id $man_id] set options [linsert $options 0 [list "-- Add New Page --" ""]] -ad_form -name set-page -export {man_id ims_item_id type} -form { - {ims_item_id:text(select),optional {label $label} {options $options}} -} -on_submit { - if {$ims_item_id eq ""} { - ad_returnredirect [export_vars -base item-add-edit {man_id type}] - ad_script_abort - } - set item_id [content::revision::item_id -revision_id $ims_item_id] +ad_form \ + -name set-page \ + -export {man_id ims_item_id type} \ + -form { + {ims_item_id:text(select),optional {label $label} {options $options}} - lorsm::set_custom_page \ - -man_id $man_id \ - -item_id $item_id \ - -type $type + } -on_submit { + if {$ims_item_id eq ""} { + ad_returnredirect [export_vars -base item-add-edit {man_id type}] + ad_script_abort + } + set item_id [content::revision::item_id -revision_id $ims_item_id] - if {$return_url eq "" } { - set return_url [export_vars -base course-structure {man_id}] - } + lorsm::set_custom_page \ + -man_id $man_id \ + -item_id $item_id \ + -type $type - ad_returnredirect $return_url - ad_script_abort -} \ No newline at end of file + if {$return_url eq "" } { + set return_url [export_vars -base course-structure {man_id}] + } + + ad_returnredirect $return_url + ad_script_abort + } Index: openacs-4/packages/lorsm/www/admin/sharer.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/sharer.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/sharer.adp 31 Dec 2006 00:36:04 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/sharer.adp 17 Nov 2008 13:36:44 -0000 1.2 @@ -1,5 +1,5 @@ - @title@ - @context@ +@title@ +@context@ - + Index: openacs-4/packages/lorsm/www/admin/sharer.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/sharer.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/sharer.tcl 31 Dec 2006 00:36:04 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/sharer.tcl 17 Nov 2008 13:36:44 -0000 1.2 @@ -1,9 +1,9 @@ # packages/lorsm/www/sharer.tcl ad_page_contract { - + Enable sharing of courses, organizations and learning objects - + @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 2004-07-09 @arch-tag: 0d48cf78-3d5d-4a39-b2e0-2f090bfbecb8 @@ -32,58 +32,74 @@ ad_form -name sharer \ -export {return_url folder_id} \ -form { - {man_id:key} - {project:text(inform) - {label "[_ lorsm.Course_Name]"} - {value {[lorsm::get_course_name -manifest_id $man_id]}} - } - {isshared:text(inform) - {label "[_ lorsm.Current_Status]"} - } - {share:text(radio) - {label Status?} - {options {{"[_ lorsm.Shared]" t} {"[_ lorsm.Not_Shared]" f}}} - } + {man_id:key} + + {project:text(inform) + {label "[_ lorsm.Course_Name]"} + {value {[lorsm::get_course_name -manifest_id $man_id]}} + } + + {isshared:text(inform) + {label "[_ lorsm.Current_Status]"} + } + + {share:text(radio) + {label Status?} + {options {{"[_ lorsm.Shared]" t} {"[_ lorsm.Not_Shared]" f}}} + } + } -select_query { - select + select case when isshared = 't' then 'Shared' else 'Not Shared' end as isshared - from ims_cp_manifests - where man_id = :man_id + from ims_cp_manifests + where man_id = :man_id + } -edit_data { - db_transaction { - db_dml do_update { - update ims_cp_manifests - set isshared = :share - where man_id = :man_id } + db_transaction { + db_dml do_update { + update ims_cp_manifests + set isshared = :share + where man_id = :man_id } - if {$share == "t"} { + if {$share == "t"} { - set party_id_students [db_string party_id {select segment_id from rel_segments \ - where rel_type = 'dotlrn_student_profile_rel'}] + set party_id_students [db_string party_id {\ + select segment_id \ + from rel_segments \ + where rel_type = 'dotlrn_student_profile_rel'}] - permission::grant -party_id $party_id_students -object_id $man_id -privilege read - permission::grant -party_id $party_id_students -object_id $folder_id -privilege read + permission::grant \ + -party_id $party_id_students \ + -object_id $man_id \ + -privilege read + permission::grant \ + -party_id $party_id_students \ + -object_id $folder_id \ + -privilege read - } else { + } else { - set party_id_students [db_string party_id {select segment_id from rel_segments \ - where rel_type = 'dotlrn_student_profile_rel'}] + set party_id_students [db_string party_id {\ + select segment_id \ + from rel_segments \ + where rel_type = 'dotlrn_student_profile_rel'}] - permission::revoke -party_id $party_id_students -object_id $man_id -privilege read - permission::revoke -party_id $party_id_students -object_id $folder_id -privilege read + permission::revoke \ + -party_id $party_id_students \ + -object_id $man_id \ + -privilege read - } - } + permission::revoke \ + -party_id $party_id_students \ + -object_id $folder_id \ + -privilege read + + } + } } -after_submit { ad_returnredirect $return_url } - - - - - - Index: openacs-4/packages/lorsm/www/admin/tracker.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/tracker.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/tracker.adp 31 Dec 2006 00:36:04 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/tracker.adp 17 Nov 2008 13:36:44 -0000 1.2 @@ -1,7 +1,7 @@ - @title@ - @context@ +@title@ +@context@ - + - + Index: openacs-4/packages/lorsm/www/admin/tracker.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/tracker.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/tracker.tcl 31 Dec 2006 00:36:04 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/tracker.tcl 17 Nov 2008 13:36:44 -0000 1.2 @@ -1,9 +1,9 @@ # packages/lorsm/www/tracker.tcl ad_page_contract { - + set a course for a class to be trackable - + @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 2004-05-25 @arch-tag 07ceb832-2053-4579-bec2-76708522707a @@ -24,38 +24,39 @@ ad_form -name tracker \ -export {package_id} \ -form { - {man_id:key} - {project:text(inform) - {label "[_ lorsm.Course_Name]"} - {value {[lorsm::get_course_name -manifest_id $man_id]}} - } - {istrackable:text(inform) - {label "[_ lorsm.Current_Status]"} - } - {enable:text(radio) - {label Status?} - {options {{"[_ lorsm.Trackable_1]" t} {"[_ lorsm.No_Thanks]" f}}} - } + {man_id:key} + + {project:text(inform) + {label "[_ lorsm.Course_Name]"} + {value {[lorsm::get_course_name -manifest_id $man_id]}} + } + + {istrackable:text(inform) + {label "[_ lorsm.Current_Status]"} + } + + {enable:text(radio) + {label Status?} + {options {{"[_ lorsm.Trackable_1]" t} {"[_ lorsm.No_Thanks]" f}}} + } + } -select_query { - select + select case when istrackable = 't' then 'Yes' else 'No' end as istrackable - from ims_cp_manifest_class - where man_id = :man_id and - lorsm_instance_id = :package_id + from ims_cp_manifest_class + where man_id = :man_id + and lorsm_instance_id = :package_id + } -edit_data { db_dml do_update " update ims_cp_manifest_class set istrackable = :enable - where man_id = :man_id and - lorsm_instance_id = :package_id" + where man_id = :man_id + and lorsm_instance_id = :package_id" + } -after_submit { ad_returnredirect [site_node::get_url_from_object_id -object_id package_id] ad_script_abort } - - - - - Index: openacs-4/packages/lorsm/www/admin/md/addmd.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/addmd.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/addmd.adp 17 Oct 2008 10:46:31 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/addmd.adp 17 Nov 2008 13:36:44 -0000 1.3 @@ -4,26 +4,27 @@

MD Schema

- +
- + + - + +
Metadata SchemaMetadata Schema
- -

Add Metadata Schema

- +
- - + + - + -
Object: @object_type@
- Add details for the metadata schema and version. -
+ Object: @object_type@
+ Add details for the metadata schema and version. +
+ Index: openacs-4/packages/lorsm/www/admin/md/addmd.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/addmd.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/addmd.tcl 31 Dec 2006 00:36:05 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/addmd.tcl 17 Nov 2008 13:36:44 -0000 1.2 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/addmd.tcl ad_page_contract { - + Add metadata schema - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 2004-11-13 @@ -20,7 +20,11 @@ set object_type [acs_object_type $ims_md_id] # set context & title -set context [list [list [export_vars -base "." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] "[_ lorsm.lt_Edit_Metadata_Schema_]"] +set context [list \ + [list [export_vars -base "." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + "[_ lorsm.lt_Edit_Metadata_Schema_]"] + set title "[_ lorsm.lt_AddEdit_MD_Schema_and]" @@ -29,107 +33,90 @@ -cancel_url ".." \ -mode edit \ -form { + {schema:text,nospell + {html {size 20}} + {help_text "[_ lorsm.lt_Metadata_schema_ie_IM]"} + {label "[_ lorsm.Schema]"} + } - {schema:text,nospell - {html {size 20}} - {help_text "[_ lorsm.lt_Metadata_schema_ie_IM]"} - {label "[_ lorsm.Schema]"} - } + {schemaversion:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Version_of_the_Schema]"} + {label "[_ lorsm.Schema_Version]"} + } - {schemaversion:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Version_of_the_Schema]"} - {label "[_ lorsm.Schema_Version]"} - } + {ims_md_id:text(hidden) {value $ims_md_id}} - {ims_md_id:text(hidden) {value $ims_md_id}} + } -on_submit { + db_transaction { + if {![lors::imsmd::mdExist -ims_md_id $ims_md_id]} { + db_dml do_insert \ + "insert into ims_md(ims_md_id, schema, schemaversion) + values (:ims_md_id, :schema, :schemaversion)" + } else { + db_dml do_update { + update ims_md + set schema = :schema, schemaversion = :schemaversion + where ims_md_id = :ims_md_id + } + } -} -on_submit { - db_transaction { + # If the object_type is on any of the IMS CP object types, + # then we update also the ims cp tables accordingly. - if {![lors::imsmd::mdExist -ims_md_id $ims_md_id]} { + switch $object_type { + "ims_manifest_object" { + db_dml upd_manifest " + update ims_cp_manifests set hasmetadata = 't' + where man_id = :ims_md_id" - db_dml do_insert " - insert into ims_md(ims_md_id, schema, schemaversion) - values (:ims_md_id, :schema, :schemaversion)" + } "ims_item_object" { + db_dml upd_item " + update ims_cp_items set hasmetadata = 't' + where ims_item_id = :ims_md_id" - } else { + } "ims_organization_object" { + db_dml upd_organization " + update ims_cp_organizations set hasmetadata = 't' + where org_id = :ims_md_id" - db_dml do_update { - update ims_md set schema = :schema, schemaversion = :schemaversion - where ims_md_id = :ims_md_id - } + } "ims_resource_object" { + db_dml upd_resource " + update ims_cp_resources set hasmetadata = 't' + where res_id = :ims_md_id" - } - - # If the object_type is on any of the IMS CP object types, - # then we update also the ims cp tables accordingly. + } "content_item" { + db_dml upd_file " + update ims_cp_files set hasmetadata = 't' + where file_id = :ims_md_id" + } + } + } - switch $object_type { - - "ims_manifest_object" { - - db_dml upd_manifest " - update ims_cp_manifests set hasmetadata = 't' - where man_id = :ims_md_id" - } - "ims_item_object" { - - db_dml upd_item " - update ims_cp_items set hasmetadata = 't' - where ims_item_id = :ims_md_id" - } - "ims_organization_object" { - - db_dml upd_organization " - update ims_cp_organizations set hasmetadata = 't' - where org_id = :ims_md_id" - } - "ims_resource_object" { - - db_dml upd_resource " - update ims_cp_resources set hasmetadata = 't' - where res_id = :ims_md_id" - } - "content_item" { - - db_dml upd_file " - update ims_cp_files set hasmetadata = 't' - where file_id = :ims_md_id" - } - - } + } -after_submit { + ad_returnredirect [export_vars -base "." ims_md_id] + ad_script_abort } -} -after_submit { - ad_returnredirect [export_vars -base "." ims_md_id] - ad_script_abort -} - # MD Schema Info template::list::create \ -name md_schema_info \ -multirow md_schema_info \ -no_data "[_ lorsm.No_Schema_Available]" \ - -html { align right style "width: 100%;" } \ - -elements { - schema { + -html { align right style "width: 100%;" } \ + -elements { + schema { label "[_ lorsm.Schema_1]" - html { align center } - } - schemaversion { + html { align center } + + } schemaversion { label "[_ lorsm.Version_1]" - html { align center } - } - } + html { align center } + } + } - db_multirow md_schema_info select_md_schema { - select - schema, - schemaversion - from - ims_md - where - ims_md_id = :ims_md_id - } - +db_multirow md_schema_info select_md_schema { + select schema, schemaversion + from ims_md + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/annotationmd.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/annotationmd.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/annotationmd.adp 31 Dec 2006 00:36:05 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/annotationmd.adp 17 Nov 2008 13:36:44 -0000 1.2 @@ -2,15 +2,12 @@ @title;noquote@ @context;noquote@ - + - +
+ - + + - - - - -
Annotation Metadata
Annotation MetadataAnnotations:
Annotations:
+ Index: openacs-4/packages/lorsm/www/admin/md/annotationmd.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/annotationmd.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/annotationmd.tcl 6 Mar 2008 13:56:57 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/annotationmd.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -11,35 +11,35 @@ } # set context & title -set context [list [list [export_vars -base "." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] "[_ lorsm.Annotation_MD]"] +set context [list \ + [list [export_vars -base "." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + "[_ lorsm.Annotation_MD]"] set title "[_ lorsm.Annotation_MD]" # Annotation template::list::create \ -name d_an_annot \ -multirow d_an_annot \ -no_data "[_ lorsm.lt_No_Annotation_Availab]" \ - -actions [list "[_ lorsm.Add_Annotation]" [export_vars -base annotationmd/annotation_add {ims_md_id}] "[_ lorsm.lt_Add_another_Annotatio_1]"] \ + -actions [list "[_ lorsm.Add_Annotation]" \ + [export_vars -base annotationmd/annotation_add {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Annotatio_1]"] \ -html { style "width: 100%; align:right;" } \ -elements { - entity { - label "[_ lorsm.Entry_1]" - } - export { + entity { label "[_ lorsm.Entry_1]" } + export { display_eval {\[View\]} - link_url_eval { [export_vars -base "annotationmd/annotation" {ims_md_an_id ims_md_id}] } + link_url_eval { [export_vars \ + -base "annotationmd/annotation" \ + {ims_md_an_id ims_md_id}] } link_html {title "[_ lorsm.lt_View_associated_Annot]"} html { align center } } } db_multirow d_an_annot select_an_annot { -select - entity, - ims_md_an_id, - ims_md_id -from - ims_md_annotation -where - ims_md_id = :ims_md_id -} + select entity, ims_md_an_id, ims_md_id + from ims_md_annotation + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/classificationmd.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/classificationmd.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/classificationmd.adp 31 Dec 2006 00:36:05 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/classificationmd.adp 17 Nov 2008 13:36:44 -0000 1.2 @@ -2,15 +2,14 @@ @title;noquote@ @context;noquote@ - + - +
- - - -
Classification Metadata
Classifications:
+ Classifications: + + + Index: openacs-4/packages/lorsm/www/admin/md/classificationmd.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/classificationmd.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/classificationmd.tcl 6 Mar 2008 13:56:57 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/classificationmd.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -11,39 +11,37 @@ } # set context & title -set context [list [list [export_vars -base "." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] "[_ lorsm.Classification_MD]"] +set context [list \ + [list [export_vars -base "." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + "[_ lorsm.Classification_MD]"] set title "[_ lorsm.Classification_MD]" # Classification template::list::create \ -name d_cl_class \ -multirow d_cl_class \ -no_data "[_ lorsm.lt_No_Classification_Ava]" \ - -actions [list "[_ lorsm.Add_Classification]" [export_vars -base classificationmd/classification_add {ims_md_id}] "[_ lorsm.lt_Add_another_Classific_2]"] \ + -actions [list "[_ lorsm.Add_Classification]" \ + [export_vars \ + -base classificationmd/classification_add {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Classific_2]"] \ -html { style "width: 100%; align:right;" } \ -elements { - purpose_s { - label "" - } - purpose_v { - label "" - } - export { + purpose_s { label "" } + purpose_v { label "" } + export { display_eval {\[View\]} - link_url_eval { [export_vars -base "classificationmd/classification" {ims_md_cl_id ims_md_id}] } + link_url_eval { [export_vars \ + -base "classificationmd/classification" \ + {ims_md_cl_id ims_md_id}] } link_html {title "[_ lorsm.lt_View_associated_Class]"} html { align center } } } db_multirow d_cl_class select_cl_class { -select - purpose_s, - purpose_v, - ims_md_cl_id, - ims_md_id -from - ims_md_classification -where - ims_md_id = :ims_md_id -} + select purpose_s, purpose_v, ims_md_cl_id, ims_md_id + from ims_md_classification + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/educationalmd.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/educationalmd.adp 31 Dec 2006 00:36:05 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd.adp 17 Nov 2008 13:36:44 -0000 1.2 @@ -2,68 +2,65 @@ @title;noquote@ @context;noquote@ - + - +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - -
#lorsm.Educational_Metadata##lorsm.Educational_Metadata#
#lorsm.Interactivity_Type#
#lorsm.Interactivity_Type#
#lorsm.lt_Learning_Resource_Typ#
#lorsm.lt_Learning_Resource_Typ#
#lorsm.Interactivity_Level#
#lorsm.Interactivity_Level#
#lorsm.Semantic_Density#
#lorsm.Semantic_Density#
#lorsm.lt_Intended_End_User_Rol#
#lorsm.lt_Intended_End_User_Rol#
#lorsm.Context#
#lorsm.Context#
#lorsm.Typical_Age_Range#
#lorsm.Typical_Age_Range#
#lorsm.Difficulty#
#lorsm.Difficulty#
#lorsm.lt_Typical_Learning_Time#
#lorsm.lt_Typical_Learning_Time#
#lorsm.Description#
#lorsm.Description#
#lorsm.Language#
- + #lorsm.Language# + + + Index: openacs-4/packages/lorsm/www/admin/md/educationalmd.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/educationalmd.tcl 6 Mar 2008 13:56:57 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -10,251 +10,219 @@ } # set context & title -set context [list [list [export_vars -base "." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] "[_ lorsm.Educational_MD]"] +set context [list \ + [list [export_vars -base "." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + "[_ lorsm.Educational_MD]"] set title "[_ lorsm.Educational_MD]" # Educational Interactivity Type template::list::create \ -name d_ed_intt \ -multirow d_ed_intt \ -no_data "[_ lorsm.lt_No_Interactivity_Type]" \ - -actions [list "[_ lorsm.lt_Add_Interactivity_Typ]" [export_vars -base educationalmd/educational_intt {ims_md_id}] "[_ lorsm.lt_Add_another_Interacti]"] \ + -actions [list "[_ lorsm.lt_Add_Interactivity_Typ]" \ + [export_vars -base educationalmd/educational_intt {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Interacti]"] \ -html { style "width: 100%; align:right;" } \ -elements { - intt { - label "" - } + intt { label "" } } db_multirow d_ed_intt select_ed_intt { - select - '[' || int_type_s || '] ' || int_type_v as intt - from - ims_md_educational - where - ims_md_id = :ims_md_id -} + select '[' || int_type_s || '] ' || int_type_v as intt + from ims_md_educational + where ims_md_id = :ims_md_id +} # Educational Learning Resource Type template::list::create \ -name d_ed_lrt \ -multirow d_ed_lrt \ -no_data "[_ lorsm.lt_No_Learning_Resource_]" \ - -actions [list "[_ lorsm.lt_Add_Learning_Resource]" [export_vars -base educationalmd/educational_lrt {ims_md_id}] "[_ lorsm.lt_Add_another_Learning_]"] \ + -actions [list "[_ lorsm.lt_Add_Learning_Resource]" \ + [export_vars -base educationalmd/educational_lrt {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Learning_]"] \ -html { style "width: 100%; align:right;" } \ -elements { - lrt { - label "" - } + lrt { label "" } } db_multirow d_ed_lrt select_ed_lrt { - select - '[' || lrt_s || '] ' || lrt_v as lrt - from - ims_md_educational_lrt - where - ims_md_id = :ims_md_id -} + select '[' || lrt_s || '] ' || lrt_v as lrt + from ims_md_educational_lrt + where ims_md_id = :ims_md_id +} # Educational Interactivity Level template::list::create \ -name d_ed_intl \ -multirow d_ed_intl \ -no_data "[_ lorsm.lt_No_Interactivity_Leve]" \ - -actions [list "[_ lorsm.lt_Add_Interactivity_Lev]" [export_vars -base educationalmd/educational_intl {ims_md_id}] "[_ lorsm.lt_Add_another_Interacti_1]"] \ + -actions [list "[_ lorsm.lt_Add_Interactivity_Lev]" \ + [export_vars -base educationalmd/educational_intl {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Interacti_1]"] \ -html { style "width: 100%; align:right;" } \ -elements { - intl { - label "" - } + intl { label "" } } db_multirow d_ed_intl select_ed_intl { - select - '[' || int_level_s || '] ' || int_level_v as intl - from - ims_md_educational - where - ims_md_id = :ims_md_id -} + select '[' || int_level_s || '] ' || int_level_v as intl + from ims_md_educational + where ims_md_id = :ims_md_id +} # Educational Semantic Density template::list::create \ -name d_ed_semd \ -multirow d_ed_semd \ -no_data "[_ lorsm.lt_No_Semantic_Density_A]" \ - -actions [list "[_ lorsm.Add_Semantic_Density]" [export_vars -base educationalmd/educational_semd {ims_md_id}] "[_ lorsm.lt_Add_another_Semantic_]"] \ + -actions [list "[_ lorsm.Add_Semantic_Density]" \ + [export_vars -base educationalmd/educational_semd {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Semantic_]"] \ -html { style "width: 100%; align:right;" } \ -elements { - semd { - label "" - } + semd { label "" } } db_multirow d_ed_semd select_ed_semd { - select - '[' || sem_density_s || '] ' || sem_density_v as semd - from - ims_md_educational - where - ims_md_id = :ims_md_id -} + select '[' || sem_density_s || '] ' || sem_density_v as semd + from ims_md_educational + where ims_md_id = :ims_md_id +} # Educational Intended End User Role template::list::create \ -name d_ed_ieur \ -multirow d_ed_ieur \ -no_data "[_ lorsm.lt_No_Intended_End_User_]" \ - -actions [list "[_ lorsm.lt_Add_Intended_End_User]" [export_vars -base educationalmd/educational_ieur {ims_md_id}] "[_ lorsm.lt_Add_another_Intended_]"] \ + -actions [list "[_ lorsm.lt_Add_Intended_End_User]" \ + [export_vars -base educationalmd/educational_ieur {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Intended_]"] \ -html { style "width: 100%; align:right;" } \ -elements { - ieur { - label "" - } + ieur { label "" } } db_multirow d_ed_ieur select_ed_ieur { - select - '[' || ieur_s || '] ' || ieur_v as ieur - from - ims_md_educational_ieur - where - ims_md_id = :ims_md_id -} + select '[' || ieur_s || '] ' || ieur_v as ieur + from ims_md_educational_ieur + where ims_md_id = :ims_md_id +} # Educational Context template::list::create \ -name d_ed_cont \ -multirow d_ed_cont \ -no_data "[_ lorsm.No_Context_Available]" \ - -actions [list "[_ lorsm.Add_Context]" [export_vars -base educationalmd/educational_cont {ims_md_id}] "[_ lorsm.Add_another_Context]"] \ + -actions [list "[_ lorsm.Add_Context]" \ + [export_vars -base educationalmd/educational_cont {ims_md_id}] \ + "[_ lorsm.Add_another_Context]"] \ -html { style "width: 100%; align:right;" } \ -elements { - context { - label "" - } + context { label "" } } db_multirow d_ed_cont select_ed_cont { - select - '[' || context_s || '] ' || context_v as context - from - ims_md_educational_context - where - ims_md_id = :ims_md_id -} + select '[' || context_s || '] ' || context_v as context + from ims_md_educational_context + where ims_md_id = :ims_md_id +} # Educational Typical Age Range template::list::create \ -name d_ed_tar \ -multirow d_ed_tar \ -no_data "[_ lorsm.lt_No_Typical_Age_Range_]" \ - -actions [list "[_ lorsm.lt_Add_Typical_Age_Range]" [export_vars -base educationalmd/educational_tar {ims_md_id}] "[_ lorsm.lt_Add_another_Typical_A]"] \ + -actions [list "[_ lorsm.lt_Add_Typical_Age_Range]" \ + [export_vars -base educationalmd/educational_tar {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Typical_A]"] \ -html { style "width: 100%; align:right;" } \ -elements { - tar { - label "" - } + tar { label "" } } db_multirow d_ed_tar select_ed_tar { - select - '[' || tar_l || '] ' || tar_s as tar - from - ims_md_educational_tar - where - ims_md_id = :ims_md_id -} + select '[' || tar_l || '] ' || tar_s as tar + from ims_md_educational_tar + where ims_md_id = :ims_md_id +} # Educational Difficulty template::list::create \ -name d_ed_dif \ -multirow d_ed_dif \ -no_data "[_ lorsm.lt_No_Difficulty_Availab]" \ - -actions [list "[_ lorsm.Add_Difficulty_Type]" [export_vars -base educationalmd/educational_dif {ims_md_id}] "[_ lorsm.lt_Add_another_Difficult]"] \ + -actions [list "[_ lorsm.Add_Difficulty_Type]" \ + [export_vars -base educationalmd/educational_dif {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Difficult]"] \ -html { style "width: 100%; align:right;" } \ -elements { - diff { - label "" - } + diff { label "" } } db_multirow d_ed_dif select_ed_dif { - select - '[' || difficulty_s || '] ' || difficulty_v as diff - from - ims_md_educational - where - ims_md_id = :ims_md_id -} + select '[' || difficulty_s || '] ' || difficulty_v as diff + from ims_md_educational + where ims_md_id = :ims_md_id +} # Educational Typical Learning Time template::list::create \ -name d_ed_tlt \ -multirow d_ed_tlt \ -no_data "[_ lorsm.lt_No_Typical_Learning_T]" \ - -actions [list "[_ lorsm.lt_Add_Typical_Learning_]" [export_vars -base educationalmd/educational_tlt {ims_md_id}] "[_ lorsm.lt_Add_another_Typical_L]"] \ + -actions [list "[_ lorsm.lt_Add_Typical_Learning_]" \ + [export_vars -base educationalmd/educational_tlt {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Typical_L]"] \ -html { style "width: 100%; align:right;" } \ -elements { - tlt { - label "" - } - tlt_ls { - label "" - } + tlt { label "" } + tlt_ls { label "" } } db_multirow d_ed_tlt select_ed_tlt { - select - type_lrn_time as tlt, - '[' || type_lrn_time_l || '] ' || type_lrn_time_s as tlt_ls - from - ims_md_educational - where - ims_md_id = :ims_md_id -} + select type_lrn_time as tlt, + '[' || type_lrn_time_l || '] ' || type_lrn_time_s as tlt_ls + from ims_md_educational + where ims_md_id = :ims_md_id +} # Educational Description template::list::create \ -name d_ed_desc \ -multirow d_ed_desc \ -no_data "[_ lorsm.lt_No_Description_Availa]" \ - -actions [list "[_ lorsm.Add_Description]" [export_vars -base educationalmd/educational_desc {ims_md_id}] "[_ lorsm.lt_Add_another_Descripti]"] \ + -actions [list "[_ lorsm.Add_Description]" \ + [export_vars -base educationalmd/educational_desc {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Descripti]"] \ -html { style "width: 100%; align:right;" } \ -elements { - desc { - label "" - } + desc { label "" } } db_multirow d_ed_desc select_ed_desc { - select - '[' || descrip_l || '] ' || descrip_s as desc - from - ims_md_educational_descrip - where - ims_md_id = :ims_md_id -} + select '[' || descrip_l || '] ' || descrip_s as desc + from ims_md_educational_descrip + where ims_md_id = :ims_md_id +} # Educational Language template::list::create \ -name d_ed_lang \ -multirow d_ed_lang \ -no_data "[_ lorsm.lt_No_Language_Available]" \ - -actions [list "[_ lorsm.Add_Language]" [export_vars -base educationalmd/educational_lang {ims_md_id}] "[_ lorsm.Add_another_Language]"] \ + -actions [list "[_ lorsm.Add_Language]" \ + [export_vars -base educationalmd/educational_lang {ims_md_id}] \ + "[_ lorsm.Add_another_Language]"] \ -html { style "width: 100%; align:right;" } \ -elements { - language { - label "" - } + language { label "" } } db_multirow d_ed_lang select_ed_lang { - select - language - from - ims_md_educational_lang - where - ims_md_id = :ims_md_id + select language + from ims_md_educational_lang + where ims_md_id = :ims_md_id } Index: openacs-4/packages/lorsm/www/admin/md/generalmd.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/generalmd.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/generalmd.adp 31 Dec 2006 00:36:05 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/generalmd.adp 17 Nov 2008 13:36:44 -0000 1.2 @@ -2,37 +2,36 @@ @title;noquote@ @context;noquote@ - + - +
- + - - - + + + - - + + - - + + - - + + - - - + + + @@ -48,6 +47,4 @@ - -
#lorsm.General_Metadata##lorsm.General_Metadata#
#lorsm.Titles#
#lorsm.Titles#
#lorsm.Catalog-Entries# #lorsm.Catalog-Entries#
#lorsm.Languages# #lorsm.Languages#
#lorsm.Descriptions# #lorsm.Descriptions#
#lorsm.Keywords#
#lorsm.Keywords#
#lorsm.Coverage# #lorsm.Aggregation_Level#
- + Index: openacs-4/packages/lorsm/www/admin/md/generalmd.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/generalmd.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/generalmd.tcl 6 Mar 2008 13:56:57 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/generalmd.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -12,32 +12,31 @@ } # set context & title -set context [list [list [export_vars -base "." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] "[_ lorsm.General_MD]"] +set context [list \ + [list [export_vars -base "." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + "[_ lorsm.General_MD]"] + set title "[_ lorsm.General_MD]" # General Title template::list::create \ -name d_gen_titles \ -multirow d_gen_titles \ -no_data "[_ lorsm.No_Titles_Available]" \ - -actions [list "[_ lorsm.Add_Title]" [export_vars -base generalmd/general_title {ims_md_id}] "[_ lorsm.Add_another_title]"] \ + -actions [list "[_ lorsm.Add_Title]" \ + [export_vars -base generalmd/general_title {ims_md_id}] \ + "[_ lorsm.Add_another_title]"] \ -html { style "width: 100%; align: right" } \ -elements { - title_l { - label "" - } - title_s { - label "" - } + title_l { label "" } + title_s { label "" } } db_multirow d_gen_titles select_ge_titles { - select title_l, - title_s - from - ims_md_general_title - where - ims_md_id = :ims_md_id + select title_l, title_s + from ims_md_general_title + where ims_md_id = :ims_md_id } { set item_url [export_vars -base "item" { ims_md_id }] } @@ -47,55 +46,41 @@ -name d_gen_desc \ -multirow d_gen_desc \ -no_data "[_ lorsm.lt_No_Description_Availa]" \ - -actions [list "[_ lorsm.Add_Description]" [export_vars -base generalmd/general_desc {ims_md_id}] "[_ lorsm.lt_Add_another_Descripti]"] \ + -actions [list "[_ lorsm.Add_Description]" \ + [export_vars -base generalmd/general_desc {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Descripti]"] \ -html { style "width: 100%; align: right;" } \ -elements { - descrip_l { - label "" - } - descrip_s { - label "" - } + descrip_l { label "" } + descrip_s { label "" } } db_multirow d_gen_desc select_ge_desc { - select descrip_l, - descrip_s - from - ims_md_general_desc - where - ims_md_id = :ims_md_id -} + select descrip_l, descrip_s + from ims_md_general_desc + where ims_md_id = :ims_md_id +} # General Catalog-entry template::list::create \ -name d_gen_cata \ -multirow d_gen_cata \ -no_data "[_ lorsm.lt_No_Catalog_Entry_Avai]" \ - -actions [list "[_ lorsm.Add_Catalog-Entry]" [export_vars -base generalmd/general_cata {ims_md_id}] "[_ lorsm.lt_Add_another_Catalog-E]"] \ + -actions [list "[_ lorsm.Add_Catalog-Entry]" \ + [export_vars -base generalmd/general_cata {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Catalog-E]"] \ -html { style "width: 100%; align: right;" } \ -elements { - catalog { - label "" - } - entry_l { - label "" - } - entry_s { - label "" - } + catalog { label "" } + entry_l { label "" } + entry_s { label "" } } db_multirow d_gen_cata select_ge_cata { - select - catalog, - entry_l, - entry_s - from - ims_md_general_cata - where - ims_md_id = :ims_md_id -} + select catalog, entry_l, entry_s + from ims_md_general_cata + where ims_md_id = :ims_md_id +} @@ -104,99 +89,78 @@ -name d_gen_lang \ -multirow d_gen_lang \ -no_data "[_ lorsm.lt_No_Language_Available]" \ - -actions [list "[_ lorsm.Add_Language]" [export_vars -base generalmd/general_lang {ims_md_id}] "[_ lorsm.Add_another_Language]"] \ + -actions [list "[_ lorsm.Add_Language]" \ + [export_vars -base generalmd/general_lang {ims_md_id}] \ + "[_ lorsm.Add_another_Language]"] \ -html { style "width: 100%; align:right;" } \ -elements { - language { - label "" - } + language { label "" } } db_multirow d_gen_lang select_ge_lang { - select - language - from - ims_md_general_lang - where - ims_md_id = :ims_md_id -} + select language + from ims_md_general_lang + where ims_md_id = :ims_md_id +} # General Keywords template::list::create \ -name d_gen_key \ -multirow d_gen_key \ -no_data "[_ lorsm.lt_No_Keywords_Available]" \ - -actions [list "[_ lorsm.Add_Keywords]" [export_vars -base generalmd/general_key {ims_md_id}] "[_ lorsm.Add_another_Keywords]"] \ + -actions [list "[_ lorsm.Add_Keywords]" \ + [export_vars -base generalmd/general_key {ims_md_id}] \ + "[_ lorsm.Add_another_Keywords]"] \ -html { style "width: 100%; align:right" } \ -elements { - keyword_l { - label "" - } - keyword_s { - label "" - } + keyword_l { label "" } + keyword_s { label "" } } db_multirow d_gen_key select_ge_key { - select - keyword_l, - keyword_s - from - ims_md_general_key - where - ims_md_id = :ims_md_id -} + select keyword_l, keyword_s + from ims_md_general_key + where ims_md_id = :ims_md_id +} # General Coverage template::list::create \ -name d_gen_cover \ -multirow d_gen_cover \ -no_data "[_ lorsm.lt_No_Coverage_Available]" \ - -actions [list "[_ lorsm.Add_Coverage]" [export_vars -base generalmd/general_cover {ims_md_id}] "[_ lorsm.Add_another_Coverage]"] \ + -actions [list "[_ lorsm.Add_Coverage]" \ + [export_vars -base generalmd/general_cover {ims_md_id}] \ + "[_ lorsm.Add_another_Coverage]"] \ -html { style "width: 100%; align:right;" } \ -elements { - cover_l { - label "" - } - cover_s { - label "" - } + cover_l { label "" } + cover_s { label "" } } db_multirow d_gen_cover select_ge_cover { - select - cover_l, - cover_s - from - ims_md_general_cover - where - ims_md_id = :ims_md_id + select cover_l, cover_s + from ims_md_general_cover + where ims_md_id = :ims_md_id } # General Structure template::list::create \ -name d_gen_struc \ -multirow d_gen_struc \ -no_data "[_ lorsm.lt_No_Structure_Availabl]" \ - -actions [list "[_ lorsm.Add_Structure]" [export_vars -base generalmd/general_struc {ims_md_id}] "[_ lorsm.lt_Add_another_Structure]"] \ + -actions [list "[_ lorsm.Add_Structure]" \ + [export_vars -base generalmd/general_struc {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Structure]"] \ -html { style "width: 100%; align:right;" } \ -elements { - structure_s { - label "" - } - structure_v { - label "" - } + structure_s { label "" } + structure_v { label "" } } db_multirow d_gen_struc select_ge_struc { - select - structure_s, - structure_v - from - ims_md_general - where - ims_md_id = :ims_md_id + select structure_s, structure_v + from ims_md_general + where ims_md_id = :ims_md_id } @@ -205,23 +169,17 @@ -name d_gen_aggl \ -multirow d_gen_aggl \ -no_data "[_ lorsm.lt_No_Aggregation_Level_]" \ - -actions [list "[_ lorsm.lt_Add_Aggregation_Level]" [export_vars -base generalmd/general_aggl {ims_md_id}] "[_ lorsm.lt_Add_another_Aggregati]"] \ + -actions [list "[_ lorsm.lt_Add_Aggregation_Level]" \ + [export_vars -base generalmd/general_aggl {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Aggregati]"] \ -html { style "width: 100%; align: right;" } \ -elements { - agg_level_s { - label "" - } - agg_level_v { - label "" - } + agg_level_s { label "" } + agg_level_v { label "" } } db_multirow d_gen_aggl select_ge_aggl { - select - agg_level_s, - agg_level_v - from - ims_md_general - where - ims_md_id = :ims_md_id + select agg_level_s, agg_level_v + from ims_md_general + where ims_md_id = :ims_md_id } Index: openacs-4/packages/lorsm/www/admin/md/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/index.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/index.adp 6 Mar 2008 13:56:57 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/index.adp 17 Nov 2008 13:36:44 -0000 1.3 @@ -3,25 +3,25 @@ @context;noquote@ - + +

+ + #lorsm.You_can# + #lorsm.lt_upload_a_XML_LOM_meta# + #lorsm.lt_to_addchange_the_meta# + +
-

- - #lorsm.You_can# #lorsm.lt_upload_a_XML_LOM_meta# #lorsm.lt_to_addchange_the_meta# + #lorsm.lt_Heres_a_link_to_the_a# -
- - #lorsm.lt_Heres_a_link_to_the_a# - - - -

-#lorsm.lt_No_metadata_record_ex# - -

-
+

+ #lorsm.lt_No_metadata_record_ex# + +

+
Index: openacs-4/packages/lorsm/www/admin/md/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/index.tcl 31 Dec 2006 00:36:05 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/index.tcl 17 Nov 2008 13:36:44 -0000 1.2 @@ -1,5 +1,5 @@ ad_page_contract { - Displays/Adds IMS Metadata + Displays/Adds IMS Metadata @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 19 January 2004 @@ -17,5 +17,12 @@ set hasmetadata [lors::imsmd::mdExist -ims_md_id $ims_md_id] set object_type [acs_object_type $ims_md_id] -set write_p [permission::permission_p -party_id [ad_conn user_id] -object_id $ims_md_id -privilege write] -set read_p [permission::permission_p -party_id [ad_conn user_id] -object_id $ims_md_id -privilege read] +set write_p [permission::permission_p \ + -party_id [ad_conn user_id] \ + -object_id $ims_md_id \ + -privilege write] + +set read_p [permission::permission_p \ + -party_id [ad_conn user_id] \ + -object_id $ims_md_id \ + -privilege read] Index: openacs-4/packages/lorsm/www/admin/md/lifecyclemd.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/lifecyclemd.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/lifecyclemd.adp 31 Dec 2006 00:36:05 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/lifecyclemd.adp 17 Nov 2008 13:36:44 -0000 1.2 @@ -2,28 +2,26 @@ @title;noquote@ @context;noquote@ - + - +
- + + - - - + + + - - - + + + - - - + + + +
#lorsm.Lifecycle_Metadata##lorsm.Lifecycle_Metadata#
#lorsm.Version#
#lorsm.Version#
#lorsm.Status#
#lorsm.Status#
#lorsm.Contribution#
#lorsm.Contribution#
- - - Index: openacs-4/packages/lorsm/www/admin/md/lifecyclemd.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/lifecyclemd.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/lifecyclemd.tcl 6 Mar 2008 13:56:57 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/lifecyclemd.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -10,7 +10,11 @@ } # set context & title -set context [list [list [export_vars -base "." ims_md_id] "IMS Metadata Editor"] "Lifecycle MD"] +set context [list \ + [list \ + [export_vars -base "." ims_md_id] \ + "IMS Metadata Editor"] \ + "Lifecycle MD"] set title "Lifecycle MD" @@ -19,85 +23,63 @@ -name d_lf_ver \ -multirow d_lf_ver \ -no_data "[_ lorsm.No_Version_Available]" \ - -actions [list "[_ lorsm.Add_Version]" [export_vars -base lifecyclemd/lifecycle_version {ims_md_id}] "[_ lorsm.Add_Version]"] \ + -actions [list "[_ lorsm.Add_Version]" \ + [export_vars -base lifecyclemd/lifecycle_version {ims_md_id}] \ + "[_ lorsm.Add_Version]"] \ -html { style "width: 100%; align:right;" } \ -elements { - version_l { - label "" - } - version_s { - label "" - } + version_l { label "" } + version_s { label "" } } db_multirow d_lf_ver select_lf_ver { - select version_l, - version_s - from - ims_md_life_cycle - where - ims_md_id = :ims_md_id -} + select version_l, version_s + from ims_md_life_cycle + where ims_md_id = :ims_md_id +} # Lifecycle status template::list::create \ -name d_lf_stat \ -multirow d_lf_stat \ -no_data "[_ lorsm.No_Status_Available]" \ - -actions [list "[_ lorsm.Add_Status]" [export_vars -base lifecyclemd/lifecycle_stat {ims_md_id}] "[_ lorsm.Add_Status]"] \ + -actions [list "[_ lorsm.Add_Status]" \ + [export_vars -base lifecyclemd/lifecycle_stat {ims_md_id}] \ + "[_ lorsm.Add_Status]"] \ -html { style "width: 100%; align:right" } \ -elements { - status_s { - label "" - } - status_v { - label "" - } + status_s { label "" } + status_v { label "" } } db_multirow d_lf_stat select_lf_stat { - select status_s, - status_v - from - ims_md_life_cycle - where - ims_md_id = :ims_md_id -} + select status_s, status_v + from ims_md_life_cycle + where ims_md_id = :ims_md_id +} # Lifecycle Contrib template::list::create \ -name d_lf_cont \ -multirow d_lf_cont \ -no_data "[_ lorsm.lt_No_Contributors_Avail]" \ - -actions [list "[_ lorsm.Add_Contributors]" [export_vars -base lifecyclemd/lifecycle_cont {ims_md_id}] "[_ lorsm.lt_Add_another_Contribut]"] \ + -actions [list "[_ lorsm.Add_Contributors]" \ + [export_vars -base lifecyclemd/lifecycle_cont {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Contribut]"] \ -html { style "width: 100%; align:right;" } \ -elements { - role { - label "[_ lorsm.Role]" - } - entity { - label "[_ lorsm.Entity_1]" - } - cont_date { - label "[_ lorsm.Contribution_Date]" - } - cont_date_ls { - label "[_ lorsm.Description_1]" - } + role { label "[_ lorsm.Role]" } + entity { label "[_ lorsm.Entity_1]" } + cont_date { label "[_ lorsm.Contribution_Date]" } + cont_date_ls { label "[_ lorsm.Description_1]" } } db_multirow d_lf_cont select_lf_cont { -select - lfc.role_v || ' ' || '[' || lfc.role_s || ']' as role, - lfce.entity, - lfc.cont_date, - '[' || lfc.cont_date_l || ']' || ' ' || lfc.cont_date_s as cont_date_ls -from - ims_md_life_cycle_contrib lfc, - ims_md_life_cycle_contrib_entity lfce -where - lfc.ims_md_lf_cont_id = lfce.ims_md_lf_cont_id -and - lfc.ims_md_id = :ims_md_id -} + select lfc.role_v || ' ' || '[' || lfc.role_s || ']' as role, + lfce.entity, lfc.cont_date, + '[' || lfc.cont_date_l || ']' || ' ' || lfc.cont_date_s as cont_date_ls + from ims_md_life_cycle_contrib lfc, ims_md_life_cycle_contrib_entity lfce + where lfc.ims_md_lf_cont_id = lfce.ims_md_lf_cont_id + and lfc.ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/metamd.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/metamd.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/metamd.adp 31 Dec 2006 00:36:05 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/metamd.adp 17 Nov 2008 13:36:44 -0000 1.2 @@ -2,33 +2,32 @@ @title;noquote@ @context;noquote@ - + - +
- + + - - - + + + - - - + + + - - - + + + - - - + + + +
#lorsm.Meta_Metadata##lorsm.Meta_Metadata#
#lorsm.Catalog-Entries#
#lorsm.Catalog-Entries#
#lorsm.Contribution#
#lorsm.Contribution#
#lorsm.Scheme#
#lorsm.Scheme#
#lorsm.Language#
#lorsm.Language#
- - Index: openacs-4/packages/lorsm/www/admin/md/metamd.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/metamd.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/metamd.tcl 6 Mar 2008 13:56:57 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/metamd.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -10,113 +10,94 @@ } # set context & title -set context [list [list [export_vars -base "." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] "[_ lorsm.Meta_Metadata]"] +set context [list \ + [list [export_vars -base "." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + "[_ lorsm.Meta_Metadata]"] set title "[_ lorsm.Meta_MD]" # Metametadata Catalogentry template::list::create \ -name d_md_cata \ -multirow d_md_cata \ -no_data "[_ lorsm.lt_No_Catalog_Entry_Avai]" \ - -actions [list "[_ lorsm.Add_Catalog-Entry]" [export_vars -base metamd/meta_cata {ims_md_id}] "[_ lorsm.lt_Add_another_Catalog-E]"] \ + -actions [list "[_ lorsm.Add_Catalog-Entry]" \ + [export_vars -base metamd/meta_cata {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Catalog-E]"] \ + -html { style "width: 100%; align: right;" } \ -elements { - catalog { - label "[_ lorsm.Catalog_1]" - } - entry_ls { - label "[_ lorsm.Language_Entry]" - } + catalog { label "[_ lorsm.Catalog_1]" } + entry_ls { label "[_ lorsm.Language_Entry]" } } db_multirow d_md_cata select_md_cata { - select - catalog, - '[' || entry_l || ']' || ' ' || entry_s as entry_ls - from - ims_md_metadata_cata - where - ims_md_id = :ims_md_id -} + select catalog, '[' || entry_l || ']' || ' ' || entry_s as entry_ls + from ims_md_metadata_cata + where ims_md_id = :ims_md_id +} # Metametadata Contrib template::list::create \ -name d_md_cont \ -multirow d_md_cont \ -no_data "[_ lorsm.lt_No_Contributors_Avail]" \ - -actions [list "[_ lorsm.Add_Contributors]" [export_vars -base metamd/meta_cont {ims_md_id}] "[_ lorsm.lt_Add_another_Contribut]"] \ + -actions [list "[_ lorsm.Add_Contributors]" \ + [export_vars -base metamd/meta_cont {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Contribut]"] \ + -html { style "width: 100%; align:right; " } \ -elements { - role { - label "[_ lorsm.Role]" - } - entity { - label "[_ lorsm.Entity_1]" - } - cont_date { - label "[_ lorsm.Contribution_Date]" - } - cont_date_ls { - label "[_ lorsm.Description_1]" - } + role { label "[_ lorsm.Role]" } + entity { label "[_ lorsm.Entity_1]" } + cont_date { label "[_ lorsm.Contribution_Date]" } + cont_date_ls { label "[_ lorsm.Description_1]" } } db_multirow d_md_cont select_md_cont { -select - mdc.role_v || ' ' || '[' || mdc.role_s || ']' as role, - mdce.entity, - mdc.cont_date, - '[' || mdc.cont_date_l || ']' || ' ' || mdc.cont_date_s as cont_date_ls -from - ims_md_metadata_contrib mdc, - ims_md_metadata_contrib_entity mdce -where - mdc.ims_md_md_cont_id = mdce.ims_md_md_cont_id -and - mdc.ims_md_id = :ims_md_id -} + select mdc.role_v || ' ' || '[' || mdc.role_s || ']' as role, + mdce.entity, mdc.cont_date, + '[' || mdc.cont_date_l || ']' || ' ' || mdc.cont_date_s as cont_date_ls + from ims_md_metadata_contrib mdc, ims_md_metadata_contrib_entity mdce + where mdc.ims_md_md_cont_id = mdce.ims_md_md_cont_id + and mdc.ims_md_id = :ims_md_id +} # Metametadata metadatascheme template::list::create \ -name d_md_scheme \ -multirow d_md_scheme \ -no_data "[_ lorsm.No_Scheme_Available]" \ - -actions [list "[_ lorsm.Add_Scheme]" [export_vars -base metamd/meta_scheme {ims_md_id}] "[_ lorsm.Add_another_Scheme]"] \ + -actions [list "[_ lorsm.Add_Scheme]" \ + [export_vars -base metamd/meta_scheme {ims_md_id}] \ + "[_ lorsm.Add_another_Scheme]"] \ -html { style "width: 100%; align:right;" } \ -elements { - scheme { - label "" - } + scheme { label "" } } db_multirow d_md_scheme select_md_scheme { - select - scheme - from - ims_md_metadata_scheme - where - ims_md_id = :ims_md_id -} + select scheme + from ims_md_metadata_scheme + where ims_md_id = :ims_md_id +} # Metametadata language template::list::create \ -name d_md_lang \ -multirow d_md_lang \ -no_data "[_ lorsm.lt_No_Language_Available]" \ - -actions [list "[_ lorsm.Add_Language]" [export_vars -base metamd/meta_lang {ims_md_id}] "[_ lorsm.lt_Add_another_Languages]"] \ + -actions [list "[_ lorsm.Add_Language]" \ + [export_vars -base metamd/meta_lang {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Languages]"] \ -html { style "width: 100%; align: right;" } \ -elements { - language { - label "" - } + language { label "" } } db_multirow d_md_lang select_md_lang { - select - language - from - ims_md_metadata - where - ims_md_id = :ims_md_id -} + select language + from ims_md_metadata + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/relationmd.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/relationmd.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/relationmd.adp 31 Dec 2006 00:36:05 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/relationmd.adp 17 Nov 2008 13:36:44 -0000 1.2 @@ -2,16 +2,16 @@ @title;noquote@ @context;noquote@ - + - +
- + + - - - -
#lorsm.Relation_Metadata##lorsm.Relation_Metadata#
#lorsm.Relations#
+ #lorsm.Relations# + + + Index: openacs-4/packages/lorsm/www/admin/md/relationmd.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/relationmd.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/relationmd.tcl 6 Mar 2008 13:56:57 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/relationmd.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -11,43 +11,37 @@ } # set context & title -set context [list [list [export_vars -base "." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] "[_ lorsm.Relation_MD]"] +set context [list \ + [list [export_vars -base "." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + "[_ lorsm.Relation_MD]"] set title "Relation MD" # Relation template::list::create \ -name d_re_relat \ -multirow d_re_relat \ -no_data "[_ lorsm.lt_No_Relation_Available]" \ - -actions [list "[_ lorsm.Add_Relation]" [export_vars -base relationmd/relation_add {ims_md_id}] "[_ lorsm.lt_Add_another_Relation__1]"] \ + -actions [list "[_ lorsm.Add_Relation]" \ + [export_vars -base relationmd/relation_add {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Relation__1]"] \ -html { style "width: 100%; align:right;" } \ -elements { - kind_s { - label "" - } - kind_v { - label "" - } - export { + kind_s { label "" } + kind_v { label "" } + export { display_eval {\[View \\ Edit\]} - link_url_eval { [export_vars -base "relationmd/relation" {ims_md_re_re_id ims_md_re_id ims_md_id}] } + link_url_eval { [export_vars \ + -base "relationmd/relation" \ + {ims_md_re_re_id ims_md_re_id ims_md_id}] } link_html {title "[_ lorsm.lt_View_associated_Relat]"} html { align center } } } db_multirow d_re_relat select_re_relat { -select - re.kind_s, - re.kind_v, - re.ims_md_id, - re.ims_md_re_id, - rere.ims_md_re_re_id -from - ims_md_relation re, - ims_md_relation_resource rere -where - re.ims_md_id = :ims_md_id -and - rere.ims_md_re_id = re.ims_md_re_id -} + select re.kind_s, re.kind_v, re.ims_md_id, re.ims_md_re_id, rere.ims_md_re_re_id + from ims_md_relation re, ims_md_relation_resource rere + where re.ims_md_id = :ims_md_id + and rere.ims_md_re_id = re.ims_md_re_id +} Index: openacs-4/packages/lorsm/www/admin/md/rightsmd.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/rightsmd.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/rightsmd.adp 31 Dec 2006 00:36:05 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/rightsmd.adp 17 Nov 2008 13:36:44 -0000 1.2 @@ -5,24 +5,23 @@ - +
- + - - - + + + - - - - + + + + - - - - - -
#lorsm.Rights_Metadata##lorsm.Rights_Metadata#
#lorsm.Cost#
#lorsm.Cost#
#lorsm.lt_Copyright_or_other_Re#
#lorsm.lt_Copyright_or_other_Re#
#lorsm.Description#
+ + #lorsm.Description# + + + Index: openacs-4/packages/lorsm/www/admin/md/rightsmd.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/rightsmd.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/rightsmd.tcl 6 Mar 2008 13:56:57 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/rightsmd.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -18,63 +18,54 @@ -name d_ri_cost \ -multirow d_ri_cost \ -no_data "[_ lorsm.No_Cost_Available]" \ - -actions [list "[_ lorsm.Add_Cost]" [export_vars -base rightsmd/rights_cost {ims_md_id}] "[_ lorsm.Add_another_Cost]"] \ + -actions [list "[_ lorsm.Add_Cost]" \ + [export_vars -base rightsmd/rights_cost {ims_md_id}] \ + "[_ lorsm.Add_another_Cost]"] \ -html { style "width: 100%; align:right;" } \ -elements { - cost { - label "" - } + cost { label "" } } db_multirow d_ri_cost select_ri_cost { - select - '[' || cost_s || '] ' || cost_v as cost - from - ims_md_rights - where - ims_md_id = :ims_md_id -} + select '[' || cost_s || '] ' || cost_v as cost + from ims_md_rights + where ims_md_id = :ims_md_id +} -# Rights Copyright or other Restrictions +# Rights Copyright or other Restrictions template::list::create \ -name d_ri_caor \ -multirow d_ri_caor \ -no_data "[_ lorsm.lt_No_Copyright_or_other]" \ - -actions [list "[_ lorsm.lt_Add_Copyright_or_othe]" [export_vars -base rightsmd/rights_caor {ims_md_id}] "[_ lorsm.lt_Add_another_Copyright]"] \ + -actions [list "[_ lorsm.lt_Add_Copyright_or_othe]" \ + [export_vars -base rightsmd/rights_caor {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Copyright]"] \ -html { style "width: 100%; align:right;" } \ -elements { - caor { - label "" - } + caor { label "" } } db_multirow d_ri_caor select_ri_caor { - select - '[' || caor_s || '] ' || caor_v as caor - from - ims_md_rights - where - ims_md_id = :ims_md_id -} + select '[' || caor_s || '] ' || caor_v as caor + from ims_md_rights + where ims_md_id = :ims_md_id +} # Rights Description template::list::create \ -name d_ri_desc \ -multirow d_ri_desc \ -no_data "[_ lorsm.lt_No_Description_Availa]" \ - -actions [list "[_ lorsm.Add_Description]" [export_vars -base rightsmd/rights_desc {ims_md_id}] "[_ lorsm.lt_Add_another_Descripti]"] \ + -actions [list "[_ lorsm.Add_Description]" \ + [export_vars -base rightsmd/rights_desc {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Descripti]"] \ -html { style "width: 100%; align:right;" } \ -elements { - desc { - label "" - } + desc { label "" } } db_multirow d_ri_desc select_ri_desc { - select - '[' || descrip_l || '] ' || descrip_s as desc - from - ims_md_rights - where - ims_md_id = :ims_md_id -} + select '[' || descrip_l || '] ' || descrip_s as desc + from ims_md_rights + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/technicalmd.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/technicalmd.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/technicalmd.adp 31 Dec 2006 00:36:05 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/technicalmd.adp 17 Nov 2008 13:36:44 -0000 1.2 @@ -2,48 +2,46 @@ @title;noquote@ @context;noquote@ - + - +
- + - - - - + + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + +
#lorsm.Technical_Metadata##lorsm.Technical_Metadata#
#lorsm.Formats#
#lorsm.Formats#
#lorsm.Size#
#lorsm.Size#
#lorsm.Locations#
#lorsm.Locations#
#lorsm.Requirements#
#lorsm.Requirements#
#lorsm.Installation_Remarks#
#lorsm.Installation_Remarks#
#lorsm.lt_Other_Platform_Requir#
#lorsm.lt_Other_Platform_Requir#
#lorsm.Duration#
#lorsm.Duration#
- - Index: openacs-4/packages/lorsm/www/admin/md/technicalmd.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/technicalmd.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/technicalmd.tcl 6 Mar 2008 13:56:57 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/technicalmd.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -10,183 +10,150 @@ } # set context & title -set context [list [list [export_vars -base "." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] "[_ lorsm.Technical_MD]"] +set context [list \ + [list [export_vars -base "." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + "[_ lorsm.Technical_MD]"] + set title "[_ lorsm.Technical_MD]" # Technical Format template::list::create \ -name d_te_form \ -multirow d_te_form \ -no_data "[_ lorsm.No_Format_Available]" \ - -actions [list "[_ lorsm.Add_Format]" [export_vars -base technicalmd/technical_form {ims_md_id}] "[_ lorsm.Add_another_Format]"] \ + -actions [list "[_ lorsm.Add_Format]" \ + [export_vars -base technicalmd/technical_form {ims_md_id}] \ + "[_ lorsm.Add_another_Format]"] \ -html { style "width: 100%; align:right;" } \ -elements { - format { - label "" - } + format { label "" } } db_multirow d_te_form select_te_form { - select - format - from - ims_md_technical_format - where - ims_md_id = :ims_md_id -} + select format + from ims_md_technical_format + where ims_md_id = :ims_md_id +} # Technical Size template::list::create \ -name d_te_size \ -multirow d_te_size \ -no_data "[_ lorsm.No_Size_Available]" \ - -actions [list "[_ lorsm.Add_Size]" [export_vars -base technicalmd/technical_size {ims_md_id}] "[_ lorsm.Add_another_Size]"] \ + -actions [list "[_ lorsm.Add_Size]" \ + [export_vars -base technicalmd/technical_size {ims_md_id}] \ + "[_ lorsm.Add_another_Size]"] \ -html { style "width: 100%; align:right;" } \ -elements { - t_size_bytes { - label "" - } + t_size_bytes { label "" } } db_multirow d_te_size select_te_size { - select - t_size || ' bytes' as t_size_bytes - from - ims_md_technical - where - ims_md_id = :ims_md_id -} + select t_size || ' bytes' as t_size_bytes + from ims_md_technical + where ims_md_id = :ims_md_id +} # Technical Location template::list::create \ -name d_te_loca \ -multirow d_te_loca \ -no_data "No Location Available" \ - -actions [list "Add Location" [export_vars -base technicalmd/technical_loca {ims_md_id}] "Add another Location"] \ + -actions [list "Add Location" \ + [export_vars -base technicalmd/technical_loca {ims_md_id}] \ + "Add another Location"] \ -html { style "width: 100%; align:right;" } \ -elements { - type { - label "" - } - location { - label "" - } + type { label "" } + location { label "" } } db_multirow d_te_loca select_te_loca { - select - type, - location - from - ims_md_technical_location - where - ims_md_id = :ims_md_id -} + select type, location + from ims_md_technical_location + where ims_md_id = :ims_md_id +} -# Technical Requirements +# Technical Requirements template::list::create \ -name d_te_req \ -multirow d_te_req \ -no_data "[_ lorsm.lt_No_Requirements_Avail]" \ - -actions [list "[_ lorsm.Add_Requirements]" [export_vars -base technicalmd/technical_req {ims_md_id}] "[_ lorsm.lt_Add_another_Requireme]"] \ + -actions [list "[_ lorsm.Add_Requirements]" \ + [export_vars -base technicalmd/technical_req {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Requireme]"] \ -html { style "width: 100%; align:right;" } \ -elements { - type { - label "[_ lorsm.Type]" - } - name { - label "[_ lorsm.Name]" - } - min_version { - label "[_ lorsm.Min_Version]" - } - max_version { - label "[_ lorsm.Max_Version]" - } + type { label "[_ lorsm.Type]" } + name { label "[_ lorsm.Name]" } + min_version { label "[_ lorsm.Min_Version]" } + max_version { label "[_ lorsm.Max_Version]" } } db_multirow d_te_req select_te_req { - select - '[' || type_s || ']' || ' ' || type_v as type, - '[' || name_s || ']' || ' ' || name_v as name, - min_version, - max_version - from - ims_md_technical_requirement - where - ims_md_id = :ims_md_id -} + select '[' || type_s || ']' || ' ' || type_v as type, + '[' || name_s || ']' || ' ' || name_v as name, + min_version, max_version + from ims_md_technical_requirement + where ims_md_id = :ims_md_id +} # Technical Installation Remarks template::list::create \ -name d_te_inst \ -multirow d_te_inst \ -no_data "[_ lorsm.lt_No_Installation_Remar]" \ - -actions [list "[_ lorsm.lt_Add_Installation_Rema]" [export_vars -base technicalmd/technical_inst {ims_md_id}] "[_ lorsm.lt_Add_another_Installat]"] \ + -actions [list "[_ lorsm.lt_Add_Installation_Rema]" \ + [export_vars -base technicalmd/technical_inst {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Installat]"] \ -html { style "width: 100%; align:right;" } \ -elements { - instl_rmrks { - label "" - } + instl_rmrks { label "" } } db_multirow d_te_inst select_te_inst { - select - '[' || instl_rmrks_l || ']' || ' ' || instl_rmrks_s as instl_rmrks - from - ims_md_technical - where - ims_md_id = :ims_md_id + select '[' || instl_rmrks_l || ']' || ' ' || instl_rmrks_s as instl_rmrks + from ims_md_technical + where ims_md_id = :ims_md_id } # Technical Other Platform Requirements template::list::create \ -name d_te_otr \ -multirow d_te_otr \ -no_data "[_ lorsm.lt_No_Other_Platform_Req]" \ - -actions [list "[_ lorsm.lt_Add_Other_Platform_Re]" [export_vars -base technicalmd/technical_otr {ims_md_id}] "[_ lorsm.lt_Add_another_Other_Pla]"] \ + -actions [list "[_ lorsm.lt_Add_Other_Platform_Re]" \ + [export_vars -base technicalmd/technical_otr {ims_md_id}] \ + "[_ lorsm.lt_Add_another_Other_Pla]"] \ -html { style "width: 100%; align:right;" } \ -elements { - otr_plt { - label "" - } + otr_plt { label "" } } db_multirow d_te_otr select_te_otr { - select - '[' || otr_plt_l || ']' || ' ' || otr_plt_s as otr_plt - from - ims_md_technical - where - ims_md_id = :ims_md_id + select '[' || otr_plt_l || ']' || ' ' || otr_plt_s as otr_plt + from ims_md_technical + where ims_md_id = :ims_md_id } # Technical Duration template::list::create \ -name d_te_dur \ -multirow d_te_dur \ -no_data "[_ lorsm.lt_No_Duration_Available]" \ - -actions [list "[_ lorsm.Add_Duration]" [export_vars -base technicalmd/technical_dur {ims_md_id}] "[_ lorsm.Add_another_Duration]"] \ + -actions [list "[_ lorsm.Add_Duration]" \ + [export_vars -base technicalmd/technical_dur {ims_md_id}] \ + "[_ lorsm.Add_another_Duration]"] \ -html { style "width: 100%; align:right;" } \ -elements { - duration_sec { - label "" - } - duration_l { - label "" - } - duration_s { - label "" - } + duration_sec { label "" } + duration_l { label "" } + duration_s { label "" } } db_multirow d_te_dur select_te_dur { - select - duration_l, - duration_s, - duration || 's' as duration_sec - from - ims_md_technical - where - ims_md_id = :ims_md_id + select duration_l, duration_s, duration || 's' as duration_sec + from ims_md_technical + where ims_md_id = :ims_md_id } Index: openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation.adp 31 Dec 2006 00:36:05 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation.adp 17 Nov 2008 13:36:44 -0000 1.2 @@ -2,27 +2,26 @@ @title;noquote@ @context;noquote@ - + - +
- + - - - + + + - - - - + + + + - - - - + + + + -
Annotation MetadataAnnotation Metadata
Entity:
Entity:
Date:
Date:
Descriptions:
Descriptions:
+ Index: openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation.tcl 31 Dec 2006 00:36:05 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation.tcl 17 Nov 2008 13:36:44 -0000 1.2 @@ -1,6 +1,6 @@ ad_page_contract { Displays/Adds IMS Metadata Annotation - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -12,73 +12,69 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../annotationmd" ims_md_id] "[_ lorsm.Annotation_MD]"] "[_ lorsm.Annotation_Entry]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + [list [export_vars -base "../annotationmd" ims_md_id] \ + "[_ lorsm.Annotation_MD]"] \ + "[_ lorsm.Annotation_Entry]"] + set title "[_ lorsm.Annotation_MD]" # Annotation Entity template::list::create \ -name d_an_ent \ -multirow d_an_ent \ -no_data "[_ lorsm.No_Entity_Available]" \ - -actions [list "[_ lorsm.Add_Entity]" [export_vars -base annotation_ent {ims_md_an_id ims_md_id}] "[_ lorsm.Add_another_Entity]"] \ + -actions [list "[_ lorsm.Add_Entity]" \ + [export_vars -base annotation_ent {ims_md_an_id ims_md_id}] \ + "[_ lorsm.Add_another_Entity]"] \ -html { align right style "width: 100%;" } \ -elements { - entity { - label "" - } + entity { label "" } } db_multirow d_an_ent select_an_ent { select entity - from - ims_md_annotation - where - ims_md_an_id = :ims_md_an_id -} + from ims_md_annotation + where ims_md_an_id = :ims_md_an_id +} -# Annotation Date +# Annotation Date template::list::create \ -name d_an_date \ -multirow d_an_date \ -no_data "[_ lorsm.No_Date_Available]" \ - -actions [list "[_ lorsm.Add_Date]" [export_vars -base annotation_date {ims_md_an_id ims_md_id}] "[_ lorsm.Add_another_Date]"] \ + -actions [list "[_ lorsm.Add_Date]" \ + [export_vars -base annotation_date {ims_md_an_id ims_md_id}] \ + "[_ lorsm.Add_another_Date]"] \ -html { align right style "width: 100%;" } \ -elements { - date { - label "[_ lorsm.Date_1]" - } - datels { - label "[_ lorsm.Description_1]" - } + date { label "[_ lorsm.Date_1]" } + datels { label "[_ lorsm.Description_1]" } } db_multirow d_an_date select_an_date { - select date, - '[' || date_l || '] ' || date_s as datels - from - ims_md_annotation - where - ims_md_an_id = :ims_md_an_id -} + select date, '[' || date_l || '] ' || date_s as datels + from ims_md_annotation + where ims_md_an_id = :ims_md_an_id +} # Annotation Description template::list::create \ -name d_an_desc \ -multirow d_an_desc \ -no_data "[_ lorsm.lt_No_Description_Availa]" \ - -actions [list "[_ lorsm.Add_Description]" [export_vars -base annotation_desc {ims_md_an_id ims_md_id}] "[_ lorsm.lt_Add_another_Descripti]"] \ + -actions [list "[_ lorsm.Add_Description]" \ + [export_vars -base annotation_desc {ims_md_an_id ims_md_id}] \ + "[_ lorsm.lt_Add_another_Descripti]"] \ -html { align right style "width: 100%;" } \ -elements { - desc { - label "" - } + desc { label "" } } db_multirow d_an_desc select_an_desc { - select - '[' || descrip_l || '] ' || descrip_s as desc - from - ims_md_annotation_descrip - where - ims_md_an_id = :ims_md_an_id -} + select '[' || descrip_l || '] ' || descrip_s as desc + from ims_md_annotation_descrip + where ims_md_an_id = :ims_md_an_id +} Index: openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_add.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_add.adp 17 Oct 2008 10:46:31 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_add.adp 17 Nov 2008 13:36:44 -0000 1.3 @@ -2,21 +2,21 @@ @title;noquote@ @context;noquote@ - +

Annotation Metadata Entry

- +
- + + - - + + + - + -
Annotation MetadataAnnotation Metadata
Add another Annotation Metadata Entry?
Add another Annotation Metadata Entry?
+ Index: openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_add.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_add.tcl 31 Dec 2006 00:36:05 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_add.tcl 17 Nov 2008 13:36:44 -0000 1.2 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/annotationmd/annotation_add.tcl ad_page_contract { - + Add/Edit Annotation MD Entry - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -17,27 +17,31 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../annotationmd" ims_md_id] "[_ lorsm.Annotation_MD]"] "[_ lorsm.Annotation_Entry]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] + "[_ lorsm.IMS_Metadata_Editor]"] \ + [list [export_vars -base "../annotationmd" ims_md_id] \ + "[_ lorsm.Annotation_MD]"] \ + "[_ lorsm.Annotation_Entry]"] + set title "[_ lorsm.lt_Add_Annotation_MD_Ent]" # Form -ad_form -name annotationmd_add \ +ad_form \ + -name annotationmd_add \ -cancel_url ../annotationmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + ims_md_an_id:key(ims_md_annotation_seq) { + ims_md_id:text(hidden) { value $ims_md_id } + } - ims_md_an_id:key(ims_md_annotation_seq) - - {ims_md_id:text(hidden) {value $ims_md_id} - } - -} -new_data { - db_dml do_insert " - insert into ims_md_annotation (ims_md_an_id, ims_md_id) + } -new_data { + db_dml do_insert \ + "insert into ims_md_annotation (ims_md_an_id, ims_md_id) values (:ims_md_an_id, :ims_md_id)" -} -after_submit { - ad_returnredirect [export_vars -base "../annotationmd" {ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars -base "../annotationmd" {ims_md_id}] ad_script_abort -} - + } Index: openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_date.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_date.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_date.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_date.adp 17 Nov 2008 13:36:44 -0000 1.4 @@ -2,25 +2,22 @@ @title;noquote@ @context;noquote@ - +

Annotation Metadata Date

- +
- + + - - - + + + +
Annotation MetadataAnnotation Metadata
Date:
Date:
- -

#lorsm.lt_AddEdit_Annotation_MD_2#

- - + Index: openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_date.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_date.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_date.tcl 15 May 2007 20:14:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_date.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/annotationmd/annotation_date.tcl ad_page_contract { - + Add/Edit Annotation MD Date - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -18,54 +18,58 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../annotationmd" ims_md_id] "[_ lorsm.Annotation_MD]"] [list [export_vars -base "annotation" {ims_md_id ims_md_an_id}] "[_ lorsm.Annotation_Entry]"] "[_ lorsm.AddEdit_Date]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + [list [export_vars -base "../annotationmd" ims_md_id] \ + "[_ lorsm.Annotation_MD]"] \ + [list [export_vars -base "annotation" {ims_md_id ims_md_an_id}] \ + "[_ lorsm.Annotation_Entry]"] \ + "[_ lorsm.AddEdit_Date]"] + set title "[_ lorsm.lt_Edit_Annotation_MD_Da]" # Form - -ad_form -name annotationmd_date \ +ad_form \ + -name annotationmd_date \ -cancel_url annotation?ims_md_id=$ims_md_id&ims_md_an_id=$ims_md_an_id \ -mode edit \ -form { + ims_md_an_id:key(ims_md_annotation_seq) - ims_md_an_id:key(ims_md_annotation_seq) + {date:text,nospell + {html {size 10}} + {help_text "[_ lorsm.Date_of_contribution]"} + {label "[_ lorsm.Date]"}} - {date:text,nospell - {html {size 10}} - {help_text "[_ lorsm.Date_of_contribution]"} - {label "[_ lorsm.Date]"} - } + {date_l:text,nospell,optional + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi_3]"} + {label "[_ lorsm.Language]"}} - {date_l:text,nospell,optional - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi_3]"} - {label "[_ lorsm.Language]"} - } - - {date_s:text(textarea),nospell,optional - {html {rows 2 cols 50}} - {help_text "[_ lorsm.lt_Date_and_Time_descrip]"} - {label "[_ lorsm.Description]"} - } + {date_s:text(textarea),nospell,optional + {html {rows 2 cols 50}} + {help_text "[_ lorsm.lt_Date_and_Time_descrip]"} + {label "[_ lorsm.Description]"}} - {ims_md_id:text(hidden) {value $ims_md_id} - } + {ims_md_id:text(hidden) {value $ims_md_id}} -} -select_query {select * from ims_md_annotation where ims_md_an_id = :ims_md_an_id + } -select_query { + select * + from ims_md_annotation + where ims_md_an_id = :ims_md_an_id -} -edit_data { - db_dml do_update " - update ims_md_annotation - set date = :date, - date_l = :date_l, - date_s = :date_s + } -edit_data { + db_dml do_update \ + "update ims_md_annotation set date = :date, date_l = :date_l, date_s = :date_s where ims_md_an_id = :ims_md_an_id " -} -after_submit { - ad_returnredirect [export_vars -base "annotation" {ims_md_an_id ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars \ + -base "annotation" {ims_md_an_id ims_md_id}] ad_script_abort -} + } # Annotation Date template::list::create \ @@ -74,21 +78,12 @@ -no_data "[_ lorsm.No_Date_Available]" \ -html { align right style "width: 100%;" } \ -elements { - date { - label "[_ lorsm.Date_1]" - } - datels { - label "[_ lorsm.Description_1]" - } + date { label "[_ lorsm.Date_1]" } + datels { label "[_ lorsm.Description_1]" } } db_multirow d_an_date select_an_date { - select date, - '[' || date_l || '] ' || date_s as datels, - ims_md_an_id, - ims_md_id - from - ims_md_annotation - where - ims_md_an_id = :ims_md_an_id -} + select date, '[' || date_l || '] ' || date_s as datels, ims_md_an_id, ims_md_id + from ims_md_annotation + where ims_md_an_id = :ims_md_an_id +} Index: openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_desc.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_desc.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_desc.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_desc.adp 17 Nov 2008 13:36:44 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Annotation Metadata Description

- +
- + + - - - + + + +
Annotation MetadataAnnotation Metadata
Description:
Description:
- -

#lorsm.lt_AddEdit_Annotation_MD#

- + Index: openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_desc.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_desc.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_desc.tcl 15 May 2007 20:14:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_desc.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/annotationmd/annotation_desc.tcl ad_page_contract { - + Add/Edit Annotation MD Description - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -20,59 +20,72 @@ # set context & title if { ![ad_form_new_p -key ims_md_an_de_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../annotationmd" ims_md_id] "[_ lorsm.Annotation_MD]"] [list [export_vars -base "annotation" {ims_md_id ims_md_an_id}] "[_ lorsm.Annotation_Entry]"] "[_ lorsm.Edit_Description]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + [list [export_vars -base "../annotationmd" ims_md_id] \ + "[_ lorsm.Annotation_MD]"] \ + [list [export_vars -base "annotation" {ims_md_id ims_md_an_id}] \ + "[_ lorsm.Annotation_Entry]"] \ + "[_ lorsm.Edit_Description]"] + set title "Edit Annotation MD Description" } else { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../annotationmd" ims_md_id] "[_ lorsm.Annotation_MD]"] [list [export_vars -base "annotation" {ims_md_id ims_md_an_id}] "[_ lorsm.Annotation_Entry]"] "[_ lorsm.Add_Description]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + [list [export_vars -base "../annotationmd" ims_md_id] \ + "[_ lorsm.Annotation_MD]"] \ + [list [export_vars -base "annotation" {ims_md_id ims_md_an_id}] \ + "[_ lorsm.Annotation_Entry]"] \ + "[_ lorsm.Add_Description]"] + set title "[_ lorsm.lt_Add_Annotation_MD_Des]" } # Form - -ad_form -name annotationmd_desc \ +ad_form \ + -name annotationmd_desc \ -cancel_url annotation?ims_md_id=$ims_md_id&ims_md_an_id=$ims_md_an_id \ -mode edit \ -form { + ims_md_an_de_id:key(ims_md_annotation_descrip_seq) - ims_md_an_de_id:key(ims_md_annotation_descrip_seq) + {descrip_l:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"}} - {descrip_l:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} - {label "[_ lorsm.Language]"} - } + {descrip_s:text(textarea),nospell + {html {rows 2 cols 50}} + {help_text "[_ lorsm.lt_Content_of_the_annota]"} + {label "[_ lorsm.Description]"}} - {descrip_s:text(textarea),nospell - {html {rows 2 cols 50}} - {help_text "[_ lorsm.lt_Content_of_the_annota]"} - {label "[_ lorsm.Description]"} - } - - {ims_md_id:text(hidden) {value $ims_md_id} - } + {ims_md_id:text(hidden) {value $ims_md_id}} - {ims_md_an_id:text(hidden) {value $ims_md_an_id} - } + {ims_md_an_id:text(hidden) {value $ims_md_an_id}} -} -select_query {select * from ims_md_annotation_descrip where ims_md_an_de_id = :ims_md_an_de_id and ims_md_an_id = :ims_md_an_id + } -select_query { + select * + from ims_md_annotation_descrip + where ims_md_an_de_id = :ims_md_an_de_id + and ims_md_an_id = :ims_md_an_id -} -edit_data { - db_dml do_update " - update ims_md_annotation_descrip - set descrip_l = :descrip_l, - descrip_s = :descrip_s + } -edit_data { + db_dml do_update \ + "update ims_md_annotation_descrip + set descrip_l = :descrip_l, descrip_s = :descrip_s where ims_md_an_de_id = :ims_md_an_de_id" -} -new_data { - db_dml do_insert " - insert into ims_md_annotation_descrip (ims_md_an_de_id, ims_md_an_id, descrip_l, descrip_s) - values - (:ims_md_an_de_id, :ims_md_an_id, :descrip_l, :descrip_s)" + } -new_data { + db_dml do_insert \ + "insert into ims_md_annotation_descrip (ims_md_an_de_id, ims_md_an_id, descrip_l, descrip_s) + values (:ims_md_an_de_id, :ims_md_an_id, :descrip_l, :descrip_s)" -} -after_submit { - ad_returnredirect [export_vars -base "annotation" {ims_md_an_id ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars -base "annotation" {ims_md_an_id ims_md_id}] ad_script_abort -} + } # Annotation Description template::list::create \ @@ -81,28 +94,22 @@ -no_data "No Description Available" \ -html { align right style "width: 100%;" } \ -elements { - desc { - label "" - } + desc { label "" } + export { display_eval {\[Edit\]} - link_url_eval { [export_vars -base "annotation_desc" {ims_md_an_de_id ims_md_an_id ims_md_id}] } + link_url_eval { [export_vars \ + -base "annotation_desc" \ + {ims_md_an_de_id ims_md_an_id ims_md_id}] } link_html {title "[_ lorsm.Edit_Record]"} html { align center } } } db_multirow d_an_desc select_an_desc { - select - '[' || ande.descrip_l || '] ' || ande.descrip_s as desc, - ande.ims_md_an_de_id, - an.ims_md_an_id, - an.ims_md_id - from - ims_md_annotation_descrip ande, - ims_md_annotation an - where - ande.ims_md_an_id = an.ims_md_an_id - and - ande.ims_md_an_id = :ims_md_an_id -} + select '[' || ande.descrip_l || '] ' || ande.descrip_s as desc, + ande.ims_md_an_de_id, an.ims_md_an_id, an.ims_md_id + from ims_md_annotation_descrip ande, ims_md_annotation an + where ande.ims_md_an_id = an.ims_md_an_id + and ande.ims_md_an_id = :ims_md_an_id +} Index: openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_ent.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_ent.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_ent.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_ent.adp 17 Nov 2008 13:36:44 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Annotation Metadata Entity

- +
- + + - - - + + + +
Annotation MetadataAnnotation Metadata
Entity:
Entity:
- -

#lorsm.lt_AddEdit_Annotation_MD_1#

- + Index: openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_ent.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_ent.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_ent.tcl 15 May 2007 20:14:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/annotationmd/annotation_ent.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/annotationmd/annotation_ent.tcl ad_page_contract { - + Add/Edit Annotation MD Entity - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -18,40 +18,49 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../annotationmd" ims_md_id] "[_ lorsm.Annotation_MD]"] [list [export_vars -base "annotation" {ims_md_id ims_md_an_id}] "[_ lorsm.Annotation_Entry]"] "[_ lorsm.AddEdit_Entity]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + [list [export_vars -base "../annotationmd" ims_md_id] \ + "[_ lorsm.Annotation_MD]"] \ + [list [export_vars -base "annotation" {ims_md_id ims_md_an_id}] \ + "[_ lorsm.Annotation_Entry]"] \ + "[_ lorsm.AddEdit_Entity]"] + set title "[_ lorsm.lt_Edit_Annotation_MD_En]" # Form - -ad_form -name annotationmd_ent \ +ad_form \ + -name annotationmd_ent \ -cancel_url annotation?ims_md_id=$ims_md_id&ims_md_an_id=$ims_md_an_id \ -mode edit \ -form { + ims_md_an_id:key(ims_md_annotation_seq) - ims_md_an_id:key(ims_md_annotation_seq) + {entity:text(textarea),nospell + {html {rows 5 cols 50}} + {help_text "[_ lorsm.Annotator]"} + {label "[_ lorsm.Entity]"} + } - {entity:text(textarea),nospell - {html {rows 5 cols 50}} - {help_text "[_ lorsm.Annotator]"} - {label "[_ lorsm.Entity]"} - } + {ims_md_id:text(hidden) {value $ims_md_id}} - {ims_md_id:text(hidden) {value $ims_md_id} - } + } -select_query { + select * + from ims_md_annotation + where ims_md_an_id = :ims_md_an_id -} -select_query {select * from ims_md_annotation where ims_md_an_id = :ims_md_an_id - -} -edit_data { - db_dml do_update " - update ims_md_annotation + } -edit_data { + db_dml do_update + "update ims_md_annotation set entity = :entity where ims_md_an_id = :ims_md_an_id " -} -after_submit { - ad_returnredirect [export_vars -base "annotation" {ims_md_an_id ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars -base "annotation" {ims_md_an_id ims_md_id}] ad_script_abort -} + } # Annotation Entity template::list::create \ @@ -60,18 +69,11 @@ -no_data "[_ lorsm.No_Entity_Available]" \ -html { align right style "width: 100%;" } \ -elements { - entity { - label "" - } + entity { label "" } } db_multirow d_an_ent select_an_ent { - select - entity, - ims_md_an_id, - ims_md_id - from - ims_md_annotation - where - ims_md_an_id = :ims_md_an_id -} + select entity, ims_md_an_id, ims_md_id + from ims_md_annotation + where ims_md_an_id = :ims_md_an_id +} Index: openacs-4/packages/lorsm/www/admin/md/classificationmd/classification.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/classificationmd/classification.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/classificationmd/classification.adp 31 Dec 2006 00:36:06 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/classificationmd/classification.adp 17 Nov 2008 13:36:44 -0000 1.2 @@ -2,27 +2,30 @@ @title;noquote@ @context;noquote@ - + - +
- + + - - - + + + + - - + + + - - + + + - - - -
Classification MetadataClassification Metadata
Purpose:
Purpose:
Taxonomic Paths: Taxonomic Paths:
Descriptions: Descriptions:
Keywords:
+ Keywords: + + + Index: openacs-4/packages/lorsm/www/admin/md/classificationmd/classification.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/classificationmd/classification.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/classificationmd/classification.tcl 31 Dec 2006 00:36:06 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/classificationmd/classification.tcl 17 Nov 2008 13:36:44 -0000 1.2 @@ -12,107 +12,109 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../classificationmd" ims_md_id] "[_ lorsm.Classification_MD]"] "[_ lorsm.Classification_Entry]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../classificationmd" ims_md_id] \ + "[_ lorsm.Classification_MD]"] \ + + "[_ lorsm.Classification_Entry]"] + set title "[_ lorsm.Classification_MD]" # Classification Purpose template::list::create \ -name d_cl_pur \ -multirow d_cl_pur \ -no_data "[_ lorsm.No_Purpose_Available]" \ - -actions [list "[_ lorsm.Add_Purpose]" [export_vars -base classification_pur {ims_md_cl_id ims_md_id}] "[_ lorsm.Add_another_Purpose]"] \ + -actions [list "[_ lorsm.Add_Purpose]" \ + [export_vars \ + -base classification_pur {ims_md_cl_id ims_md_id}] \ + "[_ lorsm.Add_another_Purpose]"] \ + -html { align right style "width: 100%;" } \ -elements { - purpose_s { - label "" - } - purpose_v { - label "" - } + purpose_s { label "" } + purpose_v { label "" } } db_multirow d_cl_pur select_cl_pur { - select purpose_s, - purpose_v - from - ims_md_classification - where - ims_md_cl_id = :ims_md_cl_id -} + select purpose_s, purpose_v + from ims_md_classification + where ims_md_cl_id = :ims_md_cl_id +} -# Classification Taxonomic Path +# Classification Taxonomic Path template::list::create \ -name d_cl_tpath \ -multirow d_cl_tpath \ -no_data "[_ lorsm.lt_No_Taxonomic_Paths_Av]" \ - -actions [list "[_ lorsm.Add_Taxonomic_Path]" [export_vars -base classification_addpath {ims_md_cl_id ims_md_id}] "[_ lorsm.lt_Add_another_Taxonomic]"] \ + -actions [list "[_ lorsm.Add_Taxonomic_Path]" \ + [export_vars \ + -base classification_addpath \ + {ims_md_cl_id ims_md_id}] \ + "[_ lorsm.lt_Add_another_Taxonomic]"] \ + -html { align right style "width: 100%;" } \ -elements { - source { - label "" + source { label "" } + export { + display_eval {\[[_ lorsm.View]\]} + link_url_eval { [export_vars -base "classification_tpath" {ims_md_cl_ta_id ims_md_cl_id ims_md_id}] } + link_html {title "[_ lorsm.lt_View_associated_Taxon]"} + html { align right } } - export { - display_eval {\[[_ lorsm.View]\]} - link_url_eval { [export_vars -base "classification_tpath" {ims_md_cl_ta_id ims_md_cl_id ims_md_id}] } - link_html {title "[_ lorsm.lt_View_associated_Taxon]"} - html { align right } - } } db_multirow d_cl_tpath select_cl_tpath { - select - '[' || ctp.source_l || '] ' || ctp.source_v as source, - ctp.ims_md_cl_ta_id, - ctp.ims_md_cl_id, - cl.ims_md_id - from - ims_md_classification_taxpath ctp, - ims_md_classification cl - where - ctp.ims_md_cl_id = :ims_md_cl_id - and cl.ims_md_cl_id = :ims_md_cl_id -} + select '[' || ctp.source_l || '] ' || ctp.source_v as source, ctp.ims_md_cl_ta_id, + ctp.ims_md_cl_id, cl.ims_md_id + from ims_md_classification_taxpath ctp, ims_md_classification cl + where ctp.ims_md_cl_id = :ims_md_cl_id + and cl.ims_md_cl_id = :ims_md_cl_id +} # Classification Description template::list::create \ -name d_cl_desc \ -multirow d_cl_desc \ -no_data "[_ lorsm.lt_No_Description_Availa]" \ - -actions [list "[_ lorsm.Add_Description]" [export_vars -base classification_desc {ims_md_cl_id ims_md_id}] "[_ lorsm.lt_Add_another_Descripti]"] \ + -actions [list "[_ lorsm.Add_Description]" \ + [export_vars \ + -base classification_desc \ + {ims_md_cl_id ims_md_id}] \ + "[_ lorsm.lt_Add_another_Descripti]"] \ + -html { align right style "width: 100%;" } \ -elements { - desc { - label "" - } + desc { label "" } } db_multirow d_cl_desc select_cl_desc { - select - '[' || descrip_l || '] ' || descrip_s as desc - from - ims_md_classification_descrip - where - ims_md_cl_id = :ims_md_cl_id + select '[' || descrip_l || '] ' || descrip_s as desc + from ims_md_classification_descrip + where ims_md_cl_id = :ims_md_cl_id } # Classification Keywords template::list::create \ -name d_cl_key \ -multirow d_cl_key \ -no_data "[_ lorsm.lt_No_Keywords_Available]" \ - -actions [list "[_ lorsm.Add_Keyword]" [export_vars -base classification_key {ims_md_cl_id ims_md_id}] "[_ lorsm.Add_another_Keyword]"] \ + -actions [list "[_ lorsm.Add_Keyword]" \ + [export_vars + -base classification_key \ + {ims_md_cl_id ims_md_id}] \ + "[_ lorsm.Add_another_Keyword]"] \ + -html { align right style "width: 100%;" } \ -elements { - keyword { - label "" - } + keyword { label "" } } db_multirow d_cl_key select_cl_key { - select - '[' || keyword_l || '] ' || keyword_s as keyword - from - ims_md_classification_keyword - where - ims_md_cl_id = :ims_md_cl_id + select '[' || keyword_l || '] ' || keyword_s as keyword + from ims_md_classification_keyword + where ims_md_cl_id = :ims_md_cl_id } Index: openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_add.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_add.adp 17 Oct 2008 10:46:31 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_add.adp 17 Nov 2008 13:36:44 -0000 1.3 @@ -2,20 +2,20 @@ @title;noquote@ @context;noquote@ - +

Classification Metadata Entry

- +
- + + - - + + + - + -
Classification MetadataClassification Metadata
Add another Classification Metadata Entry?
Add another Classification Metadata Entry?
+ Index: openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_add.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_add.tcl 31 Dec 2006 00:36:06 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_add.tcl 17 Nov 2008 13:36:44 -0000 1.2 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/classificationmd/classification_add.tcl ad_page_contract { - + Add Classification MD Entry - + @author Gerard Low (glow5809@mail.usyd.edu.au) @creation-date 16 October 2004 @@ -19,23 +19,22 @@ set title "[_ lorsm.lt_Add_Classification_MD]" # Form -ad_form -name classificationmd_add \ +ad_form \ + -name classificationmd_add \ -cancel_url ../classificationmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + ims_md_cl_id:key(ims_md_classification_seq) - ims_md_cl_id:key(ims_md_classification_seq) + {ims_md_id:text(hidden) {value $ims_md_id}} - {ims_md_id:text(hidden) {value $ims_md_id} - } - -} -new_data { - db_dml do_insert " - insert into ims_md_classification (ims_md_cl_id, ims_md_id) + } -new_data { + db_dml do_insert \ + "insert into ims_md_classification (ims_md_cl_id, ims_md_id) values (:ims_md_cl_id, :ims_md_id)" -} -after_submit { - ad_returnredirect [export_vars -base "../classificationmd" {ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars -base "../classificationmd" {ims_md_id}] ad_script_abort -} + } Index: openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_addpath.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_addpath.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_addpath.adp 17 Oct 2008 10:46:31 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_addpath.adp 17 Nov 2008 13:36:44 -0000 1.3 @@ -2,20 +2,20 @@ @title;noquote@ @context;noquote@ - +

Classification Metadata

- +
- + + - - + + + - + -
Classification MetadataClassification Metadata
Add another Classification Metadata Taxonomic Path Entry?
Add another Classification Metadata Taxonomic Path Entry?
+ Index: openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_addpath.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_addpath.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_addpath.tcl 31 Dec 2006 00:36:06 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_addpath.tcl 17 Nov 2008 13:36:44 -0000 1.2 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/classificationmd/classification_addpath.tcl ad_page_contract { - + Add Classification MD Taxonomic Path Entry - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -18,30 +18,41 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../classificationmd" ims_md_id] "[_ lorsm.Classification_MD]"] [list [export_vars -base "classification" {ims_md_id ims_md_cl_id}] "[_ lorsm.Classification_Entry]"] "[_ lorsm.lt_Add_Taxonomic_Path_En]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../classificationmd" ims_md_id] \ + "[_ lorsm.Classification_MD]"] \ + + [list [export_vars \ + -base "classification" \ + {ims_md_id ims_md_cl_id}] \ + "[_ lorsm.Classification_Entry]"] \ + + "[_ lorsm.lt_Add_Taxonomic_Path_En]"] + set title "[_ lorsm.lt_Add_Classification_MD_1]" # Form -ad_form -name classificationmd_addpath \ +ad_form \ + -name classificationmd_addpath \ -cancel_url classification?ims_md_id=$ims_md_id&ims_md_cl_id=$ims_md_cl_id \ -mode edit \ -form { + ims_md_cl_ta_id:key(ims_md_classification_taxpath_seq) - ims_md_cl_ta_id:key(ims_md_classification_taxpath_seq) - - {ims_md_cl_id:text(hidden) {value $ims_md_cl_id} - } + {ims_md_cl_id:text(hidden) {value $ims_md_cl_id}} - {ims_md_id:text(hidden) {value $ims_md_id} - } + {ims_md_id:text(hidden) {value $ims_md_id}} -} -new_data { - db_dml do_insert " - insert into ims_md_classification_taxpath (ims_md_cl_ta_id, ims_md_cl_id) + } -new_data { + db_dml do_insert \ + "insert into ims_md_classification_taxpath (ims_md_cl_ta_id, ims_md_cl_id) values (:ims_md_cl_ta_id, :ims_md_cl_id)" -} -after_submit { - ad_returnredirect [export_vars -base "classification" {ims_md_cl_id ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars -base "classification" {ims_md_cl_id ims_md_id}] ad_script_abort -} + } Index: openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_desc.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_desc.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_desc.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_desc.adp 17 Nov 2008 13:36:44 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Classification Metadata Description

- +
- + + - - - + + + +
Classification MetadataClassification Metadata
Descriptions:
Descriptions:
- -

#lorsm.lt_AddEdit_Classificatio_5#

- + Index: openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_desc.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_desc.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_desc.tcl 15 May 2007 20:14:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_desc.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/classificationmd/classification_desc.tcl ad_page_contract { - + Add/Edit Classification MD Description - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -20,59 +20,86 @@ # set context & title if { ![ad_form_new_p -key ims_md_cl_de_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../classificationmd" ims_md_id] "[_ lorsm.Classification_MD]"] [list [export_vars -base "classification" {ims_md_id ims_md_cl_id}] "[_ lorsm.Classification_Entry]"] "[_ lorsm.Edit_Description]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../classificationmd" ims_md_id] \ + "[_ lorsm.Classification_MD]"] \ + + [list [export_vars \ + -base "classification" \ + {ims_md_id ims_md_cl_id}] \ + "[_ lorsm.Classification_Entry]"] \ + + "[_ lorsm.Edit_Description]"] + set title "[_ lorsm.lt_Edit_Classification_M_4]" } else { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../classificationmd" ims_md_id] "[_ lorsm.Classification_MD]"] [list [export_vars -base "classification" {ims_md_id ims_md_cl_id}] "[_ lorsm.Classification_Entry]"] "[_ lorsm.Add_Description]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] + + [list [export_vars -base "../classificationmd" ims_md_id] \ + "[_ lorsm.Classification_MD]"] \ + + [list [export_vars \ + -base "classification" \ + {ims_md_id ims_md_cl_id}] \ + "[_ lorsm.Classification_Entry]"] \ + + "[_ lorsm.Add_Description]"] + set title "[_ lorsm.lt_Add_Classification_MD_2]" } # Form -ad_form -name classificationmd_desc \ +ad_form \ + -name classificationmd_desc \ -cancel_url classification?ims_md_id=$ims_md_id&ims_md_cl_id=$ims_md_cl_id \ -mode edit \ -form { + ims_md_cl_de_id:key(ims_md_classification_desc_seq) - ims_md_cl_de_id:key(ims_md_classification_desc_seq) + {descrip_l:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } - {descrip_l:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} - {label "[_ lorsm.Language]"} - } + {descrip_s:text(textarea),nospell + {html {rows 2 cols 50}} + {help_text "[_ lorsm.lt_Description_of_the_le]"} + {label "[_ lorsm.Description]"} + } - {descrip_s:text(textarea),nospell - {html {rows 2 cols 50}} - {help_text "[_ lorsm.lt_Description_of_the_le]"} - {label "[_ lorsm.Description]"} - } - - {ims_md_id:text(hidden) {value $ims_md_id} - } + {ims_md_id:text(hidden) {value $ims_md_id}} - {ims_md_cl_id:text(hidden) {value $ims_md_cl_id} - } + {ims_md_cl_id:text(hidden) {value $ims_md_cl_id}} -} -select_query {select * from ims_md_classification_descrip where ims_md_cl_de_id = :ims_md_cl_de_id and ims_md_cl_id = :ims_md_cl_id + } -select_query { + select * + from ims_md_classification_descrip + where ims_md_cl_de_id = :ims_md_cl_de_id + and ims_md_cl_id = :ims_md_cl_id -} -edit_data { - db_dml do_update " - update ims_md_classification_descrip + } -edit_data { + db_dml do_update \ + "update ims_md_classification_descrip set descrip_l = :descrip_l, descrip_s = :descrip_s where ims_md_cl_de_id = :ims_md_cl_de_id" -} -new_data { - db_dml do_insert " - insert into ims_md_classification_descrip (ims_md_cl_de_id, ims_md_cl_id, descrip_l, descrip_s) - values - (:ims_md_cl_de_id, :ims_md_cl_id, :descrip_l, :descrip_s)" + } -new_data { + db_dml do_insert \ + "insert into ims_md_classification_descrip (ims_md_cl_de_id, ims_md_cl_id, descrip_l, descrip_s) + values (:ims_md_cl_de_id, :ims_md_cl_id, :descrip_l, :descrip_s)" -} -after_submit { - ad_returnredirect [export_vars -base "classification" {ims_md_cl_id ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars -base "classification" {ims_md_cl_id ims_md_id}] ad_script_abort -} + } # Classification Description template::list::create \ @@ -81,9 +108,7 @@ -no_data "[_ lorsm.lt_No_Description_Availa]" \ -html { align right style "width: 100%;" } \ -elements { - desc { - label "" - } + desc { label "" } export { display_eval {\[Edit\]} link_url_eval { [export_vars -base "classification_desc" {ims_md_cl_de_id ims_md_cl_id ims_md_id}] } @@ -93,16 +118,9 @@ } db_multirow d_cl_desc select_cl_desc { - select - '[' || clde.descrip_l || '] ' || clde.descrip_s as desc, - clde.ims_md_cl_de_id, - cl.ims_md_cl_id, - cl.ims_md_id - from - ims_md_classification_descrip clde, - ims_md_classification cl - where - clde.ims_md_cl_id = cl.ims_md_cl_id - and - clde.ims_md_cl_id = :ims_md_cl_id -} + select '[' || clde.descrip_l || '] ' || clde.descrip_s as desc, + clde.ims_md_cl_de_id, cl.ims_md_cl_id, cl.ims_md_id + from ims_md_classification_descrip clde, ims_md_classification cl + where clde.ims_md_cl_id = cl.ims_md_cl_id + and clde.ims_md_cl_id = :ims_md_cl_id +} Index: openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_key.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_key.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_key.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_key.adp 17 Nov 2008 13:36:44 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Classification Metadata Keyword

- +
- + + - - - + + + +
Classification MetadataClassification Metadata
Keywords:
Keywords:
- -

#lorsm.lt_AddEdit_Classificatio_6#

- + Index: openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_key.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_key.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_key.tcl 15 May 2007 20:14:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_key.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/classificationmd/classification_key.tcl ad_page_contract { - + Add/Edit Classification MD Keyword - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -20,59 +20,84 @@ # set context & title if { ![ad_form_new_p -key ims_md_cl_ke_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../classificationmd" ims_md_id] "[_ lorsm.Classification_MD]"] [list [export_vars -base "classification" {ims_md_id ims_md_cl_id}] "[_ lorsm.Classification_Entry]"] "[_ lorsm.Edit_Keyword_1]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../classificationmd" ims_md_id] \ + "[_ lorsm.Classification_MD]"] \ + + [list [export_vars \ + -base "classification" \ + {ims_md_id ims_md_cl_id}] \ + "[_ lorsm.Classification_Entry]"] \ + + "[_ lorsm.Edit_Keyword_1]"] + set title "[_ lorsm.lt_Edit_Classification_M]" } else { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../classificationmd" ims_md_id] "[_ lorsm.Classification_MD]"] [list [export_vars -base "classification" {ims_md_id ims_md_cl_id}] "[_ lorsm.Classification_Entry]"] "[_ lorsm.Add_Keyword]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../classificationmd" ims_md_id] \ + "[_ lorsm.Classification_MD]"] \ + + [list [export_vars \ + -base "classification" \ + {ims_md_id ims_md_cl_id}] \ + "[_ lorsm.Classification_Entry]"] + + "[_ lorsm.Add_Keyword]"] set title "[_ lorsm.lt_Add_Classification_MD_3]" } # Form - -ad_form -name classificationmd_key \ +ad_form \ + -name classificationmd_key \ -cancel_url classification?ims_md_id=$ims_md_id&ims_md_cl_id=$ims_md_cl_id \ -mode edit \ -form { + ims_md_cl_ke_id:key(ims_md_classification_keyword_seq) - ims_md_cl_ke_id:key(ims_md_classification_keyword_seq) + {keyword_l:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } - {keyword_l:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} - {label "[_ lorsm.Language]"} - } + {keyword_s:text,nospell + {html {size 20}} + {help_text "[_ lorsm.lt_Keyword_description_o]"} + {label "[_ lorsm.Keyword]"} + } - {keyword_s:text,nospell - {html {size 20}} - {help_text "[_ lorsm.lt_Keyword_description_o]"} - {label "[_ lorsm.Keyword]"} - } - - {ims_md_id:text(hidden) {value $ims_md_id} - } + {ims_md_id:text(hidden) {value $ims_md_id}} - {ims_md_cl_id:text(hidden) {value $ims_md_cl_id} - } + {ims_md_cl_id:text(hidden) {value $ims_md_cl_id}} -} -select_query {select * from ims_md_classification_keyword where ims_md_cl_ke_id = :ims_md_cl_ke_id and ims_md_cl_id = :ims_md_cl_id + } -select_query { + select * + from ims_md_classification_keyword + where ims_md_cl_ke_id = :ims_md_cl_ke_id + and ims_md_cl_id = :ims_md_cl_id -} -edit_data { - db_dml do_update " - update ims_md_classification_keyword + } -edit_data { + db_dml do_update \ + "update ims_md_classification_keyword set keyword_l = :keyword_l, keyword_s = :keyword_s where ims_md_cl_ke_id = :ims_md_cl_ke_id" -} -new_data { - db_dml do_insert " - insert into ims_md_classification_keyword (ims_md_cl_ke_id, ims_md_cl_id, keyword_l, keyword_s) - values - (:ims_md_cl_ke_id, :ims_md_cl_id, :keyword_l, :keyword_s)" + } -new_data { + db_dml do_insert \ + "insert into ims_md_classification_keyword (ims_md_cl_ke_id, ims_md_cl_id, keyword_l, keyword_s) + values (:ims_md_cl_ke_id, :ims_md_cl_id, :keyword_l, :keyword_s)" -} -after_submit { - ad_returnredirect [export_vars -base "classification" {ims_md_cl_id ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars -base "classification" {ims_md_cl_id ims_md_id}] ad_script_abort -} + } # Classification Keyword template::list::create \ @@ -81,9 +106,7 @@ -no_data "[_ lorsm.No_Keyword_Available]" \ -html { align right style "width: 100%;" } \ -elements { - keyword { - label "" - } + keyword { label "" } export { display_eval {\[Edit\]} link_url_eval { [export_vars -base "classification_key" {ims_md_cl_ke_id ims_md_cl_id ims_md_id}] } @@ -93,16 +116,9 @@ } db_multirow d_cl_key select_cl_key { - select - '[' || kw.keyword_l || '] ' || kw.keyword_s as keyword, - kw.ims_md_cl_ke_id, - cl.ims_md_cl_id, - cl.ims_md_id - from - ims_md_classification_keyword kw, - ims_md_classification cl - where - kw.ims_md_cl_id = cl.ims_md_cl_id - and - kw.ims_md_cl_id = :ims_md_cl_id -} + select '[' || kw.keyword_l || '] ' || kw.keyword_s as keyword, + kw.ims_md_cl_ke_id, cl.ims_md_cl_id, cl.ims_md_id + from ims_md_classification_keyword kw, ims_md_classification cl + where kw.ims_md_cl_id = cl.ims_md_cl_id + and kw.ims_md_cl_id = :ims_md_cl_id +} Index: openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_pur.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_pur.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_pur.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_pur.adp 17 Nov 2008 13:36:44 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Classification Metadata Purpose

- +
- + + - - - + + + +
Classification MetadataClassification Metadata
Purpose:
Purpose:
- -

#lorsm.lt_AddEdit_Classificatio_7#

- + Index: openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_pur.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_pur.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_pur.tcl 15 May 2007 20:14:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_pur.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/classificationmd/classification_pur.tcl ad_page_contract { - + Add/Edit Classification MD Purpose - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -19,47 +19,60 @@ # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../classificationmd" ims_md_id] "[_ lorsm.Classification_MD]"] [list [export_vars -base "classification" {ims_md_id ims_md_cl_id}] "[_ lorsm.Classification_Entry]"] "[_ lorsm.AddEdit_Purpose]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../classificationmd" ims_md_id] \ + "[_ lorsm.Classification_MD]"] \ + + [list [export_vars \ + -base "classification" {ims_md_id ims_md_cl_id}] \ + "[_ lorsm.Classification_Entry]"] \ + + "[_ lorsm.AddEdit_Purpose]"] + set title "[_ lorsm.lt_Edit_Classification_M_1]" # Form - -ad_form -name classificationmd_pur \ +ad_form \ + -name classificationmd_pur \ -cancel_url classification?ims_md_id=$ims_md_id&ims_md_cl_id=$ims_md_cl_id \ -mode edit \ -form { + ims_md_cl_id:key(ims_md_classification_seq) - ims_md_cl_id:key(ims_md_classification_seq) + {purpose_s:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} + {label "[_ lorsm.Source]"} + } - {purpose_s:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} - {label "[_ lorsm.Source]"} - } - - {purpose_v:text,nospell - {html {size 20}} - {help_text "[_ lorsm.lt_Characteristics_of_th]"} - {label "[_ lorsm.Purpose]"} - } + {purpose_v:text,nospell + {html {size 20}} + {help_text "[_ lorsm.lt_Characteristics_of_th]"} + {label "[_ lorsm.Purpose]"} + } - {ims_md_id:text(hidden) {value $ims_md_id} - } + {ims_md_id:text(hidden) {value $ims_md_id}} -} -select_query {select * from ims_md_classification where ims_md_cl_id = :ims_md_cl_id + } -select_query { + select * + from ims_md_classification + where ims_md_cl_id = :ims_md_cl_id -} -edit_data { - db_dml do_update " - update ims_md_classification + } -edit_data { + db_dml do_update \ + "update ims_md_classification set purpose_s = :purpose_s, purpose_v = :purpose_v where ims_md_cl_id = :ims_md_cl_id " -} -after_submit { - ad_returnredirect [export_vars -base "classification" {ims_md_cl_id ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars -base "classification" {ims_md_cl_id ims_md_id}] ad_script_abort -} + } # Classification Purpose template::list::create \ @@ -68,21 +81,12 @@ -no_data "[_ lorsm.No_Purpose_Available]" \ -html { align right style "width: 100%;" } \ -elements { - purpose_s { - label "" - } - purpose_v { - label "" - } + purpose_s { label "" } + purpose_v { label "" } } db_multirow d_cl_pur select_cl_pur { - select purpose_s, - purpose_v, - ims_md_cl_id, - ims_md_id - from - ims_md_classification - where - ims_md_cl_id = :ims_md_cl_id -} + select purpose_s, purpose_v, ims_md_cl_id, ims_md_id + from ims_md_classification + where ims_md_cl_id = :ims_md_cl_id +} Index: openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_taxon.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_taxon.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_taxon.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_taxon.adp 17 Nov 2008 13:36:44 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Classification Metadata Taxonomic Path Taxonomy

- +
- + + - - - + + + +
Classification MetadataClassification Metadata
Keywords:
Keywords:
- -

#lorsm.lt_AddEdit_Classificatio_8#

- + Index: openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_taxon.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_taxon.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_taxon.tcl 15 May 2007 20:14:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_taxon.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/classificationmd/classification_taxon.tcl ad_page_contract { - + Add/Edit Classification MD Taxonomic Path Taxonomy - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -21,69 +21,101 @@ # set context & title if { ![ad_form_new_p -key ims_md_cl_ta_ta_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../classificationmd" ims_md_id] "[_ lorsm.Classification_MD]"] [list [export_vars -base "classification" {ims_md_id ims_md_cl_id ims_md_cl_ta_id}] "[_ lorsm.Classification_Entry]"] [list [export_vars -base "classification_tpath" {ims_md_id ims_md_cl_id ims_md_cl_ta_id}] "[_ lorsm.Taxonomic_Paths_2]"] "[_ lorsm.Edit_Taxonomy]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../classificationmd" ims_md_id] \ + "[_ lorsm.Classification_MD]"] \ + + [list [export_vars \ + -base "classification" \ + {ims_md_id ims_md_cl_id ims_md_cl_ta_id}] \ + "[_ lorsm.Classification_Entry]"] \ + + [list [export_vars \ + -base "classification_tpath" \ + {ims_md_id ims_md_cl_id ims_md_cl_ta_id}] \ + "[_ lorsm.Taxonomic_Paths_2]"] \ + + "[_ lorsm.Edit_Taxonomy]"] + set title "[_ lorsm.lt_Edit_Classification_M_2]" } else { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../classificationmd" ims_md_id] "[_ lorsm.Classification_MD]"] [list [export_vars -base "classification" {ims_md_id ims_md_cl_id ims_md_cl_ta_id}] "[_ lorsm.lt_Classification_Entry_]"] "[_ lorsm.Add_Taxonomy]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../classificationmd" ims_md_id] \ + "[_ lorsm.Classification_MD]"] \ + + [list [export_vars \ + -base "classification" \ + {ims_md_id ims_md_cl_id ims_md_cl_ta_id}] \ + "[_ lorsm.lt_Classification_Entry_]"] \ + + "[_ lorsm.Add_Taxonomy]"] + set title "[_ lorsm.lt_Add_Classification_MD_4]" } # Form - -ad_form -name classificationmd_taxon \ +ad_form \ + -name classificationmd_taxon \ -cancel_url classification_tpath?ims_md_id=$ims_md_id&ims_md_cl_id=$ims_md_cl_id&ims_md_cl_ta_id=$ims_md_cl_ta_id \ -mode edit \ -form { + ims_md_cl_ta_ta_id:key(ims_md_classification_taxpath_taxon_seq) - ims_md_cl_ta_ta_id:key(ims_md_classification_taxpath_taxon_seq) + {identifier:text,nospell + {html {size 50}} + {help_text "[_ lorsm.lt_Taxons_identifier_in_]"} + {label "[_ lorsm.Identifier]"} + } - {identifier:text,nospell - {html {size 50}} - {help_text "[_ lorsm.lt_Taxons_identifier_in_]"} - {label "[_ lorsm.Identifier]"} - } + {entry_l:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } - {entry_l:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} - {label "[_ lorsm.Language]"} - } + {entry_s:text,nospell + {html {size 50}} + {help_text "[_ lorsm.lt_Number_in_the_Catalog]"} + {label "[_ lorsm.Entry]"} + } - {entry_s:text,nospell - {html {size 50}} - {help_text "[_ lorsm.lt_Number_in_the_Catalog]"} - {label "[_ lorsm.Entry]"} - } - - {ims_md_id:text(hidden) {value $ims_md_id} - } + {ims_md_id:text(hidden) {value $ims_md_id}} - {ims_md_cl_id:text(hidden) {value $ims_md_cl_id} - } + {ims_md_cl_id:text(hidden) {value $ims_md_cl_id}} - {ims_md_cl_ta_id:text(hidden) {value $ims_md_cl_ta_id} - } + {ims_md_cl_ta_id:text(hidden) {value $ims_md_cl_ta_id}} -} -select_query {select * from ims_md_classification_taxpath_taxon where ims_md_cl_ta_ta_id = :ims_md_cl_ta_ta_id and ims_md_cl_ta_id = :ims_md_cl_ta_id + } -select_query { + select * + from ims_md_classification_taxpath_taxon + where ims_md_cl_ta_ta_id = :ims_md_cl_ta_ta_id + and ims_md_cl_ta_id = :ims_md_cl_ta_id -} -edit_data { - db_dml do_update " - update ims_md_classification_taxpath_taxon + } -edit_data { + db_dml do_update \ + "update ims_md_classification_taxpath_taxon set identifier = :identifier, entry_l = :entry_l, entry_s = :entry_s where ims_md_cl_ta_ta_id = :ims_md_cl_ta_ta_id" -} -new_data { - db_dml do_insert " - insert into ims_md_classification_taxpath_taxon (ims_md_cl_ta_ta_id, ims_md_cl_ta_id, identifier, entry_l, entry_s) - values - (:ims_md_cl_ta_ta_id, :ims_md_cl_ta_id, :identifier, :entry_l, :entry_s)" + } -new_data { + db_dml do_insert \ + "insert into ims_md_classification_taxpath_taxon (ims_md_cl_ta_ta_id, ims_md_cl_ta_id, identifier, entry_l, entry_s) + values (:ims_md_cl_ta_ta_id, :ims_md_cl_ta_id, :identifier, :entry_l, :entry_s)" -} -after_submit { - ad_returnredirect [export_vars -base "classification_tpath" {ims_md_cl_ta_id ims_md_cl_id ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars \ + -base "classification_tpath" \ + {ims_md_cl_ta_id ims_md_cl_id ims_md_id}] ad_script_abort -} + } # Classification Taxonomic Path Taxonomy template::list::create \ @@ -92,32 +124,22 @@ -no_data "[_ lorsm.lt_No_Taxonomies_Availab]" \ -html { align right style "width: 100%;" } \ -elements { - identifier { - label "[_ lorsm.ID]" - } - entry { - label "[_ lorsm.Entry_1]" - } - export { - display_eval {\[[_ lorsm.Edit_1]\]} - link_url_eval { [export_vars -base "classification_taxon" {ims_md_cl_ta_ta_id ims_md_cl_ta_id ims_md_cl_id ims_md_id}] } - link_html {title "[_ lorsm.Edit_Record]"} - html { align center } - } + identifier { label "[_ lorsm.ID]" } + entry { label "[_ lorsm.Entry_1]" } + export { + display_eval {\[[_ lorsm.Edit_1]\]} + link_url_eval { [export_vars \ + -base "classification_taxon" \ + {ims_md_cl_ta_ta_id ims_md_cl_ta_id ims_md_cl_id ims_md_id}] } + link_html {title "[_ lorsm.Edit_Record]"} + html { align center } + } } db_multirow d_cl_taxon select_cl_taxon { - select ctt.identifier, - '[' || ctt.entry_l || '] ' || ctt.entry_s as entry, - ctt.ims_md_cl_ta_id, - ctt.ims_md_cl_ta_ta_id, - cl.ims_md_cl_id, - cl.ims_md_id - from - ims_md_classification_taxpath_taxon ctt, - ims_md_classification cl - where - ctt.ims_md_cl_ta_id = :ims_md_cl_ta_id - and - cl.ims_md_cl_id = :ims_md_cl_id -} + select ctt.identifier, '[' || ctt.entry_l || '] ' || ctt.entry_s as entry, + ctt.ims_md_cl_ta_id, ctt.ims_md_cl_ta_ta_id, cl.ims_md_cl_id, cl.ims_md_id + from ims_md_classification_taxpath_taxon ctt, ims_md_classification cl + where ctt.ims_md_cl_ta_id = :ims_md_cl_ta_id + and cl.ims_md_cl_id = :ims_md_cl_id +} Index: openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_tpath.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_tpath.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_tpath.adp 31 Dec 2006 00:36:06 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_tpath.adp 17 Nov 2008 13:36:44 -0000 1.2 @@ -2,19 +2,20 @@ @title;noquote@ @context;noquote@ - + - +
- + + - - - + + + + - - + + -
Classification Metadata Taxonomic PathClassification Metadata Taxonomic Path
Source:
Source:
Taxonomies: Taxonomies:
+ Index: openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_tpath.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_tpath.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_tpath.tcl 31 Dec 2006 00:36:06 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_tpath.tcl 17 Nov 2008 13:36:44 -0000 1.2 @@ -13,53 +13,63 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../classificationmd" ims_md_id] "[_ lorsm.Classification_MD]"] [list [export_vars -base "classification" {ims_md_id ims_md_cl_id ims_md_cl_ta_id}] "[_ lorsm.Classification_Entry]"] "[_ lorsm.Taxonomic_Paths_1]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../classificationmd" ims_md_id] \ + "[_ lorsm.Classification_MD]"] \ + + [list [export_vars -base "classification" \ + {ims_md_id ims_md_cl_id ims_md_cl_ta_id}] \ + "[_ lorsm.Classification_Entry]"] \ + + "[_ lorsm.Taxonomic_Paths_1]"] + set title "[_ lorsm.lt_Classification_MD_Tax]" # Classification Taxonomic Path Source template::list::create \ -name d_cl_source \ -multirow d_cl_source \ -no_data "[_ lorsm.No_Source_Available]" \ - -actions [list "[_ lorsm.Add_Source]" [export_vars -base classification_tsource {ims_md_cl_ta_id ims_md_cl_id ims_md_id}] "[_ lorsm.Add_another_Source]"] \ + -actions [list \ + "[_ lorsm.Add_Source]" \ + [export_vars \ + -base classification_tsource \ + {ims_md_cl_ta_id ims_md_cl_id ims_md_id}] \ + "[_ lorsm.Add_another_Source]"] \ -html { align right style "width: 100%;" } \ -elements { - source { - label "" - } + source { label "" } } db_multirow d_cl_source select_cl_source { - select - '[' || source_l || '] ' || source_v as source - from - ims_md_classification_taxpath - where - ims_md_cl_ta_id = :ims_md_cl_ta_id - and ims_md_cl_id = :ims_md_cl_id -} + select '[' || source_l || '] ' || source_v as source + from ims_md_classification_taxpath + where ims_md_cl_ta_id = :ims_md_cl_ta_id + and ims_md_cl_id = :ims_md_cl_id +} # Classification Taxonomic Path Taxonomy template::list::create \ -name d_cl_taxon \ -multirow d_cl_taxon \ -no_data "[_ lorsm.lt_No_Taxonomies_Availab]" \ - -actions [list "[_ lorsm.Add_Taxonomy]" [export_vars -base classification_taxon {ims_md_cl_ta_id ims_md_cl_id ims_md_id}] "[_ lorsm.Add_another_Taxonomy]"] \ + -actions [list \ + "[_ lorsm.Add_Taxonomy]" \ + [export_vars \ + -base classification_taxon \ + {ims_md_cl_ta_id ims_md_cl_id ims_md_id}] \ + "[_ lorsm.Add_another_Taxonomy]"] \ -html { align right style "width: 100%;" } \ -elements { - identifier { - label "[_ lorsm.ID]" - } - entry { - label "[_ lorsm.Entry_1]" - } + identifier { label "[_ lorsm.ID]" } + entry { label "[_ lorsm.Entry_1]" } } db_multirow d_cl_taxon select_cl_taxon { - select identifier, - '[' || entry_l || '] ' || entry_s as entry - from - ims_md_classification_taxpath_taxon - where - ims_md_cl_ta_id = :ims_md_cl_ta_id + select identifier, '[' || entry_l || '] ' || entry_s as entry + from ims_md_classification_taxpath_taxon + where ims_md_cl_ta_id = :ims_md_cl_ta_id } Index: openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_tsource.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_tsource.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_tsource.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_tsource.adp 17 Nov 2008 13:36:44 -0000 1.4 @@ -2,25 +2,24 @@ @title;noquote@ @context;noquote@ - +

Classification Metadata Taxonomic Path Source

- +
- + + - - - + + + -
Classification Metadata Taxonomic PathClassification Metadata Taxonomic Path
Source:
Source:
+

#lorsm.lt_AddEdit_Classificatio_9#

- + Index: openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_tsource.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_tsource.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_tsource.tcl 15 May 2007 20:14:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/classificationmd/classification_tsource.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/classificationmd/classification_tsource.tcl ad_page_contract { - + Add/Edit Classification MD Taxonomic Path Source - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -20,51 +20,67 @@ # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../classificationmd" ims_md_id] "[_ lorsm.Classification_MD]"] [list [export_vars -base "classification" {ims_md_id ims_md_cl_id ims_md_cl_ta_id}] "[_ lorsm.Classification_Entry]"] [list [export_vars -base "classification_tpath" {ims_md_id ims_md_cl_id ims_md_cl_ta_id}] "[_ lorsm.Taxonomic_Paths_1]"] "[_ lorsm.AddEdit_Source]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + [list [export_vars -base "../classificationmd" ims_md_id] \ + "[_ lorsm.Classification_MD]"] \ + + [list [export_vars \ + -base "classification" \ + {ims_md_id ims_md_cl_id ims_md_cl_ta_id}] \ + "[_ lorsm.Classification_Entry]"] + + [list [export_vars -base "classification_tpath" \ + {ims_md_id ims_md_cl_id ims_md_cl_ta_id}] \ + "[_ lorsm.Taxonomic_Paths_1]"] \ + + "[_ lorsm.AddEdit_Source]"] + set title "[_ lorsm.lt_Edit_Classification_M_3]" # Form - -ad_form -name classificationmd_tsource \ +ad_form \ + -name classificationmd_tsource \ -cancel_url classification_tpath?ims_md_id=$ims_md_id&ims_md_cl_id=$ims_md_cl_id&ims_md_cl_ta_id=$ims_md_cl_ta_id \ -mode edit \ -form { + ims_md_cl_ta_id:key(ims_md_classification_taxpath_seq) - ims_md_cl_ta_id:key(ims_md_classification_taxpath_seq) + {source_l:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"}} - {source_l:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} - {label "[_ lorsm.Language]"} - } - - {source_v:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} - {label "[_ lorsm.Source]"} - } - - {ims_md_cl_id:text(hidden) {value $ims_md_cl_id} - } + {source_v:text,nospell + {html {size 10}} - {ims_md_id:text(hidden) {value $ims_md_id} - } + {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} + {label "[_ lorsm.Source]"}} -} -select_query {select * from ims_md_classification_taxpath where ims_md_cl_ta_id = :ims_md_cl_ta_id and ims_md_cl_id = :ims_md_cl_id + {ims_md_cl_id:text(hidden) {value $ims_md_cl_id}} -} -edit_data { - db_dml do_update " - update ims_md_classification_taxpath - set source_l = :source_l, - source_v = :source_v + {ims_md_id:text(hidden) {value $ims_md_id}} + } -select_query { + select * + from ims_md_classification_taxpath + where ims_md_cl_ta_id = :ims_md_cl_ta_id + and ims_md_cl_id = :ims_md_cl_id + + } -edit_data { + db_dml do_update \ + "update ims_md_classification_taxpath + set source_l = :source_l, source_v = :source_v where ims_md_cl_ta_id = :ims_md_cl_ta_id" -} -after_submit { - ad_returnredirect [export_vars -base "classification_tpath" {ims_md_cl_ta_id ims_md_cl_id ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars \ + -base "classification_tpath" \ + {ims_md_cl_ta_id ims_md_cl_id ims_md_id}] ad_script_abort -} + } # Classification Taxonomic Path Source template::list::create \ @@ -73,27 +89,22 @@ -no_data "[_ lorsm.lt_No_Taxonomic_Path_Sou]" \ -html { align right style "width: 100%;" } \ -elements { - source { - label "" - } + source { label "" } + export { display_eval {\[[_ lorsm.Edit_1]\]} - link_url_eval { [export_vars -base "classification_tsource" {ims_md_cl_ta_id ims_md_cl_id ims_md_id}] } + link_url_eval { [export_vars \ + -base "classification_tsource" \ + {ims_md_cl_ta_id ims_md_cl_id ims_md_id}] } link_html {title "[_ lorsm.Edit_Record]"} html { align center } } } db_multirow d_cl_tsource select_cl_tsource { - select - '[' || ctp.source_l || '] ' || ctp.source_v as source, - ctp.ims_md_cl_ta_id, - ctp.ims_md_cl_id, - cl.ims_md_id - from - ims_md_classification_taxpath ctp, - ims_md_classification cl - where - ctp.ims_md_cl_ta_id = :ims_md_cl_ta_id - and cl.ims_md_cl_id = :ims_md_cl_id -} + select '[' || ctp.source_l || '] ' || ctp.source_v as source, ctp.ims_md_cl_ta_id, + ctp.ims_md_cl_id, cl.ims_md_id + from ims_md_classification_taxpath ctp, ims_md_classification cl + where ctp.ims_md_cl_ta_id = :ims_md_cl_ta_id + and cl.ims_md_cl_id = :ims_md_cl_id +} Index: openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_cont.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_cont.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_cont.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_cont.adp 17 Nov 2008 13:36:44 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Educational Metadata Context

- +
- + + - - - + + + +
Educational MetadataEducational Metadata
Context:
Context:
- -

#lorsm.lt_AddEdit_Educational_M_11#

- + Index: openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_cont.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_cont.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_cont.tcl 15 May 2007 20:14:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_cont.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/educationalmd/educational_cont.tcl ad_page_contract { - + Add/Edit Educational MD Context - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -19,53 +19,70 @@ # set context & title if { ![ad_form_new_p -key ims_md_ed_co_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../educationalmd" im\s_md_id] "[_ lorsm.Educational_MD]"] "[_ lorsm.Edit_Context]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../educationalmd" im\s_md_id] \ + "[_ lorsm.Educational_MD]"] \ + + "[_ lorsm.Edit_Context]"] set title "[_ lorsm.lt_Edit_Educational_MD_C]" } else { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../educationalmd" im\s_md_id] "[_ lorsm.Educational_MD]"] "[_ lorsm.Add_Context]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../educationalmd" im\s_md_id] \ + "[_ lorsm.Educational_MD]"] \ + + "[_ lorsm.Add_Context]"] set title "[_ lorsm.lt_Add_Educational_MD_Co]" } # Form -ad_form -name educationalmd_cont \ +ad_form \ + -name educationalmd_cont \ -cancel_url ../educationalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + ims_md_ed_co_id:key(ims_md_educational_context_seq) - ims_md_ed_co_id:key(ims_md_educational_context_seq) + {context_s:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} + {label "[_ lorsm.Source]"} + } - {context_s:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} - {label "[_ lorsm.Source]"} - } + {context_v:text,nospell + {html {size 20}} + {help_text "[_ lorsm.lt_Learning_environment_]"} + {label "[_ lorsm.Context]"} + } - {context_v:text,nospell - {html {size 20}} - {help_text "[_ lorsm.lt_Learning_environment_]"} - {label "[_ lorsm.Context]"} - } + {ims_md_id:text(hidden) {value $ims_md_id}} - {ims_md_id:text(hidden) {value $ims_md_id} - } + } -select_query { + select * from + ims_md_educational_context + where ims_md_ed_co_id = :ims_md_ed_co_id + and ims_md_id = :ims_md_id -} -select_query {select * from ims_md_educational_context where ims_md_ed_co_id = :ims_md_ed_co_id and ims_md_id = :ims_md_id - -} -edit_data { - db_dml do_update " - update ims_md_educational_context + } -edit_data { + db_dml do_update \ + "update ims_md_educational_context set context_s = :context_s, context_v = :context_v where ims_md_ed_co_id = :ims_md_ed_co_id " -} -new_data { - db_dml do_insert " - insert into ims_md_educational_context (ims_md_ed_co_id, ims_md_id, context_s, context_v) + } -new_data { + db_dml do_insert \ + "insert into ims_md_educational_context (ims_md_ed_co_id, ims_md_id, context_s, context_v) values (:ims_md_ed_co_id, :ims_md_id, :context_s, :context_v)" -} -after_submit { - ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] ad_script_abort -} + } # Educational Context template::list::create \ @@ -74,24 +91,19 @@ -no_data "[_ lorsm.No_Context_Available]" \ -html { align right style "width: 100%;" } \ -elements { - context { - label "[_ lorsm.Context_1]" - } + context {label "[_ lorsm.Context_1]"} export { display_eval {\[[_ lorsm.Edit_1]\]} - link_url_eval { [export_vars -base "educational_cont" {ims_md_ed_co_id ims_md_id}] } + link_url_eval { [export_vars \ + -base "educational_cont" \ + {ims_md_ed_co_id ims_md_id}] } link_html {title "[_ lorsm.Edit_Record]"} html { align center } } } db_multirow d_ed_cont select_ed_cont { - select - '[' || context_s || '] ' || context_v as context, - ims_md_ed_co_id, - ims_md_id - from - ims_md_educational_context - where - ims_md_id = :ims_md_id -} + select '[' || context_s || '] ' || context_v as context, ims_md_ed_co_id, ims_md_id + from ims_md_educational_context + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_desc.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_desc.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_desc.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_desc.adp 17 Nov 2008 13:36:44 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Educational Metadata Description

- +
- + + - - - + + + +
Educational MetadataEducational Metadata
Description:
Description:
- -

#lorsm.lt_AddEdit_Educational_M_12#

- + Index: openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_desc.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_desc.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_desc.tcl 15 May 2007 20:14:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_desc.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/educationalmd/educational_desc.tcl ad_page_contract { - + Add/Edit Educational MD Description - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -19,53 +19,72 @@ # set context & title if { ![ad_form_new_p -key ims_md_ed_de_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../educationalmd" ims_md_id] "[_ lorsm.Educational_MD]"] "[_ lorsm.Edit_Description]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../educationalmd" ims_md_id] \ + "[_ lorsm.Educational_MD]"] \ + + "[_ lorsm.Edit_Description]"] set title "[_ lorsm.lt_Edit_Educational_MD_D]" } else { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../educationalmd" ims_md_id] "[_ lorsm.Educational_MD]"] "[_ lorsm.Add_Description]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../educationalmd" ims_md_id] \ + "[_ lorsm.Educational_MD]"] \ + + "[_ lorsm.Add_Description]"] set title "[_ lorsm.lt_Add_Educational_MD_De]" } # Form -ad_form -name educationalmd_desc \ +ad_form \ + -name educationalmd_desc \ -cancel_url ../educationalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + ims_md_ed_de_id:key(ims_md_educational_descrip_seq) - ims_md_ed_de_id:key(ims_md_educational_descrip_seq) + {descrip_l:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } - {descrip_l:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} - {label "[_ lorsm.Language]"} - } + {descrip_s:text(textarea),nospell + {html {rows 2 cols 50}} + {help_text "[_ lorsm.lt_How_the_learning_obje]"} + {label "[_ lorsm.Description]"} + } - {descrip_s:text(textarea),nospell - {html {rows 2 cols 50}} - {help_text "[_ lorsm.lt_How_the_learning_obje]"} - {label "[_ lorsm.Description]"} - } + {ims_md_id:text(hidden) {value $ims_md_id}} - {ims_md_id:text(hidden) {value $ims_md_id} - } + } -select_query { + select * + from ims_md_educational_descrip + where ims_md_ed_de_id = :ims_md_ed_de_id + and ims_md_id = :ims_md_id -} -select_query {select * from ims_md_educational_descrip where ims_md_ed_de_id = :ims_md_ed_de_id and ims_md_id = :ims_md_id - -} -edit_data { - db_dml do_update " - update ims_md_educational_descrip + } -edit_data { + db_dml do_update \ + "update ims_md_educational_descrip set descrip_l = :descrip_l, descrip_s = :descrip_s where ims_md_ed_de_id = :ims_md_ed_de_id " -} -new_data { - db_dml do_insert " - insert into ims_md_educational_descrip (ims_md_ed_de_id, ims_md_id, descrip_l, descrip_s) + + } -new_data { + db_dml do_insert \ + "insert into ims_md_educational_descrip (ims_md_ed_de_id, ims_md_id, descrip_l, descrip_s) values (:ims_md_ed_de_id, :ims_md_id, :descrip_l, :descrip_s)" -} -after_submit { - ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] + + } -after_submit { + ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] ad_script_abort -} + } # Educational Description template::list::create \ @@ -74,24 +93,19 @@ -no_data "[_ lorsm.lt_No_Description_Availa]" \ -html { align right style "width: 100%;" } \ -elements { - desc { - label "[_ lorsm.Description_1]" - } + desc { label "[_ lorsm.Description_1]" } export { display_eval {\[[_ lorsm.Edit_1]\]} - link_url_eval { [export_vars -base "educational_desc" {ims_md_ed_de_id ims_md_id}] } + link_url_eval { [export_vars \ + -base "educational_desc" \ + {ims_md_ed_de_id ims_md_id}] } link_html {title "[_ lorsm.Edit_Record]"} html { align center } } } db_multirow d_ed_desc select_ed_desc { - select - '[' || descrip_l || '] ' || descrip_s as desc, - ims_md_ed_de_id, - ims_md_id - from - ims_md_educational_descrip - where - ims_md_id = :ims_md_id -} + select '[' || descrip_l || '] ' || descrip_s as desc, ims_md_ed_de_id, ims_md_id + from ims_md_educational_descrip + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_dif.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_dif.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_dif.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_dif.adp 17 Nov 2008 13:36:44 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Educational Metadata Difficulty

- +
- + + - - - + + + +
Educational MetadataEducational Metadata
Difficulty:
Difficulty:
- -

#lorsm.lt_AddEdit_Educational_M_13#

- + Index: openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_dif.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_dif.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_dif.tcl 15 May 2007 20:14:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_dif.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -1,14 +1,14 @@ # packages/lorsm/www/md/educationalmd/educational_dif.tcl ad_page_contract { - + Add/Edit Educational MD Difficulty - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @cvs-id $Id$ - + } { ims_md_id:integer } -properties { @@ -17,71 +17,70 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../educationalmd" ims_md_id] "[_ lorsm.Educational_MD]"] "[_ lorsm.AddEdit_Difficulty]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../educationalmd" ims_md_id] \ + "[_ lorsm.Educational_MD]"] \ + "[_ lorsm.AddEdit_Difficulty]"] set title "[_ lorsm.lt_AddEdit_Educational_M_13]" # Form - -ad_form -name educationalmd_dif \ +ad_form \ + -name educationalmd_dif \ -cancel_url ../educationalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + {difficulty_s:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} + {label "[_ lorsm.Source]"} + } - {difficulty_s:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} - {label "[_ lorsm.Source]"} - } + {difficulty_v:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Level_of_difficulty_i]"} + {label "[_ lorsm.Difficulty]"} + } - {difficulty_v:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Level_of_difficulty_i]"} - {label "[_ lorsm.Difficulty]"} - } + {ims_md_id:text(hidden) {value $ims_md_id}} - {ims_md_id:text(hidden) {value $ims_md_id}} + } -on_submit { + # check if the educational difficulty details already exist... -} -on_submit { - # check if the educational difficulty details already exist... + if {[db_0or1row select_size { + select ims_md_id + from ims_md_educational + where ims_md_id = :ims_md_id}]} { + db_dml do_update \ + "update ims_md_educational + set difficulty_s = :difficulty_s, difficulty_v = :difficulty_v + where ims_md_id = :ims_md_id " - if {[db_0or1row select_size {select ims_md_id from ims_md_educational where ims_md_id = :ims_md_id}]} { + } else { + db_dml do_insert \ + "insert into ims_md_educational (ims_md_id, difficulty_s, difficulty_v) + values (:ims_md_id, :difficulty_s, :difficulty_v) " + } - db_dml do_update " - update ims_md_educational - set difficulty_s = :difficulty_s, difficulty_v = :difficulty_v - where ims_md_id = :ims_md_id " - - } else { - - db_dml do_insert " - insert into ims_md_educational (ims_md_id, difficulty_s, difficulty_v) - values - (:ims_md_id, :difficulty_s, :difficulty_v) " + } -after_submit { + ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] + ad_script_abort } -} -after_submit { - ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] - ad_script_abort -} - # Educational Difficulty template::list::create \ -name d_ed_dif \ -multirow d_ed_dif \ -no_data "[_ lorsm.lt_No_Difficulty_Type_Av]" \ -html { align right style "width: 100%;" } \ -elements { - diff { - label "[_ lorsm.Difficulty_1]" - } + diff { label "[_ lorsm.Difficulty_1]" } } db_multirow d_ed_dif select_ed_dif { - select - '[' || difficulty_s || '] ' || difficulty_v as diff, - ims_md_id - from - ims_md_educational - where - ims_md_id = :ims_md_id -} + select '[' || difficulty_s || '] ' || difficulty_v as diff, ims_md_id + from ims_md_educational + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_ieur.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_ieur.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_ieur.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_ieur.adp 17 Nov 2008 13:36:44 -0000 1.4 @@ -2,25 +2,22 @@ @title;noquote@ @context;noquote@ - +

Educational Metadata Intended End User Role

- +
- + - - - + + + +
Educational MetadataEducational Metadata
Intended End User Role:
Intended End User Role:
- -

#lorsm.lt_AddEdit_Educational_M_14#

- + Index: openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_ieur.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_ieur.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_ieur.tcl 15 May 2007 20:14:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_ieur.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/educationalmd/educational_ieur.tcl ad_page_contract { - + Add/Edit Educational MD Intended End User Role - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -19,53 +19,71 @@ # set context & title if { ![ad_form_new_p -key ims_md_ed_ie_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../educationalmd" ims_md_id] "[_ lorsm.Educational_MD]"] "[_ lorsm.lt_Edit_Intended_End_Use]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../educationalmd" ims_md_id] \ + "[_ lorsm.Educational_MD]"] \ + + "[_ lorsm.lt_Edit_Intended_End_Use]"] set title "[_ lorsm.lt_Edit_Educational_MD_I]" } else { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../educationalmd" ims_md_id] "[_ lorsm.Educational_MD]"] "[_ lorsm.lt_Add_Intended_End_User]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../educationalmd" ims_md_id] \ + "[_ lorsm.Educational_MD]"] \ + + "[_ lorsm.lt_Add_Intended_End_User]"] set title "[_ lorsm.lt_Add_Educational_MD_In]" } # Form - -ad_form -name educationalmd_ieur \ +ad_form \ + -name educationalmd_ieur \ -cancel_url ../educationalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + ims_md_ed_ie_id:key(ims_md_educational_ieur_seq) - ims_md_ed_ie_id:key(ims_md_educational_ieur_seq) + {ieur_s:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} + {label "[_ lorsm.Source]"} + } - {ieur_s:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} - {label "[_ lorsm.Source]"} - } + {ieur_v:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Normal_user_of_the_le]"} + {label "[_ lorsm.lt_Intended_End_User_Rol]"} + } - {ieur_v:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Normal_user_of_the_le]"} - {label "[_ lorsm.lt_Intended_End_User_Rol]"} - } + {ims_md_id:text(hidden) {value $ims_md_id}} - {ims_md_id:text(hidden) {value $ims_md_id} - } + } -select_query { + select * + from ims_md_educational_ieur + where ims_md_ed_ie_id = :ims_md_ed_ie_id + and ims_md_id = :ims_md_id -} -select_query {select * from ims_md_educational_ieur where ims_md_ed_ie_id = :ims_md_ed_ie_id and ims_md_id = :ims_md_id - -} -edit_data { - db_dml do_update " - update ims_md_educational_ieur - set ieur_s = :ieur_s, - ieur_v = :ieur_v + } -edit_data { + db_dml do_update \ + "update ims_md_educational_ieur + set ieur_s = :ieur_s, + ieur_v = :ieur_v where ims_md_ed_ie_id = :ims_md_ed_ie_id" -} -new_data { - db_dml do_insert " - insert into ims_md_educational_ieur (ims_md_ed_ie_id, ims_md_id, ieur_s, ieur_v) + + } -new_data { + db_dml do_insert \ + "insert into ims_md_educational_ieur (ims_md_ed_ie_id, ims_md_id, ieur_s, ieur_v) values (:ims_md_ed_ie_id, :ims_md_id, :ieur_s, :ieur_v)" -} -after_submit { - ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] + + } -after_submit { + ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] ad_script_abort -} + } # Educational Intended End User Role template::list::create \ @@ -74,24 +92,19 @@ -no_data "[_ lorsm.lt_No_Intended_End_User_]" \ -html { align right style "width: 100%;" } \ -elements { - ieur { - label "[_ lorsm.lt_Intended_End_User_Rol_1]" - } + ieur {label "[_ lorsm.lt_Intended_End_User_Rol_1]"} export { display_eval {\[[_ lorsm.Edit_1]\]} - link_url_eval { [export_vars -base "educational_ieur" {ims_md_ed_ie_id ims_md_id}] } + link_url_eval { [export_vars \ + -base "educational_ieur" \ + {ims_md_ed_ie_id ims_md_id}] } link_html {title "[_ lorsm.Edit_Record]"} html { align center } } } db_multirow d_ed_ieur select_ed_ieur { - select - '[' || ieur_s || '] ' || ieur_v as ieur, - ims_md_ed_ie_id, - ims_md_id - from - ims_md_educational_ieur - where - ims_md_id = :ims_md_id -} + select '[' || ieur_s || '] ' || ieur_v as ieur, ims_md_ed_ie_id, ims_md_id + from ims_md_educational_ieur + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_intl.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_intl.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_intl.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_intl.adp 17 Nov 2008 13:36:44 -0000 1.4 @@ -2,25 +2,21 @@ @title;noquote@ @context;noquote@ - +

Educational Metadata Interactivity Level

- +
+ + - + + - - - - +
Educational Metadata
Educational MetadataInteractivity Level:
Interactivity Level:
- -

#lorsm.lt_AddEdit_Educational_M_15#

- + Index: openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_intl.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_intl.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_intl.tcl 15 May 2007 20:14:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_intl.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/educationalmd/educational_intl.tcl ad_page_contract { - + Add/Edit Educational MD Interactivity Level - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -17,71 +17,70 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../educationalmd" \im\\\s_md_id] "[_ lorsm.Educational_MD]"] "[_ lorsm.lt_AddEdit_Interactivity]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + [list [export_vars -base "../educationalmd" \im\\\s_md_id] \ + "[_ lorsm.Educational_MD]"] \ + + "[_ lorsm.lt_AddEdit_Interactivity]"] set title "[_ lorsm.lt_Edit_Educational_MD_I_1]" # Form -ad_form -name educationalmd_intl \ +ad_form \ + -name educationalmd_intl \ -cancel_url ../educationalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + {int_level_s:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} + {label "[_ lorsm.Source]"} + } - {int_level_s:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} - {label "[_ lorsm.Source]"} - } + {int_level_v:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Level_of_interactivit]"} + {label "[_ lorsm.Interactivity_Level]"} + } - {int_level_v:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Level_of_interactivit]"} - {label "[_ lorsm.Interactivity_Level]"} - } - {ims_md_id:text(hidden) {value $ims_md_id}} + {ims_md_id:text(hidden) {value $ims_md_id}} -} -on_submit { - # check if the ED Interactivity Level already exist... + } -on_submit { + # check if the ED Interactivity Level already exist... + if {[db_0or1row select_size { + select ims_md_id + from ims_md_educational + where ims_md_id = :ims_md_id}]} { + db_dml do_update \ + "update ims_md_educational + set int_level_s = :int_level_s, int_level_v = :int_level_v + where ims_md_id = :ims_md_id " + } else { + db_dml do_insert \ + "insert into ims_md_educational (ims_md_id, int_level_s, int_level_v) + values (:ims_md_id, :int_level_s, :int_level_v) " + } - if {[db_0or1row select_size {select ims_md_id from ims_md_educational where ims_md_id = :ims_md_id}]} { - - db_dml do_update " - update ims_md_educational - set int_level_s = :int_level_s, int_level_v = :int_level_v - where ims_md_id = :ims_md_id " - - } else { - - db_dml do_insert " - insert into ims_md_educational (ims_md_id, int_level_s, int_level_v) - values - (:ims_md_id, :int_level_s, :int_level_v) " + } -after_submit { + ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] + ad_script_abort } -} -after_submit { - ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] - ad_script_abort -} - # Educational Interactivity Level template::list::create \ -name d_ed_intl \ -multirow d_ed_intl \ -no_data "[_ lorsm.lt_No_Interactivity_Leve]" \ -html { align right style "width: 100%;" } \ -elements { - intl { - label "[_ lorsm.Interactivity_Level_1]" - } + intl { label "[_ lorsm.Interactivity_Level_1]" } } db_multirow d_ed_intl select_ed_intl { - select - '[' || int_level_s || '] ' || int_level_v as intl, - ims_md_id - from - ims_md_educational - where - ims_md_id = :ims_md_id -} + select '[' || int_level_s || '] ' || int_level_v as intl, ims_md_id + from ims_md_educational + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_intt.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_intt.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_intt.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_intt.adp 17 Nov 2008 13:36:44 -0000 1.4 @@ -2,25 +2,21 @@ @title;noquote@ @context;noquote@ - +

Educational Metadata Interactivity Type

- +
+ + - + + - - - - +
Educational Metadata
Educational MetadataInteractivity Type:
Interactivity Type:
- -

#lorsm.lt_AddEdit_Educational_M_16#

- + Index: openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_intt.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_intt.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_intt.tcl 15 May 2007 20:14:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_intt.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/educationalmd/educational_intt.tcl ad_page_contract { - + Add/Edit Educational MD Interactivity Type - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -17,70 +17,70 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../educationalmd" ims_md_id] "[_ lorsm.Educational_MD]"] "[_ lorsm.lt_AddEdit_Interactivity]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../educationalmd" ims_md_id] \ + "[_ lorsm.Educational_MD]"] \ + + "[_ lorsm.lt_AddEdit_Interactivity]"] set title "[_ lorsm.lt_AddEdit_Educational_M_16]" # Form - -ad_form -name educationalmd_intt \ +ad_form \ + -name educationalmd_intt \ -cancel_url ../educationalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + {int_type_s:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} + {label "[_ lorsm.Source]"} + } - {int_type_s:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} - {label "[_ lorsm.Source]"} - } + {int_type_v:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Type_of_interactivity]"} + {label "[_ lorsm.Interactivity_Type]"} + } - {int_type_v:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Type_of_interactivity]"} - {label "[_ lorsm.Interactivity_Type]"} - } - {ims_md_id:text(hidden) {value $ims_md_id}} + {ims_md_id:text(hidden) {value $ims_md_id}} -} -on_submit { - # check if the ED interactivity type details already exist... + } -on_submit { + # check if the ED interactivity type details already exist... - if {[db_0or1row select_type {select ims_md_id from ims_md_educational where ims_md_id = :ims_md_id}]} { + if {[db_0or1row select_type { + select ims_md_id + from ims_md_educational + where ims_md_id = :ims_md_id}]} { + db_dml do_update \ + "update ims_md_educational + set int_type_s = :int_type_s, int_type_v = :int_type_v + where ims_md_id = :ims_md_id " + } else { + db_dml do_insert \ + "insert into ims_md_educational (ims_md_id, int_type_s, int_type_v) + values (:ims_md_id, :int_type_s, :int_type_v)" + } - db_dml do_update " - update ims_md_educational - set int_type_s = :int_type_s, int_type_v = :int_type_v - where ims_md_id = :ims_md_id " - - } else { - - db_dml do_insert " - insert into ims_md_educational (ims_md_id, int_type_s, int_type_v) - values - (:ims_md_id, :int_type_s, :int_type_v) " + } -after_submit { + ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] + ad_script_abort } -} -after_submit { - ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] - ad_script_abort -} - # Educational Interactivity Type template::list::create \ -name d_ed_intt \ -multirow d_ed_intt \ -no_data "[_ lorsm.lt_No_Interactivity_Type]" \ -html { align right style "width: 100%;" } \ -elements { - intt { - label "[_ lorsm.Interactivity_Type_1]" - } + intt { label "[_ lorsm.Interactivity_Type_1]" } } db_multirow d_ed_intt select_ed_intt { - select - '[' || int_type_s || '] ' || int_type_v as intt, - ims_md_id - from - ims_md_educational - where - ims_md_id = :ims_md_id -} + select '[' || int_type_s || '] ' || int_type_v as intt, ims_md_id + from ims_md_educational + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_lang.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_lang.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_lang.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_lang.adp 17 Nov 2008 13:36:44 -0000 1.4 @@ -2,25 +2,21 @@ @title;noquote@ @context;noquote@ - +

Educational Metadata Language

- +
+ + - + + - - - - +
Educational Metadata
Educational MetadataLanguage:
Language:
- -

#lorsm.lt_AddEdit_Educational_M_17#

- + Index: openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_lang.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_lang.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_lang.tcl 15 May 2007 20:14:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_lang.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/educationalmd/educational_lang.tcl ad_page_contract { - + Add/Edit Educational MD Language - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -19,46 +19,65 @@ # set context & title if { ![ad_form_new_p -key ims_md_ed_la_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../educationalmd" ims_md_id] "[_ lorsm.Educational_MD]"] "[_ lorsm.Edit_Language]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../educationalmd" ims_md_id] \ + "[_ lorsm.Educational_MD]"] \ + + "[_ lorsm.Edit_Language]"] set title "[_ lorsm.lt_Edit_Educational_MD_L]" } else { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../educationalmd" ims_md_id] "[_ lorsm.Educational_MD]"] "[_ lorsm.Add_Language]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../educationalmd" ims_md_id] \ + "[_ lorsm.Educational_MD]"] \ + + "[_ lorsm.Add_Language]"] set title "[_ lorsm.lt_Add_Educational_MD_La]" } # Form -ad_form -name educationalmd_lang \ +ad_form \ + -name educationalmd_lang \ -cancel_url ../educationalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + ims_md_ed_la_id:key(ims_md_educational_lang_seq) - ims_md_ed_la_id:key(ims_md_educational_lang_seq) + {language:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } - {language:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} - {label "[_ lorsm.Language]"} - } + {ims_md_id:text(hidden) {value $ims_md_id}} - {ims_md_id:text(hidden) {value $ims_md_id} - } + } -select_query { + select * + from ims_md_educational_lang + where ims_md_ed_la_id = :ims_md_ed_la_id + and ims_md_id = :ims_md_id -} -select_query {select * from ims_md_educational_lang where ims_md_ed_la_id = :ims_md_ed_la_id and ims_md_id = :ims_md_id - -} -edit_data { - db_dml do_update " - update ims_md_educational_lang - set language = :language + } -edit_data { + db_dml do_update \ + "update ims_md_educational_lang + set language = :language where ims_md_ed_la_id = :ims_md_ed_la_id " -} -new_data { - db_dml do_insert " - insert into ims_md_educational_lang (ims_md_ed_la_id, ims_md_id, language) + + } -new_data { + db_dml do_insert \ + "insert into ims_md_educational_lang (ims_md_ed_la_id, ims_md_id, language) values (:ims_md_ed_la_id, :ims_md_id, :language)" -} -after_submit { - ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] + + } -after_submit { + ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] ad_script_abort -} + } # Educational Language template::list::create \ @@ -67,24 +86,19 @@ -no_data "[_ lorsm.lt_No_Language_Available]" \ -html { align right style "width: 100%;" } \ -elements { - language { - label "[_ lorsm.Language_1]" - } + language {label "[_ lorsm.Language_1]"} export { display_eval {\[Edit\]} - link_url_eval { [export_vars -base "educational_lang" {ims_md_ed_la_id ims_md_id}] } + link_url_eval { [export_vars \ + -base "educational_lang" \ + {ims_md_ed_la_id ims_md_id}] } link_html {title "[_ lorsm.Edit_Record]"} html { align center } } } db_multirow d_ed_lang select_ed_lang { - select - language, - ims_md_ed_la_id, - ims_md_id - from - ims_md_educational_lang - where - ims_md_id = :ims_md_id -} + select language, ims_md_ed_la_id, ims_md_id + from ims_md_educational_lang + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_lrt.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_lrt.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_lrt.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_lrt.adp 17 Nov 2008 13:36:44 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Educational Metadata Learning Resource Type

- +
- + + - - - + + + +
Educational MetadataEducational Metadata
Learning Resource Type:
Learning Resource Type:
- -

#lorsm.lt_AddEdit_Educational_M_18#

- + Index: openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_lrt.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_lrt.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_lrt.tcl 15 May 2007 20:14:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_lrt.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/educationalmd/educational_lrt.tcl ad_page_contract { - + Add/Edit Educational MD Learning Resource Type - + @author Gerard Low (glow5809@mail.usyd.edu.au) @creation-date 16 October 2004 @@ -17,53 +17,72 @@ # set context & title if { ![ad_form_new_p -key ims_md_ed_lr_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../educationalmd" \i\m\\\s_md_id] "[_ lorsm.Educational_MD]"] "[_ lorsm.lt_Edit_Learning_Resourc]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../educationalmd" \i\m\\\s_md_id] \ + "[_ lorsm.Educational_MD]"] \ + + "[_ lorsm.lt_Edit_Learning_Resourc]"] set title "[_ lorsm.lt_Edit_Educational_MD_L_1]" } else { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor] "] [list [export_vars -base "../educationalmd" \i\m\\\s_md_id] "[_ lorsm.Educational_MD]"] "[_ lorsm.lt_Add_Learning_Resource]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor] "] \ + + [list [export_vars -base "../educationalmd" \i\m\\\s_md_id] \ + "[_ lorsm.Educational_MD]"] \ + + "[_ lorsm.lt_Add_Learning_Resource]"] set title "[_ lorsm.lt_Add_Educational_MD_Le]" } # Form -ad_form -name educationalmd_lrt \ +ad_form \ + -name educationalmd_lrt \ -cancel_url ../educationalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + ims_md_ed_lr_id:key(ims_md_educational_lrt_seq) - ims_md_ed_lr_id:key(ims_md_educational_lrt_seq) + {lrt_s:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} + {label "[_ lorsm.Source]"} + } - {lrt_s:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} - {label "[_ lorsm.Source]"} - } + {lrt_v:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Type_of_interactivity]"} + {label "[_ lorsm.lt_Learning_Resource_Typ]"} + } - {lrt_v:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Type_of_interactivity]"} - {label "[_ lorsm.lt_Learning_Resource_Typ]"} - } + {ims_md_id:text(hidden) {value $ims_md_id}} - {ims_md_id:text(hidden) {value $ims_md_id} - } + } -select_query { + select * + from ims_md_educational_lrt + where ims_md_ed_lr_id = :ims_md_ed_lr_id + and ims_md_id = :ims_md_id -} -select_query {select * from ims_md_educational_lrt where ims_md_ed_lr_id = :ims_md_ed_lr_id and ims_md_id = :ims_md_id - -} -edit_data { - db_dml do_update " - update ims_md_educational_lrt - set lrt_s = :lrt_s, - lrt_v = :lrt_v + } -edit_data { + db_dml do_update \ + "update ims_md_educational_lrt + set lrt_s = :lrt_s, + lrt_v = :lrt_v where ims_md_ed_lr_id = :ims_md_ed_lr_id " -} -new_data { - db_dml do_insert " - insert into ims_md_educational_lrt (ims_md_ed_lr_id, ims_md_id, lrt_s, lrt_v) - values (:ims_md_ed_lr_id, :ims_md_id, :lrt_s, :lrt_v)" -} -after_submit { - ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] + + } -new_data { + db_dml do_insert \ + "insert into ims_md_educational_lrt (ims_md_ed_lr_id, ims_md_id, lrt_s, lrt_v) + values (:ims_md_ed_lr_id, :ims_md_id, :lrt_s, :lrt_v)" + + } -after_submit { + ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] ad_script_abort -} + } # Educational Learning Resource Type template::list::create \ @@ -72,24 +91,19 @@ -no_data "[_ lorsm.lt_No_Learning_Resource_]" \ -html { align right style "width: 100%;" } \ -elements { - lrt { - label "" - } + lrt {label ""} export { display_eval {\[Edit\]} - link_url_eval { [export_vars -base "educational_lrt" {ims_md_ed_lr_id ims_md_id}] } + link_url_eval { [export_vars \ + -base "educational_lrt" \ + {ims_md_ed_lr_id ims_md_id}] } link_html {title "[_ lorsm.Edit_Record]"} html { align center } } } db_multirow d_ed_lrt select_ed_lrt { - select - '[' || lrt_s || '] ' || lrt_v as lrt, - ims_md_ed_lr_id, - ims_md_id - from - ims_md_educational_lrt - where - ims_md_id = :ims_md_id -} + select '[' || lrt_s || '] ' || lrt_v as lrt, ims_md_ed_lr_id, ims_md_id + from ims_md_educational_lrt + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_semd.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_semd.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_semd.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_semd.adp 17 Nov 2008 13:36:44 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Educational Metadata Semantic Density

- +
- + + - - - + + + +
Educational MetadataEducational Metadata
Semantic Density:
Semantic Density:
- -

#lorsm.lt_AddEdit_Educational_M_19#

- + Index: openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_semd.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_semd.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_semd.tcl 15 May 2007 20:14:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_semd.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/educationalmd/educational_semd.tcl ad_page_contract { - + Add/Edit Educational MD Semantic Density - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -18,71 +18,71 @@ # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../educationalmd" ims_md_id] "[_ lorsm.Educational_MD]"] "[_ lorsm.lt_AddEdit_Semantic_Dens]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../educationalmd" ims_md_id] \ + "[_ lorsm.Educational_MD]"] \ + "[_ lorsm.lt_AddEdit_Semantic_Dens]"] set title "[_ lorsm.lt_Edit_Educational_MD_S]" # Form -ad_form -name educationalmd_semd \ +ad_form \ + -name educationalmd_semd \ -cancel_url ../educationalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + {sem_density_s:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} + {label "[_ lorsm.Source]"} + } - {sem_density_s:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} - {label "[_ lorsm.Source]"} - } + {sem_density_v:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Learning_objects_usef]"} + {label "[_ lorsm.Semantic_Density]"} + } - {sem_density_v:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Learning_objects_usef]"} - {label "[_ lorsm.Semantic_Density]"} - } - {ims_md_id:text(hidden) {value $ims_md_id}} + {ims_md_id:text(hidden) {value $ims_md_id}} -} -on_submit { - # check if the ED Semantic Density already exist... + } -on_submit { + # check if the ED Semantic Density already exist... - if {[db_0or1row select_size {select ims_md_id from ims_md_educational where ims_md_id = :ims_md_id}]} { + if {[db_0or1row select_size { + select ims_md_id from + ims_md_educational + where ims_md_id = :ims_md_id}]} { + db_dml do_update \ + "update ims_md_educational + set sem_density_s = :sem_density_s, + sem_density_v = :sem_density_v + where ims_md_id = :ims_md_id" + } else { + db_dml do_insert \ + "insert into ims_md_educational (ims_md_id, sem_density_s, sem_density_v) + values (:ims_md_id, :sem_density_s, :sem_density_v)" + } - db_dml do_update " - update ims_md_educational - set sem_density_s = :sem_density_s, - sem_density_v = :sem_density_v - where ims_md_id = :ims_md_id " - - } else { - - db_dml do_insert " - insert into ims_md_educational (ims_md_id, sem_density_s, sem_density_v) - values - (:ims_md_id, :sem_density_s, :sem_density_v) " + } -after_submit { + ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] + ad_script_abort } -} -after_submit { - ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] - ad_script_abort -} - # Educational Semantic Density template::list::create \ -name d_ed_semd \ -multirow d_ed_semd \ -no_data "[_ lorsm.lt_No_Semantic_Density_A]" \ -html { align right style "width: 100%;" } \ -elements { - semd { - label "[_ lorsm.Semantic_Density_1]" - } + semd {label "[_ lorsm.Semantic_Density_1]"} } db_multirow d_ed_semd select_ed_semd { - select - '[' || sem_density_s || '] ' || sem_density_v as semd, - ims_md_id - from - ims_md_educational - where - ims_md_id = :ims_md_id -} + select '[' || sem_density_s || '] ' || sem_density_v as semd, ims_md_id + from ims_md_educational + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_tar.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_tar.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_tar.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_tar.adp 17 Nov 2008 13:36:44 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Educational Metadata Typical Age Range

- +
- + + - - - + + + +
Educational MetadataEducational Metadata
Typical Age Range:
Typical Age Range:
- -

#lorsm.lt_AddEdit_Educational_M_20#

- + Index: openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_tar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_tar.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_tar.tcl 15 May 2007 20:14:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_tar.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/educationalmd/educational_tar.tcl ad_page_contract { - + Add/Edit Educational MD Typical Age Range - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -19,53 +19,71 @@ # set context & title if { ![ad_form_new_p -key ims_md_ed_ta_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../educationalmd" ims_md_id] "[_ lorsm.Educational_MD]"] "[_ lorsm.lt_Edit_Typical_Age_Rang]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../educationalmd" ims_md_id] \ + "[_ lorsm.Educational_MD]"] \ + + "[_ lorsm.lt_Edit_Typical_Age_Rang]"] set title "[_ lorsm.lt_Edit_Educational_MD_T]" } else { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../educationalmd" ims_md_id] "[_ lorsm.Educational_MD]"] "[_ lorsm.Add_Typical_Age_Rang]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../educationalmd" ims_md_id] \ + "[_ lorsm.Educational_MD]"] \ + + "[_ lorsm.Add_Typical_Age_Rang]"] set title "[_ lorsm.lt_Add_Educational_MD_Ty]" } # Form - -ad_form -name educationalmd_tar \ +ad_form \ + -name educationalmd_tar \ -cancel_url ../educationalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + ims_md_ed_ta_id:key(ims_md_educational_tar_seq) - ims_md_ed_ta_id:key(ims_md_educational_tar_seq) + {tar_l:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } - {tar_l:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} - {label "[_ lorsm.Language]"} - } + {tar_s:text,nospell + {html {size 20}} + {help_text "[_ lorsm.lt_Age_of_the_typical_in]"} + {label "[_ lorsm.Typical_Age_Range]" } + } - {tar_s:text,nospell - {html {size 20}} - {help_text "[_ lorsm.lt_Age_of_the_typical_in]"} - {label "[_ lorsm.Typical_Age_Range]" } - } + {ims_md_id:text(hidden) {value $ims_md_id}} - {ims_md_id:text(hidden) {value $ims_md_id} - } + } -select_query { + select * + from ims_md_educational_tar + where ims_md_ed_ta_id = :ims_md_ed_ta_id + and ims_md_id = :ims_md_id -} -select_query {select * from ims_md_educational_tar where ims_md_ed_ta_id = :ims_md_ed_ta_id and ims_md_id = :ims_md_id - -} -edit_data { - db_dml do_update " - update ims_md_educational_tar - set tar_l = :tar_l, - tar_s = :tar_s + } -edit_data { + db_dml do_update \ + "update ims_md_educational_tar + set tar_l = :tar_l, + tar_s = :tar_s where ims_md_ed_ta_id = :ims_md_ed_ta_id " -} -new_data { - db_dml do_insert " - insert into ims_md_educational_tar (ims_md_ed_ta_id, ims_md_id, tar_l, tar_s) + + } -new_data { + db_dml do_insert \ + "insert into ims_md_educational_tar (ims_md_ed_ta_id, ims_md_id, tar_l, tar_s) values (:ims_md_ed_ta_id, :ims_md_id, :tar_l, :tar_s)" -} -after_submit { - ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] + + } -after_submit { + ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] ad_script_abort -} + } # Educational Typical Age Range template::list::create \ @@ -74,9 +92,7 @@ -no_data "[_ lorsm.lt_No_Typical_Age_Range_]" \ -html { align right style "width: 100%;" } \ -elements { - tar { - label "[_ lorsm.Typical_Age_Range_1]" - } + tar {label "[_ lorsm.Typical_Age_Range_1]"} export { display_eval {\[Edit\]} link_url_eval { [export_vars -base "educational_tar" {ims_md_ed_ta_id ims_md_id}] } @@ -86,12 +102,7 @@ } db_multirow d_ed_tar select_ed_tar { - select - '[' || tar_l || '] ' || tar_s as tar, - ims_md_ed_ta_id, - ims_md_id - from - ims_md_educational_tar - where - ims_md_id = :ims_md_id -} + select '[' || tar_l || '] ' || tar_s as tar, ims_md_ed_ta_id, ims_md_id + from ims_md_educational_tar + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_tlt.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_tlt.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_tlt.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_tlt.adp 17 Nov 2008 13:36:44 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Educational Metadata Typical Learning Time

- +
- + + - - - + + + +
Educational MetadataEducational Metadata
Typical Learning Time:
Typical Learning Time:
- -

#lorsm.lt_AddEdit_Educational_M_21#

- + Index: openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_tlt.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_tlt.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_tlt.tcl 15 May 2007 20:14:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/educationalmd/educational_tlt.tcl 17 Nov 2008 13:36:44 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/educationalmd/educational_tlt.tcl ad_page_contract { - + Add/Edit Educational MD Typical Learning Time - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -17,59 +17,65 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../educationalmd" ims_md_id] "[_ lorsm.Educational_MD]"] "[_ lorsm.lt_AddEdit_Typical_Learn]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../educationalmd" ims_md_id] \ + "[_ lorsm.Educational_MD]"] \ + + "[_ lorsm.lt_AddEdit_Typical_Learn]"] set title "[_ lorsm.lt_Edit_Educational_MD_T_1]" # Form - -ad_form -name educationalmd_tlt \ +ad_form \ + -name educationalmd_tlt \ -cancel_url ../educationalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + {type_lrn_time_l:text,nospell,optional + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } - {type_lrn_time_l:text,nospell,optional - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} - {label "[_ lorsm.Language]"} - } + {type_lrn_time_s:text(textarea),nospell,optional + {html {rows 2 cols 50}} + {help_text "[_ lorsm.lt_Brief_Description_Req]"} + {label "[_ lorsm.Description]"} + } - {type_lrn_time_s:text(textarea),nospell,optional - {html {rows 2 cols 50}} - {help_text "[_ lorsm.lt_Brief_Description_Req]"} - {label "[_ lorsm.Description]"} - } + {type_lrn_time:text,nospell + {html {size 20}} + {help_text "[_ lorsm.lt_Amount_of_time_it_tak]"} + {label "[_ lorsm.lt_Typical_Learning_Time]"} + } - {type_lrn_time:text,nospell - {html {size 20}} - {help_text "[_ lorsm.lt_Amount_of_time_it_tak]"} - {label "[_ lorsm.lt_Typical_Learning_Time]"} - } - {ims_md_id:text(hidden) {value $ims_md_id}} + {ims_md_id:text(hidden) {value $ims_md_id}} -} -on_submit { - # check if the educational typical learning time details already exist... + } -on_submit { + # check if the educational typical learning time details already exist... - if {[db_0or1row select_size {select ims_md_id from ims_md_educational where ims_md_id = :ims_md_id}]} { + if {[db_0or1row select_size { + select ims_md_id + from ims_md_educational + where ims_md_id = :ims_md_id}]} { + db_dml do_update \ + "update ims_md_educational + set type_lrn_time_s = :type_lrn_time_s, + type_lrn_time_l = :type_lrn_time_l, + type_lrn_time = :type_lrn_time + where ims_md_id = :ims_md_id " + } else { + db_dml do_insert \ + "insert into ims_md_educational (ims_md_id, type_lrn_time_s, type_lrn_time_l, type_lrn_time) + values (:ims_md_id, :type_lrn_time_s, :type_lrn_time_l, :type_lrn_time) " + } - db_dml do_update " - update ims_md_educational - set type_lrn_time_s = :type_lrn_time_s, - type_lrn_time_l = :type_lrn_time_l, - type_lrn_time = :type_lrn_time - where ims_md_id = :ims_md_id " - - } else { - - db_dml do_insert " - insert into ims_md_educational (ims_md_id, type_lrn_time_s, type_lrn_time_l, type_lrn_time) - values - (:ims_md_id, :type_lrn_time_s, :type_lrn_time_l, :type_lrn_time) " - } - -} -after_submit { - ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] ad_script_abort -} +} # Educational Typical Learning Time template::list::create \ @@ -78,21 +84,12 @@ -no_data "[_ lorsm.lt_No_Typical_Learning_T]" \ -html { align right style "width: 100%;" } \ -elements { - tlt { - label "[_ lorsm.lt_Typical_Learning_Time_1]" - } - tlt_ls { - label "[_ lorsm.Language_1]" - } + tlt { label "[_ lorsm.lt_Typical_Learning_Time_1]" } + tlt_ls { label "[_ lorsm.Language_1]" } } db_multirow d_ed_tlt select_ed_tlt { - select - type_lrn_time as tlt, - '[' || type_lrn_time_l || '] ' || type_lrn_time_s as tlt_ls, - ims_md_id - from - ims_md_educational - where - ims_md_id = :ims_md_id -} + select type_lrn_time as tlt, '[' || type_lrn_time_l || '] ' || type_lrn_time_s as tlt_ls, ims_md_id + from ims_md_educational + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/form-md-record/md-record.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/form-md-record/md-record.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/form-md-record/md-record.tcl 31 Dec 2006 00:36:06 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/form-md-record/md-record.tcl 17 Nov 2008 13:36:44 -0000 1.2 @@ -1,33 +1,53 @@ set actions [list] -lappend actions "[_ lorsm.General_MD]" [export_vars -base ../generalmd {ims_md_id}] "[_ lorsm.lt_View_General_Metadata]" -lappend actions "[_ lorsm.Lifecycle_MD]" [export_vars -base ../lifecyclemd {ims_md_id}] "[_ lorsm.lt_View_Lifecycle_Metada]" -lappend actions "[_ lorsm.Meta_MD]" [export_vars -base ../metamd {ims_md_id}] "[_ lorsm.View_Meta_Metadata]" -lappend actions "[_ lorsm.Technical_MD]" [export_vars -base ../technicalmd {ims_md_id}] "[_ lorsm.lt_View_Technical_Metada]" -lappend actions "[_ lorsm.Educational_MD]" [export_vars -base ../educationalmd {ims_md_id}] "[_ lorsm.lt_View_Educational_Meta]" -lappend actions "[_ lorsm.Rights_MD]" [export_vars -base ../rightsmd {ims_md_id}] "[_ lorsm.View_Rights_Metadata]" -lappend actions "[_ lorsm.Relation_MD]" [export_vars -base ../relationmd {ims_md_id}] "[_ lorsm.lt_View_Relation_Metadat]" -lappend actions "[_ lorsm.Annotation_MD]" [export_vars -base ../annotationmd {ims_md_id}] "[_ lorsm.lt_View_Annotation_Metad]" -lappend actions "[_ lorsm.Classification_MD]" [export_vars -base ../classificationmd {ims_md_id}] "[_ lorsm.lt_View_Classification_M_1]" +lappend actions "[_ lorsm.General_MD]" \ + [export_vars -base ../generalmd {ims_md_id}] \ + "[_ lorsm.lt_View_General_Metadata]" +lappend actions "[_ lorsm.Lifecycle_MD]" \ + [export_vars -base ../lifecyclemd {ims_md_id}] \ + "[_ lorsm.lt_View_Lifecycle_Metada]" -# Presentation +lappend actions "[_ lorsm.Meta_MD]" \ + [export_vars -base ../metamd {ims_md_id}] \ + "[_ lorsm.View_Meta_Metadata]" + +lappend actions "[_ lorsm.Technical_MD]" \ + [export_vars -base ../technicalmd {ims_md_id}] \ + "[_ lorsm.lt_View_Technical_Metada]" + +lappend actions "[_ lorsm.Educational_MD]" \ + [export_vars -base ../educationalmd {ims_md_id}] \ + "[_ lorsm.lt_View_Educational_Meta]" + +lappend actions "[_ lorsm.Rights_MD]" \ + [export_vars -base ../rightsmd {ims_md_id}] \ + "[_ lorsm.View_Rights_Metadata]" + +lappend actions "[_ lorsm.Relation_MD]" \ + [export_vars -base ../relationmd {ims_md_id}] \ + "[_ lorsm.lt_View_Relation_Metadat]" + +lappend actions "[_ lorsm.Annotation_MD]" \ + [export_vars -base ../annotationmd {ims_md_id}] \ + "[_ lorsm.lt_View_Annotation_Metad]" + +lappend actions "[_ lorsm.Classification_MD]" \ + [export_vars -base ../classificationmd {ims_md_id}] \ + "[_ lorsm.lt_View_Classification_M_1]" + +# Presentation template::list::create \ -name d_pres \ -multirow d_pres \ -no_data "-" \ -actions $actions \ -elements { - object_type { - label "[_ lorsm.Object_Type]" - } + object_type { label "[_ lorsm.Object_Type]"} } db_multirow d_pres select_ge_titles { - select - object_type - from - acs_objects - where - object_id = :ims_md_id + select object_type + from acs_objects + where object_id = :ims_md_id } Index: openacs-4/packages/lorsm/www/admin/md/generalmd/general_aggl.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/generalmd/general_aggl.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/generalmd/general_aggl.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/generalmd/general_aggl.adp 17 Nov 2008 13:36:44 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

General Metadata Aggregation Level

- +
- + + - - - + + + +
General MetadataGeneral Metadata
Aggregation Level:
Aggregation Level:
- -

#lorsm.lt_AddEdit_General_MD_Ag#

- + Index: openacs-4/packages/lorsm/www/admin/md/generalmd/general_aggl.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/generalmd/general_aggl.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/generalmd/general_aggl.tcl 6 Mar 2008 13:54:00 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/generalmd/general_aggl.tcl 17 Nov 2008 13:36:44 -0000 1.4 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/generalmd/general_aggl.tcl ad_page_contract { - + Add/Edit General MD Aggregation Level - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -17,69 +17,68 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../generalmd" im\\\\\s_md_id] "[_ lorsm.General_MD]"] "[_ lorsm.lt_Edit_Aggregation_Leve]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../generalmd" im\\\\\s_md_id] \ + "[_ lorsm.General_MD]"] \ + + "[_ lorsm.lt_Edit_Aggregation_Leve]"] set title "[_ lorsm.lt_Edit_General_MD_Aggre]" # Form -ad_form -name generalmd_aggl \ +ad_form \ + -name generalmd_aggl \ -cancel_url ../generalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + {agg_level_v:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Functional_size_of_th]"} + {label "[_ lorsm.Aggregation_Level]"} + } + {agg_level_s:text,nospell,optional + {html {size 10}} + {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} + {label "[_ lorsm.Source]"} + } + {ims_md_id:text(hidden) {value $ims_md_id}} - {agg_level_v:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Functional_size_of_th]"} - {label "[_ lorsm.Aggregation_Level]"} - } - - {agg_level_s:text,nospell,optional - {html {size 10}} - {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} - {label "[_ lorsm.Source]"} - } - - {ims_md_id:text(hidden) {value $ims_md_id}} + } -on_submit { + # check if the aggregation level already exist.. -} -on_submit { - # check if the aggregation level already exist.. + if {[db_0or1row select_aggregation_level { + select ims_md_id + from ims_md_general + where ims_md_id = :ims_md_id}]} { + db_dml do_update \ + "update ims_md_general + set agg_level_v = :agg_level_v, agg_level_s = :agg_level_s + where ims_md_id = :ims_md_id " + } else { + db_dml do_insert \ + "insert into ims_md_general (ims_md_id, agg_level_v, agg_level_s) + values(:ims_md_id, :agg_level_v, :agg_level_s)" + } - if {[db_0or1row select_aggregation_level {select ims_md_id from ims_md_general where ims_md_id = :ims_md_id}]} { - - db_dml do_update " - update ims_md_general - set agg_level_v = :agg_level_v, agg_level_s = :agg_level_s - where ims_md_id = :ims_md_id " - - } else { - - db_dml do_insert " - insert into ims_md_general (ims_md_id, agg_level_v, agg_level_s) - values - (:ims_md_id, :agg_level_v, :agg_level_s)" - + } -after_submit { + ad_returnredirect [export_vars -base "../generalmd" {ims_md_id}] + ad_script_abort } -} -after_submit { - ad_returnredirect [export_vars -base "../generalmd" {ims_md_id}] - ad_script_abort -} - # General Aggregation Level template::list::create \ -name d_gen_aggl \ -multirow d_gen_aggl \ -no_data "[_ lorsm.lt_No_Aggregation_Level__1]" \ -html { style "width: 100%; align:right;" } \ -elements { - agg_level_s { - label "[_ lorsm.Source_1]" - } - agg_level_v { - label "[_ lorsm.Value]" - } + agg_level_s { label "[_ lorsm.Source_1]" } + agg_level_v { label "[_ lorsm.Value]" } export { display_eval {\[Edit\]} link_url_eval { [export_vars -base "general_aggl" {ims_md_id}] } @@ -89,12 +88,7 @@ } db_multirow d_gen_aggl select_ge_aggl { - select agg_level_s, - agg_level_v, - ims_md_id - from - ims_md_general - where - ims_md_id = :ims_md_id + select agg_level_s, agg_level_v, ims_md_id + from ims_md_general + where ims_md_id = :ims_md_id } - Index: openacs-4/packages/lorsm/www/admin/md/generalmd/general_cata.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/generalmd/general_cata.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/generalmd/general_cata.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/generalmd/general_cata.adp 17 Nov 2008 13:36:44 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

List of General Metadata Catalog-Entries

- +
- + + - - - + + + +
General MetadataGeneral Metadata
Catalog-Entries:
Catalog-Entries:
- -

#lorsm.lt_AddEdit_General_MD_Ca#

- + Index: openacs-4/packages/lorsm/www/admin/md/generalmd/general_cata.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/generalmd/general_cata.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/generalmd/general_cata.tcl 6 Mar 2008 13:54:00 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/generalmd/general_cata.tcl 17 Nov 2008 13:36:45 -0000 1.4 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/generalmd/general_cata.tcl ad_page_contract { - + Add/Edit General MD Catalog-Entry - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -19,60 +19,74 @@ # set context & title if { ![ad_form_new_p -key ims_md_ge_cata_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../generalmd" im\s_md_id] "[_ lorsm.General_MD]"] "[_ lorsm.Edit_Catalog-Entry]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../generalmd" im\s_md_id] \ + "[_ lorsm.General_MD]"] \ + + "[_ lorsm.Edit_Catalog-Entry]"] set title "[_ lorsm.lt_Edit_General_MD_Catal]" } else { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../generalmd" im\s_md_id] "[_ lorsm.General_MD]"] "[_ lorsm.Add_Catalog-Entry]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../generalmd" im\s_md_id] \ + "[_ lorsm.General_MD]"] \ + "[_ lorsm.Add_Catalog-Entry]"] set title "[_ lorsm.lt_Add_General_MD_Catalo]" } # Form - -ad_form -name generalmd_cata \ +ad_form \ + -name generalmd_cata \ -cancel_url ../generalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + ims_md_ge_cata_id:key(ims_md_general_cata_seq) - ims_md_ge_cata_id:key(ims_md_general_cata_seq) + {catalog:text,nospell + {html {size 50}} + {help_text "[_ lorsm.Name_of_the_catalog]"} + {label "[_ lorsm.Catalog]"} + } - {catalog:text,nospell - {html {size 50}} - {help_text "[_ lorsm.Name_of_the_catalog]"} - {label "[_ lorsm.Catalog]"} - } + {entry_l:text,nospell,optional + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } - {entry_l:text,nospell,optional - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} - {label "[_ lorsm.Language]"} - } - - {entry_s:text,nospell - {html {size 50}} - {help_text "[_ lorsm.lt_Number_in_the_Catalog]"} - {label "[_ lorsm.Entry]"} - } + {entry_s:text,nospell + {html {size 50}} + {help_text "[_ lorsm.lt_Number_in_the_Catalog]"} + {label "[_ lorsm.Entry]"} + } - {ims_md_id:text(hidden) {value $ims_md_id} - } + {ims_md_id:text(hidden) {value $ims_md_id}} -} -select_query {select * from ims_md_general_cata where ims_md_ge_cata_id = :ims_md_ge_cata_id and ims_md_id = :ims_md_id + } -select_query { + select * + from ims_md_general_cata + where ims_md_ge_cata_id = :ims_md_ge_cata_id + and ims_md_id = :ims_md_id -} -edit_data { - db_dml do_update " - update ims_md_general_cata + } -edit_data { + db_dml do_update \ + "update ims_md_general_cata set catalog = :catalog, entry_l = :entry_l, entry_s = :entry_s where ims_md_ge_cata_id = :ims_md_ge_cata_id" -} -new_data { - db_dml do_insert " - insert into ims_md_general_cata (ims_md_ge_cata_id, ims_md_id, catalog, entry_l, entry_s) - values - (:ims_md_ge_cata_id, :ims_md_id, :catalog, :entry_l, :entry_s)" + } -new_data { + db_dml do_insert \ + "insert into ims_md_general_cata (ims_md_ge_cata_id, ims_md_id, catalog, entry_l, entry_s) + values(:ims_md_ge_cata_id, :ims_md_id, :catalog, :entry_l, :entry_s)" -} -after_submit { - ad_returnredirect [export_vars -base "../generalmd" {ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars -base "../generalmd" {ims_md_id}] ad_script_abort -} + } # General Catalog-entry template::list::create \ @@ -81,32 +95,22 @@ -no_data "[_ lorsm.lt_No_Catalog_Entry_Avai]" \ -html { style "width: 100%; align:right;" } \ -elements { - catalog { - label "[_ lorsm.Catalog_1]" - } - entry_l { - label "[_ lorsm.Language_1]" - } - entry_s { - label "[_ lorsm.Entry_1]" - } + catalog {label "[_ lorsm.Catalog_1]"} + entry_l {label "[_ lorsm.Language_1]"} + entry_s {label "[_ lorsm.Entry_1]"} export { display_eval {\[Edit\]} - link_url_eval { [export_vars -base "general_cata" {ims_md_ge_cata_id ims_md_id}] } + link_url_eval { [export_vars \ + -base "general_cata" \ + {ims_md_ge_cata_id ims_md_id}] } link_html {title "[_ lorsm.Edit_Record]"} html { align center } } } db_multirow d_gen_cata select_ge_cata { - select catalog, - entry_l, - entry_s, - ims_md_ge_cata_id, - ims_md_id - from - ims_md_general_cata - where - ims_md_id = :ims_md_id -} + select catalog, entry_l, entry_s, ims_md_ge_cata_id, ims_md_id + from ims_md_general_cata + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/generalmd/general_cover.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/generalmd/general_cover.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/generalmd/general_cover.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/generalmd/general_cover.adp 17 Nov 2008 13:36:45 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

List of General Metadata Coverages

- +
- + + - - - + + + +
General MetadataGeneral Metadata
Coverage:
Coverage:
- -

#lorsm.lt_AddEdit_General_MD_Co#

- + Index: openacs-4/packages/lorsm/www/admin/md/generalmd/general_cover.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/generalmd/general_cover.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/generalmd/general_cover.tcl 6 Mar 2008 13:54:00 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/generalmd/general_cover.tcl 17 Nov 2008 13:36:45 -0000 1.4 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/generalmd/general_cover.tcl ad_page_contract { - + Add/Edit General MD Coverage - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -19,54 +19,69 @@ # set context & title if { ![ad_form_new_p -key ims_md_ge_cove_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../generalmd" im\\\s_md_id] "[_ lorsm.General_MD]"] "[_ lorsm.Edit_Coverage]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../generalmd" im\\\s_md_id] \ + "[_ lorsm.General_MD]"] \ + + "[_ lorsm.Edit_Coverage]"] set title "[_ lorsm.lt_Edit_General_MD_Cover]" } else { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../generalmd" im\\\s_md_id] "[_ lorsm.General_MD]"] "[_ lorsm.Add_Coverage]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../generalmd" im\\\s_md_id] \ + "[_ lorsm.General_MD]"] \ + + "[_ lorsm.Add_Coverage]"] set title "[_ lorsm.lt_Add_General_MD_Covera]" } # Form - -ad_form -name generalmd_cover \ +ad_form \ + -name generalmd_cover \ -cancel_url ../generalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + ims_md_ge_cove_id:key(ims_md_general_cover_seq) - ims_md_ge_cove_id:key(ims_md_general_cover_seq) + {cover_l:text,nospell,optional + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } - {cover_l:text,nospell,optional - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} - {label "[_ lorsm.Language]"} - } - - {cover_s:text,nospell - {html {size 50}} - {help_text "[_ lorsm.lt_Temporalspatial_chara]"} - {label "[_ lorsm.Coverage]"} - } + {cover_s:text,nospell + {html {size 50}} + {help_text "[_ lorsm.lt_Temporalspatial_chara]"} + {label "[_ lorsm.Coverage]"} + } - {ims_md_id:text(hidden) {value $ims_md_id} - } + {ims_md_id:text(hidden) {value $ims_md_id}} -} -select_query {select * from ims_md_general_cover where ims_md_ge_cove_id = :ims_md_ge_cove_id and ims_md_id = :ims_md_id + } -select_query { + select * + from ims_md_general_cover + where ims_md_ge_cove_id = :ims_md_ge_cove_id + and ims_md_id = :ims_md_id -} -edit_data { - db_dml do_update " - update ims_md_general_cover + } -edit_data { + db_dml do_update \ + "update ims_md_general_cover set cover_l = :cover_l, cover_s = :cover_s where ims_md_ge_cove_id = :ims_md_ge_cove_id " -} -new_data { - db_dml do_insert " - insert into ims_md_general_cover (ims_md_ge_cove_id, ims_md_id, cover_l, cover_s) - values - (:ims_md_ge_cove_id, :ims_md_id, :cover_l, :cover_s)" + } -new_data { + db_dml do_insert \ + "insert into ims_md_general_cover (ims_md_ge_cove_id, ims_md_id, cover_l, cover_s) + values(:ims_md_ge_cove_id, :ims_md_id, :cover_l, :cover_s)" -} -after_submit { - ad_returnredirect [export_vars -base "../generalmd" {ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars -base "../generalmd" {ims_md_id}] ad_script_abort -} + } # General Coverage template::list::create \ @@ -75,27 +90,20 @@ -no_data "[_ lorsm.lt_No_Coverage_Available]" \ -html { style "width: 100%; align:right;" } \ -elements { - cover_l { - label "[_ lorsm.Language_1]" - } - cover_s { - label "[_ lorsm.Coverage_1]" - } + cover_l {label "[_ lorsm.Language_1]"} + cover_s {label "[_ lorsm.Coverage_1]"} export { display_eval {\[Edit\]} - link_url_eval { [export_vars -base "general_cover" {ims_md_ge_cove_id ims_md_id}] } + link_url_eval { [export_vars \ + -base "general_cover" \ + {ims_md_ge_cove_id ims_md_id}] } link_html {title "[_ lorsm.Edit_Record]"} html { align center } } } db_multirow d_gen_cover select_ge_cover { - select cover_l, - cover_s, - ims_md_ge_cove_id, - ims_md_id - from - ims_md_general_cover - where - ims_md_id = :ims_md_id + select cover_l, cover_s, ims_md_ge_cove_id, ims_md_id + from ims_md_general_cover + where ims_md_id = :ims_md_id } Index: openacs-4/packages/lorsm/www/admin/md/generalmd/general_desc.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/generalmd/general_desc.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/generalmd/general_desc.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/generalmd/general_desc.adp 17 Nov 2008 13:36:45 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

List of General Metadata Descriptions

- +
- + + - - - + + + +
General MetadataGeneral Metadata
Descriptions:
Descriptions:
- -

#lorsm.lt_AddEdit_General_MD_De#

- + Index: openacs-4/packages/lorsm/www/admin/md/generalmd/general_desc.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/generalmd/general_desc.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/generalmd/general_desc.tcl 6 Mar 2008 13:54:00 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/generalmd/general_desc.tcl 17 Nov 2008 13:36:45 -0000 1.4 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/generalmd/general_desc.tcl ad_page_contract { - + Add/Edit General MD Description - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -19,54 +19,70 @@ # set context & title if { ![ad_form_new_p -key ims_md_ge_desc_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../generalmd" ims_md_id] "[_ lorsm.General_MD]"] "[_ lorsm.Edit_Description]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../generalmd" ims_md_id] \ + "[_ lorsm.General_MD]"] \ + + "[_ lorsm.Edit_Description]"] set title "[_ lorsm.lt_Edit_General_MD_Descr]" } else { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../generalmd" ims_md_id] "[_ lorsm.General_MD]"] "[_ lorsm.Add_Description]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../generalmd" ims_md_id] \ + "[_ lorsm.General_MD]"] \ + + "[_ lorsm.Add_Description]"] set title "[_ lorsm.lt_Add_General_MD_Descri]" } # Form - -ad_form -name generalmd_desc \ +ad_form \ + -name generalmd_desc \ -cancel_url ../generalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + ims_md_ge_desc_id:key(ims_md_general_desc_seq) - ims_md_ge_desc_id:key(ims_md_general_desc_seq) + {descrip_l:text,nospell,optional + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } - {descrip_l:text,nospell,optional - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} - {label "[_ lorsm.Language]"} - } + {descrip_s:text(textarea),nospell + {html {rows 5 cols 50}} + {help_text "[_ lorsm.lt_Describes_learning_ob]"} + {label "[_ lorsm.Description]"} + } - {descrip_s:text(textarea),nospell - {html {rows 5 cols 50}} - {help_text "[_ lorsm.lt_Describes_learning_ob]"} - {label "[_ lorsm.Description]"} - } - - {ims_md_id:text(hidden) {value $ims_md_id} - } + {ims_md_id:text(hidden) {value $ims_md_id}} -} -select_query {select * from ims_md_general_desc where ims_md_ge_desc_id = :ims_md_ge_desc_id and ims_md_id = :ims_md_id + } -select_query { + select * + from ims_md_general_desc + where ims_md_ge_desc_id = :ims_md_ge_desc_id + and ims_md_id = :ims_md_id -} -edit_data { - db_dml do_update " - update ims_md_general_desc + } -edit_data { + db_dml do_update \ + "update ims_md_general_desc set descrip_l = :descrip_l, descrip_s = :descrip_s where ims_md_ge_desc_id = :ims_md_ge_desc_id " -} -new_data { - db_dml do_insert " - insert into ims_md_general_desc (ims_md_ge_desc_id, ims_md_id, descrip_l, descrip_s) - values - (:ims_md_ge_desc_id, :ims_md_id, :descrip_l, :descrip_s)" -} -after_submit { - ad_returnredirect [export_vars -base "../generalmd" {ims_md_id}] + } -new_data { + db_dml do_insert \ + "insert into ims_md_general_desc (ims_md_ge_desc_id, ims_md_id, descrip_l, descrip_s) + values (:ims_md_ge_desc_id, :ims_md_id, :descrip_l, :descrip_s)" + + } -after_submit { + ad_returnredirect [export_vars -base "../generalmd" {ims_md_id}] ad_script_abort -} + } # General Language template::list::create \ @@ -75,27 +91,20 @@ -no_data "[_ lorsm.lt_No_Description_Availa]" \ -html { style "width: 100%; align:rigth;" } \ -elements { - descrip_l { - label "[_ lorsm.Language_1]" - } - descrip_s { - label "[_ lorsm.Description_1]" - } + descrip_l {label "[_ lorsm.Language_1]"} + descrip_s {label "[_ lorsm.Description_1]"} export { display_eval {\[Edit\]} - link_url_eval { [export_vars -base "general_desc" {ims_md_ge_desc_id ims_md_id}] } + link_url_eval { [export_vars \ + -base "general_desc" \ + {ims_md_ge_desc_id ims_md_id}] } link_html {title "[_ lorsm.Edit_Record] "} html { align center } } } db_multirow d_gen_desc select_ge_desc { - select descrip_l, - descrip_s, - ims_md_ge_desc_id, - ims_md_id - from - ims_md_general_desc - where - ims_md_id = :ims_md_id -} + select descrip_l, descrip_s, ims_md_ge_desc_id, ims_md_id + from ims_md_general_desc + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/generalmd/general_key.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/generalmd/general_key.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/generalmd/general_key.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/generalmd/general_key.adp 17 Nov 2008 13:36:45 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

List of General Metadata Keywords

- +
- + + - - - + + + +
General MetadataGeneral Metadata
Keywords:
Keywords:
- -

#lorsm.lt_AddEdit_General_MD_Ke#

- + Index: openacs-4/packages/lorsm/www/admin/md/generalmd/general_key.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/generalmd/general_key.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/generalmd/general_key.tcl 6 Mar 2008 13:54:00 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/generalmd/general_key.tcl 17 Nov 2008 13:36:45 -0000 1.4 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/generalmd/general_key.tcl ad_page_contract { - + Add/Edit General MD Keyword - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -19,54 +19,72 @@ # set context & title if { ![ad_form_new_p -key ims_md_ge_key_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../generalmd" im\\\s_md_id] "[_ lorsm.General_MD]"] "[_ lorsm.Edit_Keyword_1]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../generalmd" im\\\s_md_id] \ + "[_ lorsm.General_MD]"] \ + + "[_ lorsm.Edit_Keyword_1]"] set title "[_ lorsm.lt_Edit_General_MD_Keywo]" } else { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]" ] [list [export_vars -base "../generalmd" im\\\s_md_id] "[_ lorsm.General_MD]"] "[_ lorsm.Add_Keyword]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]" ] \ + + [list [export_vars -base "../generalmd" im\\\s_md_id] \ + "[_ lorsm.General_MD]"] \ + + "[_ lorsm.Add_Keyword]"] set title "[_ lorsm.lt_Add_General_MD_Keywor]" } # Form -ad_form -name generalmd_key \ +ad_form \ + -name generalmd_key \ -cancel_url ../generalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + ims_md_ge_key_id:key(ims_md_general_key_seq) - ims_md_ge_key_id:key(ims_md_general_key_seq) + {keyword_l:text,nospell,optional + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } - {keyword_l:text,nospell,optional - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} - {label "[_ lorsm.Language]"} - } - - {keyword_s:text,nospell - {html {size 50}} - {help_text "[_ lorsm.lt_Keyword_description_o]"} - {label "[_ lorsm.Keyword]"} - } + {keyword_s:text,nospell + {html {size 50}} + {help_text "[_ lorsm.lt_Keyword_description_o]"} + {label "[_ lorsm.Keyword]"} + } - {ims_md_id:text(hidden) {value $ims_md_id} - } + {ims_md_id:text(hidden) {value $ims_md_id}} -} -select_query {select * from ims_md_general_key where ims_md_ge_key_id = :ims_md_ge_key_id and ims_md_id = :ims_md_id + } -select_query { + select * + from ims_md_general_key + where ims_md_ge_key_id = :ims_md_ge_key_id + and ims_md_id = :ims_md_id -} -edit_data { + } -edit_data { db_dml do_update " update ims_md_general_key - set keyword_l = :keyword_l, keyword_s = :keyword_s + set keyword_l = :keyword_l, + keyword_s = :keyword_s where ims_md_ge_key_id = :ims_md_ge_key_id " -} -new_data { + + } -new_data { db_dml do_insert " insert into ims_md_general_key (ims_md_ge_key_id, ims_md_id, keyword_l, keyword_s) - values - (:ims_md_ge_key_id, :ims_md_id, :keyword_l, :keyword_s)" + values (:ims_md_ge_key_id, :ims_md_id, :keyword_l, :keyword_s)" -} -after_submit { - ad_returnredirect [export_vars -base "../generalmd" {ims_md_id}] - ad_script_abort -} + } -after_submit { + ad_returnredirect [export_vars -base "../generalmd" {ims_md_id}] + ad_script_abort + } # General Keyword template::list::create \ @@ -75,28 +93,21 @@ -no_data "[_ lorsm.lt_No_Keywords_Available]" \ -html { style "width: 100%; align:right;" } \ -elements { - keyword_l { - label "" - } - keyword_s { - label "" - } + keyword_l { label "" } + keyword_s { label "" } export { display_eval {\[Edit\]} - link_url_eval { [export_vars -base "general_key" {ims_md_ge_key_id ims_md_id}] } + link_url_eval { [export_vars \ + -base "general_key" \ + {ims_md_ge_key_id ims_md_id}] } link_html {title "[_ lorsm.Edit_Record]"} html { align center } } } db_multirow d_gen_key select_ge_key { - select keyword_l, - keyword_s, - ims_md_ge_key_id, - ims_md_id - from - ims_md_general_key - where - ims_md_id = :ims_md_id + select keyword_l, keyword_s, ims_md_ge_key_id, ims_md_id + from ims_md_general_key + where ims_md_id = :ims_md_id } Index: openacs-4/packages/lorsm/www/admin/md/generalmd/general_lang.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/generalmd/general_lang.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/generalmd/general_lang.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/generalmd/general_lang.adp 17 Nov 2008 13:36:45 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

List of General Metadata Languages

- +
- + + - - - + + + +
General MetadataGeneral Metadata
Languages:
Languages:
- -

#lorsm.lt_AddEdit_General_MD_La#

- + Index: openacs-4/packages/lorsm/www/admin/md/generalmd/general_lang.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/generalmd/general_lang.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/generalmd/general_lang.tcl 6 Mar 2008 13:54:00 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/generalmd/general_lang.tcl 17 Nov 2008 13:36:45 -0000 1.4 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/generalmd/general_lang.tcl ad_page_contract { - + Add/Edit General MD Language - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -19,48 +19,64 @@ # set context & title if { ![ad_form_new_p -key ims_md_ge_lang_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../generalmd" im\\s_md_id] "[_ lorsm.General_MD]"] "[_ lorsm.Edit_Language]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../generalmd" im\\s_md_id] \ + "[_ lorsm.General_MD]"] \ + + "[_ lorsm.Edit_Language]"] set title "[_ lorsm.lt_Edit_General_MD_Langu]" } else { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../generalmd" im\\s_md_id] "[_ lorsm.General_MD]"] "[_ lorsm.Add_Language]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../generalmd" im\\s_md_id] \ + "[_ lorsm.General_MD]"] \ + + "[_ lorsm.Add_Language]"] set title "[_ lorsm.lt_Add_General_MD_Langua]" } # Form -ad_form -name generalmd_lang \ +ad_form \ + -name generalmd_lang \ -cancel_url ../generalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + ims_md_ge_lang_id:key(ims_md_general_lang_seq) - ims_md_ge_lang_id:key(ims_md_general_lang_seq) + {language:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } - {language:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} - {label "[_ lorsm.Language]"} - } - - {ims_md_id:text(hidden) {value $ims_md_id} - } + {ims_md_id:text(hidden) {value $ims_md_id}} -} -select_query {select * from ims_md_general_lang where ims_md_ge_lang_id = :ims_md_ge_lang_id and ims_md_id = :ims_md_id + } -select_query { + select * + from ims_md_general_lang + where ims_md_ge_lang_id = :ims_md_ge_lang_id + and ims_md_id = :ims_md_id -} -edit_data { - db_dml do_update " - update ims_md_general_lang + } -edit_data { + db_dml do_update \ + "update ims_md_general_lang set language = :language where ims_md_ge_lang_id = :ims_md_ge_lang_id " -} -new_data { - db_dml do_insert " - insert into ims_md_general_lang (ims_md_ge_lang_id, ims_md_id, language) - values - (:ims_md_ge_lang_id, :ims_md_id, :language)" + } -new_data { + db_dml do_insert \ + "insert into ims_md_general_lang (ims_md_ge_lang_id, ims_md_id, language) + values(:ims_md_ge_lang_id, :ims_md_id, :language)" -} -after_submit { - ad_returnredirect [export_vars -base "../generalmd" {ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars -base "../generalmd" {ims_md_id}] ad_script_abort -} + } # General Language template::list::create \ @@ -69,23 +85,20 @@ -no_data "[_ lorsm.lt_No_Language_Available]" \ -html { style "width: 100%; align:right;" } \ -elements { - language { - label "[_ lorsm.Language_1]" - } + language { label "[_ lorsm.Language_1]" } + export { display_eval {\[Edit\]} - link_url_eval { [export_vars -base "general_lang" {ims_md_ge_lang_id ims_md_id}] } + link_url_eval { [export_vars \ + -base "general_lang" \ + {ims_md_ge_lang_id ims_md_id}] } link_html {title "[_ lorsm.Edit_Record]"} html { align center } } } db_multirow d_gen_lang select_ge_lang { - select language, - ims_md_ge_lang_id, - ims_md_id - from - ims_md_general_lang - where - ims_md_id = :ims_md_id -} + select language, ims_md_ge_lang_id, ims_md_id + from ims_md_general_lang + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/generalmd/general_struc.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/generalmd/general_struc.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/generalmd/general_struc.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/generalmd/general_struc.adp 17 Nov 2008 13:36:45 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

General Metadata Structure

- +
- + + - - - + + + +
General MetadataGeneral Metadata
Structure:
Structure:
- -

#lorsm.lt_AddEdit_General_MD_St#

- + Index: openacs-4/packages/lorsm/www/admin/md/generalmd/general_struc.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/generalmd/general_struc.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/generalmd/general_struc.tcl 6 Mar 2008 13:54:00 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/generalmd/general_struc.tcl 17 Nov 2008 13:36:45 -0000 1.4 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/generalmd/general_struc.tcl ad_page_contract { - + Add/Edit General MD Structure - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -18,53 +18,60 @@ # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../generalmd" im\\\\s_md_id] "[_ lorsm.General_MD]"] "[_ lorsm.Edit_Structure]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../generalmd" im\\\\s_md_id] \ + "[_ lorsm.General_MD]"] \ + + "[_ lorsm.Edit_Structure]"] set title "[_ lorsm.lt_Edit_General_MD_Struc]" # Form -ad_form -name generalmd_struc \ +ad_form \ + -name generalmd_struc \ -cancel_url [export_vars -base "../generalmd" ims_md_id] \ -mode edit \ -form { + {structure_v:text + {html {size 10}} + {help_text "[_ lorsm.lt_Organizational_struct]"} + {label "[_ lorsm.Structure]"} + } - {structure_v:text - {html {size 10}} - {help_text "[_ lorsm.lt_Organizational_struct]"} - {label "[_ lorsm.Structure]"} - } - - {structure_s:text,nospell,optional - {html {size 10}} - {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} - {label "[_ lorsm.Source]"} - } - {ims_md_id:text(hidden) {value $ims_md_id}} + {structure_s:text,nospell,optional + {html {size 10}} + {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} + {label "[_ lorsm.Source]"} + } -} -on_submit { - # check if the structure details already exist... + {ims_md_id:text(hidden) {value $ims_md_id}} - if {[db_0or1row select_structure {select ims_md_id from ims_md_general where ims_md_id = :ims_md_id}]} { + } -on_submit { + # check if the structure details already exist... - db_dml do_update " - update ims_md_general - set structure_v = :structure_v, structure_s = :structure_s - where ims_md_id = :ims_md_id " + if {[db_0or1row select_structure { + select ims_md_id + from ims_md_general + where ims_md_id = :ims_md_id}]} { + db_dml do_update \ + "update ims_md_general + set structure_v = :structure_v, structure_s = :structure_s + where ims_md_id = :ims_md_id " - } else { + } else { + db_dml do_insert \ + "insert into ims_md_general (ims_md_id, structure_v, structure_s) + values (:ims_md_id, :structure_v, :structure_s)" + } - db_dml do_insert " - insert into ims_md_general (ims_md_id, structure_v, structure_s) - values - (:ims_md_id, :structure_v, :structure_s)" - + } -after_submit { + ad_returnredirect [export_vars -base "../generalmd" {ims_md_id}] + ad_script_abort } -} -after_submit { - ad_returnredirect [export_vars -base "../generalmd" {ims_md_id}] - ad_script_abort -} - # General Structure template::list::create \ -name d_gen_struc \ @@ -74,21 +81,16 @@ -elements { structure_s { label "[_ lorsm.Source_1]" - html {align center} - } - structure_v { + html {align center} + } structure_v { label "[_ lorsm.Value]" - html {align center} + html {align center} } } db_multirow d_gen_struc select_ge_struc { - select structure_s, - structure_v, - ims_md_id - from - ims_md_general - where - ims_md_id = :ims_md_id + select structure_s, structure_v, ims_md_id + from ims_md_general + where ims_md_id = :ims_md_id } Index: openacs-4/packages/lorsm/www/admin/md/generalmd/general_title.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/generalmd/general_title.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/generalmd/general_title.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/generalmd/general_title.adp 17 Nov 2008 13:36:45 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

List of General Metadata Titles

- +
- + + - - - + + + +
General MetadataGeneral Metadata
Titles:
Titles:
- -

#lorsm.lt_AddEdit_General_MD_Ti#

- + Index: openacs-4/packages/lorsm/www/admin/md/generalmd/general_title.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/generalmd/general_title.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/generalmd/general_title.tcl 6 Mar 2008 13:54:00 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/generalmd/general_title.tcl 17 Nov 2008 13:36:45 -0000 1.4 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/generalmd/general_title.tcl ad_page_contract { - + Add/Edit General MD Title - + @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 2004-05-03 @arch-tag 1956d02e-511a-470c-81d0-c2857242651c @@ -18,55 +18,70 @@ # set context & title if { ![ad_form_new_p -key ims_md_ge_ti_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../generalmd" ims_md_id] "[_ lorsm.General_MD]"] "[_ lorsm.Edit_Titles]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../generalmd" ims_md_id] \ + "[_ lorsm.General_MD]"] \ + + "[_ lorsm.Edit_Titles]"] set title "[_ lorsm.lt_Edit_General_MD_Title]" } else { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../generalmd" ims_md_id] "[_ lorsm.General_MD]"] "[_ lorsm.Add_Titles]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../generalmd" ims_md_id] \ + "[_ lorsm.General_MD]"] \ + "[_ lorsm.Add_Titles]"] # set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] "[_ lorsm.General_MD]"] set title "[_ lorsm.Add_General_MD_Title]" } # Form -ad_form -name generalmd_title \ +ad_form \ + -name generalmd_title \ -cancel_url [export_vars -base "../generalmd" ims_md_id] \ -mode edit \ -form { + ims_md_ge_ti_id:key(ims_md_general_title_seq) - ims_md_ge_ti_id:key(ims_md_general_title_seq) + {title_l:text,nospell,optional + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } - {title_l:text,nospell,optional - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} - {label "[_ lorsm.Language]"} - } - - {title_s:text,nospell - {html {size 50}} - {help_text "[_ lorsm.lt_Learning_objects_name]"} - {label "[_ lorsm.Title]"} - } + {title_s:text,nospell + {html {size 50}} + {help_text "[_ lorsm.lt_Learning_objects_name]"} + {label "[_ lorsm.Title]"} + } - {ims_md_id:text(hidden) {value $ims_md_id} - } + {ims_md_id:text(hidden) {value $ims_md_id}} -} -select_query {select * from ims_md_general_title where ims_md_ge_ti_id = :ims_md_ge_ti_id and ims_md_id = :ims_md_id + } -select_query { + select * + from ims_md_general_title + where ims_md_ge_ti_id = :ims_md_ge_ti_id + and ims_md_id = :ims_md_id -} -edit_data { - db_dml do_update " - update ims_md_general_title + } -edit_data { + db_dml do_update \ + "update ims_md_general_title set title_l = :title_l, title_s = :title_s where ims_md_ge_ti_id = :ims_md_ge_ti_id " -} -new_data { - db_dml do_insert " - insert into ims_md_general_title (ims_md_ge_ti_id, ims_md_id, title_l, title_s) - values - (:ims_md_ge_ti_id, :ims_md_id, :title_l, :title_s)" + } -new_data { + db_dml do_insert \ + "insert into ims_md_general_title (ims_md_ge_ti_id, ims_md_id, title_l, title_s) + values (:ims_md_ge_ti_id, :ims_md_id, :title_l, :title_s)" -} -after_submit { - ad_returnredirect [export_vars -base "../generalmd" {ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars -base "../generalmd" {ims_md_id}] ad_script_abort -} + } # General Title template::list::create \ @@ -75,30 +90,22 @@ -no_data "[_ lorsm.No_Titles_Available]" \ -html { style "width: 100%; align:right;" } \ -elements { - title_l { - label "[_ lorsm.Language_1]" - } - title_s { - label "[_ lorsm.Titles_1]" - } + title_l {label "[_ lorsm.Language_1]"} + title_s {label "[_ lorsm.Titles_1]"} export { display_eval {\[Edit\]} - link_url_eval { [export_vars -base "general_title" {ims_md_ge_ti_id ims_md_id}] } + link_url_eval { [export_vars \ + -base "general_title" \ + {ims_md_ge_ti_id ims_md_id}] } link_html {title "Edit Record "} html { align center } } } db_multirow d_gen_titles select_ge_titles { - select title_l, - title_s, - ims_md_ge_ti_id, - ims_md_id - from - ims_md_general_title - where - ims_md_id = :ims_md_id + select title_l, title_s, ims_md_ge_ti_id, ims_md_id + from ims_md_general_title + where ims_md_id = :ims_md_id } { set item_url [export_vars -base "item" { ims_md_id }] } - Index: openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_cont.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_cont.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_cont.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_cont.adp 17 Nov 2008 13:36:45 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Lifecyle Metadata Contribution

- +
- + + - - - + + + +
Lifecycle MetadataLifecycle Metadata
Contribution:
Contribution:
- -

#lorsm.lt_AddEdit_Lifecycle_Met#

- + Index: openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_cont.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_cont.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_cont.tcl 15 May 2007 20:14:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_cont.tcl 17 Nov 2008 13:36:45 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/lifecyclemd/lifecycle_cont.tcl ad_page_contract { - + Add/Edit Lifecycle MD Contributor - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -20,103 +20,112 @@ # set context & title if { ![ad_form_new_p -key ims_md_lf_cont_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../lifecyclemd" im\\\\\\\s_md_id] " [_ lorsm.Life_Cycle_MD]"] "[_ lorsm.Edit_Contributor]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../lifecyclemd" im\\\\\\\s_md_id] \ + "[_ lorsm.Life_Cycle_MD]"] \ + + "[_ lorsm.Edit_Contributor]"] set title "[_ lorsm.lt_Edit_Lifecycle_MD_Con]" } else { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../lifecyclemd" im\\\\\\\s_md_id] "[_ lorsm.Life_Cycle_MD]"] "[_ lorsm.Add_Contributor]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../lifecyclemd" im\\\\\\\s_md_id] \ + "[_ lorsm.Life_Cycle_MD]"] \ + + "[_ lorsm.Add_Contributor]"] set title "[_ lorsm.lt_Add_Lifecycle_MD_Cont]" } # Form - -ad_form -name lifecyclemd_cont \ +ad_form \ + -name lifecyclemd_cont \ -cancel_url ../lifecyclemd?ims_md_id=$ims_md_id \ -mode edit \ -form { + ims_md_lf_cont_id:key(ims_md_life_cycle_contrib_seq) - ims_md_lf_cont_id:key(ims_md_life_cycle_contrib_seq) + {role_s:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} + {label "[_ lorsm.Source]"} + } - {role_s:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} - {label "[_ lorsm.Source]"} - } + {role_v:text,nospell + {html {size 10}} + {help_text "[_ lorsm.Type_of_contribution]"} + {label "[_ lorsm.Role_1]"} + } - {role_v:text,nospell - {html {size 10}} - {help_text "[_ lorsm.Type_of_contribution]"} - {label "[_ lorsm.Role_1]"} - } - {entity:text(textarea),nospell - {html {rows 5 cols 50}} - {help_text "[_ lorsm.lt_Entity_or_entities_in]"} - {label "[_ lorsm.Entity]"} - } + {entity:text(textarea),nospell + {html {rows 5 cols 50}} + {help_text "[_ lorsm.lt_Entity_or_entities_in]"} + {label "[_ lorsm.Entity]"} + } - {cont_date:text,nospell - {html {size 10}} - {help_text "[_ lorsm.Date_of_contribution]"} - {label "[_ lorsm.Date]"} - } + {cont_date:text,nospell + {html {size 10}} + {help_text "[_ lorsm.Date_of_contribution]"} + {label "[_ lorsm.Date]"} + } - {cont_date_l:text,nospell,optional - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi_3]"} - {label "[_ lorsm.Language]"} - } + {cont_date_l:text,nospell,optional + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi_3]"} + {label "[_ lorsm.Language]"} + } - {cont_date_s:text(textarea),nospell,optional - {html {rows 2 cols 50}} - {help_text "[_ lorsm.lt_Describes_contributio]"} - {label "[_ lorsm.Description]"} - } + {cont_date_s:text(textarea),nospell,optional + {html {rows 2 cols 50}} + {help_text "[_ lorsm.lt_Describes_contributio]"} + {label "[_ lorsm.Description]"} + } - {ims_md_id:text(hidden) {value $ims_md_id} - } + {ims_md_id:text(hidden) {value $ims_md_id}} -} -select_query { - select * from - ims_md_life_cycle_contrib lfc, - ims_md_life_cycle_contrib_entity lfce - where - lfc.ims_md_lf_cont_id = :ims_md_lf_cont_id - and - lfc.ims_md_id = :ims_md_id - and - lfce.ims_md_lf_cont_id = :ims_md_lf_cont_id + } -select_query { + select * + from ims_md_life_cycle_contrib lfc, ims_md_life_cycle_contrib_entity lfce + where lfc.ims_md_lf_cont_id = :ims_md_lf_cont_id + and lfc.ims_md_id = :ims_md_id + and lfce.ims_md_lf_cont_id = :ims_md_lf_cont_id -} -edit_data { - db_transaction { - db_dml update_lfc " - update ims_md_life_cycle_contrib - set role_v = :role_v, - role_s = :role_s, - cont_date = :cont_date, - cont_date_l = :cont_date_l, - cont_date_s = :cont_date_s - where ims_md_lf_cont_id = :ims_md_lf_cont_id" - - db_dml update_lfce " - update ims_md_life_cycle_contrib_entity - set entity = :entity - where ims_md_lf_cont_id = :ims_md_lf_cont_id" - } - -} -new_data { - db_transaction { - db_dml insert_lfc " - insert into ims_md_life_cycle_contrib (ims_md_lf_cont_id, ims_md_id, role_s, role_v, cont_date, cont_date_l, cont_date_s) - values (:ims_md_lf_cont_id, :ims_md_id, :role_s, :role_v, :cont_date, :cont_date_l, :cont_date_s)" + } -edit_data { + db_transaction { + db_dml update_lfc \ + "update ims_md_life_cycle_contrib + set role_v = :role_v, + role_s = :role_s, + cont_date = :cont_date, + cont_date_l = :cont_date_l, + cont_date_s = :cont_date_s + where ims_md_lf_cont_id = :ims_md_lf_cont_id" - db_dml insert_lfce " - insert into ims_md_life_cycle_contrib_entity (ims_md_lf_cont_enti_id, ims_md_lf_cont_id, entity) - values (nextval('ims_md_life_cycle_contrib_entity_seq'), :ims_md_lf_cont_id, :entity)" - } + db_dml update_lfce \ + "update ims_md_life_cycle_contrib_entity + set entity = :entity + where ims_md_lf_cont_id = :ims_md_lf_cont_id" + } -} -after_submit { - ad_returnredirect [export_vars -base "../lifecyclemd" {ims_md_id}] + } -new_data { + db_transaction { + db_dml insert_lfc \ + "insert into ims_md_life_cycle_contrib (ims_md_lf_cont_id, ims_md_id, role_s, role_v, cont_date, cont_date_l, cont_date_s) + values (:ims_md_lf_cont_id, :ims_md_id, :role_s, :role_v, :cont_date, :cont_date_l, :cont_date_s)" + + db_dml insert_lfce \ + "insert into ims_md_life_cycle_contrib_entity (ims_md_lf_cont_enti_id, ims_md_lf_cont_id, entity) + values (nextval('ims_md_life_cycle_contrib_entity_seq'), :ims_md_lf_cont_id, :entity)" + } + + } -after_submit { + ad_returnredirect [export_vars -base "../lifecyclemd" {ims_md_id}] ad_script_abort -} + } # Lifecycle Contrib template::list::create \ @@ -125,40 +134,25 @@ -no_data "[_ lorsm.lt_No_Contributors_Avail]" \ -html { align right style "width: 100%;" } \ -elements { - role { - label "[_ lorsm.Role]" - } - entity { - label "[_ lorsm.Entity_1]" - } - cont_date { - label "[_ lorsm.Contribution_Date]" - } - cont_date_ls { - label "[_ lorsm.Description_1]" - } + role { label "[_ lorsm.Role]" } + entity { label "[_ lorsm.Entity_1]" } + cont_date { label "[_ lorsm.Contribution_Date]" } + cont_date_ls { label "[_ lorsm.Description_1]" } export { display_eval {\[Edit\]} - link_url_eval { [export_vars -base "lifecycle_cont" {ims_md_lf_cont_id ims_md_id}] } + link_url_eval { [export_vars \ + -base "lifecycle_cont" \ + {ims_md_lf_cont_id ims_md_id}] } link_html {title "[_ lorsm.Edit_Record] "} html { align center } } } db_multirow d_lf_cont select_lf_cont { - select - lfc.role_v || ' ' || '[' || lfc.role_s || ']' as role, - lfce.entity, - lfc.cont_date, - '[' || lfc.cont_date_l || ']' || ' ' || lfc.cont_date_s as cont_date_ls, - lfc.ims_md_lf_cont_id, - lfc.ims_md_id - from - ims_md_life_cycle_contrib lfc, - ims_md_life_cycle_contrib_entity lfce - where - lfc.ims_md_lf_cont_id = lfce.ims_md_lf_cont_id - and - lfc.ims_md_id = :ims_md_id + select lfc.role_v || ' ' || '[' || lfc.role_s || ']' as role, lfce.entity, lfc.cont_date, + '[' || lfc.cont_date_l || ']' || ' ' || lfc.cont_date_s as cont_date_ls, lfc.ims_md_lf_cont_id, lfc.ims_md_id + from ims_md_life_cycle_contrib lfc, ims_md_life_cycle_contrib_entity lfce + where lfc.ims_md_lf_cont_id = lfce.ims_md_lf_cont_id + and lfc.ims_md_id = :ims_md_id } Index: openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_stat.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_stat.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_stat.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_stat.adp 17 Nov 2008 13:36:45 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Lifecyle Metadata Status

- +
- + + - - - + + + +
Lifecycle MetadataLifecycle Metadata
Status:
Status:
- -

#lorsm.lt_AddEdit_Lifecycle_Met_1#

- + Index: openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_stat.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_stat.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_stat.tcl 15 May 2007 20:14:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_stat.tcl 17 Nov 2008 13:36:45 -0000 1.3 @@ -1,14 +1,14 @@ # packages/lorsm/www/md/lifecyclemd/lifecycle_stat.tcl ad_page_contract { - + Add/Edit Lifecycle MD Status - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @cvs-id $Id$ - + } { ims_md_id:integer } -properties { @@ -17,76 +17,72 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../lifecyclemd" im\\\\\\\s_md_id] "[_ lorsm.Life_Cycle_MD]"] "[_ lorsm.Edit_Status]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../lifecyclemd" im\\\\\\\s_md_id] \ + "[_ lorsm.Life_Cycle_MD]"] \ + + "[_ lorsm.Edit_Status]"] set title "[_ lorsm.lt_Edit_Lifecycle_MD_Sta]" # Form -ad_form -name lifecyclemd_stat \ +ad_form \ + -name lifecyclemd_stat \ -cancel_url ../lifecyclemd?ims_md_id=$ims_md_id \ -mode edit \ -form { + {status_v:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Learning_objects_edit]"} + {label "[_ lorsm.Status]"} + } - {status_v:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Learning_objects_edit]"} - {label "[_ lorsm.Status]"} - } - - {status_s:text,nospell,optional - {html {size 10}} - {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} - {label "[_ lorsm.Source]"} - } + {status_s:text,nospell,optional + {html {size 10}} + {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} + {label "[_ lorsm.Source]"} + } - {ims_md_id:text(hidden) {value $ims_md_id}} + {ims_md_id:text(hidden) {value $ims_md_id}} -} -on_submit { - # Checks whether LC status exist... + } -on_submit { + # Checks whether LC status exist... + if {[db_0or1row select_lc_version { + select ims_md_id + from ims_md_life_cycle + where ims_md_id = :ims_md_id}]} { + db_dml do_update \ + "update ims_md_life_cycle + set status_s = :status_s, + status_v = :status_v + where ims_md_id = :ims_md_id " + } else { + db_dml do_insert \ + "insert into ims_md_life_cycle (ims_md_id, status_s, status_v) + values (:ims_md_id, :status_s, :status_v)" + } - if {[db_0or1row select_lc_version {select ims_md_id from ims_md_life_cycle where ims_md_id = :ims_md_id}]} { - - db_dml do_update " - update ims_md_life_cycle - set status_s = :status_s, status_v = :status_v - where ims_md_id = :ims_md_id " - - } else { - - db_dml do_insert " - insert into ims_md_life_cycle (ims_md_id, status_s, status_v) - values - (:ims_md_id, :status_s, :status_v)" - + } -after_submit { + ad_returnredirect [export_vars -base "../lifecyclemd" {ims_md_id}] + ad_script_abort } -} -after_submit { - ad_returnredirect [export_vars -base "../lifecyclemd" {ims_md_id}] - ad_script_abort -} - # Lifecycle Status template::list::create \ -name d_lf_stat \ -multirow d_lf_stat \ -no_data "[_ lorsm.No_Status_Available]" \ -html { align right style "width: 100%;" } \ -elements { - status_s { - label "[_ lorsm.Source_1]" - } - status_v { - label "[_ lorsm.Value]" - } + status_s { label "[_ lorsm.Source_1]" } + status_v { label "[_ lorsm.Value]" } } db_multirow d_lf_stat select_lf_stat { - select status_s, - status_v, - ims_md_id - from - ims_md_life_cycle - where - ims_md_id = :ims_md_id + select status_s, status_v, ims_md_id + from ims_md_life_cycle + where ims_md_id = :ims_md_id } - Index: openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_version.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_version.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_version.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_version.adp 17 Nov 2008 13:36:45 -0000 1.4 @@ -2,25 +2,24 @@ @title;noquote@ @context;noquote@ - +

Lifecyle Metadata Version

- +
- + + - - - + + + -
Lifecycle MetadataLifecycle Metadata
Version:
Version:
+

#lorsm.lt_AddEdit_Lifecycle_Met_2#

- + Index: openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_version.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_version.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_version.tcl 15 May 2007 20:14:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/lifecyclemd/lifecycle_version.tcl 17 Nov 2008 13:36:45 -0000 1.3 @@ -1,14 +1,14 @@ # packages/lorsm/www/md/lifecyclemd/lifecycle_version.tcl ad_page_contract { - + Add/Edit Lifecycle MD Version - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @cvs-id $Id$ - + } { ims_md_id:integer } -properties { @@ -17,79 +17,71 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../lifecyclemd" im\\\\\\s_md_id] "[_ lorsm.Life_Cycle_MD]"] "[_ lorsm.Edit_Version]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../lifecyclemd" im\\\\\\s_md_id] \ + "[_ lorsm.Life_Cycle_MD]"] \ + + "[_ lorsm.Edit_Version]"] set title "[_ lorsm.lt_Edit_Lifecycle_MD_Ver]" # Form -ad_form -name lifecyclemd_ver \ +ad_form \ + -name lifecyclemd_ver \ -cancel_url ../lifecyclemd?ims_md_id=$ims_md_id \ -mode edit \ -form { + {version_l:text,nospell,optional + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } + {version_s:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Edition_of_the_learni]"} + {label "[_ lorsm.Version]"} + } - {version_l:text,nospell,optional - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} - {label "[_ lorsm.Language]"} - } - - {version_s:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Edition_of_the_learni]"} - {label "[_ lorsm.Version]"} - } + {ims_md_id:text(hidden) {value $ims_md_id}} - {ims_md_id:text(hidden) {value $ims_md_id}} + } -on_submit { + # check if the LC version already exists... + if {[db_0or1row select_lc_version { + select ims_md_id + from ims_md_life_cycle + where ims_md_id = :ims_md_id}]} { + db_dml do_update \ + "update ims_md_life_cycle + set version_l = :version_l, version_s = :version_s + where ims_md_id = :ims_md_id " + } else { + db_dml do_insert \ + "insert into ims_md_life_cycle (ims_md_id, version_l, version_s) + values (:ims_md_id, :version_l, :version_s)" + } -} -on_submit { - - # check if the LC version already exists... - - if {[db_0or1row select_lc_version {select ims_md_id from ims_md_life_cycle where ims_md_id = :ims_md_id}]} { - - db_dml do_update " - update ims_md_life_cycle - set version_l = :version_l, version_s = :version_s - where ims_md_id = :ims_md_id " - - - } else { - - db_dml do_insert " - insert into ims_md_life_cycle (ims_md_id, version_l, version_s) - values - (:ims_md_id, :version_l, :version_s)" - + } -after_submit { + ad_returnredirect [export_vars -base "../lifecyclemd" {ims_md_id}] + ad_script_abort } -} -after_submit { - ad_returnredirect [export_vars -base "../lifecyclemd" {ims_md_id}] - ad_script_abort -} - # Lifecycle Version template::list::create \ -name d_lf_ver \ -multirow d_lf_ver \ -no_data "[_ lorsm.lt_No_Structure_Availabl]" \ -html { align right style "width: 100%;" } \ -elements { - version_l { - label "[_ lorsm.Language_1]" - } - version_s { - label "[_ lorsm.Version_1]" - } + version_l { label "[_ lorsm.Language_1]" } + version_s { label "[_ lorsm.Version_1]" } } db_multirow d_lf_ver select_lf_ver { - select version_l, - version_s, - ims_md_id - from - ims_md_life_cycle - where - ims_md_id = :ims_md_id + select version_l, version_s, ims_md_id + from ims_md_life_cycle + where ims_md_id = :ims_md_id } - Index: openacs-4/packages/lorsm/www/admin/md/metamd/meta_cata.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/metamd/meta_cata.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/metamd/meta_cata.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/metamd/meta_cata.adp 17 Nov 2008 13:36:45 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

List of Meta Metadata Catalog-Entries

- +
- + + - - - + + + +
Meta MetadataMeta Metadata
Catalog-Entries:
Catalog-Entries:
- -

#lorsm.lt_AddEdit_Meta_MD_Catal#

- + Index: openacs-4/packages/lorsm/www/admin/md/metamd/meta_cata.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/metamd/meta_cata.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/metamd/meta_cata.tcl 15 May 2007 20:14:45 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/metamd/meta_cata.tcl 17 Nov 2008 13:36:45 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/metamd/meta_cata.tcl ad_page_contract { - + Add/Edit Meta MD Catalog-Entry - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -19,60 +19,76 @@ # set context & title if { ![ad_form_new_p -key ims_md_md_cata_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"] [list [export_vars -base "../metamd" im\s_md_id] "Meta Metadata"] "Edit Catalog-Entry"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "IMS Metadata Editor"] \ + + [list [export_vars -base "../metamd" im\s_md_id] \ + "Meta Metadata"] \ + + "Edit Catalog-Entry"] set title "Edit Meta MD Catalog-Entry" } else { - set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"] [list [export_vars -base "../metamd" im\s_md_id] "Meta Metadata"] "Add Catalog-Entry"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "IMS Metadata Editor"] \ + + [list [export_vars -base "../metamd" im\s_md_id] \ + "Meta Metadata"] \ + + "Add Catalog-Entry"] set title "Add Meta MD Catalog-Entry" } # Form -ad_form -name metamd_cata \ +ad_form \ + -name metamd_cata \ -cancel_url ../metamd?ims_md_id=$ims_md_id \ -mode edit \ -form { + ims_md_md_cata_id:key(ims_md_metadata_cata_seq) - ims_md_md_cata_id:key(ims_md_metadata_cata_seq) + {catalog:text,nospell + {html {size 50}} + {help_text "Name of the catalog"} + {label "Catalog:"} + } - {catalog:text,nospell - {html {size 50}} - {help_text "Name of the catalog"} - {label "Catalog:"} - } + {entry_l:text,nospell,optional + {html {size 10}} + {help_text "i.e.: 'en_AU' for Australian English"} + {label "Language:"} + } - {entry_l:text,nospell,optional - {html {size 10}} - {help_text "i.e.: 'en_AU' for Australian English"} - {label "Language:"} - } - - {entry_s:text,nospell - {html {size 50}} - {help_text "Number in the Catalog i.e.: '1.3.1'"} - {label "Entry:"} - } + {entry_s:text,nospell + {html {size 50}} + {help_text "Number in the Catalog i.e.: '1.3.1'"} + {label "Entry:"} + } - {ims_md_id:text(hidden) {value $ims_md_id} - } + {ims_md_id:text(hidden) {value $ims_md_id}} -} -select_query {select * from ims_md_metadata_cata where ims_md_md_cata_id = :ims_md_md_cata_id and ims_md_id = :ims_md_id + } -select_query { + select * + from ims_md_metadata_cata + where ims_md_md_cata_id = :ims_md_md_cata_id + and ims_md_id = :ims_md_id -} -edit_data { - db_dml do_update " - update ims_md_metadata_cata + } -edit_data { + db_dml do_update \ + "update ims_md_metadata_cata set catalog = :catalog, entry_l = :entry_l, entry_s = :entry_s where ims_md_md_cata_id = :ims_md_md_cata_id" -} -new_data { - db_dml do_insert " - insert into ims_md_metadata_cata (ims_md_md_cata_id, ims_md_id, catalog, entry_l, entry_s) - values - (:ims_md_md_cata_id, :ims_md_id, :catalog, :entry_l, :entry_s)" + } -new_data { + db_dml do_insert \ + "insert into ims_md_metadata_cata (ims_md_md_cata_id, ims_md_id, catalog, entry_l, entry_s) + values(:ims_md_md_cata_id, :ims_md_id, :catalog, :entry_l, :entry_s)" -} -after_submit { - ad_returnredirect [export_vars -base "../metamd" {ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars -base "../metamd" {ims_md_id}] ad_script_abort -} + } # Metametadata Catalog-entry template::list::create \ @@ -81,28 +97,20 @@ -no_data "No Catalog Entry Available" \ -html { align right style "width: 100%;" } \ -elements { - catalog { - label "Catalog" - } - entry_ls { - label "Language Entry" - } + catalog { label "Catalog" } + entry_ls { label "Language Entry" } export { display_eval {\[Edit\]} - link_url_eval { [export_vars -base "meta_cata" {ims_md_md_cata_id ims_md_id}] } + link_url_eval { [export_vars \ + -base "meta_cata" \ + {ims_md_md_cata_id ims_md_id}] } link_html {title "Edit Record "} html { align center } } } db_multirow d_md_cata select_md_cata { - select catalog, - '[' || entry_l || ']' || ' ' || entry_s as entry_ls, - ims_md_md_cata_id, - ims_md_id - from - ims_md_metadata_cata - where - ims_md_id = :ims_md_id -} - + select catalog, '[' || entry_l || ']' || ' ' || entry_s as entry_ls, ims_md_md_cata_id, ims_md_id + from ims_md_metadata_cata + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/metamd/meta_cont.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/metamd/meta_cont.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/metamd/meta_cont.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/metamd/meta_cont.adp 17 Nov 2008 13:36:45 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Meta Metadata Contribution

- +
- + + - - - + + + +
Meta MetadataMeta Metadata
Contribution:
Contribution:
- -

#lorsm.lt_AddEdit_Meta_MD_Contr#

- + Index: openacs-4/packages/lorsm/www/admin/md/metamd/meta_cont.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/metamd/meta_cont.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/metamd/meta_cont.tcl 15 May 2007 20:14:45 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/metamd/meta_cont.tcl 17 Nov 2008 13:36:45 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/metamd/meta_cont.tcl ad_page_contract { - + Add/Edit Meta MD Contributor - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -20,104 +20,111 @@ # set context & title if { ![ad_form_new_p -key ims_md_md_cont_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../metamd" im\s_\md_id] "[_ lorsm.Meta_Metadata]"] "[_ lorsm.Add_Contributor]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../metamd" im\s_\md_id] \ + "[_ lorsm.Meta_Metadata]"] \ + "[_ lorsm.Add_Contributor]"] set title "[_ lorsm.lt_Edit_Meta_MD_Contribu]" } else { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../metamd" im\s_\md_id] "[_ lorsm.Meta_Metadata]"] "[_ lorsm.Add_Contributor]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../metamd" im\s_\md_id] \ + "[_ lorsm.Meta_Metadata]"] \ + "[_ lorsm.Add_Contributor]"] set title "[_ lorsm.lt_Add_Meta_MD_Contribut]" } # Form -ad_form -name metamd_cont \ +ad_form \ + -name metamd_cont \ -cancel_url ../metamd?ims_md_id=$ims_md_id \ -mode edit \ -form { + ims_md_md_cont_id:key(ims_md_metadata_contrib_seq) - ims_md_md_cont_id:key(ims_md_metadata_contrib_seq) + {role_s:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} + {label "[_ lorsm.Source]"} + } - {role_s:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} - {label "[_ lorsm.Source]"} - } + {role_v:text,nospell + {html {size 10}} + {help_text "[_ lorsm.Type_of_contribution]"} + {label "[_ lorsm.Role_1]"} + } - {role_v:text,nospell - {html {size 10}} - {help_text "[_ lorsm.Type_of_contribution]"} - {label "[_ lorsm.Role_1]"} - } - - {entity:text(textarea),nospell - {html {rows 5 cols 50}} - {help_text "[_ lorsm.lt_Entity_or_entities_in]"} - {label "[_ lorsm.Entity]"} - } + {entity:text(textarea),nospell + {html {rows 5 cols 50}} + {help_text "[_ lorsm.lt_Entity_or_entities_in]"} + {label "[_ lorsm.Entity]"} + } - {cont_date:text,nospell - {html {size 10}} - {help_text "[_ lorsm.Date_of_contribution]"} - {label "[_ lorsm.Date]"} - } + {cont_date:text,nospell + {html {size 10}} + {help_text "[_ lorsm.Date_of_contribution]"} + {label "[_ lorsm.Date]"} + } - {cont_date_l:text,nospell,optional - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi_3]"} - {label "[_ lorsm.Language]"} - } + {cont_date_l:text,nospell,optional + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi_3]"} + {label "[_ lorsm.Language]"} + } - {cont_date_s:text(textarea),nospell,optional - {html {rows 2 cols 50}} - {help_text "[_ lorsm.lt_Describes_contributio]"} - {label "[_ lorsm.Description]"} - } + {cont_date_s:text(textarea),nospell,optional + {html {rows 2 cols 50}} + {help_text "[_ lorsm.lt_Describes_contributio]"} + {label "[_ lorsm.Description]"} + } - {ims_md_id:text(hidden) {value $ims_md_id} - } + {ims_md_id:text(hidden) {value $ims_md_id}} -} -select_query { - select * from - ims_md_metadata_contrib mdc, - ims_md_metadata_contrib_entity mdce - where - mdc.ims_md_md_cont_id = :ims_md_md_cont_id - and - mdc.ims_md_id = :ims_md_id - and - mdce.ims_md_md_cont_id = :ims_md_md_cont_id + } -select_query { + select * + from ims_md_metadata_contrib mdc, ims_md_metadata_contrib_entity mdce + where mdc.ims_md_md_cont_id = :ims_md_md_cont_id + and mdc.ims_md_id = :ims_md_id + and mdce.ims_md_md_cont_id = :ims_md_md_cont_id -} -edit_data { - db_transaction { - db_dml update_mdc " - update ims_md_metadata_contrib - set role_v = :role_v, - role_s = :role_s, - cont_date = :cont_date, - cont_date_l = :cont_date_l, - cont_date_s = :cont_date_s - where ims_md_md_cont_id = :ims_md_md_cont_id" - - db_dml update_mdce " - update ims_md_metadata_contrib_entity - set entity = :entity - where ims_md_md_cont_id = :ims_md_md_cont_id" - } - -} -new_data { - db_transaction { - db_dml insert_mdc " - insert into ims_md_metadata_contrib (ims_md_md_cont_id, ims_md_id, role_s, role_v, cont_date, cont_date_l, cont_date_s) - values (:ims_md_md_cont_id, :ims_md_id, :role_s, :role_v, :cont_date, :cont_date_l, :cont_date_s)" + } -edit_data { + db_transaction { + db_dml update_mdc \ + "update ims_md_metadata_contrib + set role_v = :role_v, + role_s = :role_s, + cont_date = :cont_date, + cont_date_l = :cont_date_l, + cont_date_s = :cont_date_s + where ims_md_md_cont_id = :ims_md_md_cont_id" - db_dml insert_mdce " - insert into ims_md_metadata_contrib_entity (ims_md_md_cont_enti_id, ims_md_md_cont_id, entity) - values (nextval('ims_md_metadata_contrib_entity_seq'), :ims_md_md_cont_id, :entity)" - } + db_dml update_mdce \ + "update ims_md_metadata_contrib_entity + set entity = :entity + where ims_md_md_cont_id = :ims_md_md_cont_id" + } -} -after_submit { - ad_returnredirect [export_vars -base "../metamd" {ims_md_id}] + } -new_data { + db_transaction { + db_dml insert_mdc \ + "insert into ims_md_metadata_contrib (ims_md_md_cont_id, ims_md_id, role_s, role_v, cont_date, cont_date_l, cont_date_s) + values (:ims_md_md_cont_id, :ims_md_id, :role_s, :role_v, :cont_date, :cont_date_l, :cont_date_s)" + + db_dml insert_mdce \ + "insert into ims_md_metadata_contrib_entity (ims_md_md_cont_enti_id, ims_md_md_cont_id, entity) + values (nextval('ims_md_metadata_contrib_entity_seq'), :ims_md_md_cont_id, :entity)" + } + + } -after_submit { + ad_returnredirect [export_vars -base "../metamd" {ims_md_id}] ad_script_abort -} + } # Metametadata Contrib template::list::create \ @@ -126,40 +133,24 @@ -no_data "[_ lorsm.lt_No_Contributors_Avail]" \ -html { align right style "width: 100%;" } \ -elements { - role { - label "[_ lorsm.Role]" - } - entity { - label "[_ lorsm.Entity_1]" - } - cont_date { - label "[_ lorsm.Contribution_Date]" - } - cont_date_ls { - label "[_ lorsm.Description_1]" - } + role { label "[_ lorsm.Role]" } + entity { label "[_ lorsm.Entity_1]" } + cont_date { label "[_ lorsm.Contribution_Date]" } + cont_date_ls { label "[_ lorsm.Description_1]" } export { display_eval {\[Edit\]} - link_url_eval { [export_vars -base "meta_cont" {ims_md_md_cont_id ims_md_id}] } + link_url_eval { [export_vars \ + -base "meta_cont" \ + {ims_md_md_cont_id ims_md_id}] } link_html {title "[_ lorsm.Edit_Record] "} html { align center } } } db_multirow d_md_cont select_md_cont { - select - mdc.role_v || ' ' || '[' || mdc.role_s || ']' as role, - mdce.entity, - mdc.cont_date, - '[' || mdc.cont_date_l || ']' || ' ' || mdc.cont_date_s as cont_date_ls, - mdc.ims_md_md_cont_id, - mdc.ims_md_id - from - ims_md_metadata_contrib mdc, - ims_md_metadata_contrib_entity mdce - where - mdc.ims_md_md_cont_id = mdce.ims_md_md_cont_id - and - mdc.ims_md_id = :ims_md_id + select mdc.role_v || ' ' || '[' || mdc.role_s || ']' as role, mdce.entity, mdc.cont_date, + '[' || mdc.cont_date_l || ']' || ' ' || mdc.cont_date_s as cont_date_ls, mdc.ims_md_md_cont_id, mdc.ims_md_id + from ims_md_metadata_contrib mdc, ims_md_metadata_contrib_entity mdce + where mdc.ims_md_md_cont_id = mdce.ims_md_md_cont_id + and mdc.ims_md_id = :ims_md_id } - Index: openacs-4/packages/lorsm/www/admin/md/metamd/meta_lang.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/metamd/meta_lang.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/metamd/meta_lang.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/metamd/meta_lang.adp 17 Nov 2008 13:36:45 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Meta Metadata Language

- +
- + + - - - + + + +
Meta MetadataMeta Metadata
Language:
Language:
- -

#lorsm.lt_AddEdit_Meta_MD_Langu#

- + Index: openacs-4/packages/lorsm/www/admin/md/metamd/meta_lang.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/metamd/meta_lang.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/metamd/meta_lang.tcl 15 May 2007 20:14:45 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/metamd/meta_lang.tcl 17 Nov 2008 13:36:46 -0000 1.3 @@ -1,14 +1,14 @@ # packages/lorsm/www/md/metamd/meta_lang.tcl ad_page_contract { - + Add/Edit Meta MD Language - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @cvs-id $Id$ - + } { ims_md_id:integer } -properties { @@ -17,64 +17,66 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../metamd" im\s_\\\md_id] "[_ lorsm.Meta_Metadata]"] "[_ lorsm.Edit_Language]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../metamd" im\s_\\\md_id] \ + "[_ lorsm.Meta_Metadata]"] \ + + "[_ lorsm.Edit_Language]"] set title "[_ lorsm.lt_Edit_Meta_MD_Language]" # Form -ad_form -name metamd_lang \ +ad_form \ + -name metamd_lang \ -cancel_url ../metamd?ims_md_id=$ims_md_id \ -mode edit \ -form { + {language:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } - {language:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} - {label "[_ lorsm.Language]"} - } - {ims_md_id:text(hidden) {value $ims_md_id}} + {ims_md_id:text(hidden) {value $ims_md_id}} -} -on_submit { - # check if the mdmd language details already exist... + } -on_submit { + # check if the mdmd language details already exist... - if {[db_0or1row select_lang {select ims_md_id from ims_md_metadata where ims_md_id = :ims_md_id}]} { + if {[db_0or1row select_lang { + select ims_md_id + from ims_md_metadata + where ims_md_id = :ims_md_id}]} { + db_dml do_update " + update ims_md_metadata + set language = :language + where ims_md_id = :ims_md_id " - db_dml do_update " - update ims_md_metadata - set language = :language - where ims_md_id = :ims_md_id " + } else { + db_dml do_insert " + insert into ims_md_metadata (ims_md_id, language) + values(:ims_md_id, :language)" + } - } else { - - db_dml do_insert " - insert into ims_md_metadata (ims_md_id, language) - values - (:ims_md_id, :language)" - + } -after_submit { + ad_returnredirect [export_vars -base "../metamd" {ims_md_id}] + ad_script_abort } -} -after_submit { - ad_returnredirect [export_vars -base "../metamd" {ims_md_id}] - ad_script_abort -} - # Metametadata Language template::list::create \ -name d_md_lang \ -multirow d_md_lang \ -no_data "[_ lorsm.lt_No_Language_Available]" \ -html { align right style "width: 100%;" } \ -elements { - language { - label "[_ lorsm.Language_1]" - } + language { label "[_ lorsm.Language_1]" } } db_multirow d_md_lang select_md_lang { - select language, - ims_md_id - from - ims_md_metadata - where - ims_md_id = :ims_md_id -} + select language, ims_md_id + from ims_md_metadata + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/metamd/meta_scheme.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/metamd/meta_scheme.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/metamd/meta_scheme.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/metamd/meta_scheme.adp 17 Nov 2008 13:36:46 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Meta Metadata Scheme

- +
- + + - - - + + + +
Meta MetadataMeta Metadata
Scheme:
Scheme:
- -

#lorsm.lt_AddEdit_Meta_MD_Schem#

- + Index: openacs-4/packages/lorsm/www/admin/md/metamd/meta_scheme.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/metamd/meta_scheme.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/metamd/meta_scheme.tcl 15 May 2007 20:14:45 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/metamd/meta_scheme.tcl 17 Nov 2008 13:36:46 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/metamd/meta_scheme.tcl ad_page_contract { - + Add/Edit Meta MD Language - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -19,50 +19,65 @@ # set context & title if { ![ad_form_new_p -key ims_md_md_sch_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../metamd" im\s_\\md_id] "[_ lorsm.Meta_Metadata]"] "[_ lorsm.Edit_Scheme]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../metamd" im\s_\\md_id] \ + "[_ lorsm.Meta_Metadata]"] \ + + "[_ lorsm.Edit_Scheme]"] set title "[_ lorsm.Edit_Meta_MD_Scheme]" } else { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../metamd" im\s_\\md_id] "[_ lorsm.Meta_Metadata]"] "[_ lorsm.Add_Scheme]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../metamd" im\s_\\md_id] \ + "[_ lorsm.Meta_Metadata]"] \ + + "[_ lorsm.Add_Scheme]"] set title "[_ lorsm.Add_Meta_MD_Scheme]" } # Form - -ad_form -name metamd_scheme \ +ad_form \ + -name metamd_scheme \ -cancel_url ../metamd?ims_md_id=$ims_md_id \ -mode edit \ -form { + ims_md_md_sch_id:key(ims_md_metadata_scheme_seq) - ims_md_md_sch_id:key(ims_md_metadata_scheme_seq) + {scheme:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Structure_of_meta-dat]"} + {label "[_ lorsm.Scheme]"} + } - {scheme:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Structure_of_meta-dat]"} - {label "[_ lorsm.Scheme]"} - } - {ims_md_id:text(hidden) {value $ims_md_id} - } + {ims_md_id:text(hidden) {value $ims_md_id}} -} -select_query {select * from ims_md_metadata_scheme where ims_md_md_sch_id = :ims_md_md_sch_id and ims_md_id = :ims_md_id + } -select_query { + select * + from ims_md_metadata_scheme + where ims_md_md_sch_id = :ims_md_md_sch_id + and ims_md_id = :ims_md_id -} -edit_data { - db_dml do_update " - update ims_md_metadata_scheme + } -edit_data { + db_dml do_update \ + "update ims_md_metadata_scheme set scheme = :scheme where ims_md_md_sch_id = :ims_md_md_sch_id " -} -new_data { - db_dml do_insert " - insert into ims_md_metadata_scheme (ims_md_md_sch_id, ims_md_id, scheme) - values - (:ims_md_md_sch_id, :ims_md_id, :scheme)" + } -new_data { + db_dml do_insert \ + "insert into ims_md_metadata_scheme (ims_md_md_sch_id, ims_md_id, scheme) + values (:ims_md_md_sch_id, :ims_md_id, :scheme)" - -} -after_submit { - ad_returnredirect [export_vars -base "../metamd" {ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars -base "../metamd" {ims_md_id}] ad_script_abort -} + } # Metametadata metadatascheme template::list::create \ @@ -71,22 +86,19 @@ -no_data "[_ lorsm.No_Scheme_Available]" \ -html { align right style "width: 100%;" } \ -elements { - scheme { - label "[_ lorsm.Scheme_1]" - } + scheme { label "[_ lorsm.Scheme_1]" } export { display_eval {\[Edit\]} - link_url_eval { [export_vars -base "meta_scheme" {ims_md_id ims_md_md_sch_id}] } + link_url_eval { [export_vars \ + -base "meta_scheme" \ + {ims_md_id ims_md_md_sch_id}] } link_html {title "[_ lorsm.Edit_Record]"} html { align center } } } db_multirow d_md_scheme select_md_scheme { - select scheme, - ims_md_id, ims_md_md_sch_id, scheme - from - ims_md_metadata_scheme - where - ims_md_id = :ims_md_id -} + select scheme, ims_md_id, ims_md_md_sch_id, scheme + from ims_md_metadata_scheme + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/relationmd/relation.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/relationmd/relation.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/relationmd/relation.adp 31 Dec 2006 00:36:07 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/relationmd/relation.adp 17 Nov 2008 13:37:54 -0000 1.2 @@ -2,30 +2,34 @@ @title;noquote@ @context;noquote@ - + - +
- + + - - + + + - - + + + - - + + + - - + + + - - + + -
Relation MetadataRelation Metadata
Kind: Kind:
Relation Metadata Resource
Relation Metadata Resource
Identifier: Identifier:
Description: Description:
Catalog-Entries: Catalog-Entries:
+ Index: openacs-4/packages/lorsm/www/admin/md/relationmd/relation.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/relationmd/relation.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/relationmd/relation.tcl 31 Dec 2006 00:36:07 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/relationmd/relation.tcl 17 Nov 2008 13:37:54 -0000 1.2 @@ -13,106 +13,108 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../relationmd" ims_md_id] "[_ lorsm.Relation_MD]"] "[_ lorsm.Relation_Entry]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../relationmd" ims_md_id] \ + "[_ lorsm.Relation_MD]"] \ + + "[_ lorsm.Relation_Entry]"] set title "[_ lorsm.Relation_MD]" # Relation Kind template::list::create \ -name d_re_kind \ -multirow d_re_kind \ -no_data "[_ lorsm.No_Kind_Available]" \ - -actions [list "[_ lorsm.Add_Kind]" [export_vars -base relation_kind {ims_md_re_re_id ims_md_re_id ims_md_id}] "[_ lorsm.Add_another_Kind]"] \ + -actions [list \ + "[_ lorsm.Add_Kind]" \ + [export_vars \ + -base relation_kind \ + {ims_md_re_re_id ims_md_re_id ims_md_id}] \ + "[_ lorsm.Add_another_Kind]"] \ -html { align right style "width: 100%;" } \ -elements { - kind_s { - label "" - } - kind_v { - label "" - } + kind_s { label "" } + kind_v { label "" } } db_multirow d_re_kind select_re_kind { - select kind_s, - kind_v - from - ims_md_relation - where - ims_md_re_id = :ims_md_re_id - and ims_md_id = :ims_md_id -} + select kind_s, kind_v + from ims_md_relation + where ims_md_re_id = :ims_md_re_id + and ims_md_id = :ims_md_id +} # Relation Resource Identifier template::list::create \ -name d_re_ident \ -multirow d_re_ident \ - -actions [list "[_ lorsm.Add_Identifier]" [export_vars -base relation_ident {ims_md_re_re_id ims_md_re_id ims_md_id}] "[_ lorsm.lt_Add_another_Identifie]"] \ + -actions [list \ + "[_ lorsm.Add_Identifier]" \ + [export_vars \ + -base relation_ident \ + {ims_md_re_re_id ims_md_re_id ims_md_id}] \ + "[_ lorsm.lt_Add_another_Identifie]"] \ -no_data "[_ lorsm.lt_No_Resource_Identifie]" \ -html { align right style "width: 100%;" } \ -elements { - identifier { - label "" - } + identifier { label "" } } db_multirow d_re_ident select_re_ident { select identifier - from - ims_md_relation_resource - where - ims_md_re_id = :ims_md_re_id - and ims_md_re_re_id = :ims_md_re_re_id + from ims_md_relation_resource + where ims_md_re_id = :ims_md_re_id + and ims_md_re_re_id = :ims_md_re_re_id } # Relation Resource Catalog-Entry template::list::create \ -name d_re_cata \ -multirow d_re_cata \ -no_data "[_ lorsm.lt_No_Catalog-Entries_Av]" \ - -actions [list "[_ lorsm.Add_Catalog-Entry]" [export_vars -base relation_cata {ims_md_re_re_id ims_md_re_id ims_md_id}] "[_ lorsm.lt_Add_another_Catalog-E]"] \ + -actions [list \ + "[_ lorsm.Add_Catalog-Entry]" \ + [export_vars \ + -base relation_cata \ + {ims_md_re_re_id ims_md_re_id ims_md_id}] \ + "[_ lorsm.lt_Add_another_Catalog-E]"] \ -html { align right style "width: 100%;" } \ -elements { - catalog { - label "" - } - entry_l { - label "" - } - entry_s { - label "" - } + catalog { label "" } + entry_l { label "" } + entry_s { label "" } } db_multirow d_re_cata select_re_cata { - select catalog, - entry_l, - entry_s - from - ims_md_relation_resource_catalog - where - ims_md_re_re_id = :ims_md_re_re_id + select catalog, entry_l, entry_s + from ims_md_relation_resource_catalog + where ims_md_re_re_id = :ims_md_re_re_id } # Relation Resource Description template::list::create \ -name d_re_desc \ -multirow d_re_desc \ -no_data "[_ lorsm.lt_No_Resource_Descripti]" \ - -actions [list "[_ lorsm.Add_Description]" [export_vars -base relation_desc {ims_md_re_re_id ims_md_re_id ims_md_id}] "[_ lorsm.lt_Add_another_Descripti]"] \ + -actions [list \ + "[_ lorsm.Add_Description]" \ + [export_vars \ + -base relation_desc \ + {ims_md_re_re_id ims_md_re_id ims_md_id}] \ + "[_ lorsm.lt_Add_another_Descripti]"] \ -html { align right style "width: 100%;" } \ -elements { - descrip { - label "" - } + descrip { label "" } } db_multirow d_re_desc select_re_desc { select '[' || descrip_l || ']' || ' ' || descrip_s as descrip - from - ims_md_relation_resource - where - ims_md_re_id = :ims_md_re_id - and ims_md_re_re_id = :ims_md_re_re_id + from ims_md_relation_resource + where ims_md_re_id = :ims_md_re_id + and ims_md_re_re_id = :ims_md_re_re_id } Index: openacs-4/packages/lorsm/www/admin/md/relationmd/relation_add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/relationmd/relation_add.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/relationmd/relation_add.adp 17 Oct 2008 10:46:31 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/relationmd/relation_add.adp 17 Nov 2008 13:37:54 -0000 1.3 @@ -2,20 +2,20 @@ @title;noquote@ @context;noquote@ - +

Relation Metadata Entry

- +
- + + - - + + + - + -
Relation MetadataRelation Metadata
Add another Relation Metadata Entry?
Add another Relation Metadata Entry?
+ Index: openacs-4/packages/lorsm/www/admin/md/relationmd/relation_add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/relationmd/relation_add.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/md/relationmd/relation_add.tcl 31 Dec 2006 00:36:07 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/md/relationmd/relation_add.tcl 17 Nov 2008 13:37:55 -0000 1.2 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/relationmd/relation_add.tcl ad_page_contract { - + Add/Edit Relation MD Entry - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -17,32 +17,38 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../relationmd" ims_md_id] "[_ lorsm.Relation_MD]"] "[_ lorsm.Add_Relation_Entry]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../relationmd" ims_md_id] \ + "[_ lorsm.Relation_MD]"] \ + + "[_ lorsm.Add_Relation_Entry]"] set title "[_ lorsm.lt_Add_Relation_MD_Entry]" # Form -ad_form -name relationmd_add \ +ad_form \ + -name relationmd_add \ -cancel_url ../relationmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + ims_md_re_id:key(ims_md_relation_seq) - ims_md_re_id:key(ims_md_relation_seq) + {ims_md_id:text(hidden) {value $ims_md_id}} - {ims_md_id:text(hidden) {value $ims_md_id}} + } -new_data { + db_transaction { + db_dml do_insert_relation \ + "insert into ims_md_relation (ims_md_re_id, ims_md_id) + values (:ims_md_re_id, :ims_md_id)" -} -new_data { - db_transaction { - db_dml do_insert_relation " - insert into ims_md_relation (ims_md_re_id, ims_md_id) - values (:ims_md_re_id, :ims_md_id)" + db_dml do_insert_resource \ + "insert into ims_md_relation_resource (ims_md_re_re_id, ims_md_re_id) + values (nextval('ims_md_relation_resource_seq'), :ims_md_re_id)" + } - db_dml do_insert_resource " - insert into ims_md_relation_resource (ims_md_re_re_id, ims_md_re_id) - values (nextval('ims_md_relation_resource_seq'), :ims_md_re_id)" - } - -} -after_submit { - ad_returnredirect [export_vars -base "../relationmd" {ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars -base "../relationmd" {ims_md_id}] ad_script_abort -} - + } Index: openacs-4/packages/lorsm/www/admin/md/relationmd/relation_cata.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/relationmd/relation_cata.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/relationmd/relation_cata.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/relationmd/relation_cata.adp 17 Nov 2008 13:37:55 -0000 1.4 @@ -2,25 +2,24 @@ @title;noquote@ @context;noquote@ - +

Relation Metadata Resource Catalog-Entry

- +
- + + - - - + + + -
Relation Metadata ResourceRelation Metadata Resource
Catalog-Entries:
Catalog-Entries:
+

#lorsm.lt_AddEdit_Relation_MD_R#

- + Index: openacs-4/packages/lorsm/www/admin/md/relationmd/relation_cata.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/relationmd/relation_cata.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/relationmd/relation_cata.tcl 15 May 2007 20:14:45 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/relationmd/relation_cata.tcl 17 Nov 2008 13:37:55 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/relationmd/relation_cata.tcl ad_page_contract { - + Add/Edit Relation MD Resource Catalog-Entry - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -21,69 +21,94 @@ # set context & title if { ![ad_form_new_p -key ims_md_re_re_ca_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../relationmd" ims_md_id] "[_ lorsm.Relation_MD]"] [list [export_vars -base "relation" {ims_md_id ims_md_re_id ims_md_re_re_id}] "[_ lorsm.Relation_Entry]"] "[_ lorsm.Edit_Catalog-Entry]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../relationmd" ims_md_id] \ + "[_ lorsm.Relation_MD]"] \ + + [list [export_vars \ + -base "relation" \ + {ims_md_id ims_md_re_id ims_md_re_re_id}] \ + "[_ lorsm.Relation_Entry]"] \ + + "[_ lorsm.Edit_Catalog-Entry]"] set title "[_ lorsm.lt_Edit_Relation_MD_Reso]" } else { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../relationmd" ims_md_id] "[_ lorsm.Relation_MD]"] [list [export_vars -base "relation" {ims_md_id ims_md_re_id ims_md_re_re_id}] "[_ lorsm.Relation_Entry]"] "[_ lorsm.Add_Catalog-Entry]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../relationmd" ims_md_id] \ + "[_ lorsm.Relation_MD]"] \ + + [list [export_vars \ + -base "relation" \ + {ims_md_id ims_md_re_id ims_md_re_re_id}] \ + "[_ lorsm.Relation_Entry]"] \ + "[_ lorsm.Add_Catalog-Entry]"] set title "[_ lorsm.lt_Add_Relation_MD_Resou]" } # Form -ad_form -name relationmd_cata \ +ad_form \ + -name relationmd_cata \ -cancel_url relation?ims_md_id=$ims_md_id&ims_md_re_id=$ims_md_re_id&ims_md_re_re_id=$ims_md_re_re_id \ -mode edit \ -form { + ims_md_re_re_ca_id:key(ims_md_relation_resource_catalog_seq) - ims_md_re_re_ca_id:key(ims_md_relation_resource_catalog_seq) + {catalog:text,nospell + {html {size 50}} + {help_text "[_ lorsm.Name_of_the_catalog]"} + {label "[_ lorsm.Catalog]"} + } - {catalog:text,nospell - {html {size 50}} - {help_text "[_ lorsm.Name_of_the_catalog]"} - {label "[_ lorsm.Catalog]"} - } + {entry_l:text,nospell,optional + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } - {entry_l:text,nospell,optional - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} - {label "[_ lorsm.Language]"} - } + {entry_s:text,nospell + {html {size 50}} + {help_text "[_ lorsm.lt_Number_in_the_Catalog]"} + {label "[_ lorsm.Entry]"} + } - {entry_s:text,nospell - {html {size 50}} - {help_text "[_ lorsm.lt_Number_in_the_Catalog]"} - {label "[_ lorsm.Entry]"} - } - - {ims_md_re_re_id:text(hidden) {value $ims_md_re_re_id} - } + {ims_md_re_re_id:text(hidden) {value $ims_md_re_re_id}} - {ims_md_re_id:text(hidden) {value $ims_md_re_id} - } + {ims_md_re_id:text(hidden) {value $ims_md_re_id}} - {ims_md_id:text(hidden) {value $ims_md_id} - } + {ims_md_id:text(hidden) {value $ims_md_id}} -} -select_query {select * from ims_md_relation_resource_catalog where ims_md_re_re_ca_id = :ims_md_re_re_ca_id and ims_md_re_re_id = :ims_md_re_re_id + } -select_query { + select * + from ims_md_relation_resource_catalog + where ims_md_re_re_ca_id = :ims_md_re_re_ca_id + and ims_md_re_re_id = :ims_md_re_re_id -} -edit_data { + } -edit_data { db_dml do_update " update ims_md_relation_resource_catalog set catalog = :catalog, entry_l = :entry_l, entry_s = :entry_s where ims_md_re_re_ca_id = :ims_md_re_re_ca_id" -} -new_data { + } -new_data { db_dml do_insert " insert into ims_md_relation_resource_catalog (ims_md_re_re_ca_id, ims_md_re_re_id, catalog, entry_l, entry_s) - values - (:ims_md_re_re_ca_id, :ims_md_re_re_id, :catalog, :entry_l, :entry_s)" + values (:ims_md_re_re_ca_id, :ims_md_re_re_id, :catalog, :entry_l, :entry_s)" -} -after_submit { - ad_returnredirect [export_vars -base "relation" {ims_md_re_id ims_md_re_re_id ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars \ + -base "relation" \ + {ims_md_re_id ims_md_re_re_id ims_md_id}] ad_script_abort -} + } # Relation Catalog-Entry template::list::create \ @@ -92,37 +117,23 @@ -no_data "[_ lorsm.lt_No_Catalog-Entries_Av]" \ -html { align right style "width: 100%;" } \ -elements { - catalog { - label "" - } - entry_l { - label "" - } - entry_s { - label "" - } + catalog { label "" } + entry_l { label "" } + entry_s { label "" } export { display_eval {\[Edit\]} - link_url_eval { [export_vars -base "relation_cata" {ims_md_re_re_ca_id ims_md_re_re_id ims_md_re_id ims_md_id}] } + link_url_eval { [export_vars \ + -base "relation_cata" \ + {ims_md_re_re_ca_id ims_md_re_re_id ims_md_re_id ims_md_id}] } link_html {title "[_ lorsm.Edit_Record]"} html { align center } } } db_multirow d_re_cata select_re_cata { - select - reca.catalog, - reca.entry_l, - reca.entry_s, - reca.ims_md_re_re_ca_id, - reca.ims_md_re_re_id, - re.ims_md_id, - re.ims_md_re_id - from - ims_md_relation_resource_catalog reca, - ims_md_relation re - where - reca.ims_md_re_re_id = :ims_md_re_re_id - and - re.ims_md_re_id = :ims_md_re_id -} + select reca.catalog, reca.entry_l, reca.entry_s, reca.ims_md_re_re_ca_id, + reca.ims_md_re_re_id, re.ims_md_id, re.ims_md_re_id + from ims_md_relation_resource_catalog reca, ims_md_relation re + where reca.ims_md_re_re_id = :ims_md_re_re_id + and re.ims_md_re_id = :ims_md_re_id +} Index: openacs-4/packages/lorsm/www/admin/md/relationmd/relation_desc.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/relationmd/relation_desc.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/relationmd/relation_desc.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/relationmd/relation_desc.adp 17 Nov 2008 13:37:55 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Relation Metadata Resource Description

- +
- + + - - - + + + +
Relation Metadata ResourceRelation Metadata Resource
Description:
Description:
- -

#lorsm.lt_AddEdit_Relation_MD_R_1#

- + Index: openacs-4/packages/lorsm/www/admin/md/relationmd/relation_desc.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/relationmd/relation_desc.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/relationmd/relation_desc.tcl 15 May 2007 20:14:45 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/relationmd/relation_desc.tcl 17 Nov 2008 13:37:55 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/annotationmd/relation_desc.tcl ad_page_contract { - + Add/Edit Relation MD Resource Description - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -19,49 +19,65 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../relationmd" ims_md_id] "[_ lorsm.Relation_MD]"] [list [export_vars -base "relation" {ims_md_id ims_md_re_id ims_md_re_re_id}] "[_ lorsm.Relation_Entry]"] "[_ lorsm.AddEdit_Description]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../relationmd" ims_md_id] \ + "[_ lorsm.Relation_MD]"] \ + + [list [export_vars \ + -base "relation" \ + {ims_md_id ims_md_re_id ims_md_re_re_id}] \ + "[_ lorsm.Relation_Entry]"] \ + + "[_ lorsm.AddEdit_Description]"] set title "[_ lorsm.lt_Edit_Relation_MD_Reso_1]" # Form -ad_form -name relationmd_desc \ +ad_form \ + -name relationmd_desc \ -cancel_url relation?ims_md_id=$ims_md_id&ims_md_re_id=$ims_md_re_id&ims_md_re_re_id=$ims_md_re_re_id \ -mode edit \ -form { + ims_md_re_re_id:key(ims_md_relation_resource_seq) - ims_md_re_re_id:key(ims_md_relation_resource_seq) + {descrip_l:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } - {descrip_l:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} - {label "[_ lorsm.Language]"} - } - - {descrip_s:text(textarea),nospell - {html {rows 2 cols 50}} - {help_text "[_ lorsm.lt_Description_of_the_ot]"} - {label "[_ lorsm.Description]"} - } + {descrip_s:text(textarea),nospell + {html {rows 2 cols 50}} + {help_text "[_ lorsm.lt_Description_of_the_ot]"} + {label "[_ lorsm.Description]"} + } - {ims_md_id:text(hidden) {value $ims_md_id} - } + {ims_md_id:text(hidden) {value $ims_md_id}} - {ims_md_re_id:text(hidden) {value $ims_md_re_id} - } + {ims_md_re_id:text(hidden) {value $ims_md_re_id}} -} -select_query {select * from ims_md_relation_resource where ims_md_re_re_id = :ims_md_re_re_id and ims_md_re_id = :ims_md_re_id + } -select_query { + select * + from ims_md_relation_resource + where ims_md_re_re_id = :ims_md_re_re_id + and ims_md_re_id = :ims_md_re_id -} -edit_data { + } -edit_data { db_dml do_update " update ims_md_relation_resource set descrip_l = :descrip_l, descrip_s = :descrip_s where ims_md_re_re_id = :ims_md_re_re_id " -} -after_submit { - ad_returnredirect [export_vars -base "relation" {ims_md_re_re_id ims_md_re_id ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars \ + -base "relation" \ + {ims_md_re_re_id ims_md_re_id ims_md_id}] ad_script_abort -} + } # Relation Description template::list::create \ @@ -70,20 +86,13 @@ -no_data "[_ lorsm.lt_No_Resource_Descripti]" \ -html { align right style "width: 100%;" } \ -elements { - descrip { - label "[_ lorsm.Description_1]" - } + descrip {label "[_ lorsm.Description_1]"} } db_multirow d_re_desc select_re_desc { - select '[' || rere.descrip_l || ']' || ' ' || rere.descrip_s as descrip, - rere.ims_md_re_re_id, - re.ims_md_re_id, - re.ims_md_id - from - ims_md_relation_resource rere, - ims_md_relation re - where - rere.ims_md_re_id = :ims_md_re_id - and re.ims_md_re_id = :ims_md_re_id -} + select '[' || rere.descrip_l || ']' || ' ' || rere.descrip_s as descrip, + rere.ims_md_re_re_id, re.ims_md_re_id, re.ims_md_id + from ims_md_relation_resource rere, ims_md_relation re + where rere.ims_md_re_id = :ims_md_re_id + and re.ims_md_re_id = :ims_md_re_id +} Index: openacs-4/packages/lorsm/www/admin/md/relationmd/relation_ident.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/relationmd/relation_ident.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/relationmd/relation_ident.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/relationmd/relation_ident.adp 17 Nov 2008 13:37:55 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Relation Metadata Resource Identifier

- +
- + + - - - + + + +
Relation Metadata ResourceRelation Metadata Resource
Identifier:
Identifier:
- -

#lorsm.lt_AddEdit_Relation_MD_R_2#

- + Index: openacs-4/packages/lorsm/www/admin/md/relationmd/relation_ident.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/relationmd/relation_ident.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/relationmd/relation_ident.tcl 15 May 2007 20:14:45 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/relationmd/relation_ident.tcl 17 Nov 2008 13:37:55 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/relationmd/relation_ident.tcl ad_page_contract { - + Add/Edit Relation MD Resource Identifier - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -19,43 +19,58 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../relationmd" ims_md_id] "[_ lorsm.Relation_MD]"] [list [export_vars -base "relation" {ims_md_id ims_md_re_id ims_md_re_re_id}] "[_ lorsm.Relation_Entry]"] "[_ lorsm.lt_AddEdit_Resource_Iden]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../relationmd" ims_md_id] \ + "[_ lorsm.Relation_MD]"] \ + + [list [export_vars \ + -base "relation" \ + {ims_md_id ims_md_re_id ims_md_re_re_id}] \ + "[_ lorsm.Relation_Entry]"] \ + + "[_ lorsm.lt_AddEdit_Resource_Iden]"] set title "[_ lorsm.lt_Edit_Relation_MD_Reso_2]" # Form - -ad_form -name relationmd_ident \ +ad_form \ + -name relationmd_ident \ -cancel_url relation?ims_md_id=$ims_md_id&ims_md_re_id=$ims_md_re_id&ims_md_re_re_id=$ims_md_re_re_id \ -mode edit \ -form { + ims_md_re_re_id:key(ims_md_relation_resource_seq) - ims_md_re_re_id:key(ims_md_relation_resource_seq) + {identifier:text,nospell + {html {size 50}} + {help_text "[_ lorsm.lt_Unique_identifier_of_]"} + {label "[_ lorsm.Identifier]"} + } - {identifier:text,nospell - {html {size 50}} - {help_text "[_ lorsm.lt_Unique_identifier_of_]"} - {label "[_ lorsm.Identifier]"} - } + {ims_md_id:text(hidden) {value $ims_md_id}} - {ims_md_id:text(hidden) {value $ims_md_id} - } + {ims_md_re_id:text(hidden) {value $ims_md_re_id}} - {ims_md_re_id:text(hidden) {value $ims_md_re_id} - } + } -select_query { + select * + from ims_md_relation_resource + where ims_md_re_re_id = :ims_md_re_re_id + and ims_md_re_id = :ims_md_re_id -} -select_query {select * from ims_md_relation_resource where ims_md_re_re_id = :ims_md_re_re_id and ims_md_re_id = :ims_md_re_id - -} -edit_data { + } -edit_data { db_dml do_update " update ims_md_relation_resource set identifier = :identifier where ims_md_re_re_id = :ims_md_re_re_id " -} -after_submit { - ad_returnredirect [export_vars -base "relation" {ims_md_re_re_id ims_md_re_id ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars \ + -base "relation" \ + {ims_md_re_re_id ims_md_re_id ims_md_id}] ad_script_abort -} + } # Relation Identifier template::list::create \ @@ -64,20 +79,12 @@ -no_data "[_ lorsm.lt_No_Resource_Identifie]" \ -html { align right style "width: 100%;" } \ -elements { - identifier { - label "[_ lorsm.Identifier_1]" - } + identifier { label "[_ lorsm.Identifier_1]" } } db_multirow d_re_ident select_re_ident { - select rere.identifier, - rere.ims_md_re_re_id, - re.ims_md_re_id, - re.ims_md_id - from - ims_md_relation_resource rere, - ims_md_relation re - where - rere.ims_md_re_id = :ims_md_re_id - and re.ims_md_re_id = :ims_md_re_id -} + select rere.identifier, rere.ims_md_re_re_id, re.ims_md_re_id, re.ims_md_id + from ims_md_relation_resource rere, ims_md_relation re + where rere.ims_md_re_id = :ims_md_re_id + and re.ims_md_re_id = :ims_md_re_id +} Index: openacs-4/packages/lorsm/www/admin/md/relationmd/relation_kind.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/relationmd/relation_kind.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/relationmd/relation_kind.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/relationmd/relation_kind.adp 17 Nov 2008 13:37:55 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Relation Metadata Kind

- +
- + + - - - + + + +
Relation Metadata KindRelation Metadata Kind
Kind:
Kind:
- -

#lorsm.lt_AddEdit_Relation_MD_K#

- + Index: openacs-4/packages/lorsm/www/admin/md/relationmd/relation_kind.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/relationmd/relation_kind.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/relationmd/relation_kind.tcl 15 May 2007 20:14:45 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/relationmd/relation_kind.tcl 17 Nov 2008 13:37:55 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/relationmd/relation_kind.tcl ad_page_contract { - + Add/Edit Relation MD Kind - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -20,49 +20,64 @@ # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../relationmd" ims_md_id] "[_ lorsm.Relation_MD]"] [list [export_vars -base "relation" {ims_md_id ims_md_re_id ims_md_re_re_id}] "[_ lorsm.Relation_Entry]"] "[_ lorsm.AddEdit_Kind]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../relationmd" ims_md_id] \ + "[_ lorsm.Relation_MD]"] \ + + [list [export_vars \ + -base "relation" \ + {ims_md_id ims_md_re_id ims_md_re_re_id}] \ + "[_ lorsm.Relation_Entry]"] \ + "[_ lorsm.AddEdit_Kind]"] set title "[_ lorsm.lt_AddEdit_Relation_MD_K]" # Form -ad_form -name relationmd_kind \ +ad_form \ + -name relationmd_kind \ -cancel_url relation?ims_md_id=$ims_md_id&ims_md_re_id=$ims_md_re_id&ims_md_re_re_id=$ims_md_re_re_id \ -mode edit \ -form { + ims_md_re_id:key(ims_md_relation_seq) - ims_md_re_id:key(ims_md_relation_seq) + {kind_s:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} + {label "[_ lorsm.Source]"} + } - {kind_s:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} - {label "[_ lorsm.Source]"} - } - - {kind_v:text,nospell - {html {size 20}} - {help_text "[_ lorsm.lt_Nature_of_the_relatio]"} - {label "[_ lorsm.Kind]"} - } + {kind_v:text,nospell + {html {size 20}} + {help_text "[_ lorsm.lt_Nature_of_the_relatio]"} + {label "[_ lorsm.Kind]"} + } - {ims_md_id:text(hidden) {value $ims_md_id} - } - - {ims_md_re_re_id:text(hidden) {value $ims_md_re_re_id} - } + {ims_md_id:text(hidden) {value $ims_md_id}} -} -select_query {select * from ims_md_relation where ims_md_re_id = :ims_md_re_id and ims_md_id = :ims_md_id + {ims_md_re_re_id:text(hidden) {value $ims_md_re_re_id}} -} -edit_data { - db_dml do_update " - update ims_md_relation + } -select_query { + select * + from ims_md_relation + where ims_md_re_id = :ims_md_re_id + and ims_md_id = :ims_md_id + + } -edit_data { + db_dml do_update \ + "update ims_md_relation set kind_s = :kind_s, kind_v = :kind_v where ims_md_re_id = :ims_md_re_id" -} -after_submit { - ad_returnredirect [export_vars -base "relation" {ims_md_re_re_id ims_md_re_id ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars \ + -base "relation" \ + {ims_md_re_re_id ims_md_re_id ims_md_id}] ad_script_abort -} + } # Relation Kind template::list::create \ @@ -71,24 +86,13 @@ -no_data "[_ lorsm.No_Kind_Available]" \ -html { align right style "width: 100%;" } \ -elements { - kind_s { - label "[_ lorsm.Source_1]" - } - kind_v { - label "[_ lorsm.Value]" - } + kind_s { label "[_ lorsm.Source_1]" } + kind_v { label "[_ lorsm.Value]" } } db_multirow d_re_kind select_re_kind { - select re.kind_s, - re.kind_v, - re.ims_md_re_id, - re.ims_md_id, - rere.ims_md_re_re_id - from - ims_md_relation re, - ims_md_relation_resource rere - where - re.ims_md_re_id = :ims_md_re_id - and rere.ims_md_re_id = :ims_md_re_id -} + select re.kind_s, re.kind_v, re.ims_md_re_id, re.ims_md_id, rere.ims_md_re_re_id + from ims_md_relation re, ims_md_relation_resource rere + where re.ims_md_re_id = :ims_md_re_id + and rere.ims_md_re_id = :ims_md_re_id +} Index: openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_caor.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_caor.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_caor.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_caor.adp 17 Nov 2008 13:37:55 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Rights Metadata Copyright or other Restrictions

- +
- + + - - - + + + +
Rights MetadataRights Metadata
Copyright or other Restrictions:
Copyright or other Restrictions:
- -

#lorsm.lt_AddEdit_Rights_MD_Cop#

- + Index: openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_caor.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_caor.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_caor.tcl 15 May 2007 20:14:45 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_caor.tcl 17 Nov 2008 13:37:55 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/rightsmd/rights_caor.tcl ad_page_contract { - + Add/Edit Rights MD Copyright or other Restrictions - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -17,71 +17,72 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../rightsmd" ims_md_id] "[_ lorsm.Rights_MD]"] " <#_Add/Edit Copyrights or other Restrictions #>"] -set title "[_ lorsm.lt_Edit_Rights_MD_Copyri]" +set context [list \ + [list \ + [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + [list \ + [export_vars -base "../rightsmd" ims_md_id] \ + "[_ lorsm.Rights_MD]"] \ -# Form + " <#_Add/Edit Copyrights or other Restrictions #>"] +set title "[_ lorsm.lt_Edit_Rights_MD_Copyri]" -ad_form -name rightsmd_caor \ +# Form +ad_form \ + -name rightsmd_caor \ -cancel_url ../rightsmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + {caor_s:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} + {label "[_ lorsm.Source]"} + } - {caor_s:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} - {label "[_ lorsm.Source]"} - } + {caor_v:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Whether_copyright_or_]"} + {label "[_ lorsm.lt_Copyright_or_other_Re]"} + } - {caor_v:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Whether_copyright_or_]"} - {label "[_ lorsm.lt_Copyright_or_other_Re]"} - } {ims_md_id:text(hidden) {value $ims_md_id}} -} -on_submit { - # check if the Rights Copyright details already exist... + } -on_submit { + # check if the Rights Copyright details already exist... - if {[db_0or1row select_type {select ims_md_id from ims_md_rights where ims_md_id = :ims_md_id}]} { + if {[db_0or1row select_type { + select ims_md_id + from ims_md_rights + where ims_md_id = :ims_md_id}]} { + db_dml do_update \ + "update ims_md_rights + set caor_s = :caor_s, caor_v = :caor_v + where ims_md_id = :ims_md_id " + } else { + db_dml do_insert \ + "insert into ims_md_rights (ims_md_id, caor_s, caor_v) + values (:ims_md_id, :caor_s, :caor_v) " + } - db_dml do_update " - update ims_md_rights - set caor_s = :caor_s, caor_v = :caor_v - where ims_md_id = :ims_md_id " - - } else { - - db_dml do_insert " - insert into ims_md_rights (ims_md_id, caor_s, caor_v) - values - (:ims_md_id, :caor_s, :caor_v) " + } -after_submit { + ad_returnredirect [export_vars -base "../rightsmd" {ims_md_id}] + ad_script_abort } -} -after_submit { - ad_returnredirect [export_vars -base "../rightsmd" {ims_md_id}] - ad_script_abort -} - # Rights Copyright or other Restrictions template::list::create \ -name d_ri_caor \ -multirow d_ri_caor \ -no_data "[_ lorsm.lt_No_Copyright_or_other]" \ -html { align right style "width: 100%;" } \ -elements { - caor { - label "[_ lorsm.Copyright_Info]" - } + caor { label "[_ lorsm.Copyright_Info]" } } db_multirow d_ri_caor select_ri_caor { - select - '[' || caor_s || '] ' || caor_v as caor, - ims_md_id - from - ims_md_rights - where - ims_md_id = :ims_md_id -} + select '[' || caor_s || '] ' || caor_v as caor, ims_md_id + from ims_md_rights + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_cost.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_cost.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_cost.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_cost.adp 17 Nov 2008 13:37:55 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Rights Metadata Cost

- +
- + + - - - + + + +
Rights MetadataRights Metadata
Cost:
Cost:
- -

#lorsm.lt_AddEdit_Rights_MD_Cos#

- + Index: openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_cost.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_cost.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_cost.tcl 15 May 2007 20:14:45 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_cost.tcl 17 Nov 2008 13:37:55 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/rightsmd/rights_cost.tcl ad_page_contract { - + Add/Edit Rights MD Cost - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -17,71 +17,73 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../rightsmd" ims_md_id] "[_ lorsm.Rights_MD]"] "[_ lorsm.AddEdit_Cost]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../rightsmd" ims_md_id] \ + "[_ lorsm.Rights_MD]"] \ + + "[_ lorsm.AddEdit_Cost]"] set title "[_ lorsm.lt_AddEdit_Rights_MD_Cos]" # Form -ad_form -name rightsmd_cost \ +ad_form \ + -name rightsmd_cost \ -cancel_url ../rightsmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + {cost_s:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} + {label "[_ lorsm.Source]"} + } - {cost_s:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} - {label "[_ lorsm.Source]"} - } + {cost_v:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Whether_use_of_the_re]"} + {label "[_ lorsm.Cost]"} + } - {cost_v:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Whether_use_of_the_re]"} - {label "[_ lorsm.Cost]"} - } - {ims_md_id:text(hidden) {value $ims_md_id}} + {ims_md_id:text(hidden) {value $ims_md_id}} -} -on_submit { - # check if the Rights Cost details already exist... + } -on_submit { + # check if the Rights Cost details already exist... - if {[db_0or1row select_type {select ims_md_id from ims_md_rights where ims_md_id = :ims_md_id}]} { + if {[db_0or1row select_type { + select ims_md_id + from ims_md_rights + where ims_md_id = :ims_md_id}]} { + db_dml do_update \ + "update ims_md_rights + set cost_s = :cost_s, + cost_v = :cost_v + where ims_md_id = :ims_md_id " + } else { + db_dml do_insert \ + "insert into ims_md_rights (ims_md_id, cost_s, cost_v) + values(:ims_md_id, :cost_s, :cost_v) " + } - db_dml do_update " - update ims_md_rights - set cost_s = :cost_s, cost_v = :cost_v - where ims_md_id = :ims_md_id " - - } else { - - db_dml do_insert " - insert into ims_md_rights (ims_md_id, cost_s, cost_v) - values - (:ims_md_id, :cost_s, :cost_v) " + } -after_submit { + ad_returnredirect [export_vars -base "../rightsmd" {ims_md_id}] + ad_script_abort } -} -after_submit { - ad_returnredirect [export_vars -base "../rightsmd" {ims_md_id}] - ad_script_abort -} - # Rights Cost template::list::create \ -name d_ri_cost \ -multirow d_ri_cost \ -no_data "[_ lorsm.No_Cost_Available]" \ -html { align right style "width: 100%;" } \ -elements { - cost { - label "[_ lorsm.Cost_1]" - } + cost { label "[_ lorsm.Cost_1]" } } db_multirow d_ri_cost select_ri_cost { - select - '[' || cost_s || '] ' || cost_v as cost, - ims_md_id - from - ims_md_rights - where - ims_md_id = :ims_md_id -} + select '[' || cost_s || '] ' || cost_v as cost, ims_md_id + from ims_md_rights + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_desc.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_desc.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_desc.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_desc.adp 17 Nov 2008 13:37:55 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Rights Metadata Description

- +
- + + - - - + + + +
Rights MetadataRights Metadata
Description:
Description:
- -

#lorsm.lt_AddEdit_Rights_MD_Des#

- + Index: openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_desc.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_desc.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_desc.tcl 15 May 2007 20:14:45 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/rightsmd/rights_desc.tcl 17 Nov 2008 13:37:55 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/rightsmd/rights_desc.tcl ad_page_contract { - + Add/Edit Rights MD Description - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -17,71 +17,71 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../rightsmd" ims_md_id] "[_ lorsm.Rights_MD]"] "[_ lorsm.AddEdit_Description]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../rightsmd" ims_md_id] \ + "[_ lorsm.Rights_MD]"] \ + + "[_ lorsm.AddEdit_Description]"] set title "[_ lorsm.lt_Edit_Rights_MD_Descri]" # Form -ad_form -name rightsmd_desc \ +ad_form \ + -name rightsmd_desc \ -cancel_url ../rightsmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + {descrip_l:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } - {descrip_l:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} - {label "[_ lorsm.Language]"} - } + {descrip_s:text(textarea),nospell + {html {rows 2 cols 50}} + {help_text "[_ lorsm.lt_Conditions_of_use_for]"} + {label "[_ lorsm.Description]"} + } - {descrip_s:text(textarea),nospell - {html {rows 2 cols 50}} - {help_text "[_ lorsm.lt_Conditions_of_use_for]"} - {label "[_ lorsm.Description]"} - } - {ims_md_id:text(hidden) {value $ims_md_id}} + {ims_md_id:text(hidden) {value $ims_md_id}} -} -on_submit { - # check if the Rights Description details already exist... + } -on_submit { + # check if the Rights Description details already exist... - if {[db_0or1row select_type {select ims_md_id from ims_md_rights where ims_md_id = :ims_md_id}]} { + if {[db_0or1row select_type {select ims_md_id from ims_md_rights where ims_md_id = :ims_md_id}]} { + db_dml do_update " + update ims_md_rights + set descrip_l = :descrip_l, + descrip_s = :descrip_s + where ims_md_id = :ims_md_id " - db_dml do_update " - update ims_md_rights - set descrip_l = :descrip_l, descrip_s = :descrip_s - where ims_md_id = :ims_md_id " + } else { + db_dml do_insert " + insert into ims_md_rights (ims_md_id, descrip_l, descrip_s) + values (:ims_md_id, :descrip_l, :descrip_s) " + } - } else { - - db_dml do_insert " - insert into ims_md_rights (ims_md_id, descrip_l, descrip_s) - values - (:ims_md_id, :descrip_l, :descrip_s) " + } -after_submit { + ad_returnredirect [export_vars -base "../rightsmd" {ims_md_id}] + ad_script_abort } -} -after_submit { - ad_returnredirect [export_vars -base "../rightsmd" {ims_md_id}] - ad_script_abort -} - # Rights Description template::list::create \ -name d_ri_desc \ -multirow d_ri_desc \ -no_data "[_ lorsm.lt_No_Description_Availa]" \ -html { align right style "width: 100%;" } \ -elements { - desc { - label "[_ lorsm.Description_1]" - } + desc { label "[_ lorsm.Description_1]" } } db_multirow d_ri_desc select_ri_desc { - select - '[' || descrip_l || '] ' || descrip_s as desc, - ims_md_id - from - ims_md_rights - where - ims_md_id = :ims_md_id -} + select '[' || descrip_l || '] ' || descrip_s as desc, ims_md_id + from ims_md_rights + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_dur.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_dur.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_dur.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_dur.adp 17 Nov 2008 13:37:55 -0000 1.4 @@ -2,24 +2,23 @@ @title;noquote@ @context;noquote@ - +

Technical Metadata Duration

- +
- + + - - - -
Technical MetadataTechnical Metadata
Duration:
+ Duration: + + +

#lorsm.lt_AddEdit_Technical_MD_#

- + Index: openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_dur.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_dur.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_dur.tcl 15 May 2007 20:14:45 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_dur.tcl 17 Nov 2008 13:37:55 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/technicalmd/technical_dur.tcl ad_page_contract { - + Add/Edit Technical MD Duration - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -17,87 +17,80 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../technicalmd" \\\i\\m\\s_md_id] "[_ lorsm.Technical_MD]"] "[_ lorsm.AddEdit_Duration]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../technicalmd" \\\i\\m\\s_md_id] \ + "[_ lorsm.Technical_MD]"] \ + + "[_ lorsm.AddEdit_Duration]"] set title "[_ lorsm.lt_Edit_Technical_MD_Dur]" # Form - -ad_form -name technicalmd_dur \ +ad_form \ + -name technicalmd_dur \ -cancel_url ../technicalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + {duration:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Time_the_continuous_l]"} + {label "[_ lorsm.Duration] "} + } - {duration:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Time_the_continuous_l]"} - {label "[_ lorsm.Duration] "} - } + {duration_l:text,nospell,optional + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } - {duration_l:text,nospell,optional - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} - {label "[_ lorsm.Language]"} - } + {duration_s:text,nospell,optional + {html {size 10}} + {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} + {label "[_ lorsm.Source]"} + } - {duration_s:text,nospell,optional - {html {size 10}} - {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} - {label "[_ lorsm.Source]"} - } - {ims_md_id:text(hidden) {value $ims_md_id}} + {ims_md_id:text(hidden) {value $ims_md_id}} -} -on_submit { - # check if the tech duration details already exist... + } -on_submit { + # check if the tech duration details already exist... - if {[db_0or1row select_duration {select ims_md_id from ims_md_technical where ims_md_id = :ims_md_id}]} { + if {[db_0or1row select_duration { + select ims_md_id + from ims_md_technical + where ims_md_id = :ims_md_id}]} { + db_dml do_update \ + "update ims_md_technical + set duration_s = :duration_s, + duration_l = :duration_l, + duration = :duration + where ims_md_id = :ims_md_id " + } else { + db_dml do_insert \ + "insert into ims_md_technical (ims_md_id, duration_l, duration_s) + values (:ims_md_id, :duration_l, :duration_s)" + } - db_dml do_update " - update ims_md_technical - set duration_s = :duration_s, - duration_l = :duration_l, - duration = :duration - where ims_md_id = :ims_md_id " - - } else { - - db_dml do_insert " - insert into ims_md_technical (ims_md_id, duration_l, duration_s) - values - (:ims_md_id, :duration_l, :duration_s)" + } -after_submit { + ad_returnredirect [export_vars -base "../technicalmd" {ims_md_id}] + ad_script_abort } -} -after_submit { - ad_returnredirect [export_vars -base "../technicalmd" {ims_md_id}] - ad_script_abort -} - # Technical Duration template::list::create \ -name d_te_dur \ -multirow d_te_dur \ -no_data "[_ lorsm.lt_No_Duration_Available]" \ -html { align right style "width: 100%;" } \ -elements { - duration_sec { - label "[_ lorsm.Duration_Seconds]" - } - duration_l { - label "[_ lorsm.Language_1]" - } - duration_s { - label "[_ lorsm.Source_1]" - } - + duration_sec { label "[_ lorsm.Duration_Seconds]" } + duration_l { label "[_ lorsm.Language_1]" } + duration_s { label "[_ lorsm.Source_1]" } } db_multirow d_te_dur select_te_dur { - select - duration_l, - duration_s, - duration || 's' as duration_sec, - ims_md_id - from - ims_md_technical - where - ims_md_id = :ims_md_id -} + select duration_l, duration_s, duration || 's' as duration_sec, ims_md_id + from ims_md_technical + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_form.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_form.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_form.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_form.adp 17 Nov 2008 13:37:55 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Technical Metadata Format

- +
- + + - - - + + + +
Technical MetadataTechnical Metadata
Formats:
Formats:
- -

#lorsm.lt_AddEdit_Technical_MD__1#

- + Index: openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_form.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_form.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_form.tcl 15 May 2007 20:14:45 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_form.tcl 17 Nov 2008 13:37:55 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/technicalmd/technical_form.tcl ad_page_contract { - + Add/Edit Technical MD Format - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -19,48 +19,62 @@ # set context & title if { ![ad_form_new_p -key ims_md_te_fo_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "I[_ lorsm.MS_Metadata_Editor]"] [list [export_vars -base "../technicalmd" im\s_md_id] "[_ lorsm.Technical_MD]"] "[_ lorsm.Edit_Format]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "I[_ lorsm.MS_Metadata_Editor]"] \ + + [list [export_vars -base "../technicalmd" im\s_md_id] \ + "[_ lorsm.Technical_MD]"] \ + "[_ lorsm.Edit_Format]"] set title "[_ lorsm.lt_Edit_Technical_MD_For]" } else { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../technicalmd" im\s_md_id] "[_ lorsm.Technical_MD]"] "[_ lorsm.Add_Format]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../technicalmd" im\s_md_id] \ + "[_ lorsm.Technical_MD]"] \ + "[_ lorsm.Add_Format]"] set title "[_ lorsm.lt_Add_Technical_MD_Form]" } # Form - -ad_form -name technicalmd_form \ +ad_form \ + -name technicalmd_form \ -cancel_url ../technicalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + ims_md_te_fo_id:key(ims_md_technical_format_seq) - ims_md_te_fo_id:key(ims_md_technical_format_seq) + {format:text,nospell + {html {size 30}} + {help_text "[_ lorsm.lt_Technical_data_type_o]"} + {label "[_ lorsm.Format]"} + } - {format:text,nospell - {html {size 30}} - {help_text "[_ lorsm.lt_Technical_data_type_o]"} - {label "[_ lorsm.Format]"} - } + {ims_md_id:text(hidden) {value $ims_md_id}} - {ims_md_id:text(hidden) {value $ims_md_id}} - -} -select_query {select * from ims_md_technical_format where ims_md_te_fo_id = :ims_md_te_fo_id and ims_md_id = :ims_md_id + } -select_query { + select * + from ims_md_technical_format + where ims_md_te_fo_id = :ims_md_te_fo_id + and ims_md_id = :ims_md_id -} -edit_data { - db_dml do_update " - update ims_md_technical_format + } -edit_data { + db_dml do_update \ + "update ims_md_technical_format set format = :format where ims_md_te_fo_id = :ims_md_te_fo_id " -} -new_data { - db_dml do_insert " - insert into ims_md_technical_format (ims_md_te_fo_id, ims_md_id, format) - values - (:ims_md_te_fo_id, :ims_md_id, :format)" + } -new_data { + db_dml do_insert \ + "insert into ims_md_technical_format (ims_md_te_fo_id, ims_md_id, format) + values(:ims_md_te_fo_id, :ims_md_id, :format)" -} -after_submit { - ad_returnredirect [export_vars -base "../technicalmd" {ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars -base "../technicalmd" {ims_md_id}] ad_script_abort -} + } # Technical Format template::list::create \ @@ -69,23 +83,19 @@ -no_data "[_ lorsm.No_Format_Available]" \ -html { align right style "width: 100%;" } \ -elements { - format { - label "[_ lorsm.Format_1]" - } + format { label "[_ lorsm.Format_1]" } export { display_eval {\[Edit\]} - link_url_eval { [export_vars -base "technical_form" {ims_md_te_fo_id ims_md_id}] } + link_url_eval { [export_vars \ + -base "technical_form" \ + {ims_md_te_fo_id ims_md_id}] } link_html {title "[_ lorsm.Edit_Record]"} html { align center } } } db_multirow d_te_form select_te_form { - select format, - ims_md_te_fo_id, - ims_md_id - from - ims_md_technical_format - where - ims_md_id = :ims_md_id -} + select format, ims_md_te_fo_id, ims_md_id + from ims_md_technical_format + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_inst.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_inst.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_inst.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_inst.adp 17 Nov 2008 13:37:55 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Technical Metadata Installation Remarks

- +
- + + - - - + + + +
Technical MetadataTechnical Metadata
Installation Remarks:
Installation Remarks:
- -

#lorsm.lt_AddEdit_Technical_MD__2#

- + Index: openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_inst.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_inst.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_inst.tcl 15 May 2007 20:14:45 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_inst.tcl 17 Nov 2008 13:37:55 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/technicalmd/technical_inst.tcl ad_page_contract { - + Add/Edit Technical MD Installation Remarks - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -17,71 +17,68 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../technicalmd" \\\im\\s_md_id] "[_ lorsm.Technical_MD]"] "[_ lorsm.lt_Edit_Installation_Rem]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../technicalmd" \\\im\\s_md_id] \ + "[_ lorsm.Technical_MD]"] \ + + "[_ lorsm.lt_Edit_Installation_Rem]"] set title "[_ lorsm.lt_AddEdit_Technical_MD__2]" # Form - -ad_form -name technicalmd_inst \ +ad_form \ + -name technicalmd_inst \ -cancel_url ../technicalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + {instl_rmrks_l:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } - {instl_rmrks_l:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} - {label "[_ lorsm.Language]"} - } + {instl_rmrks_s:text(textarea),nospell + {html {rows 5 cols 60}} + {help_text "[_ lorsm.lt_Information_on_how_to]"} + {label "[_ lorsm.Installation_Remarks]"} + } - {instl_rmrks_s:text(textarea),nospell - {html {rows 5 cols 60}} - {help_text "[_ lorsm.lt_Information_on_how_to]"} - {label "[_ lorsm.Installation_Remarks]"} - } - {ims_md_id:text(hidden) {value $ims_md_id}} + {ims_md_id:text(hidden) {value $ims_md_id}} -} -on_submit { - # check if the tech size details already exist... + } -on_submit { + # check if the tech size details already exist... + if {[db_0or1row select_size {select ims_md_id from ims_md_technical where ims_md_id = :ims_md_id}]} { + db_dml do_update \ + "update ims_md_technical + set instl_rmrks_l = :instl_rmrks_l, + instl_rmrks_s = :instl_rmrks_s + where ims_md_id = :ims_md_id" - if {[db_0or1row select_size {select ims_md_id from ims_md_technical where ims_md_id = :ims_md_id}]} { + } else { + db_dml do_insert \ + "insert into ims_md_technical (ims_md_id, instl_rmrks_l, instl_rmrks_s) + values(:ims_md_id, :instl_rmrks_l, :instl_rmrks_s) " + } - db_dml do_update " - update ims_md_technical - set instl_rmrks_l = :instl_rmrks_l, - instl_rmrks_s = :instl_rmrks_s - where ims_md_id = :ims_md_id " - - } else { - - db_dml do_insert " - insert into ims_md_technical (ims_md_id, instl_rmrks_l, instl_rmrks_s) - values - (:ims_md_id, :instl_rmrks_l, :instl_rmrks_s) " + } -after_submit { + ad_returnredirect [export_vars -base "../technicalmd" {ims_md_id}] + ad_script_abort } -} -after_submit { - ad_returnredirect [export_vars -base "../technicalmd" {ims_md_id}] - ad_script_abort -} - # Technical Installation Remarks template::list::create \ -name d_te_inst \ -multirow d_te_inst \ -no_data "[_ lorsm.lt_No_Installation_Remar]" \ -html { align right style "width: 100%;" } \ -elements { - instl_rmrks { - label "[_ lorsm.Installation_Remarks_1]" - } + instl_rmrks { label "[_ lorsm.Installation_Remarks_1]" } } db_multirow d_te_inst select_te_inst { - select - '[' || instl_rmrks_l || ']' || ' ' || instl_rmrks_s as instl_rmrks, - ims_md_id - from - ims_md_technical - where - ims_md_id = :ims_md_id -} + select '[' || instl_rmrks_l || ']' || ' ' || instl_rmrks_s as instl_rmrks, ims_md_id + from ims_md_technical + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_loca.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_loca.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_loca.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_loca.adp 17 Nov 2008 13:37:55 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

List of Technical Metadata Locations

- +
- + + - - - + + + +
Technical MetadataTechnical Metadata
Locations:
Locations:
- -

#lorsm.lt_AddEdit_Technical_MD__3#

- + Index: openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_loca.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_loca.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_loca.tcl 15 May 2007 20:14:46 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_loca.tcl 17 Nov 2008 13:37:55 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/technicalmd/technical_loca.tcl ad_page_contract { - + Add/Edit Technical MD Location - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -19,57 +19,72 @@ # set context & title if { ![ad_form_new_p -key ims_md_te_lo_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../technicalmd" \im\\s_md_id] "[_ lorsm.Technical_MD]"] " [_ lorsm.Edit_Location]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../technicalmd" \im\\s_md_id] \ + "[_ lorsm.Technical_MD]"] \ + + " [_ lorsm.Edit_Location]"] set title "[_ lorsm.lt_Edit_Technical_MD_Loc]" } else { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../technicalmd" \im\\s_md_id] "[_ lorsm.Technical_MD]"] "[_ lorsm.Add_Location]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../technicalmd" \im\\s_md_id] \ + "[_ lorsm.Technical_MD]"] \ + + "[_ lorsm.Add_Location]"] set title "[_ lorsm.lt_Add_Technical_MD_Loca]" } # Form - -ad_form -name technicalmd_loca \ +ad_form \ + -name technicalmd_loca \ -cancel_url ../technicalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + ims_md_te_lo_id:key(ims_md_technical_location_seq) - ims_md_te_lo_id:key(ims_md_technical_location_seq) + {type:text,nospell,optional + {html {size 10}} + {help_text "[_ lorsm.lt_Reference_to_location]"} + {label "[_ lorsm.Type_1]"} + } - {type:text,nospell,optional - {html {size 10}} - {help_text "[_ lorsm.lt_Reference_to_location]"} - {label "[_ lorsm.Type_1]"} - } + {location:text,nospell + {html {size 50}} + {help_text "[_ lorsm.lt_Location_of_the_resou]"} + {label "[_ lorsm.Location_1]"} + } - {location:text,nospell - {html {size 50}} - {help_text "[_ lorsm.lt_Location_of_the_resou]"} - {label "[_ lorsm.Location_1]"} - } + {ims_md_id:text(hidden) {value $ims_md_id}} - {ims_md_id:text(hidden) {value $ims_md_id} - } - -} -select_query {select * from ims_md_technical_location where ims_md_te_lo_id = :ims_md_te_lo_id and ims_md_id = :ims_md_id + } -select_query { + select * + from ims_md_technical_location + where ims_md_te_lo_id = :ims_md_te_lo_id + and ims_md_id = :ims_md_id -} -edit_data { - db_dml do_update " - update ims_md_technical_location + } -edit_data { + db_dml do_update \ + "update ims_md_technical_location set type = :type, - location = :location + location = :location where ims_md_te_lo_id = :ims_md_te_lo_id " -} -new_data { - db_dml do_insert " - insert into ims_md_technical_location (ims_md_te_lo_id, ims_md_id, type, location) - values - (:ims_md_te_lo_id, :ims_md_id, :type, :location)" + } -new_data { + db_dml do_insert \ + "insert into ims_md_technical_location (ims_md_te_lo_id, ims_md_id, type, location) + values(:ims_md_te_lo_id, :ims_md_id, :type, :location)" -} -after_submit { - ad_returnredirect [export_vars -base "../technicalmd" {ims_md_id}] + } -after_submit { + ad_returnredirect [export_vars -base "../technicalmd" {ims_md_id}] ad_script_abort -} + } # Technical Location template::list::create \ @@ -78,27 +93,20 @@ -no_data "[_ lorsm.lt_No_Location_Available]" \ -html { align right style "width: 100%;" } \ -elements { - type { - label "[_ lorsm.Type]" - } - location { - label "[_ lorsm.Location]" - } + type { label "[_ lorsm.Type]" } + location { label "[_ lorsm.Location]" } export { display_eval {\[Edit\]} - link_url_eval { [export_vars -base "technical_loca" {ims_md_te_lo_id ims_md_id}] } + link_url_eval { [export_vars \ + -base "technical_loca" \ + {ims_md_te_lo_id ims_md_id}] } link_html {title "[_ lorsm.Edit_Record]"} html { align center } } } db_multirow d_te_loca select_te_loca { - select type, - location, - ims_md_te_lo_id, - ims_md_id - from - ims_md_technical_location - where - ims_md_id = :ims_md_id -} + select type, location, ims_md_te_lo_id, ims_md_id + from ims_md_technical_location + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_otr.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_otr.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_otr.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_otr.adp 17 Nov 2008 13:37:55 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Technical Metadata Other Platform Requirements

- +
- + + - - - + + + +
Technical MetadataTechnical Metadata
Other Platform Requirements:
Other Platform Requirements:
- -

#lorsm.lt_AddEdit_Technical_MD__4#

- + Index: openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_otr.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_otr.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_otr.tcl 15 May 2007 20:14:46 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_otr.tcl 17 Nov 2008 13:37:55 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/technicalmd/technical_otr.tcl ad_page_contract { - + Add/Edit Technical MD Other Platform Requirements - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -17,71 +17,71 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../technicalmd" \\\i\m\\s_md_id] "[_ lorsm.Technical_MD]"] "[_ lorsm.lt_AddEdit_Other_Platfor]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../technicalmd" \\\i\m\\s_md_id] \ + "[_ lorsm.Technical_MD]"] \ + + "[_ lorsm.lt_AddEdit_Other_Platfor]"] set title "[_ lorsm.lt_AddEdit_Technical_MD__4]" # Form - -ad_form -name technicalmd_otr \ +ad_form \ + -name technicalmd_otr \ -cancel_url ../technicalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + {otr_plt_l:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } - {otr_plt_l:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} - {label "[_ lorsm.Language]"} - } + {otr_plt_s:text(textarea),nospell + {html {rows 5 cols 60}} + {help_text "[_ lorsm.lt_Information_on_other_]"} + {label "[_ lorsm.lt_Other_Platform_Requir]"} + } - {otr_plt_s:text(textarea),nospell - {html {rows 5 cols 60}} - {help_text "[_ lorsm.lt_Information_on_other_]"} - {label "[_ lorsm.lt_Other_Platform_Requir]"} - } - {ims_md_id:text(hidden) {value $ims_md_id}} + {ims_md_id:text(hidden) {value $ims_md_id}} -} -on_submit { - # check if the tech other platform req details already exist... + } -on_submit { + # check if the tech other platform req details already exist... - if {[db_0or1row select_size {select ims_md_id from ims_md_technical where ims_md_id = :ims_md_id}]} { + if {[db_0or1row select_size { + select ims_md_id + from ims_md_technical + where ims_md_id = :ims_md_id}]} { + db_dml do_update " + update ims_md_technical + set otr_plt_l = :otr_plt_l, + otr_plt_s = :otr_plt_s + where ims_md_id = :ims_md_id " + } else { + db_dml do_insert " + insert into ims_md_technical (ims_md_id, otr_plt_l, otr_plt_s) + values(:ims_md_id, :otr_plt_l, :otr_plt_s)" + } - db_dml do_update " - update ims_md_technical - set otr_plt_l = :otr_plt_l, - otr_plt_s = :otr_plt_s - where ims_md_id = :ims_md_id " - - } else { - - db_dml do_insert " - insert into ims_md_technical (ims_md_id, otr_plt_l, otr_plt_s) - values - (:ims_md_id, :otr_plt_l, :otr_plt_s)" + } -after_submit { + ad_returnredirect [export_vars -base "../technicalmd" {ims_md_id}] + ad_script_abort } -} -after_submit { - ad_returnredirect [export_vars -base "../technicalmd" {ims_md_id}] - ad_script_abort -} - # Technical Installation Remarks template::list::create \ -name d_te_otr \ -multirow d_te_otr \ -no_data "[_ lorsm.lt_No_Other_Platform_Req]" \ -html { align right style "width: 100%;" } \ -elements { - otr_plt { - label "[_ lorsm.Other_Platform_Req]" - } + otr_plt { label "[_ lorsm.Other_Platform_Req]" } } db_multirow d_te_otr select_te_otr { - select - '[' || otr_plt_l || ']' || ' ' || otr_plt_s as otr_plt, - ims_md_id - from - ims_md_technical - where - ims_md_id = :ims_md_id -} + select '[' || otr_plt_l || ']' || ' ' || otr_plt_s as otr_plt, ims_md_id + from ims_md_technical + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_req.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_req.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_req.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_req.adp 17 Nov 2008 13:37:55 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

List of Technical Metadata Requirements

- +
- + + - - - + + + +
Technical MetadataTechnical Metadata
Requirements:
Requirements:
- -

#lorsm.lt_AddEdit_Technical_MD__5#

- + Index: openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_req.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_req.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_req.tcl 15 May 2007 20:14:46 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_req.tcl 17 Nov 2008 13:37:55 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/technicalmd/technical_req.tcl ad_page_contract { - + Add/Edit Technical MD Requirement - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -19,81 +19,94 @@ # set context & title if { ![ad_form_new_p -key ims_md_te_rq_id]} { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../technicalmd" \\im\\s_md_id] "[_ lorsm.Technical_MD]"] "[_ lorsm.Edit_Requirement]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../technicalmd" \\im\\s_md_id] \ + "[_ lorsm.Technical_MD]"] \ + + "[_ lorsm.Edit_Requirement]"] set title "[_ lorsm.lt_Edit_Technical_MD_Req]" } else { - set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../technicalmd" \\im\\s_md_id] "[_ lorsm.Technical_MD]"] "[_ lorsm.Add_Requirement]"] + set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../technicalmd" \\im\\s_md_id] \ + "[_ lorsm.Technical_MD]"] \ + + "[_ lorsm.Add_Requirement]"] set title "[_ lorsm.lt_Add_Technical_MD_Requ]" } # Form -ad_form -name technicalmd_req \ +ad_form \ + -name technicalmd_req \ -cancel_url ../technicalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + ims_md_te_rq_id:key(ims_md_technical_requirement_seq) - ims_md_te_rq_id:key(ims_md_technical_requirement_seq) + {type_s:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} + {label "[_ lorsm.Source]"} + } - {type_s:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Source_of_vocabulary_]"} - {label "[_ lorsm.Source]"} - } + {type_v:text,nospell + {html {size 20}} + {help_text "[_ lorsm.Type_of_requirement]"} + {label "[_ lorsm.Type_1]"} + } - {type_v:text,nospell - {html {size 20}} - {help_text "[_ lorsm.Type_of_requirement]"} - {label "[_ lorsm.Type_1]"} - } - - {name_v:text,nospell - {html {size 20}} - {help_text "[_ lorsm.lt_Name_of_required_item]"} - {label "[_ lorsm.Name_1]"} - } - - {min_version:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Lowest_version_of_the]"} - {label "[_ lorsm.Minimum_Version]"} - } + {name_v:text,nospell + {html {size 20}} + {help_text "[_ lorsm.lt_Name_of_required_item]"} + {label "[_ lorsm.Name_1]"} + } - {max_version:text,nospell - {html {size 10}} - {help_text "[_ lorsm.lt_Highest_version_of_th]"} - {label "[_ lorsm.Maximum_Version]"} - } + {min_version:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Lowest_version_of_the]"} + {label "[_ lorsm.Minimum_Version]"} + } - {ims_md_id:text(hidden) {value $ims_md_id} - } + {max_version:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Highest_version_of_th]"} + {label "[_ lorsm.Maximum_Version]"} + } -} -select_query { - select * from - ims_md_technical_requirement - where - ims_md_te_rq_id = :ims_md_te_rq_id and ims_md_id = :ims_md_id + {ims_md_id:text(hidden) {value $ims_md_id}} -} -edit_data { - db_dml do_update " - update ims_md_technical_requirement - set type_v = :type_v, - type_s = :type_s, - name_v = :name_v, - name_s = :type_s, - min_version = :min_version, - max_version = :max_version + } -select_query { + select * + from ims_md_technical_requirement + where ims_md_te_rq_id = :ims_md_te_rq_id + and ims_md_id = :ims_md_id + + } -edit_data { + db_dml do_update \ + "update ims_md_technical_requirement + set type_v = :type_v, + type_s = :type_s, + name_v = :name_v, + name_s = :type_s, + min_version = :min_version, + max_version = :max_version where ims_md_te_rq_id = :ims_md_te_rq_id" - -} -new_data { - db_dml do_insert " - insert into ims_md_technical_requirement (ims_md_te_rq_id, ims_md_id, type_s, type_v, name_s, name_v, min_version, max_version) - values (:ims_md_te_rq_id, :ims_md_id, :type_s, :type_v, :type_s, :name_v, :min_version, :max_version)" - -} -after_submit { - ad_returnredirect [export_vars -base "../technicalmd" {ims_md_id}] + + } -new_data { + db_dml do_insert \ + "insert into ims_md_technical_requirement (ims_md_te_rq_id, ims_md_id, type_s, type_v, name_s, name_v, min_version, max_version) + values (:ims_md_te_rq_id, :ims_md_id, :type_s, :type_v, :type_s, :name_v, :min_version, :max_version)" + + } -after_submit { + ad_returnredirect [export_vars -base "../technicalmd" {ims_md_id}] ad_script_abort -} + } # Technical Requirements template::list::create \ @@ -102,37 +115,24 @@ -no_data "No Requirements Available" \ -html { align right style "width: 100%;" } \ -elements { - type { - label "[_ lorsm.Type]" - } - name { - label "[_ lorsm.Name]" - } - min_version { - label "[_ lorsm.Min_Version]" - } - max_version { - label "[_ lorsm.Max_Version]" - } + type { label "[_ lorsm.Type]" } + name { label "[_ lorsm.Name]" } + min_version { label "[_ lorsm.Min_Version]" } + max_version { label "[_ lorsm.Max_Version]" } export { display_eval {\[Edit\]} - link_url_eval { [export_vars -base "technical_req" {ims_md_te_rq_id ims_md_id}] } + link_url_eval { [export_vars \ + -base "technical_req" \ + {ims_md_te_rq_id ims_md_id}] } link_html {title "[_ lorsm.Edit_Record] "} html { align center } } } db_multirow d_te_req select_te_req { - select - '[' || type_s || ']' || ' ' || type_v as type, - '[' || name_s || ']' || ' ' || name_v as name, - min_version, - max_version, - ims_md_te_rq_id, - ims_md_id - from - ims_md_technical_requirement - where - ims_md_id = :ims_md_id + select '[' || type_s || ']' || ' ' || type_v as type, + '[' || name_s || ']' || ' ' || name_v as name, + min_version, max_version, ims_md_te_rq_id, ims_md_id + from ims_md_technical_requirement + where ims_md_id = :ims_md_id } - Index: openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_size.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_size.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_size.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_size.adp 17 Nov 2008 13:37:55 -0000 1.4 @@ -2,25 +2,23 @@ @title;noquote@ @context;noquote@ - +

Technical Metadata Size

- +
- + + - - - + + + +
Technical MetadataTechnical Metadata
Size:
Size:
- -

#lorsm.lt_AddEdit_Technical_MD__6#

- + Index: openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_size.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_size.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_size.tcl 15 May 2007 20:14:46 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/md/technicalmd/technical_size.tcl 17 Nov 2008 13:37:55 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/md/technicalmd/technical_size.tcl ad_page_contract { - + Add/Edit Technical MD Size - + @author Gerard Low (glow5809@mail.usyd.edu.au) @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 16 October 2004 @@ -17,56 +17,60 @@ } # set context & title -set context [list [list [export_vars -base ".." ims_md_id] "[_ lorsm.IMS_Metadata_Editor]"] [list [export_vars -base "../technicalmd" \im\s_md_id] "[_ lorsm.Technical_MD]"] "[_ lorsm.Edit_Size]"] +set context [list \ + [list [export_vars -base ".." ims_md_id] \ + "[_ lorsm.IMS_Metadata_Editor]"] \ + + [list [export_vars -base "../technicalmd" \im\s_md_id] \ + "[_ lorsm.Technical_MD]"] \ + + "[_ lorsm.Edit_Size]"] set title "[_ lorsm.lt_AddEdit_Technical_MD__6]" # Form - -ad_form -name technicalmd_size \ +ad_form \ + -name technicalmd_size \ -cancel_url ../technicalmd?ims_md_id=$ims_md_id \ -mode edit \ -form { + {t_size:text,nospell + {html {size 30}} + {help_text "[_ lorsm.lt_Size_of_the_resource_]"} + {label "[_ lorsm.Size]"} + } - {t_size:text,nospell - {html {size 30}} - {help_text "[_ lorsm.lt_Size_of_the_resource_]"} - {label "[_ lorsm.Size]"} - } - {ims_md_id:text(hidden) {value $ims_md_id}} + {ims_md_id:text(hidden) {value $ims_md_id}} -} -on_submit { - # check if the tech size details already exist... + } -on_submit { + # check if the tech size details already exist... - if {[db_0or1row select_size {select ims_md_id from ims_md_technical where ims_md_id = :ims_md_id}]} { + if {[db_0or1row select_size { + select ims_md_id + from ims_md_technical + where ims_md_id = :ims_md_id}]} { + db_dml do_update \ + "update ims_md_technical + set t_size = :t_size + where ims_md_id = :ims_md_id " + } else { + db_dml do_insert \ + "insert into ims_md_technical (ims_md_id, t_size) + values (:ims_md_id, :t_size) " + } - db_dml do_update " - update ims_md_technical - set t_size = :t_size - where ims_md_id = :ims_md_id " - - } else { - - db_dml do_insert " - insert into ims_md_technical (ims_md_id, t_size) - values - (:ims_md_id, :t_size) " + } -after_submit { + ad_returnredirect [export_vars -base "../technicalmd" {ims_md_id}] + ad_script_abort } -} -after_submit { - ad_returnredirect [export_vars -base "../technicalmd" {ims_md_id}] - ad_script_abort -} - # Technical Size template::list::create \ -name d_te_size \ -multirow d_te_size \ -no_data "[_ lorsm.No_Size_Available]" \ -html { align right style "width: 100%;" } \ -elements { - t_size_bytes { - label "[_ lorsm.Size_1]" - } + t_size_bytes { label "[_ lorsm.Size_1]" } export { display_eval {\[Edit\]} link_url_eval { [export_vars -base "technical_size" {ims_md_id}] } @@ -76,10 +80,7 @@ } db_multirow d_te_size select_te_size { - select t_size || ' bytes' as t_size_bytes, - ims_md_id - from - ims_md_technical - where - ims_md_id = :ims_md_id -} + select t_size || ' bytes' as t_size_bytes, ims_md_id + from ims_md_technical + where ims_md_id = :ims_md_id +} Index: openacs-4/packages/lorsm/www/admin/shared/add-shared-course-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/shared/add-shared-course-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/shared/add-shared-course-2.tcl 31 Dec 2006 00:36:08 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/shared/add-shared-course-2.tcl 17 Nov 2008 13:37:55 -0000 1.2 @@ -1,9 +1,9 @@ # packages/lorsm/www/shared/add-shared-course-2.tcl ad_page_contract { - + Adds an existing course to a .LRN class - + @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 2004-07-13 @arch-tag: efa8621f-daa6-4743-9711-28a4195232ec @@ -22,26 +22,32 @@ set class_key [dotlrn_community::get_community_type_from_community_id $community_id] # check if the course is actually shared -if {[db_string isshared {select isshared from ims_cp_manifests where man_id = :man_id}] == "f"} { +if {[db_string isshared \ + {select isshared + from ims_cp_manifests + where man_id = :man_id}] == "f"} { + # if it ain't complain and quit ad_complain "[_ lorsm.lt_The_course_you_are_tr]" } # check if the course is already added as course for this class -if {![db_0or1row exists {select man_id, lorsm_instance_id from ims_cp_manifest_class where man_id = :man_id \ - and lorsm_instance_id = :package_id \ - and community_id = :community_id}]} { +if {![db_0or1row exists \ + {select man_id, lorsm_instance_id + from ims_cp_manifest_class + where man_id = :man_id + and lorsm_instance_id = :package_id + and community_id = :community_id}]} { + set var1 [lorsm::get_course_name -manifest_id $man_id] ad_complain "[_ lorsm.lt_The_course_var1_is_al]" - - } -db_dml add-course {insert into ims_cp_manifest_class \ - (man_id, lorsm_instance_id, community_id, class_key, isenabled, istrackable) \ - values \ - (:man_id, :package_id, :community_id, :class_key, 't', 'f')} +db_dml add-course \ + {insert into ims_cp_manifest_class + (man_id, lorsm_instance_id, community_id, class_key, isenabled, istrackable) + values (:man_id, :package_id, :community_id, :class_key, 't', 'f')} ad_returnredirect $return_url Index: openacs-4/packages/lorsm/www/admin/shared/add-shared-course.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/shared/add-shared-course.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/shared/add-shared-course.adp 31 Dec 2006 00:36:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/shared/add-shared-course.adp 17 Nov 2008 13:37:55 -0000 1.2 @@ -1,14 +1,12 @@ - @title@ - @context@ +@title@ +@context@

#lorsm.lt_You_are_about_to_add_#

-#lorsm.Confirm_q# -

- - - -
- - + #lorsm.Confirm_q# +
+ + + +
Index: openacs-4/packages/lorsm/www/admin/shared/add-shared-course.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/shared/add-shared-course.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/shared/add-shared-course.tcl 31 Dec 2006 00:36:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/shared/add-shared-course.tcl 17 Nov 2008 13:37:55 -0000 1.2 @@ -1,9 +1,9 @@ # packages/lorsm/www/shared/add-shared-course.tcl ad_page_contract { - + Adds an existing shared course to a .LRN class - + @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 2004-07-12 @arch-tag: 9f1edd88-ff55-4328-8f3b-6d014351e48a @@ -21,26 +21,32 @@ set class_key [dotlrn_community::get_community_type_from_community_id $community_id] # check if the course is actually shared -if {[db_string isshared {select isshared from ims_cp_manifests where man_id = :man_id}] == "f"} { +if {[db_string isshared \ + {select isshared + from ims_cp_manifests + where man_id = :man_id}] == "f"} { # if it ain't complain and quit ad_complain "[_ lorsm.lt_The_course_you_are_tr]" - } # check if the course is already added as course for this class -if {![db_0or1row exists {select man_id, lorsm_instance_id from ims_cp_manifest_class where man_id = :man_id \ - and lorsm_instance_id = :package_id \ - and community_id = :community_id}]} { +if {![db_0or1row exists \ + {select man_id, lorsm_instance_id + from ims_cp_manifest_class + where man_id = :man_id + and lorsm_instance_id = :package_id + and community_id = :community_id}]} { ad_complain "The course [lorsm::get_course_name -manifest_id $man_id], is already part of your class" - - } set title "[_ lorsm.lt_Add_Course_Confirmati]" set course_name [lorsm::get_course_name -manifest_id $man_id] -set context [list [list [export_vars -base .] "[_ lorsm.Shared_Courses]"] [list [export_vars -base course-info {man_id}] "[_ lorsm.lt_Preview_Course_course]"] "[_ lorsm.Confirmation]"] +set context [list \ + [list [export_vars -base .] "[_ lorsm.Shared_Courses]"] \ + [list [export_vars -base course-info {man_id}] \ + "[_ lorsm.lt_Preview_Course_course]"] \ + "[_ lorsm.Confirmation]"] set return_url [site_node::get_url_from_object_id -object_id $package_id] - Index: openacs-4/packages/lorsm/www/admin/shared/course-info.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/shared/course-info.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/shared/course-info.adp 17 Oct 2008 10:46:31 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/shared/course-info.adp 17 Nov 2008 13:37:55 -0000 1.3 @@ -1,122 +1,83 @@ - @title;noquote@ - @context;noquote@ +@title;noquote@ +@context;noquote@ - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + - + + - + - - - - - - -
- #lorsm.Course_Information# - #lorsm.Course_Information#
- #lorsm.Course_Name# - - @course_name;noquote@ -
- #lorsm.Version# - - @version;noquote@ -
- #lorsm.Metadata# - - - #lorsm.Yes# - - - #lorsm.No# - -
- #lorsm.Identifier# - - @identifier@ -
- #lorsm.Is_SCORM# - - #lorsm.lt_classlist_stylefont-w# - - - class="list" - - valign="top" align="left">@isscorm;noquote@ -
- #lorsm.Created_By# - - @created_by@ -
- #lorsm.Date# - - @creation_date;noquote@ -
- #lorsm.Submanifests# - - @submanifests@ -
#lorsm.Course_Name#@course_name;noquote@
#lorsm.Version#@version;noquote@
#lorsm.Metadata# + + #lorsm.Yes# + + + #lorsm.No# + +
#lorsm.Identifier#@identifier@
#lorsm.Is_SCORM##lorsm.lt_classlist_stylefont-w#class="list"valign="top" align="left">@isscorm;noquote@
#lorsm.Created_By#@created_by@
#lorsm.Date#@creation_date;noquote@
#lorsm.Submanifests#@submanifests@
- #lorsm.lt_Add_course_to_my_clas# - - - #lorsm.lt_Add_course_to_my_clas# + + - #lorsm.lt_Course_already_part_o# - #lorsm.lt_Course_already_part_o#
- #lorsm.Organizations# - #lorsm.Organizations#
-
- @orgs_list;noquote@ -
+ + + + + @orgs_list;noquote@ + +
Index: openacs-4/packages/lorsm/www/admin/shared/course-info.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/shared/course-info.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/shared/course-info.tcl 31 Dec 2006 00:36:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/shared/course-info.tcl 17 Nov 2008 13:37:55 -0000 1.2 @@ -1,9 +1,9 @@ # packages/lorsm/www/shared/course-info.tcl ad_page_contract { - + Previews course - + @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 2004-07-09 @arch-tag: 9687443a-686e-4784-9702-5c00ee0bdc88 @@ -16,7 +16,10 @@ } -set context [list [list [export_vars -base .] "Shared Courses"] "Preview Course"] +set context [list \ + [list [export_vars -base .] \ + "Shared Courses"] \ + "Preview Course"] set community_id [dotlrn_community::get_community_id] set title "[_ lorsm.Preview_Course_1]" @@ -30,66 +33,48 @@ set fs_local_package_id [site_node_apm_integration::get_child_package_id \ - -package_id [dotlrn_community::get_package_id $community_id] \ - -package_key "file-storage"\ - ] + -package_id [dotlrn_community::get_package_id $community_id] \ + -package_key "file-storage"] # Checks whether this course is already in use on this community set active [db_0or1row check " - select - man_id, - community_id, - lorsm_instance_id - from - ims_cp_manifest_class - where - man_id = :man_id - and - community_id = :community_id"] + select man_id, community_id, lorsm_instance_id + from ims_cp_manifest_class + where man_id = :man_id + and community_id = :community_id"] - - if {[db_0or1row manifest " - select - cp.man_id, - cp.course_name, - cp.identifier, - cp.version, - text 'Yes' as hello, - case - when hasmetadata = 't' then 'Yes' - else 'No' - end as man_metadata, - case - when isscorm = 't' then 'Yes' - else 'No' - end as isscorm, - cp.isshared, - acs.creation_user, - acs.creation_date, - acs.context_id - from - ims_cp_manifests cp, acs_objects acs - where - cp.man_id = acs.object_id - and cp.man_id = :man_id - and cp.parent_man_id = 0"]} { + select cp.man_id, cp.course_name, cp.identifier, cp.version, + text 'Yes' as hello, + case + when hasmetadata = 't' then 'Yes' + else 'No' + end as man_metadata, + case + when isscorm = 't' then 'Yes' + else 'No' + end as isscorm, + cp.isshared, acs.creation_user, acs.creation_date, acs.context_id + from ims_cp_manifests cp, acs_objects acs + where cp.man_id = acs.object_id + and cp.man_id = :man_id + and cp.parent_man_id = 0"]} { - # Sets the variable for display. + # Sets the variable for display. set display 1 - + # Course Name if {[empty_string_p $course_name]} { - set course_name "[_ lorsm.No_course_Name]" - } + set course_name "[_ lorsm.No_course_Name]" + } # Version if {[empty_string_p $version]} { - set version "[_ lorsm._No]" - } - + set version "[_ lorsm._No]" + } + # Created By set created_by [person::name -person_id $creation_user] @@ -98,137 +83,130 @@ # Check for submanifests if {[db_0or1row submans " - select - count(*) as submanifests - from - ims_cp_manifests - where - man_id = :man_id - and - parent_man_id = :man_id"]} { + select count(*) as submanifests + from ims_cp_manifests + where man_id = :man_id + and parent_man_id = :man_id"]} { } else { - set submanifests 0 + set submanifests 0 } - } else { - set display 0 - } append orgs_list "" -append orgs_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 +append orgs_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 } { + append orgs_list \ + " + + + " } - { metadata "Metadata?" "no_sort" "" } - { type "Type" "no_sort" "" } + { title "" "no_sort" "" + } { metadata "Metadata?" "no_sort" "" + } { type "Type" "no_sort" "" } } - set table_item [ad_table -Tmissing_text $missing_text -Textra_vars $table_extra_vars -Theader_row_extra "style=\"background-color: #e0e0e0; font-weight: bold;\" class=\"list-header\"" -Ttable_extra_html $table_extra_html blah { - SELECT - o.object_id, - repeat(' ', (tree_level(tree_sortkey) - :indent)* 3) as indent, - i.ims_item_id as item_id, - i.item_title as item_title, - i.hasmetadata, - i.org_id, - case - when i.isshared = 'f' then ( - 'false' - ) - else 'true' - end as isshared, - case - when i.identifierref <> '' then ( - SELECT - res.href - FROM - ims_cp_items_to_resources i2r, - ims_cp_resources res - WHERE - i2r.res_id = res.res_id - AND - i2r.ims_item_id = i.ims_item_id -) - else '' - end as identifierref, - case - when i.identifierref <> '' then ( - SELECT - res.type - FROM - ims_cp_items_to_resources i2r, - ims_cp_resources res - WHERE - i2r.res_id = res.res_id - AND - i2r.ims_item_id = i.ims_item_id -) - else '' - end as type, - m.fs_package_id, - m.folder_id, - m.course_name - FROM - acs_objects o, ims_cp_items i, ims_cp_manifests m - WHERE - o.object_type = 'ims_item_object' - AND - i.org_id = :org_id - AND - o.object_id = i.ims_item_id - AND - m.man_id = :man_id - ORDER BY - tree_sortkey, object_id + set table_item [ad_table \ + -Tmissing_text $missing_text \ + -Textra_vars $table_extra_vars \ + -Theader_row_extra "style=\"background-color: #e0e0e0; + font-weight: bold;\" + class=\"list-header\"" \ + -Ttable_extra_html $table_extra_html blah { + select o.object_id, + repeat(' ', (tree_level(tree_sortkey) - :indent)* 3) as indent, + i.ims_item_id as item_id, i.item_title as item_title, i.hasmetadata, + i.org_id, + case + when i.isshared = 'f' then ('false') + else 'true' + end as isshared, - } $table_def] + case + when i.identifierref <> '' then ( + select res.href + from ims_cp_items_to_resources i2r, ims_cp_resources res + where i2r.res_id = res.res_id + and i2r.ims_item_id = i.ims_item_id + ) + else '' + end as identifierref, - append orgs_list "$table_item" + case + when i.identifierref <> '' then ( + select res.type + from ims_cp_items_to_resources i2r, ims_cp_resources res + where i2r.res_id = res.res_id + and i2r.ims_item_id = i.ims_item_id + ) + else '' + end as type, + m.fs_package_id, + m.folder_id, + m.course_name + from acs_objects o, ims_cp_items i, ims_cp_manifests m + where o.object_type = 'ims_item_object' + and i.org_id = :org_id + and o.object_id = i.ims_item_id + and m.man_id = :man_id + order by tree_sortkey, object_id + } $table_def] + append orgs_list "$table_item" append orgs_list "" } if_no_rows { append orgs_list "" } append orgs_list "
OrganizationMetadata?Items
OrganizationMetadata?Items
$org_title$hasmetadata" - - append orgs_list "
$org_title$hasmetadata" - set indent [expr $indent +1] set missing_text "Nothing here" set return_url [export_vars -base [ns_conn url] man_id] set table_extra_html { width="100%" } - + set track_id 0 set table_extra_vars {return_url fs_local_package_id track_id} set table_def { - { title "" "no_sort" "$indent[if {![empty_string_p $identifierref]} {set href \"$item_title\"} else {set href $item_title}][if {$hasmetadata == \"f\"} {set hasmetadata \"No\"} else {set hasmetadata \"Metadata\"}]$type$indent + [if {![empty_string_p $identifierref]} { + set href \"$item_title\" + } else { + set href $item_title}] + [if {$hasmetadata == \"f\"} { + set hasmetadata \"No\" + } else { + set hasmetadata \"Metadata\"}]$type
" - set shared_url [export_vars -base add-shared-course {man_id}] Index: openacs-4/packages/lorsm/www/admin/shared/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/shared/index.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/shared/index.adp 31 Dec 2006 00:36:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/shared/index.adp 17 Nov 2008 13:37:55 -0000 1.2 @@ -1,16 +1,12 @@ - @title@ - @context@ +@title@ +@context@ - - - - - + + + + +
-

#lorsm.lt_Shared_Courses_in_the#

-
- -

#lorsm.lt_Shared_Courses_in_the#

Index: openacs-4/packages/lorsm/www/admin/tracking/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/tracking/index.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/tracking/index.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/tracking/index.adp 17 Nov 2008 13:37:55 -0000 1.4 @@ -1,7 +1,6 @@ - @title@ - @context@ +@title@ +@context@ -


- - +


+ Index: openacs-4/packages/lorsm/www/admin/tracking/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/tracking/index.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/tracking/index.tcl 16 Jan 2008 16:54:45 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/tracking/index.tcl 17 Nov 2008 13:37:55 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/tracking/index.tcl ad_page_contract { - + Student Tracking Index Page - + @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 2004-05-25 @arch-tag a5b230ee-0fa7-4e48-be1b-eeae323291e7 @@ -32,7 +32,9 @@ template::list::create \ -name student_track \ -multirow student_track \ - -actions [list "[_ lorsm.Summarize]" [export_vars -base ".?group=0" {man_id item_id}] "[_ lorsm.lt_Summarize_all_student]"] \ + -actions [list "[_ lorsm.Summarize]" \ + [export_vars -base ".?group=0" {man_id item_id}] \ + "[_ lorsm.lt_Summarize_all_student]"] \ -key man_id \ -html {width 50%} \ -no_data "[_ lorsm.No_Students]" \ @@ -42,52 +44,51 @@ display_eval {[person::name -person_id $student_name]} link_url_eval {[acs_community_member_url -user_id $student_name]} link_html {title "[_ lorsm.Students_profile]"} - } - start_time { + + } start_time { label "[_ lorsm.Start_Course]" display_eval {[lc_time_fmt $start_time "%x %T"]} html { align center } - } - end_time { + + } end_time { label "[_ lorsm.Exit_Course]" display_eval {[lc_time_fmt $end_time "%x %T"]} html { align center } - } - time_spend { + + } time_spend { label "[_ lorsm.Time_Spent]" - display_eval {[lorsm::dates_calc -start_date [string range $start_time 0 18] -end_date [string range $end_time 0 18]]} + display_eval {[lorsm::dates_calc \ + -start_date [string range $start_time 0 18] \ + -end_date [string range $end_time 0 18]]} html { align center } } } db_multirow -extend { ims_md_id } student_track select_students { - select - user_id as student_name, - start_time, - end_time + select user_id as student_name, start_time, end_time from lorsm_student_track where community_id = :community_id - and course_id = :man_id - and end_time NOTNULL + and course_id = :man_id + and end_time NOTNULL order by start_time desc } { set ims_md_id $man_id } - + template::list::create \ -name object_views \ -multirow object_views \ -elements { title { label "[_ lorsm.Title_1]" - } - viewer_name { + + } viewer_name { label "[_ lorsm.Viewed_By]" - } - views_count { + + } views_count { label "[_ lorsm.Total_Views]" - } - last_viewed { + + } last_viewed { label "[_ lorsm.Last_Viewed_On]" display_eval {[lc_time_fmt $last_viewed "%x %X"]} } @@ -99,20 +100,14 @@ set extra_where "" } - db_multirow -extend {viewer_name} object_views objects_views " - select v.*, - i.item_title as title - from views_views v, - ims_cp_items i, - ims_cp_organizations o - where - i.ims_item_id = v.object_id - and - i.org_id = o.org_id - and - o.man_id = :man_id - $extra_where - " { + db_multirow -extend {viewer_name} object_views objects_views \ + "select v.*, i.item_title as title + from views_views v, ims_cp_items i, ims_cp_organizations o + where i.ims_item_id = v.object_id + and i.org_id = o.org_id + and o.man_id = :man_id + $extra_where" + { set viewer_name [acs_user::get_element -user_id $viewer_id -element name] } @@ -123,7 +118,9 @@ -name student_track \ -multirow student_track \ -key man_id \ - -actions [list "[_ lorsm.Expand]" [export_vars -base ".?group=1" {man_id item_id}] "Expand all students"] \ + -actions [list "[_ lorsm.Expand]" \ + [export_vars -base ".?group=1" {man_id item_id}] \ + "Expand all students"] \ -html {width 50%} \ -no_data "[_ lorsm.No_Students]" \ -elements { @@ -132,28 +129,25 @@ display_eval {[person::name -person_id $student_name]} link_url_eval {[acs_community_member_url -user_id $student_name]} link_html {title "Student's profile"} - } - counter { + + } counter { label "[_ lorsm.Times_Viewed]" html { align center } - } - time_spent { + + } time_spent { label "[_ lorsm.Time_Spent]" html { align center } } } db_multirow -extend { ims_md_id } student_track select_students { - select - user_id as student_name, - count(*) as counter, - sum(end_time - start_time) as time_spent + select user_id as student_name, count(*) as counter, + sum(end_time - start_time) as time_spent from lorsm_student_track where community_id = :community_id - and course_id = :man_id - and end_time NOTNULL + and course_id = :man_id + and end_time NOTNULL group by user_id - } { set ims_md_id $man_id } @@ -164,35 +158,29 @@ -elements { title { label "[_ lorsm.Title_1]" - } - views_count { + + } views_count { label "[_ lorsm.Total_Views]" - } - unique_views { + + } unique_views { label "[_ lorsm.Unique_Views]" - } - last_viewed { + + } last_viewed { label "[_ lorsm.Last_Viewed_On]" } } - + if {$item_id} { set extra_where " and v.object_id = :item_id" } else { set extra_where "" } - db_multirow object_views objects_views "select v.*, - i.item_title as title - from view_aggregates v, - ims_cp_items i, - ims_cp_organizations o - where - i.ims_item_id = v.object_id - and - i.org_id = o.org_id - and - o.man_id = :man_id + db_multirow object_views objects_views \ + "select v.*, i.item_title as title + from view_aggregates v, ims_cp_items i, ims_cp_organizations o + where i.ims_item_id = v.object_id + and i.org_id = o.org_id + and o.man_id = :man_id $extra_where" - } Index: openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student-2.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student-2.adp 31 Dec 2006 00:36:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student-2.adp 17 Nov 2008 13:37:55 -0000 1.2 @@ -1,20 +1,19 @@ - - @page_title;noquote@ - @context;noquote@ -
-Sessions for the selected student: - Standard view -
-
- + + @page_title;noquote@ + @context;noquote@ +
+ Sessions for the selected student: + Standard view +
+
+ - -@orgs_list;noquote@ -
- + + @orgs_list;noquote@ +
+ -
Index: openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student-2.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student-2.tcl 13 Aug 2007 09:20:16 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student-2.tcl 17 Nov 2008 13:37:55 -0000 1.3 @@ -1,16 +1,16 @@ # packages/lorsm/www/delivery/toc.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$ } { - man_id:integer,notnull - user_id:integer,notnull + man_id:integer,notnull + user_id:integer,notnull } -properties { } -validate { } -errors { @@ -49,158 +49,137 @@ set community_id [dotlrn_community::get_community_id] set fs_local_package_id [site_node_apm_integration::get_child_package_id \ - -package_id [dotlrn_community::get_package_id $community_id] \ - -package_key "file-storage"\ - ] -set track_id [lorsm::track::istrackable -course_id $man_id -package_id $package_id] + -package_id [dotlrn_community::get_package_id $community_id] \ + -package_key "file-storage"] +set track_id [lorsm::track::istrackable \ + -course_id $man_id \ + -package_id $package_id] + set extra_vars fs_local_package_id db_foreach organizations { - select - org.org_id, - org.org_title as org_title, - org.hasmetadata, + 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 + from ims_cp_organizations org, acs_objects o + where org.org_id = o.object_id + and man_id = :man_id + order by org_id } { set indent [expr $indent +1] set missing_text "[_ lorsm.Nothing_here]" set table_extra_html { width="100%" } # the table_def isn't quite neat as I'd like to, but it does the job for a - # simple indexing for delivery. + # simple indexing for delivery. # set table_def { -# { title "" "no_sort" "Item: $item_id $indent [if {![empty_string_p $identifierref]} {set href \"$item_title\"} else {set href \"AAA $item_title\"}]" } +# { title "" "no_sort" "Item: $item_id $indent [if {![empty_string_p $identifierref]} {set href \"$item_title\"} else {set href \"AAA $item_title\"}]" } # } - regsub -all {[\{\}]} $org_title "" org_title + regsub -all {[\{\}]} $org_title "" org_title - append orgs_list "
" - append orgs_list "" + append orgs_list "
$org_title (id: $org_id)
" + append orgs_list "" - set indent_items [lorsm::get_items_indent -org_id $org_id] + set indent_items [lorsm::get_items_indent -org_id $org_id] -db_foreach organization_item { - SELECT - o.object_id, - --repeat(' ', (tree_level(tree_sortkey) - :indent)* 2) as indent, - i.ims_item_id, - i.item_title as item_title, - i.hasmetadata, - i.ims_item_id as identifierref, - i.type, - i.org_id, - m.fs_package_id, - m.folder_id, - m.course_name - FROM - acs_objects o, ims_cp_items i, ims_cp_manifests m - WHERE - o.object_type like 'ims_item_object' - AND - i.org_id = :org_id - AND - o.object_id = i.ims_item_id - AND - m.man_id = :man_id - ORDER BY - object_id - --, tree_sortkey -} { + db_foreach organization_item { + select o.object_id, + --repeat(' ', (tree_level(tree_sortkey) - :indent)* 2) as indent, + i.ims_item_id, i.item_title as item_title, i.hasmetadata, + i.ims_item_id as identifierref, i.type, i.org_id, m.fs_package_id, + m.folder_id, m.course_name + from acs_objects o, ims_cp_items i, ims_cp_manifests m + where o.object_type like 'ims_item_object' + and i.org_id = :org_id + and o.object_id = i.ims_item_id + and m.man_id = :man_id + order by object_id + --, tree_sortkey + } { - foreach indent_item $indent_items { + foreach indent_item $indent_items { set indent_item_id [lindex $indent_item 0] set indent_indent [lindex $indent_item 1] if { [string equal $indent_item_id $ims_item_id] } { - set indent $indent_indent - } - } - - set table_item "" - - for {set x 0} {$x<$indent} {incr x} { - append table_item "" - } + set indent $indent_indent + } + } - append table_item "" + append orgs_list "" + + } else { + append orgs_list "" + } + + append orgs_list "
$org_title (id: $org_id) +
" + set table_item "" + for {set x 0} {$x<$indent} {incr x} { + append table_item "" + } - if { [empty_string_p $identifierref] } { - append table_item "" - } else { - #set table_item "" -} + append item_table "" + append item_table "" + append item_table "" + append item_table "" + append item_table "" + append item_table "" -append orgs_list "" -append orgs_list "
Item: $ims_item_id $indent $item_title" - #set table_item "Item: $item_id $indent AAA $item_titleItem: $item_id $indent [string trim $item_title]" - append table_item "[string trim $item_title], (id: $ims_item_id)" - } -# set table_item [concat $table_item [ad_table -Tmissing_text $missing_text -Textra_vars {fs_local_package_id track_id} -Ttable_extra_html $table_extra_html $table_def]] - #set table_item [concat $table_item [ad_table -Tmissing_text $missing_text -Textra_vars {fs_local_package_id track_id} -Ttable_extra_html $table_extra_html $table_def]] + append table_item "" - append orgs_list [string trim $table_item] - set item_table "" + if { [empty_string_p $identifierref] } { + append table_item "" + } else { + #set table_item "" - append item_table "" - append item_table "" - append item_table "" - append item_table "" - append item_table "" + append orgs_list [string trim $table_item] + set item_table "" -} - if { [empty_string_p $item_table] } { - append orgs_list " : No RTE scorm data " - append orgs_list "" - } else { - append orgs_list "" - } + db_foreach student_activity { + select * + from lorsm_student_track lorsm, lorsm_cmi_core cmi, ims_cp_manifests manif, ims_cp_items imsitems + where lorsm.community_id=:community_id + and lorsm.track_id=cmi.track_id + and lorsm.course_id=:man_id + and manif.man_id=:man_id + and cmi.man_id=:man_id + and cmi.item_id=:identifierref + and user_id=:user_id + and imsitems.ims_item_id=cmi.item_id + order by cmi.track_id asc + } { + set cut_start_time [string range $start_time 0 18] + set total_total_time [expr $total_time+$session_time] + set edit_url [export_vars -base "drill-student-singletrack" \ + {track_id}] + set drill_url [export_vars -base "drill-student-singletrack" \ + {track_id}] - append orgs_list "
Item: $ims_item_id $indent + $item_title" + #set table_item "Item: $item_id $indent AAA $item_titleItem: $item_id $indent [string trim $item_title]" + append table_item "[string trim $item_title], + (id: $ims_item_id)" + } + # set table_item [concat $table_item [ad_table -Tmissing_text $missing_text -Textra_vars {fs_local_package_id track_id} -Ttable_extra_html $table_extra_html $table_def]] + #set table_item [concat $table_item [ad_table -Tmissing_text $missing_text -Textra_vars {fs_local_package_id track_id} -Ttable_extra_html $table_extra_html $table_def]] -db_foreach student_activity { - select * - from - lorsm_student_track lorsm, lorsm_cmi_core cmi, ims_cp_manifests manif, ims_cp_items imsitems - where - lorsm.community_id=:community_id - and - lorsm.track_id=cmi.track_id - and - lorsm.course_id=:man_id - and - manif.man_id=:man_id - and - cmi.man_id=:man_id - and - cmi.item_id=:identifierref - and - user_id=:user_id - and - imsitems.ims_item_id=cmi.item_id - order by - cmi.track_id asc - } { - set cut_start_time [string range $start_time 0 18] - set total_total_time [expr $total_time+$session_time] - set edit_url [export_vars -base "drill-student-singletrack" {track_id}] - set drill_url [export_vars -base "drill-student-singletrack" {track_id}] - - append item_table "" - append item_table "$score_raw $lesson_status $total_total_time \" $cut_start_time $track_id
" - append orgs_list "" - append orgs_list "" - append orgs_list $item_table - append orgs_list "
scorestatustotal timefirst visitdetail sessions
" - append orgs_list "
" - append orgs_list "
" + append item_table "$score_raw $lesson_status $total_total_time \" $cut_start_time $track_id
" + } + if { [empty_string_p $item_table] } { + append orgs_list " : No RTE scorm data
" + append orgs_list "" + append orgs_list " + " + append orgs_list $item_table + append orgs_list "
scorestatustotal timefirst visitdetail sessions
" + append orgs_list "
" + append orgs_list "" + } + + append orgs_list "" + append orgs_list "" } Index: openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student-singletrack.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student-singletrack.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student-singletrack.adp 31 Dec 2006 00:36:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student-singletrack.adp 17 Nov 2008 13:37:55 -0000 1.2 @@ -9,57 +9,69 @@
Data regarding this session:
  • -id: @student_id@ + id: @student_id@
  • +
  • -name: @student_name@ + name: @student_name@
  • +
  • -location: @lesson_location@ + location: @lesson_location@
  • +
  • -credit: @credit@ + credit: @credit@
  • +
  • -status: @lesson_status@ + status: @lesson_status@
  • +
  • -entry: @entry@ + entry: @entry@
  • +
  • -score: @score_raw@ + score: @score_raw@
  • +
  • -total time: @total_time@ (seconds - last session excluded)
    + total time: @total_time@ (seconds - last session excluded)
  • +
  • -last session time: @session_time@ (seconds)
    + last session time: @session_time@ (seconds)
  • +
  • -comments: @comments@ + comments: @comments@
  • +
  • -mode: @lesson_mode@ + mode: @lesson_mode@
  • +
  • -launch data: @launch_data@ + launch data: @launch_data@
  • +
  • -suspend data: @suspend_data@ + suspend data: @suspend_data@
  • +
  • -Session initialization time stamp: @time_stamp@
    + Session initialization time stamp: @time_stamp@
  • <%= - #time stamp (creation date for this entry must be = first track below) @time_stamp@
    + #time stamp (creation date for this entry must be = first track below) @time_stamp@
    %>
    Data below is from 'usual' lors tracking and is not provided as scorm compliance.
    - - +
    Index: openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student-singletrack.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student-singletrack.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student-singletrack.tcl 31 Dec 2006 00:36:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student-singletrack.tcl 17 Nov 2008 13:37:55 -0000 1.2 @@ -14,83 +14,72 @@ set package_id [ad_conn package_id] set community_id [dotlrn_community::get_community_id] set man_id [ ad_get_client_property trackingrte man_id ] -set user_id [ad_get_client_property trackingrte currentlydrilleduser] +set user_id [ad_get_client_property trackingrte currentlydrilleduser] #acs_user::get -user_id $user_id -array user #set student_id $user(username) set student_name [person::name -person_id $user_id] set classname [dotlrn_community::get_community_name $community_id] set man_name [lorsm::get_course_name -manifest_id $man_id] -set thistrack [ db_1row thiscmitrack " select * from lorsm_cmi_core where track_id=:track_id " ] +set thistrack [ db_1row thiscmitrack \ + "select * + from lorsm_cmi_core + where track_id=:track_id " ] + set thistrack $track_id set context [list "$classname,$man_name,$student_name,session_id: $track_id"] -set numrows [ db_0or1row istherealready " select min(lorsm.track_id) as mint from lorsm_cmi_core cmi, lorsm_student_track lorsm - where - lorsm.community_id=:community_id - and - lorsm.course_id=:man_id - and - user_id=:user_id - and - lorsm.track_id=cmi.track_id - and - lorsm.track_id>:track_id "] +set numrows [ db_0or1row istherealready \ + "select min(lorsm.track_id) as mint from lorsm_cmi_core cmi, lorsm_student_track lorsm + where lorsm.community_id=:community_id + and lorsm.course_id=:man_id + and user_id=:user_id + and lorsm.track_id=cmi.track_id + and lorsm.track_id>:track_id "] # seems numrows always 1 when doing an aggregate query if { $mint == "" } { - set querypart "" + set querypart "" } else { - set querypart " and lorsm.track_id < $mint " + set querypart " and lorsm.track_id < $mint " } template::list::create \ -name student_track \ -multirow student_track \ -elements { - course_name { - link_url_col edit_url - label "titolo" - } - user_id { - label "student ID" - display_eval {[person::name -person_id $user_id]} - link_url_col drill_url - } - start_time { - label "time student first entered course" - } - end_time { - label "time student left course" - } - track_id { - label "track_id (from lorsm_student_track)" - } + course_name { + link_url_col edit_url + label "titolo" + + } user_id { + label "student ID" + display_eval {[person::name -person_id $user_id]} + link_url_col drill_url + + } start_time { + label "time student first entered course" + + } end_time { + label "time student left course" + + } track_id { + label "track_id (from lorsm_student_track)" + } } -db_multirow \ - student_track single_student_track " - select * - from - lorsm_student_track lorsm, ims_cp_manifests manif - where - lorsm.community_id=$community_id - and - lorsm.course_id=$man_id - and - ( - lorsm.track_id>=$track_id - $querypart - ) - and - manif.man_id=$man_id - and - user_id=$user_id - order by - lorsm.track_id asc " \ - { - set edit_url [export_vars -base "drill-student-singletrack" {track_id}] - set drill_url [export_vars -base "drill-student-singletrack" {track_id}] +db_multirow student_track single_student_track \ + "select * + from lorsm_student_track lorsm, ims_cp_manifests manif + where lorsm.community_id=$community_id + and lorsm.course_id=$man_id + and (lorsm.track_id>=$track_id $querypart) + and manif.man_id=$man_id + and user_id=$user_id + order by lorsm.track_id asc" \ + { + set edit_url [export_vars -base "drill-student-singletrack" {track_id}] + set drill_url [export_vars -base "drill-student-singletrack" {track_id}] } Index: openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student.adp 31 Dec 2006 00:36:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student.adp 17 Nov 2008 13:37:55 -0000 1.2 @@ -1,13 +1,12 @@ - @page_title;noquote@ - @context;noquote@ +@page_title;noquote@ +@context;noquote@
    Sessions for the selected student: - Hierachical view + Hierachical view

    - - +
    Index: openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student.tcl 31 Dec 2006 00:36:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/tracking-rte/drill-student.tcl 17 Nov 2008 13:37:55 -0000 1.2 @@ -24,70 +24,48 @@ ad_set_client_property trackingrte currentlydrilleduser $user_id -# course_name { -# label "titolo" -# } -# student_id { -# label "student ID" -# display_eval {[person::name -person_id $user_id]} -# } +# course_name { +# label "titolo" +# } +# student_id { +# label "student ID" +# display_eval {[person::name -person_id $user_id]} +# } ### template::list::create \ -name student \ -multirow student \ -elements { - item_title { - label "Title" - } - score_raw { - label "Score - sent by sco" - } - total_total_time { - label "Total time - sent by sco" - } - cut_start_time { - label "Time student first entered course" - } - lesson_status { - label "lesson status - sent by sco" - } - track_id { - label "session_id. click for detail" - link_url_col drill_url - } + item_title { label "Title" } + score_raw { label "Score - sent by sco" } + total_total_time { label "Total time - sent by sco" } + cut_start_time { label "Time student first entered course" } + lesson_status { label "lesson status - sent by sco" } + track_id { + label "session_id. click for detail" + link_url_col drill_url + } } - #label "session_id (cmi.core.track_id=lorsm.studenttrack.track_id)" +#label "session_id (cmi.core.track_id=lorsm.studenttrack.track_id)" + db_multirow \ - -extend { - edit_url - drill_url - total_total_time - cut_start_time - } student single_student { - select * - from - lorsm_student_track lorsm, lorsm_cmi_core cmi, ims_cp_manifests manif, ims_cp_items imsitems - where - lorsm.community_id=:community_id - and - lorsm.track_id=cmi.track_id - and - lorsm.course_id=:man_id - and - manif.man_id=:man_id - and - cmi.man_id=:man_id - and - user_id=:user_id - and - imsitems.ims_item_id=cmi.item_id - order by - cmi.track_id asc - } { - set cut_start_time [string range $start_time 0 18] - set total_total_time [expr $total_time+$session_time] - set edit_url [export_vars -base "drill-student-singletrack" {track_id}] - set drill_url [export_vars -base "drill-student-singletrack" {track_id}] + -extend { edit_url drill_url total_total_time cut_start_time } \ + student single_student { + select * + from lorsm_student_track lorsm, lorsm_cmi_core cmi, ims_cp_manifests manif, ims_cp_items imsitems + where lorsm.community_id=:community_id + and lorsm.track_id=cmi.track_id + and lorsm.course_id=:man_id + and manif.man_id=:man_id + and cmi.man_id=:man_id + and user_id=:user_id + and imsitems.ims_item_id=cmi.item_id + order by cmi.track_id asc + } { + set cut_start_time [string range $start_time 0 18] + set total_total_time [expr $total_time+$session_time] + set edit_url [export_vars -base "drill-student-singletrack" {track_id}] + set drill_url [export_vars -base "drill-student-singletrack" {track_id}] } Index: openacs-4/packages/lorsm/www/admin/tracking-rte/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/tracking-rte/index.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/tracking-rte/index.adp 31 Dec 2006 00:36:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/tracking-rte/index.adp 17 Nov 2008 13:37:55 -0000 1.2 @@ -1,6 +1,6 @@ - @title@ - @context@ +@title@ +@context@
    Runtime Session data: @@ -9,4 +9,3 @@ %>
    - Index: openacs-4/packages/lorsm/www/admin/tracking-rte/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/tracking-rte/index.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/tracking-rte/index.tcl 8 Jan 2007 20:12:56 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/tracking-rte/index.tcl 17 Nov 2008 13:37:55 -0000 1.3 @@ -18,5 +18,5 @@ ad_set_client_property trackingrte man_id $man_id -set context [list "$classname,$man_name" ] +set context [list "$classname,$man_name"] Index: openacs-4/packages/lorsm/www/admin/tracking-rte/items.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/tracking-rte/items.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/tracking-rte/items.adp 6 Mar 2008 14:00:28 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/tracking-rte/items.adp 17 Nov 2008 13:37:55 -0000 1.3 @@ -1,88 +1,89 @@ - - - - - - - - - + + + + + + + + - + - - - - -@item_id@
    -@item_title@ -@identifierref@ -
    -
    - + .index { + font-size: 8pt; + } + + .caption, .index { + color: #ffffff; + } + + .comments { + font-size: 8pt; + } + + #site-header { + background-color: #6C9A83; + color: white; + font-family: tahoma, verdana, helvetica, sans-serif; + font-size: 85%; + padding-top: 10px; + padding-bottom: 14px; + padding-left: 14px; + padding-right: 18px; + text-align: center; + } + + #site-header .system-name { + font-size: 120%; + font-weight: bold; + float: left; + } + + #site-header .system-name a { + color: white; + text-decoration: none; + } + + #site-header .system-name a:hover { + color: white; + text-decoration: none; + } + + + + + + @item_id@
    + @item_title@ + @identifierref@ +
    +
    + Index: openacs-4/packages/lorsm/www/admin/tracking-rte/items.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/tracking-rte/items.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/tracking-rte/items.tcl 31 Dec 2006 00:36:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/tracking-rte/items.tcl 17 Nov 2008 13:37:55 -0000 1.2 @@ -1,15 +1,15 @@ # packages/lorsm/www/delivery/toc.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$ } { - man_id:integer,notnull + man_id:integer,notnull user_id:integer,notnull } -properties { } -validate { @@ -24,42 +24,31 @@ # other instances of file-storages of other classes. See # documentation for further details. - if { ! [info exists indent] } { set indent 1} +if { ! [info exists indent] } { + set indent 1 +} - set org_id 12913 +set org_id 12913 +set indent [expr $indent +1] - set indent [expr $indent +1] - -db_multirow -extend { item_id items_title identifierref } suborgs select_suborgs { - SELECT - o.object_id, - i.item_id, - i.item_title as item_title, - i.hasmetadata, - i.item_id as identifierref, - i.type, - i.org_id, - m.fs_package_id, - m.folder_id, - m.course_name - FROM - acs_objects o, ims_cp_items i, ims_cp_manifests m - WHERE - o.object_type = 'ims_item' - AND - i.org_id = :org_id - AND - o.object_id = i.item_id - AND - m.man_id = :man_id - ORDER BY - object_id, tree_sortkey +db_multirow \ + -extend { item_id items_title identifierref } \ + suborgs select_suborgs { + select o.object_id, i.item_id, + i.item_title as item_title, + i.hasmetadata, + i.item_id as identifierref, + i.type, i.org_id, m.fs_package_id, m.folder_id, + m.course_name + from acs_objects o, ims_cp_items i, ims_cp_manifests m + where o.object_type = 'ims_item' + and i.org_id = :org_id + and o.object_id = i.item_id + and m.man_id = :man_id + order by object_id, tree_sortkey } { - set item_id $item_id -} + set item_id $item_id +} - - - - #repeat(' ', (tree_level(tree_sortkey) - :indent)* 2) as indent, +#repeat(' ', (tree_level(tree_sortkey) - :indent)* 2) as indent, #P Index: openacs-4/packages/lorsm/www/admin/tracking-rte/list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/tracking-rte/list.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/tracking-rte/list.tcl 31 Dec 2006 00:36:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/tracking-rte/list.tcl 17 Nov 2008 13:37:55 -0000 1.2 @@ -5,43 +5,30 @@ -name students \ -multirow students \ -elements { - course_name { - label "Course title" - } - user_id { - label "student ID" - display_eval {[person::name -person_id $user_id]} - link_url_col drill_url - } - max_attained { - label "Max raw score attained by this student" - } - + course_name { label "Course title" } + user_id { + label "student ID" + display_eval {[person::name -person_id $user_id]} + link_url_col drill_url + } + max_attained { label "Max raw score attained by this student" } } db_multirow \ -extend { - edit_url - drill_url + edit_url + drill_url + } students which_students { - select user_id, course_name, max(score_raw) as max_attained from - ( - select * - from - lorsm_student_track lorsm, lorsm_cmi_core cmi, ims_cp_manifests manif - where - lorsm.community_id=:community_id - and - lorsm.track_id=cmi.track_id - and - lorsm.course_id=:man_id - and - manif.man_id=:man_id - ) alltracks - group by - user_id, course_name - } { - set edit_url [export_vars -base "drill-student" {user_id}] - set drill_url [export_vars -base "drill-student" {user_id}] + select user_id, course_name, max(score_raw) as max_attained + from ( select * + from lorsm_student_track lorsm, lorsm_cmi_core cmi, ims_cp_manifests manif + where lorsm.community_id=:community_id + and lorsm.track_id=cmi.track_id + and lorsm.course_id=:man_id + and manif.man_id=:man_id) alltracks + group by user_id, course_name + } { + set edit_url [export_vars -base "drill-student" {user_id}] + set drill_url [export_vars -base "drill-student" {user_id}] } - Index: openacs-4/packages/lorsm/www/admin/tracking-rte/orgs.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/tracking-rte/orgs.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/tracking-rte/orgs.adp 6 Mar 2008 14:00:28 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/tracking-rte/orgs.adp 17 Nov 2008 13:37:55 -0000 1.3 @@ -1,88 +1,89 @@ - - - - - - - - - + + + + + + + + + - - - - -@org_id@
    -@org_title@ - -
    -
    - + .caption, .index { + color: #ffffff; + } + + .comments { + font-size: 8pt; + } + + #site-header { + background-color: #6C9A83; + color: white; + font-family: tahoma, verdana, helvetica, sans-serif; + font-size: 85%; + padding-top: 10px; + padding-bottom: 14px; + padding-left: 14px; + padding-right: 18px; + text-align: center; + } + + #site-header .system-name { + font-size: 120%; + font-weight: bold; + float: left; + } + + #site-header .system-name a { + color: white; + text-decoration: none; + } + + #site-header .system-name a:hover { + color: white; + text-decoration: none; + } + + + + + + + @org_id@
    + @org_title@ + +
    +
    + Index: openacs-4/packages/lorsm/www/admin/tracking-rte/orgs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/tracking-rte/orgs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/tracking-rte/orgs.tcl 31 Dec 2006 00:36:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/tracking-rte/orgs.tcl 17 Nov 2008 13:37:55 -0000 1.2 @@ -1,15 +1,15 @@ # packages/lorsm/www/delivery/toc.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$ } { - man_id:integer,notnull + man_id:integer,notnull user_id:integer,notnull } -properties { } -validate { @@ -26,50 +26,28 @@ db_multirow orgs select_orgs { - 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 -} { - set org_title $org_title -} + 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 +} { + set org_title $org_title +} db_multirow suborgs select_suborgs { - SELECT - o.object_id, - repeat(' ', (tree_level(tree_sortkey) - :indent)* 2) as indent, - i.item_id, - i.item_title as item_title, - i.hasmetadata, - i.item_id as identifierref, - i.type, - i.org_id, - m.fs_package_id, - m.folder_id, - m.course_name - FROM - acs_objects o, ims_cp_items i, ims_cp_manifests m - WHERE - o.object_type = 'ims_item' - AND - i.org_id = :org_id - AND - o.object_id = i.item_id - AND - m.man_id = :man_id - ORDER BY - object_id, tree_sortkey -} - - - + select o.object_id, + repeat(' ', (tree_level(tree_sortkey) - :indent)* 2) as indent, + i.item_id, + i.item_title as item_title, i.hasmetadata, + i.item_id as identifierref, i.type, i.org_id, m.fs_package_id, m.folder_id, m.course_name + from acs_objects o, ims_cp_items i, ims_cp_manifests m + where o.object_type = 'ims_item' + and i.org_id = :org_id + and o.object_id = i.item_id + and m.man_id = :man_id + order by object_id, tree_sortkey +} Index: openacs-4/packages/lorsm/www/admin/tracking-rte/toc.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/tracking-rte/toc.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/tracking-rte/toc.adp 6 Mar 2008 14:00:28 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/tracking-rte/toc.adp 17 Nov 2008 13:37:55 -0000 1.3 @@ -1,85 +1,85 @@ - - - - - - - - - + + + + + + + + + - - - -@orgs_list;noquote@ -
    - + .caption, .index { + color: #ffffff; + } + + .comments { + font-size: 8pt; + } + + #site-header { + background-color: #6C9A83; + color: white; + font-family: tahoma, verdana, helvetica, sans-serif; + font-size: 85%; + padding-top: 10px; + padding-bottom: 14px; + padding-left: 14px; + padding-right: 18px; + text-align: center; + } + + #site-header .system-name { + font-size: 120%; + font-weight: bold; + float: left; + } + + #site-header .system-name a { + color: white; + text-decoration: none; + } + + #site-header .system-name a:hover { + color: white; + text-decoration: none; + } + + + + + @orgs_list;noquote@ +
    + Index: openacs-4/packages/lorsm/www/admin/tracking-rte/toc.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/tracking-rte/toc.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/tracking-rte/toc.tcl 31 Dec 2006 00:36:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/tracking-rte/toc.tcl 17 Nov 2008 13:37:55 -0000 1.2 @@ -1,16 +1,16 @@ # packages/lorsm/www/delivery/toc.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$ } { - man_id:integer,notnull - user_id:integer,notnull + man_id:integer,notnull + user_id:integer,notnull } -properties { } -validate { } -errors { @@ -29,134 +29,103 @@ set community_id [dotlrn_community::get_community_id] set fs_local_package_id [site_node_apm_integration::get_child_package_id \ - -package_id [dotlrn_community::get_package_id $community_id] \ - -package_key "file-storage"\ - ] -set track_id [lorsm::track::istrackable -course_id $man_id -package_id $package_id] + -package_id [dotlrn_community::get_package_id $community_id] \ + -package_key "file-storage"] +set track_id [lorsm::track::istrackable \ + -course_id $man_id \ + -package_id $package_id] + set extra_vars fs_local_package_id 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 + 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 } { set indent [expr $indent +1] set missing_text "[_ lorsm.Nothing_here]" set table_extra_html { width="100%" } # the table_def isn't quite neat as I'd like to, but it does the job for a - # simple indexing for delivery. + # simple indexing for delivery. # set table_def { -# { title "" "no_sort" "Item: $item_id $indent [if {![empty_string_p $identifierref]} {set href \"$item_title\"} else {set href \"AAA $item_title\"}]" } +# { title "" "no_sort" "Item: $item_id $indent [if {![empty_string_p $identifierref]} {set href \"$item_title\"} else {set href \"AAA $item_title\"}]" } # } - append orgs_list "" - append orgs_list "" + append orgs_list "
    Organization: $org_title ($org_id)
    " + append orgs_list "" -db_foreach organization_item { - SELECT - o.object_id, - repeat(' ', (tree_level(tree_sortkey) - :indent)* 2) as indent, - i.item_id, - i.item_title as item_title, - i.hasmetadata, - i.item_id as identifierref, - i.type, - i.org_id, - m.fs_package_id, - m.folder_id, - m.course_name - FROM - acs_objects o, ims_cp_items i, ims_cp_manifests m - WHERE - o.object_type = 'ims_item' - AND - i.org_id = :org_id - AND - o.object_id = i.item_id - AND - m.man_id = :man_id - ORDER BY - object_id, tree_sortkey -} { + db_foreach organization_item { + select o.object_id, + repeat(' ', (tree_level(tree_sortkey) - :indent)* 2) as indent, + i.item_id, i.item_title as item_title, i.hasmetadata, + i.item_id as identifierref, + i.type, i.org_id, m.fs_package_id, m.folder_id, m.course_name + from acs_objects o, ims_cp_items i, ims_cp_manifests m + where o.object_type = 'ims_item' + and i.org_id = :org_id + and o.object_id = i.item_id + and m.man_id = :man_id + order by object_id, tree_sortkey + } { + if { [empty_string_p $identifierref] } { + set table_item "" + append item_table "" + append item_table "" + append item_table "" + append item_table "" + append item_table "" - + } - set item_table "" + if { [empty_string_p $item_table] } { + append orgs_list ": No scorm data
    " + append orgs_list "" -db_foreach student_activity { - select * - from - lorsm_student_track lorsm, lorsm_cmi_core cmi, ims_cp_manifests manif, ims_cp_items imsitems - where - lorsm.community_id=:community_id - and - lorsm.track_id=cmi.track_id - and - lorsm.course_id=:man_id - and - manif.man_id=:man_id - and - cmi.man_id=:man_id - and - cmi.item_id=:identifierref - and - user_id=:user_id - and - imsitems.ims_item_id=cmi.item_id - order by - cmi.track_id asc - } { - set cut_start_time [string range $start_time 0 18] - set total_total_time [expr $total_time+$session_time] - set edit_url [export_vars -base "drill-student-singletrack" {track_id}] - set drill_url [export_vars -base "drill-student-singletrack" {track_id}] - - append item_table "" - append item_table "" - append item_table "" - append item_table "" - append item_table "" - append item_table "" - + } else { + append orgs_list "" + } + } + append orgs_list "
    Organization: $org_title ($org_id) +
    Item: $item_id $indent AAA $item_title" + } else { + set table_item "Item: $item_id $indent [string trim $item_title]" + } + # set table_item [concat $table_item [ad_table -Tmissing_text $missing_text -Textra_vars {fs_local_package_id track_id} -Ttable_extra_html $table_extra_html $table_def]] + #set table_item [concat $table_item [ad_table -Tmissing_text $missing_text -Textra_vars {fs_local_package_id track_id} -Ttable_extra_html $table_extra_html $table_def]] + append orgs_list [string trim $table_item] + set item_table "" - if { [empty_string_p $identifierref] } { - set table_item "Item: $item_id $indent AAA $item_title" - } else { - set table_item "Item: $item_id $indent [string trim $item_title]" - } -# set table_item [concat $table_item [ad_table -Tmissing_text $missing_text -Textra_vars {fs_local_package_id track_id} -Ttable_extra_html $table_extra_html $table_def]] - #set table_item [concat $table_item [ad_table -Tmissing_text $missing_text -Textra_vars {fs_local_package_id track_id} -Ttable_extra_html $table_extra_html $table_def]] + db_foreach student_activity { + select * + from lorsm_student_track lorsm, lorsm_cmi_core cmi, ims_cp_manifests manif, ims_cp_items imsitems + where lorsm.community_id=:community_id + and lorsm.track_id=cmi.track_id + and lorsm.course_id=:man_id + and manif.man_id=:man_id + and cmi.man_id=:man_id + and cmi.item_id=:identifierref + and user_id=:user_id + and imsitems.ims_item_id=cmi.item_id + order by cmi.track_id asc + } { + set cut_start_time [string range $start_time 0 18] + set total_total_time [expr $total_time+$session_time] + set edit_url [export_vars -base "drill-student-singletrack" {track_id}] + set drill_url [export_vars -base "drill-student-singletrack" {track_id}] - append orgs_list [string trim $table_item] + append item_table "" + append item_table "$score_raw $lesson_status $total_total_time \" $cut_start_time $track_id
    " - append item_table "$score_raw $lesson_status $total_total_time \" $cut_start_time $track_id
    " + append orgs_list "" + append orgs_list " + " + append orgs_list $item_table + append orgs_list "
    scorestatustotal timefirst visitdetail sessions
    " } - if { [empty_string_p $item_table] } { - append orgs_list ": No scorm data
    " - append orgs_list "" - } else { - append orgs_list "" - append orgs_list "" - append orgs_list "" - append orgs_list $item_table - append orgs_list "
    scorestatustotal timefirst visitdetail sessions
    " - - } - -} -append orgs_list "" - -} Index: openacs-4/packages/lorsm/www/delivery/applet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/applet.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/lorsm/www/delivery/applet.adp 17 Oct 2008 10:46:31 -0000 1.5 +++ openacs-4/packages/lorsm/www/delivery/applet.adp 17 Nov 2008 13:38:34 -0000 1.6 @@ -1,52 +1,59 @@ - - + + + + + - - - - - - - -ses_renew: @ses_renew@ -ses_timeout: @ses_timeout@ -first_cookie: @cookie@ + ses_renew: @ses_renew@ + ses_timeout: @ses_timeout@ + first_cookie: @cookie@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + Index: openacs-4/packages/lorsm/www/delivery/applet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/applet.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/delivery/applet.tcl 13 Aug 2007 09:20:16 -0000 1.3 +++ openacs-4/packages/lorsm/www/delivery/applet.tcl 17 Nov 2008 13:38:34 -0000 1.4 @@ -1,5 +1,5 @@ ad_page_contract { - + @creation-date 2004-08-07 @arch-tag: 64f3397b-4558-4298-a995-fc63e472f2a1 @cvs-id $Id$ @@ -23,15 +23,19 @@ set app_height 0 } set random [clock seconds] -set ses_renew [ad_parameter -package_id [ad_acs_kernel_id] SessionRenew security 300] -set ses_timeout [ad_parameter -package_id [ad_acs_kernel_id] SessionTimeout security 1200] +set ses_renew [ad_parameter \ + -package_id [ad_acs_kernel_id] \ + SessionRenew security 300] +set ses_timeout [ad_parameter \ + -package_id [ad_acs_kernel_id] \ + SessionTimeout security 1200] set cookie [ad_get_cookie ad_session_id] set track_id [ad_get_client_property lorsm studenttrack] if { ! [info exists menu_off] } { - set menu_off 0 + set menu_off 0 } # Student tracking @@ -47,10 +51,8 @@ set body_url [export_vars -base "record-view" -url {item_id man_id}] } else { if { ! [empty_string_p $item_id] } { - ns_log Notice "APPLET.TCL: item_id is $item_id" - set ims_id $item_id - set body_url [export_vars -base "record-view" -url {item_id man_id}] + ns_log Notice "APPLET.TCL: item_id is $item_id" + set ims_id $item_id + set body_url [export_vars -base "record-view" -url {item_id man_id}] } } - - Index: openacs-4/packages/lorsm/www/delivery/blank-no-javascript.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/blank-no-javascript.html,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/delivery/blank-no-javascript.html 13 Aug 2007 09:20:16 -0000 1.2 +++ openacs-4/packages/lorsm/www/delivery/blank-no-javascript.html 17 Nov 2008 13:38:34 -0000 1.3 @@ -1,14 +1,14 @@ - - - - + function localclose() { + try{ + parent.caller.moveaway(); + parent.caller.childclosed=true; + } catch (err) { + //error while closing + } + } + //--> + Index: openacs-4/packages/lorsm/www/delivery/blank.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/blank.html,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/delivery/blank.html 7 Jun 2006 14:05:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/delivery/blank.html 17 Nov 2008 13:38:35 -0000 1.3 @@ -1,9 +1,9 @@ - - - - - ---- - + + + + + + --- + Index: openacs-4/packages/lorsm/www/delivery/body.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/body.adp,v diff -u -r1.9 -r1.10 --- openacs-4/packages/lorsm/www/delivery/body.adp 17 Oct 2008 10:46:31 -0000 1.9 +++ openacs-4/packages/lorsm/www/delivery/body.adp 17 Nov 2008 13:38:35 -0000 1.10 @@ -1,51 +1,50 @@ - - - - - - -
    - + + + + + -
    -

    @course_name@

    -

    + +

    + - -

    - Last page viewed: @last_page_viewed;noquote@ - - - You have not yet viewed any material from this course. - -

    - Click on the menu items on the left to view course materials - - -

    - +
    +

    @course_name@

    +

    + +

    + Last page viewed: + + + @last_page_viewed;noquote@ + + + + + You have not yet viewed any material from this course. + +

    + Click on the menu items on the left to view course materials + +

    + Index: openacs-4/packages/lorsm/www/delivery/body.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/body.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/lorsm/www/delivery/body.tcl 16 Jan 2008 16:54:45 -0000 1.8 +++ openacs-4/packages/lorsm/www/delivery/body.tcl 17 Nov 2008 13:38:35 -0000 1.9 @@ -1,16 +1,16 @@ # 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$ } { man_id:notnull - lmsfinish:optional + lmsfinish:optional } -properties { } -validate { } -errors { @@ -27,76 +27,73 @@ set initedonpage [ad_get_client_property lorsm initedonpage] if { $initedonpage!=0 && $initedonpage!="" } { - if { $lmsfinish > 0 } { - ns_log warning "SCORM : back to record view after lms finish, but it hasn't worked!" - ns_log warning "SCORM : resetting all visiting parameters." - ad_set_client_property lorsm studenttrack 0 - ad_set_client_property lorsm studenttrack "" - ad_set_client_property lorsm currenttrackid "" - ad_set_client_property lorsm initedonpage "" - } else { - ad_set_client_property lorsm studenttrack 0 - ns_log warning "SCORM : new content item with still open course ???" - ns_log warning "SCORM : we call for LMSFinish in place of the content!!!!!!???" - ad_returnredirect [export_vars -base lmsfinish {man_id initedonpage} ] - } + if { $lmsfinish > 0 } { + ns_log warning "SCORM : back to record view after lms finish, + but it hasn't worked!" + ns_log warning "SCORM : resetting all visiting parameters." + ad_set_client_property lorsm studenttrack 0 + ad_set_client_property lorsm studenttrack "" + ad_set_client_property lorsm currenttrackid "" + ad_set_client_property lorsm initedonpage "" + } else { + ad_set_client_property lorsm studenttrack 0 + ns_log warning "SCORM : new content item with still open course ???" + ns_log warning "SCORM : we call for LMSFinish in place of + the content!!!!!!???" + ad_returnredirect [export_vars -base lmsfinish {man_id initedonpage} ] + } } db_0or1row get_last_viewed { select ims_item_id as imsitem_id, coalesce(acs_object__name(object_id),'Item '||object_id) as last_page_viewed - from views_views v, - ims_cp_items i, - ims_cp_organizations o + from views_views v, ims_cp_items i, ims_cp_organizations o where v.viewer_id = :user_id - and v.object_id = i.ims_item_id - and i.org_id = o.org_id - and o.man_id = :man_id + and v.object_id = i.ims_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.ims_item_id - from ims_cp_items i, - ims_cp_organizations o + from ims_cp_items i, ims_cp_organizations o where o.man_id = :man_id - and i.org_id = o.org_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_views v - where v.viewer_id = :user_id - and v.object_id in ([join $all_items ,]) - "] +set viewed_items [db_list get_viewed_items \ + "select v.object_id + from views_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"] +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 "] -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"]} { - + 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]" - } + set course_name "[_ lorsm.No_Course_Name]" + } } else { set course_name "[_ lorsm.No_Course_Name]" -} \ No newline at end of file +} Index: openacs-4/packages/lorsm/www/delivery/bottom.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/bottom.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/delivery/bottom.adp 7 Jun 2006 14:05:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/delivery/bottom.adp 17 Nov 2008 13:38:35 -0000 1.3 @@ -1,16 +1,20 @@ - + - + -@prev_url;noquote@ -@next_url;noquote@ -@first_item_url;noquote@ - + @prev_url;noquote@ + @next_url;noquote@ + @first_item_url;noquote@ + + + - + Index: openacs-4/packages/lorsm/www/delivery/bottom.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/bottom.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/lorsm/www/delivery/bottom.tcl 16 Jan 2008 16:54:45 -0000 1.4 +++ openacs-4/packages/lorsm/www/delivery/bottom.tcl 17 Nov 2008 13:38:35 -0000 1.5 @@ -1,10 +1,10 @@ # packages/lorsm/www/delivery-bottom-bar/bottom.tcl ad_page_contract { - + } { - man_id:integer,notnull - {item_id:integer ""} + man_id:integer,notnull + {item_id:integer ""} } -properties { } -validate { } -errors { @@ -15,52 +15,67 @@ 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]} { - +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] + -user_id $user_id \ + -community_id $community_id \ + -course_id $man_id] } else { set track_id 0 } # return_url -set return_url [dotlrn_community::get_community_url [dotlrn_community::get_community_id]] +set return_url [dotlrn_community::get_community_url \ + [dotlrn_community::get_community_id]] set item_list [lorsm::get_item_list $man_id $user_id] -set last_item_viewed [db_string select_last_item_viewed { - select ims_item_id - from views_views v, - ims_cp_items i, - ims_cp_organizations o - where v.viewer_id = :user_id - and v.object_id = i.ims_item_id - and i.org_id = o.org_id - and o.man_id = :man_id - order by v.last_viewed desc - limit 1 -} -default "no_item"] +set last_item_viewed [db_string select_last_item_viewed { + select ims_item_id + from views_views v, ims_cp_items i, ims_cp_organizations o + where v.viewer_id = :user_id + and v.object_id = i.ims_item_id + and i.org_id = o.org_id + and o.man_id = :man_id + order by v.last_viewed desc + limit 1 + } -default "no_item"] set first_item_id [lindex $item_list 0] -set first_item_url "" +set first_item_url "" set curr_index [expr [lsearch -exact $item_list $last_item_viewed]] set prev_item_id [lindex $item_list [expr $curr_index - 1]] set next_item_id [lindex $item_list [expr $curr_index + 1]] -set prev_url "" -set next_url "" +set prev_url "" +set next_url "" + if { [string eq $last_item_viewed "no_item"] } { - # first time accessing the course - set next_url "" - set prev_url "" -} elseif { ![expr [llength $item_list] - $curr_index - 1] } { - # last item - set next_url "" + # first time accessing the course + set next_url "" + set prev_url "" +} elseif { ![expr [llength $item_list] - $curr_index - 1] } { + # last item + set next_url "" } elseif { ![expr $curr_index] } { - # first item - set prev_url "" + # first item + set prev_url "" } - Index: openacs-4/packages/lorsm/www/delivery/delivery-bottom-bar.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/delivery-bottom-bar.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/delivery/delivery-bottom-bar.adp 7 Jun 2006 14:05:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/delivery/delivery-bottom-bar.adp 17 Nov 2008 13:38:35 -0000 1.3 @@ -3,6 +3,11 @@ @course_name@ - - + + Index: openacs-4/packages/lorsm/www/delivery/delivery-context-bar.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/delivery-context-bar.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/delivery/delivery-context-bar.adp 27 Jun 2006 16:33:21 -0000 1.1 +++ openacs-4/packages/lorsm/www/delivery/delivery-context-bar.adp 17 Nov 2008 13:38:35 -0000 1.2 @@ -1,18 +1,31 @@ - -@current_title@ - - - -

    @current_title@

    -

    item_id @item_id@

    -

    [@progress_list:item@][@progress_list:item@] -

    - - - -NEXT - - \ No newline at end of file + + @current_title@ + + + + +

    @current_title@

    +

    item_id @item_id@

    +

    + + + [@progress_list:item@] + + [@progress_list:item@] + + +

    + + + + + NEXT + + + Index: openacs-4/packages/lorsm/www/delivery/delivery-context-bar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/delivery-context-bar.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/delivery/delivery-context-bar.tcl 16 Jan 2008 16:54:45 -0000 1.2 +++ openacs-4/packages/lorsm/www/delivery/delivery-context-bar.tcl 17 Nov 2008 13:38:36 -0000 1.3 @@ -1,7 +1,7 @@ # packages/lorsm/www/delivery/delivery-context-bar.tcl ad_page_contract { - + } { {__include ""} } -properties { @@ -11,21 +11,23 @@ if {![info exists man_id] || $man_id eq ""} { set man_id [ad_get_client_property lorsm man_id] } + if {![info exists item_id]} { set item_id [ad_get_client_property lorsm ims_id] } + set community_id [dotlrn_community::get_community_id] set user_id [ad_conn user_id] set lorsm_url [dotlrn_community::get_community_url $community_id]lorsm/delivery # Student tracking set package_id [ad_conn package_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] +\# -user_id $user_id \ +\# -community_id $community_id \ +\# -course_id $man_id] #} else { set track_id 0 #} @@ -35,45 +37,71 @@ set item_list [lorsm::get_item_list $man_id $user_id] -set last_item_viewed [db_string select_last_item_viewed { - select ims_item_id - from views_views v, - ims_cp_items i, - ims_cp_organizations o - where v.viewer_id = :user_id - and v.object_id = i.ims_item_id - and i.org_id = o.org_id - and o.man_id = :man_id - order by v.last_viewed desc - limit 1 -} -default ""] +set last_item_viewed [db_string select_last_item_viewed { + select ims_item_id + from views_views v, ims_cp_items i, ims_cp_organizations o + where v.viewer_id = :user_id + and v.object_id = i.ims_item_id + and i.org_id = o.org_id + and o.man_id = :man_id + order by v.last_viewed desc + limit 1 + } -default ""] - set first_item_id [lindex $item_list 0] -set first_item_url "" +set first_item_url " + " + if {$item_id eq ""} { set item_id $first_item_id ad_returnredirect [export_vars -base ${lorsm_url}/record-view {man_id item_id}] ad_script_abort } + #set curr_index [expr [lsearch -exact $item_list $last_item_viewed]] set curr_index [expr [lsearch -exact $item_list $item_id]] -if {$curr_index < 1} {set curr_index 0} +if {$curr_index < 1} { + set curr_index 0 +} set prev_item_id [lindex $item_list [expr $curr_index - 1]] set next_item_id [lindex $item_list [expr $curr_index + 1]] -set prev_url "" -set next_url [export_vars -base "${lorsm_url}/record-view" -url {{item_id $next_item_id} man_id}] +set prev_url " + " -set prev_title [db_string get_title "select item_title from ims_cp_items where ims_item_id=:prev_item_id" -default ""] -set next_title [db_string get_title "select item_title from ims_cp_items where ims_item_id=:next_item_id" -default ""] -set current_title [db_string get_title "select item_title from ims_cp_items where ims_item_id=:last_item_viewed" -default ""] +set next_url [export_vars \ + -base "${lorsm_url}/record-view" \ + -url {{item_id $next_item_id} man_id}] +set prev_title [db_string get_title \ + "select item_title + from ims_cp_items + where ims_item_id=:prev_item_id" -default ""] + +set next_title [db_string get_title \ + "select item_title + from ims_cp_items + where ims_item_id=:next_item_id" -default ""] + +set current_title [db_string get_title \ + "select item_title + from ims_cp_items + where ims_item_id=:last_item_viewed" -default ""] + set progress_list [template::util::number_list [llength $item_list] 1] set progress_index [expr {$curr_index + 1}] if {[string match "*assessment*" $__include]} { set show_next 0 } else { show_next 1 -} \ No newline at end of file +} Index: openacs-4/packages/lorsm/www/delivery/delivery-no-index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/delivery-no-index.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/delivery/delivery-no-index.adp 7 Jun 2006 14:05:44 -0000 1.2 +++ openacs-4/packages/lorsm/www/delivery/delivery-no-index.adp 17 Nov 2008 13:38:36 -0000 1.3 @@ -1,18 +1,19 @@
    - +

    #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# - + #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/delivery-progress-bar.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/delivery-progress-bar.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/lorsm/www/delivery/delivery-progress-bar.adp 6 Apr 2007 19:30:21 -0000 1.5 +++ openacs-4/packages/lorsm/www/delivery/delivery-progress-bar.adp 17 Nov 2008 13:38:36 -0000 1.6 @@ -1,29 +1,47 @@ - -@page_title@ - -@header_stuff;noquote@ - - -

    @current_title@

    - + + @page_title@ + + @header_stuff;noquote@ + + +

    @current_title@

    + + + + @include_content;noquote@ + + +

    + @next_link_text@ +

    +
    + + + EXIT COURSE + + + Index: openacs-4/packages/lorsm/www/delivery/delivery-progress-bar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/delivery-progress-bar.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/lorsm/www/delivery/delivery-progress-bar.tcl 8 Oct 2008 13:01:06 -0000 1.11 +++ openacs-4/packages/lorsm/www/delivery/delivery-progress-bar.tcl 17 Nov 2008 13:38:36 -0000 1.12 @@ -1,7 +1,7 @@ # packages/lorsm/www/delivery/delivery-context-bar.tcl ad_page_contract { - + } { {__include ""} {__include_vars ""} @@ -15,14 +15,18 @@ if {![info exists man_id] || $man_id eq ""} { set man_id [ad_get_client_property lorsm man_id] } + if {![info exists item_id]} { set item_id [ad_get_client_property lorsm ims_id] } ns_log notice "delivery progress bar DEBUG:: item_id $item_id" set community_id [dotlrn_community::get_community_id] set user_id [ad_conn user_id] -set track_id [lorsm::track::get_track_id -user_id $user_id -man_id $man_id -community_id $community_id] +set track_id [lorsm::track::get_track_id \ + -user_id $user_id \ + -man_id $man_id \ + -community_id $community_id] #ns_log notice "DAVEB LORSM BEFORE TRACK_ID='${track_id}'" set lorsm_url [dotlrn_community::get_community_url $community_id]lorsm/delivery @@ -34,7 +38,14 @@ set item_list [lorsm::get_item_list $man_id $user_id] set first_item_id [lindex $item_list 0] -set first_item_url "" +set first_item_url " + " + set curr_index [expr [lsearch -exact $item_list $item_id]] set next_link_text [_ lorsm.Next] @@ -43,15 +54,26 @@ if {$curr_index < 0} { set lorsm_return_url [get_referrer] ad_set_client_property lorsm lorsm_return_url $lorsm_return_url - + if {$track_id ne "" && $track_id ne "0"} { - set last_viewed_item_id [db_string get_last_viewed "select object_id from views_views, lorsm_student_track where viewer_id = :user_id and object_id in ([template::util::tcl_to_sql_list $item_list]) and track_id=:track_id and last_viewed > start_time order by last_viewed desc limit 1" -default ""] - if {$last_viewed_item_id ne ""} { - set item_id $last_viewed_item_id - ad_set_client_property lorsm ims_id $item_id - ad_returnredirect [export_vars -base "${lorsm_url}/record-view" -url {{item_id $item_id} track_id man_id}] - ad_script_abort - } + set last_viewed_item_id [db_string get_last_viewed \ + "select object_id + from views_views, lorsm_student_track + where viewer_id = :user_id + and object_id in ([template::util::tcl_to_sql_list $item_list]) + and track_id=:track_id + and last_viewed > start_time + order by last_viewed desc + limit 1" -default ""] + + if {$last_viewed_item_id ne ""} { + set item_id $last_viewed_item_id + ad_set_client_property lorsm ims_id $item_id + ad_returnredirect [export_vars \ + -base "${lorsm_url}/record-view" \ + -url {{item_id $item_id} track_id man_id}] + ad_script_abort + } } # start course @@ -60,27 +82,34 @@ # do we have a custom start page? set item_id [lorsm::get_custom_page_ims_item_id -man_id $man_id -type start] if {$item_id eq ""} { - set __include "/packages/lorsm/lib/start" - set page_title [lorsm::get_course_name -manifest_id $man_id] + set __include "/packages/lorsm/lib/start" + set page_title [lorsm::get_course_name -manifest_id $man_id] } else { - ad_set_client_property lorsm ims_id $item_id - set __include /packages/lorsm/lib/default - set page_title [db_string get_title "select item_title from ims_cp_items where ims_item_id=:item_id" -default ""] + ad_set_client_property lorsm ims_id $item_id + set __include /packages/lorsm/lib/default + set page_title [db_string get_title \ + "select item_title + from ims_cp_items + where ims_item_id=:item_id" -default ""] } + set next_link_text [_ lorsm.Begin] if {$track_id ne ""} { - set next_link_text [_ lorsm.Continue] + set next_link_text [_ lorsm.Continue] } set track_p 0 } + # Student tracking -if {[lorsm::track::istrackable -course_id $man_id -package_id $package_id] \ +if {[lorsm::track::istrackable \ + -course_id $man_id \ + -package_id $package_id] \ && $track_p && ($track_id == 0 || $track_id eq "")} { - + set track_id [lorsm::track::new \ - -user_id $user_id \ - -community_id $community_id \ - -course_id $man_id] + -user_id $user_id \ + -community_id $community_id \ + -course_id $man_id] ad_set_client_property lorsm studenttrack $track_id } elseif {$track_id eq ""} { set track_id 0 @@ -93,17 +122,38 @@ set prev_item_id [lindex $item_list [expr $curr_index - 1]] set next_item_id [lindex $item_list [expr $curr_index + 1]] -set prev_url "" -set next_url [export_vars -base "${lorsm_url}/record-view" -url {{item_id $next_item_id} track_id man_id}] +set prev_url " + " -set prev_title [db_string get_title "select item_title from ims_cp_items where ims_item_id=:prev_item_id" -default ""] -set next_title [db_string get_title "select item_title from ims_cp_items where ims_item_id=:next_item_id" -default ""] -set current_title [db_string get_title "select item_title from ims_cp_items where ims_item_id=:item_id" -default ""] +set next_url [export_vars \ + -base "${lorsm_url}/record-view" \ + -url {{item_id $next_item_id} track_id man_id}] +set prev_title [db_string get_title \ + "select item_title + from ims_cp_items + where ims_item_id=:prev_item_id" -default ""] + +set next_title [db_string get_title \ + "select item_title + from ims_cp_items + where ims_item_id=:next_item_id" -default ""] + +set current_title [db_string get_title \ + "select item_title + from ims_cp_items + where ims_item_id=:item_id" -default ""] + set progress_total_pages [llength $item_list] set progress_current_page [expr {$curr_index + 1}] set last_item_p [expr {$curr_index == [expr {[llength $item_list] - 1}]}] -if {[string match "*assessment*" $__include] && ![string match "*assessment/lib/session*" $__include]} { +if {[string match "*assessment*" $__include] && \ + ![string match "*assessment/lib/session*" $__include]} { set show_next 0 template::head::add_css \ -href "/resources/assessment/crbForms.css" @@ -112,34 +162,39 @@ set last_item_p 0 } else { if { $next_item_id eq "" } { - # check for end page - set next_url ${lorsm_url}/end - set last_item_p 0 + # check for end page + set next_url ${lorsm_url}/end + set last_item_p 0 } set show_next 1 } if {$__include eq "/packages/lorsm/lib/end"} { if {$track_id ne "0"} { -ns_log notice "HEY PROGRESS BAR END GOING TO TRACK $track_id" - lorsm::track::exit -track_id $track_id + ns_log notice "HEY PROGRESS BAR END GOING TO TRACK $track_id" + lorsm::track::exit -track_id $track_id } + set item_id [lorsm::get_custom_page_ims_item_id -man_id $man_id -type end] if {$item_id ne ""} { - ad_set_client_property lorsm ims_id $item_id - set __include /packages/lorsm/lib/default - set page_title [db_string get_title "select item_title from ims_cp_items where ims_item_id=:item_id" -default ""] + ad_set_client_property lorsm ims_id $item_id + set __include /packages/lorsm/lib/default + set page_title [db_string get_title "select item_title from ims_cp_items where ims_item_id=:item_id" -default ""] } + set lorsm_return_url [ad_get_client_property lorsm lorsm_return_url] if {$lorsm_return_url ne ""} { - set return_url $lorsm_return_url + set return_url $lorsm_return_url } - set next_url [export_vars -base exit {man_id track_id return_url}] - set last_item_p 1 - + set next_url [export_vars -base exit {man_id track_id return_url}] + set last_item_p 1 } -if {$item_id eq "" && $__include ne "/packages/lorsm/lib/start" && $__include ne "/packages/lorsm/lib/end"} { - ad_returnredirect -message "[_ lorsm.This_course_contains_no_items]" [get_referrer] + +if {$item_id eq "" && $__include ne "/packages/lorsm/lib/start" \ + && $__include ne "/packages/lorsm/lib/end"} { + ad_returnredirect \ + -message "[_ lorsm.This_course_contains_no_items]" \ + [get_referrer] ad_script_abort } set include_content [template::adp_include $__include $__include_vars] @@ -152,15 +207,31 @@ if {[info exists ::js_order]} { foreach js $::js_order { - template::head::add_script \ - -src $js + template::head::add_script -src $js } } template::head::add_style -style \ -".current-item { font-weight: bold; font-size: 1.2em; } -.next-button { margin: 4px; padding-left: 4px; padding-right: 4px; border-top: 2px solid #fff; border-left: 2px solid #fff; border-right: 2px solid #999; border-bottom: 2px solid #999; background-color: #eee;} -.next-button a { text-decoration: none; color: black; font-size: .8em; font-family: sans-serif;}" + ".current-item { + font-weight: bold; + font-size: 1.2em; + } + .next-button { + margin: 4px; + padding-left: 4px; + padding-right: 4px; + border-top: 2px solid #fff; + border-left: 2px solid #fff; + border-right: 2px solid #999; + border-bottom: 2px solid #999; + background-color: #eee; + } + .next-button a { + text-decoration: none; + color: black; + font-size: .8em; + font-family: sans-serif; + }" Index: openacs-4/packages/lorsm/www/delivery/delivery-scorm.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/delivery-scorm.adp,v diff -u -r1.8 -r1.9 --- openacs-4/packages/lorsm/www/delivery/delivery-scorm.adp 17 Oct 2008 10:46:31 -0000 1.8 +++ openacs-4/packages/lorsm/www/delivery/delivery-scorm.adp 17 Nov 2008 13:38:36 -0000 1.9 @@ -1,45 +1,64 @@ - - - + + + + @course_name@ + - @course_name@ - + + + + + + + -
    - - - - + + &item_id=@item_id@ + + + + &ims_id=@ims_id@ + + + &track_id=@track_id@ + + + &menu_off=@menu_off@ + " name="AppletContainerFrame" scrolling=no frameborder="0" title="#lorsm.Applet_frame#"> + - + - + + - + - + + - - - - - + + + + + + + - - - - Index: openacs-4/packages/lorsm/www/delivery/delivery.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/delivery.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/lorsm/www/delivery/delivery.adp 17 Oct 2008 10:46:31 -0000 1.6 +++ openacs-4/packages/lorsm/www/delivery/delivery.adp 17 Nov 2008 13:38:36 -0000 1.7 @@ -1,11 +1,23 @@ - - -@course_name@ - - - - - + + + @course_name@ + + + + + Index: openacs-4/packages/lorsm/www/delivery/exit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/exit.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/lorsm/www/delivery/exit.tcl 13 Aug 2007 09:20:16 -0000 1.4 +++ openacs-4/packages/lorsm/www/delivery/exit.tcl 17 Nov 2008 13:38:36 -0000 1.5 @@ -1,9 +1,9 @@ # 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 @@ -14,42 +14,49 @@ } -properties { } -validate { } -errors { -} +} #set the following accordingly set level "debug" - set track_id [ad_get_client_property lorsm currenttrackid] - set lorsmstudenttrack [ad_get_client_property lorsm studenttrack] +set track_id [ad_get_client_property lorsm currenttrackid] +set lorsmstudenttrack [ad_get_client_property lorsm studenttrack] - - ns_log $level "EXIT track_id $track_id" - ns_log $level "SCORM lorsmstudenttrack $lorsmstudenttrack" +ns_log $level "EXIT track_id $track_id" +ns_log $level "SCORM lorsmstudenttrack $lorsmstudenttrack" - if { ! [empty_string_p $lorsmstudenttrack] } { +if { ! [empty_string_p $lorsmstudenttrack] } { if { $lorsmstudenttrack == 0 } { - lorsm::track::exit -track_id $track_id } else { - #speficic for courses for which istrackable is on - lorsm::track::exit -track_id $lorsmstudenttrack } - ns_log $level "SCORM exiting a scorm course which didnt'actually FINISH" + lorsm::track::exit -track_id $track_id } else { - ns_log $level "SCORM exiting a scorm course which never INITED" + #speficic for courses for which istrackable is on + lorsm::track::exit -track_id $lorsmstudenttrack } - #unset the CLIENT properties - ad_set_client_property lorsm currenttrackid "" - ad_set_client_property lorsm studenttrack "" - if { $track_id == 0 || $track_id == "" } { - ns_log $level "delivery/exit leaving non rte-inited (or better a rte-finished) course" - } else { - ns_log $level "delivery/exit leaving course which had been rte-inited but NOT FINISHED (user forcing exit before time) (lorsm_cmi_core.track_id=$track_id)" - } - if { $lorsmstudenttrack == 0 || $lorsmstudenttrack == "" } { - ns_log $level "delivery/exit leaving non istrackable course" - } else { - ns_log $level "delivery/exit leaving course which was either istrackable or rte-inited (lorsm_student_track.track_id=$lorsmstudenttrack" - } + ns_log $level "SCORM exiting a scorm course which didnt'actually FINISH" +} else { + ns_log $level "SCORM exiting a scorm course which never INITED" +} +#unset the CLIENT properties +ad_set_client_property lorsm currenttrackid "" +ad_set_client_property lorsm studenttrack "" +if { $track_id == 0 || $track_id == "" } { + ns_log $level "delivery/exit leaving non rte-inited + (or better a rte-finished) course" +} else { + ns_log $level "delivery/exit leaving course which had been + rte-inited but NOT FINISHED (user forcing exit before + time) (lorsm_cmi_core.track_id=$track_id)" +} +if { $lorsmstudenttrack == 0 || $lorsmstudenttrack == "" } { + ns_log $level "delivery/exit leaving non istrackable course" +} else { + ns_log $level "delivery/exit leaving course which was either + istrackable or rte-inited + (lorsm_student_track.track_id=$lorsmstudenttrack" +} + # redirects ns_log $level "delivery/exit $return_url" - ad_returnredirect $return_url +ad_returnredirect $return_url Index: openacs-4/packages/lorsm/www/delivery/header.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/header.html,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/delivery/header.html 6 Mar 2008 13:41:10 -0000 1.3 +++ openacs-4/packages/lorsm/www/delivery/header.html 17 Nov 2008 13:38:36 -0000 1.4 @@ -1,55 +1,50 @@ - - -Navigation Window + + + Navigation Window - + - - + + - -

    WTF

    -
    + +

    WTF

    +
    + + + + + + + + - + height="100" + id="APIAdapter" + name="APIAdapter" + width="100" + mayscript="true"> + + + +
    + + - - - - - - - - - - -
    - - - - - - Index: openacs-4/packages/lorsm/www/delivery/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/index.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/lorsm/www/delivery/index.adp 13 Aug 2007 09:20:16 -0000 1.6 +++ openacs-4/packages/lorsm/www/delivery/index.adp 17 Nov 2008 13:38:36 -0000 1.7 @@ -1,3 +1,3 @@ + &="track_id" &="ims_id" &="ses_renew" &="menu_off" + &="debuglevel" &="return_url"> Index: openacs-4/packages/lorsm/www/delivery/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/index.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/lorsm/www/delivery/index.tcl 8 Oct 2008 13:01:06 -0000 1.14 +++ openacs-4/packages/lorsm/www/delivery/index.tcl 17 Nov 2008 13:38:36 -0000 1.15 @@ -1,9 +1,9 @@ # 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 @@ -24,36 +24,37 @@ ad_set_client_property lorsm debuglevel $debuglevel ad_set_client_property lorsm menu_type $menu_type -set ses_renew [ad_parameter -package_id [ad_acs_kernel_id] SessionRenew security 300] +set ses_renew [ad_parameter \ + -package_id [ad_acs_kernel_id] \ + SessionRenew security 300] - if { ! [info exists menu_off] } { - set menu_off 0 + set menu_off 0 } set user_id [ad_conn user_id] if { [info exists item_id] } { ad_set_client_property lorsm ims_id $item_id if { ! [info exists ims_id] } { - set ims_id $item_id - } + set ims_id $item_id + } } else { - if { $menu_off == 0 } { - ad_set_client_property lorsm ims_id "" - ns_log notice "UNSETTING LORSM IMS_ID '[ad_conn url]'" - } else { - #given menu_off without ims_id, i have to provide a default one! - #since an ims_item_id wasn't provided, we just pick up the first one - set item_list [lorsm::get_item_list $man_id $user_id] - set ims_id [lindex $item_list 0] - ad_set_client_property lorsm ims_id $ims_id - } + if { $menu_off == 0 } { + ad_set_client_property lorsm ims_id "" + ns_log notice "UNSETTING LORSM IMS_ID '[ad_conn url]'" + } else { + #given menu_off without ims_id, i have to provide a default one! + #since an ims_item_id wasn't provided, we just pick up the first one + set item_list [lorsm::get_item_list $man_id $user_id] + set ims_id [lindex $item_list 0] + ad_set_client_property lorsm ims_id $ims_id + } } if { [info exists ims_id] } { set item_id $ims_id - ad_set_client_property lorsm ims_id $ims_id + ad_set_client_property lorsm ims_id $ims_id # ns_log notice "SETTING LORSM IMS_ID = '${ims_id}' '[ad_conn url]'" set body_url [export_vars -base "record-view" -url {item_id man_id}] } @@ -62,42 +63,36 @@ # Get the course name if {[db_0or1row manifest " - select - cp.course_name, - cp.fs_package_id, - isscorm, - pf.folder_name, - pf.format_name, - case - when upper(scorm_type) = 'SCO' then 'delivery-scorm' - else 'delivery' + select cp.course_name, cp.fs_package_id, isscorm, pf.folder_name, pf.format_name, + case + when upper(scorm_type) = 'SCO' then 'delivery-scorm' + else 'delivery' end as deliverymethod - from - ims_cp_manifests cp left join (select man_id, max(scorm_type) as scorm_type from ims_cp_resources group by man_id ) as cpr using (man_id) , - lorsm_course_presentation_formats pf - where - cp.man_id = :man_id - and cp.parent_man_id = 0 - and cp.course_presentation_format = pf.format_id "]} { - + from ims_cp_manifests cp + left join (select man_id, max(scorm_type) as scorm_type from ims_cp_resources group by man_id ) as cpr using (man_id), + lorsm_course_presentation_formats pf + where + cp.man_id = :man_id + and cp.parent_man_id = 0 + and cp.course_presentation_format = pf.format_id "]} { + # Course Name if {[empty_string_p $course_name]} { - set course_name "No Course Name" - } + set course_name "No Course Name" + } } else { set course_name "No Course Name" } ns_log warning "\$isscorm=$isscorm while delivery method has to be = $deliverymethod" - if {$isscorm} { set folder_name "delivery-scorm" } else { - # workaround for when isscorm is set to inconsisten value - # (who sets it ?) - if {$deliverymethod=="delivery-scorm"} { - set folder_name delivery-scorm - } + # workaround for when isscorm is set to inconsisten value + # (who sets it ?) + if {$deliverymethod=="delivery-scorm"} { + set folder_name delivery-scorm + } } set return_url [dotlrn_community::get_community_url [dotlrn_community::get_community_id]] @@ -108,33 +103,45 @@ ad_set_client_property lorsm currentcourse $man_id -set enabled_p [db_string enabled_p "select isenabled from ims_cp_manifest_class where man_id=:man_id and community_id=:community_id" -default "f"] +set enabled_p [db_string enabled_p \ + "select isenabled + from ims_cp_manifest_class + where man_id=:man_id + and community_id=:community_id" -default "f"] + set item_list [lorsm::get_item_list $man_id $user_id] if {$enabled_p} { - permission::require_permission \ - -party_id $user_id \ - -object_id $man_id \ - -privilege read + permission::require_permission \ + -party_id $user_id \ + -object_id $man_id \ + -privilege read } else { - permission::require_permission \ - -party_id $user_id \ - -object_id $man_id \ - -privilege admin + permission::require_permission \ + -party_id $user_id \ + -object_id $man_id \ + -privilege admin } -set start_page [lorsm::get_custom_page_ims_item_id -man_id $man_id -type start] +set start_page [lorsm::get_custom_page_ims_item_id \ + -man_id $man_id \ + -type start] -if {$start_page eq "" && [lorsm::track::istrackable -course_id $man_id -package_id $package_id]} { - set track_id [lorsm::track::get_track_id -user_id $user_id -man_id $man_id -community_id $community_id] +if {$start_page eq "" && [lorsm::track::istrackable \ + -course_id $man_id \ + -package_id $package_id]} { + set track_id [lorsm::track::get_track_id \ + -user_id $user_id \ + -man_id $man_id \ + -community_id $community_id] if {$track_id eq "" || $track_id eq 0} { - set track_id [lorsm::track::new \ - -user_id $user_id \ - -community_id $community_id \ - -course_id $man_id] + set track_id [lorsm::track::new \ + -user_id $user_id \ + -community_id $community_id \ + -course_id $man_id] } - ad_set_client_property lorsm studenttrack $track_id + ad_set_client_property lorsm studenttrack $track_id } else { set track_id 0 ad_set_client_property lorsm studenttrack 0 Index: openacs-4/packages/lorsm/www/delivery/keepalive.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/keepalive.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/delivery/keepalive.adp 17 Oct 2008 10:46:31 -0000 1.3 +++ openacs-4/packages/lorsm/www/delivery/keepalive.adp 17 Nov 2008 13:38:36 -0000 1.4 @@ -1,12 +1,12 @@

    -Keepalive window -Shouldn't ever turn to login HREF - + Keepalive window + Shouldn't ever turn to login HREF <%= [ns_httptime [ns_time]] %>

    + #acs-subsite.Not_logged_in#
    -#acs-subsite.Login_or_register# + #acs-subsite.Login_or_register#
    -@user_name@
    + @user_name@
    Index: openacs-4/packages/lorsm/www/delivery/lmsfinish.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/lmsfinish.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/delivery/lmsfinish.adp 6 Mar 2008 13:41:10 -0000 1.3 +++ openacs-4/packages/lorsm/www/delivery/lmsfinish.adp 17 Nov 2008 13:38:37 -0000 1.4 @@ -1,106 +1,95 @@ + + + + SCORM FINISHER + + + I will send you to: + the new item_id is @item_id@, while the old one is @initedonpage@ + + + -//--> - - - - -I will send you to: -the new item_id is @item_id@, while the old one is @initedonpage@ - - - - - Index: openacs-4/packages/lorsm/www/delivery/lmsfinish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/lmsfinish.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/delivery/lmsfinish.tcl 13 Aug 2007 09:20:16 -0000 1.2 +++ openacs-4/packages/lorsm/www/delivery/lmsfinish.tcl 17 Nov 2008 13:38:37 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/delivery-scorm/lmsfinish.tcl ad_page_contract { - + called if an user is swithing between items of the same manifest, - WITHOUT the content having previously called LMSFinish + WITHOUT the content having previously called LMSFinish @author Michele Slocovich () @creation-date 2004-07-04 @@ -14,14 +14,14 @@ } -properties { } -validate { } -errors { -} +} if { ! [info exists item_id] } { - set item_id 0 + set item_id 0 } #this should automatically happen. nevertheless we put it here #ad_set_client_property lorsm studenttrack "" #ad_set_client_property lorsm currenttrackid "" #ad_set_client_property lorsm initedonpage "" - + Index: openacs-4/packages/lorsm/www/delivery/menu-mk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/menu-mk.adp,v diff -u -r1.9 -r1.10 --- openacs-4/packages/lorsm/www/delivery/menu-mk.adp 17 Oct 2008 10:46:31 -0000 1.9 +++ openacs-4/packages/lorsm/www/delivery/menu-mk.adp 17 Nov 2008 13:38:37 -0000 1.10 @@ -1,93 +1,100 @@ - - - - - + + + + + - + + + + + - - - - - - - - - + - + - -
    - - debug is: ON
    - delivery is: @deliverymethod@ -
    -
    +
    + + debug is: ON
    + delivery is: @deliverymethod@ +
    +
    -
    -
    +
    -
    -
    +
    - + Index: openacs-4/packages/lorsm/www/delivery/menu-mk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/menu-mk.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/lorsm/www/delivery/menu-mk.tcl 17 Oct 2008 10:46:31 -0000 1.5 +++ openacs-4/packages/lorsm/www/delivery/menu-mk.tcl 17 Nov 2008 13:38:37 -0000 1.6 @@ -1,15 +1,15 @@ # packages/lorsm/www/delivery/menu-mk.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$ } { - man_id:integer,notnull + man_id:integer,notnull ims_id:integer,notnull,optional menu_off:integer,notnull,optional track_id:integer,notnull,optional @@ -19,10 +19,12 @@ } if { ![info exists track_id] } { - set track_id 0 } + set track_id 0 +} if { ![info exists menu_off] } { - set menu_off 0 } + set menu_off 0 +} set debuglevel [ad_get_client_property lorsm debuglevel] set deliverymethod [ad_get_client_property lorsm deliverymethod] @@ -53,33 +55,44 @@ lappend items_list $item } # 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 { + 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') + andorg_id = :org_id }] # Get the root items - 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 { + 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] #lappend control_list $ims_item_id 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 } { + db_foreach get_items { + select ims_item_id + from ims_cp_items + where parent_item = :item_id + and org_id = :org_id } { if { [string equal [lsearch -exact $control_list $ims_item_id] "-1"] } { #this duplicates ITEMS lappend items_list [list $ims_item_id $indent] #lappend control_list $ims_item_id incr count } } } - } + } } -template::multirow create tree_items icon link label indent last_indent target +template::multirow create tree_items icon link label indent last_indent target set community_id [dotlrn_community::get_community_id] set counter 1 @@ -102,7 +115,7 @@ set level [lindex $one 0] set item_id [lindex $one 1] set title [lindex $one 2] - + set title [fs::remove_special_file_system_characters -string $title] regsub {'} $title {\'} title @@ -114,11 +127,11 @@ upvar #$adp_level man_id man_id set url "[export_vars -base "record-view" \ -url {item_id man_id}]" - + if { $index < [expr $itemcount - 1] } { # Get the tree level of the next item set nextlevel [lindex [lindex $items [incr index]] 0] - + # Loop through each item until an item with a different # level is encountered if { $level == $nextlevel } { @@ -136,13 +149,11 @@ template::multirow append tree_items "NEXTLEVEL" $url $title $level if { [llength $submenu] } { # There's a submenu - lappend levelitems \ - "\['$title', $url,\n$submenu\n\]" + lappend levelitems "\['$title', $url,\n$submenu\n\]" } else { # Child is a lone leaf node, if so, it should have # replace the url, the item_id and decremented counter - lappend levelitems \ - "\['$title', $url\]" + lappend levelitems "\['$title', $url\]" } # The index should have been adjusted by now to point @@ -155,7 +166,7 @@ return [join $levelitems ",\n"] } } - + } else { # Next item has lower level set localindex $index @@ -167,29 +178,20 @@ upvar item_id my_item_id set my_url $url set my_item_id $item_id - return [list] } else { lappend TREE_HASH "TREE_HASH\[\"ims_id.$item_id\"\] = $counter;" template::multirow append tree_items "LEAF" $url $title $level incr counter - return [join \ - [lappend levelitems \ - "\['$title', $url\]" - ] ",\n" - ] + return [join [lappend levelitems "\['$title', $url\]"] ",\n"] } } } else { # Terminator, end of the list set localindex [expr $index + 1] lappend TREE_HASH "TREE_HASH\[\"ims_id.$item_id\"\] = $counter;" incr counter - return [join \ - [lappend levelitems \ - "\['$title', $url\]" - ] ",\n" - ] + return [join [lappend levelitems "\['$title', $url\]"] ",\n"] } } @@ -200,64 +202,44 @@ # Counter starts at 1 coz Course Index isn't part of the list db_foreach organizations { - select - org.org_id, - org.org_title as org_title, - org.hasmetadata, - man_id, - 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 + select org.org_id, org.org_title as org_title, org.hasmetadata, man_id, 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 } { #trying to visualize organizations - lappend js [list 0 $org_id $org_title $man_id "ims/organization" ""] - - db_foreach sql { - SELECT + lappend js [list 0 $org_id $org_title $man_id "ims/organization" ""] + + db_foreach sql { + select -- (tree_level(ci.tree_sortkey) - :indent ) as indent, - i.parent_item, - i.ims_item_id, - i.item_title as item_title, - i.prerequisites_s as prerequisites, - cr.mime_type - FROM - acs_objects o, ims_cp_items i, cr_items ci, cr_revisions cr, - ims_cp_manifest_class im - WHERE - o.object_type = 'ims_item_object' - AND - i.org_id = :org_id - AND - o.object_id = i.ims_item_id - AND - im.man_id=:man_id - and im.isenabled='t' - and im.community_id=:community_id - and ci.item_id=cr.item_id - and cr.revision_id=i.ims_item_id + i.parent_item, i.ims_item_id, i.item_title as item_title, i.prerequisites_s as prerequisites, cr.mime_type + from acs_objects o, ims_cp_items i, cr_items ci, cr_revisions cr, ims_cp_manifest_class im + where o.object_type = 'ims_item_object' + and i.org_id = :org_id + and o.object_id = i.ims_item_id + and im.man_id=:man_id + and im.isenabled='t' + and im.community_id=:community_id + and ci.item_id=cr.item_id + and cr.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') - 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, ci.tree_sortkey + order by i.sort_order, o.object_id, ci.tree_sortkey } { foreach item $items_list { set item_id [lindex $item 0] set indent [lindex $item 1] if { [string equal $item_id $ims_item_id] } { - lappend js [list $indent $ims_item_id $item_title $man_id $mime_type $prerequisites] + lappend js [list $indent $ims_item_id \ + $item_title $man_id \ + $mime_type $prerequisites] } } } @@ -266,17 +248,18 @@ if { [info exists js] } { set last_indent 1 foreach l $js { - foreach {indent item_id title man_id mime_type prerequisites} $l {break} - + foreach {indent item_id title man_id mime_type prerequisites} $l { + break + } + #analyzing LESSON STATUS for the ITEM #this could as well become a lorsm:scorm:function - + ns_log debug "MENU-MK tree : $indent $item_id $title " - if { ! [string equal $mime_type "ims/organization"] } { - - if { [ db_0or1row isnotanemptyitem "select res_id - from ims_cp_items_to_resources + if { [ db_0or1row isnotanemptyitem \ + "select res_id + from ims_cp_items_to_resources where ims_item_id= $item_id limit 1" ] } { set icon "" @@ -285,168 +268,224 @@ #time will tell if the assumption is correct. set icon "\"Folder\"" } - - if { ! [ db_0or1row isanysuspendedsession "select lorsm.track_id as track_id, - cmi.lesson_status as lesson_status from - lorsm_student_track lorsm, lorsm_cmi_core cmi - where - lorsm.user_id = $user_id - and - lorsm.community_id = $community_id - and - lorsm.course_id = $man_id - and - lorsm.track_id = cmi.track_id - and - cmi.man_id = $man_id - and - cmi.item_id = $item_id - order by - lorsm.track_id desc - limit 1" ] } { + + if { ! [ db_0or1row isanysuspendedsession \ + "select lorsm.track_id as track_id, cmi.lesson_status as lesson_status + from lorsm_student_track lorsm, lorsm_cmi_core cmi + where lorsm.user_id = $user_id + and lorsm.community_id = $community_id + and lorsm.course_id = $man_id + and lorsm.track_id = cmi.track_id + and cmi.man_id = $man_id + and cmi.item_id = $item_id + order by lorsm.track_id desc + limit 1" ] } { #item has no track for the user #the icon should be the same as per "not yet visited" - append icon "\"Not" - } else { + append icon "\"Not" + } else { switch -regexp $lesson_status { - null { append icon "\"Not" } - incomplete { append icon "\"Incomplete\"" } - complete { append icon "\"Completed\"" } - failed { append icon "\"Failed\"" } - "not attempted" { append icon "\"Not" } - passed { append icon "\"Passed\"" } - default { append icon " $lesson_status ** \"$lesson_status\""} + null { + append icon "\"Not" + + } incomplete { + append icon "\"Incomplete\"" + + } complete { + append icon "\"Completed\"" + + } failed { + append icon "\"Failed\"" + + } "not attempted" { + append icon "\"Not" + + } passed { + append icon "\"Passed\"" + + } default { + append icon " $lesson_status ** + \"$lesson_status\""} } } - - + + #we analize now prerequisites. - + #regsub -all {&} $prerequisites " " prerequisites regsub -all {[\{\}]} $prerequisites "" prerequisites regsub -all { & } $prerequisites " " prerequisites set prerequisites_list [split $prerequisites] - + foreach prer $prerequisites_list { if { ! [empty_string_p $prer] } { ns_log debug "MENU prerequisites for $item_id are $prer " #in the following query we disregard the organization - if { ! [ db_0or1row givemeid "select i.ims_item_id as id_from_ref - from - ims_cp_items i, - ims_cp_manifest_class im, - ims_cp_organizations o - WHERE - i.identifier=:prer - - AND - o.org_id = i.org_id - AND - o.man_id = :man_id - AND - im.man_id= :man_id - AND - im.isenabled='t' - AND - im.community_id=:community_id" - ] } { - ns_log warning "MENU-MK: prerequisites not found comm: $community_id, man: $man_id, org: $org_id, item: $item_id" + if { ! [ db_0or1row givemeid \ + "select i.ims_item_id as id_from_ref + from ims_cp_items i, ims_cp_manifest_class im, ims_cp_organizations o + where i.identifier=:prer + and o.org_id = i.org_id + and o.man_id = :man_id + and im.man_id= :man_id + and im.isenabled='t' + and im.community_id=:community_id"] } { + ns_log warning "MENU-MK: prerequisites not found comm: + $community_id, man: $man_id, org: + $org_id, item: $item_id" continue } else { ns_log debug "THE REQUIRED ITEM IS $id_from_ref "; } } + if { ! [empty_string_p $id_from_ref] } { ns_log debug "MENU prerequisites for $item_id are $id_from_ref" if { ! [ db_0or1row isanysuspendedsession " - select lorsm.track_id as track_id, cmi.lesson_status as lex_status - from lorsm_student_track lorsm, lorsm_cmi_core cmi - where - lorsm.user_id = $user_id - and - lorsm.community_id = $community_id - and - lorsm.course_id = $man_id - and - lorsm.track_id = cmi.track_id - and - cmi.man_id = $man_id - and - cmi.item_id = $id_from_ref - order by - lorsm.track_id desc - " ] } { + select lorsm.track_id as track_id, cmi.lesson_status as lex_status + from lorsm_student_track lorsm, lorsm_cmi_core cmi + where lorsm.user_id = $user_id + and lorsm.community_id = $community_id + and lorsm.course_id = $man_id + and lorsm.track_id = cmi.track_id + and cmi.man_id = $man_id + and cmi.item_id = $id_from_ref + order by lorsm.track_id desc" ] } { ns_log debug "NOT FOUND TRACK" append icon "\"Missing" } else { ns_log debug "ITEM ID $id_from_ref HAS A TRACK WITH $lex_status" switch -regexp $lex_status { - null { append icon "\"Missing" } - incomplete { append icon "\"Missing" } - failed { append icon "\"Missing" } - "not attempted" { append icon "\"Missing" } - passed { append icon "\"Prerequisite" } - complete { append icon "\"Prerequisite" } - default { append icon " $lesson_status ** \"$lesson_status\""} + null { + append icon "\"Missing" + + } incomplete { + append icon "\"Missing" + + } failed { + append icon "\"Missing" + + } "not attempted" { + append icon "\"Missing" + + } passed { + append icon "\"Prerequisite" + + } complete { + append icon "\"Prerequisite" + + } default { + append icon " + $lesson_status ** + + \"$lesson_status\"" + } } - } + } #if found session for id_from_ref - } + } #if found id_from_ref - } + } #foreach close - - template::multirow append tree_items $icon [export_vars -base "record-view" \ - -url {item_id man_id}] "$title $mime_type" $indent $last_indent $target + + template::multirow append tree_items $icon [export_vars \ + -base "record-view" \ + -url {item_id man_id}] \ + "$title $mime_type" $indent \ + $last_indent $target set last_indent $indent - + } else { - + regsub -all {[\{\}]} $title "" title - - set icon "\"Content" - - if { ! [ db_0or1row isanysuspendedsession " - select lorsm.track_id as track_id, cmi.lesson_status as lesson_status - from lorsm_student_track lorsm, lorsm_cmi_core cmi - where - lorsm.user_id = $user_id - and - lorsm.community_id = $community_id - and - lorsm.course_id = $man_id - and - lorsm.track_id = cmi.track_id - and - cmi.man_id = $man_id - and - cmi.item_id = $item_id - order by - lorsm.track_id desc - " ] } { + set icon "\"Content" + + if { ! [ db_0or1row isanysuspendedsession \ + "select lorsm.track_id as track_id, cmi.lesson_status as lesson_status + from lorsm_student_track lorsm, lorsm_cmi_core cmi + where lorsm.user_id = $user_id + and lorsm.community_id = $community_id + and lorsm.course_id = $man_id + and lorsm.track_id = cmi.track_id + and cmi.man_id = $man_id + and cmi.item_id = $item_id + order by lorsm.track_id desc" ] } { ns_log debug "Menu-mk: no org tracking found" - - append icon "\"Not" - } else { + append icon "\"Not" + } else { switch -regexp $lesson_status { - null { append icon "\"Not" } - incomplete { append icon "\"Incomplete\"" } - complete { append icon "\"Completed\"" } - failed { append icon "\"Failed\"" } - "not attempted" { append icon "\"Not" } - passed { append icon "\"Passed\"" } - default { append icon " $lesson_status ** \"$lesson_status\""} + null { + append icon "\"Not" + + } incomplete { + append icon "\"Incomplete\"" + + } complete { + append icon "\"Completed\"" + + } failed { + append icon "\"Failed\"" + + } "not attempted" { + append icon "\"Not" + + } passed { + append icon "\"Passed\"" + + } default { + append icon " $lesson_status ** + \"$lesson_status\"" + } } - } - + } + set last_indent $indent - template::multirow append tree_items $icon "" $title $indent $last_indent "" - + template::multirow append tree_items $icon "" \ + $title $indent $last_indent "" + set last_indent $indent - } } } # return_url -set return_url [dotlrn_community::get_community_url [dotlrn_community::get_community_id]] +set return_url [dotlrn_community::get_community_url \ + [dotlrn_community::get_community_id]] Index: openacs-4/packages/lorsm/www/delivery/menu.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/menu.adp,v diff -u -r1.8 -r1.9 --- openacs-4/packages/lorsm/www/delivery/menu.adp 17 Oct 2008 10:46:31 -0000 1.8 +++ openacs-4/packages/lorsm/www/delivery/menu.adp 17 Nov 2008 13:38:37 -0000 1.9 @@ -1,76 +1,71 @@ - - - - - - - - + //--> + + + - + - + +
    + + debug is: ON
    + delivery is: @deliverymethod@ +
    +
    -
    - - debug is: ON
    - delivery is: @deliverymethod@ -
    -
    +
    -
    -
    +
    -
    -
    + + + Index: openacs-4/packages/lorsm/www/delivery/menu.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/menu.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/lorsm/www/delivery/menu.tcl 13 Aug 2007 09:20:16 -0000 1.9 +++ openacs-4/packages/lorsm/www/delivery/menu.tcl 17 Nov 2008 13:38:37 -0000 1.10 @@ -1,15 +1,15 @@ # packages/lorsm/www/delivery/menu.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$ } { - man_id:integer,notnull + man_id:integer,notnull ims_id:integer,notnull,optional menu_off:integer,notnull,optional track_id:integer,notnull,optional @@ -28,9 +28,9 @@ set deliverymethod [ad_get_client_property lorsm deliverymethod] if { [string equal $deliverymethod "delivery-scorm"] } { - set rte true + set rte true } else { - set rte false + set rte false } set items_list [list] @@ -59,99 +59,90 @@ # Loop through first level items # Sub-items are recursed while { $index < $itemcount } { - set one [lindex $items $index] - set level [lindex $one 0] - set item_id [lindex $one 1] - set title [lindex $one 2] - - set title [fs::remove_special_file_system_characters -string $title] - regsub {'} $title {\'} title + set one [lindex $items $index] + set level [lindex $one 0] + set item_id [lindex $one 1] + set title [lindex $one 2] - # as suggested by Michele Slocovich (michele@sii.it) - # http://openacs.org/bugtracker/openacs/com/lors/bug?bug%5fnumber=2100 - # - set title [string map { \{ \\{ \} \\} } $title ] + set title [fs::remove_special_file_system_characters -string $title] + regsub {'} $title {\'} title - upvar #$adp_level man_id man_id - set url "'[export_vars -base "record-view" \ - -url {item_id man_id}]'" - - if { $index < [expr $itemcount - 1] } { - # Get the tree level of the next item - set nextlevel [lindex [lindex $items [incr index]] 0] - - # Loop through each item until an item with a different - # level is encountered - if { $level == $nextlevel } { - # Another item in the same level, just add to the list - lappend TREE_HASH "TREE_HASH\[\"ims_id.$item_id\"\] = $counter;" - lappend levelitems "\['$title', $url\]" - incr counter - } elseif { $level < $nextlevel } { - # Next item is a sub-item - set ocounter $counter - incr counter - set submenu "[generate_tree_menu $items $index [expr $rlevel + 1]]" - lappend TREE_HASH "TREE_HASH\[\"ims_id.$item_id\"\] = $ocounter;" + # as suggested by Michele Slocovich (michele@sii.it) + # http://openacs.org/bugtracker/openacs/com/lors/bug?bug%5fnumber=2100 + # + set title [string map { \{ \\{ \} \\} } $title ] + upvar #$adp_level man_id man_id - if { [llength $submenu] } { - # There's a submenu - lappend levelitems \ - "\['$title', $url,\n$submenu\n\]" - } else { - # Child is a lone leaf node, if so, it should have - # replace the url, the item_id and decremented counter - lappend levelitems \ - "\['$title', $url\]" - } + set url "'[export_vars \ + -base "record-view" \ + -url {item_id man_id}]'" - # The index should have been adjusted by now to point - # to the next item, let's see if the next item has a - # lower level, if so, it's time to return - if { $index < $itemcount } { - set nextlevel [lindex [lindex $items $index] 0] - if { $level > $nextlevel } { - set localindex $index - return [join $levelitems ",\n"] - } - } - - } else { - # Next item has lower level - set localindex $index + if { $index < [expr $itemcount - 1] } { + # Get the tree level of the next item + set nextlevel [lindex [lindex $items [incr index]] 0] - # If i'm alone in this level, there's really no point - # for my existence, i'll just give my URL to my parent - if { ![info exists levelitems] } { - upvar url my_url - upvar item_id my_item_id - set my_url $url - set my_item_id $item_id + # Loop through each item until an item with a different + # level is encountered + if { $level == $nextlevel } { + # Another item in the same level, just add to the list + lappend TREE_HASH "TREE_HASH\[\"ims_id.$item_id\"\] = $counter;" + lappend levelitems "\['$title', $url\]" + incr counter + } elseif { $level < $nextlevel } { + # Next item is a sub-item + set ocounter $counter + incr counter + set submenu "[generate_tree_menu $items $index [expr $rlevel + 1]]" + lappend TREE_HASH "TREE_HASH\[\"ims_id.$item_id\"\] = $ocounter;" - return [list] - } else { - lappend TREE_HASH "TREE_HASH\[\"ims_id.$item_id\"\] = $counter;" - incr counter - return [join \ - [lappend levelitems \ - "\['$title', $url\]" - ] ",\n" - ] - } - } - } else { - # Terminator, end of the list - set localindex [expr $index + 1] - lappend TREE_HASH "TREE_HASH\[\"ims_id.$item_id\"\] = $counter;" - incr counter - return [join \ - [lappend levelitems \ - "\['$title', $url\]" - ] ",\n" - ] - } - } + if { [llength $submenu] } { + # There's a submenu + lappend levelitems \ + "\['$title', $url,\n$submenu\n\]" + } else { + # Child is a lone leaf node, if so, it should have + # replace the url, the item_id and decremented counter + lappend levelitems \ + "\['$title', $url\]" + } + # The index should have been adjusted by now to point + # to the next item, let's see if the next item has a + # lower level, if so, it's time to return + if { $index < $itemcount } { + set nextlevel [lindex [lindex $items $index] 0] + if { $level > $nextlevel } { + set localindex $index + return [join $levelitems ",\n"] + } + } + } else { + # Next item has lower level + set localindex $index + + # If i'm alone in this level, there's really no point + # for my existence, i'll just give my URL to my parent + if { ![info exists levelitems] } { + upvar url my_url + upvar item_id my_item_id + set my_url $url + set my_item_id $item_id + return [list] + } else { + lappend TREE_HASH \ + "TREE_HASH\[\"ims_id.$item_id\"\] = $counter;" + incr counter + return [join [lappend levelitems "\['$title', $url\]"] ",\n"] + } + } + } else { + # Terminator, end of the list + set localindex [expr $index + 1] + lappend TREE_HASH "TREE_HASH\[\"ims_id.$item_id\"\] = $counter;" + incr counter + return [join [lappend levelitems "\['$title', $url\]"] ",\n"] + } + } set localindex $index return [join $levelitems ",\n"] } @@ -161,41 +152,37 @@ db_foreach organizations { } { ns_log notice "menu.tcl org_id=$org_id" # If the course is from lors-central we need an extra query - + if {[apm_package_installed_p lors-central] && [empty_string_p $fs_package_id] } { - set extra_query "and i.ims_item_id in ( select - im.ims_item_id - from - ims_cp_items_map im - where - man_id = $man_id and org_id = $org_id and community_id = $community_id and - hide_p = 'f' - )" + set extra_query " + and i.ims_item_id in + ( select im.ims_item_id + from ims_cp_items_map im + where man_id = $man_id + and org_id = $org_id + and community_id = $community_id + and hide_p = 'f' + )" } else { - set extra_query "" + set extra_query "" } - db_foreach sql { SELECT - i.parent_item, - i.ims_item_id, - i.item_title as item_title - FROM - ims_cp_items i, cr_items ci, cr_revisions cr - WHERE - i.org_id = :org_id - AND ci.item_id=cr.item_id - AND cr.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,ci.tree_sortkey - - } { - set indent $items_array($ims_item_id) - ns_log notice "ims_item_id='${ims_item_id}'" - lappend js [list $indent $ims_item_id $item_title] + db_foreach sql { + select i.parent_item, i.ims_item_id, i.item_title as item_title + from ims_cp_items i, cr_items ci, cr_revisions cr + where i.org_id = :org_id + and ci.item_id=cr.item_id + and cr.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,ci.tree_sortkey + } { + set indent $items_array($ims_item_id) + ns_log notice "ims_item_id='${ims_item_id}'" + lappend js [list $indent $ims_item_id $item_title] } } @@ -205,4 +192,5 @@ set TREE_HASH [join $TREE_HASH "\n"] } # return_url -set return_url [dotlrn_community::get_community_url [dotlrn_community::get_community_id]] +set return_url [dotlrn_community::get_community_url \ + [dotlrn_community::get_community_id]] Index: openacs-4/packages/lorsm/www/delivery/popup.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/popup.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/lorsm/www/delivery/popup.adp 17 Oct 2008 10:46:31 -0000 1.5 +++ openacs-4/packages/lorsm/www/delivery/popup.adp 17 Nov 2008 13:38:37 -0000 1.6 @@ -1,467 +1,496 @@ - - - - - + //function closecontents() { + //alert("content going") + //childwindow.frames['content'].window.location.href = "blank.html"; + //if (childwindow.frames['content'].window.location.href != "blank.htm") { + // setTimeout("closecontents();",1000) + // } + //return(0); + //} - - + function checkAll() { + var innerDocument = childwindow.frames; + for (var i=0;i -@cookie@ -
    - -This window is a placeholder. Course contents should load in a new window.
    -Please don't close this window.
    -
    + function refreshFrame() { + //chiamata quando trovato adapter + + childwindow.frames['content'].window.location.href = "blank.html"; + childwindow.frames['content'].window.location.href = "@body_url;noquote@body?man_id=@man_id@"; + - - width="150" height="150" id="APIAdapter" - - - width="0" height="0" id="APIAdapter" - - codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab#Version=1,4,0,0"> - + //not ready yet to show menu + //debug(typeof(this.childwindow)); + //debug(typeof(this.childwindow.frames['topcontainer'])); + debug("frames:"); + checkAll(); + debug("end of frames:"); + //debug(childwindow.frames['topcontainer']); + //debug(childwindow.frames['menu'].document.write("aagh")); + //childwindow.frames['menu'].window.location.href = "blank.html"; + var gotit=null; + var findgetAppletInfo = 0; + while(gotit == null) { + debug("tipo di API (via APIfinder):"+typeof(APIFinder)); + findgetAppletInfo++; + try { + gotit=APIFinder.getAppletInfo(); + debug("we have established communication from javascript to java:"); + debug(gotit); + } catch (err) { + debug("Your browser told me the applet was ready but now denies + access to its functions, claiming \n"+err+"\n I must + force reload, this way you won't see this message again, + luckily.\n"); + return(0); + } - - - - - - - - - - - - + debug("activating keepalive"); + KeepAlive(); + + childwindow.frames['content'].document.location.href = "blank.html"; + childwindow.frames['content'].document.location.href = " + @body_url;noquote@ + + + body?man_id=@man_id@ + "; + //let's show menu now + childwindow.frames['menu'].document.location.href = "menu?man_id=@man_id@ + &ims_id=@ims_item_id@ + + &track_id=@track_id@ + + &menu_off=@menu_off@ + "; + //obviously no menu if menu is off... + + + try { + childwindow.frames['content'].document.write("Please wait. Loading contents.
    ") + } catch (err) { + //we are on a slow browser somehow + //or something has gotten really wrong + debug("waiting for childwindow to come up"); + myTimer=setTimeout("refreshFrame()",2500); + return(0); + } + childwindow.frames['content'].document.location.href = "record-view?man_id=@man_id@&item_id=@ims_item_id@"; + childwindow.caller=self; + childwindow.focus(); + debug("calling @man_id@ with @ims_item_id@"); +
    + if (findgetAppletInfo> 7) { + debug("I cannot talk to APIAdapter: try reloading me. Please + notify support of your sw configuration ;) "); + return(0); + } + } + getSize(); + window.resizeTo(450,450); + return(1); + } + //--> + + + + + @cookie@ + + + This window is a placeholder. Course contents should load in a new window.
    + Please don't close this window.
    +
    + + width="150" height="150" id="APIAdapter" + + + width="0" height="0" id="APIAdapter" + - - debug="true" - height="150" - width="150" - - - debug="false" - height="0" - width="0" - - name="APIAdapter"> - + codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab#Version=1,4,0,0"> + - + + + + + + + + + + + + + + debug="true" + height="150" + width="150" + + + debug="false" + height="0" + width="0" + + + name="APIAdapter"> + +
    Index: openacs-4/packages/lorsm/www/delivery/popup.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/popup.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/delivery/popup.tcl 13 Aug 2007 09:20:16 -0000 1.3 +++ openacs-4/packages/lorsm/www/delivery/popup.tcl 17 Nov 2008 13:38:37 -0000 1.4 @@ -1,5 +1,5 @@ ad_page_contract { - + @creation-date 2004-08-07 @arch-tag: 64f3397b-4558-4298-a995-fc63e472f2a1 @cvs-id $Id$ @@ -20,9 +20,14 @@ #keepalive and debug would require this set random [clock seconds] -set ses_renew [ad_parameter -package_id [ad_acs_kernel_id] SessionRenew security 300] -set ses_timeout [ad_parameter -package_id [ad_acs_kernel_id] SessionTimeout security 1200] +set ses_renew [ad_parameter \ + -package_id [ad_acs_kernel_id] \ + SessionRenew security 300] +set ses_timeout [ad_parameter \ + -package_id [ad_acs_kernel_id] \ + SessionTimeout security 1200] + set cookie [ad_get_cookie ad_session_id] set track_id [ad_get_client_property lorsm studenttrack] @@ -32,14 +37,16 @@ set user_id [ad_conn user_id] if { ! [info exists ims_item_id] } { - #since an ims_item_id wasn't provided, we just pick up the first one - set item_list [lorsm::get_item_list $man_id $user_id] - set ims_item_id [lindex $item_list 0] + #since an ims_item_id wasn't provided, we just pick up the first one + set item_list [lorsm::get_item_list $man_id $user_id] + set ims_item_id [lindex $item_list 0] } ns_log Notice "POPUP.TCL: ims_id is $ims_item_id" -set body_url [export_vars -base "record-view" -url {ims_item_id man_id}] +set body_url [export_vars \ + -base "record-view" \ + -url {ims_item_id man_id}] # return_url -set return_url [dotlrn_community::get_community_url [dotlrn_community::get_community_id]] - +set return_url [dotlrn_community::get_community_url \ + [dotlrn_community::get_community_id]] Index: openacs-4/packages/lorsm/www/delivery/popup2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/popup2.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/delivery/popup2.adp 13 Aug 2007 09:20:16 -0000 1.2 +++ openacs-4/packages/lorsm/www/delivery/popup2.adp 17 Nov 2008 13:38:38 -0000 1.3 @@ -1,37 +1,37 @@ - @course_name@ - - + - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + - + + + + + + + + + + + + + + + + + Index: openacs-4/packages/lorsm/www/delivery/popup2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/popup2.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/delivery/popup2.tcl 13 Aug 2007 09:20:16 -0000 1.2 +++ openacs-4/packages/lorsm/www/delivery/popup2.tcl 17 Nov 2008 13:38:38 -0000 1.3 @@ -1,9 +1,9 @@ # 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 @@ -24,31 +24,26 @@ if { [info exists item_id] } { ad_set_client_property lorsm ims_id $item_id if { ! [info exists ims_id] } { - set ims_id $item_id - } + set ims_id $item_id + } } if { [info exists ims_id] } { set item_id $ims_id - ad_set_client_property lorsm ims_id $ims_id + ad_set_client_property lorsm ims_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"]} { - + 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 "No Course Name" - } + set course_name "No Course Name" + } } else { set course_name "No Course Name" } @@ -59,12 +54,11 @@ set user_id [ad_conn user_id] ad_set_client_property lorsm currentcourse $man_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] + -user_id $user_id \ + -community_id $community_id \ + -course_id $man_id] ad_set_client_property lorsm studenttrack $track_id } else { set track_id 0 Index: openacs-4/packages/lorsm/www/delivery/record-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/record-view.tcl,v diff -u -r1.15 -r1.16 --- openacs-4/packages/lorsm/www/delivery/record-view.tcl 6 Mar 2008 13:41:10 -0000 1.15 +++ openacs-4/packages/lorsm/www/delivery/record-view.tcl 17 Nov 2008 13:38:38 -0000 1.16 @@ -1,9 +1,9 @@ # 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 @@ -32,27 +32,31 @@ set initedonpage [ad_get_client_property lorsm initedonpage] if { $initedonpage!=0 && $initedonpage!="" } { - if { $lmsfinish > 0 } { - ns_log warning "SCORM : back to record view after lms finish, but it hasn't worked!" - ns_log warning "SCORM : resetting all visiting parameters." - ad_set_client_property lorsm studenttrack 0 - ad_set_client_property lorsm studenttrack "" - ad_set_client_property lorsm currenttrackid "" - ad_set_client_property lorsm initedonpage "" - } else { - ad_set_client_property lorsm studenttrack 0 - ns_log warning "SCORM : new content item with still open course ???" - ns_log warning "SCORM : we call for LMSFinish in place of the content!!!!!!???" - ad_returnredirect [export_vars -base lmsfinish {item_id man_id initedonpage} ] - } + if { $lmsfinish > 0 } { + ns_log warning "SCORM : back to record view after lms finish, + but it hasn't worked!" + ns_log warning "SCORM : resetting all visiting parameters." + ad_set_client_property lorsm studenttrack 0 + ad_set_client_property lorsm studenttrack "" + ad_set_client_property lorsm currenttrackid "" + ad_set_client_property lorsm initedonpage "" + } else { + ad_set_client_property lorsm studenttrack 0 + ns_log warning "SCORM : new content item with still open course ???" + ns_log warning "SCORM : we call for LMSFinish in place of the + content!!!!!!???" + ad_returnredirect [export_vars -base lmsfinish {item_id man_id initedonpage} ] + } } #set item_id [lorsm::delivery::get_item_id -revision_id $revision_id] set folder_id [lorsm::delivery::get_folder_id_from_man_id -man_id $man_id] set lors_root [lorsm::get_root_folder_id] set folder_name [lorsm::delivery::get_folder_name -folder_id $folder_id] -set content_root [lorsm::delivery::get_item_id_from_name_parent -name $folder_name -parent_id $lors_root] +set content_root [lorsm::delivery::get_item_id_from_name_parent \ + -name $folder_name \ + -parent_id $lors_root] if {[empty_string_p $content_root]} { # This was uploaded with lorsm so we use the folder_id from the table @@ -66,207 +70,195 @@ # Get the item title set item_title [lorsm::delivery::get_ims_item_title -ims_item_id $revision_id] - set cr_item_id [lors::cr::get_item_id -folder_id $content_root -name $href] +set cr_item_id [lors::cr::get_item_id -folder_id $content_root -name $href] - if { [empty_string_p $cr_item_id] } { - set res_id [lorsm::delivery::get_res_id -ims_item_id $revision_id] - if { ![empty_string_p $res_id] } { - set file_id [lorsm::delivery::get_file_id -res_id $res_id] - if { [empty_string_p $file_id]} { - set cr_item_id "" - } else { - set cr_item_id [lorsm::delivery::get_item_id -revision_id $file_id] - } - } else { - set cr_item_id "" - } - } +if { [empty_string_p $cr_item_id] } { + set res_id [lorsm::delivery::get_res_id -ims_item_id $revision_id] - # get already imported data (like an assessment) - # it normally points relatively to the correct location in some parent folder - if {[regexp {^\.\.} $href]} { - ad_returnredirect $href - } + if { ![empty_string_p $res_id] } { + set file_id [lorsm::delivery::get_file_id -res_id $res_id] + if { [empty_string_p $file_id]} { + set cr_item_id "" + } else { + set cr_item_id [lorsm::delivery::get_item_id -revision_id $file_id] + } + } else { + set cr_item_id "" + } +} - # If no cr_item_id, this item is probably a folder - # Else deliver the page +# get already imported data (like an assessment) +# it normally points relatively to the correct location in some parent folder +if {[regexp {^\.\.} $href]} { + ad_returnredirect $href +} - if { ![empty_string_p $cr_item_id] } { - # we check if the user has access right to the item - #we analize now prerequisites. - the logic is identical to menu. +# If no cr_item_id, this item is probably a folder +# Else deliver the page - set community_id [dotlrn_community::get_community_id] - set user_id [ad_conn user_id] - - db_1row getitemattributes "select i.parent_item, - i.ims_item_id, - i.item_title as item_title, - i.prerequisites_s as prerequisites, - cr.mime_type - FROM - acs_objects o, ims_cp_items i, cr_items ci, cr_revisions cr, - ims_cp_manifest_class im, ims_cp_organizations org - WHERE - o.object_type = 'ims_item_object' - AND - i.org_id = org.org_id - AND - o.object_id = i.ims_item_id - AND - im.man_id=:man_id - and - i.ims_item_id=:revision_id - and im.isenabled='t' - and im.community_id=:community_id - and ci.item_id=cr.item_id - and cr.revision_id=i.ims_item_id - " - - #regsub -all {&} $prerequisites " " prerequisites - regsub -all {[\{\}]} $prerequisites "" prerequisites - regsub -all { & } $prerequisites " " prerequisites - set prerequisites_list [split $prerequisites] - - foreach prer $prerequisites_list { - if { ! [empty_string_p $prer] } { - ns_log warning "MENU prerequisites for $item_id are $prer " - #in the following query we disregard the organization - if { ! [ db_0or1row givemeid "select i.ims_item_id as id_from_ref, i.item_title as id_from_ref_title - from - ims_cp_items i, - ims_cp_manifest_class im, - ims_cp_organizations o - WHERE - i.identifier=:prer - AND - o.org_id = i.org_id - AND - o.man_id = :man_id - AND - im.man_id= :man_id - AND - im.isenabled='t' - AND - im.community_id=:community_id" - ] } { - ns_log warning "RECORD_VIEW: prerequisites not found comm: $community_id, man: $man_id, item: $item_id" - continue - } else { - ns_log debug "RECORD_VIEW: THE REQUIRED ITEM IS $id_from_ref " - } - } - if { ! [empty_string_p $id_from_ref] } { - ns_log warning "RECORD_VIEW: prerequisites for $item_id are $id_from_ref" - if { ! [ db_0or1row isanysuspendedsession " - select lorsm.track_id as track_id, cmi.lesson_status as lex_status - from lorsm_student_track lorsm, lorsm_cmi_core cmi - where - lorsm.user_id = $user_id - and - lorsm.community_id = $community_id - and - lorsm.course_id = $man_id - and - lorsm.track_id = cmi.track_id - and - cmi.man_id = $man_id - and - cmi.item_id = $id_from_ref - order by - lorsm.track_id desc - " ] } { - ns_log warning "RECORD_VIEW: NOT FOUND TRACK" - append errormessage "Not attempted : $id_from_ref_title ($id_from_ref)" - append errormessage "
    " - ns_log warning $errormessage - } else { - switch -regexp $lex_status { - "^passed$" { ns_log warning "ITEM ID $id_from_ref HAS A TRACK WITH $lex_status"} - "^completed$" { ns_log warning "ITEM ID $id_from_ref HAS A TRACK WITH $lex_status" } - default { - ns_log warning "ITEM ID $id_from_ref HAS A TRACK WITH $lex_status" - append errormessage "$lex_status : $id_from_ref_title ($id_from_ref)" - append errormessage "
    " - ns_log warning $errormessage - } - } - } - #if found session for id_from_ref - } - #if found id_from_ref - } - #foreach close - - if { [info exists errormessage] } { - ns_log warning $errormessage - append message " - - - - - -

    $item_title :


    -
    Please first complete following items :


    -" $errormessage - ns_return 200 text/html $message +if { ![empty_string_p $cr_item_id] } { + # we check if the user has access right to the item + #we analize now prerequisites. - the logic is identical to menu. + + set community_id [dotlrn_community::get_community_id] + set user_id [ad_conn user_id] + + db_1row getitemattributes \ + "select i.parent_item, i.ims_item_id, i.item_title as item_title, + i.prerequisites_s as prerequisites, cr.mime_type + from acs_objects o, ims_cp_items i, cr_items ci, cr_revisions cr, + ims_cp_manifest_class im, ims_cp_organizations org + where o.object_type = 'ims_item_object' + and i.org_id = org.org_id + and o.object_id = i.ims_item_id + and im.man_id=:man_id + and i.ims_item_id=:revision_id + and im.isenabled='t' + and im.community_id=:community_id + and ci.item_id=cr.item_id + and cr.revision_id=i.ims_item_id" + + #regsub -all {&} $prerequisites " " prerequisites + regsub -all {[\{\}]} $prerequisites "" prerequisites + regsub -all { & } $prerequisites " " prerequisites + set prerequisites_list [split $prerequisites] + + foreach prer $prerequisites_list { + if { ! [empty_string_p $prer] } { + ns_log warning "MENU prerequisites for $item_id are $prer " + #in the following query we disregard the organization + if { ! [ db_0or1row givemeid \ + "select i.ims_item_id as id_from_ref, i.item_title as id_from_ref_title + from ims_cp_items i, ims_cp_manifest_class im, ims_cp_organizations o + where i.identifier=:prer + and o.org_id = i.org_id + and o.man_id = :man_id + and im.man_id= :man_id + and im.isenabled='t' + and im.community_id=:community_id" ] } { + ns_log warning "RECORD_VIEW: prerequisites not found comm: + $community_id, man: $man_id, item: $item_id" + continue + } else { + ns_log debug "RECORD_VIEW: THE REQUIRED ITEM IS $id_from_ref " + } + } + + if { ![empty_string_p $id_from_ref] } { + ns_log warning "RECORD_VIEW: prerequisites for $item_id are $id_from_ref" + if { ! [ db_0or1row isanysuspendedsession \ + "select lorsm.track_id as track_id, cmi.lesson_status as lex_status + from lorsm_student_track lorsm, lorsm_cmi_core cmi + where lorsm.user_id = $user_id + and lorsm.community_id = $community_id + and lorsm.course_id = $man_id + and lorsm.track_id = cmi.track_id + and cmi.man_id = $man_id + and cmi.item_id = $id_from_ref + order by lorsm.track_id desc" ] } { + ns_log warning "RECORD_VIEW: NOT FOUND TRACK" + append errormessage "Not attempted : $id_from_ref_title ($id_from_ref)" + append errormessage "
    " + ns_log warning $errormessage + } else { + switch -regexp $lex_status { + "^passed$" { + ns_log warning "ITEM ID $id_from_ref HAS A TRACK WITH $lex_status" + + } "^completed$" { + ns_log warning "ITEM ID $id_from_ref HAS A TRACK WITH $lex_status" + + } default { + ns_log warning "ITEM ID $id_from_ref HAS A TRACK WITH $lex_status" + append errormessage "$lex_status : $id_from_ref_title ($id_from_ref)" + append errormessage "
    " + ns_log warning $errormessage + } + } + } + #if found session for id_from_ref + } + #if found id_from_ref + } + #foreach close + + if { [info exists errormessage] } { + ns_log warning $errormessage + append message \ + " + + + + + +

    $item_title :


    +
    Please first complete following items :


    " \ + $errormessage + + ns_return 200 text/html $message ad_script_abort - } + } - # This is the revision of the file (html, jpg, etc) - set cr_revision_id [item::get_best_revision $cr_item_id] - set cr_item_mime [item::get_mime_info $cr_revision_id mime_info] + # This is the revision of the file (html, jpg, etc) + set cr_revision_id [item::get_best_revision $cr_item_id] + set cr_item_mime [item::get_mime_info $cr_revision_id mime_info] - if { ![string equal -length 4 "text" $mime_info(mime_type)] || [string equal "text/xml" $mime_info(mime_type)]} { - # It's a binary or XML file. - ns_log debug "BINARY/XML FILE FROM RECORD VIEW" - ns_log debug "lorsm - (SCORM) record-view - TEXT - it's a file. should we get an error?" - cr_write_content -revision_id $cr_revision_id - ad_script_abort + if { ![string equal -length 4 "text" $mime_info(mime_type)] || \ + [string equal "text/xml" $mime_info(mime_type)]} { + # It's a binary or XML file. + ns_log debug "BINARY/XML FILE FROM RECORD VIEW" + ns_log debug "lorsm - (SCORM) record-view - TEXT - it's a file. + should we get an error?" + cr_write_content -revision_id $cr_revision_id + ad_script_abort - } else { - - # It's a textual/xml file. - set href "$url2/$href" - regsub -all {//} $href {/} href - set ims_item_id $cr_revision_id - - # lorsm::set_content_root content_root - lorsm::set_ims_item_id $item_id + } else { + # It's a textual/xml file. + set href "$url2/$href" + regsub -all {//} $href {/} href + set ims_item_id $cr_revision_id - ns_log debug "SCORM record-view : TEXT - $href cr_item_id $cr_item_id item_id $item_id ims_item_id $ims_item_id revision_id $revision_id " - - ad_set_client_property lorsm ims_id $item_id - #ad_set_client_property lorsm ims_id $revision_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 + ns_log debug "SCORM record-view : TEXT - $href cr_item_id + $cr_item_id item_id $item_id ims_item_id + $ims_item_id revision_id $revision_id " - if {[nsv_exists delivery_vars [ad_conn session_id]]} { - nsv_unset delivery_vars [ad_conn session_id] - } + ad_set_client_property lorsm ims_id $item_id + #ad_set_client_property lorsm ims_id $revision_id - #the delivery environment is passed to view/index.vuh which fetches - #everything from content repository + # we use nsv variables to set the delivery environment this is a + # temporary solution until we find something a bit better - nsv_set delivery_vars [ad_conn session_id] [list] - nsv_lappend delivery_vars [ad_conn session_id] $content_root - nsv_lappend delivery_vars [ad_conn session_id] $item_id + if {[nsv_exists delivery_vars [ad_conn session_id]]} { + nsv_unset delivery_vars [ad_conn session_id] + } - ad_returnredirect [export_vars -base view/$href {ims_item_id} ] - ad_script_abort - } - } else { - lorsm::set_ims_item_id $item_id + #the delivery environment is passed to view/index.vuh which fetches + #everything from content repository - ns_log debug "lorsm - (SCORM) record-view - EMPTY CR_ITEM_ID - cr_item_id $cr_item_id item_id $item_id" + nsv_set delivery_vars [ad_conn session_id] [list] + nsv_lappend delivery_vars [ad_conn session_id] $content_root + nsv_lappend delivery_vars [ad_conn session_id] $item_id + + ad_returnredirect [export_vars -base view/$href {ims_item_id} ] + ad_script_abort + } +} else { + lorsm::set_ims_item_id $item_id + + ns_log debug "lorsm - (SCORM) record-view - EMPTY CR_ITEM_ID - + cr_item_id $cr_item_id item_id $item_id" ad_set_client_property lorsm ims_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! + # 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 + 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/servlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/servlet.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/lorsm/www/delivery/servlet.tcl 13 Aug 2007 09:20:16 -0000 1.4 +++ openacs-4/packages/lorsm/www/delivery/servlet.tcl 17 Nov 2008 13:38:38 -0000 1.5 @@ -32,7 +32,7 @@ acs_user::get -user_id $user_id -array user set username $user(username) ns_log $tracelevel "---------------------------------------" -ns_log $basiclevel " LMS Rte server START" +ns_log $basiclevel " LMS Rte server START" ns_log $tracelevel "---------------------------------------" ns_log $tracelevel "username: $username" set currentcourse [ad_get_client_property lorsm currentcourse] @@ -46,21 +46,25 @@ ns_log $basiclevel "lorsm initedonpage $initedonpage" if { ! ($currentpage>0) } { - ns_log $basiclevel "SCORM missing ims_item_id : $currentpage" + ns_log $basiclevel "SCORM missing ims_item_id : $currentpage" } set community_id [dotlrn_community::get_community_id] -ns_log $basiclevel "SCORM user: $user_id course: $currentcourse ims_item_id: $currentpage community_id: $community_id" +ns_log $basiclevel "SCORM user: $user_id course: $currentcourse + ims_item_id: $currentpage community_id: $community_id" if { $user_id == 0 } { #http 401 is unauthorized ns_return 401 text/plain "Error=101,ErrorDescription=\"Not logged in\"" } + if { $currentcourse == "" } { #http 303 is error: but the answer should be found elsewhere - ns_return 303 text/plain "Error=102,ErrorDescription=\"No current course (how did you get here?)\"" + ns_return 303 text/plain "Error=102,ErrorDescription=\"No current + course (how did you get here?)\"" } + if { ! [info exists functionCalled] } { #http 400 BAD request: returned as well as when functionCalled is nonsense (see end of switch) ns_return 400 text/plain "Error=104,ErrorDescription=\"No function specified\"" @@ -71,8 +75,9 @@ set package_id [ad_conn package_id] -ns_log $basiclevel "SCORM $functionCalled " -ns_log $basiclevel "SCORM tracking (client properties): currenttrackid: $currenttrackid lorsmtrack: $lorsmstudenttrack " +ns_log $basiclevel "SCORM $functionCalled " +ns_log $basiclevel "SCORM tracking (client properties): currenttrackid: + $currenttrackid lorsmtrack: $lorsmstudenttrack " ad_get_user_info set name $last_name @@ -81,402 +86,493 @@ append name $first_names if { $initedonpage != $currentpage } { - if { $functionCalled != "cmigetcat" } { - if { $functionCalled != "keepalive" } { - ns_log warning "SCORM jumping to different courses WITHOUT init!!!" - } else { - ns_log warning "SCORM keepalive still alive after LMSFinish" - } - #c'e' stato un cambiamento di item - set lorsmstudenttrack "" - ad_set_client_property lorsm initedonpage $currentpage - } + if { $functionCalled != "cmigetcat" } { + if { $functionCalled != "keepalive" } { + ns_log warning "SCORM jumping to different courses WITHOUT init!!!" + } else { + ns_log warning "SCORM keepalive still alive after LMSFinish" + } + #c'e' stato un cambiamento di item + set lorsmstudenttrack "" + ad_set_client_property lorsm initedonpage $currentpage + } } switch -regexp $functionCalled { - null - - keepalive - { - ns_return 200 text/plain "OK" - ns_log warning "SCORM Keepalive" - } - cmigetcat - { - ns_log $tracelevel "---------------------------------------" - ns_log $basiclevel " LMSInitialise " - ns_log $tracelevel "---------------------------------------" + null - + keepalive { + ns_return 200 text/plain "OK" + ns_log warning "SCORM Keepalive" - if { $initedonpage != $currentpage } { - #c'e' stato un cambiamento di item - set lorsmstudenttrack "" - ad_set_client_property lorsm initedonpage $currentpage - } + } cmigetcat { + ns_log $tracelevel "---------------------------------------" + ns_log $basiclevel " LMSInitialise " + ns_log $tracelevel "---------------------------------------" - if { $lorsmstudenttrack == 0 || $lorsmstudenttrack == "" } { - ns_log $basiclevel "SCORM : lorsm student new track " - #here track id was not set (course is not lors-trackable) - #we should first try to see if we find an already open track in lorsm.track - set lorsmstudenttrack [lorsm::track::new \ - -user_id $user_id \ - -community_id $community_id \ - -course_id $currentcourse] - ad_set_client_property lorsm studenttrack $lorsmstudenttrack - ns_log $basiclevel "SCORM tracking has in any case created a lorsm_student_tracking track_id: $lorsmstudenttrack" - if { ! [ db_0or1row isanysuspendedsession " - select lorsm.track_id as track_id from - lorsm_student_track lorsm, lorsm_cmi_core cmi - where - lorsm.user_id = $user_id - and - lorsm.community_id = $community_id - and - lorsm.course_id = $currentcourse - and - lorsm.track_id = cmi.track_id - and - cmi.man_id = $currentcourse - and - cmi.item_id = $currentpage - order by - lorsm.track_id desc - limit 1 - " ] } { #faccio un nuovo trackid - #and - # not ( - # cmi.lesson_status = 'completed' - # or - # cmi.lesson_status = 'passed' - # ) - #we create a new track which is going to be the new 'master track' for this cmi data set - set currenttrackid $lorsmstudenttrack - ns_log $basiclevel "SCORM new track id: $currenttrackid" - } else { - set currenttrackid $track_id - ns_log $basiclevel "SCORM found a lorsm_cmi_core track with a non completed nor passed session." - } - } else { - ns_log $basiclevel "SCORM already has current session (=$lorsmstudenttrack) (istrackable is on): going to check if the session is ok for current item" - #now we look for the existance of a lorsm.cmi.core track id for this user / course / class which is still not completed - if { ! [ db_0or1row isanysuspendedsession " - select lorsm.track_id as track_id - from lorsm_student_track lorsm, lorsm_cmi_core cmi - where - lorsm.user_id = $user_id - and - lorsm.community_id = $community_id - and - lorsm.course_id = $currentcourse - and - lorsm.track_id = cmi.track_id - and - cmi.man_id = $currentcourse - and - cmi.item_id = $currentpage - order by - lorsm.track_id desc - limit 1 - " ] } { - #and - # not ( - # cmi.lesson_status = 'completed' - # or - # cmi.lesson_status = 'passed' - # ) - #the reasoning here is as follows: i had a $lorsmstudenttrack - #but not track for the course in lorsm_cmi_core. therefore i need to change the - #"student" track - set lorsmstudenttrack [lorsm::track::new \ - -user_id $user_id \ - -community_id $community_id \ - -course_id $currentcourse] - ad_set_client_property lorsm studenttrack $lorsmstudenttrack - set currenttrackid $lorsmstudenttrack - } else { - set currenttrackid $track_id - } - } - #at this stage currenttrackid is the value it should have in lorsm_cmi_core + if { $initedonpage != $currentpage } { + #c'e' stato un cambiamento di item + set lorsmstudenttrack "" + ad_set_client_property lorsm initedonpage $currentpage + } - if { ! [ db_0or1row istherealready "select * from lorsm_cmi_core where track_id = :currenttrackid "]} { - ns_log $basiclevel "SCORM new RTE lorsm_cmi_core: id $currenttrackid" - #get initialization data from manifest data already imported - db_0or1row get_adlcp_student_data { select datafromlms,maxtimeallowed,timelimitaction,masteryscore from ims_cp_items where ims_item_id=:currentpage; } - ns_log $basiclevel "SCORM data for lorsm_cmi_student_data is $datafromlms, $maxtimeallowed, $timelimitaction, $masteryscore" - # - # lesson_location is the bookmark. - # lesson_status is initialized to 'not attempted' - # - db_dml lmsinitialize { insert into lorsm_cmi_core(track_id,man_id,item_id,student_id,student_name, - lesson_location, - lesson_status, - launch_data, - comments,comments_from_lms, session_time, total_time, time_stamp) - values(:currenttrackid,:currentcourse,:currentpage,:username,:name, - '', - 'not attempted', - :datafromlms, - '','',0,0,CURRENT_TIMESTAMP) } - ns_log $basiclevel "SCORM Data inserting into lorsm_student_data $currenttrackid $username $maxtimeallowed" - db_dml lmsinitialize { insert into lorsm_cmi_student_data(track_id,student_id,max_time_allowed,time_limit_action,mastery_score) - values(:currenttrackid,:username,:maxtimeallowed,:timelimitaction,:masteryscore) - } - ad_set_client_property lorsm currenttrackid $currenttrackid - db_0or1row istherealready "select * from lorsm_cmi_core where track_id = :currenttrackid" + if { $lorsmstudenttrack == 0 || $lorsmstudenttrack == "" } { + ns_log $basiclevel "SCORM : lorsm student new track " + #here track id was not set (course is not lors-trackable) + #we should first try to see if we find an already open track in lorsm.track + set lorsmstudenttrack [lorsm::track::new \ + -user_id $user_id \ + -community_id $community_id \ + -course_id $currentcourse] + ad_set_client_property lorsm studenttrack $lorsmstudenttrack + ns_log $basiclevel "SCORM tracking has in any case created a + lorsm_student_tracking track_id: $lorsmstudenttrack" + if { ! [ db_0or1row isanysuspendedsession + "select lorsm.track_id as track_id + from lorsm_student_track lorsm, lorsm_cmi_core cmi + where lorsm.user_id = $user_id + and lorsm.community_id = $community_id + and lorsm.course_id = $currentcourse + and lorsm.track_id = cmi.track_id + and cmi.man_id = $currentcourse + and cmi.item_id = $currentpage + order by lorsm.track_id desc + limit 1" ] } { #faccio un nuovo trackid + #and + # not ( + # cmi.lesson_status = 'completed' + # or + # cmi.lesson_status = 'passed' + # ) + #we create a new track which is going to be the new 'master track' for this cmi data set + set currenttrackid $lorsmstudenttrack + ns_log $basiclevel "SCORM new track id: $currenttrackid" + } else { + set currenttrackid $track_id + ns_log $basiclevel "SCORM found a lorsm_cmi_core track with + a non completed nor passed session." + } + } else { + ns_log $basiclevel "SCORM already has current session + (=$lorsmstudenttrack) (istrackable is on): + going to check if the session is ok + for current item" + #now we look for the existance of a lorsm.cmi.core track id for this user / course / class which is still not completed + if { ! [ db_0or1row isanysuspendedsession \ + "select lorsm.track_id as track_id + from lorsm_student_track lorsm, lorsm_cmi_core cmi + where lorsm.user_id = $user_id + and lorsm.community_id = $community_id + and lorsm.course_id = $currentcourse + and lorsm.track_id = cmi.track_id + and cmi.man_id = $currentcourse + and cmi.item_id = $currentpage + order by lorsm.track_id desc + limit 1" ] } { + #and + # not ( + # cmi.lesson_status = 'completed' + # or + # cmi.lesson_status = 'passed' + # ) + #the reasoning here is as follows: i had a $lorsmstudenttrack + #but not track for the course in lorsm_cmi_core. therefore i need to change the + #"student" track + set lorsmstudenttrack [lorsm::track::new \ + -user_id $user_id \ + -community_id $community_id \ + -course_id $currentcourse] + ad_set_client_property lorsm studenttrack $lorsmstudenttrack + set currenttrackid $lorsmstudenttrack + } else { + set currenttrackid $track_id + } + } + #at this stage currenttrackid is the value it should have in lorsm_cmi_core - #AURALOG HACK - #adjust on a per-server basis -#if { $currentcourse == 6280 } { -#set student_id "testscorm727" -#} - set returndata "cmi.core.student_id=$student_id,cmi.core.student_name=$name," - append returndata "cmi.core.lesson_status=$lesson_status,cmi.core.credit=credit,cmi.core.entry=ab-initio," - append returndata "cmi.core.lesson_mode=normal," - append returndata "cmi.student_preference.language=italian,cmi.comments=$comments,cmi.comments_from_lms=$comments_from_lms" - append returndata ",cmi.suspend_data=$suspend_data,cmi.launch_data=$launch_data" - append returndata ",cmi.student_data.max_time_allowed=$maxtimeallowed,cmi.student_data.timelimitaction=$timelimitaction" - append returndata ",cmi.student_data.mastery_score=$masteryscore" - } else { - ns_log $basiclevel "SCORM found RTE lorsm_cmi_core: id $currenttrackid" - ad_set_client_property lorsm currenttrackid $currenttrackid - #retrieve data other than core - if { ! [db_0or1row get_adlcp_student_data " select max_time_allowed ,time_limit_action ,mastery_score from lorsm_cmi_student_data where track_id=:currenttrackid "] } { - ns_log Error "SCORM recoverying of student data: not successfull on $currenttrackid -> please check" - set max_time_allowed "" - set time_limit_action "" - set mastery_score "" - } else { - ns_log debug "SCORM recoverying of student data: successfull" - } - # THIS CHECK is somehow just a previous bug catcher, shouldn't actually be needed - # if { [db_resultrows] == 1 } { - # ns_log debug "SCORM recoverying of student data: successfull" - # } else { - # ns_log Error "SCORM recoverying of student data: not successfull on $currenttrackid -> please check" - # } + if { ! [ db_0or1row istherealready \ + "select * + from lorsm_cmi_core + where track_id = :currenttrackid "]} { + ns_log $basiclevel "SCORM new RTE lorsm_cmi_core: id $currenttrackid" + #get initialization data from manifest data already imported + db_0or1row get_adlcp_student_data { + select datafromlms,maxtimeallowed,timelimitaction,masteryscore + from ims_cp_items + where ims_item_id=:currentpage; } - ns_log $basiclevel "SCORM retrieved track id in lorsm_cmi_core: $currenttrackid" - # summing up session time to total_time - set total_time [expr $total_time + $session_time] - set total_time_ms [expr $total_time_ms + $session_time_ms] - set session_time 0 - set session_time_ms 0 - if { $total_time_ms > 100 } { set total_time_ms [expr $total_time_ms - 100] - set total_time [expr $total_time +1 ] - } - # erasing session time from server and updating current total time - set todo "UPDATE lorsm_cmi_core SET total_time = '$total_time" - append todo "', total_time_ms ='$total_time_ms' " - #append todo " WHERE track_id=:currenttrackid" - append todo " WHERE track_id=$currenttrackid" - db_dml todo $todo - if { [db_resultrows] == 1 } { - ns_log debug "SCORM time processing UPDATE: '$todo' successfull" - } else { - ns_log Warning "SCORM time processing UPDATE: '$todo' not successfull -> please check" - } - set todo "UPDATE lorsm_cmi_core SET session_time = '0" - append todo "', session_time_ms ='0' " - #append todo " WHERE track_id=:currenttrackid" - append todo " WHERE track_id=$currenttrackid" - db_dml todo $todo - if { [db_resultrows] == 1 } { - ns_log debug "SCORM data processing UPDATE: '$todo' successfull" - } else { - ns_log Warning "SCORM time processing UPDATE: '$todo' not successfull -> please check" - } - #AURALOG HACK - #adjust on a per-server basis - #if { $currentcourse == 6280 } { - # set student_id "testscorm727" - #} + ns_log $basiclevel "SCORM data for lorsm_cmi_student_data is + $datafromlms, $maxtimeallowed, $timelimitaction, + $masteryscore" + # + # lesson_location is the bookmark. + # lesson_status is initialized to 'not attempted' + # + db_dml lmsinitialize { + insert into lorsm_cmi_core(track_id,man_id,item_id,student_id, + student_name, lesson_location, lesson_status, launch_data, + comments,comments_from_lms, session_time, total_time, time_stamp) + values(:currenttrackid,:currentcourse,:currentpage,:username,:name,'', + 'not attempted',:datafromlms,'','',0,0,CURRENT_TIMESTAMP) } - set returndata "cmi.core.student_id=$student_id,cmi.core.student_name=$name," - append returndata "cmi.core.credit=$credit,cmi.core.lesson_status=$lesson_status,cmi.core.entry=$entry," - append returndata "cmi.core.lesson_mode=normal,cmi.core.lesson_location=$lesson_location," - append returndata "cmi.student_preference.language=italian,cmi.comments=$comments,cmi.comments_from_lms=$comments_from_lms" - append returndata ",cmi.suspend_data=$suspend_data,cmi.launch_data=$launch_data" - append returndata ",cmi.student_data.max_time_allowed=$max_time_allowed,cmi.student_data.time_limit_action=$time_limit_action" - append returndata ",cmi.student_data.mastery_score=$mastery_score" - } + ns_log $basiclevel "SCORM Data inserting into lorsm_student_data + $currenttrackid $username $maxtimeallowed" + db_dml lmsinitialize { + insert into lorsm_cmi_student_data(track_id,student_id,max_time_allowed,time_limit_action,mastery_score) + values(:currenttrackid,:username,:maxtimeallowed,:timelimitaction,:masteryscore) + } - #treating time from table back to system (lorsm.cmi.time fields are showing just seconds) - set prefix "0" + ad_set_client_property lorsm currenttrackid $currenttrackid + db_0or1row istherealready \ + "select * + from lorsm_cmi_core + where track_id = :currenttrackid" + + #AURALOG HACK + #adjust on a per-server basis + #if { $currentcourse == 6280 } { + #set student_id "testscorm727" + #} + set returndata "cmi.core.student_id=$student_id, + cmi.core.student_name=$name," + + append returndata "cmi.core.lesson_status=$lesson_status, + cmi.core.credit=credit,cmi.core.entry=ab-initio," + + append returndata "cmi.core.lesson_mode=normal," + + append returndata "cmi.student_preference.language=italian, + cmi.comments=$comments, + cmi.comments_from_lms=$comments_from_lms" + + append returndata ",cmi.suspend_data=$suspend_data, + cmi.launch_data=$launch_data" + + append returndata ",cmi.student_data.max_time_allowed=$maxtimeallowed, + cmi.student_data.timelimitaction=$timelimitaction" + + append returndata ",cmi.student_data.mastery_score=$masteryscore" + } else { + ns_log $basiclevel "SCORM found RTE lorsm_cmi_core: id $currenttrackid" + ad_set_client_property lorsm currenttrackid $currenttrackid + #retrieve data other than core + if { ! [db_0or1row get_adlcp_student_data \ + "select max_time_allowed ,time_limit_action ,mastery_score + from lorsm_cmi_student_data + where track_id=:currenttrackid "] } { + ns_log Error "SCORM recoverying of student data: not successfull on $currenttrackid -> please check" + set max_time_allowed "" + set time_limit_action "" + set mastery_score "" + } else { + ns_log debug "SCORM recoverying of student data: successfull" + } + # THIS CHECK is somehow just a previous bug catcher, shouldn't actually be needed + # if { [db_resultrows] == 1 } { + # ns_log debug "SCORM recoverying of student data: successfull" + # } else { + # ns_log Error "SCORM recoverying of student data: not successfull on $currenttrackid -> please check" + # } + + ns_log $basiclevel "SCORM retrieved track id in + lorsm_cmi_core: $currenttrackid" + # summing up session time to total_time + set total_time [expr $total_time + $session_time] + set total_time_ms [expr $total_time_ms + $session_time_ms] + set session_time 0 + set session_time_ms 0 + + if { $total_time_ms > 100 } { + set total_time_ms [expr $total_time_ms - 100] + set total_time [expr $total_time +1 ] + } + + # erasing session time from server and updating current total time + set todo "UPDATE lorsm_cmi_core SET total_time = '$total_time" + append todo "', total_time_ms ='$total_time_ms' " + #append todo " WHERE track_id=:currenttrackid" + append todo " WHERE track_id=$currenttrackid" + db_dml todo $todo + if { [db_resultrows] == 1 } { + ns_log debug "SCORM time processing UPDATE: '$todo' successfull" + } else { + ns_log Warning "SCORM time processing UPDATE: '$todo' + not successfull -> please check" + } + + set todo "UPDATE lorsm_cmi_core SET session_time = '0" + append todo "', session_time_ms ='0' " + #append todo " WHERE track_id=:currenttrackid" + append todo " WHERE track_id=$currenttrackid" + db_dml todo $todo + + if { [db_resultrows] == 1 } { + ns_log debug "SCORM data processing UPDATE: '$todo' successfull" + } else { + ns_log Warning "SCORM time processing UPDATE: '$todo' + not successfull -> please check" + } + #AURALOG HACK + #adjust on a per-server basis + #if { $currentcourse == 6280 } { + # set student_id "testscorm727" + #} + + set returndata "cmi.core.student_id=$student_id, + cmi.core.student_name=$name," + + append returndata "cmi.core.credit=$credit, + cmi.core.lesson_status=$lesson_status, + cmi.core.entry=$entry," + + append returndata "cmi.core.lesson_mode=normal, + cmi.core.lesson_location=$lesson_location," + + append returndata "cmi.student_preference.language=italian, + cmi.comments=$comments, + cmi.comments_from_lms=$comments_from_lms" + + append returndata ",cmi.suspend_data=$suspend_data, + cmi.launch_data=$launch_data" + append returndata ",cmi.student_data.max_time_allowed=$max_time_allowed, + cmi.student_data.time_limit_action=$time_limit_action" + + append returndata ",cmi.student_data.mastery_score=$mastery_score" + } + + #treating time from table back to system (lorsm.cmi.time fields are showing just seconds) + set prefix "0" set hours [expr int ($session_time/3600) ] - set minutes [expr int (($session_time - (3600*$hours)) / 60) ] - set seconds [expr int (($session_time - (3600*$hours)-$minutes*60)) ] - if { [ string length $session_time_ms] == 1 } { set session_time_ms "$prefix$session_time_ms" } - if { [ string length $hours ] == 1 } { set hours "$prefix$hours" } - if { [ string length $minutes] == 1 } { set minutes 0$minutes } - if { [ string length $seconds] == 1 } { set seconds 0$seconds} - set session_time "$hours:$minutes:$seconds.$session_time_ms" - #if { ! [empty_string_p $session_time_ms] } { append session_time ".$session_time_ms" } - set hours [expr int ($total_time/3600) ] - set minutes [expr int (($total_time - (3600*$hours)) / 60) ] - set seconds [expr int (($total_time - (3600*$hours)-$minutes*60)) ] - if { [ string length $total_time_ms] == 1 } { set total_time_ms "$prefix$total_time_ms" } - if { [ string length $hours ] == 1 } { set hours "$prefix$hours" } - if { [ string length $minutes] == 1 } { set minutes 0$minutes } - if { [ string length $seconds] == 1 } { set seconds 0$seconds} - set total_time "$hours:$minutes:$seconds.$total_time_ms" - #if { ! [empty_string_p $total_time_ms] } { append total_time ".$total_time_ms" } - #appending time fields to return string - append returndata ",cmi.core.session_time=$session_time,cmi.core.total_time=$total_time" - ns_log $basiclevel "SCORM initialised, sending data to applet" - ns_log $tracelevel "$returndata" + set minutes [expr int (($session_time - (3600*$hours)) / 60) ] + set seconds [expr int (($session_time - (3600*$hours)-$minutes*60)) ] + if { [ string length $session_time_ms] == 1 } { + set session_time_ms "$prefix$session_time_ms" + } - ns_return 200 text/plain "$returndata" - } + if { [ string length $hours ] == 1 } { + set hours "$prefix$hours" + } - cmiputcat* - { - ns_log $tracelevel "---------------------------------------" - switch $functionCalled { - cmiputcat { - ns_log $basiclevel " LMSCommit" } - cmiputcatONFINISH { - ns_log $basiclevel " LMSFinish" } - } - ns_log $tracelevel "---------------------------------------" - ns_log $tracelevel "received data $data from applet: processing. " - ns_log $tracelevel "Reference cmi track is $currenttrackid, while lorsmstudenttrack is: $lorsmstudenttrack" - set preparselist [lrange [ split $data "," ] 1 end] - set lista [list] - set value "" - #here we build a list of request=value. we must do some pattern matching - foreach couple $preparselist { - if { [ regexp ^cmi\.* $couple ] } { - if { ! [empty_string_p $value] } { - set value [concat [lindex $lista end],$value] - ns_log debug "SCORM PARSER ending recomposing $value " - set lista [lreplace $lista end end $value] - set value "" - } else { - ns_log debug "SCORM PARSER full couple $couple " - lappend lista $couple - } - } else { - ns_log debug "SCORM PARSER partial couple $couple " - set value [concat $value,$couple] - ns_log debug "SCORM PARSER partial couple $couple " - } - } - if { ! [empty_string_p $value] } { - set value [concat [lindex $lista end],$value] - ns_log debug "SCORM PARSER ending recomposing $value " - set lista [lreplace $lista end end $value] - set value "" - } - #end splitting list from applet - foreach couple $lista { - set all "" - set request "" - set value "" - #create list named item to contain request and value - regexp \(\[^=\]+\)=\(\.*\)$ $couple all request value - ns_log debug "SCORM request from applet is $all that is $request to $value" - if { [ string length $value ] == 0 } { - ns_log debug "SCORM EMPTY settings : '$request' received and empty -> won't skip" - } - set table [lindex [split $request .] 1] - set column [string trim [lindex [split $request .] 2]] - switch $table { - null - - "" { ns_log debug "SCORM EMPTY TABLENAME : '$table', '$column' not implemented -> not treating this applet request" } - core { - if { [ string compare "total_time" $column ] } { - # string compare returns 0 for equal, -1 or +1 in other cases - # time fields preprocessing - if { [ string first "time" $column ] >0 } { - # conversion of HHHH:MM:SS.SS - # removing leading zeros: - # 'regsub {^0*((1-90-9*)|0)$} $x {\1} x' - regsub {^0} [lindex [split $value :] 0] "" hours - regsub {^0} [lindex [split $value :] 1] "" minutes - regsub {^0} [lindex [split $value :] 2] "" seconds - regsub {^0} [lindex [split $value .] 1] "" msecs - if { [empty_string_p $hours] } { set hours 0 } - if { [empty_string_p $minutes] } { set minutes 0 } - if { [empty_string_p $seconds] } { set seconds 0 } - if { [empty_string_p $msecs] } { set msecs 0 } - set column_ms $column - append column_ms "_ms" - set todo "UPDATE lorsm_cmi_$table SET $column_ms = '" - append todo $msecs - append todo "' WHERE track_id=$currenttrackid" - #append todo "' WHERE track_id=:currenttrackid" - db_dml todo $todo - if { [db_resultrows] == 1 } { - ns_log debug "SCORM data msecs processing UPDATE: '$todo' successfull" - } else { - ns_log Warning "SCORM data msecs processing UPDATE: '$todo' not successfull -> please check" - } - #set minutes [string trim [lindex [split $value :] 1]] - #set seconds [string trim [lindex [split $value :] 2]] - set value [expr int (( $hours*60 + $minutes ) * 60 + $seconds) ] - } - - set todo "UPDATE lorsm_cmi_$table SET $column = '" - append todo $value - append todo "' WHERE track_id=$currenttrackid" - #append todo "' WHERE track_id=:currenttrackid" - db_dml todo $todo - if { [db_resultrows] == 1 } { - ns_log debug "SCORM data processing UPDATE: '$todo' successfull" - } else { - ns_log Warning "SCORM data processing UPDATE: '$todo' not successfull -> please check" - } - - #lesson_status postprocessing - if { ! [ string compare "lesson_status" $column ] } { - ns_log notice "LESSON STATUS set to $value, cascading down the tree" - #lesson status can be: - #Passed - #Completed - #Browsed - #Failed - #Not attempted - #Incomplete - ns_log debug "SCORM servlet: lesson_status postprocessing" - lorsm::delivery::scorm::check_parents -ims_item_id $currentpage - } - } - } - default { - ns_log Warning "SCORM table: '$table', '$column' not implemented -> not treating this applet request" - } - } - } - switch $functionCalled { - cmiputcat { - #We try setting track exit so that we keep some exit time - #even if user closes the course without passing by FINISH - if { $lorsmstudenttrack == "" || $lorsmstudenttrack == 0 } { - lorsm::track::exit -track_id $currenttrackid } else { - #speficic for courses for which istrackable is on - lorsm::track::exit -track_id $lorsmstudenttrack } - ns_return 200 text/plain "OK" - ns_log $basiclevel "SCORM post LMSCommit (trackid=$currenttrackid)" - } - cmiputcatONFINISH { - set lorsmstudenttrack [ad_get_client_property lorsm studenttrack] - ad_set_client_property lorsm studenttrack "" - ad_set_client_property lorsm currenttrackid "" - ad_set_client_property lorsm initedonpage "" - if { $lorsmstudenttrack == "" || $lorsmstudenttrack == 0 } { - lorsm::track::exit -track_id $currenttrackid } else { - #speficic for courses for which istrackable is on - lorsm::track::exit -track_id $lorsmstudenttrack } - ns_return 200 text/plain "OK" - ns_log $basiclevel "SCORM post LMSFinish (trackid=$currenttrackid) sent ok to applet" - } - } + if { [ string length $minutes] == 1 } { + set minutes 0$minutes + } + + if { [ string length $seconds] == 1 } { + set seconds 0$seconds + } + + set session_time "$hours:$minutes:$seconds.$session_time_ms" + #if { ! [empty_string_p $session_time_ms] } { append session_time ".$session_time_ms" } + set hours [expr int ($total_time/3600) ] + set minutes [expr int (($total_time - (3600*$hours)) / 60) ] + set seconds [expr int (($total_time - (3600*$hours)-$minutes*60)) ] + if { [ string length $total_time_ms] == 1 } { + set total_time_ms "$prefix$total_time_ms" + } + + if { [ string length $hours ] == 1 } { + set hours "$prefix$hours" + } + + if { [ string length $minutes] == 1 } { + set minutes 0$minutes + } + + if { [ string length $seconds] == 1 } { + set seconds 0$seconds + } + set total_time "$hours:$minutes:$seconds.$total_time_ms" + #if { ! [empty_string_p $total_time_ms] } { append total_time ".$total_time_ms" } + #appending time fields to return string + append returndata ",cmi.core.session_time=$session_time, + cmi.core.total_time=$total_time" + ns_log $basiclevel "SCORM initialised, sending data to applet" + ns_log $tracelevel "$returndata" + + ns_return 200 text/plain "$returndata" + } cmiputcat* { + ns_log $tracelevel "---------------------------------------" + switch $functionCalled { + cmiputcat { + ns_log $basiclevel " LMSCommit" + + } cmiputcatONFINISH { + ns_log $basiclevel " LMSFinish" + } + } + + ns_log $tracelevel "---------------------------------------" + ns_log $tracelevel "received data $data from applet: processing. " + ns_log $tracelevel "Reference cmi track is $currenttrackid, + while lorsmstudenttrack is: $lorsmstudenttrack" + set preparselist [lrange [ split $data "," ] 1 end] + set lista [list] + set value "" + #here we build a list of request=value. we must do some pattern matching + foreach couple $preparselist { + if { [ regexp ^cmi\.* $couple ] } { + if { ! [empty_string_p $value] } { + set value [concat [lindex $lista end],$value] + ns_log debug "SCORM PARSER ending recomposing $value " + set lista [lreplace $lista end end $value] + set value "" + } else { + ns_log debug "SCORM PARSER full couple $couple " + lappend lista $couple + } + } else { + ns_log debug "SCORM PARSER partial couple $couple " + set value [concat $value,$couple] + ns_log debug "SCORM PARSER partial couple $couple " + } + } + + if { ! [empty_string_p $value] } { + set value [concat [lindex $lista end],$value] + ns_log debug "SCORM PARSER ending recomposing $value " + set lista [lreplace $lista end end $value] + set value "" + } + + #end splitting list from applet + foreach couple $lista { + set all "" + set request "" + set value "" + #create list named item to contain request and value + regexp \(\[^=\]+\)=\(\.*\)$ $couple all request value + ns_log debug "SCORM request from applet is $all that is $request to $value" + + if { [ string length $value ] == 0 } { + ns_log debug "SCORM EMPTY settings : '$request' received and empty -> won't skip" + } + + set table [lindex [split $request .] 1] + set column [string trim [lindex [split $request .] 2]] + switch $table { + null - + "" { ns_log debug "SCORM EMPTY TABLENAME : '$table', + '$column' not implemented -> not treating + this applet request" + + } core { + if { [ string compare "total_time" $column ] } { + # string compare returns 0 for equal, -1 or +1 in other cases + # time fields preprocessing + + if { [ string first "time" $column ] >0 } { + # conversion of HHHH:MM:SS.SS + # removing leading zeros: + # 'regsub {^0*((1-90-9*)|0)$} $x {\1} x' + regsub {^0} [lindex [split $value :] 0] "" hours + regsub {^0} [lindex [split $value :] 1] "" minutes + regsub {^0} [lindex [split $value :] 2] "" seconds + regsub {^0} [lindex [split $value .] 1] "" msecs + if { [empty_string_p $hours] } { + set hours 0 + } + + if { [empty_string_p $minutes] } { + set minutes 0 + } + + if { [empty_string_p $seconds] } { + set seconds 0 + } + + if { [empty_string_p $msecs] } { + set msecs 0 + } + set column_ms $column + append column_ms "_ms" + + set todo "UPDATE lorsm_cmi_$table SET $column_ms = '" + append todo $msecs + append todo "' WHERE track_id=$currenttrackid" + #append todo "' WHERE track_id=:currenttrackid" + db_dml todo $todo + if { [db_resultrows] == 1 } { + ns_log debug "SCORM data msecs processing UPDATE: + '$todo' successfull" + } else { + ns_log Warning "SCORM data msecs processing UPDATE: + '$todo' not successfull -> please check" + } + + #set minutes [string trim [lindex [split $value :] 1]] + #set seconds [string trim [lindex [split $value :] 2]] + set value \ + [expr int (( $hours*60 + $minutes ) * 60 + $seconds) ] + } + + set todo "UPDATE lorsm_cmi_$table SET $column = '" + append todo $value + append todo "' WHERE track_id=$currenttrackid" + #append todo "' WHERE track_id=:currenttrackid" + db_dml todo $todo + if { [db_resultrows] == 1 } { + ns_log debug "SCORM data processing UPDATE: + '$todo' successfull" + } else { + ns_log Warning "SCORM data processing UPDATE: + '$todo' not successfull -> please check" + } + + #lesson_status postprocessing + if { ! [ string compare "lesson_status" $column ] } { + ns_log notice "LESSON STATUS set to $value, + cascading down the tree" + #lesson status can be: + #Passed + #Completed + #Browsed + #Failed + #Not attempted + #Incomplete + ns_log debug "SCORM servlet: + lesson_status postprocessing" + lorsm::delivery::scorm::check_parents -ims_item_id $currentpage + } + } + } default { + ns_log Warning "SCORM table: '$table', '$column' not implemented -> not treating this applet request" + } + } + } + + switch $functionCalled { + cmiputcat { + #We try setting track exit so that we keep some exit time + #even if user closes the course without passing by FINISH + if { $lorsmstudenttrack == "" || $lorsmstudenttrack == 0 } { + lorsm::track::exit -track_id $currenttrackid + } else { + #speficic for courses for which istrackable is on + lorsm::track::exit -track_id $lorsmstudenttrack + } + ns_return 200 text/plain "OK" + ns_log $basiclevel "SCORM post LMSCommit (trackid=$currenttrackid)" + + } cmiputcatONFINISH { + set lorsmstudenttrack [ad_get_client_property lorsm studenttrack] + ad_set_client_property lorsm studenttrack "" + ad_set_client_property lorsm currenttrackid "" + ad_set_client_property lorsm initedonpage "" + + if { $lorsmstudenttrack == "" || $lorsmstudenttrack == 0 } { + lorsm::track::exit -track_id $currenttrackid + } else { + #speficic for courses for which istrackable is on + lorsm::track::exit -track_id $lorsmstudenttrack + } + ns_return 200 text/plain "OK" + ns_log $basiclevel "SCORM post LMSFinish (trackid=$currenttrackid) sent ok to applet" + } + } + } default { + #returning a BAD REQUEST and not a GATEWAY ERROR !!! + ns_return 400 text/plain "Error=103,ErrorDescription=\"No functionCalled meaningful value provided\"" } - default - { - #returning a BAD REQUEST and not a GATEWAY ERROR !!! - ns_return 400 text/plain "Error=103,ErrorDescription=\"No functionCalled meaningful value provided\"" - } } ns_log $tracelevel "---------------------------------------" -ns_log $basiclevel " LMS Rte server END" +ns_log $basiclevel " LMS Rte server END" ns_log $tracelevel "---------------------------------------"