Index: openacs-4/packages/lors-central/catalog/lors-central.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/catalog/lors-central.en_US.ISO-8859-1.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/catalog/lors-central.en_US.ISO-8859-1.xml 17 May 2005 16:21:16 -0000 1.1 @@ -0,0 +1,108 @@ + + + + Action Not Allowed + Add Child + Add an existent Learning Object + Add File + Add From Clipboard: + Add Object + Add This Item + Add this learning object to your clipboard + Add to Clipboard + Add to this course + Add to this resource + All Views + All Views of this object + And is in use in the following courses + Associations: + Associate + Associate/Drop + Associate to dotLRN Class + Associate to this class + Already Associated + Author: + Choose the file to upload + Class Name + Classes Using this Course + Click For Preview + Clip This Resource + Course Name + Course Versions + Courses + Create a New File or.... + Current + Department Name + Description + Disabled + dotLRN classes + Drop + Drop association to this class + Edit + Edit %name% + Enabled + Everywhere + Filename + Use the "Browse..." button to locate your file, then click "Open" + Here + Hide + Item Files + Item Name: + Item Title + Check/uncheck all rows + Last Modifed + Live + Live Classes? + Learning Object Files + Make + Make Live Everywhere + Make this live + Manifest ID + Add New File + New Learning Object + No + of + of %name% + One Course + One Course Associations + One Course Views + One File + One Learning Object + Please type a keyword + Preview + Search + Search Courses + Set to + Shared? + Shared Items In The Repository + Subject Name + Term Name + There are no items in this clipboard. + This course is in use in the following dotLRN classes: + This File + This file has the following versions + This file is already present on this resource. You can't add the same file to the same resource twice. + This is a zip file containing multiple files. + This Learning Object is in use in the following class instances: + This files are in use in this learning object + Check/uncheck this row, and select an action to perform below + Tracking + Type + Update Course Versions + Update Versions + Upload a New File or.... + Usage + Version + Ver. # + Versions + View + View All + View all existing clipboards + Views + Views in this class + Course associations to dotLRN class + We are sorry, it appears you don't have permission to admin lors-central package. + Yes + <b>You have to associate the course to a class before you can manage tracking</b> + Zip File + Index: openacs-4/packages/lors-central/catalog/lors-central.es_ES.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/catalog/lors-central.es_ES.ISO-8859-1.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/catalog/lors-central.es_ES.ISO-8859-1.xml 17 May 2005 16:21:16 -0000 1.1 @@ -0,0 +1,108 @@ + + + + Accion no permitida + Agregar Hijo + Agregar un objeto de aprendizaje existente + Agregar Archivo + Agregar desde el Sujetapapeles: + Agregar Objeto + Agregar este Objeto + Agregar este objeto de aprendizaje al sujetapapeles + Agregar al sujetapapeles + Agregar a este curso + Agregar a este recurso + Todas las vistas + Todas las vistas de este objeto + Y esta siendo utilizado en los siguientes cursos + Asociaciones: + Asociar + Asociar/Quitar + Asociar a una clase de dotLRN + Asociar a esta clase + Already Asociado + Autor: + Escoja el archivo que desea subir + Nombre de la Clase + Clases que utilizan este curso + Click para previsualizar + Sujetar este Recurso + Nombre del Curso + Versiones del Curso + Cursos + Crear el nuevo archivo + Actual + Nombre del Departamento + Descripcion + Deshabilitado + classes de dotLRN + Quitar + Quitar la asociacion de esta clase + Editar + Editar %name% + Habilitado + En todos lados + Nombre del archivo + Utilizar el boton de "Browse..." para localizar el archivo, luego presionar"Open" + Aqui + Ocultar + Archivos del Objeto + Nombre del Item: + Titulo del Item + Marcar/Desmarcar todas las filas + Ultima Modificacion + Actual + Clases donde es el actual? + Archivos del Objeto de Aprendizaje + Hacer + Cambiar a actual en todas las clases + Poner actual en esta clase + ID del Manifesto + Agregar Nuevo Archivo + Nuevo Objeto de Aprendisaje + No + de + de %name% + Un Curso + Asociaciones de un Curso + Visitas al Curso + Un Archivo + Un Objeto de Aprendizaje + Por favor ingrese una palabra + Previsualizacion + Buscar + Buscar Cursos + Establecer aCompartido? + Objetos Compartidos en el repositorio> + Nombre de la Materia + Nombre del Periodo + No existen artivulos en este Sujetapapeles. + Este curso es utilizado en las siguientes clases de dotLRN: + Este Archivo + Este archivo posee las siguientes versionies + Este archivo ya existe en este recurso. No es permitido agregar el mismo archivo al mismo recurso mas de una vez. + Este es un archivo zip conteniendo multiples archivos. + Este objeto de aprendizaje es utilizado en los siguientes cursos: + Estos archivos son utilizados en este Objeto de Aprendizaje + Marcar/Desmarcar esta fila, seleccionar una accion a realizar + Seguimiento + Tipo + Actualizar versiones del curso en las clases + Actualizar Versiones + Subir un Nuevo Archivo o.... + Utilizacion + Version + Ver. # + Versiones + Observar + Obsercar Todas + Observar todos los sujetapapeles existentesx + Vistas + Vistas en esta clase + Asociaciones de un curso a una clase de dotLRN + Lo sentimos, parece que no posee los permisos necesarios para administar el paquete de lors-central. + Si + <b>Se debe asociar este curso a una clase antes de poder manejar el Seguimiento del mismo</b> + Archivo Zip + Index: openacs-4/packages/lors-central/catalog/lors-central.es_GT.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/catalog/lors-central.es_GT.ISO-8859-1.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/catalog/lors-central.es_GT.ISO-8859-1.xml 17 May 2005 16:21:16 -0000 1.1 @@ -0,0 +1,108 @@ + + + + Accion no permitida + Agregar Hijo + Agregar un objeto de aprendizaje existente + Agregar Archivo + Agregar desde el Sujetapapeles: + Agregar Objeto + Agregar este Objeto + Agregar este objeto de aprendizaje al sujetapapeles + Agregar al sujetapapeles + Agregar a este curso + Agregar a este recurso + Todas las vistas + Todas las vistas de este objeto + Y esta siendo utilizado en los siguientes cursos + Asociaciones: + Asociar + Asociar/Quitar + Asociar a una clase de dotLRN + Asociar a esta clase + Already Asociado + Autor: + Escoja el archivo que desea subir + Nombre de la Clase + Clases que utilizan este curso + Click para previsualizar + Sujetar este Recurso + Nombre del Curso + Versiones del Curso + Cursos + Crear el nuevo archivo + Actual + Nombre del Departamento + Descripcion + Deshabilitado + classes de dotLRN + Quitar + Quitar la asociacion de esta clase + Editar + Editar %name% + Habilitado + En todos lados + Nombre del archivo + Utilizar el boton de "Browse..." para localizar el archivo, luego presionar"Open" + Aqui + Ocultar + Archivos del Objeto + Nombre del Item: + Titulo del Item + Marcar/Desmarcar todas las filas + Ultima Modificacion + Actual + Clases donde es el actual? + Archivos del Objeto de Aprendizaje + Hacer + Cambiar a actual en todas las clases + Poner actual en esta clase + ID del Manifesto + Agregar Nuevo Archivo + Nuevo Objeto de Aprendisaje + No + de + de %name% + Un Curso + Asociaciones de un Curso + Visitas al Curso + Un Archivo + Un Objeto de Aprendizaje + Por favor ingrese una palabra + Previsualizacion + Buscar + Buscar Cursos + Establecer aCompartido? + Objetos Compartidos en el repositorio> + Nombre de la Materia + Nombre del Periodo + No existen artivulos en este Sujetapapeles. + Este curso es utilizado en las siguientes clases de dotLRN: + Este Archivo + Este archivo posee las siguientes versionies + Este archivo ya existe en este recurso. No es permitido agregar el mismo archivo al mismo recurso mas de una vez. + Este es un archivo zip conteniendo multiples archivos. + Este objeto de aprendizaje es utilizado en los siguientes cursos: + Estos archivos son utilizados en este Objeto de Aprendizaje + Marcar/Desmarcar esta fila, seleccionar una accion a realizar + Seguimiento + Tipo + Actualizar versiones del curso en las clases + Actualizar Versiones + Subir un Nuevo Archivo o.... + Utilizacion + Version + Ver. # + Versiones + Observar + Obsercar Todas + Observar todos los sujetapapeles existentesx + Vistas + Vistas en esta clase + Asociaciones de un curso a una clase de dotLRN + Lo sentimos, parece que no posee los permisos necesarios para administar el paquete de lors-central. + Si + <b>Se debe asociar este curso a una clase antes de poder manejar el Seguimiento del mismo</b> + Archivo Zip + Index: openacs-4/packages/lors-central/lib/clipboard.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/lib/clipboard.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/lib/clipboard.adp 17 May 2005 16:21:17 -0000 1.1 @@ -0,0 +1,62 @@ + + + + Clip this item + + + + + + + This item is in the clipboard + + + + +

Clip this item to

+
+ + + +
+
+ + +

Items in this clipboard:

+ + + + + + +
+ +

#lors-central.there_are_no#

+
+ + + +

#lors-central.view_all#

+
+ + + Index: openacs-4/packages/lors-central/lib/clipboard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/lib/clipboard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/lib/clipboard.tcl 17 May 2005 16:21:17 -0000 1.1 @@ -0,0 +1,88 @@ +# lors-central specific clipboard +if {![info exists displayed_object_id]} { + set displayed_object_id "" +} + +# The type var indicates if the items we want to show are files +# or resources +if { ![empty_string_p $type] } { + if { [string equal $type "file"] } { + set extra_query "and t.pretty_name = 'Basic Item'" + template::list::create \ + -name file_items \ + -multirow items \ + -key object_id \ + -bulk_actions { + "\#lors-central.add_to_resource\#" new-clipboard-files "\#lors-central.add_to_resource\#" + } \ + -bulk_action_method post \ + -bulk_action_export_vars { + man_id + ims_item_id + name + } \ + -row_pretty_plural "\#lors-central.clip_files\#" \ + -elements { + object_id { + label "\#lors-central.item_files\#:" + display_template { + @items.item_title@ + } + } + object_name { + label "\#lors-central.filename\#:" + display_template { + @items.object_name@ + } + } + object_type { + label "\#lors-central.type\#:" + display_template { + @items.object_type@ + } + } + mime_type { + label "\#lors-central.mime_type\#:" + display_template { + @items.pretty_mime_type@ + } + } + clipped { + label "\#lors-central.clipped\#:" + display_template { + @items.clipped@ + } + } + } + + } else { + set extra_query "and t.pretty_name = 'IMS Resource Object'" + } +} else { + set extra_query "" +} + +set user_id [ad_conn user_id] +set lors_central_package_id [ad_conn package_id] + +# find if there is a lors-central clipboard +set clipboard_id [db_string get_cb_id { } -default ""] +if { [empty_string_p $clipboard_id] } { + # Create the clipboard_id + set clipboard_id [clipboard::new -owner_id $user_id -title "Lors Central" \ + -package_id $lors_central_package_id -creation_user_id $user_id] + +} +clipboard::clipboards $user_id clipboards +clipboard::clipped $displayed_object_id $user_id this_item_clipped + + +# TODO: Yuck! should fix this query. maybe stick it in an object_type view which restricts to clipable things. +db_multirow -extend {clipped object_name} items get_items { } { + set clipped [util::age_pretty -timestamp_ansi $clipped_ansi -sysdate_ansi [clock_to_ansi [clock seconds]]] + set object_name [db_string get_object_name { } -default ""] +} + +set url "/" + +ad_return_template \ No newline at end of file Index: openacs-4/packages/lors-central/lib/clipboard.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/lib/clipboard.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/lib/clipboard.xql 17 May 2005 16:21:17 -0000 1.1 @@ -0,0 +1,64 @@ + + + + + + + select object_id + from acs_objects + where package_id= :lors_central_package_id + and object_type='clipboard' + + + + + + SELECT + o.object_id, + t.pretty_name as object_type, + coalesce(o.title,'object '||o.object_id) as item_title, + to_char(m.clipped_on,'YYYY-MM-DD HH24:MI:SS') as clipped_ansi, + coalesce((select + label + from + cr_revisions, + cr_items, + cr_mime_types + where + live_revision=revision_id + and cr_revisions.revision_id = o.object_id + and cr_revisions.mime_type = cr_mime_types.mime_type),'') as pretty_mime_type + FROM + clipboard_object_map m, + acs_objects o, + acs_object_types t + WHERE + clipboard_id = :clipboard_id + $extra_query + and o.object_id = m.object_id + and t.object_type = ( case when o.object_type = 'content_item' then ( + select + case when i.content_type = 'content_extlink' then + 'content_extlink' + else r.object_type + end + from + acs_objects r, + cr_items i + where + r.object_id = coalesce( i.live_revision, i.latest_revision, i.item_id) + and i.item_id = o.object_id) else o.object_type + end ) + + + + + + select distinct filename + from ims_cp_files + where file_id = :object_id + + + + + Index: openacs-4/packages/lors-central/lib/content-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/lib/content-edit-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/lib/content-edit-postgresql.xql 17 May 2005 16:21:17 -0000 1.1 @@ -0,0 +1,48 @@ + + + + + + postgresql + 7.2 + + + + + + update cr_revisions + set lob = [set __lob_id [db_string get_lob_id "select empty_lob()"]] + where revision_id = :revision_id + + + + + + + + update cr_revisions + set content_length = lob_length(lob) + where revision_id = :revision_id + + + + + + + + select file_storage__new_version(:title,:description,:mime_type,:file_id,:creation_user,:creation_ip); + + + + + + + + update cr_revisions + set content = '$tmp_filename', + content_length = $tmp_size + where revision_id = :revision_id + + + + Index: openacs-4/packages/lors-central/lib/content-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/lib/content-edit.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/lib/content-edit.adp 17 May 2005 16:21:17 -0000 1.1 @@ -0,0 +1,4 @@ + + + +@content_body@ \ No newline at end of file Index: openacs-4/packages/lors-central/lib/content-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/lib/content-edit.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/lib/content-edit.tcl 17 May 2005 16:21:17 -0000 1.1 @@ -0,0 +1,113 @@ +ad_page_contract { + Edit ims_cp_file content and create a new revision + @param file_id + @param res_id ? + @param man_id ? +} { +} + +set user_id [ad_conn user_id] + +foreach required_param {file_id} { + if {![info exists $required_param]} { + return -code error "$required_param is a required parameter." + } +} + +foreach optional_param {return_url submission_p} { + if {![info exists $optional_param]} { + set $optional_param {} + } +} + +if {[empty_string_p $return_url]} { + set return_url [export_vars -base "one-learning-object" {man_id ims_item_id}] +} + +set file_item_id [lors_central::get_item_id -revision_id $file_id] +if {![lors_central::item_editable_p -item_id $file_item_id]} { + set edit_p 0 +} else { + set edit_p 1 +} + +array set fs_object_info [lors_central::get_object_info -file_id $file_id] + +if {[empty_string_p $submission_p]} { + if {[string equal $fs_object_info(mime_type) "text/html"]} { + set htmlarea_p 1 + } else { + set htmlarea_p 0 + } +} + +ad_form \ + -name file_form \ + -export {res_id man_id file_id return_url} \ + -form { + {title:text(inform) {label "Title"}} + {version_notes:text(inform) {label "Current Version Notes"}} + {description:text(text),optional {label "Version Notes"}} + {content:richtext(richtext),optional {label "Content"} {html {rows 20 cols 60}} {htmlarea_p 1}} + {submission_p:text(hidden) {value 1}} + } \ + -on_request { + set title $fs_object_info(name) + set version_notes $fs_object_info(version_notes) + # Extract only the HTML body + regexp -nocase {<\s*?body[^>]*?>(.*)} $fs_object_info(content) match fs_object_info(content) + set content [list [string trim $fs_object_info(content)] $fs_object_info(mime_type)] + set return_url $return_url + } -on_submit { + set content_body [template::util::richtext::get_property contents $content] + # Rebuild HTML if necessary + if { [regexp -nocase {^(.*<\s*?body[^>]*?>).*(.*)$} $fs_object_info(content) match header footer] } { + set content_body "${header}${content_body}${footer}" + } + + foreach {link id} [regexp -inline -all {.*?} $content_body] { + # ns_log notice "DAVEB link '${link}' id '${id}" + # find out if its an image + + if {[db_0or1row mime "select mime_type as this_mime_type, title as this_title from cr_revisions, cr_items where cr_items.item_id=:id and revision_id=live_revision"]} { + # ns_log notice "DAVEB mime_type '${this_mime_type}'" + if {[string match "image/*" $this_mime_type]} { + + regsub -all $link $content_body "" content_body + } else { + # FIXME for now just throw away non image links until we can do something intelligent with them! + regsub -all $link $content_body {} content_body + } + } + + } + + set mime_type [template::util::richtext::get_property format $content] + set file_item_id [lors_central::get_item_id -revision_id $file_id] + # this is 99% the same as new-file, it _is_ a new file except its not uploaded + set new_res_id [lors_central::add_resource_revision \ + -res_id $res_id \ + -name $title \ + -user_id [ad_conn user_id] \ + -man_id $man_id] + set new_file_id [lors_central::add_file_revision \ + -file_content $content_body \ + -mime_type $mime_type \ + -name $title \ + -title $title \ + -res_id $new_res_id \ + -man_id $man_id \ + -item_id $file_item_id] + + set exclude [db_list get_exclude "select revision_id from cr_revisions where item_id=:file_item_id"] + + lors_central::resource_carry_forward_files -old_res_id $res_id -new_res_id $new_res_id -exclude $exclude + lors_central::res_update_items \ + -old_res_id $res_id \ + -new_res_id $new_res_id \ + -user_id [ad_conn user_id] + + } -after_submit { + + ad_returnredirect $return_url + } Index: openacs-4/packages/lors-central/lib/item-files.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/lib/item-files.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/lib/item-files.adp 17 May 2005 16:21:17 -0000 1.1 @@ -0,0 +1,2 @@ +

#lors-central.this_lo_uses#

+ \ No newline at end of file Index: openacs-4/packages/lors-central/lib/item-files.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/lib/item-files.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/lib/item-files.tcl 17 May 2005 16:21:17 -0000 1.1 @@ -0,0 +1,66 @@ +ad_page_contract { + List files used in this object + @param res_id + @param ims_item_id +} + +if {![exists_and_not_null res_id]} { + set res_id [lors_central::get_item_res_id -ims_item_id $ims_item_id] +} + +set package_id [ad_conn package_id] +set user_id [ad_conn user_id] +set clipboard_id [db_string get_cb_id { } -default ""] +if { [empty_string_p $clipboard_id] } { + # Create the clipboard_id + set clipboard_id [clipboard::new -owner_id $user_id -title "Lors Central" \ + -package_id $package_id -creation_user_id $user_id] + +} +db_multirow -extend {edit edit_url clip clip_url count one_file_url main_file} files get_files2 { } { + set edit "Edit" + set edit_url [export_vars -base one-object-edit {res_id}] + set clip "Clip" + set clip_url [export_vars -base "/clipboard/attach" {{object_id $file_id} clipboard_id}] + set file_item_id [db_string get_file_item_id { } -default 0] + set count [db_string get_revision_count { } -default 0] + set one_file_url [export_vars -base one-file {file_id res_id}] + if {$main_file_p} { + set main_file "Main File" + } else { + set main_file "" + } +} + +# To action buttons one for adding a new file to this resource +# and the second one to clip all the resource ( all files ) +set actions_list [list \ + [_ lors-central.add_file] [export_vars -base "new-file" {res_id}] \ + [_ lors-central.add_file] \ + [_ lors-central.clip_this_res] \ + [export_vars -base "/clipboard/attach" {{object_id $res_id} clipboard_id}] \ + [_ lors-central.clip_this_res]] + +template::list::create \ + -name files \ + -multirow files \ + -actions $actions_list \ + -elements { + title { + label "Title" + display_template { + +    + @files.title@ + } + } + rev_count { + label "[_ lors-central.versions]" + display_template { +
@files.count@
+ } + } + mime_type_pretty {label "Type"} + main_file {label ""} + clip {label "" link_url_col {clip_url}} + } \ No newline at end of file Index: openacs-4/packages/lors-central/lib/item-files.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/lib/item-files.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/lib/item-files.xql 17 May 2005 16:21:17 -0000 1.1 @@ -0,0 +1,95 @@ + + + + + + + select object_id + from acs_objects + where package_id = :package_id and object_type='clipboard' + + + + + + select + 'Edit' as edit, + r.res_id, + r.file_id, + r.item_id, + r.revision_id, + r.filename, + r.pathtofile, + r.title, + r.mime_type, + r.label as mime_type_pretty + from + ims_cp_items_to_resources itr left join + ( select + f.res_id, + f.file_id, + ci.item_id, + cr.revision_id, + f.filename, + f.pathtofile, + cr.title, + cr.mime_type, + cm.label + from + ims_cp_files f, + cr_items ci, + cr_revisions cr, + cr_mime_types cm + where + ci.item_id = ( select item_id from cr_revisions where revision_id = f.file_id) + and cr.revision_id = ci.live_revision + and cr.mime_type = cm.mime_type ) r + on r.res_id = itr.res_id + where itr.ims_item_id = :ims_item_id + + + + + + select + i.file_id, + i.res_id, + i.pathtofile, + i.filename, + i.hasmetadata, + cr.title, + crm.label as mime_type_pretty, + case when i.pathtofile = + (select href from ims_cp_resources where res_id=:res_id) + then 1 else 0 end as main_file_p + from + ims_cp_files i, + cr_mime_types crm, + cr_revisions cr + where i.res_id = :res_id + and crm.mime_type = ( select mime_type + from cr_revisions + where revision_id = i.file_id) + and cr.revision_id = i.file_id + + + + + + + select item_id + from cr_revisions + where revision_id = :file_id + + + + + + select count(revision_id) + from cr_revisions + where item_id = :file_item_id + + + + + Index: openacs-4/packages/lors-central/sql/postgresql/lors-central-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/sql/postgresql/lors-central-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/sql/postgresql/lors-central-create.sql 17 May 2005 16:21:17 -0000 1.1 @@ -0,0 +1,22 @@ +ALTER TABLE ims_cp_manifest_class DROP CONSTRAINT ims_cp_manifest_class_pkey; +ALTER TABLE ims_cp_items ADD sort_order integer; +ALTER TABLE ims_cp_files DROP CONSTRAINT ims_cp_files_file_if_fk; +ALTER TABLE ims_cp_files ADD CONSTRAINT ims_cp_files_file_if_fk FOREIGN KEY (file_id) REFERENCES cr_revisions(revision_id) ON DELETE CASCADE; + +create table ims_cp_items_map ( + man_id int + constraint ims_cp_items_map_man_id_fk references ims_cp_manifests (man_id), + org_id int + constraint ims_cp_items_map_org_id_fk references ims_cp_organizations (org_id), + community_id int + constraint ims_cp_items_map_com_id_fk references dotlrn_communities_all(community_id), + hide_p boolean default 'f', + ims_item_id int + constraint ims_cp_items_map_ims_item_id_fk references ims_cp_items (ims_item_id), + constraint ims_cp_items_map_pk primary key (ims_item_id,community_id,man_id) + +); + + + +\i lors-central-imscp-package-create.sql \ No newline at end of file Index: openacs-4/packages/lors-central/sql/postgresql/lors-central-imscp-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/sql/postgresql/lors-central-imscp-package-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/sql/postgresql/lors-central-imscp-package-create.sql 17 May 2005 16:21:17 -0000 1.1 @@ -0,0 +1,59 @@ +-- + +-- And + +-- SCORM 1.2 Specs + +create or replace function ims_manifest_admin__new ( + varchar, -- course_name + varchar, -- identifier + varchar, -- version + varchar, -- orgs_default + boolean, -- hasmetadata + integer, -- parent_man_id + boolean, -- isscorm + integer, -- folder_id + timestamp with time zone, -- creation_date + integer, -- creation_user + varchar, -- creation_ip + integer, -- package_id + integer, -- new revision_id for the item in the CR + boolean, -- is shared + integer -- course_presentation_format +) +returns integer as ' +declare + p_course_name alias for $1; + p_identifier alias for $2; + p_version alias for $3; + p_orgs_default alias for $4; + p_hasmetadata alias for $5; + p_parent_man_id alias for $6; + p_isscorm alias for $7; + p_folder_id alias for $8; + p_creation_date alias for $9; + p_creation_user alias for $10; + p_creation_ip alias for $11; + p_package_id alias for $12; + p_revision_id alias for $13; + p_isshared alias for $14; + p_course_presentation_format alias for $15; +begin + + -- we make an update here because the content::item::new already inserts a row in the ims_cp_manifests + update ims_cp_manifests + set course_name=p_course_name, identifier=p_identifier, version=p_version, + orgs_default=p_orgs_default, hasmetadata=p_hasmetadata, parent_man_id=p_parent_man_id, + isscorm=p_isscorm, folder_id=p_folder_id, isshared = p_isshared, + course_presentation_format=p_course_presentation_format + where man_id = p_revision_id; + + insert into ims_cp_manifest_class + (man_id, lorsm_instance_id, isenabled, istrackable) + values + (p_revision_id, p_package_id, ''t'', ''f''); + + return p_revision_id; +end; +' language 'plpgsql'; + Index: openacs-4/packages/lors-central/sql/postgresql/upgrade/lors-central-0.1a1-0.1a2.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/sql/postgresql/upgrade/lors-central-0.1a1-0.1a2.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/sql/postgresql/upgrade/lors-central-0.1a1-0.1a2.sql 17 May 2005 16:21:17 -0000 1.1 @@ -0,0 +1,9 @@ +ALTER TABLE ims_cp_files DROP CONSTRAINT ims_cp_files_file_if_fk; + +UPDATE ims_cp_files +SET file_id = ( + select live_revision + from cr_items + where item_id = file_id ); + +ALTER TABLE ims_cp_files ADD CONSTRAINT ims_cp_files_file_if_fk FOREIGN KEY (file_id) REFERENCES cr_revisions(revision_id) ON DELETE CASCADE; \ No newline at end of file Index: openacs-4/packages/lors-central/sql/postgresql/upgrade/lors-central-03042005.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/sql/postgresql/upgrade/lors-central-03042005.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/sql/postgresql/upgrade/lors-central-03042005.sql 17 May 2005 16:21:17 -0000 1.1 @@ -0,0 +1,3 @@ +ALTER TABLE ims_cp_items_map ADD hide_p boolean; +ALTER TABLE ims_cp_items_map ALTER hide_p SET default 'f'; + Index: openacs-4/packages/lors-central/tcl/apm-callbacks-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/tcl/apm-callbacks-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/tcl/apm-callbacks-procs.tcl 17 May 2005 16:21:18 -0000 1.1 @@ -0,0 +1,90 @@ +ad_library { + + Procedures to do a new impl and aliases in the acs-sc. + @autor Miguel Marin (miguelmarin@viaro.net) +} + +namespace eval lors_central::apm_callback {} + +ad_proc -private lors_central::apm_callback::package_install { +} { + Does the integration whith the notifications package. +} { + db_transaction { + + # Create the impl and aliases + set impl_id [create_lors_central_impl] + + # Create the notification type + set type_id [create_lors_central_type $impl_id] + + # Enable the delivery intervals and delivery methods + enable_intervals_and_methods $type_id + } +} + + +ad_proc -public lors_central::apm_callback::create_lors_central_impl {} { + Register the service contract implementation and return the impl_id + @return impl_id of the created implementation +} { + return [acs_sc::impl::new_from_spec -spec { + name one_lo_notif_type + contract_name NotificationType + owner "lors-central" + aliases { + GetURL lors_central::notification::get_url + ProcessReply lors_central::notification::process_reply + } + }] +} + +ad_proc -public lors_central::apm_callback::create_lors_central_type {impl_id} { + Create the notification type + @return the type_id of the created type +} { + return [notification::type::new \ + -sc_impl_id $impl_id \ + -short_name one_lo_notif \ + -pretty_name "One Learning Object Notification" \ + -description "Notification of a new Learning Object of one specific course"] +} + + +ad_proc -public lors_central::apm_callback::enable_intervals_and_methods {type_id} { + Enable the intervals and delivery methods of a specific type +} { + # Enable the various intervals and delivery method + notification::type::interval_enable \ + -type_id $type_id \ + -interval_id [notification::interval::get_id_from_name -name instant] + + notification::type::interval_enable \ + -type_id $type_id \ + -interval_id [notification::interval::get_id_from_name -name hourly] + + notification::type::interval_enable \ + -type_id $type_id \ + -interval_id [notification::interval::get_id_from_name -name daily] + + # Enable the delivery methods + notification::type::delivery_method_enable \ + -type_id $type_id \ + -delivery_method_id [notification::delivery::get_id -short_name email] +} + +ad_proc -public lors_central::apm_callback::after_upgrade { + -from_version_name:required + -to_version_name:required +} { + Makes the upgrade of lors-central package +} { + apm_upgrade_logic \ + -from_version_name $from_version_name \ + -to_version_name $to_version_name \ + -spec { + 0.1a2 0.1a3 { + lors_central::apm_callback::package_install + } + } +} \ No newline at end of file Index: openacs-4/packages/lors-central/tcl/lors-central-cr-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/tcl/lors-central-cr-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/tcl/lors-central-cr-procs.tcl 17 May 2005 16:21:18 -0000 1.1 @@ -0,0 +1,62 @@ +ad_library { + + @author Miguel Marin (miguelmarin@viaro.net) +} + +namespace eval lors_central::cr {} + +ad_proc -public lors_central::cr::add_files { + {-parent_id:required} + {-files:required} + {-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, + 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 + set mime_type [cr_filename_to_mime_type -create $fle] + + # insert file into the CR + db_transaction { + 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 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" + + } + + lappend retlist [list $fle $mime_type $parent_id $file_id $version_id $cr_file $file_size] + } + return $retlist +} Index: openacs-4/packages/lors-central/tcl/lors-central-export-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/tcl/lors-central-export-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/tcl/lors-central-export-procs-postgresql.xql 17 May 2005 16:21:18 -0000 1.1 @@ -0,0 +1,22 @@ + + + + postgresql7.1 + + + + select lob + from cr_revisions + where revision_id = $live_revision + + + + + + select content + from cr_revisions + where revision_id = :live_revision + + + + \ No newline at end of file Index: openacs-4/packages/lors-central/tcl/lors-central-export-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/tcl/lors-central-export-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/tcl/lors-central-export-procs.tcl 17 May 2005 16:21:18 -0000 1.1 @@ -0,0 +1,260 @@ +ad_library { + + Tcl API for lors-central content export + + @author Miguel Marin (miguelmarin@viaro.net) + @author Viaro Networks www.viaro.net +} + +namespace eval lors_central::export {} + +ad_proc -private lors_central::export::get_items_xml { + -org_id:required +} { + +} { + set items_count [db_string get_items_count { }] + set items_list [list] + set control_list [list] + db_foreach get_parent_items { } { + lappend items_list "$ims_item_id 1" + lappend control_list $ims_item_id + } + set i 0 + while { $i < $items_count } { + set i 0 + set aux_list $items_list + foreach item $aux_list { + incr i + set parent_item [lindex $item 0] + set parent_level [lindex $item 1] + db_foreach get_items { } { + if { [string equal [lsearch $control_list $ims_item_id] "-1"] } { + set items_list [linsert $items_list $i "$ims_item_id [expr $parent_level + 1]"] + lappend control_list $ims_item_id + incr i + } + } + } + } + return "$items_list" +} + + +ad_proc -private lors_central::export::publish_object_to_file_system { + -object_id:required + {-path ""} + {-user_id ""} + {-file_name ""} +} { + if {[empty_string_p $path]} { + set path [ns_tmpnam] + } + db_1row select_object_info { + select fs_objects.* + from fs_objects + where fs_objects.object_id = :object_id + } + + # We get rid of spaces since they are annoying + regsub -all { } $name {_} name + + if {[string equal folder $type]} { + set result [lors_central::export::publish_folder_to_file_system -folder_id $object_id -path $path -folder_name $name -user_id $user_id] + } elseif {[string equal url $type]} { + set result [lors_central::export::publish_url_to_file_system -object_id $object_id -path $path -file_name $file_name] + } else { + set result [lors_central::export::publish_versioned_object_to_file_system -object_id $object_id -path $path -file_name $file_name] + } + + return $result +} + +ad_proc -public lors_central::export::publish_folder_to_file_system { + {-folder_id:required} + {-path ""} + {-folder_name ""} + {-user_id ""} +} { + publish the contents of a file storage folder to the file system +} { + if {[empty_string_p $path]} { + set path [ns_tmpnam] + } + + if {[empty_string_p $folder_name]} { + set folder_name [get_object_name -object_id $folder_id] + } + set folder_name [remove_special_file_system_characters -string $folder_name] + + set dir [file join ${path} ${folder_name}] + file mkdir $dir + + foreach object [get_folder_contents -folder_id $folder_id -user_id $user_id] { + lors_central::export::publish_object_to_file_system \ + -object_id [ns_set get $object object_id] \ + -path $dir \ + -file_name [remove_special_file_system_characters -string [ns_set get $object name]] \ + -user_id $user_id + } + + return $dir +} + +ad_proc -public lors_central::export::publish_url_to_file_system { + {-object_id:required} + {-path ""} + {-file_name ""} +} { + publish a url object to the file system as a Windows shortcut + (which at least KDE also knows how to handle) +} { + if {[empty_string_p $path]} { + set path [ns_tmpnam] + file mkdir $path + } + + db_1row select_object_metadata {} + + if {[empty_string_p $file_name]} { + set file_name $label + } + set file_name "${file_name}.url" + set file_name [remove_special_file_system_characters -string $file_name] + + set fp [open [file join ${path} ${file_name}] w] + puts $fp {[InternetShortcut]} + puts $fp URL=$url + close $fp + + return [file join ${path} ${file_name}] +} + +ad_proc -public lors_central::export::publish_versioned_object_to_file_system { + {-object_id:required} + {-path ""} + {-file_name ""} +} { + publish an object to the file system +} { + if {[empty_string_p $path]} { + set path [ns_tmpnam] + file mkdir $path + } + + db_1row select_object_metadata {} + + if {[empty_string_p $file_name]} { + if {![info exists upload_file_name]} { + set file_name "unnamedfile" + } else { + set file_name $file_upload_name + } + } + set file_name [remove_special_file_system_characters -string $file_name] + + switch $storage_type { + lob { + + # FIXME: db_blob_get_file is failing when i use bind variables + + # DRB: you're out of luck - the driver doesn't support them and while it should + # be fixed it will be a long time before we'll want to require an updated + # driver. I'm substituting the Tcl variable value directly in the query due to + # this. It's safe because we've pulled the value ourselves from the database, + # don't need to worry about SQL smuggling etc. + + db_blob_get_file select_object_content {} -file [file join ${path} ${file_name}] + } + text { + set content [db_string select_object_content {}] + + set fp [open [file join ${path} ${file_name}] w] + puts $fp $content + close $fp + } + file { + set cr_path [cr_fs_path $storage_area_key] + set cr_file_name [db_string select_file_name {}] + + file copy -- "${cr_path}${cr_file_name}" [file join ${path} ${file_name}] + } + } + + return [file join ${path} ${file_name}] +} + +ad_proc -public lors_central::export::remove_special_file_system_characters { + {-string:required} +} { + remove unsafe file system characters. useful if you want to use $string + as the name of an object to write to disk. +} { + regsub -all {[<>:\"|/@\#%&+\\]} $string {_} string + return [string trim $string] +} + +ad_proc -public lors_central::export::get_folder_contents { + {-folder_id ""} + {-user_id ""} + {-n_past_days "99999"} +} { + Retrieve the contents of the specified folder in the form of a list + of ns_sets, one for each row returned. The keys for each row are as + follows: + + object_id, name, live_revision, type, + last_modified, new_p, content_size, file_upload_name + write_p, delete_p, admin_p, + + @param folder_id The folder for which to retrieve contents + @param user_id The viewer of the contents (to make sure they have + permission) + @param n_past_days Mark files that are newer than the past N days as new +} { + if {[empty_string_p $folder_id]} { + set folder_id [get_root_folder -package_id [ad_conn package_id]] + } + + if {[empty_string_p $user_id]} { + set user_id [acs_magic_object the_public] + } + + set list_of_ns_sets [db_list_of_ns_sets select_folder_contents {}] + + foreach set $list_of_ns_sets { + # in plain Tcl: + # set last_modified_ansi [lc_time_system_to_conn $last_modified_ansi] + ns_set put $set last_modified_ansi [lc_time_system_to_conn [ns_set get $set last_modifed_ansi]] + + # in plain Tcl: + # set last_modified [lc_time_fmt $last_modified_ansi "%x %X"] + ns_set put $set last_modified [lc_time_fmt [ns_set get $set last_modified_ansi] "%x %X"] + + # set content_size_pretty [lc_numeric $content_size] + ns_set put $set content_size_pretty [lc_numeric [ns_set get $set content_size]] + } + + return $list_of_ns_sets +} + +ad_proc -public lors_central::export::get_folder_contents_count { + {-folder_id ""} + {-user_id ""} +} { + Retrieve the count of contents of the specified folder. + + @param folder_id The folder for which to retrieve contents + @param user_id The viewer of the contents (to make sure they have + permission) +} { + if {[empty_string_p $folder_id]} { + set folder_id [get_root_folder -package_id [ad_conn package_id]] + } + + if {[empty_string_p $user_id]} { + set user_id [acs_magic_object the_public] + } + + return [db_string select_folder_contents_count {}] +} Index: openacs-4/packages/lors-central/tcl/lors-central-export-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/tcl/lors-central-export-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/tcl/lors-central-export-procs.xql 17 May 2005 16:21:18 -0000 1.1 @@ -0,0 +1,112 @@ + + + + + + select + count(ims_item_id) + from + ims_cp_items + where + org_id = :org_id + and ims_item_id = ( + select + live_revision + from + cr_items + where + item_id = ( + select + item_id + from + cr_revisions + where + revision_id = ims_item_id + ) + ) + + + + + + select + ims_item_id + from + ims_cp_items + where + parent_item = :org_id + and org_id = :org_id + order by sort_order + + + + + + select + ims_item_id, sort_order + from + ims_cp_items + where + parent_item = :parent_item + and org_id = :org_id + and ims_item_id = ( + select + live_revision + from + cr_items + where + item_id = ( + select + item_id + from + cr_revisions + where + revision_id = ims_item_id + ) + ) + order by sort_order + + + + + + select count(*) + from fs_objects + where parent_id = :folder_id + + + + + + + select cr_items.item_id as object_id, + cr_items.name + from cr_items + where cr_items.parent_id = :folder_id + and exists (select 1 + from acs_object_party_privilege_map m + where m.object_id = cr_items.item_id + and m.party_id = :user_id + and m.privilege = 'read') + + + + + + + select fs_objects.*, + cr_items.storage_type, + cr_items.storage_area_key, + cr_revisions.title + from fs_objects, + cr_items, + cr_revisions + where fs_objects.object_id = :object_id + and fs_objects.object_id = cr_items.item_id + and fs_objects.live_revision = cr_revisions.revision_id + + + + + + \ No newline at end of file Index: openacs-4/packages/lors-central/tcl/lors-central-imscp-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/tcl/lors-central-imscp-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/tcl/lors-central-imscp-procs.tcl 17 May 2005 16:21:18 -0000 1.1 @@ -0,0 +1,523 @@ +ad_library { + IMS Content Packaging functions + +} + +namespace eval lors_central::imscp {} + +# IMS CP database transaction functions +ad_proc -public lors_central::imscp::manifest_add { + {-man_id ""} + {-identifier ""} + {-course_name ""} + {-version ""} + {-orgs_default {}} + {-hasmetadata ""} + {-parent_man_id ""} + {-isscorm ""} + {-folder_id ""} + {-package_id ""} + {-community_id ""} + {-user_id ""} + {-creation_ip ""} + {-version_id ""} + {-course_presentation_format "-1"} + -man_folder_id:required +} { + 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 version version. + @option orgs_default default organizations value. + @option hasmetadata whether the manifest has metadata (boolean). + @option parent_man_id parent manifest id (for manifest with submanifests). + @option isscorm wheather the manifest is SCORM compliant + @option folder_id the CR folder ID we created to put the manifest on. + @option package_id package_id for the instance of LORSm + @option community_id Community ID + @option user_id user that adds the category. [ad_conn user_id] used by default. + @option creation_ip ip-address of the user that adds the category. [ad_conn peeraddr] used by default. + @author Ernie Ghiglione (ErnieG@mm.st) +} { + # set utf-8 system encoding + encoding system utf-8 + + 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 $community_id]} { + set community_id "" + } + + + ######################################################################################### + # Since now we dont use acs-objects for the manifest, then a new cr_item and revision + # needs to be done to store the manifest. The cr_item and cr_revision are created here + # in orther to use the CR API. + + # Get LORSM Manifest Folder folder_id + set parent_id $man_folder_id + set content_type "ims_manifest_object" + set name "$course_name" + if {[empty_string_p $version_id]} { + set item_id [content::item::new -name $name -item_id $man_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] + + # 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 + + # 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 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"] + + # 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_admin__new ( + :course_name, + :identifier, + :version, + :orgs_default, + :hasmetadata, + :parent_man_id, + :isscorm, + :parent_id, + current_timestamp, + :user_id, + :creation_ip, + :package_id, + :revision_id, + :isshared, + :course_presentation_format + ); + + }] + } + return $manifest_id +} + + +ad_proc -public lors_central::imscp::addItems { + -itm_folder_id:required + {-org_id:required} + {itemlist} + {parent ""} + {tmp_dir ""} +} { + 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 itemlist list of items to be uploaded + @option parent parent item node (items can have subitems). + @author Ernie Ghiglione (ErnieG@mm.st) + +} { + # set utf-8 system encoding + encoding system utf-8 + + set retlist "" + + foreach item $itemlist { + set p_org_id $org_id + set p_parent_item $parent + set p_identifier [lindex $item 1] + set p_identifierref [lindex $item 2] + set p_isvisible [lindex $item 3] + set p_parameters [lindex $item 4] + set p_title [lindex $item 5] + set p_hasmetadata [lindex $item 6] + set p_prerequisites [lindex $item 7] + set p_prerequisites_type [lindex $p_prerequisites 0] + set p_prerequisites_string [lindex $p_prerequisites 1] + set p_maxtimeallowed [lindex $item 8] + 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] + + if {$p_hasmetadata != 0} { + set md_node $p_hasmetadata + set p_hasmetadata 1 + } + + set item_id [lors_central::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] + + if {$p_hasmetadata == 1} { + set aa [lors::imsmd::addMetadata \ + -acs_object $item_id \ + -node $md_node \ + -dir $tmp_dir] + } + + lappend retlist [list $item_id $p_identifierref] + + if { [llength $item] > 13} { + set subitem [lors_central::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] + } + } + return $retlist +} + +ad_proc -public lors_central::imscp::item_add { + {-item_id ""} + -org_id:required + {-identifier ""} + {-identifierref ""} + {-isvisible ""} + {-parameters ""} + {-title ""} + {-parent_item ""} + {-hasmetadata ""} + {-prerequisites_t ""} + {-prerequisites_s ""} + {-type ""} + {-maxtimeallowed ""} + {-timelimitaction ""} + {-datafromlms ""} + {-masteryscore ""} + {-dotlrn_permission ""} + {-package_id ""} + {-user_id ""} + {-creation_ip ""} + -itm_folder_id:required + +} { + Inserts a new item according to the info retrieved from the imsmanifest.xml file. + + @option item_id item id to be inserted. + @option org_id organization_id the item belogs to. + @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 + @option title items title. + @option parent_item for recursive items. Items can have subitems. + @option hasmetadata whether the item has metadata (boolean). + @option prerequisites_t items prerequisites type (SCORM extension). + @option prerequisites_s items prerequisites string (SCORM extension). + @option type items type (SCORM extension). + @option maxtimeallowed items maximum time allowed (SCORM extension). + @option timelimitaction items time limit action (SCORM extension). + @option datafromlms items data from LMS (SCORM extension). + @option masteryscore items mastery score (SCORM extension). + @option dotlrn_permission dotlrn extension to incoporate permissions. + @option package_id Package id. + @option user_id user that adds the category. [ad_conn user_id] used by default. + @option creation_ip ip-address of the user that adds the category. [ad_conn peeraddr] used by default. + @author Ernie Ghiglione (ErnieG@mm.st) +} { + # set utf-8 system encoding + encoding system utf-8 + + 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" + } + + #--------------------------------------------------------------------------------------# + # Since now we dont use acs-objects for the item, 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 Item Folder folder_id + set parent_id $itm_folder_id + 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 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"] + + 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 + ); + + } + ] + + } + + if {![empty_string_p $dotlrn_permission]} { + + permission::toggle_inherit -object_id $item_id + + + set community_id [dotlrn_community::get_community_id] + + # 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'}] + + # 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 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 + + # 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 $item_id -privilege read + + ns_log Notice "ims_item_id ($item_id) read permissions granted for community admins" + + + } + + return $item_id +} + +ad_proc -public lors_central::imscp::resource_add { + {-res_id ""} + -man_id:required + {-identifier ""} + {-type ""} + {-href ""} + {-scorm_type ""} + {-hasmetadata ""} + {-package_id ""} + {-user_id ""} + {-creation_ip ""} + {-num ""} + -res_folder_id:required + +} { + Inserts a new resource according to the imsmanifest.xml file. + + @option res_id resource id to be inserted. + @option man_id manifest the resource belogs to (required). + @option identifier intrinsic item identifier. + @option type item type. + @option href location or references to item location. + @option scorm_type SCORM item type (SCORM extension). + @option hasmetadata whether the item has metadata (boolean). + @option package_id Package id. + @option user_id user that adds the category. [ad_conn user_id] used by default. + @option creation_ip ip-address of the user that adds the category. [ad_conn peeraddr] used by default. + @author Ernie Ghiglione (ErnieG@mm.st) +} { + # set utf-8 system encoding + encoding system utf-8 + + 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 resource, 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 Resource Folder folder_id + set parent_id $res_folder_id + 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 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 { + select ims_resource__new ( + :res_id, + :man_id, + :identifier, + :type, + :href, + :scorm_type, + :hasmetadata, + current_timestamp, + :user_id, + :creation_ip, + :package_id, + :revision_id + ); + + } + ] + + } + return $resource_id +} + +ad_proc -public lors_central::imscp::organization_add { + {-org_id ""} + -man_id:required + {-identifier ""} + {-structure ""} + {-title ""} + {-hasmetadata ""} + {-package_id ""} + {-user_id ""} + {-creation_ip ""} + -org_folder_id:required + +} { + Inserts a new organizations according to the imsmanifest.xml file. + + @option org_id organization id to be inserted. + @option man_id manifest_id the organization belogs to. + @option identifier intrinsic organization identifier. + @option structure organization structure. + @option title organization title. + @option hasmetadata whether the organization has metadata (boolean). + @option package_id Package id. + @option user_id user that adds the category. [ad_conn user_id] used by default. + @option creation_ip ip-address of the user that adds the category. [ad_conn peeraddr] used by default. + @author Ernie Ghiglione (ErnieG@mm.st) +} { + # set utf-8 system encoding + encoding system utf-8 + + 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 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 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 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 +} \ No newline at end of file Index: openacs-4/packages/lors-central/tcl/lors-central-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/tcl/lors-central-install-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/tcl/lors-central-install-procs.tcl 17 May 2005 16:21:18 -0000 1.1 @@ -0,0 +1,97 @@ +# packages/lors-central/tcl/lors-central-install-procs.tcl + +ad_library { + + LORS CENTRAL Installation procedures + + @author Miguel Marin (miguelmarin@viaro.net) + @author Viaro Networks www.viaro.net +} + +# +# +# This package is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# It is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# + + +namespace eval lors_central::install {} + +ad_proc -private lors_central::install::package_install {} { + + Install creates the lors-central folders + +} { + # Create the root folder to store the LO's + set folder_id [content::folder::new -name "LORSM Root Folder" -label "LORSM Root Folder"] + 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" + + # Create the root folder to store the LO's Manifests + set folder_id [content::folder::new -name "LORSM Manifest Folder" -label "LORSM Manifest Folder"] + content::folder::register_content_type -folder_id $folder_id -content_type "ims_manifest_object" \ + -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" + + # Create the root folder to store the LO's Organizations + set folder_id [content::folder::new -name "LORSM Organizations Folder" -label "LORSM Organizations Folder"] + content::folder::register_content_type -folder_id $folder_id -content_type "ims_organization_object" \ + -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" + + # Create the root folder to store the LO's Items + set folder_id [content::folder::new -name "LORSM Items Folder" -label "LORSM Items Folder"] + content::folder::register_content_type -folder_id $folder_id -content_type "ims_item_object" \ + -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" + + # Create the root folder to store the LO's Resources + set folder_id [content::folder::new -name "LORSM Resources Folder" -label "LORSM Resources Folder"] + content::folder::register_content_type -folder_id $folder_id -content_type "ims_resource_object" \ + -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" + + # Calling apm callback proc for notifications + lors_central::apm_callback::package_install +} Index: openacs-4/packages/lors-central/tcl/lors-central-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/tcl/lors-central-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/tcl/lors-central-procs.tcl 17 May 2005 16:21:18 -0000 1.1 @@ -0,0 +1,874 @@ +ad_library { + + Tcl API for lors-central store and manipulation + + @author Miguel Marin (miguelmarin@viaro.net) + @author Viaro Networks www.viaro.net +} + +namespace eval lors_central {} + + +ad_proc -private lors_central::get_ims_item_id_or_res_id { + {-ims_item_id ""} + {-res_id "" } +} { + Returns ims_item_id if you provide res_id, or returns res_id if you provide ims_item_id + You must provide either res_id or ims_item_id +} { + if { ![empty_string_p $ims_item_id] } { + return [db_string get_res_id { }] + } else { + return [db_string get_ims_item_id { }] + } +} + +ad_proc -private lors_central::is_swa { +} { + Check if the user (default to logged in user) has site_wide_admin privileges +} { + if { ![acs_user::site_wide_admin_p] } { + ad_returnredirect "not-allowed" + ad_script_abort + } +} + +ad_proc -private lors_central::set_sort_order { + {-sort_order ""} + -ims_item_id:required +} { + Updates the ims_cp_items sort_order field with @sort_order@, if not present then + takes the sort_order assigned to one ims_cp_item to this ims_cp_item + -sort_order The sort_order number to put to the ims_cp_item field + -ims_item_id The ims_item_id +} { + if { [empty_string_p $sort_order] } { + set sort_order [db_string get_sort_order { }] + } + db_dml set_sort_order { } +} + + +ad_proc -private lors_central::change_one_lo_version { + -ver_num:required + -man_id:required + -community_id:required + -ims_item_id:required +} { + Changes one LO version (ver_num) to display on one dotlrn class (community_id) for one course (man_id) +} { + set item_id [lors_central::get_item_id -revision_id $ims_item_id] + if { ![string equal $ver_num 0] } { + set new_ims_item_id [lors_central::get_rev_id_from_version_num -ver_num $ver_num -item_id $item_id] + db_dml update_item_map { + update ims_cp_items_map + set ims_item_id = :new_ims_item_id, hide_p = 'f' + where man_id = :man_id and community_id = :community_id + and ims_item_id in ( select revision_id from cr_revisions where item_id = :item_id ) + } + } else { + db_dml hide_learning_object { + update ims_cp_items_map + set hide_p = 't' + where man_id = :man_id and community_id = :community_id + and ims_item_id = :ims_item_id + } + } +} + +ad_proc -private lors_central::folder_id_from_man_parent { + -parent_id:required + -man_id:required +} { + Returns the folder_id of the folder with man_id = @man_id@ and parent_id = @parent_id@ +} { + set folder_name [lors_central::get_course_name -man_id $man_id] + return [db_string get_folder_id { } -default ""] +} + + +ad_proc -private lors_central::get_root_folder_id { } { + Returns the folder_id of the folder with the name "LORS Root Folder" +} { + return [db_string get_folder_id_from_name { } ] +} + + +ad_proc -private lors_central::get_root_resources_folder_id { } { + Returns the folder_id of the folder with the name "LORS Resources Folder" +} { + return [db_string get_folder_id_from_name { } ] +} + +ad_proc -private lors_central::get_root_manifest_folder_id { } { + Returns the folder_id of the folder with the name "LORS Manifest Folder" +} { + return [db_string get_folder_id_from_name { } ] +} + + +ad_proc -private lors_central::get_root_items_folder_id { } { + Returns the folder_id of the folder with the name "LORS Items Folder" +} { + return [db_string get_folder_id_from_name { } ] +} + + +ad_proc -private lors_central::get_folder_name { + -folder_id:required +} { + Returns the folder name with folder_id = @folder_id@ +} { + return [db_string get_folder_name_from_id { } ] +} + + +ad_proc -private lors_central::get_parent_id { + -item_id:required +} { + Returns the parent_id id of @item_id@ +} { + return [db_string get_parent_id { } ] +} + + +ad_proc -private lors_central::get_item_title { + -item_id:required +} { + Returns the item title of @item_id@ +} { + return [db_string get_title { } ] +} + + +ad_proc -private lors_central::get_revision_count { + {-item_id "" } + {-revision_id "" } +} { + Returns the revision count of @item_id@, you must suplly either item_id or revision_id +} { + if { [empty_string_p $item_id] } { + if { [empty_string_p $revision_id] } { + ad_return_complaint 1 "You must supply either item_id or revision_id" + ad_script_abort + } else { + set item_id [lors_central::get_item_id -revision_id $revision_id] + } + } + return [db_string get_count { } ] +} + + +ad_proc -private lors_central::check_item_name { + -parent_id:required + -name:required +} { + Returns a new name for @name@ and @parent_id@ if necessary +} { + set item_name [db_string check_name { } -default ""] + if { ![empty_string_p $item_name] } { + set count [db_string count_items { } -default 0] + set name "(${count})$name" + } + return $name +} + +ad_proc -private lors_central::get_item_res_id { + -ims_item_id:required +} { + returns the resource id associtaed with this item +} { + return [db_string get_res_id {} -default ""] +} +ad_proc -private lors_central::get_content_revision_id { + -ims_item_id:required +} { + Returns the revision_id that holds the content of one ims_item_id +} { + # Get the resource id + set res_id [lors_central::get_item_res_id -ims_item_id $ims_item_id] + set href [lors_central::get_res_href -res_id $res_id] + # Get the file_id + return [db_string get_file_id { } -default 0] +} + +ad_proc -private lors_central::get_item_url { + -ims_item_id:required + -man_id:required +} { + Returns the URL associated to one ims_item_id and man_id +} { + # We get the folder of one course where the files are stored + set root_folder [lors_central::get_root_folder_id] + set name [lors_central::get_course_name -man_id $man_id] + set folder [db_string get_folder { }] + + # We get the resource href to get the subfolder inside folder + set href [lors_central::get_href -ims_item_id $ims_item_id] + set path_list [split $href "/"] + set char [string range $href 0 0] + if { [string equal $char "/"] } { + set subfolder_name [lindex $path_list 1] + set url_name [lindex $path_list 2] + } else { + set subfolder_name [lindex $path_list 0] + set url_name [lindex $path_list 1] + } + + set sub_folder_id [db_string get_subfolder_id { } -default ""] + if { ![empty_string_p $sub_folder_id] } { + # The subfolder is in this course get the file + set file_id [db_string get_file_id { }] + } else { + # The url is on another folder of another course so we will get it using the + # res_id associated to this ims_item_id and repeating the above process + set man_id [db_string get_other_man_id { }] + set name [lors_central::get_course_name -man_id $man_id] + set folder [db_string get_folder { }] + set sub_folder_id [db_string get_subfolder_id { } -default ""] + set file_id [db_string get_file_id { }] + } + return $file_id +} + + +ad_proc -private lors_central::get_href { + -ims_item_id:required +} { + Returns the href of the res_id associated to ims_item_id +} { + # Get the resource id + set res_id [lors_central::get_item_res_id -ims_item_id $ims_item_id] + return [lors_central::get_res_href -res_id $res_id] +} + +ad_proc -private lors_central::get_res_href { + -res_id:required +} { + Returns the href of the resource +} { + return [db_string get_res_href {} -default ""] +} +ad_proc -private lors_central::get_res_file_id { + -res_id:required +} { + Get file_id that is associated to this resource with the same href +} { + return [db_string get_file_id {} -default ""] +} + +ad_proc -private lors_central::get_item_name { + -ims_item_id:required +} { + Returns the item_name of the ims_item_id +} { + return [db_string get_name { }] +} + + +ad_proc -private lors_central::relation_between { + -item_id:required + -community_id:required +} { + Returns the 1 if there is an association between a dotlrn class or community + and the item_id, 0 otherwise. + @man_id@ The manifest id of the course + @community_id@ The class_id or community_id of dotlrn +} { + return [db_string get_relation { } -default 0] +} + + +ad_proc -private lors_central::add_relation { + -item_id:required + -community_id:required + -class_key:required +} { + Add a new row to the ims_cp_manifest_class to associate one community_id (class or community) + with a man_id + @item_id@ Item id that has man_id as revisions + @community_id@ The community_id of the dotlrn class or community + @class_key@ The name of the dotlrn class or community +} { + set lorsm_instance_id [lors_central::get_package_instance_id -community_id $community_id] + set man_id [content::item::get_live_revision -item_id $item_id] + set exist_association [db_string exist_assoc { } -default "0" ] + if { [string equal $exist_association "0"] } { + set exist_man_id [db_string exist_man_id { } -default "0"] + if { [string equal $exist_man_id "0"] } { + # Insert in the ims_cp_manifest_class + db_dml insert_info { } + } else { + # Update the ims_cp_manifest_class + db_dml update_info { } + } + } else { + # Insert in the ims_cp_manifest_class + if { ![db_string get_rel { } -default 0] } { + db_dml insert_info { } + } + } +} + + +ad_proc -private lors_central::drop_relation { + -item_id:required + -community_id:required +} { + Delete a row from the ims_cp_manifest_classes to drop one association of one community_id (class or community) + with a man_id + @item_id@ Item id + @community_id@ The community_id of the dotlrn class or community +} { + db_dml delete_relation { } +} + + +ad_proc -private lors_central::get_item_id { + -revision_id:required +} { + Returns the item_id of one @revision_id@ + @revision_id@ Revision ID +} { + return [db_string get_item_id { } -default 0] +} + + +ad_proc -private lors_central::count_versions { + {-man_id ""} + {-item_id ""} +} { + Returns the number of versions that @man_id@ has, You must supply either a man_id or an item_id + @man_id@ Manifest ID +} { + if { [empty_string_p $item_id]} { + set item_id [lors_central::get_item_id -revision_id $man_id] + } + return [db_string count_versions { } -default 0] +} + + +ad_proc -private lors_central::get_version_num { + -revision_id:required +} { + Get a list of all revisions associated to one @revision_id@ in asc order, and returns the position of the @revision_id@ + in that list plus 1 + + @revision_id@ Revision ID + returns position in list + 1 +} { + set item_id [lors_central::get_item_id -revision_id $revision_id] + set versions [list] + set versions [db_list_of_lists get_all_versions { }] + return [expr [lsearch -exact $versions $revision_id] + 1] +} + + +ad_proc -private lors_central::get_rev_id_from_version_num { + -ver_num:required + -item_id:required +} { + Returns revision_id for given version number @ver_num@ + + @ver_nun@ Version Number + returns revision_id +} { + set versions [list] + set versions [db_list_of_lists get_all_versions { }] + return [lindex $versions [expr $ver_num - 1]] +} + + +ad_proc -private lors_central::change_version { + -item_id:required + -ver_num:required + -community_id:required +} { + +} { + set man_id [lors_central::get_rev_id_from_version_num -ver_num $ver_num -item_id $item_id] + db_dml delete_items_map { + delete from ims_cp_items_map + where man_id = :man_id + } + db_dml update_version { } + set org_list [db_list_of_lists get_organizations { }] + foreach org_id $org_list { + set items_list [db_list_of_lists get_ims_items { }] + foreach ims_item_id $items_list { + db_dml insert_items { } + } + } +} + + +ad_proc -private lors_central::get_man_id { + -community_id:required + -item_id:required +} { + Returns the manifest id for one community_id and one item_id +} { + return [db_string get_man_id { }] +} + + +ad_proc -private lors_central::get_package_instance_id { + -community_id:required +} { + Gets the package_id of the lorsm instance related to the evaluation portlet for this community +} { + set pkg_id [db_string get_package_id { } -default 0] + if { [string equal $pkg_id "0"] } { + ad_return_complaint 1 "You need to have lorsm-portlet in your class before associate this course" + ad_script_abort + } else { + return $pkg_id + } +} + + +ad_proc -private lors_central::get_course_name { + -man_id:required +} { + Gets the Course Name of man_id +} { + return [db_string get_course_name { } -default ""] +} + + +ad_proc -private lors_central::get_username { + -user_id:required +} { + Return the User Name of @user_id@ +} { + return [db_string get_user_name_from_id {} -default ""] +} + + +ad_proc -private lors_central::get_class_name { + -community_id:required +} { + Return the dotLRN class name of @community_id@ +} { + return [db_string get_name { }] +} + + +ad_proc -private lors_central::get_live_classes { + -man_id:required +} { + Return the Number of classes that are using this man_id +} { + return [db_string get_num_classes { } -default 0] +} + + +ad_proc -private lors_central::check_privilege { + -item_id:required + -user_id:required +} { + Return 1 if the user_id has admin privilege over item_id, 0 otherwise + @item_id@ The item_id to check admin privilege + @user_id@ The user_id that holds the admin privilege +} { + if { ![acs_user::site_wide_admin_p -user_id $user_id ]} { + set permission_p [db_string check_permission { } -default 0] + } else { + set permission_p 1 + } + return $permission_p +} + + +ad_proc -private lors_central::change_version_all_courses { + -man_id:required + -item_id:required +} { + Update the ims_cp_manifest_class so all classes associated to this man_id use the same course + @man_id@ The manifest id to associate to all classes + @item_id@ The item_id of the man_id + +} { + db_foreach get_all_communities { + select + icmc.community_id as com_id, + icmc.lorsm_instance_id as lors_ins_id, + icmc.class_key as cl_key, + icmc.isenabled as ie, + icmc.istrackable as it + from + ims_cp_manifest_class icmc + where + icmc.man_id in ( select revision_id + from cr_revisions + where item_id = :item_id ) + } { + # We update the rows with the new revision_id ( man_id ) so every class that use this course + # will have the same course version. + db_dml update_course { + update ims_cp_manifest_class + set + man_id = :man_id, + lorsm_instance_id = :lors_ins_id, + class_key = :cl_key, + isenabled = :ie, + istrackable = :it + where + community_id = :com_id and + man_id in ( select revision_id + from cr_revisions + where item_id = :item_id + ) + } + } +} + + +ad_proc -public lors_central::get_object_info { + -file_id:required + -revision_id +} { + returns an array containing the object info +} { + + set user_id [ad_conn user_id] + set root_folder_id [lors_central::get_root_folder_id] + if {![exists_and_not_null revision_id]} { + set revision_id $file_id + } + + set file_item_id [lors_central::get_item_id -revision_id $file_id] + db_1row file_info {} -column_array file_object_info + + set content [db_exec_plsql get_content {}] + + if {[string equal $file_object_info(storage_type) file]} { + set filename [cr_fs_path $file_object_info(storage_area_key)] + append filename $content + set fd [open $filename] + set content [read $fd] + close $fd + } + + set file_object_info(content) $content + return [array get file_object_info] +} + +ad_proc -public lors_central::item_editable_info { + -item_id:required +} { + Returns an array containing elements editable_p, mime_type, file_extension + if an item is editable through the browser, editable_p is set to 1 + @error +} { + # ideally, this would get values from parameters + # hardcoding it for now + set editable_mime_types [list "text/html" "text/plain"] + + # this should work even if no revision is live + # changing to use _best_ revision + item::get_mime_info [item::get_best_revision $item_id] + + if {[lsearch -exact $editable_mime_types [string tolower $mime_info(mime_type)]] != -1} { + set mime_info(editable_p) 1 + } else { + set mime_info(editable_p) 0 + } + return [array get mime_info] +} + + +ad_proc -public lors_central::item_editable_p { + -item_id:required +} { + returns 1 if item is editable via browser + +} { + array set item_editable_info [lors_central::item_editable_info -item_id $item_id] + + return $item_editable_info(editable_p) +} + +ad_proc -public lors_central::add_file { + -res_id + {-file_content ""} + -mime_type + {-tmp_filename ""} + -filename + -title + -man_id + {-user_id ""} +} { + @param file_content + @param tmp_filename +} { + if {![exists_and_not_null user_id] && [ad_conn -connected_p] } { + set user_id [ad_conn user_id] + } + db_transaction { + # We get the resource_id to get the href of the item that is the default + # since this is the default file the ims_item has + + set res_href [lors_central::get_res_href -res_id $res_id] + + # We are going to create a new cr_revision (file) for the new file + # We get the revision_id that holds the content on the CR, this is the + # live_revision of one file_id + + set res_root_folder_id [lors_central::get_root_resources_folder_id] + set res_folder_id [lors_central::folder_id_from_man_parent -man_id $man_id -parent_id $res_root_folder_id] + + set file_upload [lors_central::check_item_name -parent_id $res_folder_id -name $filename] + set title [lors_central::check_item_name -parent_id $res_folder_id -name $title] + + # add a new resource revision + + set new_res_id [lors_central::add_resource_revision \ + -res_id $res_id \ + -name $title \ + -user_id $user_id \ + -man_id $man_id] + + set new_file_item_id [content::item::new -name $title -creation_user $user_id -parent_id $res_folder_id] + + + # FIXME allow lors admins to set live immediatly + set new_file_revision_id [ lors_central::add_file_revision \ + -res_id $new_res_id \ + -name $file_upload \ + -file_content $file_content \ + -tmp_filename $tmp_filename \ + -title $title \ + -mime_type $mime_type \ + -item_id $new_file_item_id \ + -user_id $user_id] + + lors_central::resource_carry_forward_files -old_res_id $res_id -new_res_id $new_res_id + lors_central::res_update_items \ + -old_res_id $res_id \ + -new_res_id $new_res_id \ + -user_id [ad_conn user_id] + + } + return $new_res_id +} + +ad_proc -public lors_central::add_resource_revision { + -res_id + -name + -user_id + -man_id +} { + add a revision to an ims_cp_resource +} { + set new_res_item_id [lors_central::get_item_id -revision_id $res_id] + + set new_res_rev_id [content::revision::new -item_id $new_res_item_id -title $name \ + -creation_user $user_id -is_live "t"] + + # Now we have to update the new row in the ims_cp_resources using this new resource (new_res_id) + # we need a new href + + set href [lors_central::get_res_href -res_id $res_id] + set split_href [split $href "/"] + # We remove the last part + set split_href [lrange $split_href 0 [expr [llength $split_href] - 2 ]] + set new_href "" + foreach element $split_href { + append new_href "$element/" + } + append new_href "$name" + + db_dml update_new_res { + update + ims_cp_resources + set + man_id = :man_id, + identifier = :name, + type = 'webcontent', + href = :href, + hasmetadata = 'f' + where + res_id = :new_res_rev_id + } + return $new_res_rev_id +} + +ad_proc -public lors_central::resource_carry_forward_files { + -old_res_id + -new_res_id + -exclude +} { + carry forward file mapping from old res to new resource +} { + set exclude_clause "" + if {[exists_and_not_null exclude]} { + set exclude_clause " and file_id not in ([template::util::tcl_to_sql_list $exclude]) " + } + db_dml carry_forward_files " + insert into ims_cp_files ( + select + file_id, + :new_res_id, + pathtofile, + filename, + hasmetadata + from + ims_cp_files + where + res_id = :old_res_id $exclude_clause) + " +} + +ad_proc -public lors_central::add_file_revision { + -res_id + -name + -file_content + -tmp_filename + -title + -mime_type + -item_id + -man_id + {-user_id ""} +} { + +} { + + set new_file_id [content::revision::new -item_id $item_id -title $title -creation_user $user_id \ + -mime_type $mime_type -is_live "f"] + + # Now we store the content in the CR + if {[exists_and_not_null tmp_filename]} { + set cr_file [cr_create_content_file $item_id $new_file_id $tmp_filename] + } else { + set cr_file [cr_create_content_file_from_string $item_id $new_file_id $file_content] + } + # 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_revision { + update + cr_revisions + set + content = :cr_file, + content_length = :file_size + where + revision_id = :new_file_id + } + set new_href [file join [file dirname [lors_central::get_res_href -res_id $res_id]] $title] + # Now that we have the new item store in the CR, we have to make + # some insert in some tables to adjust to the new cr_item. + # First we have to reflect the new file in the resources table, so we have to make + # a new XXXXcr_item andXXXX revision for the resource and insert it on the ims_cp_resources table + # We need to create a new row in the ims_cp_files to associate the new resource to the new file + db_dml insert_new_file { + insert into ims_cp_files (file_id, res_id, pathtofile, filename, hasmetadata) + values (:new_file_id, :res_id, :new_href, :title, 'f') + } + return $new_file_id +} + + +ad_proc -public lors_central::res_update_items { + -old_res_id + -new_res_id + {-user_id ""} +} { + When a resource gets a new revision update associated items +} { + db_transaction { + # we need to create new versions of each ims_cp_item that is mapped to this resource + foreach ims_item_id [db_list get_ims_items "select ims_item_id from ims_cp_items_to_resources where res_id=:old_res_id"] { + # Now are going to create a new version of the item (ims_cp_item) + set item_id [lors_central::get_item_id -revision_id $ims_item_id] + set item_title [lors_central::get_item_title -item_id $item_id] + set item_count [expr [lors_central::get_revision_count -item_id $item_id] + 1 ] + append item_title "_$item_count" + set new_ims_rev_id [content::revision::new -item_id $item_id -title $item_title -creation_user $user_id \ + -is_live "t"] + # We need to fill the extra information + set item_name [lors_central::get_item_name -ims_item_id $ims_item_id] + set org_id [db_string get_org_id "select org_id from ims_cp_items where ims_item_id = :ims_item_id"] + set item_title [db_string get_item_title_id "select item_title from ims_cp_items where ims_item_id = :ims_item_id"] + set parent_item [db_string get_parent_item { }] + db_dml update_ims_cp_items { + update ims_cp_items + set + org_id = :org_id, + identifier = :item_name, + identifierref = :item_title, + item_title = :item_title, + parent_item = :parent_item + where ims_item_id = :new_ims_rev_id + + } + # Now this new revision_id is the one that holds the content of the new resource + # We have to make a row in ims_cp_items_to_resources table + db_dml insert_new_item_to_res { + insert into ims_cp_items_to_resources (ims_item_id, res_id ) + values (:new_ims_rev_id, :new_res_id) + } + # We are going to set the sort_order field + lors_central::set_sort_order -ims_item_id $new_ims_rev_id + } + } + +} + +ad_proc -private lors_central::do_notification { + -object_id:required +} { + Send a notification to all users subscribed to @object_id@ + @object_id@ The object_id that holds the notification +} { + notification::new \ + -type_id [notification::type::get_type_id -short_name "one_lo_notif" ] \ + -object_id $object_id \ + -notif_subject "Changes made to this resource" \ + -notif_text "Some changes have been made to one resource" \ +} + +ad_proc -public lors_central::get_folder_id { + -name:required +} { + return [db_string get_root_folder { }] +} + +ad_proc -public lors_central::get_items_indent { + -org_id:required +} { + Returns a list of the form \{ims_item_id indent\} from one org_id +} { + + # We need all the count of all items (just live revisions) + set items_count [db_string get_items_count { }] + + # Get the root items + set count 0 + db_foreach get_root_items { } { + lappend items_list [list $ims_item_id 1] + set items_array($ims_item_id) 1 + 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 { } { + 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 + } + } + } + } + return $items_list +} + +ad_proc -public lors_central::get_root_folder_id { } { } { + return [db_string get_root_folder { }] +} Index: openacs-4/packages/lors-central/tcl/lors-central-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/tcl/lors-central-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/tcl/lors-central-procs.xql 17 May 2005 16:21:18 -0000 1.1 @@ -0,0 +1,820 @@ + + + + + + + select + res_id + from + ims_cp_items_to_resources + where + ims_item_id = :ims_item_id + + + + + + select + ims_item_id + from + ims_cp_items_to_resources + where + res_id = :res_id + + + + + + + select + item_id + from + cr_items + where + name = :name and + parent_id = :root_folder + + + + + + select + item_id + from + cr_items + where + parent_id = :folder and + name = :subfolder_name + + + + + + select + item_id + from + cr_items + where + name = :url_name and + parent_id = :sub_folder_id + + + + + + select + r.man_id + from + ims_cp_resources r, ims_cp_items_to_resources ir + where + ir.res_id = r.res_id and + ir.ims_item_id = :ims_item_id + + + + + + + + + + + + + + + + + + + + + update + ims_cp_items + set + sort_order = :sort_order + where + ims_item_id = :ims_item_id + + + + + + select + distinct sort_order + from + ims_cp_items + where + ims_item_id in ( + select revision_id + from cr_revisions + where item_id = ( + select item_id + from cr_revisions + where revision_id = :ims_item_id + ) + ) + and sort_order is not null + + + + + + select + org_id + from + ims_cp_organizations + where + man_id = :man_id + + + + + + select + ims_item_id + from + ims_cp_items + where + org_id = :org_id + and ims_item_id in ( select live_revision + from cr_items + ) + + + + + + insert into ims_cp_items_map + (man_id,org_id,community_id,ims_item_id) + values + (:man_id,:org_id,:community_id,:ims_item_id) + + + + + + update + ims_cp_items_map + set + ims_item_id = :new_ims_item_id + where + man_id = :man_id and + community_id = :community_id and + ims_item_id in ( + select revision_id + from cr_revisions + where item_id = :item_id ) + + + + + + + select + item_id + from + cr_items + where + parent_id = :parent_id and + name = :folder_name + + + + + + select + name + from + cr_items + where + item_id = :item_id + + + + + + select + name + from + cr_items + where + parent_id = :parent_id and + name = :name + + + + + + select + count(item_id) + from + cr_items + where + parent_id = :parent_id + + + + + + + select count(revision_id) + from + cr_revisions + where + item_id = :item_id + + + + + + select + folder_id + from + cr_folders + where + label = 'LORSM Root Folder' + + + + + + select + folder_id + from + cr_folders + where + label = 'LORSM Resources Folder' + + + + + + select + folder_id + from + cr_folders + where + label = 'LORSM Manifest Folder' + + + + + + select + folder_id + from + cr_folders + where + label = 'LORSM Items Folder' + + + + + + select + parent_id + from + cr_items + where + item_id = :item_id + + + + + + select + pretty_name + from + dotlrn_class_instances_full + where + community_id = :community_id + + + + + + select + res_id + from + ims_cp_items_to_resources + where + ims_item_id = :ims_item_id + + + + + + select + res_id + from + ims_cp_items_to_resources + where + ims_item_id = :ims_item_id + + + + + + select + href + from + ims_cp_resources + where + res_id = :res_id + + + + + + select + file_id + from + ims_cp_files f, + ims_cp_resources r + where + r.res_id=:res_id + and + f.res_id=r.res_id + and + f.pathtofile=r.href + + + + + + select + name + from + cr_items + where + item_id = ( + select item_id + from cr_revisions + where revision_id = :ims_item_id + ) + + + + + + select + file_id + from + ims_cp_files + where + res_id = :res_id and + pathtofile = :href + + + + + + select + item_id + from + cr_items + where + name = :name and + parent_id = :root_folder + + + + + + + select + course_name + from + ims_cp_manifests + where + man_id =:man_id + + + + + + + select + label + from + cr_folders + where + folder_id = :folder_id + + + + + + select + 1 + from + ims_cp_manifest_class + where + community_id = :community_id + and + man_id in ( select revision_id from cr_revisions where item_id = :item_id ) + + + + + + select + count(community_id) + from + ims_cp_manifest_class + where + man_id = :man_id + + + + + + select + 1 + from + ims_cp_manifest_class + where + man_id = :man_id + + + + + + delete from + ims_cp_manifest_class + where + community_id = :community_id and + man_id in + ( + select revision_id + from cr_revisions + where item_id = :item_id + ) + + + + + + select + 1 + from + ims_cp_manifest_class + where + community_id = :community_id and + man_id =:man_id + + + + + + update + ims_cp_manifest_class + set + lorsm_instance_id = :lorsm_instance_id, + community_id = :community_id, + class_key = :class_key + where + man_id = :man_id + + + + + + insert into ims_cp_manifest_class + (man_id, lorsm_instance_id, community_id, class_key, isenabled, istrackable) + values + (:man_id, :lorsm_instance_id, :community_id, :class_key, 't', 'f') + + + + + + select + item_id + from + cr_revisions + where + revision_id = :revision_id + + + + + + select + count(revision_id) + from + cr_revisions + where + item_id = :item_id + + + + + + select + revision_id + from + cr_revisions + where + item_id = :item_id + order by revision_id asc + + + + + + select + distinct man_id + from + ims_cp_manifest_class + where + community_id = :community_id and + man_id in + ( + select revision_id + from cr_revisions + where item_id = :item_id + ) + + + + + + select + revision_id + from + cr_revisions + where + item_id = :item_id + order by revision_id asc + + + + + + + update + ims_cp_manifest_class + set + man_id = :man_id + where + community_id = :community_id and + man_id in ( select revision_id + from cr_revisions + where item_id = :item_id + ) + + + + + + select + dca.package_id + from + dotlrn_community_applets dca,apm_packages ap + where + community_id=:community_id and + ap.package_id=dca.package_id and + ap.package_key='lorsm' + + + + + + select + first_names || ' ' || last_name + from + cc_users + where + user_id = :user_id + + + + + + + select + count(man_id) + from + ims_cp_manifest_class + where + man_id = :man_id + and + community_id is not null + + + + + + select + 1 + from + acs_permissions + where + object_id = :item_id and + grantee_id = :user_id and + privilege = 'admin' + + + + + + select + icmc.community_id as com_id, + icmc.lorsm_instance_id as lors_ins_id, + icmc.class_key as cl_key, + icmc.isenabled as ie, + icmc.istrackable as it + from + ims_cp_manifest_class icmc + where + icmc.man_id in ( select revision_id + from cr_revisions + where item_id = :item_id ) + + + + + + update ims_cp_manifest_class + set + man_id = :man_id, + lorsm_instance_id = :lors_ins_id, + class_key = :cl_key, + isenabled = :ie, + istrackable = :it + where + community_id = :com_id and + man_id in + ( + select revision_id + from cr_revisions + where item_id = :item_id + ) + + + + + + + select person__name(o.creation_user) as owner, + i.name as title, + r.title as name, + r.description as version_notes, + acs_permission__permission_p(:file_id,:user_id,'write') as write_p, + acs_permission__permission_p(:file_id,:user_id,'delete') as delete_p, + acs_permission__permission_p(:file_id,:user_id,'admin') as admin_p, + content_item__get_path(o.object_id, :root_folder_id) as file_url, + i.live_revision, + i.storage_type, + i.storage_area_key, + r.mime_type + from acs_objects o, cr_revisions r, cr_items i + where o.object_id = :file_item_id + and i.item_id = o.object_id + and r.revision_id = :revision_id + + + + + + select content_revision__get_content(:revision_id) + + + + + + select + res_id + from + ims_cp_items_to_resources + where + ims_item_id = :ims_item_id + + + + + + select + 1 + from + ims_cp_files + where + file_id = :clipboard_object_id + and res_id = :ims_res_id + + + + + + select + distinct filename + from + ims_cp_files + where + file_id = :new_file_id + + + + + + select + distinct pathtofile + from + ims_cp_files + where + file_id = :new_file_id + + + + + + + select + res_id + from + ims_cp_items_to_resources + where + ims_item_id = :ims_item_id + + + + + + select + parent_item + from + ims_cp_items + where + ims_item_id = :ims_item_id + + + + + + select + folder_id + from + cr_folders + where + label = 'LORSM Root Folder' + + + + + + select + ims_item_id + from + ims_cp_items + where + parent_item = :item_id and + org_id = :org_id + + + + + + select + ims_item_id + from + ims_cp_items + where + parent_item = :org_id and + org_id = :org_id + + + + + + select + count(ims_item_id) + from + ims_cp_items + where + ims_item_id in ( + select + live_revision + from + cr_items + where + content_type = 'ims_item_object' + ) and + org_id = :org_id + + + + + + select + folder_id + from + cr_folders + where + label = :name + + + + \ No newline at end of file Index: openacs-4/packages/lors-central/tcl/test/lors-central-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/tcl/test/lors-central-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/tcl/test/lors-central-procs.tcl 17 May 2005 16:21:18 -0000 1.1 @@ -0,0 +1,744 @@ +ad_library { + Tcl API for lors-central testing +} + +aa_register_case null_parent_items_reference { + Checks if null parent_item exist in ims_cp_items table, since all ims_item_id must have one + parent_item. +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + set null_parent_items [db_string get_null_parents { + select + count(ims_item_id) + from + ims_cp_items + where + parent_item is null + } -default 0] + if { $null_parent_items > 0 } { + set success_p 0 + } else { + set success_p 1 + } + aa_equals "There are not null parent_items" $success_p 1 + } +} + +aa_register_case lors_central_add_relation_check { + Check if adds a new row (only one) to the ims_cp_manifest_class associating man_id and community_id + ** Requirements: + 1. Two dotlrn classes + 2. One lors course +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + set test_com_id [db_string get_community { + select max(community_id) + from dotlrn_communities_all + }] + set test_com_id_2 [db_string get_community { + select min(community_id) + from dotlrn_communities_all + }] + set test_man_id [db_string get_man_id { + select max(man_id) + from ims_cp_manifests + }] + set test_item_id [db_string get_item_id { + select item_id + from cr_revisions + where revision_id = :test_man_id + }] + + set test_class_key [db_string get_class_key { + select community_type + from dotlrn_communities_all + where community_id = :test_com_id + }] + # Testing where there is no association + lors_central::add_relation -item_id $test_item_id -community_id $test_com_id -class_key $test_class_key + set row_count [db_string get_row_count { + select count(man_id) + from ims_cp_manifest_class + where community_id = :test_com_id and man_id = :test_man_id + }] + if { [string equal $row_count "1"] } { + set success_p 1 + } else { + set success_p 0 + } + aa_true "Creates only one row" [string equal "1" "$success_p"] + + # Testing where there is already one association + lors_central::add_relation -item_id $test_item_id -community_id $test_com_id_2 -class_key $test_class_key + set row_count [db_string get_row_count { + select count(man_id) + from ims_cp_manifest_class + where man_id = :test_man_id + }] + if { [string equal $row_count "2"] } { + set success_p 1 + } else { + set success_p 0 + } + aa_equals "Associate more than one communities to the same man_id" $success_p 1 + } +} + + +aa_register_case lors_central_get_version_num { + Check if giving one number for one item_id returns a revision_id with the same item_id + ** Requirements: + 1. One LO with two or more versions +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + set test_revision_id [db_string get_revision_id { + select min(ims_item_id),org_id from ims_cp_items group by sort_order,org_id having count(ims_item_id) > 1; + }] + set test_item_id [db_string get_item_id { + select item_id from cr_revisions where revision_id = :test_revision_id + }] + set test_count [db_string get_count { + select count(revision_id) from cr_revisions where item_id = :test_item_id + }] + set test_revision_id_2 [db_string get_revision_id_2 { + select max(revision_id) from cr_revisions where item_id = :test_item_id + }] + set version_number_1 [lors_central::get_version_num -revision_id $test_revision_id] + aa_equals "Min revision_id return version number equal to 1" $version_number_1 "1" + + set version_number_2 [lors_central::get_version_num -revision_id $test_revision_id_2] + aa_equals "Max revision_id return version number equal to revisions count" $version_number_2 $test_count + } +} + + +aa_register_case lors_central_change_one_lo_version_check { + Check if changes one LO version (ver_num) on ims_cp_items_map for one community_id and one man_id + ** Requirements: + 1. One dotlrn class + 2. One lors course associated to the class + 3. One LO with two versions inside the course associated to the class + +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + set test_item_id [db_string get_item_id { + select min(ims_item_id), org_id from ims_cp_items group by sort_order, org_id having count(ims_item_id) > 1; + }] + set test_item_id_2 [db_string get_item_id { + select max(ims_item_id), org_id from ims_cp_items group by sort_order, org_id having count(ims_item_id) > 1; + }] + set test_org_id [db_string get_org_id { + select org_id + from ims_cp_items + where ims_item_id = :test_item_id + }] + set test_man_id [db_string get_man_id { + select man_id + from ims_cp_organizations + where org_id = :test_org_id + }] + set test_com_id [db_string get_com_id { + select min(community_id) + from ims_cp_items_map + where org_id = :test_org_id and + man_id = :test_man_id + }] + + set test_com_id_2 [db_string get_com_id { + select max(community_id) + from ims_cp_items_map + where org_id = :test_org_id and + man_id = :test_man_id + }] + + set ver_num_1 [lors_central::get_version_num -revision_id $test_item_id] + set ver_num_2 [lors_central::get_version_num -revision_id $test_item_id_2] + lors_central::change_one_lo_version -ver_num $ver_num_1 -man_id $test_man_id \ + -community_id $test_com_id -ims_item_id $test_item_id + + set check_item [db_string get_item { + select ims_item_id + from ims_cp_items_map + where community_id = :test_com_id and + org_id = :test_org_id and + man_id = :test_man_id and + ims_item_id in ( select revision_id from cr_revisions where item_id = + ( select item_id from cr_revisions where revision_id = :test_item_id )) + }] + aa_equals "Change to first version_number ($test_item_id)" $check_item $test_item_id + lors_central::change_one_lo_version -ver_num $ver_num_2 -man_id $test_man_id \ + -community_id $test_com_id -ims_item_id $test_item_id + set check_item [db_string get_item { + select ims_item_id + from ims_cp_items_map + where community_id = :test_com_id and + org_id = :test_org_id and + man_id = :test_man_id and + ims_item_id in ( select revision_id from cr_revisions where item_id = + ( select item_id from cr_revisions where revision_id = :test_item_id )) + }] + aa_equals "Change to last version_number ($test_item_id_2)" $check_item $test_item_id_2 + + lors_central::change_one_lo_version -ver_num $ver_num_2 -man_id $test_man_id \ + -community_id $test_com_id_2 -ims_item_id $test_item_id + set check_item [db_string get_item { + select ims_item_id + from ims_cp_items_map + where community_id = :test_com_id_2 and + org_id = :test_org_id and + man_id = :test_man_id and + ims_item_id in ( select revision_id from cr_revisions where item_id = + ( select item_id from cr_revisions where revision_id = :test_item_id )) + }] + aa_equals "Change to last version_number ($test_item_id_2) on different community" $check_item $test_item_id_2 + + lors_central::change_one_lo_version -ver_num "0" -man_id $test_man_id \ + -community_id $test_com_id_2 -ims_item_id $test_item_id_2 + + set check_item [db_string get_hide_p { + select hide_p + from ims_cp_items_map + where community_id = :test_com_id_2 and + ims_item_id = :test_item_id_2 + }] + aa_equals "Hide on one community" $check_item "t" + } +} + +aa_register_case lors_central_change_version_check { + Check if changes one course version (ver_num of man_id) on ims_cp_manifest_class and also maps each item in + ims_cp_items_map to the new version + ** Requirements: + 1. One dotlrn class + 2. One lors course associated to one or more classes with 2 or more versions + +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + set man_id [db_string get_man_id { + select min(man_id) + from ims_cp_manifest_class + }] + set item_id [lors_central::get_item_id -revision_id $man_id] + set man_id1 [db_string get_man_id_2 { + select min(revision_id) + from cr_revisions + where item_id = :item_id + }] + set man_id2 [db_string get_man_id_2 { + select max(revision_id) + from cr_revisions + where item_id = :item_id + }] + set ver_num1 [lors_central::get_version_num -revision_id $man_id1] + set ver_num2 [lors_central::get_version_num -revision_id $man_id2] + set com_id [db_string get_com_id { + select min(community_id) + from ims_cp_manifest_class + where man_id = :man_id + }] + lors_central::change_version -item_id $item_id -ver_num $ver_num1 -community_id $com_id + + set success_p [db_string check_ims_cp_manifest_class { + select count(man_id) + from ims_cp_manifest_class + where man_id = :man_id1 and community_id = :com_id + } -default 0] + aa_equals "Version $ver_num1 associated to community $com_id" $success_p 1 + + lors_central::change_version -item_id $item_id -ver_num $ver_num2 -community_id $com_id + set success_p [db_string check_ims_cp_manifest_class { + select count(man_id) + from ims_cp_manifest_class + where man_id = :man_id2 and community_id = :com_id + } -default 0] + aa_equals "Version $ver_num2 associated to community $com_id" $success_p 1 + + } +} + +aa_register_case lors_central_change_version_all_courses_check { + Checks if all communties associated to any version of one course get the same man_id on ims_cp_manifest_class + ** Requirements: + 1. Two dotlrn classes + 2. One course with two versions associated to the classes + + +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + set man_id "" + db_foreach get_man_ids { + select man_id as test_man_id + from ims_cp_manifest_class + } { + if { [lors_central::get_revision_count -revision_id $test_man_id] > 1 } { + set man_id $test_man_id + } + } + if { [empty_string_p $man_id] } { + ad_return_complaint 1 "There are no course with two versions associated to dotlrn classes to make this test" + ad_script_abort + } + set item_id [lors_central::get_item_id -revision_id $man_id] + set man_id1 [db_string get_man_id { + select min(revision_id) from cr_revisions where item_id = :item_id + }] + set man_id2 [db_string get_man_id2 { + select max(revision_id) from cr_revisions where item_id = :item_id + }] + set classes_count [db_string get_count { + select count(man_id) from ims_cp_manifest_class + where man_id in (select revision_id from cr_revisions where item_id = :item_id) + }] + + lors_central::change_version_all_courses -man_id $man_id1 -item_id $item_id + set classes_count1 [db_string get_count { + select count(man_id) from ims_cp_manifest_class + where man_id in (select revision_id from cr_revisions where item_id = :item_id) + }] + + aa_equals "All classes watching the same versions $man_id1" $classes_count1 $classes_count + + lors_central::change_version_all_courses -man_id $man_id2 -item_id $item_id + set classes_count2 [db_string get_count { + select count(man_id) from ims_cp_manifest_class + where man_id in (select revision_id from cr_revisions where item_id = :item_id) + }] + + aa_equals "All classes watching the same versions $man_id2" $classes_count2 $classes_count + + } +} + + +aa_register_case lors_central_count_versions_check { + Checks if returns the right number of revisions for one revision_id or item_id + ** Requirements: + 1. One or more cr_items (with 1 or more revisions) +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + set rev_list [db_list_of_lists get_revisions { + select min(revision_id) + from cr_revisions group by item_id + having count(revision_id) > 1 }] + set revision_id [lindex $rev_list 0] + set item_id [lors_central::get_item_id -revision_id $revision_id] + set rev_count [db_string get_count { + select count(revision_id) + from cr_revisions + where item_id = :item_id + }] + set proc_count [lors_central::get_revision_count -revision_id $revision_id] + aa_equals "Calling proc with revision_id $rev_count = $proc_count" $rev_count $proc_count + set proc_count [lors_central::get_revision_count -item_id $item_id] + aa_equals "Calling proc with item_id $rev_count = $proc_count" $rev_count $proc_count + } +} + +aa_register_case lors_central_drop_relation_check { + Checks if deletes the ralation between one man_id and one community_id on ims_cp_manifest_class + ** Requirements: + 1. One or more classes associated to one course +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + set com_id [db_string get_com_id { + select min(community_id) + from ims_cp_manifest_class + }] + set man_id [db_string get_man_id { + select min(man_id) + from ims_cp_manifest_class + where community_id = :com_id + }] + set item_id [lors_central::get_item_id -revision_id $man_id] + lors_central::drop_relation -item_id $item_id -community_id $com_id + set test [db_string check_relation { + select count(man_id) + from ims_cp_manifest_class + where community_id = :com_id + and man_id in ( select revision_id from cr_revisions where item_id = :item_id ) + }] + aa_equals "Deleting everything from ims_cp_manifest_class" $test "0" + } +} + +aa_register_case lors_central_get_class_name_check { + Checks if the dotlrn class name is the same + ** Requirements: + 1. One dotlrn class +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + set com_id [db_string get_community { + select min(community_id) + from dotlrn_communities_all + }] + set name [db_string get_name { + select pretty_name + from dotlrn_class_instances_full + where community_id = :com_id + }] + set proc_name [lors_central::get_class_name -community_id $com_id] + aa_equals "Returns the same name $name = $proc_name" $name $proc_name + } +} + +aa_register_case lors_central_get_folder_name_check { + Checks if the folder name is correct + ** Requirements: + 1. One LO course +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + set folder_id [db_string get_folder_id { + select max(folder_id) + from cr_folders + }] + set name [db_string get_name { + select label + from cr_folders + where folder_id = :folder_id + }] + set proc_name [lors_central::get_folder_name -folder_id $folder_id] + aa_equals "Returns the same name $name = $proc_name" $name $proc_name + } +} + + +aa_register_case lors_central_get_item_id_check { + Checks if the item_id is the correct + ** Requirements: + 1. One cr_revision +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + set rev_id [db_string get_rev_id { + select max(revision_id) + from cr_revisions + }] + set item_id [db_string get_name { + select item_id + from cr_revisions + where revision_id = :rev_id + }] + set proc_item_id [lors_central::get_item_id -revision_id $rev_id] + aa_equals "Returns the same item_id $item_id = $proc_item_id" $item_id $proc_item_id + } +} + +aa_register_case lors_central_get_item_id_check { + Checks if the item_id is the correct + ** Requirements: + 1. One cr_revision +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + set rev_id [db_string get_rev_id { + select max(revision_id) + from cr_revisions + }] + set item_id [db_string get_name { + select item_id + from cr_revisions + where revision_id = :rev_id + }] + set proc_item_id [lors_central::get_item_id -revision_id $rev_id] + aa_equals "Returns the same item_id $item_id = $proc_item_id" $item_id $proc_item_id + } +} + + +aa_register_case lors_central_get_parent_id_check { + Checks if the parent_id is the correct + ** Requirements: + 1. One cr_revision +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + set item_id [db_string get_item_id { + select max(item_id) + from cr_items + where parent_id is not null + }] + set parent_id [db_string get_parent_id { + select parent_id + from cr_items + where item_id = :item_id + }] + set proc_parent_id [lors_central::get_parent_id -item_id $item_id] + aa_equals "Returns the same item_id $parent_id = $proc_parent_id" $parent_id $proc_parent_id + } +} + +aa_register_case lors_central_relation_between_check { + Checks if the relation_between proc is correct + ** Requirements: + 1. One cr_revision +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + set man_id [db_string get_man_id { + select max(man_id) + from ims_cp_manifest_class + }] + set com_id [db_string get_com_id { + select min(community_id) + from ims_cp_manifest_class + where man_id = :man_id + }] + set item_id [lors_central::get_item_id -revision_id $man_id] + set rel_p [db_string get_rel { + select 1 from ims_cp_manifest_class + where community_id = :com_id and man_id in + ( select revision_id from cr_revisions where item_id = :item_id ) + }] + set proc_rel_p [lors_central::relation_between -item_id $item_id -community_id $com_id] + aa_equals "Relation between proc" $rel_p $proc_rel_p + } +} + +aa_register_case lors_central_set_sort_order_check { + Checks if the item_id sort_order is the correct + ** Requirements: + 1. One LO +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + set ims_item_id [db_string get_ims_item_id { + select max(ims_item_id) + from ims_cp_items + }] + lors_central::set_sort_order -ims_item_id $ims_item_id -sort_order 2 + set proc_sort [db_string get_sort { + select sort_order + from ims_cp_items + where ims_item_id = :ims_item_id} -default 0] + aa_equals "Sort order proc set the right sort" $proc_sort "2" + + set proc_sort [lors_central::set_sort_order -ims_item_id $ims_item_id] + set sort_p [db_string get_sort { + select 1 + from ims_cp_items + where sort_order is not null + and ims_item_id = :ims_item_id } -default 0] + aa_true "Sort order proc set the right sort (when not sendind the sort_order number)" $sort_p + } +} + +aa_register_case lors_central_check_item_name_check { + Checks if returns a new name for a given item_name + ** Requirements: + 1. One Course +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + set rev_id [db_string get_rev_id { + select max(ims_item_id) + from ims_cp_items + }] + set item_id [lors_central::get_item_id -revision_id $rev_id] + set parent_id [lors_central::get_parent_id -item_id $item_id] + set name [db_string get_nanme { + select name + from cr_items + where item_id = :item_id + }] + set proc_name [lors_central::check_item_name -parent_id $parent_id -name $name] + if { [string equal $name $proc_name] } { + set success_p 0 + } else { + set success_p 1 + } + aa_true "Name exist, gives a new name" $success_p + set name ${name}h + set proc_name [lors_central::check_item_name -parent_id $parent_id -name $name] + if { [string equal $name $proc_name] } { + set success_p 1 + } else { + set success_p 0 + } + aa_true "Name doesn't exist, gives the same name" $success_p + } +} + +aa_register_case lors_central_check_privilege { + Checks lors_central::check_privilige proc + ** Requirements: + 1. One Course +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + set item_id [db_string get_item_id { + select max(object_id) + from acs_permissions + where privilege = 'admin' + }] + set user_id [db_string get_user_id { + select min(grantee_id) + from acs_permissions + where privilege = 'admin' + and object_id = :item_id + }] + set proc_result [lors_central::check_privilege -user_id $user_id -item_id $item_id] + aa_true "Check privilege proc when user has privilege" $proc_result + set proc_result [lors_central::check_privilege -user_id 0 -item_id $item_id] + aa_true "Check privilege proc when user has no privilege" [string equal $proc_result 0] + } +} + +aa_register_case lors_central_item_editable_info { + Check if sending an editable item returns the correct information + ** Requirements: + 1. One editable LO and one that isn't +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + set rev_id [db_string get_item_id { + select max(revision_id) + from cr_revisions + where mime_type = 'text/html' and + revision_id in (select live_revision from cr_items) + }] + set item_id [lors_central::get_item_id -revision_id $rev_id] + set proc_result [lors_central::item_editable_info -item_id $item_id] + aa_true "Sending one editable item" [lindex $proc_result 3] + set rev_id [db_string get_item_id { + select max(revision_id) + from cr_revisions + where mime_type = 'image/gif' and + revision_id in (select live_revision from cr_items) + }] + set item_id [lors_central::get_item_id -revision_id $rev_id] + set proc_result [lors_central::item_editable_info -item_id $item_id] + aa_true "Sending one non editable item" [string equal [lindex $proc_result 3] 0] + } +} + + +aa_register_case lors_central_item_editable_p { + Check if sending an editable item returns the correct information + ** Requirements: + 1. One editable LO and one that isn't +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + set rev_id [db_string get_item_id { + select max(revision_id) + from cr_revisions + where mime_type = 'text/html' and + revision_id in (select live_revision from cr_items) + }] + set item_id [lors_central::get_item_id -revision_id $rev_id] + set proc_result [lors_central::item_editable_p -item_id $item_id] + aa_true "Sending one editable item" $proc_result + set rev_id [db_string get_item_id { + select max(revision_id) + from cr_revisions + where mime_type = 'image/gif' and + revision_id in (select live_revision from cr_items) + }] + set item_id [lors_central::get_item_id -revision_id $rev_id] + set proc_result [lors_central::item_editable_p -item_id $item_id] + aa_true "Sending one non editable item" [string equal $proc_result 0] + } +} + +aa_register_case lors_central_package_install { + Check if the package creates the right folders and types + ** Requires + 1. lors-central package alreay installed +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + set success_p [db_string check_folder { + select 1 + from cr_folders + where label = 'LORSM Root Folder'} -default 0] + aa_true "Folders created" $success_p + set success_p [db_string check_folder { + select 1 + from cr_folders + where label = 'LORSM Manifest Folder'} -default 0] + aa_true "Folders created" $success_p + set success_p [db_string check_folder { + select 1 + from cr_folders + where label = 'LORSM Organizations Folder'} -default 0] + aa_true "Folders created" $success_p + set success_p [db_string check_folder { + select 1 + from cr_folders + where label = 'LORSM Items Folder'} -default 0] + aa_true "Folders created" $success_p + set success_p [db_string check_folder { + select 1 + from cr_folders + where label = 'LORSM Resources Folder'} -default 0] + aa_true "Folders created" $success_p + } +} + +aa_register_case lors_central_imscp_manifest_add { + Checks if a new manifest_id is created + ** Requires + 1. Once course +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + set man_id [db_string get_man_id {select max(man_id) from ims_cp_manifests}] + db_1row get_info { select * from ims_cp_manifests where man_id = :man_id } + set man_folder_id [db_string get_folder_id { + select folder_id + from cr_folders + where label = 'LORSM Manifest Folder'} -default 0] + + + set new_man_id [lors_central::imscp::manifest_add \ + -identifier $identifier\ + -course_name "test_check" \ + -version "" \ + -orgs_default $orgs_default\ + -hasmetadata $hasmetadata\ + -parent_man_id $parent_man_id\ + -isscorm $isscorm\ + -folder_id $folder_id\ + -package_id "" \ + -community_id "" \ + -user_id "" \ + -creation_ip "" \ + -version_id "" \ + -man_folder_id $man_folder_id] + + set success_p [db_string get_check { select 1 from ims_cp_manifests where man_id = :new_man_id } -default 0] + + aa_true "New man_id created" $success_p + } +} Index: openacs-4/packages/lors-central/www/add-exist-item.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/add-exist-item.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/add-exist-item.tcl 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,137 @@ +ad_page_contract { + Add one existent LO to a course + @author Miguel Marin (miguelmarin@viaro.net) + @author Viaro Networks www.viaro.net +} { + org_id:notnull + man_id:notnull + parent_item:notnull + ims_item_id:notnull + {sort_order ""} + item_man_id:notnull +} + +# Checking swa privilege over lors-central +lors_central::is_swa + +set the_ims_item_id $ims_item_id +set user_id [ad_conn user_id] + +db_transaction { + # Here we makee reference to the same res_id + set res_id [db_string get_res_id { }] + set identifierref [db_string get_identifierref { }] + + if { [empty_string_p $sort_order] } { + set max_sort_order [db_string get_max_sort_order { } ] + set sort_order [expr $max_sort_order + 1] + } else { + incr sort_order + } + + # First we are going to create a new cr_item (file) for the new resource + # We need the folder_id of the course to store the new item + set course_name [lors_central::get_course_name -man_id $man_id] + set root_folder [lors_central::get_root_folder_id] + set items_root_folder [lors_central::get_root_items_folder_id] + set folder_id [db_string get_folder_id { }] + set item_folder_id [db_string get_item_folder_id { }] + set item_name [db_string get_item_name { }] + set item_org_name $item_name + + # We are going to create a new item. First we are going to check + # if the name already exists to generate a new one + set item_name [lors_central::check_item_name -parent_id $folder_id -name $item_name] + set item_name [lors_central::check_item_name -parent_id $item_folder_id -name $item_name] + + ############################### + # We need to know where the new resource should be + set res_root_folder_id [lors_central::get_root_resources_folder_id] + set res_folder_id [lors_central::folder_id_from_man_parent -man_id $man_id -parent_id $res_root_folder_id] + + set new_res_item_id [content::item::new -name $item_name -creation_user $user_id \ + -parent_id $res_folder_id -content_type "ims_resource_object"] + + set new_res_rev_id [content::revision::new -item_id $new_res_item_id -title $item_name \ + -creation_user $user_id -is_live "t"] + + + # Now we have to update the new row in the ims_cp_resources using this new resource (new_res_id) + # we need a new href + set href [db_string get_res_href { select href from ims_cp_resources where res_id = :res_id }] + set identifier [db_string get_res_identifier { select identifier from ims_cp_resources where res_id = :res_id }] + + db_dml update_new_res { + update + ims_cp_resources + set + man_id = :man_id, + identifier = :identifier, + type = 'webcontent', + href = :href, + hasmetadata = 'f' + where + res_id = :new_res_rev_id + } + + # We need to make a copy of the rows on ims_cp_files + db_dml insert_files " + insert into ims_cp_files (select file_id,$new_res_rev_id,pathtofile,filename,hasmetadata from ims_cp_files where res_id = :res_id)" + + + + ############################################ + + # Now are going to create a new item (ims_cp_item) + # We need the folder_id of the course to store the new item + set root_ims_folder [lors_central::get_root_items_folder_id] + set items_folder_id [db_string get_items_folder_id { }] + + set new_ims_item_id [content::item::new -name $item_name -creation_user $user_id -parent_id $items_folder_id \ + -content_type "ims_item_object"] + set new_ims_rev_id [content::revision::new -item_id $new_ims_item_id -title $item_name -creation_user $user_id \ + -is_live "t"] + + # We need to insert in the ims_cp_items at the proper sort_order so we are going + # to rearrenge the items sort_order and then fill the information for the item + db_foreach get_items_to_reorder { } { + set new_sort [expr $order + 1] + db_dml reorder_items { } + } + + + db_dml update_ims_cp_items { + update ims_cp_items set + org_id = :org_id, + identifier = :item_name, + identifierref = :identifierref, + item_title = :item_org_name, + sort_order = :sort_order, + parent_item = :parent_item + where ims_item_id = :new_ims_rev_id + } + # Now this new revision_id is the one that holds the content of the new resource + # We have to make a row in ims_cp_items_to_resources table + + db_dml insert_new_item_to_res { + insert into ims_cp_items_to_resources (ims_item_id, res_id ) + values (:new_ims_rev_id, :new_res_rev_id) + } + + # We also need to map this item to (ims_cp_items_map) + # We need to do it for every community that is associated to this course (man_id) + set com_list [db_list_of_lists get_community_id { + select distinct community_id from ims_cp_items_map + where man_id = :man_id + }] + foreach community_id $com_list { + db_dml insert_item { + insert into ims_cp_items_map + (man_id,org_id,community_id,ims_item_id) + values + (:man_id,:org_id,:community_id,:new_ims_rev_id) + } + } +} + +ad_returnredirect "one-course?man_id=$man_id" \ No newline at end of file Index: openacs-4/packages/lors-central/www/add-exist-item.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/add-exist-item.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/add-exist-item.xql 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,109 @@ + + + + + + select + max (sort_order) + from + ims_cp_items + where + org_id = :org_id + + + + + + select + sort_order as order, ims_item_id as reorder_item_id + from + ims_cp_items + where + org_id = :org_id + and sort_order >= :sort_order + + + + + + update + ims_cp_items + set + sort_order = :new_sort + where + ims_item_id = :reorder_item_id + + + + + + select + item_title + from + ims_cp_items + where + ims_item_id = :ims_item_id + + + + + + select + item_id + from + cr_items + where + name = :course_name and + parent_id = :root_folder + + + + + + select + item_id + from + cr_items + where + name = :course_name and + parent_id = :items_root_folder + + + + + + select + item_id + from + cr_items + where + name = :course_name and + parent_id = :root_ims_folder + + + + + + select + r.res_id + from + ims_cp_items_to_resources i, ims_cp_resources r + where + i.ims_item_id = :the_ims_item_id + and r.man_id = :item_man_id + and r.res_id = i.res_id + + + + + + select + identifier + from + ims_cp_resources + where + res_id = :res_id + + + + \ No newline at end of file Index: openacs-4/packages/lors-central/www/add-lo.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/add-lo.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/add-lo.adp 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,6 @@ + +@page_title;noquote@ +@context;noquote@ + +

#lors-central.add_from_clip#

+ \ No newline at end of file Index: openacs-4/packages/lors-central/www/add-lo.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/add-lo.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/add-lo.tcl 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,114 @@ +ad_page_contract { + Display all shared items for adding + @author Miguel Marin (miguelmarin@viaro.net) + @author Viaro Networks www.viaro.net +} { + man_id:notnull + org_id:notnull + {sort_order ""} + parent_item:notnull + {ims_item_id ""} + clipboard_object_id:optional +} + +set user_id [ad_conn user_id] + +# Checking swa privilege over lors-central +lors_central::is_swa + +set new_lo_link "man_id=$man_id&org_id=$org_id&parent=$parent_item" +set page_title [_ lors-central.add_an_existent] +set context "[list [list "one-course?man_id=$man_id" [_ lors-central.one_course]] [list "new-learning-object?$new_lo_link" [_ lors-central.new_object]] $page_title]" + + +if {[exists_and_not_null clipboard_object_id]} { + db_transaction { + if { [empty_string_p $sort_order] } { + set max_sort_order [db_string get_max_sort_order { } ] + set sort_order [expr $max_sort_order + 1] + } else { + incr sort_order + } + set course_name [lors_central::get_course_name -man_id $man_id] + set root_folder [lors_central::get_root_folder_id] + set folder_id [db_string get_folder_id { }] + set clipboard_object_item_id [lors_central::get_item_id -revision_id $clipboard_object_id] + set item [content::item::get -item_id $clipboard_object_item_id -array_name original_item] + if { !$item } { + ad_return_complaint 1 "No Item associated to this object" + ad_script_abort + } + + # We get the identifier from the clipped resource + set identifierref [db_string get_res_identifier { } -default ""] + set href [db_string get_res_href { } -default ""] + + # We get the item_title and identifier that the clipped object has associated + set item_title [db_string get_item_title { } -default "Untitled"] + set identifier [db_string get_item_title { } -default "Untitled"] + + # No item, create a new one + # We need to know where the new resource should be + set res_root_folder_id [lors_central::get_root_resources_folder_id] + set res_folder_id [lors_central::folder_id_from_man_parent -man_id $man_id -parent_id $res_root_folder_id] + + # We check the name + set item_title [lors_central::check_item_name -parent_id $res_folder_id -name $item_title] + + set new_res_rev_id $clipboard_object_id + + # Now are going to create a new item (ims_cp_item) + # We need the folder_id of the course to store the new item + set root_ims_folder [lors_central::get_root_items_folder_id] + set items_folder_id [db_string get_items_folder_id { }] + + # We check the name and create a new item + set item_title [lors_central::check_item_name -parent_id $items_folder_id -name $item_title] + set new_ims_item_id [content::item::new -name $item_title -creation_user $user_id -parent_id $items_folder_id \ + -content_type "ims_item_object"] + set new_ims_rev_id [content::revision::new -item_id $new_ims_item_id -title $item_title \ + -creation_user $user_id -is_live "t"] + + # We need to insert in the ims_cp_items at the proper sort_order so we are going + # to rearrenge the items sort_order and then fill the information for the item + db_foreach get_items_to_reorder { } { + set new_sort [expr $order + 1] + db_dml reorder_items { } + } + db_dml update_ims_cp_items { + update ims_cp_items set + org_id = :org_id, + identifier = :identifier, + identifierref = :identifierref, + parent_item = :parent_item, + item_title = :item_title, + sort_order = :sort_order + where ims_item_id = :new_ims_rev_id + } + + # Now this new revision_id is the one that holds the content of the new resource + # We have to make a row in ims_cp_items_to_resources table + db_dml insert_new_item_to_res { + insert into ims_cp_items_to_resources (ims_item_id, res_id ) + values (:new_ims_rev_id, :new_res_rev_id) + } + + } + set com_list [db_list_of_lists get_community_id { + select distinct community_id from ims_cp_items_map + where man_id = :man_id + }] + foreach community_id $com_list { + db_dml insert_item { + insert into ims_cp_items_map + (man_id,org_id,community_id,ims_item_id) + values + (:man_id,:org_id,:community_id,:new_ims_rev_id) + } + } + + ad_returnredirect [export_vars -base "one-learning-object" {man_id {ims_item_id $new_ims_rev_id}}] +} + +set clipboard_add_url [export_vars -base "add-lo" {man_id ims_item_id org_id sort_order parent_item}] + Index: openacs-4/packages/lors-central/www/add-lo.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/add-lo.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/add-lo.xql 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,133 @@ + + + + + + select + max (sort_order) + from + ims_cp_items + where + org_id = :org_id + + + + + + select + item_id + from + cr_items + where + name = :course_name and + parent_id = :root_folder + + + + + + select + identifier + from + ims_cp_resources + where + res_id = :clipboard_object_id + + + + + + select + href + from + ims_cp_resources + where + res_id = :clipboard_object_id + + + + + + select + item_title + from + ims_cp_items + where + ims_item_id = ( select + min (ims_item_id) + from + ims_cp_items_to_resources + where + res_id = :clipboard_object_id ) + + + + + + select + identifier + from + ims_cp_items + where + ims_item_id = ( select + ims_item_id + from + ims_cp_items_to_resources + where + res_id = :clipboard_object_id ) + + + + + + select + item_id + from + cr_items + where + name = :course_name and + parent_id = :root_ims_folder + + + + + + insert into ims_cp_files ( + select + file_id, + :new_res_rev_id, + pathtofile, + filename, + hasmetadata + from + ims_cp_files + where + res_id = :clipboard_object_id + ) + + + + + + select + sort_order as order, ims_item_id as reorder_item_id + from + ims_cp_items + where + org_id = :org_id + and sort_order >= :sort_order + + + + + + update + ims_cp_items + set + sort_order = :new_sort + where + ims_item_id = :reorder_item_id + + + + Index: openacs-4/packages/lors-central/www/change-lo-version.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/change-lo-version.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/change-lo-version.tcl 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,38 @@ +ad_page_contract { + Change the live revision to revision_id + + @author Miguel Marin (miguelmarin@viaro.net) + @author Viaro Networks www.viaro.net + @creation_date 28-03-2005 +} { + ims_item_id:integer,notnull + item_id:integer,notnull + name:optional + man_id:notnull + live_hide_p:notnull +} + +# Checking swa privilege over lors-central +lors_central::is_swa + +if { ![info exist name] } { + set name [db_string get_name { select item_title from ims_cp_items where ims_item_id = :ims_item_id }] +} + +if { [string equal $live_hide_p "live"] } { + db_dml make_live_item { + update ims_cp_items_map + set ims_item_id = :ims_item_id, hide_p = 'f' + where man_id = :man_id and + ims_item_id in ( select revision_id from cr_revisions where item_id = :item_id) + } +} else { + db_dml hide_item { + update ims_cp_items_map + set hide_p = 't' + where man_id = :man_id and + ims_item_id in ( select revision_id from cr_revisions where item_id = :item_id) + } +} + +ad_returnredirect "one-learning-object?ims_item_id=$ims_item_id&man_id=$man_id&name=$name" \ No newline at end of file Index: openacs-4/packages/lors-central/www/change-one-lo-version.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/change-one-lo-version.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/change-one-lo-version.tcl 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,29 @@ +ad_page_contract { + Changes the version of the LO that one user will see on each class + @author Miguel Marin (miguelmarin@viaro.net) + @author Viaro Networks www.viaro.net +} { + man_id:integer,notnull + name:notnull + ims_item_id:integer,notnull + objects_id:multiple + objects_value:multiple +} + +# Checking swa privilege over lors-central +lors_central::is_swa + +# object_id: A list of communities ids +# object_value: The version number to set the revision + +set i 0 +foreach object_id $objects_id { + set object_value [lindex $objects_value $i] + lors_central::change_one_lo_version -ver_num $object_value -community_id $object_id \ + -man_id $man_id -ims_item_id $ims_item_id + incr i +} + + +ad_returnredirect "one-learning-object?ims_item_id=$ims_item_id&man_id=$man_id&name=$name" + Index: openacs-4/packages/lors-central/www/change-one-version.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/change-one-version.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/change-one-version.tcl 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,39 @@ +ad_page_contract { + Changes versions of courses according to the number set on "Set to" + +} { + item_id:integer,notnull + objects_count:multiple + objects_id:multiple + objects_value:multiple +} -validate { + equal_length_lists -requires {objects_id:notnull objects_value:notnull } { + if { ![string equal [llength $objects_id] [llength $objects_value]]} { + ad_complain "You must supply all values for Set to" + } + } +} + +# Checking swa privilege over lors-central +lors_central::is_swa + +# Validation of Range +set i 0 + +foreach object $objects_value { + if { $object < 1 || [lindex $objects_count $i] < $object } { + ad_return_complaint 1 "You must enter the right version number for Set to" + ad_script_abort + } + incr i +} + + +set i 0 +foreach object_id $objects_id { + set object_value [lindex $objects_value $i] + lors_central::change_version -ver_num $object_value -community_id $object_id -item_id $item_id + incr i +} + +ad_returnredirect "one-course-associations?item_id=$item_id" \ No newline at end of file Index: openacs-4/packages/lors-central/www/course-add-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-add-2.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/course-add-2.adp 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,42 @@ + +@context;noquote@ + +

+ +

#lorsm.lt_Preliminary_informati#

+

+ + + +

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

+ +

+ + +

#lorsm.SCORM_Package_Info#

+ +

+ + + + +

#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# + + + + + + + Index: openacs-4/packages/lors-central/www/course-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-add-2.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/course-add-2.tcl 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,378 @@ +ad_page_contract { + Upload an IMS Content Package + + Scope: + + 1.- Uploads file + 2.- Unzip file + 3.- Finds imsmanifest.xml + 4.- Displays basic imsmanifest.xml information + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 19 March 2003 + @cvs-id $Id: course-add-2.tcl,v 1.1 2005/05/17 16:21:19 miguelm Exp $ +} { + upload_file:trim,optional + upload_file.tmpfile:optional,tmpfile + course_id:integer,notnull + indb_p:integer,notnull + man_id:optional + +} -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)} { + ad_complain "[_ lorsm.lt_The_upload_failed_or_]" + } + } +} + +# Checking swa privilege over lors-central +lors_central::is_swa + +# To support versions +if { ![info exist man_id] } { + set man_id "" +} + +# Permissions +set user_id [ad_conn user_id] +# dotlrn::require_user_admin_community -user_id $user_id -community_id [dotlrn_community::get_community_id] + +# 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] } { + 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" + set allfiles [lors::imscp::dir_walk $tmp_dir] + +} else { + set allfiles [lors::imscp::dir_walk $directory] + +} + +# Get LORSM Root folder_id +set folder_id [lors_central::get_root_folder_id] + + +# 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} { + 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] + +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 + +# checks for write permission on the parent folder +ad_require_permission $parent_id write + +# 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 + + ## Create lists and multirows + multirow create element_nodes element attributes + + template::list::create \ + -name d_info \ + -multirow d_info \ + -no_data "[_ lorsm.No_Information]" \ + -elements { + col1 { + label "" + html {valign top style "background-color: #e0e0e0; font-weight: bold;"} + } + col2 { + label "" + html {valign top style "background-color: #f0f0f0; font-weight: bold;"} + } + } + + multirow create d_info col1 col2 + + + template::list::create \ + -name d_IMS_package_info \ + -multirow d_IMS_package_info \ + -no_data "[_ lorsm.lt_No_IMS_Package_struct]" \ + -elements { + organizations { + label "[_ lorsm.Organizations]" + html {valign top align center} + } + items { + label "[_ lorsm.Items]" + html {valign top align center} + } + resources { + label "[_ lorsm.Resources]" + html {valign top align center} + } + files { + label "[_ lorsm.Files]" + html {valign top align center} + } + } + + multirow create d_IMS_package_info organizations items resources files + + template::list::create \ + -name d_SCORM_package_info \ + -multirow d_SCORM_package_info \ + -no_data "[_ lorsm.No_Items]" \ + -elements { + scos { + label "[_ lorsm.SCOs]" + html {valign top} + } + assets { + label "[_ lorsm.Assets]" + html {valign top} + } + sharableresources { + label "[_ lorsm.Sharable_Resources]" + html {valign top} + } + files { + label "[_ lorsm.files]" + html {valign top} + } + } + + multirow create d_SCORM_package_info scos assets sharableresources files + + ## Opens imsmanifest.xml + + # open manifest file with tDOM + set doc [dom parse [read [open $manifest]]] + # gets the manifest tree + set manifest [$doc documentElement] + + # gets metadata node + set metadata [$manifest child all metadata] + + # 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] + + 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 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 + 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" + } + # 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] + + 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" + } + } 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]" + } + + + # 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 items 0 + + foreach organization $num_organizations { + + set items [expr $items + [lors::imscp::countItems $organization]] + + } + multirow append d_info "Number of Items: " $items + } + + # gets the resources + set resources [$manifest child all resources] + + # 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 + } + + set resourcex [$resources child all resource] + + 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 + } + asset { + incr assets + } + sharableresource { + incr sharableresources + } + } + + set files [expr $files + [llength [lors::imsmd::getResource -node $resourcex -att 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]]] + } + } + 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} } \ + -html {enctype multipart/form-data} \ + -mode edit \ + -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_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 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 -optional + +template::element create course_upload isSCORM \ + -label "[_ lorsm.isSCORM]" -datatype integer -widget hidden -optional + + +if { ![empty_string_p $man_id] } { + set version_id [db_string get_version_id "select item_id from cr_revisions where revision_id = :man_id"] + template::element create course_upload version_id -datatype integer -widget hidden -optional + template::element set_properties course_upload version_id -value $version_id +} + +template::element set_properties course_upload course_id -value $course_id + +template::element set_properties course_upload indb_p -value $indb_p + +template::element set_properties course_upload tmp_dir -value $tmp_dir + +template::element set_properties course_upload folder_id -value $folder_id + +template::element set_properties course_upload isSCORM -value $isSCORM + +template::element set_properties course_upload course_name -value $manifest_title + + + + + Index: openacs-4/packages/lors-central/www/course-add-3.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-add-3.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/course-add-3.adp 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,57 @@ + +@context;noquote@ + +

+ +

#lorsm.lt_Preliminary_informati#

+

+ +

+ +

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

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

+ +

#lorsm.Organizations#

+ +

+ +

+

#lorsm.Items#

+ +
+

+ + + +

#lorsm.SCOs#

+ +

+ +

#lorsm.Assets#

+ +

+ + + + +

#lorsm.Resources#

+ +

+ +

+ + + +
+@l_files@ +
+ +

+@all_files@ + + Index: openacs-4/packages/lors-central/www/course-add-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-add-3.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/course-add-3.tcl 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,692 @@ +ad_page_contract { + Upload an IMS Content Package 3 + + Scope: + + Add files to the CR + Process imsmanifest.xml + Determines this is a Blackboard course and if it is process it accordingly. + Inserts all ims_items, resources and all IMS CP entities into the DB. + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 19 March 2003 + @cvs-id $Id: course-add-3.tcl,v 1.1 2005/05/17 16:21:19 miguelm Exp $ +} { + folder_id:integer,notnull + tmp_dir:optional,notnull + course_id:integer,notnull + course_name:notnull + indb_p:integer,notnull + {version_id:integer ""} + +} -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)} { + ad_complain "[_ lorsm.lt_The_upload_failed_or_]" + } + } +} + +# Checking swa privilege over lors-central +lors_central::is_swa + +#check permission +set user_id [ad_conn user_id] +# ad_require_permission $folder_id admin + +# Display progress bar +ad_progress_bar_begin \ + -title "[_ lorsm.Uploading_course]" \ + -message_1 "[_ lorsm.lt_Uploading_and_process]" \ + -message_2 "[_ lorsm.lt_We_will_continue_auto]" + + +ns_write "

[_ lorsm.lt_Initiating_Updating_l]

" + +# Is this a Blackboard6 package? +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_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]

" + +db_transaction { + + ## 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 + + # 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 + if {![empty_string_p $course_name]} { + regexp {([^/\\]+)$} $course_name match cr_dir + } else { + regexp {([^/\\]+)$} $fs_dir match cr_dir + } + + #set new_parent_id [lors::cr::add_folder -parent_id $parent_id -folder_name $cr_dir] + + ############################################################################ + # Add all the folders that will store all the webcontent (files) in th CR + + # Add new folder to store the webcontent (Same as it was with file-storage) + set new_parent_id [content::folder::new -name $cr_dir -label $cr_dir -parent_id $parent_id] + content::folder::register_content_type -folder_id $new_parent_id -content_type "content_revision" \ + -include_subtypes "t" + content::folder::register_content_type -folder_id $new_parent_id -content_type "content_folder" \ + -include_subtypes "t" + content::folder::register_content_type -folder_id $new_parent_id -content_type "content_symlink" \ + -include_subtypes "t" + content::folder::register_content_type -folder_id $new_parent_id -content_type "content_extlink" \ + -include_subtypes "t" + + # Add new folders to store the manifest, organizations, items, resources items (replacing acs_objects) + # Manifest + set man_parent_id [lors_central::get_folder_id -name "LORSM Manifest Folder"] + set man_folder_id [content::folder::new -name $cr_dir -label $cr_dir -parent_id $man_parent_id] + content::folder::register_content_type -folder_id $man_folder_id -content_type "ims_manifest_object" \ + -include_subtypes "t" + content::folder::register_content_type -folder_id $man_folder_id -content_type "content_revision" \ + -include_subtypes "t" + + # Organizations + set org_parent_id [lors_central::get_folder_id -name "LORSM Organizations Folder"] + set org_folder_id [content::folder::new -name $cr_dir -label $cr_dir -parent_id $org_parent_id] + content::folder::register_content_type -folder_id $org_folder_id -content_type "ims_organization_object" \ + -include_subtypes "t" + content::folder::register_content_type -folder_id $org_folder_id -content_type "content_revision" \ + -include_subtypes "t" + + set itm_parent_id [lors_central::get_folder_id -name "LORSM Items Folder"] + set itm_folder_id [content::folder::new -name $cr_dir -label $cr_dir -parent_id $itm_parent_id] + content::folder::register_content_type -folder_id $itm_folder_id -content_type "ims_item_object" \ + -include_subtypes "t" + content::folder::register_content_type -folder_id $itm_folder_id -content_type "content_revision" \ + -include_subtypes "t" + + set res_parent_id [lors_central::get_folder_id -name "LORSM Resources Folder"] + set res_folder_id [content::folder::new -name $cr_dir -label $cr_dir -parent_id $res_parent_id] + content::folder::register_content_type -folder_id $res_folder_id -content_type "ims_resource_object" \ + -include_subtypes "t" + content::folder::register_content_type -folder_id $res_folder_id -content_type "content_revision" \ + -include_subtypes "t" + + ############################ + # Store the files in the CR + + set filesx [lors_central::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 + + set dirs [lors::cr::has_dirs -fs_dir $fs_dir] + + set base_parent_id $new_parent_id + + # dirx = directory loop + set dirx [list "$base_parent_id [list $dirs]"] + + # 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 + regexp {([^/\\]+)$} $subdir match cr_dir + + # add the folder to the CR + ns_write "[_ lorsm.Processing_folder]: $cr_dir
" + + ################################ + # Add new sub-folder to the CR + + set new_cr_folder_id [content::folder::new -name $cr_dir -parent_id $base_parent_id -label $cr_dir] + content::folder::register_content_type -folder_id $new_cr_folder_id -content_type "content_revision"\ + -include_subtypes "t" + content::folder::register_content_type -folder_id $new_cr_folder_id -content_type "content_folder" \ + -include_subtypes "t" + content::folder::register_content_type -folder_id $new_cr_folder_id -content_type "content_symlink" \ + -include_subtypes "t" + content::folder::register_content_type -folder_id $new_cr_folder_id -content_type "content_extlink" \ + -include_subtypes "t" + + + 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[_ acs-kernel.common_OK]
" + } + ns_write "
" + # + + if ![empty_string_p $files] { + + ####################### + # Add files to the CR + + set filesx [lors_central::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 + } else { + # otherwise, then just add the new directories to the queue + set dirx + set dirx $collector + } + } + + ## Finish adding files to the CR. + ## Now we start processing the imsmanifest.xml file + + ns_write "

[_ lorsm.Now_processing]imsmanifest.xml [_ lorsm.file]" + ## Opens imsmanifest.xml + + # open manifest file with tDOM + set doc [dom parse [read [open $tmp_dir/imsmanifest.xml]]] + # gets the manifest tree + set manifest [$doc documentElement] + + # Gets manifest characteristics + set man_identifier [lors::imsmd::getAtt $manifest identifier] + set man_version [lors::imsmd::getAtt $manifest version] + + # DETECT SCORM OR IMS CP + # NOTE: it requires that the manifest contains a metadata record (which is not always the case) :-( + ## + + # gets metadata node + set metadata [$manifest child all metadata] + + 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 manifest title + + 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 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 + + # 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] + + } + + } 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_central::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_parent_id \ + -community_id "" \ + -man_folder_id $man_folder_id \ + -version_id $version_id ] + + ns_write "[_ lorsm.lt_Granting_permissions__1 [list course_name $course_name]]
" + + # 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 + + # 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 + + # 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 + + # 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'}] + + 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 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 + + + # Done with Manifest and learning object Permissions + + + ns_write "[_ lorsm.lt_Adding_course_name_Ma [list course_name $course_name]]
" + + 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]
" + + } + + + if { ![empty_string_p $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_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_central::imscp::organization_add \ + -man_id $man_id \ + -identifier $org_identifier \ + -structure $org_structure \ + -title $org_title \ + -hasmetadata $org_hasmetadata \ + -org_folder_id $org_folder_id] + + ns_write "[_ lorsm.lt_Adding_Organization_o [list org_title $org_title]]
" + + + 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 list_items [lors::imscp::getItems $organization] + + # ns_write "[_ lorsm.lt_here_is_list_items_li [list list_items $list_items]]" + + + set add [concat $add [lors_central::imscp::addItems -itm_folder_id $itm_folder_id \ + -org_id $org_id $list_items 0 $tmp_dir]] + + 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_hasmetadata [lors::imsmd::hasMetadata $resource] + set res_files [lors::imsmd::getResource -node $resource -att files] + set res_scormtype [lors::imsmd::getAtt $resource adlcp:scormtype] + +### Addition provided by e-lane people to integrate on deployment with +# assessment package. + +# In the future we need to come up with a nicier way to do this as +# this is rather a dirty hack for now. + +# if {$res_type == "imsqti_xmlv1p0" || $res_type == "imsqti_xmlv1p1" || $res_type =="imsqti_item_xmlv2p0"} { +# set res_href [lors::assessment::ims_qti_register_assessment \ +# -tmp_dir $tmp_dir/$res_href \ +# -community_id $community_id] +# } + +## End integration showcase + + set resource_id [lors_central::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 $res_folder_id ] + + ns_write "[_ lorsm.lt_Adding_resource_res_i_2 [list res_identifier $res_identifier]]
" + + 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 [list res_identifier $res_identifier]]
" + + } + + + foreach dependency $res_dependencies { + + set dep_id [lors::imscp::dependency_add \ + -res_id $resource_id \ + -identifierref $dependency] + + 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 "$resource_id $res_identifier \n" + # ns_write "\t$file \n" + } + } + } + + # gets the resources + set resources [$manifest child all resources] + + } else { + # Error MSG here + #ns_write "[_ lorsm.no_page]" + } + + + # 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] + + # ad_return_complaint 1 "$found_file
$tmp_dir $filename
$all_files " + # ad_script_abort + } + + 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 [list filex $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 [list filex $filex]]
" + } + } + + } + + + # 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]


" + +} + +# Get all organizations associated to this man_id +set org_list [db_list_of_lists get_organizations { + select org_id + from ims_cp_organizations + where man_id = :man_id +}] + + +# We make this outside the db_transaction because we need man_id present in ims_cp_manifests +if { ![empty_string_p $version_id] } { + set item_id [lors_central::get_item_id -revision_id $man_id] + + # We are making a new version of a course. We need to make inserts in ims_cp_manifest_class + # so the changes will be reflected in all classes that use this course + # We get all classes that use this course + + db_foreach get_all_communities { } { + # We update the rows with the new revision_id ( man_id ) so every class that use this course + # will have the same course version + db_dml update_course { } + db_dml delete_temporary_row { } + } + + # We need to update the ims_cp_items_map table to have same man_id for all clases + # First we are going to get all the communities id that are associated to this man_id + + set com_list [db_list_of_lists get_communities { + select distinct community_id from ims_cp_manifest_class + where man_id in ( select revision_id from cr_revisions where item_id = :item_id ) + }] + + # Now we are going to delete all from ims_cp_items related to this man_id + db_dml delete_from_items_map { + delete from ims_cp_items_map + where man_id in ( select revision_id from cr_revisions where item_id = :item_id ) + } + + + # Now we are going to insert the same course for all dotlrn classes + foreach com_id $com_list { + if { ![empty_string_p [lindex $com_id 0]] } { + foreach org_id $org_list { + set items_list [db_list_of_lists get_items { + select ims_item_id + from ims_cp_items + where org_id = :org_id + and ims_item_id in ( select live_revision + from cr_items + ) + }] + foreach ims_item_id $items_list { + db_dml insert_items { + insert into ims_cp_items_map + (man_id, org_id, community_id, ims_item_id) + values + (:man_id, :org_id, :com_id, :ims_item_id) + } + } + } + } + } +} + +# We also need to set the sort_order field in the ims_cp_items table, so we are going to do it here +foreach org_id $org_list { + set items_list [db_list_of_lists get_items { + select ims_item_id + from ims_cp_items + where org_id = :org_id + order by ims_item_id asc + }] + set i 1 + foreach ims_item_id $items_list { + lors_central::set_sort_order -sort_order $i -ims_item_id $ims_item_id + incr i + } +} + +# jump to the front page +ad_progress_bar_end -url [apm_package_url_from_id [ad_conn package_id]] Index: openacs-4/packages/lors-central/www/course-add-3.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-add-3.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/course-add-3.xql 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,45 @@ + + + + + + select + icmc.community_id as com_id, + icmc.lorsm_instance_id as lors_ins_id, + icmc.class_key as cl_key, + icmc.isenabled as ie, + icmc.istrackable as it + from + ims_cp_manifest_class icmc + where + icmc.man_id in ( select revision_id + from cr_revisions + where item_id = :version_id ) + + + + + + update ims_cp_manifest_class + set + man_id = :man_id, + lorsm_instance_id = :lors_ins_id, + class_key = :cl_key, + isenabled = :ie, + istrackable = :it + where + community_id = :com_id + + + + + + delete from ims_cp_manifest_class + where + community_id is null and + class_key is null and + man_id = :man_id + + + + \ No newline at end of file Index: openacs-4/packages/lors-central/www/course-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-add.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/course-add.adp 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,20 @@ + +#lorsm.lt_Upload_an_IMSSCORM_Co# +@context;noquote@ + + + + + + + +
+

#lorsm.Add_your_own_course#

+
+
+

#lorsm.lt_We_have_detected_the_# @folder_name;noquote@ + #lorsm.lt_and_we_will_import_yo#

+ +
+
+ Index: openacs-4/packages/lors-central/www/course-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-add.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/course-add.tcl 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,91 @@ +ad_page_contract { + Upload and imports an IMS Content Package file + Initial form data + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 19 March 2003 + @cvs-id $Id: course-add.tcl,v 1.1 2005/05/17 16:21:19 miguelm Exp $ + +} { + man_id:optional +} + +set user_id [ad_conn user_id] +set community_id [dotlrn_community::get_community_id] + +# Checking swa privilege over lors-central +lors_central::is_swa + +if { ![info exists man_id] } { + set man_id "" +} + +# Permissions +# dotlrn::require_user_admin_community -user_id $user_id -community_id $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"\ + ] + +#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] + +set folder_id [lors_central::get_root_folder_id] +set folder_name [lors_central::get_folder_name -folder_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. + +#set indb_p [parameter::get -parameter "StoreFilesInDatabaseP" -package_id $fs_package_id] +set indb_p 1 + +# Gets URL for file-storage package +# 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 course id +set course_id 1 + +# 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::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 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 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 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 man_id -value $man_id + + +ad_return_template + + Index: openacs-4/packages/lors-central/www/course-admin.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-admin.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/course-admin.adp 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,16 @@ + + @title@ + @context@ + + + + + + + +
+

#lorsm.lt_Courses_in_your_Repos#

+
+ +
+ Index: openacs-4/packages/lors-central/www/course-admin.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-admin.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/course-admin.tcl 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,147 @@ +# packages/lors-central/www/index.tcl + +ad_page_contract { + Learning Object Repository Management Index page + +} { + man_id:integer,notnull +} + +# Checking swa privilege over lors-central +lors_central::is_swa + + +set title "[_ lorsm.lt_Manage_Courses_in_Rep]" +set context [list "[_ lorsm.Manage_Courses]"] + + +set package_id [ad_conn package_id] +set user_id [ad_conn user_id] +# set community_id [dotlrn_community::get_community_id] + + +# set admin_p [dotlrn::user_can_admin_community_p \ + -user_id [ad_conn user_id] \ + -community_id $community_id ] + +# set admin_p [dotlrn::user_can_admin_community_p \ + -user_id $user_id \ + -community_id $community_id ] + +# Permissions +# dotlrn::require_user_admin_community -user_id $user_id -community_id $community_id + +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]" + + +template::list::create \ + -name d_courses \ + -multirow d_courses \ + -html {width 50%} \ + -actions $actions \ + -key man_id \ + -no_data "[_ lorsm.No_Courses]" \ + -elements { + course_name { + label "[_ lorsm.Available_Courses]" + display_col course_name + link_url_eval {delivery/?[export_vars man_id]} + link_html {title "[_ lorsm.Access_Course]"} + + } + class_name { + label "[_ lors-central.class_name]" + } + hasmetadata { + label "[_ lorsm.Metadata_1]" + link_url_eval {md/?[export_vars ims_md_id]} + link_html {title "[_ lorsm.See_metadata]" } + html { align center } + } + isscorm { + label "[_ lorsm.SCORM]" + html { align center } + } + isenabled { + label "[_ lorsm.Status_1]" + html { align center } + } + istrackable { + label "[_ lorsm.Tracking]" + link_url_eval {tracking/?[export_vars {man_id lorsm_instance_id community_id}]} + link_html {title "[_ lorsm.lt_Track_Students_Progre]" class button} + 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 { + label "[_ lorsm.Creation_Date]" + display_eval {[lc_time_fmt $creation_date "%x %X"]} + } + export { + label "[_ lorsm.Export]" + display_eval {\[zip\]} + link_url_eval {[export_vars -base export folder_id]} + link_html {title "[_ lorsm.lt_Export_as_IMS_Content]"} + html { align center } + } + admin { + label "[_ lorsm.Admin_Course]" + display_eval {Admin} + link_url_eval {[export_vars -base course-structure {man_id lorsm_instance_id}]} + link_html {title "[_ lorsm.Admin_Course]" class button} + html { align center } + } + } + + +db_multirow -extend { ims_md_id class_name } d_courses select_d_courses { + select + cp.man_id, + cp.course_name, + cp.identifier, + cp.version, + cpmc.lorsm_instance_id, + cpmc.community_id, + case + when hasmetadata = 't' then 'Yes' + else 'No' + end as hasmetadata, + case + when isscorm = 't' then 'Yes' + else 'No' + end as isscorm, + cp.fs_package_id, + cp.folder_id, + acs.creation_user, + acs.creation_date, + 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 + from + ims_cp_manifests cp, acs_objects acs, ims_cp_manifest_class cpmc + where + cp.man_id = acs.object_id + and + cp.man_id = :man_id + and + cp.man_id = cpmc.man_id + order by acs.creation_date desc +} { + set ims_md_id $man_id + set class_name [lors_central::get_class_name -community_id $community_id] +} + Index: openacs-4/packages/lors-central/www/course-associate.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-associate.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/course-associate.tcl 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,41 @@ +ad_page_contract { + Associates a item_id with dotlrn's class_instance_id or community + + @author Miguel Marin (miguelmarin@viaro.net) + @author Viaro Networks www.viaro.net +} { + item_id:notnull + type:notnull + object_id:multiple + { return_url "" } +} + +# Checking swa privilege over lors-central +lors_central::is_swa + +set man_id [content::item::get_live_revision -item_id $item_id] + +foreach community_id $object_id { + # Here we associate the course with every community_id that was checked + lors_central::add_relation -item_id $item_id -community_id $community_id -class_key $type + + # Now we have to make insert in the ims_cp_items_map in orther to tell which version + # of which course will be shown to an especific dotlrn class. + set org_list [db_list_of_lists get_organizations { }] + foreach org_id $org_list { + # We need to insert every single ims_item_id to ims_cp_items_map (only the live_revision) + set items_list [db_list_of_lists get_ims_items { }] + foreach ims_item_id $items_list { + db_dml insert_items { } + } + } + } + + + +if { [empty_string_p $return_url] } { + ad_returnredirect "course-dotlrn-assoc?item_id=$item_id" +} else { + ad_returnredirect $return_url +} + Index: openacs-4/packages/lors-central/www/course-associate.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-associate.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/course-associate.xql 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,46 @@ + + + + + + select + org_id + from + ims_cp_organizations + where + man_id = :man_id + + + + + + select + ims_item_id + from + ims_cp_items + where + org_id = :org_id + and + ims_item_id = ( + select live_revision + from cr_items + where item_id = ( + select item_id + from cr_revisions + where revision_id = ims_item_id + ) + ) + + + + + + + insert into ims_cp_items_map + (man_id,org_id,community_id,ims_item_id) + values + (:man_id,:org_id,:community_id,:ims_item_id) + + + + \ No newline at end of file Index: openacs-4/packages/lors-central/www/course-association-drop.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-association-drop.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/course-association-drop.tcl 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,32 @@ +ad_page_contract { + Drop associations of item_id's with dotlrn's classes or communities + + @author Miguel Marin (miguelmarin@viaro.net) + @author Viaro Networks www.viaro.net +} { + item_id:notnull + object_id:multiple + { return_url "" } +} + +# Checking swa privilege over lors-central +lors_central::is_swa + + +set man_list [db_list_of_lists get_man_ids { }] +foreach community_id $object_id { + lors_central::drop_relation -item_id $item_id -community_id $community_id + foreach man_id $man_list { + set org_list [db_list_of_lists get_organizations { }] + foreach org_id $org_list { + db_dml delete_items { } + } + } +} + +if { [empty_string_p $return_url] } { + ad_returnredirect "course-dotlrn-assoc?item_id=$item_id" +} else { + ad_returnredirect $return_url +} + Index: openacs-4/packages/lors-central/www/course-association-drop.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-association-drop.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/course-association-drop.xql 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,37 @@ + + + + + + select + revision_id + from + cr_revisions + where + item_id = :item_id + + + + + + + select + org_id + from + ims_cp_organizations + where + man_id = :man_id + + + + + + delete from ims_cp_items_map + where + man_id = :man_id and + org_id = :org_id and + community_id = :community_id + + + + \ No newline at end of file Index: openacs-4/packages/lors-central/www/course-dotlrn-assoc.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-dotlrn-assoc.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/course-dotlrn-assoc.adp 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,7 @@ + +@title;noquote@ +@context;noquote@ + + +

+ Index: openacs-4/packages/lors-central/www/course-dotlrn-assoc.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-dotlrn-assoc.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/course-dotlrn-assoc.tcl 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,157 @@ +ad_page_contract { + @author Miguel Marin (migeulmarin@viaro.net) + @author Viaro Networks www.viaro.net + + This page associate this course to one class or community of dotlrn +} { + man_id:integer,optional + item_id:integer,optional +} + +# Checking swa privilege over lors-central +lors_central::is_swa + +set title [_ lors-central.associate_to] + +# Get the item_id that the manifest_id has associated +if { ![info exist item_id] } { + set item_id [lors_central::get_item_id -revision_id $man_id] + set context [list [list "one-course-associations?man_id=$man_id" [_ lors-central.one_course_assoc]] \ + [_ lors-central.associate_to]] +} else { + set context [list [list "one-course-associations?item_id=$item_id" [_ lors-central.one_course_assoc]] \ + [_ lors-central.associate_to]] +} + +set user_id [ad_conn user_id] + + +##################################### TO ASSOCIATE ########################################################## + +db_multirow -extend { rel type } classes_list get_dotlrn_classes { } { + set rel [lors_central::relation_between -item_id $item_id -community_id $com_id] + set type dotlrn_class_instance +} + +template::list::create \ + -name dotlrn_classes \ + -multirow classes_list \ + -key community_id \ + -has_checkboxes\ + -bulk_actions { + "\#lors-central.associate\#" "course-associate" "\#lors-central.associate_to_class\#" \ + } \ + -bulk_action_method post \ + -bulk_action_export_vars { + item_id + type + }\ + -row_pretty_plural "[_ lors-central.dotlrn_classes]" \ + -elements { + check_box { + class "list-narrow" + label "" + display_template { + + } + } + class { + label "[_ lors-central.class_name]" + display_template { + @classes_list.pretty_name@ + } + } + dep_name { + label "[_ lors-central.dep_name]" + display_template { + @classes_list.department_name@ + } + } + term_name { + label "[_ lors-central.term_name]" + display_template { + @classes_list.term_name@ + } + } + subject { + label "[_ lors-central.subject_name]" + display_template { + @classes_list.class_name@ + } + } + associate { + display_template { + + #lors-central.associated# + + } + } + } + + +############################## TO DROP ASSOCIATION ###################################### + +db_multirow -extend { rel } drop_classes_list get_dotlrn_classes_drop { } { + set rel [lors_central::relation_between -item_id $item_id -community_id $com_id] +} + +template::list::create \ + -name drop_dotlrn_classes \ + -multirow drop_classes_list \ + -key community_id \ + -has_checkboxes\ + -bulk_actions { + "\#lors-central.drop\#" "course-association-drop" "\#lors-central.drop_association\#" \ + } \ + -bulk_action_method post \ + -bulk_action_export_vars { + item_id + }\ + -row_pretty_plural "[_ lors-central.dotlrn_classes]" \ + -elements { + check_box { + class "list-narrow" + label "" + display_template { + + } + } + class { + label "[_ lors-central.class_name]" + display_template { + @drop_classes_list.pretty_name@ + } + } + dep_name { + label "[_ lors-central.dep_name]" + display_template { + @drop_classes_list.department_name@ + } + } + term_name { + label "[_ lors-central.term_name]" + display_template { + @drop_classes_list.term_name@ + } + } + subject { + label "[_ lors-central.subject_name]" + display_template { + @drop_classes_list.class_name@ + } + } + associate { + display_template { + + #lors-central.associated# + + } + } + } + Index: openacs-4/packages/lors-central/www/course-dotlrn-assoc.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-dotlrn-assoc.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/course-dotlrn-assoc.xql 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,68 @@ + + + + + + select + dc.class_instance_id as com_id, + dc.department_name, + dc.term_name, + dc.class_name, + dc.pretty_name, + dc.url + from + dotlrn_class_instances_full dc + where + dc.class_instance_id not in + ( + select + icmc.community_id + from + ims_cp_manifest_class icmc + where + icmc.community_id is not null and + man_id in + ( + select revision_id + from cr_revisions + where item_id = :item_id + ) + ) + order by department_name, term_name, class_name, pretty_name + + + + + + select + dc.class_instance_id as com_id, + dc.department_name, + dc.term_name, + dc.class_name, + dc.pretty_name, + dc.url + from + dotlrn_class_instances_full dc + where + dc.class_instance_id in + ( + select + icmc.community_id + from + ims_cp_manifest_class icmc + where + icmc.man_id in + ( + select revision_id + from cr_revisions + where item_id = :item_id + ) + ) + order by department_name, + term_name, + class_name, + pretty_name + + + + \ No newline at end of file Index: openacs-4/packages/lors-central/www/course-live-in.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-live-in.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/course-live-in.adp 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,5 @@ + +@title;noquote@ +@context;noquote@ + + \ No newline at end of file Index: openacs-4/packages/lors-central/www/course-live-in.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-live-in.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/course-live-in.tcl 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,67 @@ +ad_page_contract { + Display a list of dotlrn classes where the course is in use + @author Miguel Marin (miguelmarin@viaro.net) + @author Viaro Networks www.viaro.net +} { + man_id:integer,optional +} + +# Checking swa privilege over lors-central +lors_central::is_swa + +set title "[_ lors-central.Classes_using]" +set context [list [list "one-course-associations?man_id=$man_id" [_ lors-central.one_course_assoc]] \ + [_ lors-central.Classes_using]] + +# Get the item_id of man_id +set item_id [lors_central::get_item_id -revision_id $man_id] + +db_multirow -extend { ver_num ver_count manifest_id options } cl_list get_dotlrn_classes { } { + set manifest_id [lors_central::get_man_id -community_id $com_id -item_id $item_id] + set ver_count [lors_central::count_versions -man_id $manifest_id] + set ver_num [lors_central::get_version_num -revision_id $manifest_id] + # Create the options for the select menu + set options "" + for { set i 1 } { $i < [expr $ver_count + 1] } { incr i } { + if { [string equal $i $ver_num] } { + append options "
>@revisions.title@} link_url_eval {[export_vars -base one-resource {res_id}]}} + last_modified {label "Modified On" display_template {class="list-selected">@revisions.last_modified@}} + type {label "Type"} + } + +# Find lors-central courses that use this resource + +db_multirow courses courses { } + +template::list::create \ + -name courses \ + -multirow courses \ + -elements { + course_name {label "Course Name" link_url_eval {[export_vars -base one-learning-object {ims_item_id man_id org_id}]}} + } + +ad_return_template Index: openacs-4/packages/lors-central/www/one-resource.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/one-resource.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/one-resource.xql 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,73 @@ + + + + + + select + io.org_id, + ii.ims_item_id, + im.man_id, + im.course_name + from + ims_cp_manifests im, + ims_cp_items ii , + ims_cp_items_to_resources ir, + ims_cp_organizations io, + cr_revisions cr, + cr_items ci + where + im.man_id = io.man_id and + ii.org_id = io.org_id and + ii.ims_item_id = ir.ims_item_id and + ir.res_id = cr.revision_id and + cr.item_id = ( + select + item_id + from + cr_revisions + where + revision_id = :res_id + ) and + ci.live_revision = ii.ims_item_id + + + + + + + select + man_id + from + ims_cp_resources + where + res_id = :res_id + + + + + + + select + r.*, + f.file_id, + case + when r.revision_id =:res_id then 1 + else 0 + end as selected + from + ims_cp_resourcesx r left join ims_cp_files f on f.res_id = r.res_id and + f.pathtofile = r.href + where + item_id = ( + select + item_id + from + cr_revisions + where + revision_id = :res_id + ) + order by ( case when revision_id = :res_id then 1 else 0 end), creation_date desc + + + + \ No newline at end of file Index: openacs-4/packages/lors-central/www/reorder-items.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/reorder-items.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/reorder-items.tcl 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,145 @@ +ad_page_contract { + Reorders all the items according to sort_order +} { + item_id:integer,notnull + dir:notnull + org_id:notnull + sort_order:notnull +} + +# Checking swa privilege over lors-central +lors_central::is_swa + +set ims_item_id $item_id +set item_sort [db_string get_item_sort { }] +set man_id [db_string get_man_id { }] +set parent_item [db_string get_parent_item { }] +set global_list [db_list_of_lists get_global_group { }] +set max_sort_order [db_string get_max_sort { }] + +if { [string equal $dir "up"] } { + set up_items [list [list $ims_item_id $item_sort]] + + # First we need to get all the items that are going up + # (all the revisions and all the childrens if any) + # We get all items with the same parent_item as ims_item_id has + set same_parent [db_list_of_lists get_items_parent { }] + + # We get all the items for the parent_item + + # To get all the childrens we will get the sort_order of the next + # ims_item_id of with the same parent and get all the ims_item_id's + # between the ims_item_id to reorder and the next ims_item_id + set i 0 + foreach item $same_parent { + if { [string equal [lindex $item 0] $ims_item_id] } { + set next_sort_pos [expr $i + 1] + set back_sort_pos [expr $i - 1] + } + incr i + } + set next_sort [lindex [lindex $same_parent $next_sort_pos] 1] + if { [empty_string_p $next_sort] } { + + # This item is the last one so we need to get the sort order of the next parent + set next_item [lindex $global_list [expr [lsearch $global_list $parent_item] + 1]] + if { [empty_string_p $next_item] } { + # This is the last one of the course + set next_sort [expr $max_sort_order + 1] + } else { + set next_sort [db_string get_next_sort { }] + } + } + set up_childs [db_list_of_lists get_up_childs { }] + foreach item $up_childs { + lappend up_items $item + } + set tot_items_up [llength $up_items] + + # Finish with up, now we are going to so the same for the items that + # are going down + + set back_sort [lindex [lindex $same_parent $back_sort_pos] 1] + set down_items [list [lindex $same_parent $back_sort_pos]] + set down_childs [db_list_of_lists get_down_childs { }] + foreach item $down_childs { + lappend down_items $item + } + set tot_items_down [llength $down_items] + + # Now that we now how many items will go up and how many will go down + # we make the updates on the tables + + foreach item $up_items { + set ims_item_id [lindex $item 0] + set sort [expr [lindex $item 1] - $tot_items_down] + lors_central::set_sort_order -ims_item_id $ims_item_id -sort_order $sort + } + foreach item $down_items { + set ims_item_id [lindex $item 0] + set sort [expr [lindex $item 1] + $tot_items_up] + lors_central::set_sort_order -ims_item_id $ims_item_id -sort_order $sort + } +} else { + # We are going to do the same as above but with some variants + set down_items [list [list $ims_item_id $item_sort]] + + # We get all items with the same parent_item as ims_item_id has + set same_parent [db_list_of_lists get_items_parent { }] + + # To get all the childrens we will get the sort_order of the next + # ims_item_id of with the same parent and get all the ims_item_id's + # between the ims_item_id to reorder and the next ims_item_id + set i 0 + foreach item $same_parent { + if { [string equal [lindex $item 0] $ims_item_id] } { + set next_sort_pos [expr $i + 1] + set back_sort_pos [expr $i + 2] + } + incr i + } + set next_sort [lindex [lindex $same_parent $next_sort_pos] 1] + set down_childs [db_list_of_lists get_down_childs_2 { }] + foreach item $down_childs { + lappend down_items $item + } + set tot_items_down [llength $down_items] + + + # Finish with down, now we are going to so the same for the items that + # are going up + + set back_sort [lindex [lindex $same_parent $back_sort_pos] 1] + if { [empty_string_p $back_sort] } { + # This is the last one of same parent + set next_item [lindex $global_list [expr [lsearch $global_list $parent_item] + 1]] + if { [empty_string_p $next_item] } { + # This is the last one of the course + set back_sort [expr $max_sort_order + 1] + } else { + set back_sort [db_string get_next_sort { }] + } + } + set up_items [list [lindex $same_parent $next_sort_pos]] + set up_childs [db_list_of_lists get_up_childs_2 { }] + foreach item $up_childs { + lappend up_items $item + } + set tot_items_up [llength $up_items] + + # Now that we now how many items will go up and how many will go down + # we make the updates on the tables + + foreach item $up_items { + set ims_item_id [lindex $item 0] + set sort [expr [lindex $item 1] - $tot_items_down] + lors_central::set_sort_order -ims_item_id $ims_item_id -sort_order $sort + } + foreach item $down_items { + set ims_item_id [lindex $item 0] + set sort [expr [lindex $item 1] + $tot_items_up] + lors_central::set_sort_order -ims_item_id $ims_item_id -sort_order $sort + } +} + +ad_returnredirect "one-course?man_id=$man_id" \ No newline at end of file Index: openacs-4/packages/lors-central/www/reorder-items.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/reorder-items.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/reorder-items.xql 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,145 @@ + + + + + + select + man_id + from + ims_cp_organizations + where + org_id = :org_id + + + + + + select + sort_order + from + ims_cp_items + where + ims_item_id = :ims_item_id + + + + + + + select + ims_item_id, sort_order + from + ims_cp_items + where + parent_item = :parent_item + order by sort_order asc + + + + + + select + parent_item + from + ims_cp_items + where + ims_item_id = :ims_item_id + + + + + + select + ims_item_id + from + ims_cp_items + where + parent_item = ( select + parent_item + from + ims_cp_items + where + ims_item_id = :parent_item ) + order by sort_order asc + + + + + + select + ims_item_id, sort_order + from + ims_cp_items + where + sort_order > :item_sort and sort_order < :next_sort + and org_id = :org_id + order by sort_order + + + + + + select + sort_order + from + ims_cp_items + where + ims_item_id = :next_item + and org_id = :org_id + order by sort_order + + + + + + select + max(sort_order) + from + ims_cp_items + where + org_id = :org_id + + + + + + + select + ims_item_id, sort_order + from + ims_cp_items + where + sort_order < :item_sort and sort_order > :back_sort + and org_id = :org_id + order by sort_order + + + + + + select + ims_item_id, sort_order + from + ims_cp_items + where + sort_order > :item_sort and sort_order < :next_sort + and org_id = :org_id + order by sort_order + + + + + + select + ims_item_id, sort_order + from + ims_cp_items + where + sort_order > :next_sort and sort_order < :back_sort + and org_id = :org_id + order by sort_order + + + + + Index: openacs-4/packages/lors-central/www/search.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/search.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/search.adp 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,10 @@ + + @page_title@ + @header_stuff@ + @context@ + @focus@ + + + +
+ Index: openacs-4/packages/lors-central/www/search.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/search.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/search.tcl 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,102 @@ +# + +ad_page_contract { + + Search Learning Objects + + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2005-03-26 + @arch-tag: 79e55eed-608a-449e-b684-5c5d4018fe4f + @cvs-id $Id: search.tcl,v 1.1 2005/05/17 16:21:19 miguelm Exp $ +} { + {q ""} + {extra_q ""} + {offset 0} + {num 0} +} -properties { +} -validate { +} -errors { +} + +set page_title "Search Learning Objects" +set context [list $page_title] +set header_stuff "" +set focus "" + +set package_id [ad_conn package_id] +set user_id [ad_conn user_id] + +permission::require_permission \ + -object_id $package_id \ + -party_id $user_id \ + -privilege "read" + +set grade_range_options [db_list_of_lists glo "select distinct context_v as label, context_v from ims_md_educational_context"] +set grade_range_options [linsert $grade_range_options 0 {"--" ""}] +set subject_area_options [db_list_of_lists so "select distinct entry_s as label, entry_s from ims_md_general_cata where catalog = 'PBS-SubjectArea'"] +set subject_area_options [linsert $subject_area_options 0 {"--" ""}] +ad_form -name search -method GET -form { + {q:text(text) + {label "Enter Search Terms"} + {html {id search-textbox}}} + {search:text(submit) {label "Search"}} + {grade_range:text(select),optional + {label "Grade Range"} + {options $grade_range_options}} + {subject_area:text(select),optional + {label "Subject Area"} + {options $subject_area_options}} + + +} -on_submit { + +append extra_q " object_type:ims_resource_object" +if {[exists_and_not_null grade_range]} { + append extra_q " grade_range:${grade_range} " +} +if {[exists_and_not_null subject_area]} { + append extra_q " subject_area:${subject_area} " +} +} + +# if {[info exists q] && ![string equal "" $q]} { +# set search 1 +# } else { +# set search 0 +# } + +# set filters {search {values {0 1} where_clause_eval { +# if {$search} { +# array set result [acs_sc_call FtsEngineDriver search [list [string tolower $q] 0 10 $user_id "" ""] "tsearch2-driver"] +# if {![info exists result(ids)]} { +# # search is not working, ignore search terms +# set where " 1=1 " +# } elseif {[llength $result(ids)] >0} { +# set result_ids $result(ids) +# set where " object_id in ([template::util::tcl_to_sql_list $result_ids])" +# } else { +# subst {1=0} +# } +# } else { +# subst {1=0} +# } +# } } } + +# # search results (with checkboxes for clipboard) +# template::list::create \ +# -name results \ +# -multirow results \ +# -elements { +# title { label "title" link_url_col url } +# } \ +# -filters ${filters} + +# # TODO use search to generate multirow, otherwise we have issues with +# # ordering if we try to put the ids into a IN clause + +# db_multirow -extend {url} results get_results "select object_id, coalesce ('Untitled',title) as title from acs_objects where [template::list::filter_where_clauses -name results]" { +# set url "/o/${object_id}" +# } + +ad_return_template + Index: openacs-4/packages/lors-central/www/shared.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/shared.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/shared.tcl 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,29 @@ +ad_page_contract { + Changes one ims_items isshared field + @author Miguel Marin (miguelmarin@viaro.net) + @author Viaro Networks www.viaro.net +} { + man_id:notnull + ims_item_id:notnull + {name ""} + shared:notnull + org_id:notnull +} + +# Checking swa privilege over lors-central +lors_central::is_swa + +if { $shared } { + set isshared f +} else { + set isshared t +} + +db_dml update_isshared { + update ims_cp_items + set isshared = :isshared + where ims_item_id = :ims_item_id + and org_id = :org_id +} + +ad_returnredirect "one-learning-object?man_id=$man_id&name=$name&ims_item_id=$ims_item_id" \ No newline at end of file Index: openacs-4/packages/lors-central/www/tracker.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/tracker.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/tracker.adp 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,7 @@ + + @title@ + @context@ + + + + Index: openacs-4/packages/lors-central/www/tracker.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/tracker.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/tracker.tcl 17 May 2005 16:21:19 -0000 1.1 @@ -0,0 +1,80 @@ +# 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 + @cvs-id $Id: tracker.tcl,v 1.1 2005/05/17 16:21:19 miguelm Exp $ +} { + man_id:integer,notnull + community_id:integer,notnull +} -properties { +} -validate { +} -errors { +} + +# Checking swa privilege over lors-central +lors_central::is_swa + +set lorsm_instance_id [db_string get_lorsm_instance_id { + select lorsm_instance_id from ims_cp_manifest_class where man_id = :man_id and community_id = :community_id +} -default 0] + +set package_id $lorsm_instance_id + +if { [string equal $package_id "0"] } { + ad_return_complaint 1 "[_ lors-central.you_have_to]" + ad_script_abort +} + +set title "[_ lorsm.lt_Set_Course_Track_Opti]" +set context [list [list "one-course-associations?man_id=$man_id" \ + "[_ lors-central.one_course_assoc]"] "[_ lorsm.Set_Course_Options]"] + +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]"} + } + {lorsm_instance_id:text(hidden) + {value $lorsm_instance_id} + } + {community_id:text(hidden) + {value $community_id} + } + {enable:text(radio) + {label Status?} + {options {{"[_ lorsm.Trackable_1]" t} {"[_ lorsm.No_Thanks]" f}}} + } + } -select_query { + 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 + } -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" + } -after_submit { + ad_returnredirect "one-course-associations?man_id=$man_id" + ad_script_abort + } + + + + + Index: openacs-4/packages/lors-central/www/download/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/download/index.vuh,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/download/index.vuh 17 May 2005 16:21:20 -0000 1.1 @@ -0,0 +1,27 @@ + ad_page_contract { + + Virtual URL handler for file downloads + + @author Kevin Scaldeferri (kevin@arsdigita.com) + @author Don Baccus (simplified it by using cr utility) + @creation-date 18 December 2000 + @cvs-id $Id: index.vuh,v 1.1 2005/05/17 16:21:20 miguelm Exp $ +} { + file_id:integer,optional + version_id:integer,optional +} + +if {![exists_and_not_null version_id]} { + set version_id [item::get_live_revision $file_id] +} + +set user_id [ad_conn user_id] + + +#ad_require_permission $version_id "read" + +cr_write_content -revision_id $version_id + + + + Index: openacs-4/packages/lors-central/www/download/preview.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/download/preview.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/download/preview.adp 17 May 2005 16:21:20 -0000 1.1 @@ -0,0 +1 @@ +@preview;noquote@ \ No newline at end of file Index: openacs-4/packages/lors-central/www/download/preview.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/download/preview.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/download/preview.tcl 17 May 2005 16:21:20 -0000 1.1 @@ -0,0 +1,21 @@ +ad_page_contract { + + URL handler for file preview + +} { + file_id:integer,optional + version_id:integer,optional +} + +# DAVEB file_id is version_id now +set version_id $file_id +#if {![exists_and_not_null version_id]} { +# set version_id [item::get_live_revision $file_id] +#} + +set preview [cr_write_content -string -revision_id $version_id] + + + + + Index: openacs-4/packages/lors-central/www/export/create-zip.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/export/create-zip.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/export/create-zip.tcl 17 May 2005 16:21:20 -0000 1.1 @@ -0,0 +1,254 @@ +ad_page_contract { + Export one course in IMS type + @author Miguel Marin (miguelmarin@viaro.net) + @author Viaro Networks www.viaro.net +} { + man_id:notnull + folder_id:notnull +} + +set content_folder_id $folder_id +set user_id [ad_conn user_id] +set course_man_id $man_id +# - - - - - - - - - - - - - - - - - - - +# We open a new file to write to it +# - - - - - - - - - - - - - - - - - - - + +set fid [open "/tmp/gimsmanifest.xml" w] + +set line "" +puts $fid $line + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Now we are going to check if it has a metadata to insert that on the xml also +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +if { $hasmetadata } { + puts $fid "" + puts $fid "" + db_1row get_metadata_info { } + puts $fid " $schema" + puts $fid " $schemaversion" + puts $fid " " + puts $fid " " + puts $fid " " + puts $fid " <langstring xml:lang=\"$title_l\">$title_s</langstring>" + puts $fid " " + puts $fid " " + puts $fid " $descrip_s" + puts $fid " " + puts $fid " " + puts $fid " " + puts $fid "" +} + +# - - - - - - - - - - - - - - - - - - - - - +# We are goint to get all organizations +# - - - - - - - - - - - - - - - - - - - - - + +puts $fid "" +db_foreach get_organizations { } { + puts $fid " " + + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + # We need to get all items and arrange them at the proper order to get + # parent son relation reflected on test.xml + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + set i 0 + set all_items [lors_central::export::get_items_xml -org_id $org_id] + foreach item $all_items { + set ims_item_id [lindex $item 0] + set level [lindex $item 1] + set indent "" + for {set j 0 } { $j <= $level } {incr j} { + append indent " " + } + db_1row get_item_info { } + + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + # We add the res_id to the identifierref to avoid names conflicts since resources added + # from other courses could have the same name. + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + puts $fid "$indent" + puts $fid "$indent$item_title" + set next_level [lindex [lindex $all_items [expr $i + 1]] 1] + if { [empty_string_p $next_level] } { + set next_level 1 + } + if { [string equal $next_level $level] } { + puts $fid "$indent" + } + if { $next_level < $level } { + puts $fid "$indent" + for { set j 0 } { $j < [expr $level - $next_level] } { incr j } { + puts $fid "$indent" + } + } + incr i + } + puts $fid "" + +} +puts $fid "" + + +# - - - - - - - - - - - - - - - - - - +# Here we get all the resources +# - - - - - - - - - - - - - - - - - - +set orgs_list "(" +db_foreach get_organizations { } { + append orgs_list "$org_id," + puts $fid "" + db_foreach get_resources { } { + + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + # We add the res_id to the identifier to avoid names conflicts since resources added + # from other courses could have the same name. + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + set line "" + puts $fid $line + db_foreach get_files { } { + puts $fid "" + } + } else { + append line ">" + puts $fid $line + } + puts $fid "" + } + puts $fid "" +} +append orgs_list "0)" + +# - - - - - - - - - - - - +# Now we close the file +# - - - - - - - - - - - - + +puts $fid "" +close $fid + + +# - - - - - - - - - - - +# Creating zip file +# - - - - - - - - - - - + + +# publish the object to the file system +set in_path [ns_tmpnam] +exec mkdir $in_path + +set file [lors_central::export::publish_object_to_file_system -object_id $content_folder_id -path $in_path -user_id $user_id] +set file_name [file tail $file] + +set download_name "${file_name}.zip" + +# - - - - - - - - - - - - - - - - - - - - - - - - +# We get rid of spaces since they are annoying +# - - - - - - - - - - - - - - - - - - - - - - - - +regsub -all { } $download_name {_} download_name + +# - - - - - - - - - - - - - - - - - - - - +# Create a temp dir to put the archive in +# - - - - - - - - - - - - - - - - - - - - +set out_path [ns_tmpnam] +file mkdir $out_path +set out_file [file join ${out_path} ${download_name}] + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# We need to copy all files related to all resources that are not present on this folder +# This are the one that are on a different course +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +set extra_resources [db_list_of_lists get_other_resources { }] + +foreach res $extra_resources { + set path [db_string get_href { } ] + set split_path [split $path "/"] + if { [llength $split_path] <= 1 } { + # - - - - - - - - - - - - - - - + # It just a file, copy the file + # - - - - - - - - - - - - - - - + set file_id [db_string get_file { } -default ""] + if { ![empty_string_p $file_id] } { + set filename [db_string get_filename { } -default ""] + } + set object_id [lors_central::get_item_id -revision_id $file_id] + lors_central::export::publish_versioned_object_to_file_system -object_id $object_id \ + -path "$file" -file_name $filename + } else { + # - - - - - - - - - - - - - - - - - - - - - - + # Is a folder, we need to create the folder + # - - - - - - - - - - - - - - - - - - - - - - + if { ![empty_string_p [lindex $split_path 0]] } { + set folder_path [lindex $split_path 0] + set file_path [lindex $split_path 1] + } else { + set folder_path [lindex $split_path 1] + set file_path [lindex $split_path 2] + } + with_catch errmsg { + exec bash -c "cd '$file'; mkdir $folder_path;" + } { + # We don't need to create this folder since already exists + } + db_foreach get_resource_files { } { + # - - - - - - - - + # Copy all files + # - - - - - - - - + set object_id [lors_central::get_item_id -revision_id $file_id] + lors_central::export::publish_versioned_object_to_file_system -object_id $object_id \ + -path "$file/$folder_path" -file_name $filename + } if_no_rows { + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + # This is a file that it's not present on ims_cp_files table ( URL ) + # We need to get it from the folder directly, using res_id to get + # man id to get the folder where the file is present + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + set root_folder [lors_central::get_root_folder_id] + set man_id [db_string get_man_id { }] + set name [lors_central::get_course_name -man_id $man_id] + set content_folder [db_string get_content_folder { select item_id from cr_items where parent_id = :root_folder and name = :name }] + set folder_id [db_string get_folder_id { select item_id from cr_items where parent_id = :content_folder and name = :folder_path }] + set url_file_id [db_string get_url_file_id { select item_id from cr_items where parent_id = :folder_id and name = :file_path} ] + lors_central::export::publish_versioned_object_to_file_system -object_id $url_file_id \ + -path "$file/$folder_path" -file_name $file_path + } + } +} + + +set cmd "zip -r '$out_file' *" +set copy "cp /tmp/gimsmanifest.xml ./imsmanifest.xml" + +# - - - - - - - - - - +# create the archive +# - - - - - - - - - - +with_catch errmsg { + exec bash -c "cd '$file'; $copy; $cmd; cd -" +} { + # some day we'll do something useful here + error $errmsg +} + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# redirect the archive to index.vuh to be returned to the connection. +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +ad_returnredirect ".$out_file" + + + +# - - - - - - - - - - - - - - - - - - - +# Removing temporary files and folders +# - - - - - - - - - - - - - - - - - - - + +exec rm -fr $in_path +exec rm -fr $out_path +exec rm -fr "tmp/gimsmanifest.xml" + + Index: openacs-4/packages/lors-central/www/export/create-zip.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/export/create-zip.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/export/create-zip.xql 17 May 2005 16:21:20 -0000 1.1 @@ -0,0 +1,187 @@ + + + + + + select + distinct res_id + from + ims_cp_items_to_resources + where + res_id in ( + select + res_id + from + ims_cp_items_to_resources + where + ims_item_id in ( + select + ims_item_id + from + ims_cp_items + where + org_id in $orgs_list + ) + ) + and res_id not in ( + select + res_id + from + ims_cp_resources + where + man_id = :course_man_id + ) + + + + + + + select + md.schema, + md.schemaversion, + mdgt.title_l, + mdgt.title_s, + mdgd.descrip_l, + mdgd.descrip_s + from + ims_md md, + ims_md_general_title mdgt, + ims_md_general_desc mdgd + where + md.ims_md_id = mdgd.ims_md_id and + mdgd.ims_md_id = mdgt.ims_md_id and + md.ims_md_id = :man_id + + + + + + + select + * + from + ims_cp_manifests + where + man_id = :man_id + + + + + + select + * + from + ims_cp_organizations + where + man_id = :man_id + order by org_id + + + + + + select + r.* + from + ims_cp_resources r, + ims_cp_items_to_resources ir + where + r.res_id = ir.res_id + and ir.ims_item_id in ( + select + ims_item_id + from + ims_cp_items + where + org_id = :org_id + ) + order by res_id + + + + + + select + file_id, + filename + from + ims_cp_files + where + res_id = :res + + + + + + select + * + from + ims_cp_files + where + res_id = :res_id + order by file_id + + + + + + select + i.identifier, + i.identifierref, + i.item_title, + ir.res_id as item_res_id + from + ims_cp_items i, ims_cp_items_to_resources ir + where + i.ims_item_id = ir.ims_item_id and + i.ims_item_id = :ims_item_id + + + + + + + select + href + from + ims_cp_resources + where + res_id = :res + + + + + + select + file_id + from + ims_cp_files + where + res_id = :res + + + + + + select + filename + from + ims_cp_files + where + file_id = :file_id + + + + + + select + man_id + from + ims_cp_resources + where + res_id = :res + + + + \ No newline at end of file Index: openacs-4/packages/lors-central/www/export/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/export/index.vuh,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/export/index.vuh 17 May 2005 16:21:20 -0000 1.1 @@ -0,0 +1,15 @@ +# packages/lors-central/www/export/index.vuh + +ad_page_contract { + Just to get the propper file name to return to the user + from the server + + @author Miguel Marin (miguelmarin@viaro.net) + @author Viaro Networks www.viaro.net +} + + +set download_name [ad_conn path_info] + +ns_returnfile 200 application/octet-stream "/$download_name" + Index: openacs-4/packages/lors-central/www/images/down.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/images/down.gif,v diff -u Binary files differ Index: openacs-4/packages/lors-central/www/images/file.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/images/file.gif,v diff -u Binary files differ Index: openacs-4/packages/lors-central/www/images/folder.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/images/folder.gif,v diff -u Binary files differ Index: openacs-4/packages/lors-central/www/images/live.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/images/live.gif,v diff -u Binary files differ Index: openacs-4/packages/lors-central/www/images/up.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/images/up.gif,v diff -u Binary files differ Index: openacs-4/packages/lors-central/www/lib/md-record-pbs.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/lib/md-record-pbs.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/lib/md-record-pbs.adp 17 May 2005 16:21:21 -0000 1.1 @@ -0,0 +1 @@ + \ No newline at end of file Index: openacs-4/packages/lors-central/www/lib/md-record-pbs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/lib/md-record-pbs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/lib/md-record-pbs.tcl 17 May 2005 16:21:21 -0000 1.1 @@ -0,0 +1,48 @@ + +template::list::create \ + -name d_pres \ + -multirow d_pres \ + -no_data "-" \ + -html {width 80%} \ + -elements { + object_type { + label "[_ lorsm.Object_Type]" + } + schema_and_version { + label "[_ lorsm.lt_MD_Schema_and_Version]" + html { align center } + } + 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 +} + +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 + +} { + set schema_and_version [concat $schema " " $schemaversion] +} + Index: openacs-4/packages/lors-central/www/lib/md-record.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/lib/md-record.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/lib/md-record.adp 17 May 2005 16:21:21 -0000 1.1 @@ -0,0 +1 @@ + \ No newline at end of file Index: openacs-4/packages/lors-central/www/lib/md-record.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/lib/md-record.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/lib/md-record.tcl 17 May 2005 16:21:21 -0000 1.1 @@ -0,0 +1,61 @@ +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]" + + +# Presentation +template::list::create \ + -name d_pres \ + -multirow d_pres \ + -no_data "-" \ + -actions $actions \ + -elements { + object_type { + label "[_ lorsm.Object_Type]" + } + schema_and_version { + label "[_ lorsm.lt_MD_Schema_and_Version]" + html { align center } + } + 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 +} + +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 + +} { + set schema_and_version [concat $schema " " $schemaversion] +} + Index: openacs-4/packages/lors-central/www/lib/repository-shared-courses.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/lib/repository-shared-courses.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/lib/repository-shared-courses.adp 17 May 2005 16:21:21 -0000 1.1 @@ -0,0 +1,3 @@ + + + Index: openacs-4/packages/lors-central/www/lib/repository-shared-courses.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/lib/repository-shared-courses.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/lib/repository-shared-courses.tcl 17 May 2005 16:21:21 -0000 1.1 @@ -0,0 +1,99 @@ +# 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: repository-shared-courses.tcl,v 1.1 2005/05/17 16:21:21 miguelm Exp $ +} { + +} -properties { +} -validate { +} -errors { +} + + +set title "[_ lorsm.Shared_Courses]" +set context [list "[_ lorsm.Shared_Courses]"] + +set package_id [ad_conn package_id] +set community_id [dotlrn_community::get_community_id] + +set admin_p [dotlrn::user_can_admin_community_p \ + -user_id [ad_conn user_id] \ + -community_id $community_id ] + +set com_url [dotlrn_community::get_community_url $community_id] + +template::list::create \ + -name d_courses \ + -multirow d_courses \ + -html {width 50%} \ + -key man_id \ + -no_data "[_ lorsm.No_Courses]" \ + -elements { + course_name { + label "[_ lorsm.Available_Courses]" + display_col course_name + link_url_eval {[export_vars -base $community_url/lorsm/shared/course-info {man_id fs_package_id folder_id}]} + link_html {title "[_ lorsm.Access_Course]"} + + } + 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 { + label "[_ lorsm.Owner]" + display_eval {[person::name -person_id $creation_user]} + link_url_eval {[acs_community_member_url -user_id $creation_user]} + } + creation_date { + label "[_ lorsm.Creation_Date]" + display_eval {[lc_time_fmt $creation_date "%x %X"]} + } + admin { + label "[_ lorsm.Course_Info]" + display_eval {Info/View} + link_url_eval {[export_vars -base $community_url/lorsm/shared/course-info man_id]} + link_html {title "[_ lorsm.Info]" class button} + html { align center } + } + } + + +db_multirow -extend { ims_md_id community_url } d_courses select_d_courses { + select + cp.man_id, + cp.course_name, + cp.identifier, + cp.version, + case + when hasmetadata = 't' then 'Yes' + else 'No' + 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' ) + order by acs.creation_date desc +} { + set ims_md_id $man_id + set community_url $com_url +} + Index: openacs-4/packages/lors-central/www/md/addmd.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/addmd.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/addmd.adp 17 May 2005 16:21:21 -0000 1.1 @@ -0,0 +1,31 @@ + +@title;noquote@ +@context;noquote@ + +

MD Schema

+
+ + + + + + + + +
Metadata Schema
+
+

+ +

Add Metadata Schema

+
+ + + + + + + +
Object: @object_type@
+ Add details for the metadata schema and version. +
+
Index: openacs-4/packages/lors-central/www/md/addmd.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/addmd.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/addmd.tcl 17 May 2005 16:21:21 -0000 1.1 @@ -0,0 +1,135 @@ +# 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 + @arch-tag: 28b76527-a05f-42cf-b562-37c7b85e799f + @cvs-id $Id: addmd.tcl,v 1.1 2005/05/17 16:21:21 miguelm Exp $ +} { + ims_md_id:integer +} -properties { +} -validate { +} -errors { +} + +# Get object information +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 title "[_ lorsm.lt_AddEdit_MD_Schema_and]" + + +# Form +ad_form -name add_md \ + -cancel_url ".." \ + -mode edit \ + -form { + + {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]"} + } + + {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 + } + + } + + # If the object_type is on any of the IMS CP object types, + # then we update also the ims cp tables accordingly. + + switch $object_type { + + "ims_manifest" { + + db_dml upd_manifest " + update ims_cp_manifests set hasmetadata = 't' + where man_id = :ims_md_id" + } + "ims_item" { + + db_dml upd_item " + update ims_cp_items set hasmetadata = 't' + where item_id = :ims_md_id" + } + "ims_organization" { + + db_dml upd_organization " + update ims_cp_organizations set hasmetadata = 't' + where org_id = :ims_md_id" + } + "ims_resource" { + + 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 +} + +# 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 { + label "[_ lorsm.Schema_1]" + html { align center } + } + schemaversion { + label "[_ lorsm.Version_1]" + html { align center } + } + } + + 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/lors-central/www/md/annotationmd.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/annotationmd.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/annotationmd.adp 17 May 2005 16:21:21 -0000 1.1 @@ -0,0 +1,16 @@ + +@title;noquote@ +@context;noquote@ + + + + + + + + + + + +
Annotation Metadata
Annotations:
Index: openacs-4/packages/lors-central/www/md/annotationmd.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/annotationmd.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/annotationmd.tcl 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,45 @@ +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 + @cvs-id $Id: annotationmd.tcl,v 1.1 2005/05/17 16:21:22 miguelm Exp $ + +} { + ims_md_id:integer +} + +# set context & title +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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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_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 +} Index: openacs-4/packages/lors-central/www/md/classificationmd.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/classificationmd.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/classificationmd.adp 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,16 @@ + +@title;noquote@ +@context;noquote@ + + + + + + + + + + + +
Classification Metadata
Classifications:
Index: openacs-4/packages/lors-central/www/md/classificationmd.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/classificationmd.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/classificationmd.tcl 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,49 @@ +ad_page_contract { + Displays/Adds IMS Metadata Classification + + @author Gerard Low (glow5809@mail.usyd.edu.au) + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 16 October 2004 + @cvs-id $Id: classificationmd.tcl,v 1.1 2005/05/17 16:21:22 miguelm Exp $ + +} { + ims_md_id:integer +} + +# set context & title +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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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_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 +} Index: openacs-4/packages/lors-central/www/md/educationalmd.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd.adp 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,69 @@ + +@title;noquote@ +@context;noquote@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#lorsm.Educational_Metadata#
#lorsm.Interactivity_Type#
#lorsm.lt_Learning_Resource_Typ#
#lorsm.Interactivity_Level#
#lorsm.Semantic_Density#
#lorsm.lt_Intended_End_User_Rol#
#lorsm.Context#
#lorsm.Typical_Age_Range#
#lorsm.Difficulty#
#lorsm.lt_Typical_Learning_Time#
#lorsm.Description#
#lorsm.Language#
+ Index: openacs-4/packages/lors-central/www/md/educationalmd.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd.tcl 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,260 @@ +ad_page_contract { + Displays/Adds IMS Metadata Educational + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 30 January 2004 + @cvs-id $Id: educationalmd.tcl,v 1.1 2005/05/17 16:21:22 miguelm Exp $ + +} { + ims_md_id:integer +} + +# set context & title +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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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_]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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_]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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_]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + language { + label "" + } + } + +db_multirow d_ed_lang select_ed_lang { + select + language + from + ims_md_educational_lang + where + ims_md_id = :ims_md_id +} Index: openacs-4/packages/lors-central/www/md/generalmd.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/generalmd.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/generalmd.adp 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,53 @@ + +@title;noquote@ +@context;noquote@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#lorsm.General_Metadata#
#lorsm.Titles#
#lorsm.Catalog-Entries#
#lorsm.Languages#
#lorsm.Descriptions#
#lorsm.Keywords#
#lorsm.Coverage#
#lorsm.Structure#
#lorsm.Aggregation_Level#
+ Index: openacs-4/packages/lors-central/www/md/generalmd.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/generalmd.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/generalmd.tcl 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,227 @@ +# packages/lorsm/www/md/generalmd.tcl + +ad_page_contract { + Displays/Adds IMS Metadata General + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 19 January 2004 + @cvs-id $Id: generalmd.tcl,v 1.1 2005/05/17 16:21:22 miguelm Exp $ + +} { + ims_md_id:integer +} + +# set context & title +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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} { + set item_url [export_vars -base "item" { ims_md_id }] +} + +# General Description +template::list::create \ + -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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + + + +# General Language +template::list::create \ + -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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + language { + label "" + } + } + +db_multirow d_gen_lang select_ge_lang { + 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + + +# General Aggregation level +template::list::create \ + -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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} Index: openacs-4/packages/lors-central/www/md/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/index.adp 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,27 @@ + +@title;noquote@ +@context;noquote@ + + + + + +

+ + #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_No_metadata_record_ex# + +

+
+ + Index: openacs-4/packages/lors-central/www/md/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/index.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/index.tcl 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,21 @@ +ad_page_contract { + Displays/Adds IMS Metadata + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 19 January 2004 + @cvs-id $Id: index.tcl,v 1.1 2005/05/17 16:21:22 miguelm Exp $ + +} { + ims_md_id:integer +} + +# set context +set context [list "[_ lorsm.IMS_Metadata_Editor]"] +set title [list "[_ lorsm.IMS_Metadata_Editor]"] +set link [export_vars -base "md_upload" ims_md_id] + +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] Index: openacs-4/packages/lors-central/www/md/lifecyclemd.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/lifecyclemd.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/lifecyclemd.adp 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + + + + + + + + + + + + + + + + + + + + + +
#lorsm.Lifecycle_Metadata#
#lorsm.Version#
#lorsm.Status#
#lorsm.Contribution#
+ Index: openacs-4/packages/lors-central/www/md/lifecyclemd.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/lifecyclemd.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/lifecyclemd.tcl 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,103 @@ +ad_page_contract { + Displays/Adds IMS Metadata Lifecycle + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 30 January 2004 + @cvs-id $Id: lifecyclemd.tcl,v 1.1 2005/05/17 16:21:22 miguelm Exp $ + +} { + ims_md_id:integer +} + +# set context & title +set context [list [list [export_vars -base "." ims_md_id] "IMS Metadata Editor"] "Lifecycle MD"] + +set title "Lifecycle MD" + +# Lifecycle version +template::list::create \ + -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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + + +# 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]"] \ + -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]" + } + } + +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 +} Index: openacs-4/packages/lors-central/www/md/metamd.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/metamd.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/metamd.adp 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,34 @@ + +@title;noquote@ +@context;noquote@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#lorsm.Meta_Metadata#
#lorsm.Catalog-Entries#
#lorsm.Contribution#
#lorsm.Scheme#
#lorsm.Language#
+ + Index: openacs-4/packages/lors-central/www/md/metamd.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/metamd.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/metamd.tcl 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,122 @@ +ad_page_contract { + Displays/Adds IMS Metadata Metametadata + + @author Ernie Ghiglione (ErnieG@ee.usyd.edu.au) + @creation-date 30 January 2004 + @cvs-id $Id: metamd.tcl,v 1.1 2005/05/17 16:21:22 miguelm Exp $ + +} { + ims_md_id:integer +} + +# set context & title +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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + + +# 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]"] \ + -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]" + } + } + +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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + scheme { + label "" + } + } + +db_multirow d_md_scheme select_md_scheme { + 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + language { + label "" + } + } + +db_multirow d_md_lang select_md_lang { + select + language + from + ims_md_metadata + where + ims_md_id = :ims_md_id +} Index: openacs-4/packages/lors-central/www/md/relationmd.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/relationmd.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/relationmd.adp 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,17 @@ + +@title;noquote@ +@context;noquote@ + + + + + + + + + + + +
#lorsm.Relation_Metadata#
#lorsm.Relations#
+ Index: openacs-4/packages/lors-central/www/md/relationmd.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/relationmd.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/relationmd.tcl 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,53 @@ +ad_page_contract { + Displays/Adds IMS Metadata Relation + + @author Gerard Low (glow5809@mail.usyd.edu.au) + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 16 October 2004 + @cvs-id $Id: relationmd.tcl,v 1.1 2005/05/17 16:21:22 miguelm Exp $ + +} { + ims_md_id:integer +} + +# set context & title +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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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_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 +} Index: openacs-4/packages/lors-central/www/md/rightsmd.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/rightsmd.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/rightsmd.adp 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,28 @@ + +@title;noquote@ +@context;noquote@ + + + + + + + + + + + + + + + + + + + + + + + +
#lorsm.Rights_Metadata#
#lorsm.Cost#
#lorsm.lt_Copyright_or_other_Re#
#lorsm.Description#
Index: openacs-4/packages/lors-central/www/md/rightsmd.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/rightsmd.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/rightsmd.tcl 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,80 @@ +ad_page_contract { + Displays/Adds IMS Metadata Rights + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 30 January 2004 + @cvs-id $Id: rightsmd.tcl,v 1.1 2005/05/17 16:21:22 miguelm Exp $ + +} { + ims_md_id:integer +} + +# set context & title +set context [list [list [export_vars -base "." ims_md_id] "IMS Metadata Editor"] "Rights MD"] +set title "[_ lorsm.Rights_MD]" + +# Rights Cost +template::list::create \ + -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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} Index: openacs-4/packages/lors-central/www/md/technicalmd.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/technicalmd.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/technicalmd.adp 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,49 @@ + +@title;noquote@ +@context;noquote@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#lorsm.Technical_Metadata#
#lorsm.Formats#
#lorsm.Size#
#lorsm.Locations#
#lorsm.Requirements#
#lorsm.Installation_Remarks#
#lorsm.lt_Other_Platform_Requir#
#lorsm.Duration#
+ Index: openacs-4/packages/lors-central/www/md/technicalmd.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/technicalmd.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/technicalmd.tcl 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,192 @@ +ad_page_contract { + Displays/Adds IMS Metadata Metametadata + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 30 January 2004 + @cvs-id $Id: technicalmd.tcl,v 1.1 2005/05/17 16:21:22 miguelm Exp $ + +} { + ims_md_id:integer +} + +# set context & title +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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + format { + label "" + } + } + +db_multirow d_te_form select_te_form { + 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -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]" + } + } + +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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} Index: openacs-4/packages/lors-central/www/md/annotationmd/annotation.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/annotationmd/annotation.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/annotationmd/annotation.adp 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,28 @@ + +@title;noquote@ +@context;noquote@ + + + + + + + + + + + + + + + + + + + + + + + +
Annotation Metadata
Entity:
Date:
Descriptions:
Index: openacs-4/packages/lors-central/www/md/annotationmd/annotation.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/annotationmd/annotation.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/annotationmd/annotation.tcl 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,84 @@ +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 + @cvs-id $Id: annotation.tcl,v 1.1 2005/05/17 16:21:22 miguelm Exp $ + +} { + ims_md_an_id:integer + ims_md_id:integer +} + +# 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 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} Index: openacs-4/packages/lors-central/www/md/annotationmd/annotation_add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/annotationmd/annotation_add.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/annotationmd/annotation_add.adp 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,22 @@ + +@title;noquote@ +@context;noquote@ + + + +

Annotation Metadata Entry

+
+ + + + + + + + + + +
Annotation Metadata
Add another Annotation Metadata Entry?
+
Index: openacs-4/packages/lors-central/www/md/annotationmd/annotation_add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/annotationmd/annotation_add.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/annotationmd/annotation_add.tcl 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,43 @@ +# 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 + @cvs-id $Id: annotation_add.tcl,v 1.1 2005/05/17 16:21:22 miguelm Exp $ + +} { + ims_md_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_Add_Annotation_MD_Ent]" + +# Form +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} + } + +} -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}] + ad_script_abort +} + Index: openacs-4/packages/lors-central/www/md/annotationmd/annotation_date.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/annotationmd/annotation_date.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/annotationmd/annotation_date.adp 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Annotation Metadata Date

+
+ + + + + + + + + +
Annotation Metadata
Date:
+
+

+ +

Add/Edit Annotation Metadata Date

+
+ +
Index: openacs-4/packages/lors-central/www/md/annotationmd/annotation_date.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/annotationmd/annotation_date.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/annotationmd/annotation_date.tcl 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,95 @@ +# 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 + @cvs-id $Id: annotation_date.tcl,v 1.1 2005/05/17 16:21:22 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_an_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_Edit_Annotation_MD_Da]" + + +# Form + +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) + + {date:text,nospell + {section "[_ lorsm.lt_AddEdit_Annotation_MD_2]"} + {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_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} + } + +} -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 + where ims_md_an_id = :ims_md_an_id " + +} -after_submit { + ad_returnredirect [export_vars -base "annotation" {ims_md_an_id ims_md_id}] + ad_script_abort +} + +# Annotation Date +template::list::create \ + -name d_an_date \ + -multirow d_an_date \ + -no_data "[_ lorsm.No_Date_Available]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} Index: openacs-4/packages/lors-central/www/md/annotationmd/annotation_desc.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/annotationmd/annotation_desc.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/annotationmd/annotation_desc.adp 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Annotation Metadata Description

+
+ + + + + + + + + +
Annotation Metadata
Description:
+
+

+ +

Add/Edit Annotation Metadata Description

+
+ +
Index: openacs-4/packages/lors-central/www/md/annotationmd/annotation_desc.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/annotationmd/annotation_desc.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/annotationmd/annotation_desc.tcl 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,109 @@ +# 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 + @cvs-id $Id: annotation_desc.tcl,v 1.1 2005/05/17 16:21:22 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_an_id:integer + ims_md_an_de_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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 title "[_ lorsm.lt_Add_Annotation_MD_Des]" +} + +# Form + +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) + + {descrip_l:text,nospell + {section "[_ lorsm.lt_AddEdit_Annotation_MD]"} + {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]"} + } + + {ims_md_id:text(hidden) {value $ims_md_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 + +} -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)" + +} -after_submit { + ad_returnredirect [export_vars -base "annotation" {ims_md_an_id ims_md_id}] + ad_script_abort +} + +# Annotation Description +template::list::create \ + -name d_an_desc \ + -multirow d_an_desc \ + -no_data "No Description Available" \ + -html { align right style "width: 100%;" } \ + -elements { + 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_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 +} Index: openacs-4/packages/lors-central/www/md/annotationmd/annotation_ent.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/annotationmd/annotation_ent.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/annotationmd/annotation_ent.adp 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Annotation Metadata Entity

+
+ + + + + + + + + +
Annotation Metadata
Entity:
+
+

+ +

Add/Edit Annotation Metadata Entity

+
+ +
Index: openacs-4/packages/lors-central/www/md/annotationmd/annotation_ent.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/annotationmd/annotation_ent.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/annotationmd/annotation_ent.tcl 17 May 2005 16:21:22 -0000 1.1 @@ -0,0 +1,78 @@ +# 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 + @cvs-id $Id: annotation_ent.tcl,v 1.1 2005/05/17 16:21:22 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_an_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_Edit_Annotation_MD_En]" + + +# Form + +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) + + {entity:text(textarea),nospell + {section "[_ lorsm.lt_AddEdit_Annotation_MD_1]"} + {html {rows 5 cols 50}} + {help_text "[_ lorsm.Annotator]"} + {label "[_ lorsm.Entity]"} + } + + {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 + +} -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}] + ad_script_abort +} + +# Annotation Entity +template::list::create \ + -name d_an_ent \ + -multirow d_an_ent \ + -no_data "[_ lorsm.No_Entity_Available]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} Index: openacs-4/packages/lors-central/www/md/classificationmd/classification.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/classificationmd/classification.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/classificationmd/classification.adp 17 May 2005 16:21:23 -0000 1.1 @@ -0,0 +1,28 @@ + +@title;noquote@ +@context;noquote@ + + + + + + + + + + + + + + + + + + + + + + + +
Classification Metadata
Purpose:
Taxonomic Paths:
Descriptions:
Keywords:
Index: openacs-4/packages/lors-central/www/md/classificationmd/classification.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/classificationmd/classification.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/classificationmd/classification.tcl 17 May 2005 16:21:23 -0000 1.1 @@ -0,0 +1,118 @@ +ad_page_contract { + Displays/Adds IMS Metadata Classification + + @author Gerard Low (glow5809@mail.usyd.edu.au) + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 16 October 2004 + @cvs-id $Id: classification.tcl,v 1.1 2005/05/17 16:21:23 miguelm Exp $ + +} { + ims_md_cl_id:integer + ims_md_id:integer +} + +# 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 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 } + } + } + +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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} Index: openacs-4/packages/lors-central/www/md/classificationmd/classification_add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/classificationmd/classification_add.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/classificationmd/classification_add.adp 17 May 2005 16:21:23 -0000 1.1 @@ -0,0 +1,22 @@ + +@title;noquote@ +@context;noquote@ + + + +

Classification Metadata Entry

+
+ + + + + + + + + + +
Classification Metadata
Add another Classification Metadata Entry?
+
Index: openacs-4/packages/lors-central/www/md/classificationmd/classification_add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/classificationmd/classification_add.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/classificationmd/classification_add.tcl 17 May 2005 16:21:23 -0000 1.1 @@ -0,0 +1,41 @@ +# 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 + +} { + ims_md_id:integer +} -properties { +} -validate { +} -errors { +} + +# set context & title +set context [list "[_ lorsm.lt_IMS_Metadata_Editor_-]"] +set title "[_ lorsm.lt_Add_Classification_MD]" + +# Form +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_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) + values (:ims_md_cl_id, :ims_md_id)" + +} -after_submit { + ad_returnredirect [export_vars -base "../classificationmd" {ims_md_id}] + ad_script_abort +} + Index: openacs-4/packages/lors-central/www/md/classificationmd/classification_addpath.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/classificationmd/classification_addpath.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/classificationmd/classification_addpath.adp 17 May 2005 16:21:23 -0000 1.1 @@ -0,0 +1,22 @@ + +@title;noquote@ +@context;noquote@ + + + +

Classification Metadata

+
+ + + + + + + + + + +
Classification Metadata
Add another Classification Metadata Taxonomic Path Entry?
+
Index: openacs-4/packages/lors-central/www/md/classificationmd/classification_addpath.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/classificationmd/classification_addpath.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/classificationmd/classification_addpath.tcl 17 May 2005 16:21:23 -0000 1.1 @@ -0,0 +1,47 @@ +# 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 + @cvs-id $Id: classification_addpath.tcl,v 1.1 2005/05/17 16:21:23 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_cl_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_Add_Classification_MD_1]" + +# Form +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_id:text(hidden) {value $ims_md_cl_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) + 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}] + ad_script_abort +} + Index: openacs-4/packages/lors-central/www/md/classificationmd/classification_desc.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/classificationmd/classification_desc.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/classificationmd/classification_desc.adp 17 May 2005 16:21:23 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Classification Metadata Description

+
+ + + + + + + + + +
Classification Metadata
Descriptions:
+
+

+ +

Add/Edit Classification Metadata Description

+
+ +
Index: openacs-4/packages/lors-central/www/md/classificationmd/classification_desc.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/classificationmd/classification_desc.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/classificationmd/classification_desc.tcl 17 May 2005 16:21:23 -0000 1.1 @@ -0,0 +1,109 @@ +# 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 + @cvs-id $Id: classification_desc.tcl,v 1.1 2005/05/17 16:21:23 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_cl_id:integer + ims_md_cl_de_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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 title "[_ lorsm.lt_Add_Classification_MD_2]" +} + +# Form + +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) + + {descrip_l:text,nospell + {section "[_ lorsm.lt_AddEdit_Classificatio_5]"} + {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]"} + } + + {ims_md_id:text(hidden) {value $ims_md_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 + +} -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)" + +} -after_submit { + ad_returnredirect [export_vars -base "classification" {ims_md_cl_id ims_md_id}] + ad_script_abort +} + +# Classification Description +template::list::create \ + -name d_cl_desc \ + -multirow d_cl_desc \ + -no_data "[_ lorsm.lt_No_Description_Availa]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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}] } + link_html {title "[_ lorsm.Edit_Record]"} + html { align center } + } + } + +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 +} Index: openacs-4/packages/lors-central/www/md/classificationmd/classification_key.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/classificationmd/classification_key.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/classificationmd/classification_key.adp 17 May 2005 16:21:23 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Classification Metadata Keyword

+
+ + + + + + + + + +
Classification Metadata
Keywords:
+
+

+ +

Add/Edit Classification Metadata Keyword

+
+ +
Index: openacs-4/packages/lors-central/www/md/classificationmd/classification_key.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/classificationmd/classification_key.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/classificationmd/classification_key.tcl 17 May 2005 16:21:23 -0000 1.1 @@ -0,0 +1,109 @@ +# 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 + @cvs-id $Id: classification_key.tcl,v 1.1 2005/05/17 16:21:23 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_cl_id:integer + ims_md_cl_ke_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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 title "[_ lorsm.lt_Add_Classification_MD_3]" +} + +# Form + +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) + + {keyword_l:text,nospell + {section "[_ lorsm.lt_AddEdit_Classificatio_6]"} + {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]"} + } + + {ims_md_id:text(hidden) {value $ims_md_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 + +} -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)" + +} -after_submit { + ad_returnredirect [export_vars -base "classification" {ims_md_cl_id ims_md_id}] + ad_script_abort +} + +# Classification Keyword +template::list::create \ + -name d_cl_key \ + -multirow d_cl_key \ + -no_data "[_ lorsm.No_Keyword_Available]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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}] } + link_html {title "[_ lorsm.Edit_Record]"} + html { align center } + } + } + +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 +} Index: openacs-4/packages/lors-central/www/md/classificationmd/classification_pur.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/classificationmd/classification_pur.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/classificationmd/classification_pur.adp 17 May 2005 16:21:23 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Classification Metadata Purpose

+
+ + + + + + + + + +
Classification Metadata
Purpose:
+
+

+ +

Add/Edit Classification Metadata Purpose

+
+ +
Index: openacs-4/packages/lors-central/www/md/classificationmd/classification_pur.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/classificationmd/classification_pur.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/classificationmd/classification_pur.tcl 17 May 2005 16:21:23 -0000 1.1 @@ -0,0 +1,89 @@ +# 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 + @cvs-id $Id: classification_pur.tcl,v 1.1 2005/05/17 16:21:23 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_cl_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_Edit_Classification_M_1]" + + +# Form + +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) + + {purpose_s:text,nospell + {section "[_ lorsm.lt_AddEdit_Classificatio_7]"} + {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]"} + } + + {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 + +} -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}] + ad_script_abort +} + +# Classification Purpose +template::list::create \ + -name d_cl_pur \ + -multirow d_cl_pur \ + -no_data "[_ lorsm.No_Purpose_Available]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} Index: openacs-4/packages/lors-central/www/md/classificationmd/classification_taxon.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/classificationmd/classification_taxon.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/classificationmd/classification_taxon.adp 17 May 2005 16:21:23 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Classification Metadata Taxonomic Path Taxonomy

+
+ + + + + + + + + +
Classification Metadata
Keywords:
+
+

+ +

Add/Edit Classification Metadata Taxonomic Path Taxonomy

+
+ +
Index: openacs-4/packages/lors-central/www/md/classificationmd/classification_taxon.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/classificationmd/classification_taxon.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/classificationmd/classification_taxon.tcl 17 May 2005 16:21:23 -0000 1.1 @@ -0,0 +1,124 @@ +# 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 + @cvs-id $Id: classification_taxon.tcl,v 1.1 2005/05/17 16:21:23 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_cl_id:integer + ims_md_cl_ta_id:integer + ims_md_cl_ta_ta_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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 title "[_ lorsm.lt_Add_Classification_MD_4]" +} + +# Form + +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) + + {identifier:text,nospell + {section "[_ lorsm.lt_AddEdit_Classificatio_8]"} + {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_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_cl_id:text(hidden) {value $ims_md_cl_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 + +} -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)" + +} -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 \ + -name d_cl_taxon \ + -multirow d_cl_taxon \ + -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 } + } + } + +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 +} Index: openacs-4/packages/lors-central/www/md/classificationmd/classification_tpath.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/classificationmd/classification_tpath.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/classificationmd/classification_tpath.adp 17 May 2005 16:21:23 -0000 1.1 @@ -0,0 +1,20 @@ + +@title;noquote@ +@context;noquote@ + + + + + + + + + + + + + + + +
Classification Metadata Taxonomic Path
Source:
Taxonomies:
Index: openacs-4/packages/lors-central/www/md/classificationmd/classification_tpath.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/classificationmd/classification_tpath.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/classificationmd/classification_tpath.tcl 17 May 2005 16:21:23 -0000 1.1 @@ -0,0 +1,65 @@ +ad_page_contract { + Displays IMS Metadata Classification Taxonomic Path Entry + + @author Gerard Low (glow5809@mail.usyd.edu.au) + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 16 October 2004 + @cvs-id $Id: classification_tpath.tcl,v 1.1 2005/05/17 16:21:23 miguelm Exp $ + +} { + ims_md_cl_id:integer + ims_md_cl_ta_id:integer + ims_md_id:integer +} + +# 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 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} Index: openacs-4/packages/lors-central/www/md/classificationmd/classification_tsource.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/classificationmd/classification_tsource.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/classificationmd/classification_tsource.adp 17 May 2005 16:21:23 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Classification Metadata Taxonomic Path Source

+
+ + + + + + + + + +
Classification Metadata Taxonomic Path
Source:
+
+

+ +

Add/Edit Classification Metadata Taxonomic Path Source

+
+ +
Index: openacs-4/packages/lors-central/www/md/classificationmd/classification_tsource.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/classificationmd/classification_tsource.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/classificationmd/classification_tsource.tcl 17 May 2005 16:21:23 -0000 1.1 @@ -0,0 +1,100 @@ +# 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 + @cvs-id $Id: classification_tsource.tcl,v 1.1 2005/05/17 16:21:23 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_cl_id:integer + ims_md_cl_ta_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_Edit_Classification_M_3]" + + +# Form + +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) + + {source_l:text,nospell + {section "[_ lorsm.lt_AddEdit_Classificatio_9]"} + {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} + } + + {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}] + ad_script_abort +} + +# Classification Taxonomic Path Source +template::list::create \ + -name d_cl_tsource \ + -multirow d_cl_tsource \ + -no_data "[_ lorsm.lt_No_Taxonomic_Path_Sou]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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_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 +} Index: openacs-4/packages/lors-central/www/md/educationalmd/educational_cont.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd/educational_cont.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd/educational_cont.adp 17 May 2005 16:21:24 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Educational Metadata Context

+
+ + + + + + + + + +
Educational Metadata
Context:
+
+

+ +

Add/Edit Educational Metadata Context

+
+ +
Index: openacs-4/packages/lors-central/www/md/educationalmd/educational_cont.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd/educational_cont.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd/educational_cont.tcl 17 May 2005 16:21:24 -0000 1.1 @@ -0,0 +1,98 @@ +# 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 + @cvs-id $Id: educational_cont.tcl,v 1.1 2005/05/17 16:21:24 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_ed_co_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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 title "[_ lorsm.lt_Add_Educational_MD_Co]" +} + +# Form + +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) + + {context_s:text,nospell + {section "[_ lorsm.lt_AddEdit_Educational_M_11]"} + {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]"} + } + + {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 + +} -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) + values (:ims_md_ed_co_id, :ims_md_id, :context_s, :context_v)" +} -after_submit { + ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] + ad_script_abort +} + +# Educational Context +template::list::create \ + -name d_ed_cont \ + -multirow d_ed_cont \ + -no_data "[_ lorsm.No_Context_Available]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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_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 +} Index: openacs-4/packages/lors-central/www/md/educationalmd/educational_desc.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd/educational_desc.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd/educational_desc.adp 17 May 2005 16:21:24 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Educational Metadata Description

+
+ + + + + + + + + +
Educational Metadata
Description:
+
+

+ +

Add/Edit Educational Metadata Description

+
+ +
Index: openacs-4/packages/lors-central/www/md/educationalmd/educational_desc.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd/educational_desc.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd/educational_desc.tcl 17 May 2005 16:21:24 -0000 1.1 @@ -0,0 +1,98 @@ +# 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 + @cvs-id $Id: educational_desc.tcl,v 1.1 2005/05/17 16:21:24 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_ed_de_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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 title "[_ lorsm.lt_Add_Educational_MD_De]" +} + +# Form + +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) + + {descrip_l:text,nospell + {section "[_ lorsm.lt_AddEdit_Educational_M_12]"} + {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]"} + } + + {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 + +} -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) + values (:ims_md_ed_de_id, :ims_md_id, :descrip_l, :descrip_s)" +} -after_submit { + ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] + ad_script_abort +} + +# Educational Description +template::list::create \ + -name d_ed_desc \ + -multirow d_ed_desc \ + -no_data "[_ lorsm.lt_No_Description_Availa]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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_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 +} Index: openacs-4/packages/lors-central/www/md/educationalmd/educational_dif.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd/educational_dif.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd/educational_dif.adp 17 May 2005 16:21:24 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Educational Metadata Difficulty

+
+ + + + + + + + + +
Educational Metadata
Difficulty:
+
+

+ +

Add/Edit Educational Metadata Difficulty

+
+ +
Index: openacs-4/packages/lors-central/www/md/educationalmd/educational_dif.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd/educational_dif.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd/educational_dif.tcl 17 May 2005 16:21:24 -0000 1.1 @@ -0,0 +1,88 @@ +# 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: educational_dif.tcl,v 1.1 2005/05/17 16:21:24 miguelm Exp $ + +} { + ims_md_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_AddEdit_Educational_M_13]" + +# Form + +ad_form -name educationalmd_dif \ + -cancel_url ../educationalmd?ims_md_id=$ims_md_id \ + -mode edit \ + -form { + + {difficulty_s:text,nospell + {section "[_ lorsm.lt_AddEdit_Educational_M_13]"} + {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]"} + } + + {ims_md_id:text(hidden) {value $ims_md_id}} + +} -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 " + + } 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 +} + +# 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]" + } + } + +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 +} Index: openacs-4/packages/lors-central/www/md/educationalmd/educational_ieur.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd/educational_ieur.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd/educational_ieur.adp 17 May 2005 16:21:24 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Educational Metadata Intended End User Role

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

+ +

Add/Edit Educational Metadata Intended End User Role

+
+ +
Index: openacs-4/packages/lors-central/www/md/educationalmd/educational_ieur.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd/educational_ieur.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd/educational_ieur.tcl 17 May 2005 16:21:24 -0000 1.1 @@ -0,0 +1,98 @@ +# 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 + @cvs-id $Id: educational_ieur.tcl,v 1.1 2005/05/17 16:21:24 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_ed_ie_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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 title "[_ lorsm.lt_Add_Educational_MD_In]" +} + +# Form + +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) + + {ieur_s:text,nospell + {section "[_ lorsm.lt_AddEdit_Educational_M_14]"} + {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]"} + } + + {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 + +} -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) + values (:ims_md_ed_ie_id, :ims_md_id, :ieur_s, :ieur_v)" +} -after_submit { + ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] + ad_script_abort +} + +# Educational Intended End User Role +template::list::create \ + -name d_ed_ieur \ + -multirow d_ed_ieur \ + -no_data "[_ lorsm.lt_No_Intended_End_User_]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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_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 +} Index: openacs-4/packages/lors-central/www/md/educationalmd/educational_intl.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd/educational_intl.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd/educational_intl.adp 17 May 2005 16:21:24 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Educational Metadata Interactivity Level

+
+ + + + + + + + + +
Educational Metadata
Interactivity Level:
+
+

+ +

Add/Edit Educational Metadata Interactivity Level

+
+ +
Index: openacs-4/packages/lors-central/www/md/educationalmd/educational_intl.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd/educational_intl.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd/educational_intl.tcl 17 May 2005 16:21:24 -0000 1.1 @@ -0,0 +1,88 @@ +# 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 + @cvs-id $Id: educational_intl.tcl,v 1.1 2005/05/17 16:21:24 miguelm Exp $ + +} { + ims_md_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_Edit_Educational_MD_I_1]" + +# Form + +ad_form -name educationalmd_intl \ + -cancel_url ../educationalmd?ims_md_id=$ims_md_id \ + -mode edit \ + -form { + + {int_level_s:text,nospell + {section "[_ lorsm.lt_AddEdit_Educational_M_15]"} + {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]"} + } + {ims_md_id:text(hidden) {value $ims_md_id}} + +} -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) " + } + +} -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]" + } + } + +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 +} Index: openacs-4/packages/lors-central/www/md/educationalmd/educational_intt.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd/educational_intt.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd/educational_intt.adp 17 May 2005 16:21:24 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Educational Metadata Interactivity Type

+
+ + + + + + + + + +
Educational Metadata
Interactivity Type:
+
+

+ +

Add/Edit Educational Metadata Interactivity Type

+
+ +
Index: openacs-4/packages/lors-central/www/md/educationalmd/educational_intt.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd/educational_intt.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd/educational_intt.tcl 17 May 2005 16:21:24 -0000 1.1 @@ -0,0 +1,87 @@ +# 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 + @cvs-id $Id: educational_intt.tcl,v 1.1 2005/05/17 16:21:24 miguelm Exp $ + +} { + ims_md_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_AddEdit_Educational_M_16]" + +# Form + +ad_form -name educationalmd_intt \ + -cancel_url ../educationalmd?ims_md_id=$ims_md_id \ + -mode edit \ + -form { + + {int_type_s:text,nospell + {section "[_ lorsm.lt_AddEdit_Educational_M_16]"} + {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]"} + } + {ims_md_id:text(hidden) {value $ims_md_id}} + +} -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}]} { + + 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 +} + +# 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]" + } + } + +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 +} Index: openacs-4/packages/lors-central/www/md/educationalmd/educational_lang.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd/educational_lang.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd/educational_lang.adp 17 May 2005 16:21:24 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Educational Metadata Language

+
+ + + + + + + + + +
Educational Metadata
Language:
+
+

+ +

Add/Edit Educational Metadata Language

+
+ +
Index: openacs-4/packages/lors-central/www/md/educationalmd/educational_lang.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd/educational_lang.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd/educational_lang.tcl 17 May 2005 16:21:24 -0000 1.1 @@ -0,0 +1,91 @@ +# 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 + @cvs-id $Id: educational_lang.tcl,v 1.1 2005/05/17 16:21:24 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_ed_la_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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 title "[_ lorsm.lt_Add_Educational_MD_La]" +} + +# Form + +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) + + {language:text,nospell + {section "[_ lorsm.lt_AddEdit_Educational_M_17]"} + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } + + {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 + +} -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) + values (:ims_md_ed_la_id, :ims_md_id, :language)" +} -after_submit { + ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] + ad_script_abort +} + +# Educational Language +template::list::create \ + -name d_ed_lang \ + -multirow d_ed_lang \ + -no_data "[_ lorsm.lt_No_Language_Available]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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}] } +q 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 +} Index: openacs-4/packages/lors-central/www/md/educationalmd/educational_lrt.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd/educational_lrt.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd/educational_lrt.adp 17 May 2005 16:21:24 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Educational Metadata Learning Resource Type

+
+ + + + + + + + + +
Educational Metadata
Learning Resource Type:
+
+

+ +

Add/Edit Educational Metadata Learning Resource Type

+
+ +
Index: openacs-4/packages/lors-central/www/md/educationalmd/educational_lrt.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd/educational_lrt.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd/educational_lrt.tcl 17 May 2005 16:21:24 -0000 1.1 @@ -0,0 +1,96 @@ +# 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 + +} { + ims_md_id:integer + ims_md_ed_lr_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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 title "[_ lorsm.lt_Add_Educational_MD_Le]" +} + +# Form + +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) + + {lrt_s:text,nospell + {section "[_ lorsm.lt_AddEdit_Educational_M_18]"} + {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]"} + } + + {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 + +} -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}] + ad_script_abort +} + +# Educational Learning Resource Type +template::list::create \ + -name d_ed_lrt \ + -multirow d_ed_lrt \ + -no_data "[_ lorsm.lt_No_Learning_Resource_]" \ + -html { align right style "width: 100%;" } \ + -elements { + lrt { + label "" + } + export { + display_eval {\[Edit\]} + 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 +} Index: openacs-4/packages/lors-central/www/md/educationalmd/educational_semd.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd/educational_semd.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd/educational_semd.adp 17 May 2005 16:21:24 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Educational Metadata Semantic Density

+
+ + + + + + + + + +
Educational Metadata
Semantic Density:
+
+

+ +

Add/Edit Educational Metadata Semantic Density

+
+ +
Index: openacs-4/packages/lors-central/www/md/educationalmd/educational_semd.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd/educational_semd.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd/educational_semd.tcl 17 May 2005 16:21:24 -0000 1.1 @@ -0,0 +1,89 @@ +# 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 + @cvs-id $Id: educational_semd.tcl,v 1.1 2005/05/17 16:21:24 miguelm Exp $ + +} { + ims_md_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_Edit_Educational_MD_S]" + +# Form + +ad_form -name educationalmd_semd \ + -cancel_url ../educationalmd?ims_md_id=$ims_md_id \ + -mode edit \ + -form { + + {sem_density_s:text,nospell + {section "[_ lorsm.lt_AddEdit_Educational_M_19]"} + {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]"} + } + {ims_md_id:text(hidden) {value $ims_md_id}} + +} -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}]} { + + 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 +} + +# 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]" + } + } + +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 +} Index: openacs-4/packages/lors-central/www/md/educationalmd/educational_tar.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd/educational_tar.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd/educational_tar.adp 17 May 2005 16:21:24 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Educational Metadata Typical Age Range

+
+ + + + + + + + + +
Educational Metadata
Typical Age Range:
+
+

+ +

Add/Edit Educational Metadata Typical Age Range

+
+ +
Index: openacs-4/packages/lors-central/www/md/educationalmd/educational_tar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd/educational_tar.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd/educational_tar.tcl 17 May 2005 16:21:24 -0000 1.1 @@ -0,0 +1,98 @@ +# 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 + @cvs-id $Id: educational_tar.tcl,v 1.1 2005/05/17 16:21:24 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_ed_ta_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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 title "[_ lorsm.lt_Add_Educational_MD_Ty]" +} + +# Form + +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) + + {tar_l:text,nospell + {section "[_ lorsm.lt_AddEdit_Educational_M_20]"} + {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]" } + } + + {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 + +} -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) + values (:ims_md_ed_ta_id, :ims_md_id, :tar_l, :tar_s)" +} -after_submit { + ad_returnredirect [export_vars -base "../educationalmd" {ims_md_id}] + ad_script_abort +} + +# Educational Typical Age Range +template::list::create \ + -name d_ed_tar \ + -multirow d_ed_tar \ + -no_data "[_ lorsm.lt_No_Typical_Age_Range_]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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}] } + link_html {title "[_ lorsm.Edit_Record]"} + html { align center } + } + } + +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 +} Index: openacs-4/packages/lors-central/www/md/educationalmd/educational_tlt.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd/educational_tlt.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd/educational_tlt.adp 17 May 2005 16:21:24 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Educational Metadata Typical Learning Time

+
+ + + + + + + + + +
Educational Metadata
Typical Learning Time:
+
+

+ +

Add/Edit Educational Metadata Typical Learning Time

+
+ +
Index: openacs-4/packages/lors-central/www/md/educationalmd/educational_tlt.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/educationalmd/educational_tlt.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/educationalmd/educational_tlt.tcl 17 May 2005 16:21:24 -0000 1.1 @@ -0,0 +1,99 @@ +# 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 + @cvs-id $Id: educational_tlt.tcl,v 1.1 2005/05/17 16:21:24 miguelm Exp $ + +} { + ims_md_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_Edit_Educational_MD_T_1]" + +# Form + +ad_form -name educationalmd_tlt \ + -cancel_url ../educationalmd?ims_md_id=$ims_md_id \ + -mode edit \ + -form { + + {type_lrn_time_l:text,nospell,optional + {section "[_ lorsm.lt_AddEdit_Educational_M_21]"} + {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: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}} + +} -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}]} { + + 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}] + ad_script_abort +} + +# Educational Typical Learning Time +template::list::create \ + -name d_ed_tlt \ + -multirow d_ed_tlt \ + -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]" + } + } + +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 +} Index: openacs-4/packages/lors-central/www/md/form-md-record/md-record.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/form-md-record/md-record.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/form-md-record/md-record.adp 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1 @@ + \ No newline at end of file Index: openacs-4/packages/lors-central/www/md/form-md-record/md-record.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/form-md-record/md-record.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/form-md-record/md-record.tcl 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,33 @@ +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]" + + +# Presentation +template::list::create \ + -name d_pres \ + -multirow d_pres \ + -no_data "-" \ + -actions $actions \ + -elements { + 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 +} Index: openacs-4/packages/lors-central/www/md/generalmd/general_aggl.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/generalmd/general_aggl.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/generalmd/general_aggl.adp 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

General Metadata Aggregation Level

+
+ + + + + + + + + +
General Metadata
Aggregation Level:
+
+

+ +

Add/Edit General Metadata Aggregation Level

+
+ +
Index: openacs-4/packages/lors-central/www/md/generalmd/general_aggl.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/generalmd/general_aggl.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/generalmd/general_aggl.tcl 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,101 @@ +# 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 + @cvs-id $Id: general_aggl.tcl,v 1.1 2005/05/17 16:21:25 miguelm Exp $ + +} { + ims_md_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_Edit_General_MD_Aggre]" + +# Form + +ad_form -name generalmd_aggl \ + -cancel_url ../generalmd?ims_md_id=$ims_md_id \ + -mode edit \ + -form { + + + + {agg_level_v:text,nospell + {section "[_ lorsm.lt_AddEdit_General_MD_Ag]"} + {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.. + + 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 +} + +# General Aggregation Level +template::list::create \ + -name d_gen_aggl \ + -multirow d_gen_aggl \ + -no_data "[_ lorsm.lt_No_Aggregation_Level__1]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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}] } + link_html {title "[_ lorsm.Edit_Record] "} + html { align center } + } + } + +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 +} + Index: openacs-4/packages/lors-central/www/md/generalmd/general_cata.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/generalmd/general_cata.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/generalmd/general_cata.adp 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

List of General Metadata Catalog-Entries

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

+ +

Add/Edit General Metadata Catalog-Entry

+
+ +
Index: openacs-4/packages/lors-central/www/md/generalmd/general_cata.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/generalmd/general_cata.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/generalmd/general_cata.tcl 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,113 @@ +# 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 + @cvs-id $Id: general_cata.tcl,v 1.1 2005/05/17 16:21:25 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_ge_cata_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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 title "[_ lorsm.lt_Add_General_MD_Catalo]" +} + +# Form + +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) + + {catalog:text,nospell + {section "[_ lorsm.lt_AddEdit_General_MD_Ca]"} + {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_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} + } + +} -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 + 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)" + +} -after_submit { + ad_returnredirect [export_vars -base "../generalmd" {ims_md_id}] + ad_script_abort +} + +# General Catalog-entry +template::list::create \ + -name d_gen_cata \ + -multirow d_gen_cata \ + -no_data "[_ lorsm.lt_No_Catalog_Entry_Avai]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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_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 +} + Index: openacs-4/packages/lors-central/www/md/generalmd/general_cover.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/generalmd/general_cover.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/generalmd/general_cover.adp 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

List of General Metadata Coverages

+
+ + + + + + + + + +
General Metadata
Coverage:
+
+

+ +

Add/Edit General Metadata Coverage

+
+ +
Index: openacs-4/packages/lors-central/www/md/generalmd/general_cover.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/generalmd/general_cover.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/generalmd/general_cover.tcl 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,102 @@ +# 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 + @cvs-id $Id: general_cover.tcl,v 1.1 2005/05/17 16:21:25 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_ge_cove_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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 title "[_ lorsm.lt_Add_General_MD_Covera]" +} + +# Form + +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) + + {cover_l:text,nospell,optional + {section "[_ lorsm.lt_AddEdit_General_MD_Co]"} + {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]"} + } + + {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 + +} -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)" + +} -after_submit { + ad_returnredirect [export_vars -base "../generalmd" {ims_md_id}] + ad_script_abort +} + +# General Coverage +template::list::create \ + -name d_gen_cover \ + -multirow d_gen_cover \ + -no_data "[_ lorsm.lt_No_Coverage_Available]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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_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 +} Index: openacs-4/packages/lors-central/www/md/generalmd/general_desc.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/generalmd/general_desc.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/generalmd/general_desc.adp 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

List of General Metadata Descriptions

+
+ + + + + + + + + +
General Metadata
Descriptions:
+
+

+ +

Add/Edit General Metadata Description

+
+ +
Index: openacs-4/packages/lors-central/www/md/generalmd/general_desc.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/generalmd/general_desc.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/generalmd/general_desc.tcl 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,102 @@ +# 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 + @cvs-id $Id: general_desc.tcl,v 1.1 2005/05/17 16:21:25 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_ge_desc_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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 title "[_ lorsm.lt_Add_General_MD_Descri]" +} + +# Form + +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) + + {descrip_l:text,nospell,optional + {section "[_ lorsm.lt_AddEdit_General_MD_De]"} + {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]"} + } + + {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 + +} -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}] + ad_script_abort +} + +# General Language +template::list::create \ + -name d_gen_desc \ + -multirow d_gen_desc \ + -no_data "[_ lorsm.lt_No_Description_Availa]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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_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 +} Index: openacs-4/packages/lors-central/www/md/generalmd/general_key.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/generalmd/general_key.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/generalmd/general_key.adp 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

List of General Metadata Keywords

+
+ + + + + + + + + +
General Metadata
Keywords:
+
+

+ +

Add/Edit General Metadata Keyword

+
+ +
Index: openacs-4/packages/lors-central/www/md/generalmd/general_key.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/generalmd/general_key.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/generalmd/general_key.tcl 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,103 @@ +# 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 + @cvs-id $Id: general_key.tcl,v 1.1 2005/05/17 16:21:25 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_ge_key_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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 title "[_ lorsm.lt_Add_General_MD_Keywor]" +} + +# Form + +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) + + {keyword_l:text,nospell,optional + {section "[_ lorsm.lt_AddEdit_General_MD_Ke]"} + {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]"} + } + + {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 + +} -edit_data { + db_dml do_update " + update ims_md_general_key + set keyword_l = :keyword_l, keyword_s = :keyword_s + where ims_md_ge_key_id = :ims_md_ge_key_id " +} -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)" + +} -after_submit { + ad_returnredirect [export_vars -base "../generalmd" {ims_md_id}] + ad_script_abort +} + +# General Keyword +template::list::create \ + -name d_gen_key \ + -multirow d_gen_key \ + -no_data "[_ lorsm.lt_No_Keywords_Available]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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_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 +} + Index: openacs-4/packages/lors-central/www/md/generalmd/general_lang.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/generalmd/general_lang.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/generalmd/general_lang.adp 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

List of General Metadata Languages

+
+ + + + + + + + + +
General Metadata
Languages:
+
+

+ +

Add/Edit General Metadata Language

+
+ +
Index: openacs-4/packages/lors-central/www/md/generalmd/general_lang.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/generalmd/general_lang.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/generalmd/general_lang.tcl 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,92 @@ +# 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 + @cvs-id $Id: general_lang.tcl,v 1.1 2005/05/17 16:21:25 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_ge_lang_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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 title "[_ lorsm.lt_Add_General_MD_Langua]" +} + +# Form + +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) + + {language:text,nospell + {section "[_ lorsm.lt_AddEdit_General_MD_La]"} + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } + + {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 + +} -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)" + +} -after_submit { + ad_returnredirect [export_vars -base "../generalmd" {ims_md_id}] + ad_script_abort +} + +# General Language +template::list::create \ + -name d_gen_lang \ + -multirow d_gen_lang \ + -no_data "[_ lorsm.lt_No_Language_Available]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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_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 +} Index: openacs-4/packages/lors-central/www/md/generalmd/general_struc.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/generalmd/general_struc.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/generalmd/general_struc.adp 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

General Metadata Structure

+
+ + + + + + + + + +
General Metadata
Structure:
+
+

+ +

Add/Edit General Metadata Structure

+
+ +
Index: openacs-4/packages/lors-central/www/md/generalmd/general_struc.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/generalmd/general_struc.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/generalmd/general_struc.tcl 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,95 @@ +# 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 + @cvs-id $Id: general_struc.tcl,v 1.1 2005/05/17 16:21:25 miguelm Exp $ + +} { + ims_md_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_Edit_General_MD_Struc]" + +# Form + +ad_form -name generalmd_struc \ + -cancel_url [export_vars -base "../generalmd" ims_md_id] \ + -mode edit \ + -form { + + {structure_v:text + {section "[_ lorsm.lt_AddEdit_General_MD_St]"} + {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}} + +} -on_submit { + # check if the structure details already exist... + + 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 { + + 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 +} + +# General Structure +template::list::create \ + -name d_gen_struc \ + -multirow d_gen_struc \ + -no_data "[_ lorsm.lt_No_Structure_Availabl]" \ + -html { align right style "width: 100%;" } \ + -elements { + structure_s { + label "[_ lorsm.Source_1]" + html {align center} + } + structure_v { + label "[_ lorsm.Value]" + 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 +} + Index: openacs-4/packages/lors-central/www/md/generalmd/general_title.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/generalmd/general_title.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/generalmd/general_title.adp 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

List of General Metadata Titles

+
+ + + + + + + + + +
General Metadata
Titles:
+
+

+ +

Add/Edit General Metadata Title

+
+ +
Index: openacs-4/packages/lors-central/www/md/generalmd/general_title.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/generalmd/general_title.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/generalmd/general_title.tcl 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,105 @@ +# 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 + @cvs-id $Id: general_title.tcl,v 1.1 2005/05/17 16:21:25 miguelm Exp $ +} { + ims_md_id:integer + ims_md_ge_ti_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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]"] "[_ lorsm.General_MD]"] + set title "[_ lorsm.Add_General_MD_Title]" +} + +# Form + +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) + + {title_l:text,nospell,optional + {section "[_ lorsm.lt_AddEdit_General_MD_Ti]"} + {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]"} + } + + {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 + +} -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)" + +} -after_submit { + ad_returnredirect [export_vars -base "../generalmd" {ims_md_id}] + ad_script_abort +} + +# General Title +template::list::create \ + -name d_gen_titles \ + -multirow d_gen_titles \ + -no_data "[_ lorsm.No_Titles_Available]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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_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 +} { + set item_url [export_vars -base "item" { ims_md_id }] +} + Index: openacs-4/packages/lors-central/www/md/lifecyclemd/lifecycle_cont.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/lifecyclemd/lifecycle_cont.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/lifecyclemd/lifecycle_cont.adp 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Lifecyle Metadata Contribution

+
+ + + + + + + + + +
Lifecycle Metadata
Contribution:
+
+

+ +

Add/Edit Lifecycle Metadata Contributor

+
+ +
Index: openacs-4/packages/lors-central/www/md/lifecyclemd/lifecycle_cont.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/lifecyclemd/lifecycle_cont.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/lifecyclemd/lifecycle_cont.tcl 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,165 @@ +# 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 + @cvs-id $Id: lifecycle_cont.tcl,v 1.1 2005/05/17 16:21:25 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_lf_cont_id:integer,optional + ims_md_lf_cont_enti_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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 title "[_ lorsm.lt_Add_Lifecycle_MD_Cont]" +} + +# Form + +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) + + {role_s:text,nospell + {section "[_ lorsm.lt_AddEdit_Lifecycle_MD_]"} + {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]"} + } + {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_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]"} + } + + {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 + +} -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)" + + 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 \ + -name d_lf_cont \ + -multirow d_lf_cont \ + -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]" + } + export { + display_eval {\[Edit\]} + 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 +} + Index: openacs-4/packages/lors-central/www/md/lifecyclemd/lifecycle_stat.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/lifecyclemd/lifecycle_stat.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/lifecyclemd/lifecycle_stat.adp 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Lifecyle Metadata Status

+
+ + + + + + + + + +
Lifecycle Metadata
Status:
+
+

+ +

Add/Edit Lifecycle Metadata Status

+
+ +
Index: openacs-4/packages/lors-central/www/md/lifecyclemd/lifecycle_stat.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/lifecyclemd/lifecycle_stat.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/lifecyclemd/lifecycle_stat.tcl 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,93 @@ +# 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: lifecycle_stat.tcl,v 1.1 2005/05/17 16:21:25 miguelm Exp $ + +} { + ims_md_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_Edit_Lifecycle_MD_Sta]" + +# Form + +ad_form -name lifecyclemd_stat \ + -cancel_url ../lifecyclemd?ims_md_id=$ims_md_id \ + -mode edit \ + -form { + + {status_v:text,nospell + {section "[_ lorsm.lt_AddEdit_Lifecycle_MD__1]"} + {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]"} + } + + {ims_md_id:text(hidden) {value $ims_md_id}} + +} -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)" + + } + +} -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]" + } + } + +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 +} + Index: openacs-4/packages/lors-central/www/md/lifecyclemd/lifecycle_version.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/lifecyclemd/lifecycle_version.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/lifecyclemd/lifecycle_version.adp 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Lifecyle Metadata Version

+
+ + + + + + + + + +
Lifecycle Metadata
Version:
+
+

+ +

Add/Edit Lifecycle Metadata Version

+
+ +
Index: openacs-4/packages/lors-central/www/md/lifecyclemd/lifecycle_version.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/lifecyclemd/lifecycle_version.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/lifecyclemd/lifecycle_version.tcl 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,96 @@ +# 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: lifecycle_version.tcl,v 1.1 2005/05/17 16:21:25 miguelm Exp $ + +} { + ims_md_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_Edit_Lifecycle_MD_Ver]" + +# Form + +ad_form -name lifecyclemd_ver \ + -cancel_url ../lifecyclemd?ims_md_id=$ims_md_id \ + -mode edit \ + -form { + + + {version_l:text,nospell,optional + {section "[_ lorsm.lt_AddEdit_Lifecycle_MD__1]"} + {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}} + +} -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 +} + +# 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]" + } + } + +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 +} + Index: openacs-4/packages/lors-central/www/md/metamd/meta_cata.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/metamd/meta_cata.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/metamd/meta_cata.adp 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

List of Meta Metadata Catalog-Entries

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

+ +

Add/Edit Meta Metadata Catalog-Entry

+
+ +
Index: openacs-4/packages/lors-central/www/md/metamd/meta_cata.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/metamd/meta_cata.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/metamd/meta_cata.tcl 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,109 @@ +# 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 + @cvs-id $Id: meta_cata.tcl,v 1.1 2005/05/17 16:21:25 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_md_cata_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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 title "Add Meta MD Catalog-Entry" +} + +# Form + +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) + + {catalog:text,nospell + {section "Add/Edit Meta MD Catalog-Entry"} + {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_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} + } + +} -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 + 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)" + +} -after_submit { + ad_returnredirect [export_vars -base "../metamd" {ims_md_id}] + ad_script_abort +} + +# Metametadata Catalog-entry +template::list::create \ + -name d_md_cata \ + -multirow d_md_cata \ + -no_data "No Catalog Entry Available" \ + -html { align right style "width: 100%;" } \ + -elements { + 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_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 +} + Index: openacs-4/packages/lors-central/www/md/metamd/meta_cont.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/metamd/meta_cont.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/metamd/meta_cont.adp 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Meta Metadata Contribution

+
+ + + + + + + + + +
Meta Metadata
Contribution:
+
+

+ +

Add/Edit Meta Metadata Contributor

+
+ +
Index: openacs-4/packages/lors-central/www/md/metamd/meta_cont.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/metamd/meta_cont.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/metamd/meta_cont.tcl 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,166 @@ +# 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 + @cvs-id $Id: meta_cont.tcl,v 1.1 2005/05/17 16:21:25 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_md_cont_id:integer,optional + ims_md_md_cont_enti_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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 title "[_ lorsm.lt_Add_Meta_MD_Contribut]" +} + +# Form + +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) + + {role_s:text,nospell + {section "[_ lorsm.lt_AddEdit_Meta_MD_Contr]"} + {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]"} + } + + {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_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]"} + } + + {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 + +} -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)" + + 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 \ + -name d_md_cont \ + -multirow d_md_cont \ + -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]" + } + export { + display_eval {\[Edit\]} + 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 +} + Index: openacs-4/packages/lors-central/www/md/metamd/meta_lang.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/metamd/meta_lang.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/metamd/meta_lang.adp 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Meta Metadata Language

+
+ + + + + + + + + +
Meta Metadata
Language:
+
+

+ +

Add/Edit Meta Metadata Language

+
+ +
Index: openacs-4/packages/lors-central/www/md/metamd/meta_lang.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/metamd/meta_lang.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/metamd/meta_lang.tcl 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,81 @@ +# 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: meta_lang.tcl,v 1.1 2005/05/17 16:21:25 miguelm Exp $ + +} { + ims_md_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_Edit_Meta_MD_Language]" + +# Form + +ad_form -name metamd_lang \ + -cancel_url ../metamd?ims_md_id=$ims_md_id \ + -mode edit \ + -form { + + {language:text,nospell + {section "[_ lorsm.lt_AddEdit_Meta_MD_Langu]"} + {html {size 10}} + {help_text "[_ lorsm.lt_ie_en_AU_for_Australi]"} + {label "[_ lorsm.Language]"} + } + {ims_md_id:text(hidden) {value $ims_md_id}} + +} -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}]} { + + 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)" + + } + +} -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]" + } + } + +db_multirow d_md_lang select_md_lang { + select language, + ims_md_id + from + ims_md_metadata + where + ims_md_id = :ims_md_id +} Index: openacs-4/packages/lors-central/www/md/metamd/meta_scheme.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/metamd/meta_scheme.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/metamd/meta_scheme.adp 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Meta Metadata Scheme

+
+ + + + + + + + + +
Meta Metadata
Scheme:
+
+

+ +

Add/Edit Meta Metadata Scheme

+
+ +
Index: openacs-4/packages/lors-central/www/md/metamd/meta_scheme.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/metamd/meta_scheme.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/metamd/meta_scheme.tcl 17 May 2005 16:21:25 -0000 1.1 @@ -0,0 +1,93 @@ +# 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 + @cvs-id $Id: meta_scheme.tcl,v 1.1 2005/05/17 16:21:25 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_md_sch_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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 title "[_ lorsm.Add_Meta_MD_Scheme]" +} + +# Form + +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) + + {scheme:text,nospell + {section "[_ lorsm.lt_AddEdit_Meta_MD_Schem]"} + {html {size 10}} + {help_text "[_ lorsm.lt_Structure_of_meta-dat]"} + {label "[_ lorsm.Scheme]"} + } + {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 + +} -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)" + + +} -after_submit { + ad_returnredirect [export_vars -base "../metamd" {ims_md_id}] + ad_script_abort +} + +# Metametadata metadatascheme +template::list::create \ + -name d_md_scheme \ + -multirow d_md_scheme \ + -no_data "[_ lorsm.No_Scheme_Available]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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_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 +} Index: openacs-4/packages/lors-central/www/md/pbs-md/addmd.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/pbs-md/addmd.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/pbs-md/addmd.adp 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,31 @@ + +@title;noquote@ +@context;noquote@ + +

MD Schema

+
+ + + + + + + + +
Metadata Schema
+
+

+ +

Add Metadata Schema

+
+ + + + + + + +
Object: @object_type@
+ Add details for the metadata schema and version. +
+
Index: openacs-4/packages/lors-central/www/md/pbs-md/addmd.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/pbs-md/addmd.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/pbs-md/addmd.tcl 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,135 @@ +# 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 + @arch-tag: 28b76527-a05f-42cf-b562-37c7b85e799f + @cvs-id $Id: addmd.tcl,v 1.1 2005/05/17 16:21:26 miguelm Exp $ +} { + ims_md_id:integer +} -properties { +} -validate { +} -errors { +} + +# Get object information +set object_type [acs_object_type $ims_md_id] + +# set context & title +set context [list [list [export_vars -base "." ims_md_id] "PBS Metadata Editor"] "PBS Metadata"] +set title "MD Schema" + + +# Form +ad_form -name add_md \ + -cancel_url [export_vars -base "." {ims_md_id}] \ + -mode edit \ + -form { + + {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]"} + } + + {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 + } + + } + + # If the object_type is on any of the IMS CP object types, + # then we update also the ims cp tables accordingly. + + 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 +} + +# 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 { + label "[_ lorsm.Schema_1]" + html { align center } + } + schemaversion { + label "[_ lorsm.Version_1]" + html { align center } + } + } + + 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/lors-central/www/md/pbs-md/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/pbs-md/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/pbs-md/index.adp 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,27 @@ + +@title;noquote@ +@context;noquote@ + + + + + +

+ + #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_No_metadata_record_ex# + +

+
+ + Index: openacs-4/packages/lors-central/www/md/pbs-md/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/pbs-md/index.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/pbs-md/index.tcl 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,25 @@ +ad_page_contract { + Displays/Adds IMS Metadata + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 19 January 2004 + @cvs-id $Id: index.tcl,v 1.1 2005/05/17 16:21:26 miguelm Exp $ + +} { + ims_md_id:integer +} + +# set context +set context [list "PBS Metadata Editor"] +set title "PBS Metadata Editor" +set link [export_vars -base "md_upload" ims_md_id] + +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] + +if {$hasmetadata} { + ad_returnredirect [export_vars -base "pbs-md" {ims_md_id}] +} \ No newline at end of file Index: openacs-4/packages/lors-central/www/md/pbs-md/pbs-md.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/pbs-md/pbs-md.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/pbs-md/pbs-md.adp 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,56 @@ + +@title;noquote@ +@context;noquote@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PBS Metadata
Program Title/Episode Title:
PBS Curriculum Topics:
PBS Subject Areas:
#lorsm.Descriptions#
#lorsm.Keywords#
URL:
Grade Range:
Resource Type
+ + + + Index: openacs-4/packages/lors-central/www/md/pbs-md/pbs-md.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/pbs-md/pbs-md.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/pbs-md/pbs-md.tcl 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,236 @@ +# packages/lors-central/www/md/pbs-md/pbs-md.tcl + +ad_page_contract { + + Add/Edit PBS MD Schema + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2005-04-03 + @arch-tag: 4eb5b155-a31b-461e-a671-9265963e3257 + @cvs-id $Id: pbs-md.tcl,v 1.1 2005/05/17 16:21:26 miguelm Exp $ +} { + ims_md_id:integer +} -properties { +} -validate { +} -errors { +} + + +# set context & title +set context [list [list [export_vars -base "." ims_md_id] "PBS Metadata Editor"] "PBS Metadata"] +set title "PBS Metadata Editor" + +# General Title +template::list::create \ + -name d_gen_titles \ + -multirow d_gen_titles \ + -no_data "No Title Available" \ + -actions [list " Add Program Title " [export_vars -base pbsmd_title {ims_md_id}] "Add Program Title"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} { + set item_url [export_vars -base "item" { ims_md_id }] +} + +# General Description +template::list::create \ + -name d_gen_desc \ + -multirow d_gen_desc \ + -no_data "[_ lorsm.lt_No_Description_Availa]" \ + -actions [list "[_ lorsm.Add_Description]" [export_vars -base pbsmd_desc {ims_md_id}] "[_ lorsm.lt_Add_another_Descripti]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# General Catalog-entry (PBS SubjectArea) +template::list::create \ + -name d_gen_cata_pbs_sa \ + -multirow d_gen_cata_pbs_sa \ + -no_data " No PBS Subject Area Available " \ + -actions [list "Add PBS-Subject Area" [export_vars -base pbsmd_subarea {ims_md_id}] "Add PBS-Subject Area"] \ + -html { align right style "width: 100%;" } \ + -elements { + catalog { + label "" + } + entry_l { + label "" + } + entry_s { + label "" + } + } + +db_multirow d_gen_cata_pbs_sa select_ge_cata { + select + catalog, + entry_l, + entry_s + from + ims_md_general_cata + where + catalog = 'PBS-SubjectArea' + and + ims_md_id = :ims_md_id +} + +# General Catalog-entry (PBS-CurriculumTopic) +template::list::create \ + -name d_gen_cata_pbs_ct \ + -multirow d_gen_cata_pbs_ct \ + -no_data "[_ lorsm.lt_No_Catalog_Entry_Avai]" \ + -actions [list "Add PBS-Curriculum Topic" [export_vars -base pbsmd_currtop {ims_md_id}] " Add another PBS-Curriculum Topic "] \ + -html { align right style "width: 100%;" } \ + -elements { + catalog { + label "" + } + entry_l { + label "" + } + entry_s { + label "" + } + } + +db_multirow d_gen_cata_pbs_ct select_ge_cata { + select + catalog, + entry_l, + entry_s + from + ims_md_general_cata + where + catalog = 'PBS-CurriculumTopic' + and + 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 pbsmd_key {ims_md_id}] "[_ lorsm.Add_another_Keywords]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + + +# Technical Location (PBS: URL) +template::list::create \ + -name d_te_loca \ + -multirow d_te_loca \ + -no_data "No URL Available" \ + -actions [list "Add URL" [export_vars -base pbsmd_url {ims_md_id}] "Add another URL"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# Educational Context (PBS: Grade Range) +template::list::create \ + -name d_ed_cont \ + -multirow d_ed_cont \ + -no_data "No Grade Range Available" \ + -actions [list "Add Grade Range" [export_vars -base pbsmd_grade {ims_md_id}] "Add another Grade Range"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# Educational Learning Resource Type (PBS: Resource Type) +template::list::create \ + -name d_ed_lrt \ + -multirow d_ed_lrt \ + -no_data "No Resource Type Available" \ + -actions [list "Add Resource Type" [export_vars -base pbsmd_restype {ims_md_id}] "Add another Resource Type"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} Index: openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_currtop.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_currtop.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_currtop.adp 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

List of PBS Curriculm Topics

+
+ + + + + + + + + +
Curriculum Topics
Topics:
+
+

+ +

Add/Edit Curriculum Topics

+
+ +
Index: openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_currtop.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_currtop.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_currtop.tcl 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,117 @@ +# packages/lorsm/www/md/pbs-md/pbsmd_currtop.tcl + +ad_page_contract { + + Add/Edit PBS Curriculum Topic + + @author Gerard Low (glow5809@mail.usyd.edu.au) + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 16 October 2004 + @cvs-id $Id: pbsmd_currtop.tcl,v 1.1 2005/05/17 16:21:26 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_ge_cata_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# set context & title +if { ![ad_form_new_p -key ims_md_ge_cata_id]} { + set context [list [list [export_vars -base "." ims_md_id] "PBS Metadata Editor"] [list [export_vars -base pbs-md ims_md_id] "PBS Metadata"] "PBS Curriculum Topic "] + set title "Edit PBS Curriculum Topic" +} else { + set context [list [list [export_vars -base "." ims_md_id] "PBS Metadata Editor"] [list [export_vars -base pbs-md ims_md_id] "PBS Metadata"] "PBS Curriculum Topic"] + set title "Add PBS Curriculum Topic" +} + +# Form + +ad_form -name generalmd_cata \ + -cancel_url pbs-md?ims_md_id=$ims_md_id \ + -mode edit \ + -form { + + ims_md_ge_cata_id:key(ims_md_general_cata_seq) + + {catalogx:text,nospell,optional + {section "Add/Edit PBS Curriculum Topics"} + {html {size 50 value {PBS-CurriculumTopics} disabled {}}} + {label "Catalog Schema:"} + } + + {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]"} + } + + {ims_md_id:text(hidden) {value $ims_md_id} + } + + {catalog:text(hidden) {value {PBS-CurriculumTopic}} + } + +} -select_query {select * from ims_md_general_cata where catalog = 'PBS-CurriculumTopic' and 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 + 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)" + +} -after_submit { + ad_returnredirect [export_vars -base "pbs-md" {ims_md_id}] + ad_script_abort +} + +# General Catalog-entry +template::list::create \ + -name d_gen_cata \ + -multirow d_gen_cata \ + -no_data "No PBS Curriculum Topics Available" \ + -html { align right style "width: 100%;" } \ + -elements { + 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 "pbsmd_currtop" {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 + catalog = 'PBS-CurriculumTopic' + and + ims_md_id = :ims_md_id +} + Index: openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_desc.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_desc.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_desc.adp 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

List of PBS Descriptions

+
+ + + + + + + + + +
General Descriptions
Descriptions:
+
+

+ +

Add/Edit Description

+
+ +
Index: openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_desc.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_desc.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_desc.tcl 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,101 @@ +# packages/lorsm/www/md/pbs-md/pbsmd_desc.tcl + +ad_page_contract { + + Add/Edit PBS Schema Description + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 16 October 2004 + @cvs-id $Id: pbsmd_desc.tcl,v 1.1 2005/05/17 16:21:26 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_ge_desc_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# set context & title +if { ![ad_form_new_p -key ims_md_ge_desc_id]} { + set context [list [list [export_vars -base "." ims_md_id] "PBS Metadata Editor"] [list [export_vars -base "pbs-md" ims_md_id] "PBS Metadata"] "Edit Description"] + set title "Edit Description" +} else { + set context [list [list [export_vars -base "." ims_md_id] "PBS Metadata Editor"] [list [export_vars -base "pbs-md" ims_md_id] "PBS Metadata"] "Add Description"] + set title "Add Description" +} + +# Form + +ad_form -name generalmd_desc \ + -cancel_url pbs-md?ims_md_id=$ims_md_id \ + -mode edit \ + -form { + + ims_md_ge_desc_id:key(ims_md_general_desc_seq) + + {descrip_l:text,nospell,optional + {section "Add/Edit Description"} + {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]"} + } + + {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 + +} -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 "pbs-md" {ims_md_id}] + ad_script_abort +} + +# General Language +template::list::create \ + -name d_gen_desc \ + -multirow d_gen_desc \ + -no_data "No Description Available" \ + -html { align right style "width: 100%;" } \ + -elements { + descrip_l { + label "[_ lorsm.Language_1]" + } + descrip_s { + label "[_ lorsm.Description_1]" + } + export { + display_eval {\[Edit\]} + link_url_eval { [export_vars -base "pbsmd_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 +} Index: openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_grade.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_grade.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_grade.adp 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,30 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Grade Ranges

+
+ + + + + + + + + +
Grade Ranges
Grade Range:
+
+

+ +

Add/Edit Grade Range

+
+ +
+ Index: openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_grade.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_grade.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_grade.tcl 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,98 @@ +# packages/lors-central/www/md/pbs-md/pbsmd_grade.tcl + +ad_page_contract { + + Add/Edit PBS Grade Range MD + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2005-04-03 + @arch-tag: 6d6ac4ab-a0d4-4610-9175-335981940c33 + @cvs-id $Id: pbsmd_grade.tcl,v 1.1 2005/05/17 16:21:26 miguelm Exp $ +} { + ims_md_id:integer + ims_md_ed_co_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# set context & title +if { ![ad_form_new_p -key ims_md_ed_co_id]} { + set context [list [list [export_vars -base "." ims_md_id] "PBS Metadata Editor"] [list [export_vars -base "pbs-md" im\s_md_id] "PBS Metadata"] "Edit Grade Range"] + set title "Edit Grade Range" +} else { + set context [list [list [export_vars -base "." ims_md_id] "PBS Metadata Editor"] [list [export_vars -base "pbs-md" ims_md_id] "PBS Metadata"] "Add Grade Range"] + set title "Add Grade Range" +} + +# Form + +ad_form -name educationalmd_cont \ + -cancel_url pbs-md?ims_md_id=$ims_md_id \ + -mode edit \ + -form { + + ims_md_ed_co_id:key(ims_md_educational_context_seq) + + {context_s:text,nospell + {section "Add/Edit Grade Range"} + {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]"} + } + + {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 + +} -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) + values (:ims_md_ed_co_id, :ims_md_id, :context_s, :context_v)" +} -after_submit { + ad_returnredirect [export_vars -base "pbs-md" {ims_md_id}] + ad_script_abort +} + +# Educational Context +template::list::create \ + -name d_ed_cont \ + -multirow d_ed_cont \ + -no_data "[_ lorsm.No_Context_Available]" \ + -html { align right style "width: 100%;" } \ + -elements { + context { + label "[_ lorsm.Context_1]" + } + export { + display_eval {\[[_ lorsm.Edit_1]\]} + link_url_eval { [export_vars -base "pbsmd_grade" {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 +} + Index: openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_key.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_key.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_key.adp 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

List of PBS Keywords

+
+ + + + + + + + + +
PBS Keywords
Keywords:
+
+

+ +

Add/Edit Keyword

+
+ +
Index: openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_key.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_key.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_key.tcl 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,102 @@ +# packages/lorsm/www/md/pbs-md/pbsmd_key.tcl + +ad_page_contract { + + Add/Edit + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 16 October 2004 + @cvs-id $Id: pbsmd_key.tcl,v 1.1 2005/05/17 16:21:26 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_ge_key_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# set context & title +if { ![ad_form_new_p -key ims_md_ge_key_id]} { + set context [list [list [export_vars -base "." ims_md_id] "PBS Metadata Editor"] [list [export_vars -base "pbs-md" ims_md_id] "PBS Metadata"] "Edit Keywords"] + set title "Edit Keywords" +} else { + set context [list [list [export_vars -base "." ims_md_id] "PBS Metadata Editor" ] [list [export_vars -base "pbs-md" ims_md_id] "PBS Metadata"] "Add Keywords"] + set title "Add Keywords" +} + +# Form + +ad_form -name generalmd_key \ + -cancel_url pbs-md?ims_md_id=$ims_md_id \ + -mode edit \ + -form { + + ims_md_ge_key_id:key(ims_md_general_key_seq) + + {keyword_l:text,nospell,optional + {section "Add/Edit Keywords"} + {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]"} + } + + {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 + +} -edit_data { + db_dml do_update " + update ims_md_general_key + set keyword_l = :keyword_l, keyword_s = :keyword_s + where ims_md_ge_key_id = :ims_md_ge_key_id " +} -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)" + +} -after_submit { + ad_returnredirect [export_vars -base "pbs-md" {ims_md_id}] + ad_script_abort +} + +# General Keyword +template::list::create \ + -name d_gen_key \ + -multirow d_gen_key \ + -no_data "No Keywords Available" \ + -html { align right style "width: 100%;" } \ + -elements { + keyword_l { + label "" + } + keyword_s { + label "" + } + export { + display_eval {\[Edit\]} + link_url_eval { [export_vars -base "pbsmd_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 +} + Index: openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_restype.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_restype.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_restype.adp 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,30 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Learning Resource Type

+
+ + + + + + + + + +
Resource Types
Learning Resource Type:
+
+

+ +

Add/Edit Resource Type

+
+ +
+ Index: openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_restype.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_restype.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_restype.tcl 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,97 @@ +# packages/lors-central/www/md/pbs-md/pbsmd_restype.tcl + +ad_page_contract { + + Add/Edit PBS Resource Type MD + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2005-04-03 + @arch-tag: b18e4129-8f95-4a73-b6ec-50f67c96ee3c + @cvs-id $Id: pbsmd_restype.tcl,v 1.1 2005/05/17 16:21:26 miguelm Exp $ +} { + ims_md_id:integer + ims_md_ed_lr_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# set context & title +if { ![ad_form_new_p -key ims_md_ed_lr_id]} { + set context [list [list [export_vars -base "." ims_md_id] "PBS Metadata Editor"] [list [export_vars -base "pbs-md" ims_md_id] "PBS Metadata"] "Add PBS Resource Type"] + set title "Edit PBS Resource Type" +} else { + set context [list [list [export_vars -base "." ims_md_id] "PBS Metadata Editor "] [list [export_vars -base "pbs-md" ims_md_id] "PBS Metadata"] "Add PBS Resource Type"] + set title "Add PBS Resource Type" +} + +# Form + +ad_form -name educationalmd_lrt \ + -cancel_url pbs-md?ims_md_id=$ims_md_id \ + -mode edit \ + -form { + + ims_md_ed_lr_id:key(ims_md_educational_lrt_seq) + + {lrt_s:text,nospell + {section "Add/Edit PBS Resource Type"} + {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]"} + } + + {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 + +} -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 "pbs-md" {ims_md_id}] + ad_script_abort +} + +# Educational Learning Resource Type +template::list::create \ + -name d_ed_lrt \ + -multirow d_ed_lrt \ + -no_data "[_ lorsm.lt_No_Learning_Resource_]" \ + -html { align right style "width: 100%;" } \ + -elements { + lrt { + label "" + } + export { + display_eval {\[Edit\]} + link_url_eval { [export_vars -base "pbsmd_restype" {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 +} Index: openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_subarea.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_subarea.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_subarea.adp 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,30 @@ + +@title;noquote@ +@context;noquote@ + + + + +
+ +

List of PBS Curriculm Topics

+
+ + + + + + + + + +
Subject Areas
Topics:
+
+

+ +

Add/Edit Subject Areas

+
+ +
Index: openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_subarea.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_subarea.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_subarea.tcl 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,111 @@ +# packages/lorsm/www/md/pbs-md/pbsmd_subarea.tcl + +ad_page_contract { + + Add/Edit PBS Subject Area + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 16 October 2004 + @cvs-id $Id: pbsmd_subarea.tcl,v 1.1 2005/05/17 16:21:26 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_ge_cata_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# set context & title +if { ![ad_form_new_p -key ims_md_ge_cata_id]} { + set context [list [list [export_vars -base "." ims_md_id] "PBS Metadata Editor"] [list [export_vars -base pbs-md ims_md_id] "PBS Metadata"] "PBS Subject Area "] + set title "Edit PBS Subject Area" +} else { + set context [list [list [export_vars -base "." ims_md_id] "PBS Metadata Editor"] [list [export_vars -base pbs-md ims_md_id] "PBS Metadata"] "PBS Subject Area"] + set title "Add PBS Subject Area" +} + +# Form + +ad_form -name generalmd_cata \ + -cancel_url pbs-md?ims_md_id=$ims_md_id \ + -mode edit \ + -form { + + ims_md_ge_cata_id:key(ims_md_general_cata_seq) + + {entry_l:text,nospell,optional + {section "Add/Edit PBS Subject Areas"} + {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]"} + } + + {ims_md_id:text(hidden) {value $ims_md_id} + } + + {catalog:text(hidden) {value {PBS-SubjectArea}} + } + +} -select_query {select * from ims_md_general_cata where catalog = 'PBS-SubjectArea' and 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 + 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)" + +} -after_submit { + ad_returnredirect [export_vars -base "pbs-md" {ims_md_id}] + ad_script_abort +} + +# General Catalog-entry +template::list::create \ + -name d_gen_cata \ + -multirow d_gen_cata \ + -no_data "No PBS Subject Areas Available" \ + -html { align right style "width: 100%;" } \ + -elements { + 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 "pbsmd_subarea" {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 + catalog = 'PBS-SubjectArea' + and + ims_md_id = :ims_md_id +} + Index: openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_title.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_title.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_title.adp 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

List of General Metadata Titles

+
+ + + + + + + + + +
General Metadata
Titles:
+
+

+ +

Add/Edit General Metadata Title

+
+ +
Index: openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_title.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_title.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_title.tcl 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,104 @@ +# 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 + @cvs-id $Id: pbsmd_title.tcl,v 1.1 2005/05/17 16:21:26 miguelm Exp $ +} { + ims_md_id:integer + ims_md_ge_ti_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# set context & title +if { ![ad_form_new_p -key ims_md_ge_ti_id]} { + set context [list [list [export_vars -base "." ims_md_id] "PBS Metadata Editor"] [list [export_vars -base "pbs-md" ims_md_id] "PBS Metadata"] "Edit Titles"] + set title "Add PBS Title" +} else { + set context [list [list [export_vars -base "." ims_md_id] "PBS Metadata Editor"] [list [export_vars -base "pbs-md" ims_md_id] "PBS Metadata"] "Add Titles"] + set title "Add PBS Title" +} + +# Form + +ad_form -name generalmd_title \ + -cancel_url [export_vars -base "pbs-md" ims_md_id] \ + -mode edit \ + -form { + + ims_md_ge_ti_id:key(ims_md_general_title_seq) + + {title_l:text,nospell,optional + {section "[_ lorsm.lt_AddEdit_General_MD_Ti]"} + {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]"} + } + + {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 + +} -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)" + +} -after_submit { + ad_returnredirect [export_vars -base "pbs-md" {ims_md_id}] + ad_script_abort +} + +# General Title +template::list::create \ + -name d_gen_titles \ + -multirow d_gen_titles \ + -no_data "[_ lorsm.No_Titles_Available]" \ + -html { align right style "width: 100%;" } \ + -elements { + title_l { + label "[_ lorsm.Language_1]" + } + title_s { + label "[_ lorsm.Titles_1]" + } + export { + display_eval {\[Edit\]} + link_url_eval { [export_vars -base "pbsmd_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 +} { + set item_url [export_vars -base "item" { ims_md_id }] +} + Index: openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_url.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_url.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_url.adp 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

List of URLs

+
+ + + + + + + + + +
URL
URLs:
+
+

+ +

Add/Edit URLs

+
+ +
Index: openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_url.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_url.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/pbs-md/pbsmd_url.tcl 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,104 @@ +# packages/lorsm/www/md/pbs-md/pbsmd_url.tcl + +ad_page_contract { + + Add/Edit PBS URL + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 16 October 2004 + @cvs-id $Id: pbsmd_url.tcl,v 1.1 2005/05/17 16:21:26 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_te_lo_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# set context & title +if { ![ad_form_new_p -key ims_md_te_lo_id]} { + set context [list [list [export_vars -base "." ims_md_id] "PBS Metadata Editor"] [list [export_vars -base "../technicalmd" ims_md_id] "PBS Metadata"] "Edit URL"] + set title "Edit URL" +} else { + set context [list [list [export_vars -base "." ims_md_id] "PBS Metadata Editor"] [list [export_vars -base "../technicalmd" ims_md_id] "PBS Metadata"] "Add URL"] + set title "Add URL" +} + +# Form + +ad_form -name technicalmd_loca \ + -cancel_url pbs-md?ims_md_id=$ims_md_id \ + -mode edit \ + -form { + + ims_md_te_lo_id:key(ims_md_technical_location_seq) + + {type:text,nospell,optional + {section "Add/Edit URL"} + {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]"} + } + + {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 + +} -edit_data { + db_dml do_update " + update ims_md_technical_location + set type = :type, + 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)" + +} -after_submit { + ad_returnredirect [export_vars -base "pbs-md" {ims_md_id}] + ad_script_abort +} + +# Technical Location +template::list::create \ + -name d_te_loca \ + -multirow d_te_loca \ + -no_data "No URL Available" \ + -html { align right style "width: 100%;" } \ + -elements { + type { + label "[_ lorsm.Type]" + } + location { + label "[_ lorsm.Location]" + } + export { + display_eval {\[Edit\]} + link_url_eval { [export_vars -base "pbsmd_url" {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 +} Index: openacs-4/packages/lors-central/www/md/relationmd/relation.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/relationmd/relation.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/relationmd/relation.adp 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,31 @@ + +@title;noquote@ +@context;noquote@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Relation Metadata
Kind:
Relation Metadata Resource
Identifier:
Description:
Catalog-Entries:
Index: openacs-4/packages/lors-central/www/md/relationmd/relation.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/relationmd/relation.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/relationmd/relation.tcl 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,118 @@ +ad_page_contract { + Displays/Adds IMS Metadata Relation + + @author Gerard Low (glow5809@mail.usyd.edu.au) + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 16 October 2004 + @cvs-id $Id: relation.tcl,v 1.1 2005/05/17 16:21:26 miguelm Exp $ + +} { + ims_md_re_id:integer + ims_md_id:integer + ims_md_re_re_id:integer +} + +# 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 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -no_data "[_ lorsm.lt_No_Resource_Identifie]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + +# 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]"] \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} + + Index: openacs-4/packages/lors-central/www/md/relationmd/relation_add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/relationmd/relation_add.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/relationmd/relation_add.adp 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,22 @@ + +@title;noquote@ +@context;noquote@ + + + +

Relation Metadata Entry

+
+ + + + + + + + + + +
Relation Metadata
Add another Relation Metadata Entry?
+
Index: openacs-4/packages/lors-central/www/md/relationmd/relation_add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/relationmd/relation_add.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/relationmd/relation_add.tcl 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,48 @@ +# 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 + @cvs-id $Id: relation_add.tcl,v 1.1 2005/05/17 16:21:26 miguelm Exp $ + +} { + ims_md_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_Add_Relation_MD_Entry]" + +# Form +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_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)" + + 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}] + ad_script_abort +} + Index: openacs-4/packages/lors-central/www/md/relationmd/relation_cata.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/relationmd/relation_cata.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/relationmd/relation_cata.adp 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Relation Metadata Resource Catalog-Entry

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

+ +

Add/Edit Relation Metadata Resource Catalog-Entry

+
+ +
Index: openacs-4/packages/lors-central/www/md/relationmd/relation_cata.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/relationmd/relation_cata.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/relationmd/relation_cata.tcl 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,129 @@ +# 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 + @cvs-id $Id: relation_cata.tcl,v 1.1 2005/05/17 16:21:26 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_re_id:integer + ims_md_re_re_id:integer + ims_md_re_re_ca_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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 title "[_ lorsm.lt_Add_Relation_MD_Resou]" +} + +# Form + +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) + + {catalog:text,nospell + {section "[_ lorsm.lt_AddEdit_Relation_MD_R]"} + {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_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_id:text(hidden) {value $ims_md_re_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 + +} -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 { + 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)" + +} -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 \ + -name d_re_cata \ + -multirow d_re_cata \ + -no_data "[_ lorsm.lt_No_Catalog-Entries_Av]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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_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 +} Index: openacs-4/packages/lors-central/www/md/relationmd/relation_desc.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/relationmd/relation_desc.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/relationmd/relation_desc.adp 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Relation Metadata Resource Description

+
+ + + + + + + + + +
Relation Metadata Resource
Description:
+
+

+ +

Add/Edit Relation Metadata Resource Description

+
+ +
Index: openacs-4/packages/lors-central/www/md/relationmd/relation_desc.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/relationmd/relation_desc.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/relationmd/relation_desc.tcl 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,90 @@ +# 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 + @cvs-id $Id: relation_desc.tcl,v 1.1 2005/05/17 16:21:26 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_re_id:integer + ims_md_re_re_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_Edit_Relation_MD_Reso_1]" + +# Form + +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) + + {descrip_l:text,nospell + {section "[_ lorsm.lt_AddEdit_Relation_MD_R_1]"} + {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]"} + } + + {ims_md_id:text(hidden) {value $ims_md_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 + +} -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}] + ad_script_abort +} + +# Relation Description +template::list::create \ + -name d_re_desc \ + -multirow d_re_desc \ + -no_data "[_ lorsm.lt_No_Resource_Descripti]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} Index: openacs-4/packages/lors-central/www/md/relationmd/relation_ident.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/relationmd/relation_ident.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/relationmd/relation_ident.adp 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Relation Metadata Resource Identifier

+
+ + + + + + + + + +
Relation Metadata Resource
Identifier:
+
+

+ +

Add/Edit Relation Metadata Resource Identifier

+
+ +
Index: openacs-4/packages/lors-central/www/md/relationmd/relation_ident.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/relationmd/relation_ident.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/relationmd/relation_ident.tcl 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,84 @@ +# 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 + @cvs-id $Id: relation_ident.tcl,v 1.1 2005/05/17 16:21:26 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_re_id:integer + ims_md_re_re_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_Edit_Relation_MD_Reso_2]" + + +# Form + +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) + + {identifier:text,nospell + {section "[_ lorsm.lt_AddEdit_Relation_MD_R_2]"} + {html {size 50}} + {help_text "[_ lorsm.lt_Unique_identifier_of_]"} + {label "[_ lorsm.Identifier]"} + } + + {ims_md_id:text(hidden) {value $ims_md_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 + +} -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}] + ad_script_abort +} + +# Relation Identifier +template::list::create \ + -name d_re_ident \ + -multirow d_re_ident \ + -no_data "[_ lorsm.lt_No_Resource_Identifie]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} Index: openacs-4/packages/lors-central/www/md/relationmd/relation_kind.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/relationmd/relation_kind.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/relationmd/relation_kind.adp 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Relation Metadata Kind

+
+ + + + + + + + + +
Relation Metadata Kind
Kind:
+
+

+ +

Add/Edit Relation Metadata Kind

+
+ +
Index: openacs-4/packages/lors-central/www/md/relationmd/relation_kind.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/relationmd/relation_kind.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/relationmd/relation_kind.tcl 17 May 2005 16:21:26 -0000 1.1 @@ -0,0 +1,95 @@ +# 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 + @cvs-id $Id: relation_kind.tcl,v 1.1 2005/05/17 16:21:26 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_re_id:integer + ims_md_re_re_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_AddEdit_Relation_MD_K]" + +# Form + +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) + + {kind_s:text,nospell + {section "[_ lorsm.lt_AddEdit_Relation_MD_K]"} + {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]"} + } + + {ims_md_id:text(hidden) {value $ims_md_id} + } + + {ims_md_re_re_id:text(hidden) {value $ims_md_re_re_id} + } + +} -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}] + ad_script_abort +} + +# Relation Kind +template::list::create \ + -name d_re_kind \ + -multirow d_re_kind \ + -no_data "[_ lorsm.No_Kind_Available]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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 +} Index: openacs-4/packages/lors-central/www/md/rightsmd/rights_caor.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/rightsmd/rights_caor.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/rightsmd/rights_caor.adp 17 May 2005 16:21:27 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Rights Metadata Copyright or other Restrictions

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

+ +

Add/Edit Rights Metadata Copyright or other Restrictions

+
+ +
Index: openacs-4/packages/lors-central/www/md/rightsmd/rights_caor.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/rightsmd/rights_caor.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/rightsmd/rights_caor.tcl 17 May 2005 16:21:27 -0000 1.1 @@ -0,0 +1,88 @@ +# 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 + @cvs-id $Id: rights_caor.tcl,v 1.1 2005/05/17 16:21:27 miguelm Exp $ + +} { + ims_md_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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]" + + +# Form + +ad_form -name rightsmd_caor \ + -cancel_url ../rightsmd?ims_md_id=$ims_md_id \ + -mode edit \ + -form { + + {caor_s:text,nospell + {section "[_ lorsm.lt_AddEdit_Rights_MD_Cop]"} + {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]"} + } + {ims_md_id:text(hidden) {value $ims_md_id}} + +} -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}]} { + + 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 +} + +# 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]" + } + } + +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 +} Index: openacs-4/packages/lors-central/www/md/rightsmd/rights_cost.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/rightsmd/rights_cost.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/rightsmd/rights_cost.adp 17 May 2005 16:21:27 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Rights Metadata Cost

+
+ + + + + + + + + +
Rights Metadata
Cost:
+
+

+ +

Add/Edit Rights Metadata Cost

+
+ +
Index: openacs-4/packages/lors-central/www/md/rightsmd/rights_cost.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/rightsmd/rights_cost.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/rightsmd/rights_cost.tcl 17 May 2005 16:21:27 -0000 1.1 @@ -0,0 +1,88 @@ +# 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 + @cvs-id $Id: rights_cost.tcl,v 1.1 2005/05/17 16:21:27 miguelm Exp $ + +} { + ims_md_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_AddEdit_Rights_MD_Cos]" + + +# Form + +ad_form -name rightsmd_cost \ + -cancel_url ../rightsmd?ims_md_id=$ims_md_id \ + -mode edit \ + -form { + + {cost_s:text,nospell + {section "[_ lorsm.lt_AddEdit_Rights_MD_Cos]"} + {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]"} + } + {ims_md_id:text(hidden) {value $ims_md_id}} + +} -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}]} { + + 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 +} + +# 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]" + } + } + +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 +} Index: openacs-4/packages/lors-central/www/md/rightsmd/rights_desc.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/rightsmd/rights_desc.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/rightsmd/rights_desc.adp 17 May 2005 16:21:27 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Rights Metadata Description

+
+ + + + + + + + + +
Rights Metadata
Description:
+
+

+ +

Add/Edit Rights Metadata Description

+
+ +
Index: openacs-4/packages/lors-central/www/md/rightsmd/rights_desc.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/rightsmd/rights_desc.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/rightsmd/rights_desc.tcl 17 May 2005 16:21:27 -0000 1.1 @@ -0,0 +1,88 @@ +# 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 + @cvs-id $Id: rights_desc.tcl,v 1.1 2005/05/17 16:21:27 miguelm Exp $ + +} { + ims_md_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_Edit_Rights_MD_Descri]" + + +# Form + +ad_form -name rightsmd_desc \ + -cancel_url ../rightsmd?ims_md_id=$ims_md_id \ + -mode edit \ + -form { + + {descrip_l:text,nospell + {section "[_ lorsm.lt_AddEdit_Rights_MD_Des]"} + {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]"} + } + {ims_md_id:text(hidden) {value $ims_md_id}} + +} -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}]} { + + 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) " + } + +} -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]" + } + } + +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 +} Index: openacs-4/packages/lors-central/www/md/technicalmd/technical_dur.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/technicalmd/technical_dur.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/technicalmd/technical_dur.adp 17 May 2005 16:21:27 -0000 1.1 @@ -0,0 +1,28 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Technical Metadata Duration

+
+ + + + + + + + +
Technical Metadata
Duration:
+
+

+ +

Add/Edit Technical Metadata Duration

+
+ +
Index: openacs-4/packages/lors-central/www/md/technicalmd/technical_dur.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/technicalmd/technical_dur.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/technicalmd/technical_dur.tcl 17 May 2005 16:21:27 -0000 1.1 @@ -0,0 +1,104 @@ +# 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 + @cvs-id $Id: technical_dur.tcl,v 1.1 2005/05/17 16:21:27 miguelm Exp $ + +} { + ims_md_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_Edit_Technical_MD_Dur]" + +# Form + +ad_form -name technicalmd_dur \ + -cancel_url ../technicalmd?ims_md_id=$ims_md_id \ + -mode edit \ + -form { + + {duration:text,nospell + {section "[_ lorsm.lt_AddEdit_Technical_MD_]"} + {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_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 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}]} { + + 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 +} + +# 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]" + } + + } + +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 +} Index: openacs-4/packages/lors-central/www/md/technicalmd/technical_form.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/technicalmd/technical_form.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/technicalmd/technical_form.adp 17 May 2005 16:21:27 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Technical Metadata Format

+
+ + + + + + + + + +
Technical Metadata
Formats:
+
+

+ +

Add/Edit Technical Metadata Format

+
+ +
Index: openacs-4/packages/lors-central/www/md/technicalmd/technical_form.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/technicalmd/technical_form.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/technicalmd/technical_form.tcl 17 May 2005 16:21:27 -0000 1.1 @@ -0,0 +1,92 @@ +# 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 + @cvs-id $Id: technical_form.tcl,v 1.1 2005/05/17 16:21:27 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_te_fo_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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 title "[_ lorsm.lt_Add_Technical_MD_Form]" +} + +# 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) + + {format:text,nospell + {section "[_ lorsm.lt_AddEdit_Technical_MD__1]"} + {html {size 30}} + {help_text "[_ lorsm.lt_Technical_data_type_o]"} + {label "[_ lorsm.Format]"} + } + + {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 + +} -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)" + +} -after_submit { + ad_returnredirect [export_vars -base "../technicalmd" {ims_md_id}] + ad_script_abort +} + +# Technical Format +template::list::create \ + -name d_te_form \ + -multirow d_te_form \ + -no_data "[_ lorsm.No_Format_Available]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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_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 +} Index: openacs-4/packages/lors-central/www/md/technicalmd/technical_inst.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/technicalmd/technical_inst.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/technicalmd/technical_inst.adp 17 May 2005 16:21:27 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Technical Metadata Installation Remarks

+
+ + + + + + + + + +
Technical Metadata
Installation Remarks:
+
+

+ +

Add/Edit Technical Metadata Installation Remarks

+
+ +
Index: openacs-4/packages/lors-central/www/md/technicalmd/technical_inst.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/technicalmd/technical_inst.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/technicalmd/technical_inst.tcl 17 May 2005 16:21:27 -0000 1.1 @@ -0,0 +1,88 @@ +# 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 + @cvs-id $Id: technical_inst.tcl,v 1.1 2005/05/17 16:21:27 miguelm Exp $ + +} { + ims_md_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_AddEdit_Technical_MD__2]" + +# Form + +ad_form -name technicalmd_inst \ + -cancel_url ../technicalmd?ims_md_id=$ims_md_id \ + -mode edit \ + -form { + + {instl_rmrks_l:text,nospell + {section "[_ lorsm.lt_AddEdit_Technical_MD__2]"} + {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]"} + } + {ims_md_id:text(hidden) {value $ims_md_id}} + +} -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 " + + } 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 +} + +# 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]" + } + } + +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 +} Index: openacs-4/packages/lors-central/www/md/technicalmd/technical_loca.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/technicalmd/technical_loca.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/technicalmd/technical_loca.adp 17 May 2005 16:21:27 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

List of Technical Metadata Locations

+
+ + + + + + + + + +
Technical Metadata
Locations:
+
+

+ +

Add/Edit Technical Metadata Format

+
+ +
Index: openacs-4/packages/lors-central/www/md/technicalmd/technical_loca.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/technicalmd/technical_loca.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/technicalmd/technical_loca.tcl 17 May 2005 16:21:27 -0000 1.1 @@ -0,0 +1,105 @@ +# 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 + @cvs-id $Id: technical_loca.tcl,v 1.1 2005/05/17 16:21:27 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_te_lo_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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 title "[_ lorsm.lt_Add_Technical_MD_Loca]" +} + +# Form + +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) + + {type:text,nospell,optional + {section "[_ lorsm.lt_AddEdit_Technical_MD__3]"} + {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]"} + } + + {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 + +} -edit_data { + db_dml do_update " + update ims_md_technical_location + set type = :type, + 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)" + +} -after_submit { + ad_returnredirect [export_vars -base "../technicalmd" {ims_md_id}] + ad_script_abort +} + +# Technical Location +template::list::create \ + -name d_te_loca \ + -multirow d_te_loca \ + -no_data "[_ lorsm.lt_No_Location_Available]" \ + -html { align right style "width: 100%;" } \ + -elements { + 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_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 +} Index: openacs-4/packages/lors-central/www/md/technicalmd/technical_otr.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/technicalmd/technical_otr.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/technicalmd/technical_otr.adp 17 May 2005 16:21:27 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Technical Metadata Other Platform Requirements

+
+ + + + + + + + + +
Technical Metadata
Other Platform Requirements:
+
+

+ +

Add/Edit Technical Metadata Other Platform Requirements

+
+ +
Index: openacs-4/packages/lors-central/www/md/technicalmd/technical_otr.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/technicalmd/technical_otr.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/technicalmd/technical_otr.tcl 17 May 2005 16:21:27 -0000 1.1 @@ -0,0 +1,88 @@ +# 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 + @cvs-id $Id: technical_otr.tcl,v 1.1 2005/05/17 16:21:27 miguelm Exp $ + +} { + ims_md_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_AddEdit_Technical_MD__4]" + +# Form + +ad_form -name technicalmd_otr \ + -cancel_url ../technicalmd?ims_md_id=$ims_md_id \ + -mode edit \ + -form { + + {otr_plt_l:text,nospell + {section "[_ lorsm.lt_AddEdit_Technical_MD__4]"} + {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]"} + } + {ims_md_id:text(hidden) {value $ims_md_id}} + +} -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}]} { + + 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 +} + +# 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]" + } + } + +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 +} Index: openacs-4/packages/lors-central/www/md/technicalmd/technical_req.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/technicalmd/technical_req.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/technicalmd/technical_req.adp 17 May 2005 16:21:27 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

List of Technical Metadata Requirements

+
+ + + + + + + + + +
Technical Metadata
Requirements:
+
+

+ +

Add/Edit Technical Metadata Requirement

+
+ +
Index: openacs-4/packages/lors-central/www/md/technicalmd/technical_req.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/technicalmd/technical_req.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/technicalmd/technical_req.tcl 17 May 2005 16:21:27 -0000 1.1 @@ -0,0 +1,139 @@ +# 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 + @cvs-id $Id: technical_req.tcl,v 1.1 2005/05/17 16:21:27 miguelm Exp $ + +} { + ims_md_id:integer + ims_md_te_rq_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# 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 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 title "[_ lorsm.lt_Add_Technical_MD_Requ]" +} + +# Form + +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) + + {type_s:text,nospell + {section "[_ lorsm.lt_AddEdit_Technical_MD__5]"} + {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]"} + } + + {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]"} + } + + {max_version:text,nospell + {html {size 10}} + {help_text "[_ lorsm.lt_Highest_version_of_th]"} + {label "[_ lorsm.Maximum_Version]"} + } + + {ims_md_id:text(hidden) {value $ims_md_id} + } + +} -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}] + ad_script_abort +} + +# Technical Requirements +template::list::create \ + -name d_te_req \ + -multirow d_te_req \ + -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]" + } + export { + display_eval {\[Edit\]} + 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 +} + Index: openacs-4/packages/lors-central/www/md/technicalmd/technical_size.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/technicalmd/technical_size.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/technicalmd/technical_size.adp 17 May 2005 16:21:27 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

Technical Metadata Size

+
+ + + + + + + + + +
Technical Metadata
Size:
+
+

+ +

Add/Edit Technical Metadata Size

+
+ +
Index: openacs-4/packages/lors-central/www/md/technicalmd/technical_size.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/md/technicalmd/technical_size.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/md/technicalmd/technical_size.tcl 17 May 2005 16:21:27 -0000 1.1 @@ -0,0 +1,86 @@ +# 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 + @cvs-id $Id: technical_size.tcl,v 1.1 2005/05/17 16:21:27 miguelm Exp $ + +} { + ims_md_id:integer +} -properties { +} -validate { +} -errors { +} + +# 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 title "[_ lorsm.lt_AddEdit_Technical_MD__6]" + +# Form + +ad_form -name technicalmd_size \ + -cancel_url ../technicalmd?ims_md_id=$ims_md_id \ + -mode edit \ + -form { + + {t_size:text,nospell + {section "[_ lorsm.lt_AddEdit_Technical_MD__6]"} + {html {size 30}} + {help_text "[_ lorsm.lt_Size_of_the_resource_]"} + {label "[_ lorsm.Size]"} + } + {ims_md_id:text(hidden) {value $ims_md_id}} + +} -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 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 +} + +# 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]" + } + export { + display_eval {\[Edit\]} + link_url_eval { [export_vars -base "technical_size" {ims_md_id}] } + link_html {title "[_ lorsm.Edit_Record]"} + html { align center } + } + } + +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 +} Index: openacs-4/packages/lors-central/www/tracking/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/tracking/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/tracking/index.adp 17 May 2005 16:21:28 -0000 1.1 @@ -0,0 +1,9 @@ + + @title@ + @context@ + +
+

+ +
+ Index: openacs-4/packages/lors-central/www/tracking/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/tracking/index.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lors-central/www/tracking/index.tcl 17 May 2005 16:21:28 -0000 1.1 @@ -0,0 +1,226 @@ +# 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 + @cvs-id $Id: index.tcl,v 1.1 2005/05/17 16:21:28 miguelm Exp $ +} { + man_id:integer,notnull + { lorsm_instance_id "" } + { community_id "" } + {item_id 0} + group:optional +} -properties { +} -validate { +} -errors { +} + +# set package_id [ad_conn package_id] +# set community_id [dotlrn_community::get_community_id] + +if { ![empty_string_p $lorsm_instance_id] } { + set package_id $lorsm_instance_id +} +if { ![empty_string_p $community_id] } { + set community_id $community_id +} + +# set admin_p [dotlrn::user_can_admin_community_p \ + -user_id [ad_conn user_id] \ + -community_id $community_id ] + +# Permissions +# dotlrn::require_user_admin_community -user_id [ad_conn user_id] -community_id $community_id + +set title [list "[_ lorsm.Student_Tracking]"] +set context [list "[_ lorsm.Tracking_1]"] + +if {![exists_and_not_null group]} { + set group 1 +} + +if {$group == 1} { + + template::list::create \ + -name student_track \ + -multirow student_track \ + -actions [list "[_ lorsm.Summarize]" [export_vars -base ".?group=0" {man_id item_id lorsm_instance_id community_id}] "[_ lorsm.lt_Summarize_all_student]"] \ + -key man_id \ + -html {width 50%} \ + -no_data "[_ lorsm.No_Students]" \ + -elements { + student_name { + label "[_ lorsm.Student_Name]" + 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 { + label "[_ lorsm.Start_Course]" + display_eval {[lc_time_fmt $start_time "%x %T"]} + html { align center } + } + end_time { + label "[_ lorsm.Exit_Course]" + display_eval {[lc_time_fmt $end_time "%x %T"]} + html { align center } + } + 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]]} + html { align center } + } + } + + db_multirow -extend { ims_md_id } student_track select_students { + 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 + 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 { + label "[_ lorsm.Viewed_By]" + } + views { + label "[_ lorsm.Total_Views]" + } + last_viewed { + label "[_ lorsm.Last_Viewed_On]" + display_eval {[lc_time_fmt $last_viewed "%x %X"]} + } + } + + if {$item_id} { + set extra_where " and v.object_id in ( select revision_id from cr_revisions where item_id = ( + select item_id from cr_revisions where revision_id = :item_id))" + } else { + set extra_where "" + } + + db_multirow -extend {viewer_name} object_views objects_views " + select v.*, + i.item_title as title + from 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] + } + +} else { + # group display + + template::list::create \ + -name student_track \ + -multirow student_track \ + -key man_id \ + -actions [list "[_ lorsm.Expand]" [export_vars -base ".?group=1" {man_id item_id lorsm_instance_id community_id}] "Expand all students"] \ + -html {width 50%} \ + -no_data "[_ lorsm.No_Students]" \ + -elements { + student_name { + label "Student Name" + 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 { + label "[_ lorsm.Times_Viewed]" + html { align center } + } + 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 + from + lorsm_student_track + where + community_id = :community_id + and + course_id = :man_id + and + end_time NOTNULL + group by user_id + + } { + set ims_md_id $man_id + } + + template::list::create \ + -name object_views \ + -multirow object_views \ + -elements { + title { + label "[_ lorsm.Title_1]" + } + views { + label "[_ lorsm.Total_Views]" + } + unique_views { + label "[_ lorsm.Unique_Views]" + } + 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 + $extra_where + " + +}